The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
build: build new ui
Krrish Dholakia1b7f7ba64350
diff --git a/litellm/proxy/_experimental/mcp_server/db.py b/litellm/proxy/_experimental/mcp_server/db.pyindex b09e5e76014..414f8094c32 100644--- a/litellm/proxy/_experimental/mcp_server/db.py+++ b/litellm/proxy/_experimental/mcp_server/db.py@@ -14,15 +14,15 @@ from litellm.proxy.utils import PrismaClientdef _prepare_mcp_server_data(- data: Union[NewMCPServerRequest, UpdateMCPServerRequest]+ data: Union[NewMCPServerRequest, UpdateMCPServerRequest],) -> Dict[str, Any]:"""Helper function to prepare MCP server data for database operations.Handles JSON field serialization for mcp_info and env fields.-+Args:data: NewMCPServerRequest or UpdateMCPServerRequest object-+Returns:Dict with properly serialized JSON fields"""@@ -31,20 +31,19 @@ def _prepare_mcp_server_data(# Convert model to dictdata_dict = data.model_dump()# Ensure alias is always present in the dict (even if None)- if 'alias' not in data_dict:- data_dict['alias'] = getattr(data, 'alias', None)-+ if "alias" not in data_dict:+ data_dict["alias"] = getattr(data, "alias", None)+# Handle mcp_info serializationif data.mcp_info is not None:data_dict["mcp_info"] = safe_dumps(data.mcp_info)-+# Handle env serializationif data.env is not None:data_dict["env"] = safe_dumps(data.env)-+# mcp_access_groups is already List[str], no serialization needed--+return data_dict@@ -56,7 +55,9 @@ async def get_all_mcp_servers("""mcp_servers = await prisma_client.db.litellm_mcpservertable.find_many()- return mcp_servers+ return [+ LiteLLM_MCPServerTable(**mcp_server.model_dump()) for mcp_server in mcp_servers+ ]async def get_mcp_server(@@ -65,12 +66,12 @@ async def get_mcp_server("""Returns the matching mcp server from the db iff exists"""- mcp_server: Optional[- LiteLLM_MCPServerTable- ] = await prisma_client.db.litellm_mcpservertable.find_unique(- where={- "server_id": server_id,- }+ mcp_server: Optional[LiteLLM_MCPServerTable] = (+ await prisma_client.db.litellm_mcpservertable.find_unique(+ where={+ "server_id": server_id,+ }+ ))return mcp_server@@ -81,12 +82,12 @@ async def get_mcp_servers("""Returns the matching mcp servers from the db with the server_ids"""- mcp_servers: List[- LiteLLM_MCPServerTable- ] = await prisma_client.db.litellm_mcpservertable.find_many(- where={- "server_id": {"in": server_ids},- }+ mcp_servers: List[LiteLLM_MCPServerTable] = (+ await prisma_client.db.litellm_mcpservertable.find_many(+ where={+ "server_id": {"in": server_ids},+ }+ ))return mcp_servers@@ -252,10 +253,10 @@ async def create_mcp_server("""if data.server_id is None:data.server_id = str(uuid.uuid4())-+# Use helper to prepare data with proper JSON serializationdata_dict = _prepare_mcp_server_data(data)-+# Add audit fieldsdata_dict["created_by"] = touched_bydata_dict["updated_by"] = touched_by@@ -275,7 +276,7 @@ async def update_mcp_server("""# Use helper to prepare data with proper JSON serializationdata_dict = _prepare_mcp_server_data(data)-+# Add audit fieldsdata_dict["updated_by"] = touched_bydiff --git a/litellm/proxy/_experimental/out/_next/static/-NrHJ0b9HqrHBQ9wRZS8v/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/-EIomgntDHk-HrU9rbKNY/_buildManifest.jssimilarity index 100%rename from litellm/proxy/_experimental/out/_next/static/-NrHJ0b9HqrHBQ9wRZS8v/_buildManifest.jsrename to litellm/proxy/_experimental/out/_next/static/-EIomgntDHk-HrU9rbKNY/_buildManifest.jsdiff --git a/litellm/proxy/_experimental/out/_next/static/-NrHJ0b9HqrHBQ9wRZS8v/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/-EIomgntDHk-HrU9rbKNY/_ssgManifest.jssimilarity index 100%rename from litellm/proxy/_experimental/out/_next/static/-NrHJ0b9HqrHBQ9wRZS8v/_ssgManifest.jsrename to litellm/proxy/_experimental/out/_next/static/-EIomgntDHk-HrU9rbKNY/_ssgManifest.jsdiff --git a/litellm/proxy/_experimental/out/_next/static/chunks/199-9064d94cb58e5474.js b/litellm/proxy/_experimental/out/_next/static/chunks/199-7d06fdac37bed3ff.jssimilarity index 70%rename from litellm/proxy/_experimental/out/_next/static/chunks/199-9064d94cb58e5474.jsrename to litellm/proxy/_experimental/out/_next/static/chunks/199-7d06fdac37bed3ff.jsindex 570da128591..4cfc11ce022 100644--- a/litellm/proxy/_experimental/out/_next/static/chunks/199-9064d94cb58e5474.js+++ b/litellm/proxy/_experimental/out/_next/static/chunks/199-7d06fdac37bed3ff.js@@ -1,11 +1,11 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199],{12660:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},88009:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},37527:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]},name:"bank",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},9775:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},68208:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83669:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26430:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},5540:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11894:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},44625:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26349:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62670:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},73879:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},29271:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41169:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11741:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},97416:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},6520:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34310:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM472 744a40 40 0 1080 0 40 40 0 10-80 0zm16-104h48c4.4 0 8-3.6 8-8V448c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8z"}}]},name:"file-exclamation",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},38434:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},10798:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71282:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},92403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},48231:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62272:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},45246:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},16601:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},99890:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},28595:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},96473:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},89245:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},69993:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},78355:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},23907:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},55322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},8881:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71891:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41361:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"}}]},name:"team",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58630:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},3632:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},35291:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58747:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}},75105:function(e,t,n){"use strict";n.d(t,{Z:function(){return et}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(87602),s=n(59221),c=n(86757),u=n.n(c),d=n(95645),f=n.n(d),p=n(77571),h=n.n(p),m=n(82559),g=n.n(m),v=n(21652),y=n.n(v),b=n(57165),x=n(81889),w=n(9841),k=n(58772),S=n(34067),E=n(16630),O=n(85355),C=n(82944),j=["layout","type","stroke","connectNulls","isRange","ref"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(i,e);var t,n,r,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=R(i);return e=t?Reflect.construct(n,arguments,R(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return I(e)}(this,e)});function i(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return D(I(e=a.call.apply(a,[this].concat(n))),"state",{isAnimationFinished:!0}),D(I(e),"id",(0,E.EL)("recharts-area-")),D(I(e),"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),u()(t)&&t()}),D(I(e),"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),u()(t)&&t()}),e}return n=[{key:"renderDots",value:function(e,t,n){var r=this.props.isAnimationActive,a=this.state.isAnimationFinished;if(r&&!a)return null;var l=this.props,s=l.dot,c=l.points,u=l.dataKey,d=(0,C.L6)(this.props,!1),f=(0,C.L6)(s,!0),p=c.map(function(e,t){var n=T(T(T({key:"dot-".concat(t),r:3},d),f),{},{dataKey:u,cx:e.x,cy:e.y,index:t,value:e.value,payload:e.payload});return i.renderDotItem(s,n)}),h={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return o.createElement(w.m,P({className:"recharts-area-dots"},h),p)}},{key:"renderHorizontalRect",value:function(e){var t=this.props,n=t.baseLine,r=t.points,a=t.strokeWidth,i=r[0].x,l=r[r.length-1].x,s=e*Math.abs(i-l),c=f()(r.map(function(e){return e.y||0}));return((0,E.hj)(n)&&"number"==typeof n?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(f()(n.map(function(e){return e.y||0})),c)),(0,E.hj)(c))?o.createElement("rect",{x:i<l?i:i-s,y:0,width:s,height:Math.floor(c+(a?parseInt("".concat(a),10):1))}):null}},{key:"renderVerticalRect",value:function(e){var t=this.props,n=t.baseLine,r=t.points,a=t.strokeWidth,i=r[0].y,l=r[r.length-1].y,s=e*Math.abs(i-l),c=f()(r.map(function(e){return e.x||0}));return((0,E.hj)(n)&&"number"==typeof n?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(f()(n.map(function(e){return e.x||0})),c)),(0,E.hj)(c))?o.createElement("rect",{x:0,y:i<l?i:i-s,width:c+(a?parseInt("".concat(a),10):1),height:Math.floor(s)}):null}},{key:"renderClipRect",value:function(e){return"vertical"===this.props.layout?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:"renderAreaStatically",value:function(e,t,n,r){var a=this.props,i=a.layout,l=a.type,s=a.stroke,c=a.connectNulls,u=a.isRange,d=(a.ref,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,j));return o.createElement(w.m,{clipPath:n?"url(#clipPath-".concat(r,")"):null},o.createElement(b.H,P({},(0,C.L6)(d,!0),{points:e,connectNulls:c,type:l,baseLine:t,layout:i,stroke:"none",className:"recharts-area-area"})),"none"!==s&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:e})),"none"!==s&&u&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var n=this,r=this.props,a=r.points,i=r.baseLine,l=r.isAnimationActive,c=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationId,p=this.state,m=p.prevPoints,v=p.prevBaseLine;return o.createElement(s.ZP,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"area-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var l=r.t;if(m){var s,c=m.length/a.length,u=a.map(function(e,t){var n=Math.floor(t*c);if(m[n]){var r=m[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e});return s=(0,E.hj)(i)&&"number"==typeof i?(0,E.k4)(v,i)(l):h()(i)||g()(i)?(0,E.k4)(v,0)(l):i.map(function(e,t){var n=Math.floor(t*c);if(v[n]){var r=v[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e}),n.renderAreaStatically(u,s,e,t)}return o.createElement(w.m,null,o.createElement("defs",null,o.createElement("clipPath",{id:"animationClipPath-".concat(t)},n.renderClipRect(l))),o.createElement(w.m,{clipPath:"url(#animationClipPath-".concat(t,")")},n.renderAreaStatically(a,i,e,t)))})}},{key:"renderArea",value:function(e,t){var n=this.props,r=n.points,o=n.baseLine,a=n.isAnimationActive,i=this.state,l=i.prevPoints,s=i.prevBaseLine,c=i.totalLength;return a&&r&&r.length&&(!l&&c>0||!y()(l,r)||!y()(s,o))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,o,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,a=t.points,i=t.className,s=t.top,c=t.left,u=t.xAxis,d=t.yAxis,f=t.width,p=t.height,m=t.isAnimationActive,g=t.id;if(n||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=1===a.length,b=(0,l.Z)("recharts-area",i),x=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,E=x||S,O=h()(g)?this.id:g,j=null!==(e=(0,C.L6)(r,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,C.$k)(r)?r:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return o.createElement(w.m,{className:b},x||S?o.createElement("defs",null,o.createElement("clipPath",{id:"clipPath-".concat(O)},o.createElement("rect",{x:x?c:c-f/2,y:S?s:s-p/2,width:x?f:2*f,height:S?p:2*p})),!T&&o.createElement("clipPath",{id:"clipPath-dots-".concat(O)},o.createElement("rect",{x:c-A/2,y:s-A/2,width:f+A,height:p+A}))):null,y?null:this.renderArea(E,O),(r||y)&&this.renderDots(E,T,O),(!m||v)&&k.e.renderCallByParent(this.props,a))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],n&&A(i.prototype,n),r&&A(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}(o.PureComponent);D(Z,"displayName","Area"),D(Z,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!S.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),D(Z,"getBaseValue",function(e,t,n,r){var o=e.layout,a=e.baseValue,i=t.props.baseValue,l=null!=i?i:a;if((0,E.hj)(l)&&"number"==typeof l)return l;var s="horizontal"===o?r:n,c=s.scale.domain();if("number"===s.type){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return"dataMin"===l?d:"dataMax"===l?u:u<0?u:Math.max(Math.min(c[0],c[1]),0)}return"dataMin"===l?c[0]:"dataMax"===l?c[1]:c[0]}),D(Z,"getComposedData",function(e){var t,n=e.props,r=e.item,o=e.xAxis,a=e.yAxis,i=e.xAxisTicks,l=e.yAxisTicks,s=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,p=e.offset,h=n.layout,m=u&&u.length,g=Z.getBaseValue(n,r,o,a),v="horizontal"===h,y=!1,b=f.map(function(e,t){m?n=u[d+t]:Array.isArray(n=(0,O.F$)(e,c))?y=!0:n=[g,n];var n,r=null==n[1]||m&&null==(0,O.F$)(e,c);return v?{x:(0,O.Hv)({axis:o,ticks:i,bandSize:s,entry:e,index:t}),y:r?null:a.scale(n[1]),value:n,payload:e}:{x:r?null:o.scale(n[1]),y:(0,O.Hv)({axis:a,ticks:l,bandSize:s,entry:e,index:t}),value:n,payload:e}});return t=m||y?b.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?a.scale(t):null}:{x:null!=t?o.scale(t):null,y:e.y}}):v?a.scale(g):o.scale(g),T({points:b,baseLine:t,layout:h,isRange:y},p)}),D(Z,"renderDotItem",function(e,t){return o.isValidElement(e)?o.cloneElement(e,t):u()(e)?e(t):o.createElement(x.o,P({},t,{className:"recharts-area-dot"}))});var z=n(97059),B=n(62994),F=n(25311),H=(0,i.z)({chartName:"AreaChart",GraphicalChild:Z,axisComponents:[{axisType:"xAxis",AxisComp:z.K},{axisType:"yAxis",AxisComp:B.B}],formatAxisMap:F.t9}),q=n(56940),W=n(8147),U=n(22190),K=n(54061),$=n(65278),V=n(98593),X=n(69448),G=n(32644),Y=n(7084),Q=n(26898),J=n(97324),ee=n(1153);let et=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:l,stack:s=!1,colors:c=Q.s,valueFormatter:u=ee.Cj,startEndOnly:d=!1,showXAxis:f=!0,showYAxis:p=!0,yAxisWidth:h=56,intervalType:m="equidistantPreserveStart",showAnimation:g=!1,animationDuration:v=900,showTooltip:y=!0,showLegend:b=!0,showGridLines:w=!0,showGradient:k=!0,autoMinValue:S=!1,curveType:E="linear",minValue:O,maxValue:C,connectNulls:j=!1,allowDecimals:_=!0,noDataText:P,className:N,onValueChange:T,enableLegendSlider:A=!1,customTooltip:M,rotateLabelX:I,tickGap:R=5}=e,D=(0,r._T)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),L=(f||p)&&(!d||p)?20:0,[F,et]=(0,o.useState)(60),[en,er]=(0,o.useState)(void 0),[eo,ea]=(0,o.useState)(void 0),ei=(0,G.me)(i,c),el=(0,G.i4)(S,O,C),es=!!T;function ec(e){es&&(e===eo&&!en||(0,G.FB)(n,e)&&en&&en.dataKey===e?(ea(void 0),null==T||T(null)):(ea(e),null==T||T({eventType:"category",categoryClicked:e})),er(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,J.q)("w-full h-80",N)},D),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(H,{data:n,onClick:es&&(eo||en)?()=>{er(void 0),ea(void 0),null==T||T(null)}:void 0},w?o.createElement(q.q,{className:(0,J.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(z.K,{padding:{left:L,right:L},hide:!f,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:d?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:d?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:R,angle:null==I?void 0:I.angle,dy:null==I?void 0:I.verticalShift,height:null==I?void 0:I.xAxisHeight}),o.createElement(B.B,{width:h,hide:!p,axisLine:!1,tickLine:!1,type:"number",domain:el,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:_}),o.createElement(W.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:y?e=>{let{active:t,payload:n,label:r}=e;return M?o.createElement(M,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:Y.fr.Gray})}),active:t,label:r}):o.createElement(V.ZP,{active:t,payload:n,label:r,valueFormatter:u,categoryColors:ei})}:o.createElement(o.Fragment,null),position:{y:0}}),b?o.createElement(U.D,{verticalAlign:"top",height:F,content:e=>{let{payload:t}=e;return(0,$.Z)({payload:t},ei,et,eo,es?e=>ec(e):void 0,A)}}):null,i.map(e=>{var t,n;return o.createElement("defs",{key:e},k?o.createElement("linearGradient",{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.15:.4}),o.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):o.createElement("linearGradient",{className:(0,ee.bM)(null!==(n=ei.get(e))&&void 0!==n?n:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.1:.3})))}),i.map(e=>{var t;return o.createElement(Z,{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).strokeColor,strokeOpacity:en||eo&&eo!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(x.o,{className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(t=ei.get(u))&&void 0!==t?t:Y.fr.Gray,Q.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),es&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,G.FB)(n,e.dataKey)&&eo&&eo===e.dataKey?(ea(void 0),er(void 0),null==T||T(null)):(ea(e.dataKey),er({index:e.index,dataKey:e.dataKey}),null==T||T(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,G.FB)(n,e)&&!(en||eo&&eo!==e)||(null==en?void 0:en.index)===f&&(null==en?void 0:en.dataKey)===e?o.createElement(x.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(r=ei.get(d))&&void 0!==r?r:Y.fr.Gray,Q.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:E,dataKey:e,stroke:"",fill:"url(#".concat(ei.get(e),")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:g,animationDuration:v,stackId:s?"a":void 0,connectNulls:j})}),T?i.map(e=>o.createElement(K.x,{className:(0,J.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:E,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:j,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ec(n)}})):null):o.createElement(X.Z,{noDataText:P})))});et.displayName="AreaChart"},40278:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(47625),u=n(93765),d=n(31699),f=n(97059),p=n(62994),h=n(25311),m=(0,u.z)({chartName:"BarChart",GraphicalChild:d.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:f.K},{axisType:"yAxis",AxisComp:p.B}],formatAxisMap:h.t9}),g=n(56940),v=n(8147),y=n(22190),b=n(65278),x=n(98593),w=n(69448),k=n(32644);let S=s.forwardRef((e,t)=>{let{data:n=[],categories:u=[],index:h,colors:S=a.s,valueFormatter:E=l.Cj,layout:O="horizontal",stack:C=!1,relative:j=!1,startEndOnly:_=!1,animationDuration:P=900,showAnimation:N=!1,showXAxis:T=!0,showYAxis:A=!0,yAxisWidth:M=56,intervalType:I="equidistantPreserveStart",showTooltip:R=!0,showLegend:D=!0,showGridLines:L=!0,autoMinValue:Z=!1,minValue:z,maxValue:B,allowDecimals:F=!0,noDataText:H,onValueChange:q,enableLegendSlider:W=!1,customTooltip:U,rotateLabelX:K,tickGap:$=5,className:V}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),G=T||A?20:0,[Y,Q]=(0,s.useState)(60),J=(0,k.me)(u,S),[ee,et]=s.useState(void 0),[en,er]=(0,s.useState)(void 0),eo=!!q;function ea(e,t,n){var r,o,a,i;n.stopPropagation(),q&&((0,k.vZ)(ee,Object.assign(Object.assign({},e.payload),{value:e.value}))?(er(void 0),et(void 0),null==q||q(null)):(er(null===(o=null===(r=e.tooltipPayload)||void 0===r?void 0:r[0])||void 0===o?void 0:o.dataKey),et(Object.assign(Object.assign({},e.payload),{value:e.value})),null==q||q(Object.assign({eventType:"bar",categoryClicked:null===(i=null===(a=e.tooltipPayload)||void 0===a?void 0:a[0])||void 0===i?void 0:i.dataKey},e.payload))))}let ei=(0,k.i4)(Z,z,B);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-80",V)},X),s.createElement(c.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(m,{data:n,stackOffset:C?"sign":j?"expand":"none",layout:"vertical"===O?"vertical":"horizontal",onClick:eo&&(en||ee)?()=>{et(void 0),er(void 0),null==q||q(null)}:void 0},L?s.createElement(g.q,{className:(0,i.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==O,vertical:"vertical"===O}):null,"vertical"!==O?s.createElement(f.K,{padding:{left:G,right:G},hide:!T,dataKey:h,interval:_?"preserveStartEnd":I,tick:{transform:"translate(0, 6)"},ticks:_?[n[0][h],n[n.length-1][h]]:void 0,fill:"",stroke:"",className:(0,i.q)("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight,minTickGap:$}):s.createElement(f.K,{hide:!T,type:"number",tick:{transform:"translate(-3, 0)"},domain:ei,fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:E,minTickGap:$,allowDecimals:F,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight}),"vertical"!==O?s.createElement(p.B,{width:M,hide:!A,axisLine:!1,tickLine:!1,type:"number",domain:ei,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:j?e=>"".concat((100*e).toString()," %"):E,allowDecimals:F}):s.createElement(p.B,{width:M,hide:!A,dataKey:h,axisLine:!1,tickLine:!1,ticks:_?[n[0][h],n[n.length-1][h]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),s.createElement(v.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:R?e=>{let{active:t,payload:n,label:r}=e;return U?s.createElement(U,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=J.get(e.dataKey))&&void 0!==t?t:o.fr.Gray})}),active:t,label:r}):s.createElement(x.ZP,{active:t,payload:n,label:r,valueFormatter:E,categoryColors:J})}:s.createElement(s.Fragment,null),position:{y:0}}),D?s.createElement(y.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,b.Z)({payload:t},J,Q,en,eo?e=>{eo&&(e!==en||ee?(er(e),null==q||q({eventType:"category",categoryClicked:e})):(er(void 0),null==q||q(null)),et(void 0))}:void 0,W)}}):null,u.map(e=>{var t;return s.createElement(d.$,{className:(0,i.q)((0,l.bM)(null!==(t=J.get(e))&&void 0!==t?t:o.fr.Gray,a.K.background).fillColor,q?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:C||j?"a":void 0,dataKey:e,fill:"",isAnimationActive:N,animationDuration:P,shape:e=>((e,t,n,r)=>{let{fillOpacity:o,name:a,payload:i,value:l}=e,{x:c,width:u,y:d,height:f}=e;return"horizontal"===r&&f<0?(d+=f,f=Math.abs(f)):"vertical"===r&&u<0&&(c+=u,u=Math.abs(u)),s.createElement("rect",{x:c,y:d,width:u,height:f,opacity:t||n&&n!==a?(0,k.vZ)(t,Object.assign(Object.assign({},i),{value:l}))?o:.3:o})})(e,ee,en,O),onClick:ea})})):s.createElement(w.Z,{noDataText:H})))});S.displayName="BarChart"},14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return ez}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(60474),u=n(47625),d=n(93765),f=n(86757),p=n.n(f),h=n(9841),m=n(81889),g=n(87602),v=n(82944),y=["points","className","baseLinePoints","connectNulls"];function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return w(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var k=function(e){return e&&e.x===+e.x&&e.y===+e.y},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){k(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),k(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},E=function(e,t){var n=S(e);t&&(n=[n.reduce(function(e,t){return[].concat(x(e),x(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},O=function(e,t,n){var r=E(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(E(t.reverse(),n).slice(1))},C=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,y);if(!t||!t.length)return null;var i=(0,g.Z)("recharts-polygon",n);if(r&&r.length){var l=a.stroke&&"none"!==a.stroke,c=O(t,r,o);return s.createElement("g",{className:i},s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===c.slice(-1)?a.fill:"none",stroke:"none",d:c})),l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(t,o)})):null,l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(r,o)})):null)}var u=E(t,o);return s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===u.slice(-1)?a.fill:"none",className:i,d:u}))},j=n(58811),_=n(41637),P=n(39206);function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(){return(T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(t){L(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z(r.key),r)}}function R(e,t){return(R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t,n){return(t=Z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){var t=function(e,t){if("object"!==N(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==N(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===N(t)?t:String(t)}var z=Math.PI/180,B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=D(a);return e=t?Reflect.construct(n,arguments,D(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===N(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"getTickLineCoord",value:function(e){var t=this.props,n=t.cx,r=t.cy,o=t.radius,a=t.orientation,i=t.tickSize,l=(0,P.op)(n,r,o,e.coordinate),s=(0,P.op)(n,r,o+("inner"===a?-1:1)*(i||8),e.coordinate);return{x1:l.x,y1:l.y,x2:s.x,y2:s.y}}},{key:"getTickTextAnchor",value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*z);return n>1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,a=e.axisLineType,i=M(M({},(0,v.L6)(this.props,!1)),{},{fill:"none"},(0,v.L6)(o,!1));if("circle"===a)return s.createElement(m.o,T({className:"recharts-polar-angle-axis-line"},i,{cx:t,cy:n,r:r}));var l=this.props.ticks.map(function(e){return(0,P.op)(t,n,r,e.coordinate)});return s.createElement(C,T({className:"recharts-polar-angle-axis-line"},i,{points:l}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,i=t.tickFormatter,l=t.stroke,c=(0,v.L6)(this.props,!1),u=(0,v.L6)(r,!1),d=M(M({},c),{},{fill:"none"},(0,v.L6)(o,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),p=M(M(M({textAnchor:e.getTickTextAnchor(t)},c),{},{stroke:"none",fill:l},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return s.createElement(h.m,T({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),o&&s.createElement("line",T({className:"recharts-polar-angle-axis-tick-line"},d,f)),r&&a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?s.createElement(h.m,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,T({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],n&&I(a.prototype,n),r&&I(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);L(B,"displayName","PolarAngleAxis"),L(B,"axisType","angleAxis"),L(B,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var F=n(35802),H=n.n(F),q=n(37891),W=n.n(q),U=n(26680),K=["cx","cy","angle","ticks","axisLine"],$=["ticks","tick","angle","tickFormatter","stroke"];function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(){return(X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach(function(t){en(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,er(r.key),r)}}function ee(e,t){return(ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function et(e){return(et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function en(e,t,n){return(t=er(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(e){var t=function(e,t){if("object"!==V(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==V(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===V(t)?t:String(t)}var eo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=et(a);return e=t?Reflect.construct(n,arguments,et(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===V(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"getTickValueCoord",value:function(e){var t=e.coordinate,n=this.props,r=n.angle,o=n.cx,a=n.cy;return(0,P.op)(o,a,t,r)}},{key:"getTickTextAnchor",value:function(){var e;switch(this.props.orientation){case"left":e="end";break;case"right":e="start";break;default:e="middle"}return e}},{key:"getViewBox",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,o=e.ticks,a=H()(o,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:W()(o,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,o=e.ticks,a=e.axisLine,i=Q(e,K),l=o.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=(0,P.op)(t,n,l[0],r),u=(0,P.op)(t,n,l[1],r),d=Y(Y(Y({},(0,v.L6)(i,!1)),{},{fill:"none"},(0,v.L6)(a,!1)),{},{x1:c.x,y1:c.y,x2:u.x,y2:u.y});return s.createElement("line",X({className:"recharts-polar-radius-axis-line"},d))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.angle,i=t.tickFormatter,l=t.stroke,c=Q(t,$),u=this.getTickTextAnchor(),d=(0,v.L6)(c,!1),f=(0,v.L6)(r,!1),p=n.map(function(t,n){var c=e.getTickValueCoord(t),p=Y(Y(Y(Y({textAnchor:u,transform:"rotate(".concat(90-o,", ").concat(c.x,", ").concat(c.y,")")},d),{},{stroke:"none",fill:l},f),{},{index:n},c),{},{payload:t});return s.createElement(h.m,X({className:"recharts-polar-radius-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return t&&t.length?s.createElement(h.m,{className:"recharts-polar-radius-axis"},n&&this.renderAxisLine(),r&&this.renderTicks(),U._.renderCallByParent(this.props,this.getViewBox())):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,X({},t,{className:"recharts-polar-radius-axis-tick-value"}),n)}}],n&&J(a.prototype,n),r&&J(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);en(eo,"displayName","PolarRadiusAxis"),en(eo,"axisType","radiusAxis"),en(eo,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});var ea=n(59221),ei=n(13735),el=n.n(ei),es=n(21652),ec=n.n(es),eu=n(77571),ed=n.n(eu),ef=n(57165),ep=n(58772),eh=n(20407),em=n(34067),eg=n(16630),ev=n(85355),ey=n(1175),eb=n(11638);function ex(e){return(ex="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(){return(ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(t){e_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eP(r.key),r)}}function eO(e,t){return(eO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eC(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ej(e){return(ej=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e_(e,t,n){return(t=eP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eP(e){var t=function(e,t){if("object"!==ex(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ex(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ex(t)?t:String(t)}var eN=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eO(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=ej(a);return e=t?Reflect.construct(n,arguments,ej(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===ex(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eC(e)}(this,e)});function a(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),e_(eC(t=o.call(this,e)),"pieRef",null),e_(eC(t),"sectorRefs",[]),e_(eC(t),"id",(0,eg.EL)("recharts-pie-")),e_(eC(t),"handleAnimationEnd",function(){var e=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),p()(e)&&e()}),e_(eC(t),"handleAnimationStart",function(){var e=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),p()(e)&&e()}),t.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},t}return n=[{key:"isActiveIndex",value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?-1!==t.indexOf(e):e===t}},{key:"hasActiveIndex",value:function(){var e=this.props.activeIndex;return Array.isArray(e)?0!==e.length:e||0===e}},{key:"renderLabels",value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var t=this.props,n=t.label,r=t.labelLine,o=t.dataKey,i=t.valueKey,l=(0,v.L6)(this.props,!1),c=(0,v.L6)(n,!1),u=(0,v.L6)(r,!1),d=n&&n.offsetRadius||20,f=e.map(function(e,t){var f=(e.startAngle+e.endAngle)/2,p=(0,P.op)(e.cx,e.cy,e.outerRadius+d,f),m=eS(eS(eS(eS({},l),e),{},{stroke:"none"},c),{},{index:t,textAnchor:a.getTextAnchor(p.x,e.cx)},p),g=eS(eS(eS(eS({},l),e),{},{fill:"none",stroke:e.fill},u),{},{index:t,points:[(0,P.op)(e.cx,e.cy,e.outerRadius,f),p],key:"line"}),v=o;return ed()(o)&&ed()(i)?v="value":ed()(o)&&(v=i),s.createElement(h.m,{key:"label-".concat(e.startAngle,"-").concat(e.endAngle)},r&&a.renderLabelLineItem(r,g),a.renderLabelItem(n,m,(0,ev.F$)(e,v)))});return s.createElement(h.m,{className:"recharts-pie-labels"},f)}},{key:"renderSectorsStatically",value:function(e){var t=this,n=this.props,r=n.activeShape,o=n.blendStroke,a=n.inactiveShape;return e.map(function(n,i){if((null==n?void 0:n.startAngle)===0&&(null==n?void 0:n.endAngle)===0&&1!==e.length)return null;var l=t.isActiveIndex(i),c=a&&t.hasActiveIndex()?a:null,u=eS(eS({},n),{},{stroke:o?n.fill:n.stroke,tabIndex:-1});return s.createElement(h.m,ew({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:"recharts-pie-sector"},(0,_.bw)(t.props,n,i),{key:"sector-".concat(null==n?void 0:n.startAngle,"-").concat(null==n?void 0:n.endAngle,"-").concat(n.midAngle)}),s.createElement(eb.bn,ew({option:l?r:c,isActive:l,shapeType:"sector"},u)))})}},{key:"renderSectorsWithAnimation",value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,i=t.animationEasing,l=t.animationId,c=this.state,u=c.prevSectors,d=c.prevIsAnimationActive;return s.createElement(ea.ZP,{begin:o,duration:a,isActive:r,easing:i,from:{t:0},to:{t:1},key:"pie-".concat(l,"-").concat(d),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,o=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=u&&u[t],i=t>0?el()(e,"paddingAngle",0):0;if(n){var l=(0,eg.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),s=eS(eS({},e),{},{startAngle:a+i,endAngle:a+l(r)+i});o.push(s),a=s.endAngle}else{var c=e.endAngle,d=e.startAngle,f=(0,eg.k4)(0,c-d)(r),p=eS(eS({},e),{},{startAngle:a+i,endAngle:a+f+i});o.push(p),a=p.endAngle}}),s.createElement(h.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!ec()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,a=t.label,i=t.cx,l=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eg.hj)(i)||!(0,eg.hj)(l)||!(0,eg.hj)(c)||!(0,eg.hj)(u))return null;var p=(0,g.Z)("recharts-pie",o);return s.createElement(h.m,{tabIndex:this.props.rootTabIndex,className:p,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),U._.renderCallByParent(this.props,null,!1),(!d||f)&&ep.e.renderCallByParent(this.props,r,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e<t?"end":"middle"}},{key:"renderLabelLineItem",value:function(e,t){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(ef.H,ew({},t,{type:"linear",className:"recharts-pie-label-line"}))}},{key:"renderLabelItem",value:function(e,t,n){if(s.isValidElement(e))return s.cloneElement(e,t);var r=n;return p()(e)&&(r=e(t),s.isValidElement(r))?r:s.createElement(j.x,ew({},t,{alignmentBaseline:"middle",className:"recharts-pie-label-text"}),r)}}],n&&eE(a.prototype,n),r&&eE(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);e_(eN,"displayName","Pie"),e_(eN,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!em.x.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0}),e_(eN,"parseDeltaAngle",function(e,t){return(0,eg.uY)(t-e)*Math.min(Math.abs(t-e),360)}),e_(eN,"getRealPieData",function(e){var t=e.props,n=t.data,r=t.children,o=(0,v.L6)(e.props,!1),a=(0,v.NN)(r,eh.b);return n&&n.length?n.map(function(e,t){return eS(eS(eS({payload:e},o),e),a&&a[t]&&a[t].props)}):a&&a.length?a.map(function(e){return eS(eS({},o),e.props)}):[]}),e_(eN,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,o=t.width,a=t.height,i=(0,P.$4)(o,a);return{cx:r+(0,eg.h1)(e.props.cx,o,o/2),cy:n+(0,eg.h1)(e.props.cy,a,a/2),innerRadius:(0,eg.h1)(e.props.innerRadius,i,0),outerRadius:(0,eg.h1)(e.props.outerRadius,i,.8*i),maxRadius:e.props.maxRadius||Math.sqrt(o*o+a*a)/2}}),e_(eN,"getComposedData",function(e){var t,n,r=e.item,o=e.offset,a=eN.getRealPieData(r);if(!a||!a.length)return null;var i=r.props,l=i.cornerRadius,s=i.startAngle,c=i.endAngle,u=i.paddingAngle,d=i.dataKey,f=i.nameKey,p=i.valueKey,h=i.tooltipType,m=Math.abs(r.props.minAngle),g=eN.parseCoordinateOfPie(r,o),v=eN.parseDeltaAngle(s,c),y=Math.abs(v),b=d;ed()(d)&&ed()(p)?((0,ey.Z)(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b="value"):ed()(d)&&((0,ey.Z)(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b=p);var x=a.filter(function(e){return 0!==(0,ev.F$)(e,b,0)}).length,w=y-x*m-(y>=360?x:x-1)*u,k=a.reduce(function(e,t){var n=(0,ev.F$)(t,b,0);return e+((0,eg.hj)(n)?n:0)},0);return k>0&&(t=a.map(function(e,t){var r,o=(0,ev.F$)(e,b,0),a=(0,ev.F$)(e,f,t),i=((0,eg.hj)(o)?o:0)/k,c=(r=t?n.endAngle+(0,eg.uY)(v)*u*(0!==o?1:0):s)+(0,eg.uY)(v)*((0!==o?m:0)+i*w),d=(r+c)/2,p=(g.innerRadius+g.outerRadius)/2,y=[{name:a,value:o,payload:e,dataKey:b,type:h}],x=(0,P.op)(g.cx,g.cy,p,d);return n=eS(eS(eS({percent:i,cornerRadius:l,name:a,tooltipPayload:y,midAngle:d,middleRadius:p,tooltipPosition:x},e),g),{},{value:(0,ev.F$)(e,b),startAngle:r,endAngle:c,payload:e,paddingAngle:(0,eg.uY)(v)*u})})),eS(eS({},g),{},{sectors:t,data:a})});var eT=(0,d.z)({chartName:"PieChart",GraphicalChild:eN,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:B},{axisType:"radiusAxis",AxisComp:eo}],formatAxisMap:P.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eA=n(8147),eM=n(69448),eI=n(98593);let eR=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return s.createElement(eI.$B,null,s.createElement("div",{className:(0,i.q)("px-4 py-2")},s.createElement(eI.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eD=(e,t)=>e.map((e,n)=>{let r=n<t.length?t[n]:o.fr.Gray;return Object.assign(Object.assign({},e),{color:r,className:(0,l.bM)(null!=r?r:o.fr.Gray,a.K.background).fillColor,fill:""})}),eL=(e,t,n,r)=>e||t((0,l.vP)(n.map(e=>e[r]))),eZ=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l}=e;return s.createElement("g",null,s.createElement(c.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l,fill:"",opacity:.3,style:{outline:"none"}}))},ez=s.forwardRef((e,t)=>{let{data:n=[],category:c="value",index:d="name",colors:f=a.s,variant:p="donut",valueFormatter:h=l.Cj,label:m,showLabel:g=!0,animationDuration:v=900,showAnimation:y=!1,showTooltip:b=!0,noDataText:x,onValueChange:w,customTooltip:k,className:S}=e,E=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),O="donut"==p,C=eL(m,h,n,c),[j,_]=s.useState(void 0),P=!!w;return(0,s.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[j]),s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-40",S)},E),s.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(eT,{onClick:P&&j?()=>{_(void 0),null==w||w(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},g&&O?s.createElement("text",{className:(0,i.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},C):null,s.createElement(eN,{className:(0,i.q)("stroke-tremor-background dark:stroke-dark-tremor-background",w?"cursor-pointer":"cursor-default"),data:eD(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:O?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:c,nameKey:d,isAnimationActive:y,animationDuration:v,onClick:function(e,t,n){n.stopPropagation(),P&&(j===t?(_(void 0),null==w||w(null)):(_(t),null==w||w(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:j,inactiveShape:eZ,style:{outline:"none"}}),s.createElement(eA.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:b?e=>{var t;let{active:n,payload:r}=e;return k?s.createElement(k,{payload:null==r?void 0:r.map(e=>{var t,n,a;return Object.assign(Object.assign({},e),{color:null!==(a=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==a?a:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):s.createElement(eR,{active:n,payload:r,valueFormatter:h})}:s.createElement(s.Fragment,null)})):s.createElement(eM.Z,{noDataText:x})))});ez.displayName="DonutChart"},59664:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(54061),s=n(97059),c=n(62994),u=n(25311),d=(0,i.z)({chartName:"LineChart",GraphicalChild:l.x,axisComponents:[{axisType:"xAxis",AxisComp:s.K},{axisType:"yAxis",AxisComp:c.B}],formatAxisMap:u.t9}),f=n(56940),p=n(8147),h=n(22190),m=n(81889),g=n(65278),v=n(98593),y=n(69448),b=n(32644),x=n(7084),w=n(26898),k=n(97324),S=n(1153);let E=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:u,colors:E=w.s,valueFormatter:O=S.Cj,startEndOnly:C=!1,showXAxis:j=!0,showYAxis:_=!0,yAxisWidth:P=56,intervalType:N="equidistantPreserveStart",animationDuration:T=900,showAnimation:A=!1,showTooltip:M=!0,showLegend:I=!0,showGridLines:R=!0,autoMinValue:D=!1,curveType:L="linear",minValue:Z,maxValue:z,connectNulls:B=!1,allowDecimals:F=!0,noDataText:H,className:q,onValueChange:W,enableLegendSlider:U=!1,customTooltip:K,rotateLabelX:$,tickGap:V=5}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),G=j||_?20:0,[Y,Q]=(0,o.useState)(60),[J,ee]=(0,o.useState)(void 0),[et,en]=(0,o.useState)(void 0),er=(0,b.me)(i,E),eo=(0,b.i4)(D,Z,z),ea=!!W;function ei(e){ea&&(e===et&&!J||(0,b.FB)(n,e)&&J&&J.dataKey===e?(en(void 0),null==W||W(null)):(en(e),null==W||W({eventType:"category",categoryClicked:e})),ee(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,k.q)("w-full h-80",q)},X),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(d,{data:n,onClick:ea&&(et||J)?()=>{ee(void 0),en(void 0),null==W||W(null)}:void 0},R?o.createElement(f.q,{className:(0,k.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(s.K,{padding:{left:G,right:G},hide:!j,dataKey:u,interval:C?"preserveStartEnd":N,tick:{transform:"translate(0, 6)"},ticks:C?[n[0][u],n[n.length-1][u]]:void 0,fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:V,angle:null==$?void 0:$.angle,dy:null==$?void 0:$.verticalShift,height:null==$?void 0:$.xAxisHeight}),o.createElement(c.B,{width:P,hide:!_,axisLine:!1,tickLine:!1,type:"number",domain:eo,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:O,allowDecimals:F}),o.createElement(p.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:r}=e;return K?o.createElement(K,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=er.get(e.dataKey))&&void 0!==t?t:x.fr.Gray})}),active:t,label:r}):o.createElement(v.ZP,{active:t,payload:n,label:r,valueFormatter:O,categoryColors:er})}:o.createElement(o.Fragment,null),position:{y:0}}),I?o.createElement(h.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,g.Z)({payload:t},er,Q,et,ea?e=>ei(e):void 0,U)}}):null,i.map(e=>{var t;return o.createElement(l.x,{className:(0,k.q)((0,S.bM)(null!==(t=er.get(e))&&void 0!==t?t:x.fr.Gray,w.K.text).strokeColor),strokeOpacity:J||et&&et!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(m.o,{className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(t=er.get(u))&&void 0!==t?t:x.fr.Gray,w.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),ea&&(e.index===(null==J?void 0:J.index)&&e.dataKey===(null==J?void 0:J.dataKey)||(0,b.FB)(n,e.dataKey)&&et&&et===e.dataKey?(en(void 0),ee(void 0),null==W||W(null)):(en(e.dataKey),ee({index:e.index,dataKey:e.dataKey}),null==W||W(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,b.FB)(n,e)&&!(J||et&&et!==e)||(null==J?void 0:J.index)===f&&(null==J?void 0:J.dataKey)===e?o.createElement(m.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(r=er.get(d))&&void 0!==r?r:x.fr.Gray,w.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:L,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:A,animationDuration:T,connectNulls:B})}),W?i.map(e=>o.createElement(l.x,{className:(0,k.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:L,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:B,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ei(n)}})):null):o.createElement(y.Z,{noDataText:H})))});E.displayName="LineChart"},65278:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(2265);let o=(e,t)=>{let[n,o]=(0,r.useState)(t);(0,r.useEffect)(()=>{let t=()=>{o(window.innerWidth),e()};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e,n])};var a=n(5853),i=n(26898),l=n(97324),s=n(1153);let c=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},u=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},d=(0,s.fn)("Legend"),f=e=>{let{name:t,color:n,onClick:o,activeLegend:a}=e,c=!!o;return r.createElement("li",{className:(0,l.q)(d("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",c?"cursor-pointer":"cursor-default","text-tremor-content",c?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",c?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:e=>{e.stopPropagation(),null==o||o(t,n)}},r.createElement("svg",{className:(0,l.q)("flex-none h-2 w-2 mr-1.5",(0,s.bM)(n,i.K.text).textColor,a&&a!==t?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},r.createElement("circle",{cx:4,cy:4,r:4})),r.createElement("p",{className:(0,l.q)("whitespace-nowrap truncate text-tremor-default","text-tremor-content",c?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",a&&a!==t?"opacity-40":"opacity-100",c?"dark:group-hover:text-dark-tremor-content-emphasis":"")},t))},p=e=>{let{icon:t,onClick:n,disabled:o}=e,[a,i]=r.useState(!1),s=r.useRef(null);return r.useEffect(()=>(a?s.current=setInterval(()=>{null==n||n()},300):clearInterval(s.current),()=>clearInterval(s.current)),[a,n]),(0,r.useEffect)(()=>{o&&(clearInterval(s.current),i(!1))},[o]),r.createElement("button",{type:"button",className:(0,l.q)(d("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:e=>{e.stopPropagation(),null==n||n()},onMouseDown:e=>{e.stopPropagation(),i(!0)},onMouseUp:e=>{e.stopPropagation(),i(!1)}},r.createElement(t,{className:"w-full"}))},h=r.forwardRef((e,t)=>{var n,o;let{categories:s,colors:h=i.s,className:m,onClickLegendItem:g,activeLegend:v,enableLegendSlider:y=!1}=e,b=(0,a._T)(e,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=r.useRef(null),[w,k]=r.useState(null),[S,E]=r.useState(null),O=r.useRef(null),C=(0,r.useCallback)(()=>{let e=null==x?void 0:x.current;e&&k({left:e.scrollLeft>0,right:e.scrollWidth-e.clientWidth>e.scrollLeft})},[k]),j=(0,r.useCallback)(e=>{var t;let n=null==x?void 0:x.current,r=null!==(t=null==n?void 0:n.clientWidth)&&void 0!==t?t:0;n&&y&&(n.scrollTo({left:"left"===e?n.scrollLeft-r:n.scrollLeft+r,behavior:"smooth"}),setTimeout(()=>{C()},400))},[y,C]);r.useEffect(()=>{let e=e=>{"ArrowLeft"===e?j("left"):"ArrowRight"===e&&j("right")};return S?(e(S),O.current=setInterval(()=>{e(S)},300)):clearInterval(O.current),()=>clearInterval(O.current)},[S,j]);let _=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),E(e.key))},P=e=>{e.stopPropagation(),E(null)};return r.useEffect(()=>{let e=null==x?void 0:x.current;return y&&(C(),null==e||e.addEventListener("keydown",_),null==e||e.addEventListener("keyup",P)),()=>{null==e||e.removeEventListener("keydown",_),null==e||e.removeEventListener("keyup",P)}},[C,y]),r.createElement("ol",Object.assign({ref:t,className:(0,l.q)(d("root"),"relative overflow-hidden",m)},b),r.createElement("div",{ref:x,tabIndex:0,className:(0,l.q)("h-full flex",y?(null==w?void 0:w.right)||(null==w?void 0:w.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},s.map((e,t)=>r.createElement(f,{key:"item-".concat(t),name:e,color:h[t],onClick:g,activeLegend:v}))),y&&((null==w?void 0:w.right)||(null==w?void 0:w.left))?r.createElement(r.Fragment,null,r.createElement("div",{className:(0,l.q)("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},r.createElement(p,{icon:c,onClick:()=>{E(null),j("left")},disabled:!(null==w?void 0:w.left)}),r.createElement(p,{icon:u,onClick:()=>{E(null),j("right")},disabled:!(null==w?void 0:w.right)}))):null)});h.displayName="Legend";let m=(e,t,n,a,i,l)=>{let{payload:s}=e,c=(0,r.useRef)(null);o(()=>{var e,t;n((t=null===(e=c.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)});let u=s.filter(e=>"none"!==e.type);return r.createElement("div",{ref:c,className:"flex items-center justify-end"},r.createElement(h,{categories:u.map(e=>e.value),colors:u.map(e=>t.get(e.value)),onClickLegendItem:i,activeLegend:a,enableLegendSlider:l}))}},98593:function(e,t,n){"use strict";n.d(t,{$B:function(){return s},ZP:function(){return u},zX:function(){return c}});var r=n(2265),o=n(7084),a=n(26898),i=n(97324),l=n(1153);let s=e=>{let{children:t}=e;return r.createElement("div",{className:(0,i.q)("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},t)},c=e=>{let{value:t,name:n,color:o}=e;return r.createElement("div",{className:"flex items-center justify-between space-x-8"},r.createElement("div",{className:"flex items-center space-x-2"},r.createElement("span",{className:(0,i.q)("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",(0,l.bM)(o,a.K.background).bgColor)}),r.createElement("p",{className:(0,i.q)("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},n)),r.createElement("p",{className:(0,i.q)("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},t))},u=e=>{let{active:t,payload:n,label:a,categoryColors:l,valueFormatter:u}=e;if(t&&n){let e=n.filter(e=>"none"!==e.type);return r.createElement(s,null,r.createElement("div",{className:(0,i.q)("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},r.createElement("p",{className:(0,i.q)("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},a)),r.createElement("div",{className:(0,i.q)("px-4 py-2 space-y-1")},e.map((e,t)=>{var n;let{value:a,name:i}=e;return r.createElement(c,{key:"id-".concat(t),value:u(a),name:i,color:null!==(n=l.get(i))&&void 0!==n?n:o.fr.Blue})})))}return null}},69448:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(97324),o=n(2265),a=n(5853);let i=(0,n(1153).fn)("Flex"),l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},c={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},u=o.forwardRef((e,t)=>{let{flexDirection:n="row",justifyContent:u="between",alignItems:d="center",children:f,className:p}=e,h=(0,a._T)(e,["flexDirection","justifyContent","alignItems","children","className"]);return o.createElement("div",Object.assign({ref:t,className:(0,r.q)(i("root"),"flex w-full",c[n],l[u],s[d],p)},h),f)});u.displayName="Flex";var d=n(84264);let f=e=>{let{noDataText:t="No data"}=e;return o.createElement(u,{alignItems:"center",justifyContent:"center",className:(0,r.q)("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},o.createElement(d.Z,{className:(0,r.q)("text-tremor-content","dark:text-dark-tremor-content")},t))}},32644:function(e,t,n){"use strict";n.d(t,{FB:function(){return a},i4:function(){return o},me:function(){return r},vZ:function(){return function e(t,n){if(t===n)return!0;if("object"!=typeof t||"object"!=typeof n||null===t||null===n)return!1;let r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(let a of r)if(!o.includes(a)||!e(t[a],n[a]))return!1;return!0}}});let r=(e,t)=>{let n=new Map;return e.forEach((e,r)=>{n.set(e,t[r])}),n},o=(e,t,n)=>[e?"auto":null!=t?t:0,null!=n?n:"auto"];function a(e,t){let n=[];for(let r of e)if(Object.prototype.hasOwnProperty.call(r,t)&&(n.push(r[t]),n.length>1))return!1;return!0}},47323:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(5853),o=n(2265),a=n(1526),i=n(7084),l=n(97324),s=n(1153),c=n(26898);let u={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},d={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},f={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,s.bM)(t,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,l.q)((0,s.bM)(t,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,s.fn)("Icon"),m=o.forwardRef((e,t)=>{let{icon:n,variant:c="simple",tooltip:m,size:g=i.u8.SM,color:v,className:y}=e,b=(0,r._T)(e,["icon","variant","tooltip","size","color","className"]),x=p(c,v),{tooltipProps:w,getReferenceProps:k}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,s.lq)([t,w.refs.setReference]),className:(0,l.q)(h("root"),"inline-flex flex-shrink-0 items-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,f[c].rounded,f[c].border,f[c].shadow,f[c].ring,u[g].paddingX,u[g].paddingY,y)},k,b),o.createElement(a.Z,Object.assign({text:m},w)),o.createElement(n,{className:(0,l.q)(h("icon"),"shrink-0",d[g].height,d[g].width)}))});m.displayName="Icon"},69262:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},l=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var s=n(96398),c=n(97324),u=n(1153);let d=o.forwardRef((e,t)=>{let{value:n,defaultValue:d,type:f,placeholder:p="Type...",icon:h,error:m=!1,errorMessage:g,disabled:v=!1,stepper:y,makeInputClassName:b,className:x,onChange:w,onValueChange:k,autoFocus:S}=e,E=(0,r._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[O,C]=(0,o.useState)(S||!1),[j,_]=(0,o.useState)(!1),P=(0,o.useCallback)(()=>_(!j),[j,_]),N=(0,o.useRef)(null),T=(0,s.Uh)(n||d);return o.useEffect(()=>{let e=()=>C(!0),t=()=>C(!1),n=N.current;return n&&(n.addEventListener("focus",e),n.addEventListener("blur",t),S&&n.focus()),()=>{n&&(n.removeEventListener("focus",e),n.removeEventListener("blur",t))}},[S]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,c.q)(b("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,s.um)(T,v,m),O&&(0,c.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),x)},h?o.createElement(h,{className:(0,c.q)(b("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,u.lq)([N,t]),defaultValue:d,value:n,type:j?"text":f,className:(0,c.q)(b("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",h?"pl-2":"pl-3",m?"pr-3":"pr-4",v?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:v,"data-testid":"base-input",onChange:e=>{null==w||w(e),null==k||k(e.target.value)}},E)),"password"!==f||v?null:o.createElement("button",{className:(0,c.q)(b("toggleButton"),"mr-2"),type:"button",onClick:()=>P(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(l,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(i,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),m?o.createElement(a,{className:(0,c.q)(b("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=y?y:null),m&&g?o.createElement("p",{className:(0,c.q)(b("errorMessage"),"text-sm text-red-500 mt-1")},g):null)});d.displayName="BaseInput"},53003:function(e,t,n){"use strict";let r,o,a;n.d(t,{Z:function(){return nF}});var i,l,s,c,u=n(5853),d=n(2265),f=n(54887),p=n(13323),h=n(64518),m=n(96822),g=n(40293);function v(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,d.useMemo)(()=>(0,g.r)(...t),[...t])}var y=n(72238),b=n(93689);let x=(0,d.createContext)(!1);var w=n(61424),k=n(27847);let S=d.Fragment,E=d.Fragment,O=(0,d.createContext)(null),C=(0,d.createContext)(null);Object.assign((0,k.yV)(function(e,t){var n;let r,o,a=(0,d.useRef)(null),i=(0,b.T)((0,b.h)(e=>{a.current=e}),t),l=v(a),s=function(e){let t=(0,d.useContext)(x),n=(0,d.useContext)(O),r=v(e),[o,a]=(0,d.useState)(()=>{if(!t&&null!==n||w.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return(0,d.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),(0,d.useEffect)(()=>{t||null!==n&&a(n.current)},[n,a,t]),o}(a),[c]=(0,d.useState)(()=>{var e;return w.O.isServer?null:null!=(e=null==l?void 0:l.createElement("div"))?e:null}),u=(0,d.useContext)(C),g=(0,y.H)();return(0,h.e)(()=>{!s||!c||s.contains(c)||(c.setAttribute("data-headlessui-portal",""),s.appendChild(c))},[s,c]),(0,h.e)(()=>{if(c&&u)return u.register(c)},[u,c]),n=()=>{var e;s&&c&&(c instanceof Node&&s.contains(c)&&s.removeChild(c),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))},r=(0,p.z)(n),o=(0,d.useRef)(!1),(0,d.useEffect)(()=>(o.current=!1,()=>{o.current=!0,(0,m.Y)(()=>{o.current&&r()})}),[r]),g&&s&&c?(0,f.createPortal)((0,k.sY)({ourProps:{ref:i},theirProps:e,defaultTag:S,name:"Portal"}),c):null}),{Group:(0,k.yV)(function(e,t){let{target:n,...r}=e,o={ref:(0,b.T)(t)};return d.createElement(O.Provider,{value:n},(0,k.sY)({ourProps:o,theirProps:r,defaultTag:E,name:"Popover.Group"}))})});var j=n(31948),_=n(17684),P=n(98505),N=n(80004),T=n(38198),A=n(3141),M=((r=M||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function I(){let e=(0,d.useRef)(0);return(0,A.s)("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}var R=n(37863),D=n(47634),L=n(37105),Z=n(24536),z=n(37388),B=((o=B||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),F=((a=F||{})[a.TogglePopover=0]="TogglePopover",a[a.ClosePopover=1]="ClosePopover",a[a.SetButton=2]="SetButton",a[a.SetButtonId=3]="SetButtonId",a[a.SetPanel=4]="SetPanel",a[a.SetPanelId=5]="SetPanelId",a);let H={0:e=>{let t={...e,popoverState:(0,Z.E)(e.popoverState,{0:1,1:0})};return 0===t.popoverState&&(t.__demoMode=!1),t},1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},q=(0,d.createContext)(null);function W(e){let t=(0,d.useContext)(q);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Popover /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,W),t}return t}q.displayName="PopoverContext";let U=(0,d.createContext)(null);function K(e){let t=(0,d.useContext)(U);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Popover /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return t}U.displayName="PopoverAPIContext";let $=(0,d.createContext)(null);function V(){return(0,d.useContext)($)}$.displayName="PopoverGroupContext";let X=(0,d.createContext)(null);function G(e,t){return(0,Z.E)(t.type,H,e,t)}X.displayName="PopoverPanelContext";let Y=k.AN.RenderStrategy|k.AN.Static,Q=k.AN.RenderStrategy|k.AN.Static,J=Object.assign((0,k.yV)(function(e,t){var n,r,o,a;let i,l,s,c,u,f;let{__demoMode:h=!1,...m}=e,g=(0,d.useRef)(null),y=(0,b.T)(t,(0,b.h)(e=>{g.current=e})),x=(0,d.useRef)([]),w=(0,d.useReducer)(G,{__demoMode:h,popoverState:h?0:1,buttons:x,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:(0,d.createRef)(),afterPanelSentinel:(0,d.createRef)()}),[{popoverState:S,button:E,buttonId:O,panel:_,panelId:N,beforePanelSentinel:A,afterPanelSentinel:M},I]=w,D=v(null!=(n=g.current)?n:E),z=(0,d.useMemo)(()=>{if(!E||!_)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(E))^Number(null==e?void 0:e.contains(_)))return!0;let e=(0,L.GO)(),t=e.indexOf(E),n=(t+e.length-1)%e.length,r=(t+1)%e.length,o=e[n],a=e[r];return!_.contains(o)&&!_.contains(a)},[E,_]),B=(0,j.E)(O),F=(0,j.E)(N),H=(0,d.useMemo)(()=>({buttonId:B,panelId:F,close:()=>I({type:1})}),[B,F,I]),W=V(),K=null==W?void 0:W.registerPopover,$=(0,p.z)(()=>{var e;return null!=(e=null==W?void 0:W.isFocusWithinPopoverGroup())?e:(null==D?void 0:D.activeElement)&&((null==E?void 0:E.contains(D.activeElement))||(null==_?void 0:_.contains(D.activeElement)))});(0,d.useEffect)(()=>null==K?void 0:K(H),[K,H]);let[Y,Q]=(i=(0,d.useContext)(C),l=(0,d.useRef)([]),s=(0,p.z)(e=>(l.current.push(e),i&&i.register(e),()=>c(e))),c=(0,p.z)(e=>{let t=l.current.indexOf(e);-1!==t&&l.current.splice(t,1),i&&i.unregister(e)}),u=(0,d.useMemo)(()=>({register:s,unregister:c,portals:l}),[s,c,l]),[l,(0,d.useMemo)(()=>function(e){let{children:t}=e;return d.createElement(C.Provider,{value:u},t)},[u])]),J=function(){var e;let{defaultContainers:t=[],portals:n,mainTreeNodeRef:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(0,d.useRef)(null!=(e=null==r?void 0:r.current)?e:null),a=v(o),i=(0,p.z)(()=>{var e,r,i;let l=[];for(let e of t)null!==e&&(e instanceof HTMLElement?l.push(e):"current"in e&&e.current instanceof HTMLElement&&l.push(e.current));if(null!=n&&n.current)for(let e of n.current)l.push(e);for(let t of null!=(e=null==a?void 0:a.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||t.contains(null==(i=null==(r=o.current)?void 0:r.getRootNode())?void 0:i.host)||l.some(e=>t.contains(e))||l.push(t));return l});return{resolveContainers:i,contains:(0,p.z)(e=>i().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,d.useMemo)(()=>function(){return null!=r?null:d.createElement(T._,{features:T.A.Hidden,ref:o})},[o,r])}}({mainTreeNodeRef:null==W?void 0:W.mainTreeNodeRef,portals:Y,defaultContainers:[E,_]});r=null==D?void 0:D.defaultView,o="focus",a=e=>{var t,n,r,o;e.target!==window&&e.target instanceof HTMLElement&&0===S&&($()||E&&_&&(J.contains(e.target)||null!=(n=null==(t=A.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(o=null==(r=M.current)?void 0:r.contains)&&o.call(r,e.target)||I({type:1})))},f=(0,j.E)(a),(0,d.useEffect)(()=>{function e(e){f.current(e)}return(r=null!=r?r:window).addEventListener(o,e,!0),()=>r.removeEventListener(o,e,!0)},[r,o,!0]),(0,P.O)(J.resolveContainers,(e,t)=>{I({type:1}),(0,L.sP)(t,L.tJ.Loose)||(e.preventDefault(),null==E||E.focus())},0===S);let ee=(0,p.z)(e=>{I({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:E:E;null==t||t.focus()}),et=(0,d.useMemo)(()=>({close:ee,isPortalled:z}),[ee,z]),en=(0,d.useMemo)(()=>({open:0===S,close:ee}),[S,ee]);return d.createElement(X.Provider,{value:null},d.createElement(q.Provider,{value:w},d.createElement(U.Provider,{value:et},d.createElement(R.up,{value:(0,Z.E)(S,{0:R.ZM.Open,1:R.ZM.Closed})},d.createElement(Q,null,(0,k.sY)({ourProps:{ref:y},theirProps:m,slot:en,defaultTag:"div",name:"Popover"}),d.createElement(J.MainTreeNode,null))))))}),{Button:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-button-".concat(n),...o}=e,[a,i]=W("Popover.Button"),{isPortalled:l}=K("Popover.Button"),s=(0,d.useRef)(null),c="headlessui-focus-sentinel-".concat((0,_.M)()),u=V(),f=null==u?void 0:u.closeOthers,h=null!==(0,d.useContext)(X);(0,d.useEffect)(()=>{if(!h)return i({type:3,buttonId:r}),()=>{i({type:3,buttonId:null})}},[h,r,i]);let[m]=(0,d.useState)(()=>Symbol()),g=(0,b.T)(s,t,h?null:e=>{if(e)a.buttons.current.push(m);else{let e=a.buttons.current.indexOf(m);-1!==e&&a.buttons.current.splice(e,1)}a.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),e&&i({type:2,button:e})}),y=(0,b.T)(s,t),x=v(s),w=(0,p.z)(e=>{var t,n,r;if(h){if(1===a.popoverState)return;switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),i({type:1}),null==(r=a.button)||r.focus()}}else switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0});break;case z.R.Escape:if(0!==a.popoverState)return null==f?void 0:f(a.buttonId);if(!s.current||null!=x&&x.activeElement&&!s.current.contains(x.activeElement))return;e.preventDefault(),e.stopPropagation(),i({type:1})}}),S=(0,p.z)(e=>{h||e.key===z.R.Space&&e.preventDefault()}),E=(0,p.z)(t=>{var n,r;(0,D.P)(t.currentTarget)||e.disabled||(h?(i({type:1}),null==(n=a.button)||n.focus()):(t.preventDefault(),t.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0}),null==(r=a.button)||r.focus()))}),O=(0,p.z)(e=>{e.preventDefault(),e.stopPropagation()}),C=0===a.popoverState,j=(0,d.useMemo)(()=>({open:C}),[C]),P=(0,N.f)(e,s),A=h?{ref:y,type:P,onKeyDown:w,onClick:E}:{ref:g,id:a.buttonId,type:P,"aria-expanded":0===a.popoverState,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:w,onKeyUp:S,onClick:E,onMouseDown:O},R=I(),B=(0,p.z)(()=>{let e=a.panel;e&&(0,Z.E)(R.current,{[M.Forwards]:()=>(0,L.jA)(e,L.TO.First),[M.Backwards]:()=>(0,L.jA)(e,L.TO.Last)})===L.fE.Error&&(0,L.jA)((0,L.GO)().filter(e=>"true"!==e.dataset.headlessuiFocusGuard),(0,Z.E)(R.current,{[M.Forwards]:L.TO.Next,[M.Backwards]:L.TO.Previous}),{relativeTo:a.button})});return d.createElement(d.Fragment,null,(0,k.sY)({ourProps:A,theirProps:o,slot:j,defaultTag:"button",name:"Popover.Button"}),C&&!h&&l&&d.createElement(T._,{id:c,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:B}))}),Overlay:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-overlay-".concat(n),...o}=e,[{popoverState:a},i]=W("Popover.Overlay"),l=(0,b.T)(t),s=(0,R.oJ)(),c=null!==s?(s&R.ZM.Open)===R.ZM.Open:0===a,u=(0,p.z)(e=>{if((0,D.P)(e.currentTarget))return e.preventDefault();i({type:1})}),f=(0,d.useMemo)(()=>({open:0===a}),[a]);return(0,k.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:u},theirProps:o,slot:f,defaultTag:"div",features:Y,visible:c,name:"Popover.Overlay"})}),Panel:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-panel-".concat(n),focus:o=!1,...a}=e,[i,l]=W("Popover.Panel"),{close:s,isPortalled:c}=K("Popover.Panel"),u="headlessui-focus-sentinel-before-".concat((0,_.M)()),f="headlessui-focus-sentinel-after-".concat((0,_.M)()),m=(0,d.useRef)(null),g=(0,b.T)(m,t,e=>{l({type:4,panel:e})}),y=v(m),x=(0,k.Y2)();(0,h.e)(()=>(l({type:5,panelId:r}),()=>{l({type:5,panelId:null})}),[r,l]);let w=(0,R.oJ)(),S=null!==w?(w&R.ZM.Open)===R.ZM.Open:0===i.popoverState,E=(0,p.z)(e=>{var t;if(e.key===z.R.Escape){if(0!==i.popoverState||!m.current||null!=y&&y.activeElement&&!m.current.contains(y.activeElement))return;e.preventDefault(),e.stopPropagation(),l({type:1}),null==(t=i.button)||t.focus()}});(0,d.useEffect)(()=>{var t;e.static||1===i.popoverState&&(null==(t=e.unmount)||t)&&l({type:4,panel:null})},[i.popoverState,e.unmount,e.static,l]),(0,d.useEffect)(()=>{if(i.__demoMode||!o||0!==i.popoverState||!m.current)return;let e=null==y?void 0:y.activeElement;m.current.contains(e)||(0,L.jA)(m.current,L.TO.First)},[i.__demoMode,o,m,i.popoverState]);let O=(0,d.useMemo)(()=>({open:0===i.popoverState,close:s}),[i,s]),C={ref:g,id:r,onKeyDown:E,onBlur:o&&0===i.popoverState?e=>{var t,n,r,o,a;let s=e.relatedTarget;s&&m.current&&(null!=(t=m.current)&&t.contains(s)||(l({type:1}),(null!=(r=null==(n=i.beforePanelSentinel.current)?void 0:n.contains)&&r.call(n,s)||null!=(a=null==(o=i.afterPanelSentinel.current)?void 0:o.contains)&&a.call(o,s))&&s.focus({preventScroll:!0})))}:void 0,tabIndex:-1},j=I(),P=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var t;(0,L.jA)(e,L.TO.First)===L.fE.Error&&(null==(t=i.afterPanelSentinel.current)||t.focus())},[M.Backwards]:()=>{var e;null==(e=i.button)||e.focus({preventScroll:!0})}})}),N=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var e;if(!i.button)return;let t=(0,L.GO)(),n=t.indexOf(i.button),r=t.slice(0,n+1),o=[...t.slice(n+1),...r];for(let t of o.slice())if("true"===t.dataset.headlessuiFocusGuard||null!=(e=i.panel)&&e.contains(t)){let e=o.indexOf(t);-1!==e&&o.splice(e,1)}(0,L.jA)(o,L.TO.First,{sorted:!1})},[M.Backwards]:()=>{var t;(0,L.jA)(e,L.TO.Previous)===L.fE.Error&&(null==(t=i.button)||t.focus())}})});return d.createElement(X.Provider,{value:r},S&&c&&d.createElement(T._,{id:u,ref:i.beforePanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:P}),(0,k.sY)({mergeRefs:x,ourProps:C,theirProps:a,slot:O,defaultTag:"div",features:Q,visible:S,name:"Popover.Panel"}),S&&c&&d.createElement(T._,{id:f,ref:i.afterPanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:N}))}),Group:(0,k.yV)(function(e,t){let n;let r=(0,d.useRef)(null),o=(0,b.T)(r,t),[a,i]=(0,d.useState)([]),l={mainTreeNodeRef:n=(0,d.useRef)(null),MainTreeNode:(0,d.useMemo)(()=>function(){return d.createElement(T._,{features:T.A.Hidden,ref:n})},[n])},s=(0,p.z)(e=>{i(t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t})}),c=(0,p.z)(e=>(i(t=>[...t,e]),()=>s(e))),u=(0,p.z)(()=>{var e;let t=(0,g.r)(r);if(!t)return!1;let n=t.activeElement;return!!(null!=(e=r.current)&&e.contains(n))||a.some(e=>{var r,o;return(null==(r=t.getElementById(e.buttonId.current))?void 0:r.contains(n))||(null==(o=t.getElementById(e.panelId.current))?void 0:o.contains(n))})}),f=(0,p.z)(e=>{for(let t of a)t.buttonId.current!==e&&t.close()}),h=(0,d.useMemo)(()=>({registerPopover:c,unregisterPopover:s,isFocusWithinPopoverGroup:u,closeOthers:f,mainTreeNodeRef:l.mainTreeNodeRef}),[c,s,u,f,l.mainTreeNodeRef]),m=(0,d.useMemo)(()=>({}),[]);return d.createElement($.Provider,{value:h},(0,k.sY)({ourProps:{ref:o},theirProps:e,slot:m,defaultTag:"div",name:"Popover.Group"}),d.createElement(l.MainTreeNode,null))})});var ee=n(33044),et=n(28517);let en=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};var er=n(4537),eo=n(99735),ea=n(7656);function ei(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setHours(0,0,0,0),t}function el(){return ei(Date.now())}function es(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setDate(1),t.setHours(0,0,0,0),t}var ec=n(97324),eu=n(96398),ed=n(41154);function ef(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)}),n||new Date(NaN)}function ep(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)}),n||new Date(NaN)}var eh=n(25721),em=n(47869);function eg(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,-n)}var ev=n(55463);function ey(e,t){if((0,ea.Z)(2,arguments),!t||"object"!==(0,ed.Z)(t))return new Date(NaN);var n=t.years?(0,em.Z)(t.years):0,r=t.months?(0,em.Z)(t.months):0,o=t.weeks?(0,em.Z)(t.weeks):0,a=t.days?(0,em.Z)(t.days):0,i=t.hours?(0,em.Z)(t.hours):0,l=t.minutes?(0,em.Z)(t.minutes):0,s=t.seconds?(0,em.Z)(t.seconds):0;return new Date(eg(function(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,-n)}(e,r+12*n),a+7*o).getTime()-1e3*(s+60*(l+60*i)))}function eb(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ex(e){return(0,ea.Z)(1,arguments),e instanceof Date||"object"===(0,ed.Z)(e)&&"[object Date]"===Object.prototype.toString.call(e)}function ew(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCDay();return t.setUTCDate(t.getUTCDate()-((n<1?7:0)+n-1)),t.setUTCHours(0,0,0,0),t}function ek(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=ew(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=ew(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}var eS={};function eE(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getUTCDay();return d.setUTCDate(d.getUTCDate()-((f<u?7:0)+f-u)),d.setUTCHours(0,0,0,0),d}function eO(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getUTCFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var h=eE(p,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var g=eE(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}function eC(e,t){for(var n=Math.abs(e).toString();n.length<t;)n="0"+n;return(e<0?"-":"")+n}var ej={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return eC("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):eC(n+1,2)},d:function(e,t){return eC(e.getUTCDate(),t.length)},h:function(e,t){return eC(e.getUTCHours()%12||12,t.length)},H:function(e,t){return eC(e.getUTCHours(),t.length)},m:function(e,t){return eC(e.getUTCMinutes(),t.length)},s:function(e,t){return eC(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length;return eC(Math.floor(e.getUTCMilliseconds()*Math.pow(10,n-3)),t.length)}},e_={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function eP(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+(t||"")+eC(a,2)}function eN(e,t){return e%60==0?(e>0?"-":"+")+eC(Math.abs(e)/60,2):eT(e,t)}function eT(e,t){var n=Math.abs(e);return(e>0?"-":"+")+eC(Math.floor(n/60),2)+(t||"")+eC(n%60,2)}var eA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return ej.y(e,t)},Y:function(e,t,n,r){var o=eO(e,r),a=o>0?o:1-o;return"YY"===t?eC(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):eC(a,t.length)},R:function(e,t){return eC(ek(e),t.length)},u:function(e,t){return eC(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return eC(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return eC(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return ej.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return eC(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((eE(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=eO(e,t),f=new Date(0);return f.setUTCFullYear(d,0,u),f.setUTCHours(0,0,0,0),eE(f,t)})(n,t).getTime())/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):eC(o,t.length)},I:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((ew(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=ek(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),ew(n)})(t).getTime())/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):eC(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):ej.d(e,t)},D:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getTime();return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),Math.floor((n-t.getTime())/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):eC(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return eC(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return eC(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return eC(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?e_.noon:0===o?e_.midnight:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?e_.evening:o>=12?e_.afternoon:o>=4?e_.morning:e_.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ej.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ej.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):ej.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):ej.s(e,t)},S:function(e,t){return ej.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return eN(o);case"XXXX":case"XX":return eT(o);default:return eT(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return eN(o);case"xxxx":case"xx":return eT(o);default:return eT(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},t:function(e,t,n,r){return eC(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return eC((r._originalDate||e).getTime(),t.length)}},eM=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},eI=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},eR={p:eI,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],a=r[2];if(!a)return eM(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",eM(o,t)).replace("{{time}}",eI(a,t))}};function eD(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var eL=["D","DD"],eZ=["YY","YYYY"];function ez(e,t,n){if("YYYY"===e)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var eB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function eF(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var eH={date:eF({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:eF({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:eF({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},eq={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function eW(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!=n&&n.width?String(n.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var i=e.defaultWidth,l=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[i]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function eU(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var l=i[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(s,function(e){return e.test(l)}):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(s,function(e){return e.test(l)});return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(l.length)}}}var eK={code:"en-US",formatDistance:function(e,t,n){var r,o=eB[e];return(r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix)?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:eH,formatRelative:function(e,t,n,r){return eq[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:eW({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:eW({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:eW({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:eW({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:eW({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(i={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(i.matchPattern);if(!n)return null;var r=n[0],o=e.match(i.parsePattern);if(!o)return null;var a=i.valueCallback?i.valueCallback(o[0]):o[0];return{value:a=t.valueCallback?t.valueCallback(a):a,rest:e.slice(r.length)}}),era:eU({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:eU({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:eU({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:eU({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:eU({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},e$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eX=/^'([^]*?)'?$/,eG=/''/g,eY=/[a-zA-Z]/;function eQ(e,t,n){(0,ea.Z)(2,arguments);var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w=String(t),k=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:eS.locale)&&void 0!==r?r:eK,S=(0,em.Z)(null!==(a=null!==(i=null!==(l=null!==(s=null==n?void 0:n.firstWeekContainsDate)&&void 0!==s?s:null==n?void 0:null===(c=n.locale)||void 0===c?void 0:null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==l?l:eS.firstWeekContainsDate)&&void 0!==i?i:null===(d=eS.locale)||void 0===d?void 0:null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==a?a:1);if(!(S>=1&&S<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=(0,em.Z)(null!==(p=null!==(h=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n?void 0:null===(v=n.locale)||void 0===v?void 0:null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:eS.weekStartsOn)&&void 0!==h?h:null===(b=eS.locale)||void 0===b?void 0:null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(E>=0&&E<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw RangeError("locale must contain localize property");if(!k.formatLong)throw RangeError("locale must contain formatLong property");var O=(0,eo.Z)(e);if(!function(e){return(0,ea.Z)(1,arguments),(!!ex(e)||"number"==typeof e)&&!isNaN(Number((0,eo.Z)(e)))}(O))throw RangeError("Invalid time value");var C=eD(O),j=function(e,t){return(0,ea.Z)(2,arguments),function(e,t){return(0,ea.Z)(2,arguments),new Date((0,eo.Z)(e).getTime()+(0,em.Z)(t))}(e,-(0,em.Z)(t))}(O,C),_={firstWeekContainsDate:S,weekStartsOn:E,locale:k,_originalDate:O};return w.match(eV).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,eR[t])(e,k.formatLong):e}).join("").match(e$).map(function(r){if("''"===r)return"'";var o,a=r[0];if("'"===a)return(o=r.match(eX))?o[1].replace(eG,"'"):r;var i=eA[a];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===eZ.indexOf(r)||ez(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||-1===eL.indexOf(r)||ez(r,t,String(e)),i(j,r,k.localize,_);if(a.match(eY))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r}).join("")}var eJ=n(1153);let e0=(0,eJ.fn)("DateRangePicker"),e1=(e,t,n,r)=>{var o;if(n&&(e=null===(o=r.get(n))||void 0===o?void 0:o.from),e)return ei(e&&!t?e:ef([e,t]))},e2=(e,t,n,r)=>{var o,a;if(n&&(e=ei(null!==(a=null===(o=r.get(n))||void 0===o?void 0:o.to)&&void 0!==a?a:el())),e)return ei(e&&!t?e:ep([e,t]))},e6=[{value:"tdy",text:"Today",from:el()},{value:"w",text:"Last 7 days",from:ey(el(),{days:7})},{value:"t",text:"Last 30 days",from:ey(el(),{days:30})},{value:"m",text:"Month to Date",from:es(el())},{value:"y",text:"Year to Date",from:eb(el())}],e4=(e,t,n,r)=>{let o=(null==n?void 0:n.code)||"en-US";if(!e&&!t)return"";if(e&&!t)return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e&&t){if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()===r.getTime()}(e,t))return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())return r?"".concat(eQ(e,r)," - ").concat(eQ(t,r)):"".concat(e.toLocaleDateString(o,{month:"short",day:"numeric"})," - \n ").concat(t.getDate(),", ").concat(t.getFullYear());{if(r)return"".concat(eQ(e,r)," - ").concat(eQ(t,r));let n={year:"numeric",month:"short",day:"numeric"};return"".concat(e.toLocaleDateString(o,n)," - \n ").concat(t.toLocaleDateString(o,n))}}return""};function e3(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function e5(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t),o=n.getFullYear(),a=n.getDate(),i=new Date(0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);var l=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(i);return n.setMonth(r,Math.min(a,l)),n}function e8(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function e7(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function e9(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function te(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()<r.getTime()}function tt(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()-((f<u?7:0)+f-u)),d.setHours(0,0,0,0),d}function tn(e){return(0,ea.Z)(1,arguments),tt(e,{weekStartsOn:1})}function tr(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return n.getTime()===r.getTime()}function to(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()>r.getTime()}function ta(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return Math.round((n.getTime()-eD(n)-(r.getTime()-eD(r)))/864e5)}function ti(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,7*n)}function tl(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,12*n)}function ts(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()+((f<u?-7:0)+6-(f-u))),d.setHours(23,59,59,999),d}function tc(e){return(0,ea.Z)(1,arguments),ts(e,{weekStartsOn:1})}var tu=function(){return(tu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function td(e,t,n){if(n||2==arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tf={exports:{}},tp={};tf.exports=function(){if(s)return tp;s=1;var e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(t,a,i){var l,s={},c=null,u=null;for(l in void 0!==i&&(c=""+i),void 0!==a.key&&(c=""+a.key),void 0!==a.ref&&(u=a.ref),a)n.call(a,l)&&!o.hasOwnProperty(l)&&(s[l]=a[l]);if(t&&t.defaultProps)for(l in a=t.defaultProps)void 0===s[l]&&(s[l]=a[l]);return{$$typeof:e,type:t,key:c,ref:u,props:s,_owner:r.current}}return tp.Fragment=t,tp.jsx=a,tp.jsxs=a,tp}();var th=tf.exports;function tm(e){return"multiple"===e.mode}function tg(e){return"range"===e.mode}function tv(e){return"single"===e.mode}var ty={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"},tb=Object.freeze({__proto__:null,formatCaption:function(e,t){return eQ(e,"LLLL y",t)},formatDay:function(e,t){return eQ(e,"d",t)},formatMonthCaption:function(e,t){return eQ(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return eQ(e,"cccccc",t)},formatYearCaption:function(e,t){return eQ(e,"yyyy",t)}}),tx=Object.freeze({__proto__:null,labelDay:function(e,t,n){return eQ(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return eQ(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}}),tw=(0,d.createContext)(void 0);function tk(e){var t,n,r,o,a,i,l,s,c=e.initialProps,u={captionLayout:"buttons",classNames:ty,formatters:tb,labels:tx,locale:eK,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},d=(t=c.fromYear,n=c.toYear,r=c.fromMonth,o=c.toMonth,a=c.fromDate,i=c.toDate,r?a=es(r):t&&(a=new Date(t,0,1)),o?i=e3(o):n&&(i=new Date(n,11,31)),{fromDate:a?ei(a):void 0,toDate:i?ei(i):void 0}),f=d.fromDate,p=d.toDate,h=null!==(l=c.captionLayout)&&void 0!==l?l:u.captionLayout;"buttons"===h||f&&p||(h="buttons"),(tv(c)||tm(c)||tg(c))&&(s=c.onSelect);var m=tu(tu(tu({},u),c),{captionLayout:h,classNames:tu(tu({},u.classNames),c.classNames),components:tu({},c.components),formatters:tu(tu({},u.formatters),c.formatters),fromDate:f,labels:tu(tu({},u.labels),c.labels),mode:c.mode||u.mode,modifiers:tu(tu({},u.modifiers),c.modifiers),modifiersClassNames:tu(tu({},u.modifiersClassNames),c.modifiersClassNames),onSelect:s,styles:tu(tu({},u.styles),c.styles),toDate:p});return th.jsx(tw.Provider,{value:m,children:e.children})}function tS(){var e=(0,d.useContext)(tw);if(!e)throw Error("useDayPicker must be used within a DayPickerProvider.");return e}function tE(e){var t=tS(),n=t.locale,r=t.classNames,o=t.styles,a=t.formatters.formatCaption;return th.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:n})})}function tO(e){return th.jsx("svg",tu({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:th.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tC(e){var t,n,r=e.onChange,o=e.value,a=e.children,i=e.caption,l=e.className,s=e.style,c=tS(),u=null!==(n=null===(t=c.components)||void 0===t?void 0:t.IconDropdown)&&void 0!==n?n:tO;return th.jsxs("div",{className:l,style:s,children:[th.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),th.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:a}),th.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[i,th.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function tj(e){var t,n=tS(),r=n.fromDate,o=n.toDate,a=n.styles,i=n.locale,l=n.formatters.formatMonthCaption,s=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r||!o)return th.jsx(th.Fragment,{});var d=[];if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()}(r,o))for(var f=es(r),p=r.getMonth();p<=o.getMonth();p++)d.push(e5(f,p));else for(var f=es(new Date),p=0;p<=11;p++)d.push(e5(f,p));var h=null!==(t=null==c?void 0:c.Dropdown)&&void 0!==t?t:tC;return th.jsx(h,{name:"months","aria-label":u(),className:s.dropdown_month,style:a.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=e5(es(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:i}),children:d.map(function(e){return th.jsx("option",{value:e.getMonth(),children:l(e,{locale:i})},e.getMonth())})})}function t_(e){var t,n=e.displayMonth,r=tS(),o=r.fromDate,a=r.toDate,i=r.locale,l=r.styles,s=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!o||!a)return th.jsx(th.Fragment,{});for(var p=o.getFullYear(),h=a.getFullYear(),m=p;m<=h;m++)f.push(e8(eb(new Date),m));var g=null!==(t=null==c?void 0:c.Dropdown)&&void 0!==t?t:tC;return th.jsx(g,{name:"years","aria-label":d(),className:s.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=e8(es(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:u(n,{locale:i}),children:f.map(function(e){return th.jsx("option",{value:e.getFullYear(),children:u(e,{locale:i})},e.getFullYear())})})}var tP=(0,d.createContext)(void 0);function tN(e){var t,n,r,o,a,i,l,s,c,u,f,p,h,m,g,v,y=tS(),b=(g=(r=(n=t=tS()).month,o=n.defaultMonth,a=n.today,i=r||o||a||new Date,l=n.toDate,s=n.fromDate,c=n.numberOfMonths,l&&0>e7(l,i)&&(i=(0,ev.Z)(l,-1*((void 0===c?1:c)-1))),s&&0>e7(i,s)&&(i=s),u=es(i),f=t.month,h=(p=(0,d.useState)(u))[0],m=[void 0===f?h:f,p[1]])[0],v=m[1],[g,function(e){if(!t.disableNavigation){var n,r=es(e);v(r),null===(n=t.onMonthChange)||void 0===n||n.call(t,r)}}]),x=b[0],w=b[1],k=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=es(e),a=e7(es((0,ev.Z)(o,r)),o),i=[],l=0;l<a;l++){var s=(0,ev.Z)(o,l);i.push(s)}return n&&(i=i.reverse()),i}(x,y),S=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=es(e);if(!n||!(e7(n,e)<a))return(0,ev.Z)(i,r?a:1)}}(x,y),E=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,a=es(e);if(!n||!(0>=e7(a,n)))return(0,ev.Z)(a,-(r?void 0===o?1:o:1))}}(x,y),O=function(e){return k.some(function(t){return e9(e,t)})};return th.jsx(tP.Provider,{value:{currentMonth:x,displayMonths:k,goToMonth:w,goToDate:function(e,t){O(e)||(t&&te(e,t)?w((0,ev.Z)(e,1+-1*y.numberOfMonths)):w(e))},previousMonth:E,nextMonth:S,isDateDisplayed:O},children:e.children})}function tT(){var e=(0,d.useContext)(tP);if(!e)throw Error("useNavigation must be used within a NavigationProvider");return e}function tA(e){var t,n=tS(),r=n.classNames,o=n.styles,a=n.components,i=tT().goToMonth,l=function(t){i((0,ev.Z)(t,e.displayIndex?-e.displayIndex:0))},s=null!==(t=null==a?void 0:a.CaptionLabel)&&void 0!==t?t:tE,c=th.jsx(s,{id:e.id,displayMonth:e.displayMonth});return th.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[th.jsx("div",{className:r.vhidden,children:c}),th.jsx(tj,{onChange:l,displayMonth:e.displayMonth}),th.jsx(t_,{onChange:l,displayMonth:e.displayMonth})]})}function tM(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tI(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var tR=(0,d.forwardRef)(function(e,t){var n=tS(),r=n.classNames,o=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var i=a.join(" "),l=tu(tu({},o.button_reset),o.button);return e.style&&Object.assign(l,e.style),th.jsx("button",tu({},e,{ref:t,type:"button",className:i,style:l}))});function tD(e){var t,n,r=tS(),o=r.dir,a=r.locale,i=r.classNames,l=r.styles,s=r.labels,c=s.labelPrevious,u=s.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return th.jsx(th.Fragment,{});var f=c(e.previousMonth,{locale:a}),p=[i.nav_button,i.nav_button_previous].join(" "),h=u(e.nextMonth,{locale:a}),m=[i.nav_button,i.nav_button_next].join(" "),g=null!==(t=null==d?void 0:d.IconRight)&&void 0!==t?t:tI,v=null!==(n=null==d?void 0:d.IconLeft)&&void 0!==n?n:tM;return th.jsxs("div",{className:i.nav,style:l.nav,children:[!e.hidePrevious&&th.jsx(tR,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===o?th.jsx(g,{className:i.nav_icon,style:l.nav_icon}):th.jsx(v,{className:i.nav_icon,style:l.nav_icon})}),!e.hideNext&&th.jsx(tR,{name:"next-month","aria-label":h,className:m,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===o?th.jsx(v,{className:i.nav_icon,style:l.nav_icon}):th.jsx(g,{className:i.nav_icon,style:l.nav_icon})})]})}function tL(e){var t=tS().numberOfMonths,n=tT(),r=n.previousMonth,o=n.nextMonth,a=n.goToMonth,i=n.displayMonths,l=i.findIndex(function(t){return e9(e.displayMonth,t)}),s=0===l,c=l===i.length-1;return th.jsx(tD,{displayMonth:e.displayMonth,hideNext:t>1&&(s||!c),hidePrevious:t>1&&(c||!s),nextMonth:o,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){o&&a(o)}})}function tZ(e){var t,n,r=tS(),o=r.classNames,a=r.disableNavigation,i=r.styles,l=r.captionLayout,s=r.components,c=null!==(t=null==s?void 0:s.CaptionLabel)&&void 0!==t?t:tE;return n=a?th.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?th.jsx(tA,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?th.jsxs(th.Fragment,{children:[th.jsx(tA,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),th.jsx(tL,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):th.jsxs(th.Fragment,{children:[th.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(tL,{displayMonth:e.displayMonth,id:e.id})]}),th.jsx("div",{className:o.caption,style:i.caption,children:n})}function tz(e){var t=tS(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?th.jsx("tfoot",{className:o,style:r.tfoot,children:th.jsx("tr",{children:th.jsx("td",{colSpan:8,children:n})})}):th.jsx(th.Fragment,{})}function tB(){var e=tS(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,a=e.weekStartsOn,i=e.ISOWeek,l=e.formatters.formatWeekdayName,s=e.labels.labelWeekday,c=function(e,t,n){for(var r=n?tn(new Date):tt(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=(0,eh.Z)(r,a);o.push(i)}return o}(o,a,i);return th.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&th.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(e,r){return th.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":s(e,{locale:o}),children:l(e,{locale:o})},r)})]})}function tF(){var e,t=tS(),n=t.classNames,r=t.styles,o=t.components,a=null!==(e=null==o?void 0:o.HeadRow)&&void 0!==e?e:tB;return th.jsx("thead",{style:r.head,className:n.head,children:th.jsx(a,{})})}function tH(e){var t=tS(),n=t.locale,r=t.formatters.formatDay;return th.jsx(th.Fragment,{children:r(e.date,{locale:n})})}var tq=(0,d.createContext)(void 0);function tW(e){return tm(e.initialProps)?th.jsx(tU,{initialProps:e.initialProps,children:e.children}):th.jsx(tq.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function tU(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,a=t.max,i={disabled:[]};return r&&i.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return tr(t,e)});return!!(t&&!n)}),th.jsx(tq.Provider,{value:{selected:r,onDayClick:function(e,n,i){if(null===(l=t.onDayClick)||void 0===l||l.call(t,e,n,i),(!n.selected||!o||(null==r?void 0:r.length)!==o)&&(n.selected||!a||(null==r?void 0:r.length)!==a)){var l,s,c=r?td([],r,!0):[];if(n.selected){var u=c.findIndex(function(t){return tr(e,t)});c.splice(u,1)}else c.push(e);null===(s=t.onSelect)||void 0===s||s.call(t,c,e,n,i)}},modifiers:i},children:n})}function tK(){var e=(0,d.useContext)(tq);if(!e)throw Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var t$=(0,d.createContext)(void 0);function tV(e){return tg(e.initialProps)?th.jsx(tX,{initialProps:e.initialProps,children:e.children}):th.jsx(t$.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function tX(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},a=o.from,i=o.to,l=t.min,s=t.max,c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(c.range_start=[a],i?(c.range_end=[i],tr(a,i)||(c.range_middle=[{after:a,before:i}])):c.range_end=[a]):i&&(c.range_start=[i],c.range_end=[i]),l&&(a&&!i&&c.disabled.push({after:eg(a,l-1),before:(0,eh.Z)(a,l-1)}),a&&i&&c.disabled.push({after:a,before:(0,eh.Z)(a,l-1)}),!a&&i&&c.disabled.push({after:eg(i,l-1),before:(0,eh.Z)(i,l-1)})),s){if(a&&!i&&(c.disabled.push({before:(0,eh.Z)(a,-s+1)}),c.disabled.push({after:(0,eh.Z)(a,s-1)})),a&&i){var u=s-(ta(i,a)+1);c.disabled.push({before:eg(a,u)}),c.disabled.push({after:(0,eh.Z)(i,u)})}!a&&i&&(c.disabled.push({before:(0,eh.Z)(i,-s+1)}),c.disabled.push({after:(0,eh.Z)(i,s-1)}))}return th.jsx(t$.Provider,{value:{selected:r,onDayClick:function(e,n,o){null===(s=t.onDayClick)||void 0===s||s.call(t,e,n,o);var a,i,l,s,c,u=(i=(a=r||{}).from,l=a.to,i&&l?tr(l,e)&&tr(i,e)?void 0:tr(l,e)?{from:l,to:void 0}:tr(i,e)?void 0:to(i,e)?{from:e,to:l}:{from:i,to:e}:l?to(e,l)?{from:l,to:e}:{from:e,to:l}:i?te(e,i)?{from:e,to:i}:{from:i,to:e}:{from:e,to:void 0});null===(c=t.onSelect)||void 0===c||c.call(t,u,e,n,o)},modifiers:c},children:n})}function tG(){var e=(0,d.useContext)(t$);if(!e)throw Error("useSelectRange must be used within a SelectRangeProvider");return e}function tY(e){return Array.isArray(e)?td([],e,!0):void 0!==e?[e]:[]}(l=c||(c={})).Outside="outside",l.Disabled="disabled",l.Selected="selected",l.Hidden="hidden",l.Today="today",l.RangeStart="range_start",l.RangeEnd="range_end",l.RangeMiddle="range_middle";var tQ=c.Selected,tJ=c.Disabled,t0=c.Hidden,t1=c.Today,t2=c.RangeEnd,t6=c.RangeMiddle,t4=c.RangeStart,t3=c.Outside,t5=(0,d.createContext)(void 0);function t8(e){var t,n,r,o=tS(),a=tK(),i=tG(),l=((t={})[tQ]=tY(o.selected),t[tJ]=tY(o.disabled),t[t0]=tY(o.hidden),t[t1]=[o.today],t[t2]=[],t[t6]=[],t[t4]=[],t[t3]=[],o.fromDate&&t[tJ].push({before:o.fromDate}),o.toDate&&t[tJ].push({after:o.toDate}),tm(o)?t[tJ]=t[tJ].concat(a.modifiers[tJ]):tg(o)&&(t[tJ]=t[tJ].concat(i.modifiers[tJ]),t[t4]=i.modifiers[t4],t[t6]=i.modifiers[t6],t[t2]=i.modifiers[t2]),t),s=(n=o.modifiers,r={},Object.entries(n).forEach(function(e){var t=e[0],n=e[1];r[t]=tY(n)}),r),c=tu(tu({},l),s);return th.jsx(t5.Provider,{value:c,children:e.children})}function t7(){var e=(0,d.useContext)(t5);if(!e)throw Error("useModifiers must be used within a ModifiersProvider");return e}function t9(e,t,n){var r=Object.keys(t).reduce(function(n,r){return t[r].some(function(t){if("boolean"==typeof t)return t;if(ex(t))return tr(e,t);if(Array.isArray(t)&&t.every(ex))return t.includes(e);if(t&&"object"==typeof t&&"from"in t)return r=t.from,o=t.to,r&&o?(0>ta(o,r)&&(r=(n=[o,r])[0],o=n[1]),ta(e,r)>=0&&ta(o,e)>=0):o?tr(o,e):!!r&&tr(r,e);if(t&&"object"==typeof t&&"dayOfWeek"in t)return t.dayOfWeek.includes(e.getDay());if(t&&"object"==typeof t&&"before"in t&&"after"in t){var n,r,o,a=ta(t.before,e),i=ta(t.after,e),l=a>0,s=i<0;return to(t.before,t.after)?s&&l:l||s}return t&&"object"==typeof t&&"after"in t?ta(e,t.after)>0:t&&"object"==typeof t&&"before"in t?ta(t.before,e)>0:"function"==typeof t&&t(e)})&&n.push(r),n},[]),o={};return r.forEach(function(e){return o[e]=!0}),n&&!e9(e,n)&&(o.outside=!0),o}var ne=(0,d.createContext)(void 0);function nt(e){var t=tT(),n=t7(),r=(0,d.useState)(),o=r[0],a=r[1],i=(0,d.useState)(),l=i[0],s=i[1],c=function(e,t){for(var n,r,o=es(e[0]),a=e3(e[e.length-1]),i=o;i<=a;){var l=t9(i,t);if(!(!l.disabled&&!l.hidden)){i=(0,eh.Z)(i,1);continue}if(l.selected)return i;l.today&&!r&&(r=i),n||(n=i),i=(0,eh.Z)(i,1)}return r||n}(t.displayMonths,n),u=(null!=o?o:l&&t.isDateDisplayed(l))?l:c,f=function(e){a(e)},p=tS(),h=function(e,r){if(o){var a=function e(t,n){var r=n.moveBy,o=n.direction,a=n.context,i=n.modifiers,l=n.retry,s=void 0===l?{count:0,lastFocused:t}:l,c=a.weekStartsOn,u=a.fromDate,d=a.toDate,f=a.locale,p=({day:eh.Z,week:ti,month:ev.Z,year:tl,startOfWeek:function(e){return a.ISOWeek?tn(e):tt(e,{locale:f,weekStartsOn:c})},endOfWeek:function(e){return a.ISOWeek?tc(e):ts(e,{locale:f,weekStartsOn:c})}})[r](t,"after"===o?1:-1);"before"===o&&u?p=ef([u,p]):"after"===o&&d&&(p=ep([d,p]));var h=!0;if(i){var m=t9(p,i);h=!m.disabled&&!m.hidden}return h?p:s.count>365?s.lastFocused:e(p,{moveBy:r,direction:o,context:a,modifiers:i,retry:tu(tu({},s),{count:s.count+1})})}(o,{moveBy:e,direction:r,context:p,modifiers:n});tr(o,a)||(t.goToDate(a,o),f(a))}};return th.jsx(ne.Provider,{value:{focusedDay:o,focusTarget:u,blur:function(){s(o),a(void 0)},focus:f,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}},children:e.children})}function nn(){var e=(0,d.useContext)(ne);if(!e)throw Error("useFocusContext must be used within a FocusProvider");return e}var nr=(0,d.createContext)(void 0);function no(e){return tv(e.initialProps)?th.jsx(na,{initialProps:e.initialProps,children:e.children}):th.jsx(nr.Provider,{value:{selected:void 0},children:e.children})}function na(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var o,a,i;if(null===(o=t.onDayClick)||void 0===o||o.call(t,e,n,r),n.selected&&!t.required){null===(a=t.onSelect)||void 0===a||a.call(t,void 0,e,n,r);return}null===(i=t.onSelect)||void 0===i||i.call(t,e,e,n,r)}};return th.jsx(nr.Provider,{value:r,children:n})}function ni(){var e=(0,d.useContext)(nr);if(!e)throw Error("useSelectSingle must be used within a SelectSingleProvider");return e}function nl(e){var t,n,r,o,a,i,l,s,u,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U=(0,d.useRef)(null),K=(t=e.date,n=e.displayMonth,i=tS(),l=nn(),s=t9(t,t7(),n),u=tS(),f=ni(),p=tK(),h=tG(),g=(m=nn()).focusDayAfter,v=m.focusDayBefore,y=m.focusWeekAfter,b=m.focusWeekBefore,x=m.blur,w=m.focus,k=m.focusMonthBefore,S=m.focusMonthAfter,E=m.focusYearBefore,O=m.focusYearAfter,C=m.focusStartOfWeek,j=m.focusEndOfWeek,_={onClick:function(e){var n,r,o,a;tv(u)?null===(n=f.onDayClick)||void 0===n||n.call(f,t,s,e):tm(u)?null===(r=p.onDayClick)||void 0===r||r.call(p,t,s,e):tg(u)?null===(o=h.onDayClick)||void 0===o||o.call(h,t,s,e):null===(a=u.onDayClick)||void 0===a||a.call(u,t,s,e)},onFocus:function(e){var n;w(t),null===(n=u.onDayFocus)||void 0===n||n.call(u,t,s,e)},onBlur:function(e){var n;x(),null===(n=u.onDayBlur)||void 0===n||n.call(u,t,s,e)},onKeyDown:function(e){var n;switch(e.key){case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?g():v();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?v():g();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),y();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),b();break;case"PageUp":e.preventDefault(),e.stopPropagation(),e.shiftKey?E():k();break;case"PageDown":e.preventDefault(),e.stopPropagation(),e.shiftKey?O():S();break;case"Home":e.preventDefault(),e.stopPropagation(),C();break;case"End":e.preventDefault(),e.stopPropagation(),j()}null===(n=u.onDayKeyDown)||void 0===n||n.call(u,t,s,e)},onKeyUp:function(e){var n;null===(n=u.onDayKeyUp)||void 0===n||n.call(u,t,s,e)},onMouseEnter:function(e){var n;null===(n=u.onDayMouseEnter)||void 0===n||n.call(u,t,s,e)},onMouseLeave:function(e){var n;null===(n=u.onDayMouseLeave)||void 0===n||n.call(u,t,s,e)},onPointerEnter:function(e){var n;null===(n=u.onDayPointerEnter)||void 0===n||n.call(u,t,s,e)},onPointerLeave:function(e){var n;null===(n=u.onDayPointerLeave)||void 0===n||n.call(u,t,s,e)},onTouchCancel:function(e){var n;null===(n=u.onDayTouchCancel)||void 0===n||n.call(u,t,s,e)},onTouchEnd:function(e){var n;null===(n=u.onDayTouchEnd)||void 0===n||n.call(u,t,s,e)},onTouchMove:function(e){var n;null===(n=u.onDayTouchMove)||void 0===n||n.call(u,t,s,e)},onTouchStart:function(e){var n;null===(n=u.onDayTouchStart)||void 0===n||n.call(u,t,s,e)}},P=tS(),N=ni(),T=tK(),A=tG(),M=tv(P)?N.selected:tm(P)?T.selected:tg(P)?A.selected:void 0,I=!!(i.onDayClick||"default"!==i.mode),(0,d.useEffect)(function(){var e;!s.outside&&l.focusedDay&&I&&tr(l.focusedDay,t)&&(null===(e=U.current)||void 0===e||e.focus())},[l.focusedDay,t,U,I,s.outside]),D=(R=[i.classNames.day],Object.keys(s).forEach(function(e){var t=i.modifiersClassNames[e];if(t)R.push(t);else if(Object.values(c).includes(e)){var n=i.classNames["day_".concat(e)];n&&R.push(n)}}),R).join(" "),L=tu({},i.styles.day),Object.keys(s).forEach(function(e){var t;L=tu(tu({},L),null===(t=i.modifiersStyles)||void 0===t?void 0:t[e])}),Z=L,z=!!(s.outside&&!i.showOutsideDays||s.hidden),B=null!==(a=null===(o=i.components)||void 0===o?void 0:o.DayContent)&&void 0!==a?a:tH,F={style:Z,className:D,children:th.jsx(B,{date:t,displayMonth:n,activeModifiers:s}),role:"gridcell"},H=l.focusTarget&&tr(l.focusTarget,t)&&!s.outside,q=l.focusedDay&&tr(l.focusedDay,t),W=tu(tu(tu({},F),((r={disabled:s.disabled,role:"gridcell"})["aria-selected"]=s.selected,r.tabIndex=q||H?0:-1,r)),_),{isButton:I,isHidden:z,activeModifiers:s,selectedDays:M,buttonProps:W,divProps:F});return K.isHidden?th.jsx("div",{role:"gridcell"}):K.isButton?th.jsx(tR,tu({name:"day",ref:U},K.buttonProps)):th.jsx("div",tu({},K.divProps))}function ns(e){var t=e.number,n=e.dates,r=tS(),o=r.onWeekNumberClick,a=r.styles,i=r.classNames,l=r.locale,s=r.labels.labelWeekNumber,c=(0,r.formatters.formatWeekNumber)(Number(t),{locale:l});if(!o)return th.jsx("span",{className:i.weeknumber,style:a.weeknumber,children:c});var u=s(Number(t),{locale:l});return th.jsx(tR,{name:"week-number","aria-label":u,className:i.weeknumber,style:a.weeknumber,onClick:function(e){o(t,n,e)},children:c})}function nc(e){var t,n,r,o=tS(),a=o.styles,i=o.classNames,l=o.showWeekNumber,s=o.components,c=null!==(t=null==s?void 0:s.Day)&&void 0!==t?t:nl,u=null!==(n=null==s?void 0:s.WeekNumber)&&void 0!==n?n:ns;return l&&(r=th.jsx("td",{className:i.cell,style:a.cell,children:th.jsx(u,{number:e.weekNumber,dates:e.dates})})),th.jsxs("tr",{className:i.row,style:a.row,children:[r,e.dates.map(function(t){return th.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:th.jsx(c,{displayMonth:e.displayMonth,date:t})},function(e){return(0,ea.Z)(1,arguments),Math.floor(function(e){return(0,ea.Z)(1,arguments),(0,eo.Z)(e).getTime()}(e)/1e3)}(t))})]})}function nu(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?tc(t):ts(t,n),o=(null==n?void 0:n.ISOWeek)?tn(e):tt(e,n),a=ta(r,o),i=[],l=0;l<=a;l++)i.push((0,eh.Z)(o,l));return i.reduce(function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((tn(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=tn(r),a=new Date(0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);var i=tn(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),tn(n)})(t).getTime())/6048e5)+1}(t):function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((tt(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var h=tt(p,t),m=new Date(0);m.setFullYear(d,0,f),m.setHours(0,0,0,0);var g=tt(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(d,0,u),f.setHours(0,0,0,0),tt(f,t)})(n,t).getTime())/6048e5)+1}(t,n),o=e.find(function(e){return e.weekNumber===r});return o?o.dates.push(t):e.push({weekNumber:r,dates:[t]}),e},[])}function nd(e){var t,n,r,o=tS(),a=o.locale,i=o.classNames,l=o.styles,s=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,p=o.ISOWeek,h=function(e,t){var n=nu(es(e),e3(e),t);if(null==t?void 0:t.useFixedWeeks){var r=function(e,t){return(0,ea.Z)(1,arguments),function(e,t,n){(0,ea.Z)(2,arguments);var r=tt(e,n),o=tt(t,n);return Math.round((r.getTime()-eD(r)-(o.getTime()-eD(o)))/6048e5)}(function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),es(e),t)+1}(e,t);if(r<6){var o=n[n.length-1],a=o.dates[o.dates.length-1],i=ti(a,6-r),l=nu(ti(a,1),i,t);n.push.apply(n,l)}}return n}(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:a,weekStartsOn:d,firstWeekContainsDate:f}),m=null!==(t=null==u?void 0:u.Head)&&void 0!==t?t:tF,g=null!==(n=null==u?void 0:u.Row)&&void 0!==n?n:nc,v=null!==(r=null==u?void 0:u.Footer)&&void 0!==r?r:tz;return th.jsxs("table",{id:e.id,className:i.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!s&&th.jsx(m,{}),th.jsx("tbody",{className:i.tbody,style:l.tbody,children:h.map(function(t){return th.jsx(g,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),th.jsx(v,{displayMonth:e.displayMonth})]})}var nf="undefined"!=typeof window&&window.document&&window.document.createElement?d.useLayoutEffect:d.useEffect,np=!1,nh=0;function nm(){return"react-day-picker-".concat(++nh)}function ng(e){var t,n,r,o,a,i,l,s,c=tS(),u=c.dir,f=c.classNames,p=c.styles,h=c.components,m=tT().displayMonths,g=(r=null!=(t=c.id?"".concat(c.id,"-").concat(e.displayIndex):void 0)?t:np?nm():null,a=(o=(0,d.useState)(r))[0],i=o[1],nf(function(){null===a&&i(nm())},[]),(0,d.useEffect)(function(){!1===np&&(np=!0)},[]),null!==(n=null!=t?t:a)&&void 0!==n?n:void 0),v=c.id?"".concat(c.id,"-grid-").concat(e.displayIndex):void 0,y=[f.month],b=p.month,x=0===e.displayIndex,w=e.displayIndex===m.length-1,k=!x&&!w;"rtl"===u&&(w=(l=[x,w])[0],x=l[1]),x&&(y.push(f.caption_start),b=tu(tu({},b),p.caption_start)),w&&(y.push(f.caption_end),b=tu(tu({},b),p.caption_end)),k&&(y.push(f.caption_between),b=tu(tu({},b),p.caption_between));var S=null!==(s=null==h?void 0:h.Caption)&&void 0!==s?s:tZ;return th.jsxs("div",{className:y.join(" "),style:b,children:[th.jsx(S,{id:g,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(nd,{id:v,"aria-labelledby":g,displayMonth:e.displayMonth})]},e.displayIndex)}function nv(e){var t=tS(),n=t.classNames,r=t.styles;return th.jsx("div",{className:n.months,style:r.months,children:e.children})}function ny(e){var t,n,r=e.initialProps,o=tS(),a=nn(),i=tT(),l=(0,d.useState)(!1),s=l[0],c=l[1];(0,d.useEffect)(function(){o.initialFocus&&a.focusTarget&&(s||(a.focus(a.focusTarget),c(!0)))},[o.initialFocus,s,a.focus,a.focusTarget,a]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=tu(tu({},o.styles.root),o.style),p=Object.keys(r).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var n;return tu(tu({},e),((n={})[t]=r[t],n))},{}),h=null!==(n=null===(t=r.components)||void 0===t?void 0:t.Months)&&void 0!==n?n:nv;return th.jsx("div",tu({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:th.jsx(h,{children:i.displayMonths.map(function(e,t){return th.jsx(ng,{displayIndex:t,displayMonth:e},t)})})}))}function nb(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}(e,["children"]);return th.jsx(tk,{initialProps:n,children:th.jsx(tN,{children:th.jsx(no,{initialProps:n,children:th.jsx(tW,{initialProps:n,children:th.jsx(tV,{initialProps:n,children:th.jsx(t8,{children:th.jsx(nt,{children:t})})})})})})})}function nx(e){return th.jsx(nb,tu({},e,{children:th.jsx(ny,{initialProps:e})}))}let nw=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))},nk=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))},nS=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))},nE=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))};var nO=n(84264);n(41649);var nC=n(1526),nj=n(7084),n_=n(26898);let nP={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},nN={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},nT={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},nA={[nj.wu.Increase]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.ModerateIncrease]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.Decrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.ModerateDecrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.Unchanged]:{bgColor:(0,eJ.bM)(nj.fr.Orange,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Orange,n_.K.text).textColor}},nM={[nj.wu.Increase]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))},[nj.wu.ModerateIncrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))},[nj.wu.Decrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))},[nj.wu.ModerateDecrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))},[nj.wu.Unchanged]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))}},nI=(0,eJ.fn)("BadgeDelta");d.forwardRef((e,t)=>{let{deltaType:n=nj.wu.Increase,isIncreasePositive:r=!0,size:o=nj.u8.SM,tooltip:a,children:i,className:l}=e,s=(0,u._T)(e,["deltaType","isIncreasePositive","size","tooltip","children","className"]),c=nM[n],f=(0,eJ.Fo)(n,r),p=i?nN:nP,{tooltipProps:h,getReferenceProps:m}=(0,nC.l)();return d.createElement("span",Object.assign({ref:(0,eJ.lq)([t,h.refs.setReference]),className:(0,ec.q)(nI("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full bg-opacity-20 dark:bg-opacity-25",nA[f].bgColor,nA[f].textColor,p[o].paddingX,p[o].paddingY,p[o].fontSize,l)},m,s),d.createElement(nC.Z,Object.assign({text:a},h)),d.createElement(c,{className:(0,ec.q)(nI("icon"),"shrink-0",i?(0,ec.q)("-ml-1 mr-1.5"):nT[o].height,nT[o].width)}),i?d.createElement("p",{className:(0,ec.q)(nI("text"),"text-sm whitespace-nowrap")},i):null)}).displayName="BadgeDelta";var nR=n(47323);let nD=e=>{var{onClick:t,icon:n}=e,r=(0,u._T)(e,["onClick","icon"]);return d.createElement("button",Object.assign({type:"button",className:(0,ec.q)("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},r),d.createElement(nR.Z,{onClick:t,icon:n,variant:"simple",color:"slate",size:"sm"}))};function nL(e){var{mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,enableYearNavigation:l,classNames:s,weekStartsOn:c=0}=e,f=(0,u._T)(e,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return d.createElement(nx,Object.assign({showOutsideDays:!0,mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,weekStartsOn:c,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},s),components:{IconLeft:e=>{var t=(0,u._T)(e,[]);return d.createElement(nw,Object.assign({className:"h-4 w-4"},t))},IconRight:e=>{var t=(0,u._T)(e,[]);return d.createElement(nk,Object.assign({className:"h-4 w-4"},t))},Caption:e=>{var t=(0,u._T)(e,[]);let{goToMonth:n,nextMonth:r,previousMonth:o,currentMonth:i}=tT();return d.createElement("div",{className:"flex justify-between items-center"},d.createElement("div",{className:"flex items-center space-x-1"},l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,-1)),icon:nS}),d.createElement(nD,{onClick:()=>o&&n(o),icon:nw})),d.createElement(nO.Z,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},eQ(t.displayMonth,"LLLL yyy",{locale:a})),d.createElement("div",{className:"flex items-center space-x-1"},d.createElement(nD,{onClick:()=>r&&n(r),icon:nk}),l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,1)),icon:nE})))}}},f))}nL.displayName="DateRangePicker",n(27281);var nZ=n(57365),nz=n(44140);let nB=el(),nF=d.forwardRef((e,t)=>{var n,r;let{value:o,defaultValue:a,onValueChange:i,enableSelect:l=!0,minDate:s,maxDate:c,placeholder:f="Select range",selectPlaceholder:p="Select range",disabled:h=!1,locale:m=eK,enableClear:g=!0,displayFormat:v,children:y,className:b,enableYearNavigation:x=!1,weekStartsOn:w=0,disabledDates:k}=e,S=(0,u._T)(e,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[E,O]=(0,nz.Z)(a,o),[C,j]=(0,d.useState)(!1),[_,P]=(0,d.useState)(!1),N=(0,d.useMemo)(()=>{let e=[];return s&&e.push({before:s}),c&&e.push({after:c}),[...e,...null!=k?k:[]]},[s,c,k]),T=(0,d.useMemo)(()=>{let e=new Map;return y?d.Children.forEach(y,t=>{var n;e.set(t.props.value,{text:null!==(n=(0,eu.qg)(t))&&void 0!==n?n:t.props.value,from:t.props.from,to:t.props.to})}):e6.forEach(t=>{e.set(t.value,{text:t.text,from:t.from,to:nB})}),e},[y]),A=(0,d.useMemo)(()=>{if(y)return(0,eu.sl)(y);let e=new Map;return e6.forEach(t=>e.set(t.value,t.text)),e},[y]),M=(null==E?void 0:E.selectValue)||"",I=e1(null==E?void 0:E.from,s,M,T),R=e2(null==E?void 0:E.to,c,M,T),D=I||R?e4(I,R,m,v):f,L=es(null!==(r=null!==(n=null!=R?R:I)&&void 0!==n?n:c)&&void 0!==r?r:nB),Z=g&&!h;return d.createElement("div",Object.assign({ref:t,className:(0,ec.q)("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",b)},S),d.createElement(J,{as:"div",className:(0,ec.q)("w-full",l?"rounded-l-tremor-default":"rounded-tremor-default",C&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},d.createElement("div",{className:"relative w-full"},d.createElement(J.Button,{onFocus:()=>j(!0),onBlur:()=>j(!1),disabled:h,className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",l?"rounded-l-tremor-default":"rounded-tremor-default",Z?"pr-8":"pr-4",(0,eu.um)((0,eu.Uh)(I||R),h))},d.createElement(en,{className:(0,ec.q)(e0("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),d.createElement("p",{className:"truncate"},D)),Z&&I?d.createElement("button",{type:"button",className:(0,ec.q)("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==i||i({}),O({})}},d.createElement(er.Z,{className:(0,ec.q)(e0("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),d.createElement(ee.u,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(J.Panel,{focus:!0,className:(0,ec.q)("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},d.createElement(nL,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:L,selected:{from:I,to:R},onSelect:e=>{null==i||i({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),O({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:m,disabled:N,enableYearNavigation:x,classNames:{day_range_middle:(0,ec.q)("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:w},e))))),l&&d.createElement(et.R,{as:"div",className:(0,ec.q)("w-48 -ml-px rounded-r-tremor-default",_&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:M,onChange:e=>{let{from:t,to:n}=T.get(e),r=null!=n?n:nB;null==i||i({from:t,to:r,selectValue:e}),O({from:t,to:r,selectValue:e})},disabled:h},e=>{var t;let{value:n}=e;return d.createElement(d.Fragment,null,d.createElement(et.R.Button,{onFocus:()=>P(!0),onBlur:()=>P(!1),className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",(0,eu.um)((0,eu.Uh)(n),h))},n&&null!==(t=A.get(n))&&void 0!==t?t:p),d.createElement(ee.u,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(et.R.Options,{className:(0,ec.q)("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=y?y:e6.map(e=>d.createElement(nZ.Z,{key:e.value,value:e.value},e.text)))))}))});nF.displayName="DateRangePicker"},92414:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(5853),o=n(2265);n(42698),n(64016),n(8710);var a=n(33232),i=n(44140),l=n(58747);let s=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var c=n(4537),u=n(28517),d=n(33044);let f=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),o.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var p=n(97324),h=n(1153),m=n(96398);let g=(0,h.fn)("MultiSelect"),v=o.forwardRef((e,t)=>{let{defaultValue:n,value:h,onValueChange:v,placeholder:y="Select...",placeholderSearch:b="Search",disabled:x=!1,icon:w,children:k,className:S}=e,E=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[O,C]=(0,i.Z)(n,h),{reactElementChildren:j,optionsAvailable:_}=(0,o.useMemo)(()=>{let e=o.Children.toArray(k).filter(o.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,m.n0)("",e)}},[k]),[P,N]=(0,o.useState)(""),T=(null!=O?O:[]).length>0,A=(0,o.useMemo)(()=>P?(0,m.n0)(P,j):_,[P,j,_]),M=()=>{N("")};return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:O,value:O,onChange:e=>{null==v||v(e),C(e)},disabled:x,className:(0,p.q)("w-full min-w-[10rem] relative text-tremor-default",S)},E,{multiple:!0}),e=>{let{value:t}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,p.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,m.um)(t.length>0,x))},w&&o.createElement("span",{className:(0,p.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(w,{className:(0,p.q)(g("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("div",{className:"h-6 flex items-center"},t.length>0?o.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,n)=>{var r;return o.createElement("div",{key:n,className:(0,p.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},o.createElement("div",{className:"text-xs truncate "},null!==(r=e.props.children)&&void 0!==r?r:e.props.value),o.createElement("div",{onClick:n=>{n.preventDefault();let r=t.filter(t=>t!==e.props.value);null==v||v(r),C(r)}},o.createElement(f,{className:(0,p.q)(g("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):o.createElement("span",null,y)),o.createElement("span",{className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},o.createElement(l.Z,{className:(0,p.q)(g("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),T&&!x?o.createElement("button",{type:"button",className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),C([]),null==v||v([])}},o.createElement(c.Z,{className:(0,p.q)(g("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,p.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},o.createElement("div",{className:(0,p.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},o.createElement("span",null,o.createElement(s,{className:(0,p.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:b,className:(0,p.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>N(e.target.value),value:P})),o.createElement(a.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:M}},{value:{selectedValue:t}}),A))))})});v.displayName="MultiSelect"},46030:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698),n(64016),n(8710);var o=n(33232),a=n(2265),i=n(97324),l=n(1153),s=n(28517);let c=(0,l.fn)("MultiSelectItem"),u=a.forwardRef((e,t)=>{let{value:n,className:u,children:d}=e,f=(0,r._T)(e,["value","className","children"]),{selectedValue:p}=(0,a.useContext)(o.Z),h=(0,l.NZ)(n,p);return a.createElement(s.R.Option,Object.assign({className:(0,i.q)(c("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",u),ref:t,key:n,value:n},f),a.createElement("input",{type:"checkbox",className:(0,i.q)(c("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),a.createElement("span",{className:"whitespace-nowrap truncate"},null!=d?d:n))});u.displayName="MultiSelectItem"},30150:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var l=n(97324),s=n(1153),c=n(69262);let u="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",f=o.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:f=!0,disabled:p,onValueChange:h,onChange:m}=e,g=(0,r._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),v=(0,o.useRef)(null),[y,b]=o.useState(!1),x=o.useCallback(()=>{b(!0)},[]),w=o.useCallback(()=>{b(!1)},[]),[k,S]=o.useState(!1),E=o.useCallback(()=>{S(!0)},[]),O=o.useCallback(()=>{S(!1)},[]);return o.createElement(c.Z,Object.assign({type:"number",ref:(0,s.lq)([v,t]),disabled:p,makeInputClassName:(0,s.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=v.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&O()},onChange:e=>{p||(null==h||h(parseFloat(e.target.value)),null==m||m(e))},stepper:f?o.createElement("div",{className:(0,l.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepDown(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(i,{"data-testid":"step-down",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepUp(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-up",className:(k?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},g))});f.displayName="NumberInput"},27281:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(5853),o=n(2265),a=n(58747),i=n(4537),l=n(97324),s=n(1153),c=n(96398),u=n(28517),d=n(33044),f=n(44140);let p=(0,s.fn)("Select"),h=o.forwardRef((e,t)=>{let{defaultValue:n,value:s,onValueChange:h,placeholder:m="Select...",disabled:g=!1,icon:v,enableClear:y=!0,children:b,className:x}=e,w=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","children","className"]),[k,S]=(0,f.Z)(n,s),E=(0,o.useMemo)(()=>{let e=o.Children.toArray(b).filter(o.isValidElement);return(0,c.sl)(e)},[b]);return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:k,value:k,onChange:e=>{null==h||h(e),S(e)},disabled:g,className:(0,l.q)("w-full min-w-[10rem] relative text-tremor-default",x)},w),e=>{var t;let{value:n}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,l.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",v?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(n),g))},v&&o.createElement("span",{className:(0,l.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(v,{className:(0,l.q)(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},n&&null!==(t=E.get(n))&&void 0!==t?t:m),o.createElement("span",{className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,l.q)(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),y&&k?o.createElement("button",{type:"button",className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),S(""),null==h||h("")}},o.createElement(i.Z,{className:(0,l.q)(p("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,l.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},b)))})});h.displayName="Select"},57365:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(28517),i=n(97324);let l=(0,n(1153).fn)("SelectItem"),s=o.forwardRef((e,t)=>{let{value:n,icon:s,className:c,children:u}=e,d=(0,r._T)(e,["value","icon","className","children"]);return o.createElement(a.R.Option,Object.assign({className:(0,i.q)(l("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:n,value:n},d),s&&o.createElement(s,{className:(0,i.q)(l("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),o.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:n))});s.displayName="SelectItem"},92858:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var r=n(5853),o=n(2265),a=n(62963),i=n(90945),l=n(13323),s=n(17684),c=n(80004),u=n(93689),d=n(38198),f=n(47634),p=n(56314),h=n(27847),m=n(64518);let g=(0,o.createContext)(null),v=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-description-".concat(n),...a}=e,i=function e(){let t=(0,o.useContext)(g);if(null===t){let t=Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),l=(0,u.T)(t);(0,m.e)(()=>i.register(r),[r,i.register]);let c={ref:l,...i.props,id:r};return(0,h.sY)({ourProps:c,theirProps:a,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})}),{});var y=n(37388);let b=(0,o.createContext)(null),x=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-label-".concat(n),passive:a=!1,...i}=e,l=function e(){let t=(0,o.useContext)(b);if(null===t){let t=Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),c=(0,u.T)(t);(0,m.e)(()=>l.register(r),[r,l.register]);let d={ref:c,...l.props,id:r};return a&&("onClick"in d&&(delete d.htmlFor,delete d.onClick),"onClick"in i&&delete i.onClick),(0,h.sY)({ourProps:d,theirProps:i,slot:l.slot||{},defaultTag:"label",name:l.name||"Label"})}),{}),w=(0,o.createContext)(null);w.displayName="GroupContext";let k=o.Fragment,S=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-switch-".concat(n),checked:m,defaultChecked:g=!1,onChange:v,name:b,value:x,form:k,...S}=e,E=(0,o.useContext)(w),O=(0,o.useRef)(null),C=(0,u.T)(O,t,null===E?null:E.setSwitch),[j,_]=(0,a.q)(m,v,g),P=(0,l.z)(()=>null==_?void 0:_(!j)),N=(0,l.z)(e=>{if((0,f.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),P()}),T=(0,l.z)(e=>{e.key===y.R.Space?(e.preventDefault(),P()):e.key===y.R.Enter&&(0,p.g)(e.currentTarget)}),A=(0,l.z)(e=>e.preventDefault()),M=(0,o.useMemo)(()=>({checked:j}),[j]),I={id:r,ref:C,role:"switch",type:(0,c.f)(e,O),tabIndex:0,"aria-checked":j,"aria-labelledby":null==E?void 0:E.labelledby,"aria-describedby":null==E?void 0:E.describedby,onClick:N,onKeyUp:T,onKeyPress:A},R=(0,i.G)();return(0,o.useEffect)(()=>{var e;let t=null==(e=O.current)?void 0:e.closest("form");t&&void 0!==g&&R.addEventListener(t,"reset",()=>{_(g)})},[O,_]),o.createElement(o.Fragment,null,null!=b&&j&&o.createElement(d._,{features:d.A.Hidden,...(0,h.oA)({as:"input",type:"checkbox",hidden:!0,readOnly:!0,form:k,checked:j,name:b,value:x})}),(0,h.sY)({ourProps:I,theirProps:S,slot:M,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[n,r]=(0,o.useState)(null),[a,i]=function(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(b.Provider,{value:r},e.children)},[t])]}(),[s,c]=function(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(g.Provider,{value:r},e.children)},[t])]}(),u=(0,o.useMemo)(()=>({switch:n,setSwitch:r,labelledby:a,describedby:s}),[n,r,a,s]);return o.createElement(c,{name:"Switch.Description"},o.createElement(i,{name:"Switch.Label",props:{htmlFor:null==(t=u.switch)?void 0:t.id,onClick(e){n&&("LABEL"===e.currentTarget.tagName&&e.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},o.createElement(w.Provider,{value:u},(0,h.sY)({ourProps:{},theirProps:e,defaultTag:k,name:"Switch.Group"}))))},Label:x,Description:v});var E=n(44140),O=n(26898),C=n(97324),j=n(1153),_=n(1526);let P=(0,j.fn)("Switch"),N=o.forwardRef((e,t)=>{let{checked:n,defaultChecked:a=!1,onChange:i,color:l,name:s,error:c,errorMessage:u,disabled:d,required:f,tooltip:p,id:h}=e,m=(0,r._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:l?(0,j.bM)(l,O.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:l?(0,j.bM)(l,O.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,y]=(0,E.Z)(a,n),[b,x]=(0,o.useState)(!1),{tooltipProps:w,getReferenceProps:k}=(0,_.l)(300);return o.createElement("div",{className:"flex flex-row items-center justify-start"},o.createElement(_.Z,Object.assign({text:p},w)),o.createElement("div",Object.assign({ref:(0,j.lq)([t,w.refs.setReference]),className:(0,C.q)(P("root"),"flex flex-row relative h-5")},m,k),o.createElement("input",{type:"checkbox",className:(0,C.q)(P("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:s,required:f,checked:v,onChange:e=>{e.preventDefault()}}),o.createElement(S,{checked:v,onChange:e=>{y(e),null==i||i(e)},disabled:d,className:(0,C.q)(P("switch"),"w-10 h-5 group relative inline-flex flex-shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>x(!0),onBlur:()=>x(!1),id:h},o.createElement("span",{className:(0,C.q)(P("sr-only"),"sr-only")},"Switch ",v?"on":"off"),o.createElement("span",{"aria-hidden":"true",className:(0,C.q)(P("background"),v?g.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),o.createElement("span",{"aria-hidden":"true",className:(0,C.q)(P("round"),v?(0,C.q)(g.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",b?(0,C.q)("ring-2",g.ringColor):"")}))),c&&u?o.createElement("p",{className:(0,C.q)(P("errorMessage"),"text-sm text-red-500 mt-1 ")},u):null)});N.displayName="Switch"},12485:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(31492),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(35242),u=n(42698);n(64016),n(8710),n(33232);let d=(0,l.fn)("Tab"),f=s.forwardRef((e,t)=>{let{icon:n,className:f,children:p}=e,h=(0,r._T)(e,["icon","className","children"]),m=(0,s.useContext)(c.O),g=(0,s.useContext)(u.Z);return s.createElement(o.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",g?(0,l.bM)(g,a.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,l.bM)(t,a.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,l.bM)(t,a.K.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}(m,g),f)},h),n?s.createElement(n,{className:(0,i.q)(d("icon"),"flex-none h-5 w-5",p?"mr-2":"")}):null,p?s.createElement("span",null,p):null)});f.displayName="Tab"},18135:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(31492),a=n(97324),i=n(1153),l=n(2265);let s=(0,i.fn)("TabGroup"),c=l.forwardRef((e,t)=>{let{defaultIndex:n,index:i,onIndexChange:c,children:u,className:d}=e,f=(0,r._T)(e,["defaultIndex","index","onIndexChange","children","className"]);return l.createElement(o.O.Group,Object.assign({as:"div",ref:t,defaultIndex:n,selectedIndex:i,onChange:c,className:(0,a.q)(s("root"),"w-full",d)},f),u)});c.displayName="TabGroup"},35242:function(e,t,n){"use strict";n.d(t,{O:function(){return c},Z:function(){return d}});var r=n(5853),o=n(2265),a=n(42698);n(64016),n(8710),n(33232);var i=n(31492),l=n(97324);let s=(0,n(1153).fn)("TabList"),c=(0,o.createContext)("line"),u={line:(0,l.q)("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:(0,l.q)("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},d=o.forwardRef((e,t)=>{let{color:n,variant:d="line",children:f,className:p}=e,h=(0,r._T)(e,["color","variant","children","className"]);return o.createElement(i.O.List,Object.assign({ref:t,className:(0,l.q)(s("root"),"justify-start overflow-x-clip",u[d],p)},h),o.createElement(c.Provider,{value:d},o.createElement(a.Z.Provider,{value:n},f)))});d.displayName="TabList"},29706:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698);var o=n(64016);n(8710);var a=n(33232),i=n(97324),l=n(1153),s=n(2265);let c=(0,l.fn)("TabPanel"),u=s.forwardRef((e,t)=>{let{children:n,className:l}=e,u=(0,r._T)(e,["children","className"]),{selectedValue:d}=(0,s.useContext)(a.Z),f=d===(0,s.useContext)(o.Z);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)(c("root"),"w-full mt-2",f?"":"hidden",l),"aria-selected":f?"true":"false"},u),n)});u.displayName="TabPanel"},77991:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(31492);n(42698);var a=n(64016);n(8710);var i=n(33232),l=n(97324),s=n(1153),c=n(2265);let u=(0,s.fn)("TabPanels"),d=c.forwardRef((e,t)=>{let{children:n,className:s}=e,d=(0,r._T)(e,["children","className"]);return c.createElement(o.O.Panels,Object.assign({as:"div",ref:t,className:(0,l.q)(u("root"),"w-full",s)},d),e=>{let{selectedIndex:t}=e;return c.createElement(i.Z.Provider,{value:{selectedValue:t}},c.Children.map(n,(e,t)=>c.createElement(a.Z.Provider,{value:t},e)))})});d.displayName="TabPanels"},49566:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265);n(97324);var a=n(1153),i=n(69262);let l=(0,a.fn)("TextInput"),s=o.forwardRef((e,t)=>{let{type:n="text"}=e,a=(0,r._T)(e,["type"]);return o.createElement(i.Z,Object.assign({ref:t,type:n,makeInputClassName:l},a))});s.displayName="TextInput"},16853:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(96398),a=n(44140),i=n(2265),l=n(97324),s=n(1153);let c=(0,s.fn)("Textarea"),u=i.forwardRef((e,t)=>{let{value:n,defaultValue:u="",placeholder:d="Type...",error:f=!1,errorMessage:p,disabled:h=!1,className:m,onChange:g,onValueChange:v}=e,y=(0,r._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[b,x]=(0,a.Z)(u,n),w=(0,i.useRef)(null),k=(0,o.Uh)(b);return i.createElement(i.Fragment,null,i.createElement("textarea",Object.assign({ref:(0,s.lq)([w,t]),value:b,placeholder:d,disabled:h,className:(0,l.q)(c("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,o.um)(k,h,f),h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",m),"data-testid":"text-area",onChange:e=>{null==g||g(e),x(e.target.value),null==v||v(e.target.value)}},y)),f&&p?i.createElement("p",{className:(0,l.q)(c("errorMessage"),"text-sm text-red-500 mt-1")},p):null)});u.displayName="Textarea"},96398:function(e,t,n){"use strict";n.d(t,{Uh:function(){return c},n0:function(){return l},qg:function(){return a},sl:function(){return i},um:function(){return s}});var r=n(97324),o=n(2265);let a=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(a).join(""):"object"==typeof e&&e?a(e.props.children):void 0;function i(e){let t=new Map;return o.Children.map(e,e=>{var n;t.set(e.props.value,null!==(n=a(e))&&void 0!==n?n:e.props.value)}),t}function l(e,t){return o.Children.map(t,t=>{var n;if((null!==(n=a(t))&&void 0!==n?n:t.props.value).toLowerCase().includes(e.toLowerCase()))return t})}let s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.q)(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",n&&"text-red-500",n?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function c(e){return null!=e&&""!==e}},87452:function(e,t,n){"use strict";n.d(t,{Z:function(){return d},r:function(){return u}});var r=n(5853),o=n(21886);n(42698),n(64016);var a=n(8710);n(33232);var i=n(97324),l=n(1153),s=n(2265);let c=(0,l.fn)("Accordion"),u=(0,s.createContext)({isOpen:!1}),d=s.forwardRef((e,t)=>{var n;let{defaultOpen:l=!1,children:d,className:f}=e,p=(0,r._T)(e,["defaultOpen","children","className"]),h=null!==(n=(0,s.useContext)(a.Z))&&void 0!==n?n:(0,i.q)("rounded-tremor-default border");return s.createElement(o.p,Object.assign({as:"div",ref:t,className:(0,i.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",h,f),defaultOpen:l},p),e=>{let{open:t}=e;return s.createElement(u.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(21886),i=n(97324);let l=(0,n(1153).fn)("AccordionBody"),s=o.forwardRef((e,t)=>{let{children:n,className:s}=e,c=(0,r._T)(e,["children","className"]);return o.createElement(a.p.Panel,Object.assign({ref:t,className:(0,i.q)(l("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",s)},c),n)});s.displayName="AccordionBody"},72208:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(2265),a=n(21886);let i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var l=n(87452),s=n(97324);let c=(0,n(1153).fn)("AccordionHeader"),u=o.forwardRef((e,t)=>{let{children:n,className:u}=e,d=(0,r._T)(e,["children","className"]),{isOpen:f}=(0,o.useContext)(l.r);return o.createElement(a.p.Button,Object.assign({ref:t,className:(0,s.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),o.createElement("div",{className:(0,s.q)(c("children"),"flex flex-1 text-inherit mr-4")},n),o.createElement("div",null,o.createElement(i,{className:(0,s.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",f?"transition-all":"transition-all -rotate-180")})))});u.displayName="AccordionHeader"},67982:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265);let l=(0,a.fn)("Divider"),s=i.forwardRef((e,t)=>{let{className:n,children:a}=e,s=(0,r._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(l("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",n)},s),a?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,o.q)("text-inherit whitespace-nowrap")},a),i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});s.displayName="Divider"},49804:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265),l=n(9496);let s=(0,a.fn)("Col"),c=i.forwardRef((e,t)=>{let{numColSpan:n=1,numColSpanSm:a,numColSpanMd:c,numColSpanLg:u,children:d,className:f}=e,p=(0,r._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),h=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),(()=>{let e=h(n,l.PT),t=h(a,l.SP),r=h(c,l.VS),i=h(u,l._w);return(0,o.q)(e,t,r,i)})(),f)},p),d)});c.displayName="Col"},67101:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265),l=n(9496);let s=(0,a.fn)("Grid"),c=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",u=i.forwardRef((e,t)=>{let{numItems:n=1,numItemsSm:a,numItemsMd:u,numItemsLg:d,children:f,className:p}=e,h=(0,r._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),m=c(n,l._m),g=c(a,l.LH),v=c(u,l.l5),y=c(d,l.N4),b=(0,o.q)(m,g,v,y);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),"grid",b,p)},h),f)});u.displayName="Grid"},9496:function(e,t,n){"use strict";n.d(t,{LH:function(){return o},N4:function(){return i},PT:function(){return l},SP:function(){return s},VS:function(){return c},_m:function(){return r},_w:function(){return u},l5:function(){return a}});let r={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},o={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},a={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},i={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},l={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},s={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},c={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},u={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},94789:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(2265),a=n(26898),i=n(97324),l=n(1153);let s=(0,l.fn)("Callout"),c=o.forwardRef((e,t)=>{let{title:n,icon:c,color:u,className:d,children:f}=e,p=(0,r._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",u?(0,i.q)((0,l.bM)(u,a.K.background).bgColor,(0,l.bM)(u,a.K.darkBorder).borderColor,(0,l.bM)(u,a.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,i.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),d)},p),o.createElement("div",{className:(0,i.q)(s("header"),"flex items-start")},c?o.createElement(c,{className:(0,i.q)(s("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,i.q)(s("title"),"font-semibold")},n)),o.createElement("p",{className:(0,i.q)(s("body"),"overflow-y-auto",f?"mt-2":"")},f))});c.displayName="Callout"},35829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(26898),a=n(97324),i=n(1153),l=n(2265);let s=l.forwardRef((e,t)=>{let{color:n,children:s,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)("font-semibold text-tremor-metric",n?(0,i.bM)(n,o.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},u),s)});s.displayName="Metric"},97765:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(26898),a=n(97324),i=n(1153),l=n(2265);let s=l.forwardRef((e,t)=>{let{color:n,children:s,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)(n?(0,i.bM)(n,o.K.lightText).textColor:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c)},u),s)});s.displayName="Subtitle"},96889:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(2265),a=n(26898),i=n(97324),l=n(1153);let s=(0,l.fn)("BarList"),c=o.forwardRef((e,t)=>{var n;let c;let{data:u=[],color:d,valueFormatter:f=l.Cj,showAnimation:p=!1,className:h}=e,m=(0,r._T)(e,["data","color","valueFormatter","showAnimation","className"]),g=(n=u.map(e=>e.value),c=-1/0,n.forEach(e=>{c=Math.max(c,e)}),n.map(e=>0===e?0:Math.max(e/c*100,1)));return o.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex justify-between space-x-6",h)},m),o.createElement("div",{className:(0,i.q)(s("bars"),"relative w-full")},u.map((e,t)=>{var n,r,c;let f=e.icon;return o.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:(0,i.q)(s("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||d?(0,l.bM)(null!==(r=e.color)&&void 0!==r?r:d,a.K.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===u.length-1?"mb-0":"mb-2"),style:{width:"".concat(g[t],"%"),transition:p?"all 1s":""}},o.createElement("div",{className:(0,i.q)("absolute max-w-full flex left-2")},f?o.createElement(f,{className:(0,i.q)(s("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?o.createElement("a",{href:e.href,target:null!==(c=e.target)&&void 0!==c?c:"_blank",rel:"noreferrer",className:(0,i.q)(s("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name):o.createElement("p",{className:(0,i.q)(s("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name)))})),o.createElement("div",{className:"text-right min-w-min"},u.map((e,t)=>{var n;return o.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:(0,i.q)(s("labelWrapper"),"flex justify-end items-center","h-9",t===u.length-1?"mb-0":"mb-2")},o.createElement("p",{className:(0,i.q)(s("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},f(e.value)))})))});c.displayName="BarList"},42698:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2265),o=n(7084);n(97324);let a=(0,r.createContext)(o.fr.Blue)},64016:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)(0)},8710:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)(void 0)},33232:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)({selectedValue:void 0,handleValueChange:void 0})},44140:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);let o=(e,t)=>{let n=void 0!==t,[o,a]=(0,r.useState)(e);return[n?t:o,e=>{n||a(e)}]}},61778:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}});var r=n(2265),o=n(8900),a=n(39725),i=n(49638),l=n(54537),s=n(55726),c=n(36760),u=n.n(c),d=n(47970),f=n(18242),p=n(19722),h=n(71744),m=n(352),g=n(12918),v=n(80669);let y=(e,t,n,r,o)=>({background:e,border:"".concat((0,m.bf)(r.lineWidth)," ").concat(r.lineType," ").concat(t),["".concat(o,"-icon")]:{color:n}}),b=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:o,fontSize:a,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:u,colorText:d,colorTextHeading:f,withDescriptionPadding:p,defaultPadding:h}=e;return{[t]:Object.assign(Object.assign({},(0,g.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:s,["&".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-content")]:{flex:1,minWidth:0},["".concat(t,"-icon")]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-message":{color:f},["&".concat(t,"-motion-leave")]:{overflow:"hidden",opacity:1,transition:"max-height ".concat(n," ").concat(c,", opacity ").concat(n," ").concat(c,",\n padding-top ").concat(n," ").concat(c,", padding-bottom ").concat(n," ").concat(c,",\n margin-bottom ").concat(n," ").concat(c)},["&".concat(t,"-motion-leave-active")]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),["".concat(t,"-with-description")]:{alignItems:"flex-start",padding:p,["".concat(t,"-icon")]:{marginInlineEnd:o,fontSize:u,lineHeight:0},["".concat(t,"-message")]:{display:"block",marginBottom:r,color:f,fontSize:i},["".concat(t,"-description")]:{display:"block",color:d}},["".concat(t,"-banner")]:{marginBottom:0,border:"0 !important",borderRadius:0}}},x=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:o,colorWarning:a,colorWarningBorder:i,colorWarningBg:l,colorError:s,colorErrorBorder:c,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":y(o,r,n,e,t),"&-info":y(p,f,d,e,t),"&-warning":y(l,i,a,e,t),"&-error":Object.assign(Object.assign({},y(u,c,s,e,t)),{["".concat(t,"-description > pre")]:{margin:0,padding:0}})}}},w=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:o,fontSizeIcon:a,colorIcon:i,colorIconHover:l}=e;return{[t]:{"&-action":{marginInlineStart:o},["".concat(t,"-close-icon")]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,m.bf)(a),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",["".concat(n,"-close")]:{color:i,transition:"color ".concat(r),"&:hover":{color:l}}},"&-close-text":{color:i,transition:"color ".concat(r),"&:hover":{color:l}}}}};var k=(0,v.I$)("Alert",e=>[b(e),x(e),w(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:"".concat(e.paddingContentVerticalSM,"px ").concat(12,"px"),withDescriptionPadding:"".concat(e.paddingMD,"px ").concat(e.paddingContentHorizontalLG,"px")})),S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let E={success:o.Z,info:s.Z,error:a.Z,warning:l.Z},O=e=>{let{icon:t,prefixCls:n,type:o}=e,a=E[o]||null;return t?(0,p.wm)(t,r.createElement("span",{className:"".concat(n,"-icon")},t),()=>({className:u()("".concat(n,"-icon"),{[t.props.className]:t.props.className})})):r.createElement(a,{className:"".concat(n,"-icon")})},C=e=>{let{isClosable:t,prefixCls:n,closeIcon:o,handleClose:a}=e,l=!0===o||void 0===o?r.createElement(i.Z,null):o;return t?r.createElement("button",{type:"button",onClick:a,className:"".concat(n,"-close-icon"),tabIndex:0},l):null};var j=e=>{let{description:t,prefixCls:n,message:o,banner:a,className:i,rootClassName:l,style:s,onMouseEnter:c,onMouseLeave:p,onClick:m,afterClose:g,showIcon:v,closable:y,closeText:b,closeIcon:x,action:w}=e,E=S(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action"]),[j,_]=r.useState(!1),P=r.useRef(null),{getPrefixCls:N,direction:T,alert:A}=r.useContext(h.E_),M=N("alert",n),[I,R,D]=k(M),L=t=>{var n;_(!0),null===(n=e.onClose)||void 0===n||n.call(e,t)},Z=r.useMemo(()=>void 0!==e.type?e.type:a?"warning":"info",[e.type,a]),z=r.useMemo(()=>!!b||("boolean"==typeof y?y:!1!==x&&null!=x),[b,x,y]),B=!!a&&void 0===v||v,F=u()(M,"".concat(M,"-").concat(Z),{["".concat(M,"-with-description")]:!!t,["".concat(M,"-no-icon")]:!B,["".concat(M,"-banner")]:!!a,["".concat(M,"-rtl")]:"rtl"===T},null==A?void 0:A.className,i,l,D,R),H=(0,f.Z)(E,{aria:!0,data:!0});return I(r.createElement(d.ZP,{visible:!j,motionName:"".concat(M,"-motion"),motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:g},n=>{let{className:a,style:i}=n;return r.createElement("div",Object.assign({ref:P,"data-show":!j,className:u()(F,a),style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.style),s),i),onMouseEnter:c,onMouseLeave:p,onClick:m,role:"alert"},H),B?r.createElement(O,{description:t,icon:e.icon,prefixCls:M,type:Z}):null,r.createElement("div",{className:"".concat(M,"-content")},o?r.createElement("div",{className:"".concat(M,"-message")},o):null,t?r.createElement("div",{className:"".concat(M,"-description")},t):null),w?r.createElement("div",{className:"".concat(M,"-action")},w):null,r.createElement(C,{isClosable:z,prefixCls:M,closeIcon:b||x,handleClose:L}))}))},_=n(76405),P=n(25049),N=n(37977),T=n(63929),A=n(24995),M=n(15354);let I=function(e){function t(){var e,n,r;return(0,_.Z)(this,t),n=t,r=arguments,n=(0,A.Z)(n),(e=(0,N.Z)(this,(0,T.Z)()?Reflect.construct(n,r||[],(0,A.Z)(this).constructor):n.apply(this,r))).state={error:void 0,info:{componentStack:""}},e}return(0,M.Z)(t,e),(0,P.Z)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:t,children:n}=this.props,{error:o,info:a}=this.state,i=a&&a.componentStack?a.componentStack:null,l=void 0===e?(o||"").toString():e;return o?r.createElement(j,{type:"error",message:l,description:r.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===t?i:t)}):n}}]),t}(r.Component);j.ErrorBoundary=I;var R=j},33866:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var r=n(2265),o=n(36760),a=n.n(o),i=n(47970),l=n(93350),s=n(19722),c=n(71744),u=n(352),d=n(12918),f=n(18536),p=n(3104),h=n(80669);let m=new u.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=new u.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),v=new u.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),y=new u.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),b=new u.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),x=new u.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),w=e=>{let{componentCls:t,iconCls:n,antCls:r,badgeShadowSize:o,motionDurationSlow:a,textFontSize:i,textFontSizeSM:l,statusSize:s,dotSize:c,textFontWeight:p,indicatorHeight:h,indicatorHeightSM:w,marginXS:k,calc:S}=e,E="".concat(r,"-scroll-number"),O=(0,f.Z)(e,(e,n)=>{let{darkColor:r}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:r,["&:not(".concat(t,"-count)")]:{color:r}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{zIndex:e.indicatorZIndex,minWidth:h,height:h,color:e.badgeTextColor,fontWeight:p,fontSize:i,lineHeight:(0,u.bf)(h),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:S(h).div(2).equal(),boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor),transition:"background ".concat(e.motionDurationMid),a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},["".concat(t,"-count-sm")]:{minWidth:w,height:w,fontSize:l,lineHeight:(0,u.bf)(w),borderRadius:S(w).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,u.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:c,minWidth:c,height:c,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor)},["".concat(t,"-dot").concat(E)]:{transition:"background ".concat(a)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(E,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(t,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(t,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},["".concat(t,"-status-success")]:{backgroundColor:e.colorSuccess},["".concat(t,"-status-processing")]:{overflow:"visible",color:e.colorPrimary,backgroundColor:e.colorPrimary,"&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:m,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(t,"-status-default")]:{backgroundColor:e.colorTextPlaceholder},["".concat(t,"-status-error")]:{backgroundColor:e.colorError},["".concat(t,"-status-warning")]:{backgroundColor:e.colorWarning},["".concat(t,"-status-text")]:{marginInlineStart:k,color:e.colorText,fontSize:e.fontSize}}}),O),{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:g,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["".concat(t,"-zoom-leave")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:b,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(E,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(E,"-custom-component, ").concat(E)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},["".concat(E)]:{overflow:"hidden",["".concat(E,"-only")]:{position:"relative",display:"inline-block",height:h,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(E,"-only-unit")]:{height:h,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(E,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(E,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},k=e=>{let{fontHeight:t,lineWidth:n,marginXS:r,colorBorderBg:o}=e,a=e.colorBgContainer,i=e.colorError,l=e.colorErrorHover;return(0,p.TS)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:a,badgeColor:i,badgeColorHover:l,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:r,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},S=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:r,lineWidth:o}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*o,indicatorHeightSM:t,dotSize:r/2,textFontSize:r,textFontSizeSM:r,textFontWeight:"normal",statusSize:r/2}};var E=(0,h.I$)("Badge",e=>w(k(e)),S);let O=e=>{let{antCls:t,badgeFontHeight:n,marginXS:r,badgeRibbonOffset:o,calc:a}=e,i="".concat(t,"-ribbon"),l=(0,f.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(i,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat("".concat(t,"-ribbon-wrapper"))]:{position:"relative"},["".concat(i)]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:r,padding:"0 ".concat((0,u.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,u.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(i,"-text")]:{color:e.colorTextLightSolid},["".concat(i,"-corner")]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:"".concat((0,u.bf)(a(o).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),l),{["&".concat(i,"-placement-end")]:{insetInlineEnd:a(o).mul(-1).equal(),borderEndEndRadius:0,["".concat(i,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(i,"-placement-start")]:{insetInlineStart:a(o).mul(-1).equal(),borderEndStartRadius:0,["".concat(i,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var C=(0,h.I$)(["Badge","Ribbon"],e=>O(k(e)),S);function j(e){let t,{prefixCls:n,value:o,current:i,offset:l=0}=e;return l&&(t={position:"absolute",top:"".concat(l,"00%"),left:0}),r.createElement("span",{style:t,className:a()("".concat(n,"-only-unit"),{current:i})},o)}function _(e){let t,n;let{prefixCls:o,count:a,value:i}=e,l=Number(i),s=Math.abs(a),[c,u]=r.useState(l),[d,f]=r.useState(s),p=()=>{u(l),f(s)};if(r.useEffect(()=>{let e=setTimeout(()=>{p()},1e3);return()=>{clearTimeout(e)}},[l]),c===l||Number.isNaN(l)||Number.isNaN(c))t=[r.createElement(j,Object.assign({},e,{key:l,current:!0}))],n={transition:"none"};else{t=[];let o=l+10,a=[];for(let e=l;e<=o;e+=1)a.push(e);let i=a.findIndex(e=>e%10===c);t=a.map((t,n)=>r.createElement(j,Object.assign({},e,{key:t,value:t%10,offset:n-i,current:n===i}))),n={transform:"translateY(".concat(-function(e,t,n){let r=e,o=0;for(;(r+10)%10!==t;)r+=n,o+=n;return o}(c,l,d<s?1:-1),"00%)")}}return r.createElement("span",{className:"".concat(o,"-only"),style:n,onTransitionEnd:p},t)}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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=r.forwardRef((e,t)=>{let{prefixCls:n,count:o,className:i,motionClassName:l,style:u,title:d,show:f,component:p="sup",children:h}=e,m=P(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:g}=r.useContext(c.E_),v=g("scroll-number",n),y=Object.assign(Object.assign({},m),{"data-show":f,style:u,className:a()(v,i,l),title:d}),b=o;if(o&&Number(o)%1==0){let e=String(o).split("");b=r.createElement("bdi",null,e.map((t,n)=>r.createElement(_,{prefixCls:v,count:Number(o),value:t,key:e.length-n})))}return(u&&u.borderColor&&(y.style=Object.assign(Object.assign({},u),{boxShadow:"0 0 0 1px ".concat(u.borderColor," inset")})),h)?(0,s.Tm)(h,e=>({className:a()("".concat(v,"-custom-component"),null==e?void 0:e.className,l)})):r.createElement(p,Object.assign({},y,{ref:t}),b)});var T=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let A=r.forwardRef((e,t)=>{var n,o,u,d,f;let{prefixCls:p,scrollNumberPrefixCls:h,children:m,status:g,text:v,color:y,count:b=null,overflowCount:x=99,dot:w=!1,size:k="default",title:S,offset:O,style:C,className:j,rootClassName:_,classNames:P,styles:A,showZero:M=!1}=e,I=T(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:R,direction:D,badge:L}=r.useContext(c.E_),Z=R("badge",p),[z,B,F]=E(Z),H=b>x?"".concat(x,"+"):b,q="0"===H||0===H,W=(null!=g||null!=y)&&(null===b||q&&!M),U=w&&!q,K=U?"":H,$=(0,r.useMemo)(()=>(null==K||""===K||q&&!M)&&!U,[K,q,M,U]),V=(0,r.useRef)(b);$||(V.current=b);let X=V.current,G=(0,r.useRef)(K);$||(G.current=K);let Y=G.current,Q=(0,r.useRef)(U);$||(Q.current=U);let J=(0,r.useMemo)(()=>{if(!O)return Object.assign(Object.assign({},null==L?void 0:L.style),C);let e={marginTop:O[1]};return"rtl"===D?e.left=parseInt(O[0],10):e.right=-parseInt(O[0],10),Object.assign(Object.assign(Object.assign({},e),null==L?void 0:L.style),C)},[D,O,C,null==L?void 0:L.style]),ee=null!=S?S:"string"==typeof X||"number"==typeof X?X:void 0,et=$||!v?null:r.createElement("span",{className:"".concat(Z,"-status-text")},v),en=X&&"object"==typeof X?(0,s.Tm)(X,e=>({style:Object.assign(Object.assign({},J),e.style)})):void 0,er=(0,l.o2)(y,!1),eo=a()(null==P?void 0:P.indicator,null===(n=null==L?void 0:L.classNames)||void 0===n?void 0:n.indicator,{["".concat(Z,"-status-dot")]:W,["".concat(Z,"-status-").concat(g)]:!!g,["".concat(Z,"-color-").concat(y)]:er}),ea={};y&&!er&&(ea.color=y,ea.background=y);let ei=a()(Z,{["".concat(Z,"-status")]:W,["".concat(Z,"-not-a-wrapper")]:!m,["".concat(Z,"-rtl")]:"rtl"===D},j,_,null==L?void 0:L.className,null===(o=null==L?void 0:L.classNames)||void 0===o?void 0:o.root,null==P?void 0:P.root,B,F);if(!m&&W){let e=J.color;return z(r.createElement("span",Object.assign({},I,{className:ei,style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.root),null===(u=null==L?void 0:L.styles)||void 0===u?void 0:u.root),J)}),r.createElement("span",{className:eo,style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.indicator),null===(d=null==L?void 0:L.styles)||void 0===d?void 0:d.indicator),ea)}),v&&r.createElement("span",{style:{color:e},className:"".concat(Z,"-status-text")},v)))}return z(r.createElement("span",Object.assign({ref:t},I,{className:ei,style:Object.assign(Object.assign({},null===(f=null==L?void 0:L.styles)||void 0===f?void 0:f.root),null==A?void 0:A.root)}),m,r.createElement(i.ZP,{visible:!$,motionName:"".concat(Z,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:o,ref:i}=e,l=R("scroll-number",h),s=Q.current,c=a()(null==P?void 0:P.indicator,null===(t=null==L?void 0:L.classNames)||void 0===t?void 0:t.indicator,{["".concat(Z,"-dot")]:s,["".concat(Z,"-count")]:!s,["".concat(Z,"-count-sm")]:"small"===k,["".concat(Z,"-multiple-words")]:!s&&Y&&Y.toString().length>1,["".concat(Z,"-status-").concat(g)]:!!g,["".concat(Z,"-color-").concat(y)]:er}),u=Object.assign(Object.assign(Object.assign({},null==A?void 0:A.indicator),null===(n=null==L?void 0:L.styles)||void 0===n?void 0:n.indicator),J);return y&&!er&&((u=u||{}).background=y),r.createElement(N,{prefixCls:l,show:!$,motionClassName:o,className:c,count:Y,title:ee,style:u,key:"scrollNumber",ref:i},en)}),et))});A.Ribbon=e=>{let{className:t,prefixCls:n,style:o,color:i,children:s,text:u,placement:d="end",rootClassName:f}=e,{getPrefixCls:p,direction:h}=r.useContext(c.E_),m=p("ribbon",n),g="".concat(m,"-wrapper"),[v,y,b]=C(m,g),x=(0,l.o2)(i,!1),w=a()(m,"".concat(m,"-placement-").concat(d),{["".concat(m,"-rtl")]:"rtl"===h,["".concat(m,"-color-").concat(i)]:x},t),k={},S={};return i&&!x&&(k.background=i,S.color=i),v(r.createElement("div",{className:a()(g,f,y,b)},s,r.createElement("div",{className:a()(w,y),style:Object.assign(Object.assign({},k),o)},r.createElement("span",{className:"".concat(m,"-text")},u),r.createElement("div",{className:"".concat(m,"-corner"),style:S}))))};var M=A},67960:function(e,t,n){"use strict";n.d(t,{Z:function(){return e8}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),l=n(71744),s=n(33759),c=e=>{let{prefixCls:t,className:n,style:o,size:i,shape:l}=e,s=a()({["".concat(t,"-lg")]:"large"===i,["".concat(t,"-sm")]:"small"===i}),c=a()({["".concat(t,"-circle")]:"circle"===l,["".concat(t,"-square")]:"square"===l,["".concat(t,"-round")]:"round"===l}),u=r.useMemo(()=>"number"==typeof i?{width:i,height:i,lineHeight:"".concat(i,"px")}:{},[i]);return r.createElement("span",{className:a()(t,s,c,n),style:Object.assign(Object.assign({},u),o)})},u=n(352),d=n(80669),f=n(3104);let p=new u.E4("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),h=e=>({height:e,lineHeight:(0,u.bf)(e)}),m=e=>Object.assign({width:e},h(e)),g=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:p,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),v=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},h(e)),y=e=>{let{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:o,controlHeightSM:a}=e;return{["".concat(t)]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},m(r)),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"},["".concat(t).concat(t,"-lg")]:Object.assign({},m(o)),["".concat(t).concat(t,"-sm")]:Object.assign({},m(a))}},b=e=>{let{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:o,controlHeightSM:a,gradientFromColor:i,calc:l}=e;return{["".concat(r)]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:n},v(t,l)),["".concat(r,"-lg")]:Object.assign({},v(o,l)),["".concat(r,"-sm")]:Object.assign({},v(a,l))}},x=e=>Object.assign({width:e},h(e)),w=e=>{let{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:o,calc:a}=e;return{["".concat(t)]:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:r,borderRadius:o},x(a(n).mul(2).equal())),{["".concat(t,"-path")]:{fill:"#bfbfbf"},["".concat(t,"-svg")]:Object.assign(Object.assign({},x(n)),{maxWidth:a(n).mul(4).equal(),maxHeight:a(n).mul(4).equal()}),["".concat(t,"-svg").concat(t,"-svg-circle")]:{borderRadius:"50%"}}),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"}}},k=(e,t,n)=>{let{skeletonButtonCls:r}=e;return{["".concat(n).concat(r,"-circle")]:{width:t,minWidth:t,borderRadius:"50%"},["".concat(n).concat(r,"-round")]:{borderRadius:t}}},S=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},h(e)),E=e=>{let{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:o,controlHeightSM:a,gradientFromColor:i,calc:l}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:l(r).mul(2).equal(),minWidth:l(r).mul(2).equal()},S(r,l))},k(e,r,n)),{["".concat(n,"-lg")]:Object.assign({},S(o,l))}),k(e,o,"".concat(n,"-lg"))),{["".concat(n,"-sm")]:Object.assign({},S(a,l))}),k(e,a,"".concat(n,"-sm")))},O=e=>{let{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:o,skeletonButtonCls:a,skeletonInputCls:i,skeletonImageCls:l,controlHeight:s,controlHeightLG:c,controlHeightSM:u,gradientFromColor:d,padding:f,marginSM:p,borderRadius:h,titleHeight:v,blockRadius:x,paragraphLiHeight:k,controlHeightXS:S,paragraphMarginTop:O}=e;return{["".concat(t)]:{display:"table",width:"100%",["".concat(t,"-header")]:{display:"table-cell",paddingInlineEnd:f,verticalAlign:"top",["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:d},m(s)),["".concat(n,"-circle")]:{borderRadius:"50%"},["".concat(n,"-lg")]:Object.assign({},m(c)),["".concat(n,"-sm")]:Object.assign({},m(u))},["".concat(t,"-content")]:{display:"table-cell",width:"100%",verticalAlign:"top",["".concat(r)]:{width:"100%",height:v,background:d,borderRadius:x,["+ ".concat(o)]:{marginBlockStart:u}},["".concat(o)]:{padding:0,"> li":{width:"100%",height:k,listStyle:"none",background:d,borderRadius:x,"+ li":{marginBlockStart:S}}},["".concat(o,"> li:last-child:not(:first-child):not(:nth-child(2))")]:{width:"61%"}},["&-round ".concat(t,"-content")]:{["".concat(r,", ").concat(o," > li")]:{borderRadius:h}}},["".concat(t,"-with-avatar ").concat(t,"-content")]:{["".concat(r)]:{marginBlockStart:p,["+ ".concat(o)]:{marginBlockStart:O}}},["".concat(t).concat(t,"-element")]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},E(e)),y(e)),b(e)),w(e)),["".concat(t).concat(t,"-block")]:{width:"100%",["".concat(a)]:{width:"100%"},["".concat(i)]:{width:"100%"}},["".concat(t).concat(t,"-active")]:{["\n ".concat(r,",\n ").concat(o," > li,\n ").concat(n,",\n ").concat(a,",\n ").concat(i,",\n ").concat(l,"\n ")]:Object.assign({},g(e))}}};var C=(0,d.I$)("Skeleton",e=>{let{componentCls:t,calc:n}=e;return[O((0,f.TS)(e,{skeletonAvatarCls:"".concat(t,"-avatar"),skeletonTitleCls:"".concat(t,"-title"),skeletonParagraphCls:"".concat(t,"-paragraph"),skeletonButtonCls:"".concat(t,"-button"),skeletonInputCls:"".concat(t,"-input"),skeletonImageCls:"".concat(t,"-image"),imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:"linear-gradient(90deg, ".concat(e.gradientFromColor," 25%, ").concat(e.gradientToColor," 37%, ").concat(e.gradientFromColor," 63%)"),skeletonLoadingMotionDuration:"1.4s"}))]},e=>{let{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n,gradientFromColor:t,gradientToColor:n,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),j=n(1119),_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},P=n(55015),N=r.forwardRef(function(e,t){return r.createElement(P.Z,(0,j.Z)({},e,{ref:t,icon:_}))}),T=n(83145),A=e=>{let t=t=>{let{width:n,rows:r=2}=e;return Array.isArray(n)?n[t]:r-1===t?n:void 0},{prefixCls:n,className:o,style:i,rows:l}=e,s=(0,T.Z)(Array(l)).map((e,n)=>r.createElement("li",{key:n,style:{width:t(n)}}));return r.createElement("ul",{className:a()(n,o),style:i},s)},M=e=>{let{prefixCls:t,className:n,width:o,style:i}=e;return r.createElement("h3",{className:a()(t,n),style:Object.assign({width:o},i)})};function I(e){return e&&"object"==typeof e?e:{}}let R=e=>{let{prefixCls:t,loading:n,className:o,rootClassName:i,style:s,children:u,avatar:d=!1,title:f=!0,paragraph:p=!0,active:h,round:m}=e,{getPrefixCls:g,direction:v,skeleton:y}=r.useContext(l.E_),b=g("skeleton",t),[x,w,k]=C(b);if(n||!("loading"in e)){let e,t;let n=!!d,l=!!f,u=!!p;if(n){let t=Object.assign(Object.assign({prefixCls:"".concat(b,"-avatar")},l&&!u?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),I(d));e=r.createElement("div",{className:"".concat(b,"-header")},r.createElement(c,Object.assign({},t)))}if(l||u){let e,o;if(l){let t=Object.assign(Object.assign({prefixCls:"".concat(b,"-title")},!n&&u?{width:"38%"}:n&&u?{width:"50%"}:{}),I(f));e=r.createElement(M,Object.assign({},t))}if(u){let e=Object.assign(Object.assign({prefixCls:"".concat(b,"-paragraph")},function(e,t){let n={};return e&&t||(n.width="61%"),!e&&t?n.rows=3:n.rows=2,n}(n,l)),I(p));o=r.createElement(A,Object.assign({},e))}t=r.createElement("div",{className:"".concat(b,"-content")},e,o)}let g=a()(b,{["".concat(b,"-with-avatar")]:n,["".concat(b,"-active")]:h,["".concat(b,"-rtl")]:"rtl"===v,["".concat(b,"-round")]:m},null==y?void 0:y.className,o,i,w,k);return x(r.createElement("div",{className:g,style:Object.assign(Object.assign({},null==y?void 0:y.style),s)},e,t))}return void 0!==u?u:null};R.Button=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,block:u=!1,size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s,["".concat(p,"-block")]:u},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-button"),size:d},v))))},R.Avatar=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,shape:u="circle",size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls","className"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-avatar"),shape:u,size:d},v))))},R.Input=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,block:u,size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s,["".concat(p,"-block")]:u},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-input"),size:d},v))))},R.Image=e=>{let{prefixCls:t,className:n,rootClassName:o,style:i,active:s}=e,{getPrefixCls:c}=r.useContext(l.E_),u=c("skeleton",t),[d,f,p]=C(u),h=a()(u,"".concat(u,"-element"),{["".concat(u,"-active")]:s},n,o,f,p);return d(r.createElement("div",{className:h},r.createElement("div",{className:a()("".concat(u,"-image"),n),style:i},r.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(u,"-image-svg")},r.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(u,"-image-path")})))))},R.Node=e=>{let{prefixCls:t,className:n,rootClassName:o,style:i,active:s,children:c}=e,{getPrefixCls:u}=r.useContext(l.E_),d=u("skeleton",t),[f,p,h]=C(d),m=a()(d,"".concat(d,"-element"),{["".concat(d,"-active")]:s},p,n,o,h),g=null!=c?c:r.createElement(N,null);return f(r.createElement("div",{className:m},r.createElement("div",{className:a()("".concat(d,"-image"),n),style:i},g)))};var D=n(49638),L=n(39760),Z=n(96473),z=n(11993),B=n(31686),F=n(26365),H=n(41154),q=n(6989),W=n(50506),U=n(79267),K=(0,r.createContext)(null),$=n(31474),V=n(58525),X=n(28791),G=n(53346),Y=function(e){var t=e.activeTabOffset,n=e.horizontal,o=e.rtl,a=e.indicator,i=void 0===a?{}:a,l=i.size,s=i.align,c=void 0===s?"center":s,u=(0,r.useState)(),d=(0,F.Z)(u,2),f=d[0],p=d[1],h=(0,r.useRef)(),m=r.useCallback(function(e){return"function"==typeof l?l(e):"number"==typeof l?l:e},[l]);function g(){G.Z.cancel(h.current)}return(0,r.useEffect)(function(){var e={};if(t){if(n){e.width=m(t.width);var r=o?"right":"left";"start"===c&&(e[r]=t[r]),"center"===c&&(e[r]=t[r]+t.width/2,e.transform=o?"translateX(50%)":"translateX(-50%)"),"end"===c&&(e[r]=t[r]+t.width,e.transform="translateX(-100%)")}else e.height=m(t.height),"start"===c&&(e.top=t.top),"center"===c&&(e.top=t.top+t.height/2,e.transform="translateY(-50%)"),"end"===c&&(e.top=t.top+t.height,e.transform="translateY(-100%)")}return g(),h.current=(0,G.Z)(function(){p(e)}),g},[t,n,o,c,m]),{style:f}},Q={width:0,height:0,left:0,top:0};function J(e,t){var n=r.useRef(e),o=r.useState({}),a=(0,F.Z)(o,2)[1];return[n.current,function(e){var r="function"==typeof e?e(n.current):e;r!==n.current&&t(r,n.current),n.current=r,a({})}]}var ee=n(27380);function et(e){var t=(0,r.useState)(0),n=(0,F.Z)(t,2),o=n[0],a=n[1],i=(0,r.useRef)(0),l=(0,r.useRef)();return l.current=e,(0,ee.o)(function(){var e;null===(e=l.current)||void 0===e||e.call(l)},[o]),function(){i.current===o&&(i.current+=1,a(i.current))}}var en={width:0,height:0,left:0,top:0,right:0};function er(e){var t;return e instanceof Map?(t={},e.forEach(function(e,n){t[n]=e})):t=e,JSON.stringify(t)}function eo(e){return String(e).replace(/"/g,"TABS_DQ")}function ea(e,t,n,r){return!!n&&!r&&!1!==e&&(void 0!==e||!1!==t&&null!==t)}var ei=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.editable,a=e.locale,i=e.style;return o&&!1!==o.showAdd?r.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(null==a?void 0:a.addAriaLabel)||"Add tab",onClick:function(e){o.onEdit("add",{event:e})}},o.addIcon||"+"):null}),el=r.forwardRef(function(e,t){var n,o=e.position,a=e.prefixCls,i=e.extra;if(!i)return null;var l={};return"object"!==(0,H.Z)(i)||r.isValidElement(i)?l.right=i:l=i,"right"===o&&(n=l.right),"left"===o&&(n=l.left),n?r.createElement("div",{className:"".concat(a,"-extra-content"),ref:t},n):null}),es=n(71030),ec=n(33082),eu=n(95814),ed=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.id,i=e.tabs,l=e.locale,s=e.mobile,c=e.moreIcon,u=e.moreTransitionName,d=e.style,f=e.className,p=e.editable,h=e.tabBarGutter,m=e.rtl,g=e.removeAriaLabel,v=e.onTabClick,y=e.getPopupContainer,b=e.popupClassName,x=(0,r.useState)(!1),w=(0,F.Z)(x,2),k=w[0],S=w[1],E=(0,r.useState)(null),O=(0,F.Z)(E,2),C=O[0],j=O[1],_="".concat(o,"-more-popup"),P="".concat(n,"-dropdown"),N=null!==C?"".concat(_,"-").concat(C):null,T=null==l?void 0:l.dropdownAriaLabel,A=r.createElement(ec.ZP,{onClick:function(e){v(e.key,e.domEvent),S(!1)},prefixCls:"".concat(P,"-menu"),id:_,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[C],"aria-label":void 0!==T?T:"expanded dropdown"},i.map(function(e){var t=e.closable,n=e.disabled,a=e.closeIcon,i=e.key,l=e.label,s=ea(t,a,p,n);return r.createElement(ec.sN,{key:i,id:"".concat(_,"-").concat(i),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(i),disabled:n},r.createElement("span",null,l),s&&r.createElement("button",{type:"button","aria-label":g||"remove",tabIndex:0,className:"".concat(P,"-menu-item-remove"),onClick:function(e){e.stopPropagation(),e.preventDefault(),e.stopPropagation(),p.onEdit("remove",{key:i,event:e})}},a||p.removeIcon||"\xd7"))}));function M(e){for(var t=i.filter(function(e){return!e.disabled}),n=t.findIndex(function(e){return e.key===C})||0,r=t.length,o=0;o<r;o+=1){var a=t[n=(n+e+r)%r];if(!a.disabled){j(a.key);return}}}(0,r.useEffect)(function(){var e=document.getElementById(N);e&&e.scrollIntoView&&e.scrollIntoView(!1)},[C]),(0,r.useEffect)(function(){k||j(null)},[k]);var I=(0,z.Z)({},m?"marginRight":"marginLeft",h);i.length||(I.visibility="hidden",I.order=1);var R=a()((0,z.Z)({},"".concat(P,"-rtl"),m)),D=s?null:r.createElement(es.Z,{prefixCls:P,overlay:A,trigger:["hover"],visible:!!i.length&&k,transitionName:u,onVisibleChange:S,overlayClassName:a()(R,b),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:y},r.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:I,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":_,id:"".concat(o,"-more"),"aria-expanded":k,onKeyDown:function(e){var t=e.which;if(!k){[eu.Z.DOWN,eu.Z.SPACE,eu.Z.ENTER].includes(t)&&(S(!0),e.preventDefault());return}switch(t){case eu.Z.UP:M(-1),e.preventDefault();break;case eu.Z.DOWN:M(1),e.preventDefault();break;case eu.Z.ESC:S(!1);break;case eu.Z.SPACE:case eu.Z.ENTER:null!==C&&v(C,e)}}},void 0===c?"More":c));return r.createElement("div",{className:a()("".concat(n,"-nav-operations"),f),style:d,ref:t},D,r.createElement(ei,{prefixCls:n,locale:l,editable:p}))}),ef=r.memo(ed,function(e,t){return t.tabMoving}),ep=function(e){var t=e.prefixCls,n=e.id,o=e.active,i=e.tab,l=i.key,s=i.label,c=i.disabled,u=i.closeIcon,d=i.icon,f=e.closable,p=e.renderWrapper,h=e.removeAriaLabel,m=e.editable,g=e.onClick,v=e.onFocus,y=e.style,b="".concat(t,"-tab"),x=ea(f,u,m,c);function w(e){c||g(e)}var k=r.useMemo(function(){return d&&"string"==typeof s?r.createElement("span",null,s):s},[s,d]),S=r.createElement("div",{key:l,"data-node-key":eo(l),className:a()(b,(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(b,"-with-remove"),x),"".concat(b,"-active"),o),"".concat(b,"-disabled"),c)),style:y,onClick:w},r.createElement("div",{role:"tab","aria-selected":o,id:n&&"".concat(n,"-tab-").concat(l),className:"".concat(b,"-btn"),"aria-controls":n&&"".concat(n,"-panel-").concat(l),"aria-disabled":c,tabIndex:c?null:0,onClick:function(e){e.stopPropagation(),w(e)},onKeyDown:function(e){[eu.Z.SPACE,eu.Z.ENTER].includes(e.which)&&(e.preventDefault(),w(e))},onFocus:v},d&&r.createElement("span",{className:"".concat(b,"-icon")},d),s&&k),x&&r.createElement("button",{type:"button","aria-label":h||"remove",tabIndex:0,className:"".concat(b,"-remove"),onClick:function(e){e.stopPropagation(),e.preventDefault(),e.stopPropagation(),m.onEdit("remove",{key:l,event:e})}},u||m.removeIcon||"\xd7"));return p?p(S):S},eh=function(e,t){var n=e.offsetWidth,r=e.offsetHeight,o=e.offsetTop,a=e.offsetLeft,i=e.getBoundingClientRect(),l=i.width,s=i.height,c=i.x,u=i.y;return 1>Math.abs(l-n)?[l,s,c-t.x,u-t.y]:[n,r,a,o]},em=function(e){var t=e.current||{},n=t.offsetWidth,r=void 0===n?0:n,o=t.offsetHeight;if(e.current){var a=e.current.getBoundingClientRect(),i=a.width,l=a.height;if(1>Math.abs(i-r))return[i,l]}return[r,void 0===o?0:o]},eg=function(e,t){return e[t?0:1]},ev=r.forwardRef(function(e,t){var n,o,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,_,P,N,A,M,I,R,D,L,Z,H,q,W,U,G,ee,ea=e.className,es=e.style,ec=e.id,eu=e.animated,ed=e.activeKey,ev=e.rtl,ey=e.extra,eb=e.editable,ex=e.locale,ew=e.tabPosition,ek=e.tabBarGutter,eS=e.children,eE=e.onTabClick,eO=e.onTabScroll,eC=e.indicator,ej=r.useContext(K),e_=ej.prefixCls,eP=ej.tabs,eN=(0,r.useRef)(null),eT=(0,r.useRef)(null),eA=(0,r.useRef)(null),eM=(0,r.useRef)(null),eI=(0,r.useRef)(null),eR=(0,r.useRef)(null),eD=(0,r.useRef)(null),eL="top"===ew||"bottom"===ew,eZ=J(0,function(e,t){eL&&eO&&eO({direction:e>t?"left":"right"})}),ez=(0,F.Z)(eZ,2),eB=ez[0],eF=ez[1],eH=J(0,function(e,t){!eL&&eO&&eO({direction:e>t?"top":"bottom"})}),eq=(0,F.Z)(eH,2),eW=eq[0],eU=eq[1],eK=(0,r.useState)([0,0]),e$=(0,F.Z)(eK,2),eV=e$[0],eX=e$[1],eG=(0,r.useState)([0,0]),eY=(0,F.Z)(eG,2),eQ=eY[0],eJ=eY[1],e0=(0,r.useState)([0,0]),e1=(0,F.Z)(e0,2),e2=e1[0],e6=e1[1],e4=(0,r.useState)([0,0]),e3=(0,F.Z)(e4,2),e5=e3[0],e8=e3[1],e7=(n=new Map,o=(0,r.useRef)([]),i=(0,r.useState)({}),l=(0,F.Z)(i,2)[1],s=(0,r.useRef)("function"==typeof n?n():n),c=et(function(){var e=s.current;o.current.forEach(function(t){e=t(e)}),o.current=[],s.current=e,l({})}),[s.current,function(e){o.current.push(e),c()}]),e9=(0,F.Z)(e7,2),te=e9[0],tt=e9[1],tn=(u=eQ[0],(0,r.useMemo)(function(){for(var e=new Map,t=te.get(null===(o=eP[0])||void 0===o?void 0:o.key)||Q,n=t.left+t.width,r=0;r<eP.length;r+=1){var o,a,i=eP[r].key,l=te.get(i);l||(l=te.get(null===(a=eP[r-1])||void 0===a?void 0:a.key)||Q);var s=e.get(i)||(0,B.Z)({},l);s.right=n-s.left-s.width,e.set(i,s)}return e},[eP.map(function(e){return e.key}).join("_"),te,u])),tr=eg(eV,eL),to=eg(eQ,eL),ta=eg(e2,eL),ti=eg(e5,eL),tl=tr<to+ta,ts=tl?tr-ti:tr-ta,tc="".concat(e_,"-nav-operations-hidden"),tu=0,td=0;function tf(e){return e<tu?tu:e>td?td:e}eL&&ev?(tu=0,td=Math.max(0,to-ts)):(tu=Math.min(0,ts-to),td=0);var tp=(0,r.useRef)(null),th=(0,r.useState)(),tm=(0,F.Z)(th,2),tg=tm[0],tv=tm[1];function ty(){tv(Date.now())}function tb(){tp.current&&clearTimeout(tp.current)}d=function(e,t){function n(e,t){e(function(e){return tf(e+t)})}return!!tl&&(eL?n(eF,e):n(eU,t),tb(),ty(),!0)},f=(0,r.useState)(),h=(p=(0,F.Z)(f,2))[0],m=p[1],g=(0,r.useState)(0),y=(v=(0,F.Z)(g,2))[0],b=v[1],x=(0,r.useState)(0),k=(w=(0,F.Z)(x,2))[0],S=w[1],E=(0,r.useState)(),C=(O=(0,F.Z)(E,2))[0],_=O[1],P=(0,r.useRef)(),N=(0,r.useRef)(),(A=(0,r.useRef)(null)).current={onTouchStart:function(e){var t=e.touches[0];m({x:t.screenX,y:t.screenY}),window.clearInterval(P.current)},onTouchMove:function(e){if(h){e.preventDefault();var t=e.touches[0],n=t.screenX,r=t.screenY;m({x:n,y:r});var o=n-h.x,a=r-h.y;d(o,a);var i=Date.now();b(i),S(i-y),_({x:o,y:a})}},onTouchEnd:function(){if(h&&(m(null),_(null),C)){var e=C.x/k,t=C.y/k;if(!(.1>Math.max(Math.abs(e),Math.abs(t)))){var n=e,r=t;P.current=window.setInterval(function(){if(.01>Math.abs(n)&&.01>Math.abs(r)){window.clearInterval(P.current);return}n*=.9046104802746175,r*=.9046104802746175,d(20*n,20*r)},20)}}},onWheel:function(e){var t=e.deltaX,n=e.deltaY,r=0,o=Math.abs(t),a=Math.abs(n);o===a?r="x"===N.current?t:n:o>a?(r=t,N.current="x"):(r=n,N.current="y"),d(-r,-r)&&e.preventDefault()}},r.useEffect(function(){function e(e){A.current.onTouchMove(e)}function t(e){A.current.onTouchEnd(e)}return document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",t,{passive:!1}),eM.current.addEventListener("touchstart",function(e){A.current.onTouchStart(e)},{passive:!1}),eM.current.addEventListener("wheel",function(e){A.current.onWheel(e)}),function(){document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)}},[]),(0,r.useEffect)(function(){return tb(),tg&&(tp.current=setTimeout(function(){tv(0)},100)),tb},[tg]);var tx=(M=eL?eB:eW,Z=(I=(0,B.Z)((0,B.Z)({},e),{},{tabs:eP})).tabs,H=I.tabPosition,q=I.rtl,["top","bottom"].includes(H)?(R="width",D=q?"right":"left",L=Math.abs(M)):(R="height",D="top",L=-M),(0,r.useMemo)(function(){if(!Z.length)return[0,0];for(var e=Z.length,t=e,n=0;n<e;n+=1){var r=tn.get(Z[n].key)||en;if(r[D]+r[R]>L+ts){t=n-1;break}}for(var o=0,a=e-1;a>=0;a-=1)if((tn.get(Z[a].key)||en)[D]<L){o=a+1;break}return o>=t?[0,0]:[o,t]},[tn,ts,to,ta,ti,L,H,Z.map(function(e){return e.key}).join("_"),q])),tw=(0,F.Z)(tx,2),tk=tw[0],tS=tw[1],tE=(0,V.Z)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ed,t=tn.get(e)||{width:0,height:0,left:0,right:0,top:0};if(eL){var n=eB;ev?t.right<eB?n=t.right:t.right+t.width>eB+ts&&(n=t.right+t.width-ts):t.left<-eB?n=-t.left:t.left+t.width>-eB+ts&&(n=-(t.left+t.width-ts)),eU(0),eF(tf(n))}else{var r=eW;t.top<-eW?r=-t.top:t.top+t.height>-eW+ts&&(r=-(t.top+t.height-ts)),eF(0),eU(tf(r))}}),tO={};"top"===ew||"bottom"===ew?tO[ev?"marginRight":"marginLeft"]=ek:tO.marginTop=ek;var tC=eP.map(function(e,t){var n=e.key;return r.createElement(ep,{id:ec,prefixCls:e_,key:n,tab:e,style:0===t?void 0:tO,closable:e.closable,editable:eb,active:n===ed,renderWrapper:eS,removeAriaLabel:null==ex?void 0:ex.removeAriaLabel,onClick:function(e){eE(n,e)},onFocus:function(){tE(n),ty(),eM.current&&(ev||(eM.current.scrollLeft=0),eM.current.scrollTop=0)}})}),tj=function(){return tt(function(){var e,t=new Map,n=null===(e=eI.current)||void 0===e?void 0:e.getBoundingClientRect();return eP.forEach(function(e){var r,o=e.key,a=null===(r=eI.current)||void 0===r?void 0:r.querySelector('[data-node-key="'.concat(eo(o),'"]'));if(a){var i=eh(a,n),l=(0,F.Z)(i,4),s=l[0],c=l[1],u=l[2],d=l[3];t.set(o,{width:s,height:c,left:u,top:d})}}),t})};(0,r.useEffect)(function(){tj()},[eP.map(function(e){return e.key}).join("_")]);var t_=et(function(){var e=em(eN),t=em(eT),n=em(eA);eX([e[0]-t[0]-n[0],e[1]-t[1]-n[1]]);var r=em(eD);e6(r),e8(em(eR));var o=em(eI);eJ([o[0]-r[0],o[1]-r[1]]),tj()}),tP=eP.slice(0,tk),tN=eP.slice(tS+1),tT=[].concat((0,T.Z)(tP),(0,T.Z)(tN)),tA=tn.get(ed),tM=Y({activeTabOffset:tA,horizontal:eL,indicator:eC,rtl:ev}).style;(0,r.useEffect)(function(){tE()},[ed,tu,td,er(tA),er(tn),eL]),(0,r.useEffect)(function(){t_()},[ev]);var tI=!!tT.length,tR="".concat(e_,"-nav-wrap");return eL?ev?(U=eB>0,W=eB!==td):(W=eB<0,U=eB!==tu):(G=eW<0,ee=eW!==tu),r.createElement($.Z,{onResize:t_},r.createElement("div",{ref:(0,X.x1)(t,eN),role:"tablist",className:a()("".concat(e_,"-nav"),ea),style:es,onKeyDown:function(){ty()}},r.createElement(el,{ref:eT,position:"left",extra:ey,prefixCls:e_}),r.createElement($.Z,{onResize:t_},r.createElement("div",{className:a()(tR,(0,z.Z)((0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(tR,"-ping-left"),W),"".concat(tR,"-ping-right"),U),"".concat(tR,"-ping-top"),G),"".concat(tR,"-ping-bottom"),ee)),ref:eM},r.createElement($.Z,{onResize:t_},r.createElement("div",{ref:eI,className:"".concat(e_,"-nav-list"),style:{transform:"translate(".concat(eB,"px, ").concat(eW,"px)"),transition:tg?"none":void 0}},tC,r.createElement(ei,{ref:eD,prefixCls:e_,locale:ex,editable:eb,style:(0,B.Z)((0,B.Z)({},0===tC.length?void 0:tO),{},{visibility:tI?"hidden":null})}),r.createElement("div",{className:a()("".concat(e_,"-ink-bar"),(0,z.Z)({},"".concat(e_,"-ink-bar-animated"),eu.inkBar)),style:tM}))))),r.createElement(ef,(0,j.Z)({},e,{removeAriaLabel:null==ex?void 0:ex.removeAriaLabel,ref:eR,prefixCls:e_,tabs:tT,className:!tI&&tc,tabMoving:!!tg})),r.createElement(el,{ref:eA,position:"right",extra:ey,prefixCls:e_})))}),ey=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.className,i=e.style,l=e.id,s=e.active,c=e.tabKey,u=e.children;return r.createElement("div",{id:l&&"".concat(l,"-panel-").concat(c),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":l&&"".concat(l,"-tab-").concat(c),"aria-hidden":!s,style:i,className:a()(n,s&&"".concat(n,"-active"),o),ref:t},u)}),eb=["renderTabBar"],ex=["label","key"],ew=function(e){var t=e.renderTabBar,n=(0,q.Z)(e,eb),o=r.useContext(K).tabs;return t?t((0,B.Z)((0,B.Z)({},n),{},{panes:o.map(function(e){var t=e.label,n=e.key,o=(0,q.Z)(e,ex);return r.createElement(ey,(0,j.Z)({tab:t,key:n,tabKey:n},o))})}),ev):r.createElement(ev,n)},ek=n(47970),eS=["key","forceRender","style","className","destroyInactiveTabPane"],eE=function(e){var t=e.id,n=e.activeKey,o=e.animated,i=e.tabPosition,l=e.destroyInactiveTabPane,s=r.useContext(K),c=s.prefixCls,u=s.tabs,d=o.tabPane,f="".concat(c,"-tabpane");return r.createElement("div",{className:a()("".concat(c,"-content-holder"))},r.createElement("div",{className:a()("".concat(c,"-content"),"".concat(c,"-content-").concat(i),(0,z.Z)({},"".concat(c,"-content-animated"),d))},u.map(function(e){var i=e.key,s=e.forceRender,c=e.style,u=e.className,p=e.destroyInactiveTabPane,h=(0,q.Z)(e,eS),m=i===n;return r.createElement(ek.ZP,(0,j.Z)({key:i,visible:m,forceRender:s,removeOnLeave:!!(l||p),leavedClassName:"".concat(f,"-hidden")},o.tabPaneMotion),function(e,n){var o=e.style,l=e.className;return r.createElement(ey,(0,j.Z)({},h,{prefixCls:f,id:t,tabKey:i,animated:d,active:m,style:(0,B.Z)((0,B.Z)({},c),o),className:a()(u,l),ref:n}))})})))};n(32559);var eO=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],eC=0,ej=r.forwardRef(function(e,t){var n=e.id,o=e.prefixCls,i=void 0===o?"rc-tabs":o,l=e.className,s=e.items,c=e.direction,u=e.activeKey,d=e.defaultActiveKey,f=e.editable,p=e.animated,h=e.tabPosition,m=void 0===h?"top":h,g=e.tabBarGutter,v=e.tabBarStyle,y=e.tabBarExtraContent,b=e.locale,x=e.moreIcon,w=e.moreTransitionName,k=e.destroyInactiveTabPane,S=e.renderTabBar,E=e.onChange,O=e.onTabClick,C=e.onTabScroll,_=e.getPopupContainer,P=e.popupClassName,N=e.indicator,T=(0,q.Z)(e,eO),A=r.useMemo(function(){return(s||[]).filter(function(e){return e&&"object"===(0,H.Z)(e)&&"key"in e})},[s]),M="rtl"===c,I=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(e=!1===t?{inkBar:!1,tabPane:!1}:!0===t?{inkBar:!0,tabPane:!1}:(0,B.Z)({inkBar:!0},"object"===(0,H.Z)(t)?t:{})).tabPaneMotion&&void 0===e.tabPane&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}(p),R=(0,r.useState)(!1),D=(0,F.Z)(R,2),L=D[0],Z=D[1];(0,r.useEffect)(function(){Z((0,U.Z)())},[]);var $=(0,W.Z)(function(){var e;return null===(e=A[0])||void 0===e?void 0:e.key},{value:u,defaultValue:d}),V=(0,F.Z)($,2),X=V[0],G=V[1],Y=(0,r.useState)(function(){return A.findIndex(function(e){return e.key===X})}),Q=(0,F.Z)(Y,2),J=Q[0],ee=Q[1];(0,r.useEffect)(function(){var e,t=A.findIndex(function(e){return e.key===X});-1===t&&(t=Math.max(0,Math.min(J,A.length-1)),G(null===(e=A[t])||void 0===e?void 0:e.key)),ee(t)},[A.map(function(e){return e.key}).join("_"),X,J]);var et=(0,W.Z)(null,{value:n}),en=(0,F.Z)(et,2),er=en[0],eo=en[1];(0,r.useEffect)(function(){n||(eo("rc-tabs-".concat(eC)),eC+=1)},[]);var ea={id:er,activeKey:X,animated:I,tabPosition:m,rtl:M,mobile:L},ei=(0,B.Z)((0,B.Z)({},ea),{},{editable:f,locale:b,moreIcon:x,moreTransitionName:w,tabBarGutter:g,onTabClick:function(e,t){null==O||O(e,t);var n=e!==X;G(e),n&&(null==E||E(e))},onTabScroll:C,extra:y,style:v,panes:null,getPopupContainer:_,popupClassName:P,indicator:N});return r.createElement(K.Provider,{value:{tabs:A,prefixCls:i}},r.createElement("div",(0,j.Z)({ref:t,id:n,className:a()(i,"".concat(i,"-").concat(m),(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(i,"-mobile"),L),"".concat(i,"-editable"),f),"".concat(i,"-rtl"),M),l)},T),r.createElement(ew,(0,j.Z)({},ei,{renderTabBar:S})),r.createElement(eE,(0,j.Z)({destroyInactiveTabPane:k},ea,{animated:I}))))}),e_=n(64024),eP=n(68710);let eN={motionAppear:!1,motionEnter:!0,motionLeave:!0};var eT=n(45287),eA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},eM=n(12918),eI=n(18544),eR=e=>{let{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{["".concat(t,"-switch")]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:"opacity ".concat(n)}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:"opacity ".concat(n)}}}}},[(0,eI.oN)(e,"slide-up"),(0,eI.oN)(e,"slide-down")]]};let eD=e=>{let{componentCls:t,tabsCardPadding:n,cardBg:r,cardGutter:o,colorBorderSecondary:a,itemSelectedColor:i}=e;return{["".concat(t,"-card")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{margin:0,padding:n,background:r,border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut)},["".concat(t,"-tab-active")]:{color:i,background:e.colorBgContainer},["".concat(t,"-ink-bar")]:{visibility:"hidden"}},["&".concat(t,"-top, &").concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginLeft:{_skip_check_:!0,value:(0,u.bf)(o)}}}},["&".concat(t,"-top")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")},["".concat(t,"-tab-active")]:{borderBottomColor:e.colorBgContainer}}},["&".concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},["".concat(t,"-tab-active")]:{borderTopColor:e.colorBgContainer}}},["&".concat(t,"-left, &").concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginTop:(0,u.bf)(o)}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,u.bf)(e.borderRadiusLG)," 0 0 ").concat((0,u.bf)(e.borderRadiusLG))}},["".concat(t,"-tab-active")]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0")}},["".concat(t,"-tab-active")]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},eL=e=>{let{componentCls:t,itemHoverColor:n,dropdownEdgeChildVerticalPadding:r}=e;return{["".concat(t,"-dropdown")]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},["".concat(t,"-dropdown-menu")]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:"".concat((0,u.bf)(r)," 0"),overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},eM.vS),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:"".concat((0,u.bf)(e.paddingXXS)," ").concat((0,u.bf)(e.paddingSM)),color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},eZ=e=>{let{componentCls:t,margin:n,colorBorderSecondary:r,horizontalMargin:o,verticalItemPadding:a,verticalItemMargin:i,calc:l}=e;return{["".concat(t,"-top, ").concat(t,"-bottom")]:{flexDirection:"column",["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r),content:"''"},["".concat(t,"-ink-bar")]:{height:e.lineWidthBold,"&-animated":{transition:"width ".concat(e.motionDurationSlow,", left ").concat(e.motionDurationSlow,",\n right ").concat(e.motionDurationSlow)}},["".concat(t,"-nav-wrap")]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},["&".concat(t,"-nav-wrap-ping-left::before")]:{opacity:1},["&".concat(t,"-nav-wrap-ping-right::after")]:{opacity:1}}}},["".concat(t,"-top")]:{["> ".concat(t,"-nav,\n > div > ").concat(t,"-nav")]:{"&::before":{bottom:0},["".concat(t,"-ink-bar")]:{bottom:0}}},["".concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},["".concat(t,"-ink-bar")]:{top:0}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{order:0}},["".concat(t,"-left, ").concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{flexDirection:"column",minWidth:l(e.controlHeight).mul(1.25).equal(),["".concat(t,"-tab")]:{padding:a,textAlign:"center"},["".concat(t,"-tab + ").concat(t,"-tab")]:{margin:i},["".concat(t,"-nav-wrap")]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},["&".concat(t,"-nav-wrap-ping-top::before")]:{opacity:1},["&".concat(t,"-nav-wrap-ping-bottom::after")]:{opacity:1}},["".concat(t,"-ink-bar")]:{width:e.lineWidthBold,"&-animated":{transition:"height ".concat(e.motionDurationSlow,", top ").concat(e.motionDurationSlow)}},["".concat(t,"-nav-list, ").concat(t,"-nav-operations")]:{flex:"1 0 auto",flexDirection:"column"}}},["".concat(t,"-left")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-ink-bar")]:{right:{_skip_check_:!0,value:0}}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{marginLeft:{_skip_check_:!0,value:(0,u.bf)(l(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},["> ".concat(t,"-content > ").concat(t,"-tabpane")]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},["".concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{order:1,["".concat(t,"-ink-bar")]:{left:{_skip_check_:!0,value:0}}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{order:0,marginRight:{_skip_check_:!0,value:l(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},["> ".concat(t,"-content > ").concat(t,"-tabpane")]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},ez=e=>{let{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,horizontalItemPaddingSM:o,horizontalItemPaddingLG:a}=e;return{[t]:{"&-small":{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:o,fontSize:e.titleFontSizeSM}}},"&-large":{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:a,fontSize:e.titleFontSizeLG}}}},["".concat(t,"-card")]:{["&".concat(t,"-small")]:{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:n}},["&".concat(t,"-bottom")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius))}},["&".concat(t,"-top")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:"".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius)," 0 0")}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius)," 0")}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,u.bf)(e.borderRadius)," 0 0 ").concat((0,u.bf)(e.borderRadius))}}}},["&".concat(t,"-large")]:{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:r}}}}}},eB=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:o,tabsHorizontalItemMargin:a,horizontalItemPadding:i,itemSelectedColor:l,itemColor:s}=e,c="".concat(t,"-tab");return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:i,fontSize:e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:s,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},(0,eM.Qy)(e)),"&-btn":{outline:"none",transition:"all 0.3s",["".concat(c,"-icon:not(:last-child)")]:{marginInlineEnd:e.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextHeading}},"&:hover":{color:r},["&".concat(c,"-active ").concat(c,"-btn")]:{color:l,textShadow:e.tabsActiveTextShadow},["&".concat(c,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed"},["&".concat(c,"-disabled ").concat(c,"-btn, &").concat(c,"-disabled ").concat(t,"-remove")]:{"&:focus, &:active":{color:e.colorTextDisabled}},["& ".concat(c,"-remove ").concat(o)]:{margin:0},["".concat(o,":not(:last-child)")]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},["".concat(c," + ").concat(c)]:{margin:{_skip_check_:!0,value:a}}}},eF=e=>{let{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:o,calc:a}=e;return{["".concat(t,"-rtl")]:{direction:"rtl",["".concat(t,"-nav")]:{["".concat(t,"-tab")]:{margin:{_skip_check_:!0,value:n},["".concat(t,"-tab:last-of-type")]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,u.bf)(e.marginSM)}},["".concat(t,"-tab-remove")]:{marginRight:{_skip_check_:!0,value:(0,u.bf)(e.marginXS)},marginLeft:{_skip_check_:!0,value:(0,u.bf)(a(e.marginXXS).mul(-1).equal())},[r]:{margin:0}}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav")]:{order:1},["> ".concat(t,"-content-holder")]:{order:0}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav")]:{order:0},["> ".concat(t,"-content-holder")]:{order:1}},["&".concat(t,"-card").concat(t,"-top, &").concat(t,"-card").concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},["".concat(t,"-dropdown-rtl")]:{direction:"rtl"},["".concat(t,"-menu-item")]:{["".concat(t,"-dropdown-rtl")]:{textAlign:{_skip_check_:!0,value:"right"}}}}},eH=e=>{let{componentCls:t,tabsCardPadding:n,cardHeight:r,cardGutter:o,itemHoverColor:a,itemActiveColor:i,colorBorderSecondary:l}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,eM.Wf)(e)),{display:"flex",["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{position:"relative",display:"flex",flex:"none",alignItems:"center",["".concat(t,"-nav-wrap")]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:"opacity ".concat(e.motionDurationSlow),content:"''",pointerEvents:"none"}},["".concat(t,"-nav-list")]:{position:"relative",display:"flex",transition:"opacity ".concat(e.motionDurationSlow)},["".concat(t,"-nav-operations")]:{display:"flex",alignSelf:"stretch"},["".concat(t,"-nav-operations-hidden")]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},["".concat(t,"-nav-more")]:{position:"relative",padding:n,background:"transparent",border:0,color:e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},["".concat(t,"-nav-add")]:Object.assign({minWidth:r,minHeight:r,marginLeft:{_skip_check_:!0,value:o},padding:"0 ".concat((0,u.bf)(e.paddingXS)),background:"transparent",border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(l),borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0"),outline:"none",cursor:"pointer",color:e.colorText,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut),"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:i}},(0,eM.Qy)(e))},["".concat(t,"-extra-content")]:{flex:"none"},["".concat(t,"-ink-bar")]:{position:"absolute",background:e.inkBarColor,pointerEvents:"none"}}),eB(e)),{["".concat(t,"-content")]:{position:"relative",width:"100%"},["".concat(t,"-content-holder")]:{flex:"auto",minWidth:0,minHeight:0},["".concat(t,"-tabpane")]:{outline:"none","&-hidden":{display:"none"}}}),["".concat(t,"-centered")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-nav-wrap")]:{["&:not([class*='".concat(t,"-nav-wrap-ping'])")]:{justifyContent:"center"}}}}}};var eq=(0,d.I$)("Tabs",e=>{let t=(0,f.TS)(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:"0 0 0 ".concat((0,u.bf)(e.horizontalItemGutter)),tabsHorizontalItemMarginRTL:"0 0 0 ".concat((0,u.bf)(e.horizontalItemGutter))});return[ez(t),eF(t),eZ(t),eL(t),eD(t),eH(t),eR(t)]},e=>{let t=e.controlHeightLG;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:t,cardPadding:"".concat((t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth,"px ").concat(e.padding,"px"),cardPaddingSM:"".concat(1.5*e.paddingXXS,"px ").concat(e.padding,"px"),cardPaddingLG:"".concat(e.paddingXS,"px ").concat(e.padding,"px ").concat(1.5*e.paddingXXS,"px"),titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:"0 0 ".concat(e.margin,"px 0"),horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:"".concat(e.paddingSM,"px 0"),horizontalItemPaddingSM:"".concat(e.paddingXS,"px 0"),horizontalItemPaddingLG:"".concat(e.padding,"px 0"),verticalItemPadding:"".concat(e.paddingXS,"px ").concat(e.paddingLG,"px"),verticalItemMargin:"".concat(e.margin,"px 0 0 0"),itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}}),eW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eU=e=>{var t,n,o,i,c,u;let d;let{type:f,className:p,rootClassName:h,size:m,onEdit:g,hideAdd:v,centered:y,addIcon:b,popupClassName:x,children:w,items:k,animated:S,style:E,indicatorSize:O,indicator:C}=e,j=eW(e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:_,moreIcon:P=r.createElement(L.Z,null)}=j,{direction:N,tabs:T,getPrefixCls:A,getPopupContainer:M}=r.useContext(l.E_),I=A("tabs",_),R=(0,e_.Z)(I),[z,B,F]=eq(I,R);"editable-card"===f&&(d={onEdit:(e,t)=>{let{key:n,event:r}=t;null==g||g("add"===e?r:n,e)},removeIcon:r.createElement(D.Z,null),addIcon:b||r.createElement(Z.Z,null),showAdd:!0!==v});let H=A(),q=(0,s.Z)(m),W=k||(0,eT.Z)(w).map(e=>{if(r.isValidElement(e)){let{key:t,props:n}=e,r=n||{},{tab:o}=r,a=eA(r,["tab"]);return Object.assign(Object.assign({key:String(t)},a),{label:o})}return null}).filter(e=>e),U=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return(t=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{})).tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},eN),{motionName:(0,eP.m)(e,"switch")})),t}(I,S),K=Object.assign(Object.assign({},null==T?void 0:T.style),E),$={align:null!==(t=null==C?void 0:C.align)&&void 0!==t?t:null===(n=null==T?void 0:T.indicator)||void 0===n?void 0:n.align,size:null!==(u=null!==(i=null!==(o=null==C?void 0:C.size)&&void 0!==o?o:O)&&void 0!==i?i:null===(c=null==T?void 0:T.indicator)||void 0===c?void 0:c.size)&&void 0!==u?u:null==T?void 0:T.indicatorSize};return z(r.createElement(ej,Object.assign({direction:N,getPopupContainer:M,moreTransitionName:"".concat(H,"-slide-up")},j,{items:W,className:a()({["".concat(I,"-").concat(q)]:q,["".concat(I,"-card")]:["card","editable-card"].includes(f),["".concat(I,"-editable-card")]:"editable-card"===f,["".concat(I,"-centered")]:y},null==T?void 0:T.className,p,h,B,F,R),popupClassName:a()(x,B,F,R),style:K,editable:d,moreIcon:P,prefixCls:I,animated:U,indicator:$})))};eU.TabPane=()=>null;var eK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},e$=e=>{var{prefixCls:t,className:n,hoverable:o=!0}=e,i=eK(e,["prefixCls","className","hoverable"]);let{getPrefixCls:s}=r.useContext(l.E_),c=s("card",t),u=a()("".concat(c,"-grid"),n,{["".concat(c,"-grid-hoverable")]:o});return r.createElement("div",Object.assign({},i,{className:u}))};let eV=e=>{let{antCls:t,componentCls:n,headerHeight:r,cardPaddingBase:o,tabsMarginBottom:a}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:r,marginBottom:-1,padding:"0 ".concat((0,u.bf)(o)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")},(0,eM.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},eM.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:a,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},eX=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:o}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,u.bf)(o)," 0 0 0 ").concat(n,",\n 0 ").concat((0,u.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,u.bf)(o)," ").concat((0,u.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,u.bf)(o)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,u.bf)(o)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:r}}},eG=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:r,cardActionsIconSize:o,colorBorderSecondary:a,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),display:"flex",borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},(0,eM.dF)()),{"& > li":{margin:r,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:"color ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:e.colorTextDescription,lineHeight:(0,u.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(n)]:{fontSize:o,lineHeight:(0,u.bf)(e.calc(o).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a)}}})},eY=e=>Object.assign(Object.assign({margin:"".concat((0,u.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,eM.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},eM.vS),"&-description":{color:e.colorTextDescription}}),eQ=e=>{let{componentCls:t,cardPaddingBase:n,colorFillAlter:r}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,u.bf)(n)),background:r,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,u.bf)(e.padding)," ").concat((0,u.bf)(n))}}},eJ=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},e0=e=>{let{antCls:t,componentCls:n,cardShadow:r,cardHeadPadding:o,colorBorderSecondary:a,boxShadowTertiary:i,cardPaddingBase:l,extraColor:s}=e;return{[n]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(n,"-bordered)")]:{boxShadow:i},["".concat(n,"-head")]:eV(e),["".concat(n,"-extra")]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},["".concat(n,"-body")]:Object.assign({padding:l,borderRadius:" 0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},(0,eM.dF)()),["".concat(n,"-grid")]:eX(e),["".concat(n,"-cover")]:{"> *":{display:"block",width:"100%"},["img, img + ".concat(t,"-image-mask")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")}},["".concat(n,"-actions")]:eG(e),["".concat(n,"-meta")]:eY(e)}),["".concat(n,"-bordered")]:{border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(n,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(n,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:r}},["".concat(n,"-contain-grid")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0 "),["".concat(n,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(n,"-loading) ").concat(n,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(n,"-contain-tabs")]:{["> ".concat(n,"-head")]:{minHeight:0,["".concat(n,"-head-title, ").concat(n,"-extra")]:{paddingTop:o}}},["".concat(n,"-type-inner")]:eQ(e),["".concat(n,"-loading")]:eJ(e),["".concat(n,"-rtl")]:{direction:"rtl"}}},e1=e=>{let{componentCls:t,cardPaddingSM:n,headerHeightSM:r,headerFontSizeSM:o}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:r,padding:"0 ".concat((0,u.bf)(n)),fontSize:o,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:n}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var e2=(0,d.I$)("Card",e=>{let t=(0,f.TS)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[e0(t),e1(t)]},e=>({headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText})),e6=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let e4=e=>{let{prefixCls:t,actions:n=[]}=e;return r.createElement("ul",{className:"".concat(t,"-actions")},n.map((e,t)=>r.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(t)},r.createElement("span",null,e))))},e3=r.forwardRef((e,t)=>{let n;let{prefixCls:o,className:c,rootClassName:u,style:d,extra:f,headStyle:p={},bodyStyle:h={},title:m,loading:g,bordered:v=!0,size:y,type:b,cover:x,actions:w,tabList:k,children:S,activeTabKey:E,defaultActiveTabKey:O,tabBarExtraContent:C,hoverable:j,tabProps:_={}}=e,P=e6(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:N,direction:T,card:A}=r.useContext(l.E_),M=r.useMemo(()=>{let e=!1;return r.Children.forEach(S,t=>{t&&t.type&&t.type===e$&&(e=!0)}),e},[S]),I=N("card",o),[D,L,Z]=e2(I),z=r.createElement(R,{loading:!0,active:!0,paragraph:{rows:4},title:!1},S),B=void 0!==E,F=Object.assign(Object.assign({},_),{[B?"activeKey":"defaultActiveKey"]:B?E:O,tabBarExtraContent:C}),H=(0,s.Z)(y),q=H&&"default"!==H?H:"large",W=k?r.createElement(eU,Object.assign({size:q},F,{className:"".concat(I,"-head-tabs"),onChange:t=>{var n;null===(n=e.onTabChange)||void 0===n||n.call(e,t)},items:k.map(e=>{var{tab:t}=e;return Object.assign({label:t},e6(e,["tab"]))})})):null;(m||f||W)&&(n=r.createElement("div",{className:"".concat(I,"-head"),style:p},r.createElement("div",{className:"".concat(I,"-head-wrapper")},m&&r.createElement("div",{className:"".concat(I,"-head-title")},m),f&&r.createElement("div",{className:"".concat(I,"-extra")},f)),W));let U=x?r.createElement("div",{className:"".concat(I,"-cover")},x):null,K=r.createElement("div",{className:"".concat(I,"-body"),style:h},g?z:S),$=w&&w.length?r.createElement(e4,{prefixCls:I,actions:w}):null,V=(0,i.Z)(P,["onTabChange"]),X=a()(I,null==A?void 0:A.className,{["".concat(I,"-loading")]:g,["".concat(I,"-bordered")]:v,["".concat(I,"-hoverable")]:j,["".concat(I,"-contain-grid")]:M,["".concat(I,"-contain-tabs")]:k&&k.length,["".concat(I,"-").concat(H)]:H,["".concat(I,"-type-").concat(b)]:!!b,["".concat(I,"-rtl")]:"rtl"===T},c,u,L,Z),G=Object.assign(Object.assign({},null==A?void 0:A.style),d);return D(r.createElement("div",Object.assign({ref:t},V,{className:X,style:G}),n,U,K,$))});var e5=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};e3.Grid=e$,e3.Meta=e=>{let{prefixCls:t,className:n,avatar:o,title:i,description:s}=e,c=e5(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=r.useContext(l.E_),d=u("card",t),f=a()("".concat(d,"-meta"),n),p=o?r.createElement("div",{className:"".concat(d,"-meta-avatar")},o):null,h=i?r.createElement("div",{className:"".concat(d,"-meta-title")},i):null,m=s?r.createElement("div",{className:"".concat(d,"-meta-description")},s):null,g=h||m?r.createElement("div",{className:"".concat(d,"-meta-detail")},h,m):null;return r.createElement("div",Object.assign({},c,{className:f}),p,g)};var e8=e3},69410:function(e,t,n){"use strict";var r=n(54998);t.Z=r.Z},44851:function(e,t,n){"use strict";n.d(t,{default:function(){return H}});var r=n(2265),o=n(77565),a=n(36760),i=n.n(a),l=n(83145),s=n(26365),c=n(41154),u=n(50506),d=n(32559),f=n(1119),p=n(6989),h=n(45287),m=n(11993),g=n(47970),v=n(95814),y=r.forwardRef(function(e,t){var n,o=e.prefixCls,a=e.forceRender,l=e.className,c=e.style,u=e.children,d=e.isActive,f=e.role,p=r.useState(d||a),h=(0,s.Z)(p,2),g=h[0],v=h[1];return(r.useEffect(function(){(a||d)&&v(!0)},[a,d]),g)?r.createElement("div",{ref:t,className:i()("".concat(o,"-content"),(n={},(0,m.Z)(n,"".concat(o,"-content-active"),d),(0,m.Z)(n,"".concat(o,"-content-inactive"),!d),n),l),style:c,role:f},r.createElement("div",{className:"".concat(o,"-content-box")},u)):null});y.displayName="PanelContent";var b=["showArrow","headerClass","isActive","onItemClick","forceRender","className","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],x=r.forwardRef(function(e,t){var n,o,a=e.showArrow,l=e.headerClass,s=e.isActive,c=e.onItemClick,u=e.forceRender,d=e.className,h=e.prefixCls,x=e.collapsible,w=e.accordion,k=e.panelKey,S=e.extra,E=e.header,O=e.expandIcon,C=e.openMotion,j=e.destroyInactivePanel,_=e.children,P=(0,p.Z)(e,b),N="disabled"===x,T="header"===x,A="icon"===x,M=function(){null==c||c(k)},I="function"==typeof O?O(e):r.createElement("i",{className:"arrow"});I&&(I=r.createElement("div",{className:"".concat(h,"-expand-icon"),onClick:["header","icon"].includes(x)?M:void 0},I));var R=i()((n={},(0,m.Z)(n,"".concat(h,"-item"),!0),(0,m.Z)(n,"".concat(h,"-item-active"),s),(0,m.Z)(n,"".concat(h,"-item-disabled"),N),n),d),D={className:i()(l,(o={},(0,m.Z)(o,"".concat(h,"-header"),!0),(0,m.Z)(o,"".concat(h,"-header-collapsible-only"),T),(0,m.Z)(o,"".concat(h,"-icon-collapsible-only"),A),o)),"aria-expanded":s,"aria-disabled":N,onKeyDown:function(e){("Enter"===e.key||e.keyCode===v.Z.ENTER||e.which===v.Z.ENTER)&&M()}};return T||A||(D.onClick=M,D.role=w?"tab":"button",D.tabIndex=N?-1:0),r.createElement("div",(0,f.Z)({},P,{ref:t,className:R}),r.createElement("div",D,(void 0===a||a)&&I,r.createElement("span",{className:"".concat(h,"-header-text"),onClick:"header"===x?M:void 0},E),null!=S&&"boolean"!=typeof S&&r.createElement("div",{className:"".concat(h,"-extra")},S)),r.createElement(g.ZP,(0,f.Z)({visible:s,leavedClassName:"".concat(h,"-content-hidden")},C,{forceRender:u,removeOnLeave:j}),function(e,t){var n=e.className,o=e.style;return r.createElement(y,{ref:t,prefixCls:h,className:n,style:o,isActive:s,forceRender:u,role:w?"tabpanel":void 0},_)}))}),w=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],k=function(e,t){var n=t.prefixCls,o=t.accordion,a=t.collapsible,i=t.destroyInactivePanel,l=t.onItemClick,s=t.activeKey,c=t.openMotion,u=t.expandIcon;return e.map(function(e,t){var d=e.children,h=e.label,m=e.key,g=e.collapsible,v=e.onItemClick,y=e.destroyInactivePanel,b=(0,p.Z)(e,w),k=String(null!=m?m:t),S=null!=g?g:a,E=!1;return E=o?s[0]===k:s.indexOf(k)>-1,r.createElement(x,(0,f.Z)({},b,{prefixCls:n,key:k,panelKey:k,isActive:E,accordion:o,openMotion:c,expandIcon:u,header:h,collapsible:S,onItemClick:function(e){"disabled"!==S&&(l(e),null==v||v(e))},destroyInactivePanel:null!=y?y:i}),d)})},S=function(e,t,n){if(!e)return null;var o=n.prefixCls,a=n.accordion,i=n.collapsible,l=n.destroyInactivePanel,s=n.onItemClick,c=n.activeKey,u=n.openMotion,d=n.expandIcon,f=e.key||String(t),p=e.props,h=p.header,m=p.headerClass,g=p.destroyInactivePanel,v=p.collapsible,y=p.onItemClick,b=!1;b=a?c[0]===f:c.indexOf(f)>-1;var x=null!=v?v:i,w={key:f,panelKey:f,header:h,headerClass:m,isActive:b,prefixCls:o,destroyInactivePanel:null!=g?g:l,openMotion:u,accordion:a,children:e.props.children,onItemClick:function(e){"disabled"!==x&&(s(e),null==y||y(e))},expandIcon:d,collapsible:x};return"string"==typeof e.type?e:(Object.keys(w).forEach(function(e){void 0===w[e]&&delete w[e]}),r.cloneElement(e,w))};function E(e){var t=e;if(!Array.isArray(t)){var n=(0,c.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var O=Object.assign(r.forwardRef(function(e,t){var n,o=e.prefixCls,a=void 0===o?"rc-collapse":o,c=e.destroyInactivePanel,f=e.style,p=e.accordion,m=e.className,g=e.children,v=e.collapsible,y=e.openMotion,b=e.expandIcon,x=e.activeKey,w=e.defaultActiveKey,O=e.onChange,C=e.items,j=i()(a,m),_=(0,u.Z)([],{value:x,onChange:function(e){return null==O?void 0:O(e)},defaultValue:w,postState:E}),P=(0,s.Z)(_,2),N=P[0],T=P[1];(0,d.ZP)(!g,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var A=(n={prefixCls:a,accordion:p,openMotion:y,expandIcon:b,collapsible:v,destroyInactivePanel:void 0!==c&&c,onItemClick:function(e){return T(function(){return p?N[0]===e?[]:[e]:N.indexOf(e)>-1?N.filter(function(t){return t!==e}):[].concat((0,l.Z)(N),[e])})},activeKey:N},Array.isArray(C)?k(C,n):(0,h.Z)(g).map(function(e,t){return S(e,t,n)}));return r.createElement("div",{ref:t,className:j,style:f,role:p?"tablist":void 0},A)}),{Panel:x});O.Panel;var C=n(18694),j=n(68710),_=n(19722),P=n(71744),N=n(33759);let T=r.forwardRef((e,t)=>{let{getPrefixCls:n}=r.useContext(P.E_),{prefixCls:o,className:a,showArrow:l=!0}=e,s=n("collapse",o),c=i()({["".concat(s,"-no-arrow")]:!l},a);return r.createElement(O.Panel,Object.assign({ref:t},e,{prefixCls:s,className:c}))});var A=n(352),M=n(12918),I=n(63074),R=n(80669),D=n(3104);let L=e=>{let{componentCls:t,contentBg:n,padding:r,headerBg:o,headerPadding:a,collapseHeaderPaddingSM:i,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:s,lineWidth:c,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:h,fontSizeLG:m,lineHeight:g,lineHeightLG:v,marginSM:y,paddingSM:b,paddingLG:x,paddingXS:w,motionDurationSlow:k,fontSizeIcon:S,contentPadding:E,fontHeight:O,fontHeightLG:C}=e,j="".concat((0,A.bf)(c)," ").concat(u," ").concat(d);return{[t]:Object.assign(Object.assign({},(0,M.Wf)(e)),{backgroundColor:o,border:j,borderBottom:0,borderRadius:s,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:j,"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["> ".concat(t,"-header")]:{position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:a,color:p,lineHeight:g,cursor:"pointer",transition:"all ".concat(k,", visibility 0s"),["> ".concat(t,"-header-text")]:{flex:"auto"},"&:focus":{outline:"none"},["".concat(t,"-expand-icon")]:{height:O,display:"flex",alignItems:"center",paddingInlineEnd:y},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,M.Ro)()),{fontSize:S,svg:{transition:"transform ".concat(k)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}},["".concat(t,"-icon-collapsible-only")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:f,backgroundColor:n,borderTop:j,["& > ".concat(t,"-content-box")]:{padding:E},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:i,paddingInlineStart:w,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(b).sub(w).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:b}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:m,lineHeight:v,["> ".concat(t,"-header")]:{padding:l,paddingInlineStart:r,["> ".concat(t,"-expand-icon")]:{height:C,marginInlineStart:e.calc(x).sub(r).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:x}}},["".concat(t,"-item:last-child")]:{["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:h,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:y}}}}})}},Z=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow svg");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},z=e=>{let{componentCls:t,headerBg:n,paddingXXS:r,colorBorder:o}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(o)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:"transparent",borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{paddingTop:r}}}},B=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var F=(0,R.I$)("Collapse",e=>{let t=(0,D.TS)(e,{collapseHeaderPaddingSM:"".concat((0,A.bf)(e.paddingXS)," ").concat((0,A.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,A.bf)(e.padding)," ").concat((0,A.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[L(t),z(t),B(t),Z(t),(0,I.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer})),H=Object.assign(r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a,collapse:l}=r.useContext(P.E_),{prefixCls:s,className:c,rootClassName:u,style:d,bordered:f=!0,ghost:p,size:m,expandIconPosition:g="start",children:v,expandIcon:y}=e,b=(0,N.Z)(e=>{var t;return null!==(t=null!=m?m:e)&&void 0!==t?t:"middle"}),x=n("collapse",s),w=n(),[k,S,E]=F(x),T=r.useMemo(()=>"left"===g?"start":"right"===g?"end":g,[g]),A=i()("".concat(x,"-icon-position-").concat(T),{["".concat(x,"-borderless")]:!f,["".concat(x,"-rtl")]:"rtl"===a,["".concat(x,"-ghost")]:!!p,["".concat(x,"-").concat(b)]:"middle"!==b},null==l?void 0:l.className,c,u,S,E),M=Object.assign(Object.assign({},(0,j.Z)(w)),{motionAppear:!1,leavedClassName:"".concat(x,"-content-hidden")}),I=r.useMemo(()=>v?(0,h.Z)(v).map((e,t)=>{var n,r;if(null===(n=e.props)||void 0===n?void 0:n.disabled){let n=null!==(r=e.key)&&void 0!==r?r:String(t),{disabled:o,collapsible:a}=e.props,i=Object.assign(Object.assign({},(0,C.Z)(e.props,["disabled"])),{key:n,collapsible:null!=a?a:o?"disabled":void 0});return(0,_.Tm)(e,i)}return e}):null,[v]);return k(r.createElement(O,Object.assign({ref:t,openMotion:M},(0,C.Z)(e,["rootClassName"]),{expandIcon:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=y?y(e):r.createElement(o.Z,{rotate:e.isActive?90:void 0});return(0,_.Tm)(t,()=>({className:i()(t.props.className,"".concat(x,"-arrow"))}))},prefixCls:x,className:A,style:Object.assign(Object.assign({},null==l?void 0:l.style),d)}),I))}),{Panel:T})},23496:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),l=n(352),s=n(12918),c=n(80669),u=n(3104);let d=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:o,textPaddingInline:a,orientationMargin:i,verticalMarginInline:c}=e;return{[t]:Object.assign(Object.assign({},(0,s.Wf)(e)),{borderBlockStart:"".concat((0,l.bf)(o)," solid ").concat(r),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:c,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat((0,l.bf)(o)," solid ").concat(r)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat((0,l.bf)(e.dividerHorizontalGutterMargin)," 0")},["&-horizontal".concat(t,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat((0,l.bf)(e.dividerHorizontalWithTextGutterMargin)," 0"),color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(r),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat((0,l.bf)(o)," solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(t,"-with-text-left")]:{"&::before":{width:"calc(".concat(i," * 100%)")},"&::after":{width:"calc(100% - ".concat(i," * 100%)")}},["&-horizontal".concat(t,"-with-text-right")]:{"&::before":{width:"calc(100% - ".concat(i," * 100%)")},"&::after":{width:"calc(".concat(i," * 100%)")}},["".concat(t,"-inner-text")]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:"".concat((0,l.bf)(o)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(t,"-dashed")]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(t,"-with-text")]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},["&-horizontal".concat(t,"-with-text-left").concat(t,"-no-default-orientation-margin-left")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(t,"-inner-text")]:{paddingInlineStart:n}},["&-horizontal".concat(t,"-with-text-right").concat(t,"-no-default-orientation-margin-right")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(t,"-inner-text")]:{paddingInlineEnd:n}}})}};var f=(0,c.I$)("Divider",e=>[d((0,u.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0}))],e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},h=e=>{let{getPrefixCls:t,direction:n,divider:o}=r.useContext(i.E_),{prefixCls:l,type:s="horizontal",orientation:c="center",orientationMargin:u,className:d,rootClassName:h,children:m,dashed:g,plain:v,style:y}=e,b=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),x=t("divider",l),[w,k,S]=f(x),E=c.length>0?"-".concat(c):c,O=!!m,C="left"===c&&null!=u,j="right"===c&&null!=u,_=a()(x,null==o?void 0:o.className,k,S,"".concat(x,"-").concat(s),{["".concat(x,"-with-text")]:O,["".concat(x,"-with-text").concat(E)]:O,["".concat(x,"-dashed")]:!!g,["".concat(x,"-plain")]:!!v,["".concat(x,"-rtl")]:"rtl"===n,["".concat(x,"-no-default-orientation-margin-left")]:C,["".concat(x,"-no-default-orientation-margin-right")]:j},d,h),P=r.useMemo(()=>"number"==typeof u?u:/^\d+$/.test(u)?Number(u):u,[u]),N=Object.assign(Object.assign({},C&&{marginLeft:P}),j&&{marginRight:P});return w(r.createElement("div",Object.assign({className:_,style:Object.assign(Object.assign({},null==o?void 0:o.style),y)},b,{role:"separator"}),m&&"vertical"!==s&&r.createElement("span",{className:"".concat(x,"-inner-text"),style:N},m)))}},20577:function(e,t,n){"use strict";n.d(t,{Z:function(){return em}});var r=n(2265),o=n(70464),a=n(1119),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},l=n(55015),s=r.forwardRef(function(e,t){return r.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:i}))}),c=n(36760),u=n.n(c),d=n(11993),f=n(41154),p=n(26365),h=n(6989),m=n(76405),g=n(25049);function v(){return"function"==typeof BigInt}function y(e){return!e&&0!==e&&!Number.isNaN(e)||!String(e).trim()}function b(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var r=t||"0",o=r.split("."),a=o[0]||"0",i=o[1]||"0";"0"===a&&"0"===i&&(n=!1);var l=n?"-":"";return{negative:n,negativeStr:l,trimStr:r,integerStr:a,decimalStr:i,fullStr:"".concat(l).concat(r)}}function x(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function w(e){var t=String(e);if(x(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&S(t)?t.length-t.indexOf(".")-1:0}function k(e){var t=String(e);if(x(e)){if(e>Number.MAX_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);t=e.toFixed(w(t))}return b(t).fullStr}function S(e){return"number"==typeof e?!Number.isNaN(e):!!e&&(/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e))}var E=function(){function e(t){if((0,m.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"negative",void 0),(0,d.Z)(this,"integer",void 0),(0,d.Z)(this,"decimal",void 0),(0,d.Z)(this,"decimalLen",void 0),(0,d.Z)(this,"empty",void 0),(0,d.Z)(this,"nan",void 0),y(t)){this.empty=!0;return}if(this.origin=String(t),"-"===t||Number.isNaN(t)){this.nan=!0;return}var n=t;if(x(n)&&(n=Number(n)),S(n="string"==typeof n?n:k(n))){var r=b(n);this.negative=r.negative;var o=r.trimStr.split(".");this.integer=BigInt(o[0]);var a=o[1]||"0";this.decimal=BigInt(a),this.decimalLen=a.length}else this.nan=!0}return(0,g.Z)(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(e){return BigInt("".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(e,"0")))}},{key:"negate",value:function(){var t=new e(this.toString());return t.negative=!t.negative,t}},{key:"cal",value:function(t,n,r){var o=Math.max(this.getDecimalStr().length,t.getDecimalStr().length),a=n(this.alignDecimal(o),t.alignDecimal(o)).toString(),i=r(o),l=b(a),s=l.negativeStr,c=l.trimStr,u="".concat(s).concat(c.padStart(i+1,"0"));return new e("".concat(u.slice(0,-i),".").concat(u.slice(-i)))}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=new e(t);return n.isInvalidate()?this:this.cal(n,function(e,t){return e+t},function(e){return e})}},{key:"multi",value:function(t){var n=new e(t);return this.isInvalidate()||n.isInvalidate()?new e(NaN):this.cal(n,function(e,t){return e*t},function(e){return 2*e})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toString()===(null==e?void 0:e.toString())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":b("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}(),O=function(){function e(t){if((0,m.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"number",void 0),(0,d.Z)(this,"empty",void 0),y(t)){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return(0,g.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(w(this.number),w(n));return new e(r.toFixed(o))}},{key:"multi",value:function(t){var n=Number(t);if(this.isInvalidate()||Number.isNaN(n))return new e(NaN);var r=this.number*n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(w(this.number),w(n));return new e(r.toFixed(o))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toNumber()===(null==e?void 0:e.toNumber())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":k(this.number):this.origin}}]),e}();function C(e){return v()?new E(e):new O(e)}function j(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var o=b(e),a=o.negativeStr,i=o.integerStr,l=o.decimalStr,s="".concat(t).concat(l),c="".concat(a).concat(i);if(n>=0){var u=Number(l[n]);return u>=5&&!r?j(C(e).add("".concat(a,"0.").concat("0".repeat(n)).concat(10-u)).toString(),t,n,r):0===n?c:"".concat(c).concat(t).concat(l.padEnd(n,"0").slice(0,n))}return".0"===s?c:"".concat(c).concat(s)}var _=n(2027),P=n(27380),N=n(28791),T=n(32559),A=n(79267),M=function(){var e=(0,r.useState)(!1),t=(0,p.Z)(e,2),n=t[0],o=t[1];return(0,P.Z)(function(){o((0,A.Z)())},[]),n},I=n(53346);function R(e){var t=e.prefixCls,n=e.upNode,o=e.downNode,i=e.upDisabled,l=e.downDisabled,s=e.onStep,c=r.useRef(),f=r.useRef([]),p=r.useRef();p.current=s;var h=function(){clearTimeout(c.current)},m=function(e,t){e.preventDefault(),h(),p.current(t),c.current=setTimeout(function e(){p.current(t),c.current=setTimeout(e,200)},600)};if(r.useEffect(function(){return function(){h(),f.current.forEach(function(e){return I.Z.cancel(e)})}},[]),M())return null;var g="".concat(t,"-handler"),v=u()(g,"".concat(g,"-up"),(0,d.Z)({},"".concat(g,"-up-disabled"),i)),y=u()(g,"".concat(g,"-down"),(0,d.Z)({},"".concat(g,"-down-disabled"),l)),b=function(){return f.current.push((0,I.Z)(h))},x={unselectable:"on",role:"button",onMouseUp:b,onMouseLeave:b};return r.createElement("div",{className:"".concat(g,"-wrap")},r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){m(e,!0)},"aria-label":"Increase Value","aria-disabled":i,className:v}),n||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){m(e,!1)},"aria-label":"Decrease Value","aria-disabled":l,className:y}),o||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function D(e){var t="number"==typeof e?k(e):b(e).fullStr;return t.includes(".")?b(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var L=n(55041),Z=function(){var e=(0,r.useRef)(0),t=function(){I.Z.cancel(e.current)};return(0,r.useEffect)(function(){return t},[]),function(n){t(),e.current=(0,I.Z)(function(){n()})}},z=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","wheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur"],B=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],F=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},H=function(e){var t=C(e);return t.isInvalidate()?null:t},q=r.forwardRef(function(e,t){var n,o,i,l=e.prefixCls,s=void 0===l?"rc-input-number":l,c=e.className,m=e.style,g=e.min,v=e.max,y=e.step,b=void 0===y?1:y,x=e.defaultValue,E=e.value,O=e.disabled,_=e.readOnly,A=e.upHandler,M=e.downHandler,I=e.keyboard,L=e.wheel,B=e.controls,q=(e.classNames,e.stringMode),W=e.parser,U=e.formatter,K=e.precision,$=e.decimalSeparator,V=e.onChange,X=e.onInput,G=e.onPressEnter,Y=e.onStep,Q=e.changeOnBlur,J=void 0===Q||Q,ee=(0,h.Z)(e,z),et="".concat(s,"-input"),en=r.useRef(null),er=r.useState(!1),eo=(0,p.Z)(er,2),ea=eo[0],ei=eo[1],el=r.useRef(!1),es=r.useRef(!1),ec=r.useRef(!1),eu=r.useState(function(){return C(null!=E?E:x)}),ed=(0,p.Z)(eu,2),ef=ed[0],ep=ed[1],eh=r.useCallback(function(e,t){return t?void 0:K>=0?K:Math.max(w(e),w(b))},[K,b]),em=r.useCallback(function(e){var t=String(e);if(W)return W(t);var n=t;return $&&(n=n.replace($,".")),n.replace(/[^\w.-]+/g,"")},[W,$]),eg=r.useRef(""),ev=r.useCallback(function(e,t){if(U)return U(e,{userTyping:t,input:String(eg.current)});var n="number"==typeof e?k(e):e;if(!t){var r=eh(n,t);S(n)&&($||r>=0)&&(n=j(n,$||".",r))}return n},[U,eh,$]),ey=r.useState(function(){var e=null!=x?x:E;return ef.isInvalidate()&&["string","number"].includes((0,f.Z)(e))?Number.isNaN(e)?"":e:ev(ef.toString(),!1)}),eb=(0,p.Z)(ey,2),ex=eb[0],ew=eb[1];function ek(e,t){ew(ev(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}eg.current=ex;var eS=r.useMemo(function(){return H(v)},[v,K]),eE=r.useMemo(function(){return H(g)},[g,K]),eO=r.useMemo(function(){return!(!eS||!ef||ef.isInvalidate())&&eS.lessEquals(ef)},[eS,ef]),eC=r.useMemo(function(){return!(!eE||!ef||ef.isInvalidate())&&ef.lessEquals(eE)},[eE,ef]),ej=(n=en.current,o=(0,r.useRef)(null),[function(){try{var e=n.selectionStart,t=n.selectionEnd,r=n.value,a=r.substring(0,e),i=r.substring(t);o.current={start:e,end:t,value:r,beforeTxt:a,afterTxt:i}}catch(e){}},function(){if(n&&o.current&&ea)try{var e=n.value,t=o.current,r=t.beforeTxt,a=t.afterTxt,i=t.start,l=e.length;if(e.endsWith(a))l=e.length-o.current.afterTxt.length;else if(e.startsWith(r))l=r.length;else{var s=r[i-1],c=e.indexOf(s,i-1);-1!==c&&(l=c+1)}n.setSelectionRange(l,l)}catch(e){(0,T.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),e_=(0,p.Z)(ej,2),eP=e_[0],eN=e_[1],eT=function(e){return eS&&!e.lessEquals(eS)?eS:eE&&!eE.lessEquals(e)?eE:null},eA=function(e){return!eT(e)},eM=function(e,t){var n=e,r=eA(n)||n.isEmpty();if(n.isEmpty()||t||(n=eT(n)||n,r=!0),!_&&!O&&r){var o,a=n.toString(),i=eh(a,t);return i>=0&&!eA(n=C(j(a,".",i)))&&(n=C(j(a,".",i,!0))),n.equals(ef)||(o=n,void 0===E&&ep(o),null==V||V(n.isEmpty()?null:F(q,n)),void 0===E&&ek(n,t)),n}return ef},eI=Z(),eR=function e(t){if(eP(),eg.current=t,ew(t),!es.current){var n=C(em(t));n.isNaN()||eM(n,!0)}null==X||X(t),eI(function(){var n=t;W||(n=t.replace(/。/g,".")),n!==t&&e(n)})},eD=function(e){if((!e||!eO)&&(e||!eC)){el.current=!1;var t,n=C(ec.current?D(b):b);e||(n=n.negate());var r=eM((ef||C(0)).add(n.toString()),!1);null==Y||Y(F(q,r),{offset:ec.current?D(b):b,type:e?"up":"down"}),null===(t=en.current)||void 0===t||t.focus()}},eL=function(e){var t=C(em(ex)),n=t;n=t.isNaN()?eM(ef,e):eM(t,e),void 0!==E?ek(ef,!1):n.isNaN()||ek(n,!1)};return r.useEffect(function(){var e=function(e){!1!==L&&(eD(e.deltaY<0),e.preventDefault())},t=en.current;if(t)return t.addEventListener("wheel",e),function(){return t.removeEventListener("wheel",e)}},[eD]),(0,P.o)(function(){ef.isInvalidate()||ek(ef,!1)},[K,U]),(0,P.o)(function(){var e=C(E);ep(e);var t=C(em(ex));e.equals(t)&&el.current&&!U||ek(e,el.current)},[E]),(0,P.o)(function(){U&&eN()},[ex]),r.createElement("div",{className:u()(s,c,(i={},(0,d.Z)(i,"".concat(s,"-focused"),ea),(0,d.Z)(i,"".concat(s,"-disabled"),O),(0,d.Z)(i,"".concat(s,"-readonly"),_),(0,d.Z)(i,"".concat(s,"-not-a-number"),ef.isNaN()),(0,d.Z)(i,"".concat(s,"-out-of-range"),!ef.isInvalidate()&&!eA(ef)),i)),style:m,onFocus:function(){ei(!0)},onBlur:function(){J&&eL(!1),ei(!1),el.current=!1},onKeyDown:function(e){var t=e.key,n=e.shiftKey;el.current=!0,ec.current=n,"Enter"===t&&(es.current||(el.current=!1),eL(!1),null==G||G(e)),!1!==I&&!es.current&&["Up","ArrowUp","Down","ArrowDown"].includes(t)&&(eD("Up"===t||"ArrowUp"===t),e.preventDefault())},onKeyUp:function(){el.current=!1,ec.current=!1},onCompositionStart:function(){es.current=!0},onCompositionEnd:function(){es.current=!1,eR(en.current.value)},onBeforeInput:function(){el.current=!0}},(void 0===B||B)&&r.createElement(R,{prefixCls:s,upNode:A,downNode:M,upDisabled:eO,downDisabled:eC,onStep:eD}),r.createElement("div",{className:"".concat(et,"-wrap")},r.createElement("input",(0,a.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":g,"aria-valuemax":v,"aria-valuenow":ef.isInvalidate()?null:ef.toString(),step:b},ee,{ref:(0,N.sQ)(en,t),className:et,value:ex,onChange:function(e){eR(e.target.value)},disabled:O,readOnly:_}))))}),W=r.forwardRef(function(e,t){var n=e.disabled,o=e.style,i=e.prefixCls,l=e.value,s=e.prefix,c=e.suffix,u=e.addonBefore,d=e.addonAfter,f=e.className,p=e.classNames,m=(0,h.Z)(e,B),g=r.useRef(null);return r.createElement(_.Q,{className:f,triggerFocus:function(e){g.current&&(0,L.nH)(g.current,e)},prefixCls:i,value:l,disabled:n,style:o,prefix:s,suffix:c,addonAfter:d,addonBefore:u,classNames:p,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}},r.createElement(q,(0,a.Z)({prefixCls:i,disabled:n,ref:(0,N.sQ)(g,t),className:null==p?void 0:p.input},m)))});W.displayName="InputNumber";var U=n(12757),K=n(71744),$=n(13959),V=n(86586),X=n(64024),G=n(33759),Y=n(39109),Q=n(56250),J=n(65658),ee=n(352),et=n(31282),en=n(37433),er=n(65265),eo=n(12918),ea=n(17691),ei=n(80669),el=n(3104),es=n(36360);let ec=(e,t)=>{let{componentCls:n,borderRadiusSM:r,borderRadiusLG:o}=e,a="lg"===t?o:r;return{["&-".concat(t)]:{["".concat(n,"-handler-wrap")]:{borderStartEndRadius:a,borderEndEndRadius:a},["".concat(n,"-handler-up")]:{borderStartEndRadius:a},["".concat(n,"-handler-down")]:{borderEndEndRadius:a}}}},eu=e=>{let{componentCls:t,lineWidth:n,lineType:r,borderRadius:o,fontSizeLG:a,controlHeightLG:i,controlHeightSM:l,colorError:s,paddingInlineSM:c,paddingBlockSM:u,paddingBlockLG:d,paddingInlineLG:f,colorTextDescription:p,motionDurationMid:h,handleHoverColor:m,paddingInline:g,paddingBlock:v,handleBg:y,handleActiveBg:b,colorTextDisabled:x,borderRadiusSM:w,borderRadiusLG:k,controlWidth:S,handleOpacity:E,handleBorderColor:O,filledHandleBg:C,lineHeightLG:j,calc:_}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.ik)(e)),{display:"inline-block",width:S,margin:0,padding:0,borderRadius:o}),(0,er.qG)(e,{["".concat(t,"-handler-wrap")]:{background:y,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O)}}})),(0,er.H8)(e,{["".concat(t,"-handler-wrap")]:{background:C,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O)}},"&:focus-within":{["".concat(t,"-handler-wrap")]:{background:y}}})),(0,er.Mu)(e)),{"&-rtl":{direction:"rtl",["".concat(t,"-input")]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:a,lineHeight:j,borderRadius:k,["input".concat(t,"-input")]:{height:_(i).sub(_(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(d)," ").concat((0,ee.bf)(f))}},"&-sm":{padding:0,borderRadius:w,["input".concat(t,"-input")]:{height:_(l).sub(_(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(u)," ").concat((0,ee.bf)(c))}},"&-out-of-range":{["".concat(t,"-input-wrap")]:{input:{color:s}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.s7)(e)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",["".concat(t,"-affix-wrapper")]:{width:"100%"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:k,fontSize:e.fontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:w}}},(0,er.ir)(e)),(0,er.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),["&-disabled ".concat(t,"-input")]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),{width:"100%",padding:"".concat((0,ee.bf)(v)," ").concat((0,ee.bf)(g)),textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:"all ".concat(h," linear"),appearance:"textfield",fontSize:"inherit"}),(0,et.nz)(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[t]:Object.assign(Object.assign(Object.assign({["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{opacity:1},["".concat(t,"-handler-wrap")]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:"100%",borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:E,display:"flex",flexDirection:"column",alignItems:"stretch",transition:"opacity ".concat(h," linear ").concat(h),["".concat(t,"-handler")]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},["".concat(t,"-handler")]:{height:"50%",overflow:"hidden",color:p,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O),transition:"all ".concat(h," linear"),"&:active":{background:b},"&:hover":{height:"60%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{color:m}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,eo.Ro)()),{color:p,transition:"all ".concat(h," linear"),userSelect:"none"})},["".concat(t,"-handler-up")]:{borderStartEndRadius:o},["".concat(t,"-handler-down")]:{borderEndEndRadius:o}},ec(e,"lg")),ec(e,"sm")),{"&-disabled, &-readonly":{["".concat(t,"-handler-wrap")]:{display:"none"},["".concat(t,"-input")]:{color:"inherit"}},["\n ".concat(t,"-handler-up-disabled,\n ").concat(t,"-handler-down-disabled\n ")]:{cursor:"not-allowed"},["\n ".concat(t,"-handler-up-disabled:hover &-handler-up-inner,\n ").concat(t,"-handler-down-disabled:hover &-handler-down-inner\n ")]:{color:x}})}]},ed=e=>{let{componentCls:t,paddingBlock:n,paddingInline:r,inputAffixPadding:o,controlWidth:a,borderRadiusLG:i,borderRadiusSM:l,paddingInlineLG:s,paddingInlineSM:c,paddingBlockLG:u,paddingBlockSM:d}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign({["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(n)," 0")}},(0,et.ik)(e)),{position:"relative",display:"inline-flex",width:a,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:i,paddingInlineStart:s,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(u)," 0")}},"&-sm":{borderRadius:l,paddingInlineStart:c,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(d)," 0")}},["&:not(".concat(t,"-disabled):hover")]:{zIndex:1},"&-focused, &:focus":{zIndex:1},["&-disabled > ".concat(t,"-disabled")]:{background:"transparent"},["> div".concat(t)]:{width:"100%",border:"none",outline:"none",["&".concat(t,"-focused")]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t,"-handler-wrap")]:{zIndex:2},[t]:{color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:r,marginInlineStart:o}}})}};var ef=(0,ei.I$)("InputNumber",e=>{let t=(0,el.TS)(e,(0,en.e)(e));return[eu(t),ed(t),(0,ea.c)(t)]},e=>{var t;let n=null!==(t=e.handleVisible)&&void 0!==t?t:"auto";return Object.assign(Object.assign({},(0,en.T)(e)),{controlWidth:90,handleWidth:e.controlHeightSM-2*e.lineWidth,handleFontSize:e.fontSize/2,handleVisible:n,handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,filledHandleBg:new es.C(e.colorFillSecondary).onBackground(e.colorBgContainer).toHexString(),handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder,handleOpacity:!0===n?1:0})},{unitless:{handleOpacity:!0}}),ep=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eh=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a}=r.useContext(K.E_),i=r.useRef(null);r.useImperativeHandle(t,()=>i.current);let{className:l,rootClassName:c,size:d,disabled:f,prefixCls:p,addonBefore:h,addonAfter:m,prefix:g,bordered:v,readOnly:y,status:b,controls:x,variant:w}=e,k=ep(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls","variant"]),S=n("input-number",p),E=(0,X.Z)(S),[O,C,j]=ef(S,E),{compactSize:_,compactItemClassnames:P}=(0,J.ri)(S,a),N=r.createElement(s,{className:"".concat(S,"-handler-up-inner")}),T=r.createElement(o.Z,{className:"".concat(S,"-handler-down-inner")});"object"==typeof x&&(N=void 0===x.upIcon?N:r.createElement("span",{className:"".concat(S,"-handler-up-inner")},x.upIcon),T=void 0===x.downIcon?T:r.createElement("span",{className:"".concat(S,"-handler-down-inner")},x.downIcon));let{hasFeedback:A,status:M,isFormItemInput:I,feedbackIcon:R}=r.useContext(Y.aM),D=(0,U.F)(M,b),L=(0,G.Z)(e=>{var t;return null!==(t=null!=d?d:_)&&void 0!==t?t:e}),Z=r.useContext(V.Z),[z,B]=(0,Q.Z)(w,v),F=A&&r.createElement(r.Fragment,null,R),H=u()({["".concat(S,"-lg")]:"large"===L,["".concat(S,"-sm")]:"small"===L,["".concat(S,"-rtl")]:"rtl"===a,["".concat(S,"-in-form-item")]:I},C),q="".concat(S,"-group");return O(r.createElement(W,Object.assign({ref:i,disabled:null!=f?f:Z,className:u()(j,E,l,c,P),upHandler:N,downHandler:T,prefixCls:S,readOnly:y,controls:"boolean"==typeof x?x:void 0,prefix:g,suffix:F,addonAfter:m&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},m)),addonBefore:h&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},h)),classNames:{input:H,variant:u()({["".concat(S,"-").concat(z)]:B},(0,U.Z)(S,D,A)),affixWrapper:u()({["".concat(S,"-affix-wrapper-sm")]:"small"===L,["".concat(S,"-affix-wrapper-lg")]:"large"===L,["".concat(S,"-affix-wrapper-rtl")]:"rtl"===a},C),wrapper:u()({["".concat(q,"-rtl")]:"rtl"===a},C),groupWrapper:u()({["".concat(S,"-group-wrapper-sm")]:"small"===L,["".concat(S,"-group-wrapper-lg")]:"large"===L,["".concat(S,"-group-wrapper-rtl")]:"rtl"===a,["".concat(S,"-group-wrapper-").concat(z)]:B},(0,U.Z)("".concat(S,"-group-wrapper"),D,A),C)}},k)))});eh._InternalPanelDoNotUseOrYouWillBeFired=e=>r.createElement($.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},r.createElement(eh,Object.assign({},e)));var em=eh},65863:function(e,t,n){"use strict";n.d(t,{Z:function(){return k},n:function(){return w}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2027),l=n(28791),s=n(12757),c=n(71744),u=n(86586),d=n(33759),f=n(39109),p=n(65658),h=n(39164),m=n(31282),g=n(64024),v=n(56250),y=n(39725),b=e=>{let t;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?t=e:e&&(t={clearIcon:r.createElement(y.Z,null)}),t},x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function w(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n){let t=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var k=(0,r.forwardRef)((e,t)=>{var n;let{prefixCls:o,bordered:y=!0,status:w,size:k,disabled:S,onBlur:E,onFocus:O,suffix:C,allowClear:j,addonAfter:_,addonBefore:P,className:N,style:T,styles:A,rootClassName:M,onChange:I,classNames:R,variant:D}=e,L=x(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:Z,direction:z,input:B}=r.useContext(c.E_),F=Z("input",o),H=(0,r.useRef)(null),q=(0,g.Z)(F),[W,U,K]=(0,m.ZP)(F,q),{compactSize:$,compactItemClassnames:V}=(0,p.ri)(F,z),X=(0,d.Z)(e=>{var t;return null!==(t=null!=k?k:$)&&void 0!==t?t:e}),G=r.useContext(u.Z),{status:Y,hasFeedback:Q,feedbackIcon:J}=(0,r.useContext)(f.aM),ee=(0,s.F)(Y,w),et=!!(e.prefix||e.suffix||e.allowClear||e.showCount)||!!Q;(0,r.useRef)(et);let en=(0,h.Z)(H,!0),er=(Q||C)&&r.createElement(r.Fragment,null,C,Q&&J),eo=b(j),[ea,ei]=(0,v.Z)(D,y);return W(r.createElement(i.Z,Object.assign({ref:(0,l.sQ)(t,H),prefixCls:F,autoComplete:null==B?void 0:B.autoComplete},L,{disabled:null!=S?S:G,onBlur:e=>{en(),null==E||E(e)},onFocus:e=>{en(),null==O||O(e)},style:Object.assign(Object.assign({},null==B?void 0:B.style),T),styles:Object.assign(Object.assign({},null==B?void 0:B.styles),A),suffix:er,allowClear:eo,className:a()(N,M,K,q,V,null==B?void 0:B.className),onChange:e=>{en(),null==I||I(e)},addonAfter:_&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},_)),addonBefore:P&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},P)),classNames:Object.assign(Object.assign(Object.assign({},R),null==B?void 0:B.classNames),{input:a()({["".concat(F,"-sm")]:"small"===X,["".concat(F,"-lg")]:"large"===X,["".concat(F,"-rtl")]:"rtl"===z},null==R?void 0:R.input,null===(n=null==B?void 0:B.classNames)||void 0===n?void 0:n.input,U),variant:a()({["".concat(F,"-").concat(ea)]:ei},(0,s.Z)(F,ee)),affixWrapper:a()({["".concat(F,"-affix-wrapper-sm")]:"small"===X,["".concat(F,"-affix-wrapper-lg")]:"large"===X,["".concat(F,"-affix-wrapper-rtl")]:"rtl"===z},U),wrapper:a()({["".concat(F,"-group-rtl")]:"rtl"===z},U),groupWrapper:a()({["".concat(F,"-group-wrapper-sm")]:"small"===X,["".concat(F,"-group-wrapper-lg")]:"large"===X,["".concat(F,"-group-wrapper-rtl")]:"rtl"===z,["".concat(F,"-group-wrapper-").concat(ea)]:ei},(0,s.Z)("".concat(F,"-group-wrapper"),ee,Q),U)})})))})},90464:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r,o=n(2265),a=n(39725),i=n(36760),l=n.n(i),s=n(1119),c=n(11993),u=n(31686),d=n(83145),f=n(26365),p=n(6989),h=n(2027),m=n(96032),g=n(55041),v=n(50506),y=n(41154),b=n(31474),x=n(27380),w=n(53346),k=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],S={},E=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],O=o.forwardRef(function(e,t){var n=e.prefixCls,a=(e.onPressEnter,e.defaultValue),i=e.value,d=e.autoSize,h=e.onResize,m=e.className,g=e.style,O=e.disabled,C=e.onChange,j=(e.onInternalAutoSize,(0,p.Z)(e,E)),_=(0,v.Z)(a,{value:i,postState:function(e){return null!=e?e:""}}),P=(0,f.Z)(_,2),N=P[0],T=P[1],A=o.useRef();o.useImperativeHandle(t,function(){return{textArea:A.current}});var M=o.useMemo(function(){return d&&"object"===(0,y.Z)(d)?[d.minRows,d.maxRows]:[]},[d]),I=(0,f.Z)(M,2),R=I[0],D=I[1],L=!!d,Z=function(){try{if(document.activeElement===A.current){var e=A.current,t=e.selectionStart,n=e.selectionEnd,r=e.scrollTop;A.current.setSelectionRange(t,n),A.current.scrollTop=r}}catch(e){}},z=o.useState(2),B=(0,f.Z)(z,2),F=B[0],H=B[1],q=o.useState(),W=(0,f.Z)(q,2),U=W[0],K=W[1],$=function(){H(0)};(0,x.Z)(function(){L&&$()},[i,R,D,L]),(0,x.Z)(function(){if(0===F)H(1);else if(1===F){var e=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&S[n])return S[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),i=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l={sizingStyle:k.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),paddingSize:a,borderSize:i,boxSizing:o};return t&&n&&(S[n]=l),l}(e,n),l=i.paddingSize,s=i.borderSize,c=i.boxSizing,u=i.sizingStyle;r.setAttribute("style","".concat(u,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=e.value||e.placeholder||"";var d=void 0,f=void 0,p=r.scrollHeight;if("border-box"===c?p+=s:"content-box"===c&&(p-=l),null!==o||null!==a){r.value=" ";var h=r.scrollHeight-l;null!==o&&(d=h*o,"border-box"===c&&(d=d+l+s),p=Math.max(d,p)),null!==a&&(f=h*a,"border-box"===c&&(f=f+l+s),t=p>f?"":"hidden",p=Math.min(f,p))}var m={height:p,overflowY:t,resize:"none"};return d&&(m.minHeight=d),f&&(m.maxHeight=f),m}(A.current,!1,R,D);H(2),K(e)}else Z()},[F]);var V=o.useRef(),X=function(){w.Z.cancel(V.current)};o.useEffect(function(){return X},[]);var G=(0,u.Z)((0,u.Z)({},g),L?U:null);return(0===F||1===F)&&(G.overflowY="hidden",G.overflowX="hidden"),o.createElement(b.Z,{onResize:function(e){2===F&&(null==h||h(e),d&&(X(),V.current=(0,w.Z)(function(){$()})))},disabled:!(d||h)},o.createElement("textarea",(0,s.Z)({},j,{ref:A,style:G,className:l()(n,m,(0,c.Z)({},"".concat(n,"-disabled"),O)),disabled:O,value:N,onChange:function(e){T(e.target.value),null==C||C(e)}})))}),C=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],j=o.forwardRef(function(e,t){var n,r,a,i=e.defaultValue,y=e.value,b=e.onFocus,x=e.onBlur,w=e.onChange,k=e.allowClear,S=e.maxLength,E=e.onCompositionStart,j=e.onCompositionEnd,_=e.suffix,P=e.prefixCls,N=void 0===P?"rc-textarea":P,T=e.showCount,A=e.count,M=e.className,I=e.style,R=e.disabled,D=e.hidden,L=e.classNames,Z=e.styles,z=e.onResize,B=(0,p.Z)(e,C),F=(0,v.Z)(i,{value:y,defaultValue:i}),H=(0,f.Z)(F,2),q=H[0],W=H[1],U=null==q?"":String(q),K=o.useState(!1),$=(0,f.Z)(K,2),V=$[0],X=$[1],G=o.useRef(!1),Y=o.useState(null),Q=(0,f.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,o.useRef)(null),en=function(){var e;return null===(e=et.current)||void 0===e?void 0:e.textArea},er=function(){en().focus()};(0,o.useImperativeHandle)(t,function(){return{resizableTextArea:et.current,focus:er,blur:function(){en().blur()}}}),(0,o.useEffect)(function(){X(function(e){return!R&&e})},[R]);var eo=o.useState(null),ea=(0,f.Z)(eo,2),ei=ea[0],el=ea[1];o.useEffect(function(){if(ei){var e;(e=en()).setSelectionRange.apply(e,(0,d.Z)(ei))}},[ei]);var es=(0,m.Z)(A,T),ec=null!==(n=es.max)&&void 0!==n?n:S,eu=Number(ec)>0,ed=es.strategy(U),ef=!!ec&&ed>ec,ep=function(e,t){var n=t;!G.current&&es.exceedFormatter&&es.max&&es.strategy(t)>es.max&&(n=es.exceedFormatter(t,{max:es.max}),t!==n&&el([en().selectionStart||0,en().selectionEnd||0])),W(n),(0,g.rJ)(e.currentTarget,e,w,n)},eh=_;es.show&&(a=es.showFormatter?es.showFormatter({value:U,count:ed,maxLength:ec}):"".concat(ed).concat(eu?" / ".concat(ec):""),eh=o.createElement(o.Fragment,null,eh,o.createElement("span",{className:l()("".concat(N,"-data-count"),null==L?void 0:L.count),style:null==Z?void 0:Z.count},a)));var em=!B.autoSize&&!T&&!k;return o.createElement(h.Q,{value:U,allowClear:k,handleReset:function(e){W(""),er(),(0,g.rJ)(en(),e,w)},suffix:eh,prefixCls:N,classNames:(0,u.Z)((0,u.Z)({},L),{},{affixWrapper:l()(null==L?void 0:L.affixWrapper,(r={},(0,c.Z)(r,"".concat(N,"-show-count"),T),(0,c.Z)(r,"".concat(N,"-textarea-allow-clear"),k),r))}),disabled:R,focused:V,className:l()(M,ef&&"".concat(N,"-out-of-range")),style:(0,u.Z)((0,u.Z)({},I),J&&!em?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof a?a:void 0}},hidden:D},o.createElement(O,(0,s.Z)({},B,{maxLength:S,onKeyDown:function(e){var t=B.onPressEnter,n=B.onKeyDown;"Enter"===e.key&&t&&t(e),null==n||n(e)},onChange:function(e){ep(e,e.target.value)},onFocus:function(e){X(!0),null==b||b(e)},onBlur:function(e){X(!1),null==x||x(e)},onCompositionStart:function(e){G.current=!0,null==E||E(e)},onCompositionEnd:function(e){G.current=!1,ep(e,e.currentTarget.value),null==j||j(e)},className:l()(null==L?void 0:L.textarea),style:(0,u.Z)((0,u.Z)({},null==Z?void 0:Z.textarea),{},{resize:null==I?void 0:I.resize}),disabled:R,prefixCls:N,onResize:function(e){var t;null==z||z(e),null!==(t=en())&&void 0!==t&&t.style.height&&ee(!0)},ref:et})))}),_=n(12757),P=n(71744),N=n(86586),T=n(33759),A=n(39109),M=n(65863),I=n(31282),R=n(64024),D=n(56250),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Z=(0,o.forwardRef)((e,t)=>{var n;let r;let{prefixCls:i,bordered:s=!0,size:c,disabled:u,status:d,allowClear:f,classNames:p,rootClassName:h,className:m,variant:g}=e,v=L(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:y,direction:b}=o.useContext(P.E_),x=(0,T.Z)(c),w=o.useContext(N.Z),{status:k,hasFeedback:S,feedbackIcon:E}=o.useContext(A.aM),O=(0,_.F)(k,d),C=o.useRef(null);o.useImperativeHandle(t,()=>{var e;return{resizableTextArea:null===(e=C.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;(0,M.n)(null===(n=null===(t=C.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.blur()}}});let Z=y("input",i);"object"==typeof f&&(null==f?void 0:f.clearIcon)?r=f:f&&(r={clearIcon:o.createElement(a.Z,null)});let z=(0,R.Z)(Z),[B,F,H]=(0,I.ZP)(Z,z),[q,W]=(0,D.Z)(g,s);return B(o.createElement(j,Object.assign({},v,{disabled:null!=u?u:w,allowClear:r,className:l()(H,z,m,h),classNames:Object.assign(Object.assign({},p),{textarea:l()({["".concat(Z,"-sm")]:"small"===x,["".concat(Z,"-lg")]:"large"===x},F,null==p?void 0:p.textarea),variant:l()({["".concat(Z,"-").concat(q)]:W},(0,_.Z)(Z,O)),affixWrapper:l()("".concat(Z,"-textarea-affix-wrapper"),{["".concat(Z,"-affix-wrapper-rtl")]:"rtl"===b,["".concat(Z,"-affix-wrapper-sm")]:"small"===x,["".concat(Z,"-affix-wrapper-lg")]:"large"===x,["".concat(Z,"-textarea-show-count")]:e.showCount||(null===(n=e.count)||void 0===n?void 0:n.show)},F)}),prefixCls:Z,suffix:S&&o.createElement("span",{className:"".concat(Z,"-textarea-suffix")},E),ref:C})))})},39164:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e,t){let n=(0,r.useRef)([]),o=()=>{n.current.push(setTimeout(()=>{var t,n,r,o;(null===(t=e.current)||void 0===t?void 0:t.input)&&(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))==="password"&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(o=e.current)||void 0===o||o.input.removeAttribute("value"))}))};return(0,r.useEffect)(()=>(t&&o(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),o}},64482:function(e,t,n){"use strict";n.d(t,{default:function(){return _}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),l=n(39109),s=n(31282),c=n(65863),u=n(97416),d=n(6520),f=n(18694),p=n(28791),h=n(39164),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let g=e=>e?r.createElement(d.Z,null):r.createElement(u.Z,null),v={click:"onClick",hover:"onMouseOver"},y=r.forwardRef((e,t)=>{let{visibilityToggle:n=!0}=e,o="object"==typeof n&&void 0!==n.visible,[l,s]=(0,r.useState)(()=>!!o&&n.visible),u=(0,r.useRef)(null);r.useEffect(()=>{o&&s(n.visible)},[o,n]);let d=(0,h.Z)(u),y=()=>{let{disabled:t}=e;t||(l&&d(),s(e=>{var t;let r=!e;return"object"==typeof n&&(null===(t=n.onVisibleChange)||void 0===t||t.call(n,r)),r}))},{className:b,prefixCls:x,inputPrefixCls:w,size:k}=e,S=m(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:E}=r.useContext(i.E_),O=E("input",w),C=E("input-password",x),j=n&&(t=>{let{action:n="click",iconRender:o=g}=e,a=v[n]||"",i=o(l);return r.cloneElement(r.isValidElement(i)?i:r.createElement("span",null,i),{[a]:y,className:"".concat(t,"-icon"),key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}})})(C),_=a()(C,b,{["".concat(C,"-").concat(k)]:!!k}),P=Object.assign(Object.assign({},(0,f.Z)(S,["suffix","iconRender","visibilityToggle"])),{type:l?"text":"password",className:_,prefixCls:O,suffix:j});return k&&(P.size=k),r.createElement(c.Z,Object.assign({ref:(0,p.sQ)(t,u)},P))});var b=n(29436),x=n(19722),w=n(73002),k=n(33759),S=n(65658),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O=r.forwardRef((e,t)=>{let n;let{prefixCls:o,inputPrefixCls:l,className:s,size:u,suffix:d,enterButton:f=!1,addonAfter:h,loading:m,disabled:g,onSearch:v,onChange:y,onCompositionStart:O,onCompositionEnd:C}=e,j=E(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:_,direction:P}=r.useContext(i.E_),N=r.useRef(!1),T=_("input-search",o),A=_("input",l),{compactSize:M}=(0,S.ri)(T,P),I=(0,k.Z)(e=>{var t;return null!==(t=null!=u?u:M)&&void 0!==t?t:e}),R=r.useRef(null),D=e=>{var t;document.activeElement===(null===(t=R.current)||void 0===t?void 0:t.input)&&e.preventDefault()},L=e=>{var t,n;v&&v(null===(n=null===(t=R.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},Z="boolean"==typeof f?r.createElement(b.Z,null):null,z="".concat(T,"-button"),B=f||{},F=B.type&&!0===B.type.__ANT_BUTTON;n=F||"button"===B.type?(0,x.Tm)(B,Object.assign({onMouseDown:D,onClick:e=>{var t,n;null===(n=null===(t=null==B?void 0:B.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),L(e)},key:"enterButton"},F?{className:z,size:I}:{})):r.createElement(w.ZP,{className:z,type:f?"primary":void 0,size:I,disabled:g,key:"enterButton",onMouseDown:D,onClick:L,loading:m,icon:Z},f),h&&(n=[n,(0,x.Tm)(h,{key:"addonAfter"})]);let H=a()(T,{["".concat(T,"-rtl")]:"rtl"===P,["".concat(T,"-").concat(I)]:!!I,["".concat(T,"-with-button")]:!!f},s);return r.createElement(c.Z,Object.assign({ref:(0,p.sQ)(R,t),onPressEnter:e=>{N.current||m||L(e)}},j,{size:I,onCompositionStart:e=>{N.current=!0,null==O||O(e)},onCompositionEnd:e=>{N.current=!1,null==C||C(e)},prefixCls:A,addonAfter:n,suffix:d,onChange:e=>{e&&e.target&&"click"===e.type&&v&&v(e.target.value,e,{source:"clear"}),y&&y(e)},className:H,disabled:g}))});var C=n(90464);let j=c.Z;j.Group=e=>{let{getPrefixCls:t,direction:n}=(0,r.useContext)(i.E_),{prefixCls:o,className:c}=e,u=t("input-group",o),d=t("input"),[f,p]=(0,s.ZP)(d),h=a()(u,{["".concat(u,"-lg")]:"large"===e.size,["".concat(u,"-sm")]:"small"===e.size,["".concat(u,"-compact")]:e.compact,["".concat(u,"-rtl")]:"rtl"===n},p,c),m=(0,r.useContext)(l.aM),g=(0,r.useMemo)(()=>Object.assign(Object.assign({},m),{isFormItemInput:!1}),[m]);return f(r.createElement("span",{className:h,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},r.createElement(l.aM.Provider,{value:g},e.children)))},j.Search=O,j.TextArea=C.Z,j.Password=y;var _=j},31282:function(e,t,n){"use strict";n.d(t,{ik:function(){return p},nz:function(){return u},s7:function(){return h},x0:function(){return f}});var r=n(352),o=n(12918),a=n(17691),i=n(80669),l=n(3104),s=n(37433),c=n(65265);let u=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=e=>{let{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:a}=e;return{padding:"".concat((0,r.bf)(t)," ").concat((0,r.bf)(a)),fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:o}},f=e=>({padding:"".concat((0,r.bf)(e.paddingBlockSM)," ").concat((0,r.bf)(e.paddingInlineSM)),fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),p=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:"".concat((0,r.bf)(e.paddingBlock)," ").concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationMid)},u(e.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:"all ".concat(e.motionDurationSlow,", height 0s"),resize:"vertical"},"&-lg":Object.assign({},d(e)),"&-sm":Object.assign({},f(e)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),h=e=>{let{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},["&-lg ".concat(t,", &-lg > ").concat(t,"-group-addon")]:Object.assign({},d(e)),["&-sm ".concat(t,", &-sm > ").concat(t,"-group-addon")]:Object.assign({},f(e)),["&-lg ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightLG},["&-sm ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightSM},["> ".concat(t)]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},["".concat(t,"-group")]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:"0 ".concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationSlow),lineHeight:1,["".concat(n,"-select")]:{margin:"".concat((0,r.bf)(e.calc(e.paddingBlock).add(1).mul(-1).equal())," ").concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),["&".concat(n,"-select-single:not(").concat(n,"-select-customize-input):not(").concat(n,"-pagination-size-changer)")]:{["".concat(n,"-select-selector")]:{backgroundColor:"inherit",border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),boxShadow:"none"}},"&-open, &-focused":{["".concat(n,"-select-selector")]:{color:e.colorPrimary}}},["".concat(n,"-cascader-picker")]:{margin:"-9px ".concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),backgroundColor:"transparent",["".concat(n,"-cascader-input")]:{textAlign:"start",border:0,boxShadow:"none"}}}},["".concat(t)]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,["".concat(t,"-search-with-button &")]:{zIndex:0}}},["> ".concat(t,":first-child, ").concat(t,"-group-addon:first-child")]:{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,"-affix-wrapper")]:{["&:not(:first-child) ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0},["&:not(:last-child) ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,":last-child, ").concat(t,"-group-addon:last-child")]:{borderStartStartRadius:0,borderEndStartRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["".concat(t,"-affix-wrapper")]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(t,"-search &")]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},["&:not(:first-child), ".concat(t,"-search &:not(:first-child)")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&".concat(t,"-group-compact")]:Object.assign(Object.assign({display:"block"},(0,o.dF)()),{["".concat(t,"-group-addon, ").concat(t,"-group-wrap, > ").concat(t)]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},["\n & > ".concat(t,"-affix-wrapper,\n & > ").concat(t,"-number-affix-wrapper,\n & > ").concat(n,"-picker-range\n ")]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},["".concat(t)]:{float:"none"},["& > ".concat(n,"-select > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete ").concat(t,",\n & > ").concat(n,"-cascader-picker ").concat(t,",\n & > ").concat(t,"-group-wrapper ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},["& > ".concat(n,"-select-focused")]:{zIndex:1},["& > ".concat(n,"-select > ").concat(n,"-select-arrow")]:{zIndex:1},["& > *:first-child,\n & > ".concat(n,"-select:first-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete:first-child ").concat(t,",\n & > ").concat(n,"-cascader-picker:first-child ").concat(t)]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},["& > *:last-child,\n & > ".concat(n,"-select:last-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-cascader-picker:last-child ").concat(t,",\n & > ").concat(n,"-cascader-picker-focused:last-child ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},["& > ".concat(n,"-select-auto-complete ").concat(t)]:{verticalAlign:"top"},["".concat(t,"-group-wrapper + ").concat(t,"-group-wrapper")]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),["".concat(t,"-affix-wrapper")]:{borderRadius:0}},["".concat(t,"-group-wrapper:not(:last-child)")]:{["&".concat(t,"-search > ").concat(t,"-group")]:{["& > ".concat(t,"-group-addon > ").concat(t,"-search-button")]:{borderRadius:0},["& > ".concat(t)]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},m=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:a}=e,i=a(n).sub(a(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),p(e)),(0,c.qG)(e)),(0,c.H8)(e)),(0,c.Mu)(e)),{'&[type="color"]':{height:e.controlHeight,["&".concat(t,"-lg")]:{height:e.controlHeightLG},["&".concat(t,"-sm")]:{height:n,paddingTop:i,paddingBottom:i}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},g=e=>{let{componentCls:t}=e;return{["".concat(t,"-clear-icon")]:{margin:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextTertiary},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:"0 ".concat((0,r.bf)(e.inputAffixPadding))}}}},v=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:a,colorIconHover:i,iconCls:l}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign(Object.assign(Object.assign({},p(e)),{display:"inline-flex",["&:not(".concat(t,"-disabled):hover")]:{zIndex:1,["".concat(t,"-search-with-button &")]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},["> input".concat(t)]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t)]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),g(e)),{["".concat(l).concat(t,"-password-icon")]:{color:a,cursor:"pointer",transition:"all ".concat(o),"&:hover":{color:i}}})}},y=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{["".concat(t,"-group")]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),h(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:r}}},(0,c.ir)(e)),(0,c.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},b=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-search");return{[r]:{["".concat(t)]:{"&:hover, &:focus":{borderColor:e.colorPrimaryHover,["+ ".concat(t,"-group-addon ").concat(r,"-button:not(").concat(n,"-btn-primary)")]:{borderInlineStartColor:e.colorPrimaryHover}}},["".concat(t,"-affix-wrapper")]:{borderRadius:0},["".concat(t,"-lg")]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal({unit:!1})},["> ".concat(t,"-group")]:{["> ".concat(t,"-group-addon:last-child")]:{insetInlineStart:-1,padding:0,border:0,["".concat(r,"-button")]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius,borderEndStartRadius:0,boxShadow:"none"},["".concat(r,"-button:not(").concat(n,"-btn-primary)")]:{color:e.colorTextDescription,"&:hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},["&".concat(n,"-btn-loading::before")]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},["".concat(r,"-button")]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},["&-large ".concat(r,"-button")]:{height:e.controlHeightLG},["&-small ".concat(r,"-button")]:{height:e.controlHeightSM},"&-rtl":{direction:"rtl"},["&".concat(t,"-compact-item")]:{["&:not(".concat(t,"-compact-last-item)")]:{["".concat(t,"-group-addon")]:{["".concat(t,"-search-button")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},["&:not(".concat(t,"-compact-first-item)")]:{["".concat(t,",").concat(t,"-affix-wrapper")]:{borderRadius:0}},["> ".concat(t,"-group-addon ").concat(t,"-search-button,\n > ").concat(t,",\n ").concat(t,"-affix-wrapper")]:{"&:hover,&:focus,&:active":{zIndex:2}},["> ".concat(t,"-affix-wrapper-focused")]:{zIndex:2}}}}},x=e=>{let{componentCls:t,paddingLG:n}=e,r="".concat(t,"-textarea");return{[r]:{position:"relative","&-show-count":{["> ".concat(t)]:{height:"100%"},["".concat(t,"-data-count")]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{["> ".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(r,"-has-feedback")]:{["".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(t,"-affix-wrapper")]:{padding:0,["> textarea".concat(t)]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},["".concat(t,"-suffix")]:{margin:0,"> *:not(:last-child)":{marginInline:0},["".concat(t,"-clear-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,insetBlockStart:e.paddingXS},["".concat(r,"-suffix")]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},w=e=>{let{componentCls:t}=e;return{["".concat(t,"-out-of-range")]:{["&, & input, & textarea, ".concat(t,"-show-count-suffix, ").concat(t,"-data-count")]:{color:e.colorError}}}};t.ZP=(0,i.I$)("Input",e=>{let t=(0,l.TS)(e,(0,s.e)(e));return[m(t),x(t),v(t),y(t),b(t),w(t),(0,a.c)(t)]},s.T)},37433:function(e,t,n){"use strict";n.d(t,{T:function(){return a},e:function(){return o}});var r=n(3104);function o(e){return(0,r.TS)(e,{inputAffixPadding:e.paddingXXS})}let a=e=>{let{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:a,controlHeightLG:i,fontSizeLG:l,lineHeightLG:s,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:h,controlOutlineWidth:m,controlOutline:g,colorErrorOutline:v,colorWarningOutline:y,colorBgContainer:b}=e;return{paddingBlock:Math.max(Math.round((t-n*r)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((a-n*r)/2*10)/10-o,0),paddingBlockLG:Math.ceil((i-l*s)/2*10)/10-o,paddingInline:c-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:f,activeBorderColor:h,hoverBorderColor:p,activeShadow:"0 0 0 ".concat(m,"px ").concat(g),errorActiveShadow:"0 0 0 ".concat(m,"px ").concat(v),warningActiveShadow:"0 0 0 ".concat(m,"px ").concat(y),hoverBg:b,activeBg:b,inputFontSize:n,inputFontSizeLG:l,inputFontSizeSM:n}}},65265:function(e,t,n){"use strict";n.d(t,{$U:function(){return l},H8:function(){return m},Mu:function(){return f},S5:function(){return v},Xy:function(){return i},ir:function(){return d},qG:function(){return c}});var r=n(352),o=n(3104);let a=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),i=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},a((0,o.TS)(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),l=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),s=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},l(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),c=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},l(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),s(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),s(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),u=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),d=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.addonBg,border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},u(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),u(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group-addon")]:Object.assign({},i(e))}})}),f=(e,t)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},["&".concat(e.componentCls,"-disabled, &[disabled]")]:{color:e.colorTextDisabled}},t)}),p=(e,t)=>({background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null==t?void 0:t.inputColor},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}),h=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},p(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),m=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.colorPrimary})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),h(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),h(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),g=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{background:t.addonBg,color:t.addonColor}}}),v=e=>({"&-filled":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary},["".concat(e.componentCls,"-filled:not(:focus):not(:focus-within)")]:{"&:not(:first-child)":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)},"&:not(:last-child)":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}}}},g(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),g(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:last-child":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)}}}})})},19226:function(e,t,n){"use strict";n.d(t,{default:function(){return O}});var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),l=n(18694),s=n(71744),c=n(80856),u=n(45287),d=n(92239),f=n(352),p=n(80669),h=e=>{let{componentCls:t,bodyBg:n,lightSiderBg:r,lightTriggerBg:o,lightTriggerColor:a}=e;return{["".concat(t,"-sider-light")]:{background:r,["".concat(t,"-sider-trigger")]:{color:a,background:o},["".concat(t,"-sider-zero-width-trigger")]:{color:a,background:o,border:"1px solid ".concat(n),borderInlineStart:0}}}};let m=e=>{let{antCls:t,componentCls:n,colorText:r,triggerColor:o,footerBg:a,triggerBg:i,headerHeight:l,headerPadding:s,headerColor:c,footerPadding:u,triggerHeight:d,zeroTriggerHeight:p,zeroTriggerWidth:m,motionDurationMid:g,motionDurationSlow:v,fontSize:y,borderRadius:b,bodyBg:x,headerBg:w,siderBg:k}=e;return{[n]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:x,"&, *":{boxSizing:"border-box"},["&".concat(n,"-has-sider")]:{flexDirection:"row",["> ".concat(n,", > ").concat(n,"-content")]:{width:0}},["".concat(n,"-header, &").concat(n,"-footer")]:{flex:"0 0 auto"},["".concat(n,"-sider")]:{position:"relative",minWidth:0,background:k,transition:"all ".concat(g,", background 0s"),"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,["".concat(t,"-menu").concat(t,"-menu-inline-collapsed")]:{width:"auto"}},"&-has-trigger":{paddingBottom:d},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:d,color:o,lineHeight:(0,f.bf)(d),textAlign:"center",background:i,cursor:"pointer",transition:"all ".concat(g)},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:l,insetInlineEnd:e.calc(m).mul(-1).equal(),zIndex:1,width:m,height:p,color:o,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:k,borderStartStartRadius:0,borderStartEndRadius:b,borderEndEndRadius:b,borderEndStartRadius:0,cursor:"pointer",transition:"background ".concat(v," ease"),"&::after":{position:"absolute",inset:0,background:"transparent",transition:"all ".concat(v),content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(m).mul(-1).equal(),borderStartStartRadius:b,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:b}}}}},h(e)),{"&-rtl":{direction:"rtl"}}),["".concat(n,"-header")]:{height:l,padding:s,color:c,lineHeight:(0,f.bf)(l),background:w,["".concat(t,"-menu")]:{lineHeight:"inherit"}},["".concat(n,"-footer")]:{padding:u,color:r,fontSize:y,background:a},["".concat(n,"-content")]:{flex:"auto",minHeight:0}}};var g=(0,p.I$)("Layout",e=>[m(e)],e=>{let{colorBgLayout:t,controlHeight:n,controlHeightLG:r,colorText:o,controlHeightSM:a,marginXXS:i,colorTextLightSolid:l,colorBgContainer:s}=e,c=1.25*r;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:2*n,headerPadding:"0 ".concat(c,"px"),headerColor:o,footerPadding:"".concat(a,"px ").concat(c,"px"),footerBg:t,siderBg:"#001529",triggerHeight:r+2*i,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:r,zeroTriggerHeight:r,lightSiderBg:s,lightTriggerBg:s,lightTriggerColor:o}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function y(e){let{suffixCls:t,tagName:n,displayName:r}=e;return e=>o.forwardRef((r,a)=>o.createElement(e,Object.assign({ref:a,suffixCls:t,tagName:n},r)))}let b=o.forwardRef((e,t)=>{let{prefixCls:n,suffixCls:r,className:a,tagName:l}=e,c=v(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:u}=o.useContext(s.E_),d=u("layout",n),[f,p,h]=g(d),m=r?"".concat(d,"-").concat(r):d;return f(o.createElement(l,Object.assign({className:i()(n||m,a,p,h),ref:t},c)))}),x=o.forwardRef((e,t)=>{let{direction:n}=o.useContext(s.E_),[a,f]=o.useState([]),{prefixCls:p,className:h,rootClassName:m,children:y,hasSider:b,tagName:x,style:w}=e,k=v(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),S=(0,l.Z)(k,["suffixCls"]),{getPrefixCls:E,layout:O}=o.useContext(s.E_),C=E("layout",p),j="boolean"==typeof b?b:!!a.length||(0,u.Z)(y).some(e=>e.type===d.Z),[_,P,N]=g(C),T=i()(C,{["".concat(C,"-has-sider")]:j,["".concat(C,"-rtl")]:"rtl"===n},null==O?void 0:O.className,h,m,P,N),A=o.useMemo(()=>({siderHook:{addSider:e=>{f(t=>[].concat((0,r.Z)(t),[e]))},removeSider:e=>{f(t=>t.filter(t=>t!==e))}}}),[]);return _(o.createElement(c.V.Provider,{value:A},o.createElement(x,Object.assign({ref:t,className:T,style:Object.assign(Object.assign({},null==O?void 0:O.style),w)},S),y)))}),w=y({tagName:"div",displayName:"Layout"})(x),k=y({suffixCls:"header",tagName:"header",displayName:"Header"})(b),S=y({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(b),E=y({suffixCls:"content",tagName:"main",displayName:"Content"})(b);w.Header=k,w.Footer=S,w.Content=E,w.Sider=d.Z,w._InternalSiderContext=d.D;var O=w},14301:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var r=n(2265),o=n(36760),a=n.n(o);let i=e=>e?"function"==typeof e?e():e:null;var l=n(68710),s=n(71744),c=n(89970),u=n(5769),d=n(12918),f=n(691),p=n(88260),h=n(53454),m=n(80669),g=n(3104),v=n(34442);let y=e=>{let{componentCls:t,popoverColor:n,titleMinWidth:r,fontWeightStrong:o,innerPadding:a,boxShadowSecondary:i,colorTextHeading:l,borderRadiusLG:s,zIndexPopup:c,titleMarginBottom:u,colorBgElevated:f,popoverBg:h,titleBorderBottom:m,innerContentPadding:g,titlePadding:v}=e;return[{[t]:Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":f,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},["".concat(t,"-content")]:{position:"relative"},["".concat(t,"-inner")]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:s,boxShadow:i,padding:a},["".concat(t,"-title")]:{minWidth:r,marginBottom:u,color:l,fontWeight:o,borderBottom:m,padding:v},["".concat(t,"-inner-content")]:{color:n,padding:g}})},(0,p.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(t,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",["".concat(t,"-content")]:{display:"inline-block"}}}]},b=e=>{let{componentCls:t}=e;return{[t]:h.i.map(n=>{let r=e["".concat(n,"6")];return{["&".concat(t,"-").concat(n)]:{"--antd-arrow-background-color":r,["".concat(t,"-inner")]:{backgroundColor:r},["".concat(t,"-arrow")]:{background:"transparent"}}}})}};var x=(0,m.I$)("Popover",e=>{let{colorBgElevated:t,colorText:n}=e,r=(0,g.TS)(e,{popoverBg:t,popoverColor:n});return[y(r),b(r),(0,f._y)(r,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:n,fontHeight:r,padding:o,wireframe:a,zIndexPopupBase:i,borderRadiusLG:l,marginXS:s,lineType:c,colorSplit:u,paddingSM:d}=e,f=n-r;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:i+30},(0,v.w)(e)),(0,p.wZ)({contentRadius:l,limitVerticalRadius:!0})),{innerPadding:a?0:12,titleMarginBottom:a?0:s,titlePadding:a?"".concat(f/2,"px ").concat(o,"px ").concat(f/2-t,"px"):0,titleBorderBottom:a?"".concat(t,"px ").concat(c," ").concat(u):"none",innerContentPadding:a?"".concat(d,"px ").concat(o,"px"):0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]}),w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let k=(e,t,n)=>t||n?r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(e,"-title")},i(t)),r.createElement("div",{className:"".concat(e,"-inner-content")},i(n))):null,S=e=>{let{hashId:t,prefixCls:n,className:o,style:i,placement:l="top",title:s,content:c,children:d}=e;return r.createElement("div",{className:a()(t,n,"".concat(n,"-pure"),"".concat(n,"-placement-").concat(l),o),style:i},r.createElement("div",{className:"".concat(n,"-arrow")}),r.createElement(u.G,Object.assign({},e,{className:t,prefixCls:n}),d||k(n,s,c)))};var 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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O=e=>{let{title:t,content:n,prefixCls:o}=e;return r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(o,"-title")},i(t)),r.createElement("div",{className:"".concat(o,"-inner-content")},i(n)))},C=r.forwardRef((e,t)=>{let{prefixCls:n,title:o,content:i,overlayClassName:u,placement:d="top",trigger:f="hover",mouseEnterDelay:p=.1,mouseLeaveDelay:h=.1,overlayStyle:m={}}=e,g=E(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:v}=r.useContext(s.E_),y=v("popover",n),[b,w,k]=x(y),S=v(),C=a()(u,w,k);return b(r.createElement(c.Z,Object.assign({placement:d,trigger:f,mouseEnterDelay:p,mouseLeaveDelay:h,overlayStyle:m},g,{prefixCls:y,overlayClassName:C,ref:t,overlay:o||i?r.createElement(O,{prefixCls:y,title:o,content:i}):null,transitionName:(0,l.m)(S,"zoom-big",g.transitionName),"data-popover-inject":!0})))});C._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,className:n}=e,o=w(e,["prefixCls","className"]),{getPrefixCls:i}=r.useContext(s.E_),l=i("popover",t),[c,u,d]=x(l);return c(r.createElement(S,Object.assign({},o,{prefixCls:l,hashId:u,className:a()(n,d)})))};var j=C},29967:function(e,t,n){"use strict";n.d(t,{ZP:function(){return R}});var r=n(2265),o=n(36760),a=n.n(o),i=n(50506),l=n(18242),s=n(71744),c=n(33759);let u=r.createContext(null),d=u.Provider,f=r.createContext(null),p=f.Provider;var h=n(20873),m=n(28791),g=n(6694),v=n(34709),y=n(86586),b=n(39109),x=n(352),w=n(12918),k=n(80669),S=n(3104);let E=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-group");return{[r]:Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(r,"-rtl")]:{direction:"rtl"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},O=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:r,radioSize:o,motionDurationSlow:a,motionDurationMid:i,motionEaseInOutCirc:l,colorBgContainer:s,colorBorder:c,lineWidth:u,colorBgContainerDisabled:d,colorTextDisabled:f,paddingXS:p,dotColorDisabled:h,lineType:m,radioColor:g,radioBgColor:v,calc:y}=e,b="".concat(t,"-inner"),k=y(o).sub(y(4).mul(2)),S=y(1).mul(o).equal();return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",["&".concat(t,"-wrapper-rtl")]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,x.bf)(u)," ").concat(m," ").concat(r),borderRadius:"50%",visibility:"hidden",content:'""'},[t]:Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(b)]:{borderColor:r},["".concat(t,"-input:focus-visible + ").concat(b)]:Object.assign({},(0,w.oN)(e)),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:S,height:S,marginBlockStart:y(1).mul(o).div(-2).equal(),marginInlineStart:y(1).mul(o).div(-2).equal(),backgroundColor:g,borderBlockStart:0,borderInlineStart:0,borderRadius:S,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(l),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:S,height:S,backgroundColor:s,borderColor:c,borderStyle:"solid",borderWidth:u,borderRadius:"50%",transition:"all ".concat(i)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[b]:{borderColor:r,backgroundColor:v,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(o).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(l)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[b]:{backgroundColor:d,borderColor:c,cursor:"not-allowed","&::after":{backgroundColor:h}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[b]:{"&::after":{transform:"scale(".concat(y(k).div(o).equal({unit:!1}),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},C=e=>{let{buttonColor:t,controlHeight:n,componentCls:r,lineWidth:o,lineType:a,colorBorder:i,motionDurationSlow:l,motionDurationMid:s,buttonPaddingInline:c,fontSize:u,buttonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:h,paddingXS:m,borderRadius:g,borderRadiusSM:v,borderRadiusLG:y,buttonCheckedBg:b,buttonSolidCheckedColor:k,colorTextDisabled:S,colorBgContainerDisabled:E,buttonCheckedBgDisabled:O,buttonCheckedColorDisabled:C,colorPrimary:j,colorPrimaryHover:_,colorPrimaryActive:P,buttonSolidCheckedBg:N,buttonSolidCheckedHoverBg:T,buttonSolidCheckedActiveBg:A,calc:M}=e;return{["".concat(r,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:u,lineHeight:(0,x.bf)(M(n).sub(M(o).mul(2)).equal()),background:d,border:"".concat((0,x.bf)(o)," ").concat(a," ").concat(i),borderBlockStartWidth:M(o).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:o,cursor:"pointer",transition:["color ".concat(s),"background ".concat(s),"box-shadow ".concat(s)].join(","),a:{color:t},["> ".concat(r,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:M(o).mul(-1).equal(),insetInlineStart:M(o).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:o,paddingInline:0,backgroundColor:i,transition:"background-color ".concat(l),content:'""'}},"&:first-child":{borderInlineStart:"".concat((0,x.bf)(o)," ").concat(a," ").concat(i),borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g},"&:first-child:last-child":{borderRadius:g},["".concat(r,"-group-large &")]:{height:p,fontSize:f,lineHeight:(0,x.bf)(M(p).sub(M(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:y,borderEndStartRadius:y},"&:last-child":{borderStartEndRadius:y,borderEndEndRadius:y}},["".concat(r,"-group-small &")]:{height:h,paddingInline:M(m).sub(o).equal(),paddingBlock:0,lineHeight:(0,x.bf)(M(h).sub(M(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:j},"&:has(:focus-visible)":Object.assign({},(0,w.oN)(e)),["".concat(r,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(r,"-button-wrapper-disabled)")]:{zIndex:1,color:j,background:b,borderColor:j,"&::before":{backgroundColor:j},"&:first-child":{borderColor:j},"&:hover":{color:_,borderColor:_,"&::before":{backgroundColor:_}},"&:active":{color:P,borderColor:P,"&::before":{backgroundColor:P}}},["".concat(r,"-group-solid &-checked:not(").concat(r,"-button-wrapper-disabled)")]:{color:k,background:N,borderColor:N,"&:hover":{color:k,background:T,borderColor:T},"&:active":{color:k,background:A,borderColor:A}},"&-disabled":{color:S,backgroundColor:E,borderColor:i,cursor:"not-allowed","&:first-child, &:hover":{color:S,backgroundColor:E,borderColor:i}},["&-disabled".concat(r,"-button-wrapper-checked")]:{color:C,backgroundColor:O,borderColor:i,boxShadow:"none"}}}};var j=(0,k.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,r="0 0 0 ".concat((0,x.bf)(n)," ").concat(t),o=(0,S.TS)(e,{radioFocusShadow:r,radioButtonFocusShadow:r});return[E(o),O(o),C(o)]},e=>{let{wireframe:t,padding:n,marginXS:r,lineWidth:o,fontSizeLG:a,colorText:i,colorBgContainer:l,colorTextDisabled:s,controlItemBgActiveDisabled:c,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:h}=e;return{radioSize:a,dotSize:t?a-8:a-(4+o)*2,dotColorDisabled:s,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:l,buttonCheckedBg:l,buttonColor:i,buttonCheckedBgDisabled:c,buttonCheckedColorDisabled:s,buttonPaddingInline:n-o,wrapperMarginInlineEnd:r,radioColor:t?d:h,radioBgColor:t?l:d}},{unitless:{radioSize:!0,dotSize:!0}}),_=n(64024),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=r.forwardRef((e,t)=>{var n,o;let i=r.useContext(u),l=r.useContext(f),{getPrefixCls:c,direction:d,radio:p}=r.useContext(s.E_),x=r.useRef(null),w=(0,m.sQ)(t,x),{isFormItemInput:k}=r.useContext(b.aM),{prefixCls:S,className:E,rootClassName:O,children:C,style:N,title:T}=e,A=P(e,["prefixCls","className","rootClassName","children","style","title"]),M=c("radio",S),I="button"===((null==i?void 0:i.optionType)||l),R=I?"".concat(M,"-button"):M,D=(0,_.Z)(M),[L,Z,z]=j(M,D),B=Object.assign({},A),F=r.useContext(y.Z);i&&(B.name=i.name,B.onChange=t=>{var n,r;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(r=null==i?void 0:i.onChange)||void 0===r||r.call(i,t)},B.checked=e.value===i.value,B.disabled=null!==(n=B.disabled)&&void 0!==n?n:i.disabled),B.disabled=null!==(o=B.disabled)&&void 0!==o?o:F;let H=a()("".concat(R,"-wrapper"),{["".concat(R,"-wrapper-checked")]:B.checked,["".concat(R,"-wrapper-disabled")]:B.disabled,["".concat(R,"-wrapper-rtl")]:"rtl"===d,["".concat(R,"-wrapper-in-form-item")]:k},null==p?void 0:p.className,E,O,Z,z,D);return L(r.createElement(g.Z,{component:"Radio",disabled:B.disabled},r.createElement("label",{className:H,style:Object.assign(Object.assign({},null==p?void 0:p.style),N),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:T},r.createElement(h.Z,Object.assign({},B,{className:a()(B.className,!I&&v.A),type:"radio",prefixCls:R,ref:w})),void 0!==C?r.createElement("span",null,C):null)))}),T=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:o}=r.useContext(s.E_),[u,f]=(0,i.Z)(e.defaultValue,{value:e.value}),{prefixCls:p,className:h,rootClassName:m,options:g,buttonStyle:v="outline",disabled:y,children:b,size:x,style:w,id:k,onMouseEnter:S,onMouseLeave:E,onFocus:O,onBlur:C}=e,P=n("radio",p),T="".concat(P,"-group"),A=(0,_.Z)(P),[M,I,R]=j(P,A),D=b;g&&g.length>0&&(D=g.map(e=>"string"==typeof e||"number"==typeof e?r.createElement(N,{key:e.toString(),prefixCls:P,disabled:y,value:e,checked:u===e},e):r.createElement(N,{key:"radio-group-value-options-".concat(e.value),prefixCls:P,disabled:e.disabled||y,value:e.value,checked:u===e.value,title:e.title,style:e.style,id:e.id,required:e.required},e.label)));let L=(0,c.Z)(x),Z=a()(T,"".concat(T,"-").concat(v),{["".concat(T,"-").concat(L)]:L,["".concat(T,"-rtl")]:"rtl"===o},h,m,I,R,A);return M(r.createElement("div",Object.assign({},(0,l.Z)(e,{aria:!0,data:!0}),{className:Z,style:w,onMouseEnter:S,onMouseLeave:E,onFocus:O,onBlur:C,id:k,ref:t}),r.createElement(d,{value:{onChange:t=>{let n=t.target.value;"value"in e||f(n);let{onChange:r}=e;r&&n!==u&&r(t)},value:u,disabled:e.disabled,name:e.name,optionType:e.optionType}},D)))});var A=r.memo(T),M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},I=r.forwardRef((e,t)=>{let{getPrefixCls:n}=r.useContext(s.E_),{prefixCls:o}=e,a=M(e,["prefixCls"]),i=n("radio",o);return r.createElement(p,{value:"button"},r.createElement(N,Object.assign({prefixCls:i},a,{type:"radio",ref:t})))});N.Button=I,N.Group=A,N.__ANT_RADIO=!0;var R=N},47451:function(e,t,n){"use strict";var r=n(10295);t.Z=r.Z},87908:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),l=n(19722),s=n(71744),c=n(352),u=n(12918),d=n(80669),f=n(3104);let p=new c.E4("antSpinMove",{to:{opacity:1}}),h=new c.E4("antRotate",{to:{transform:"rotate(405deg)"}}),m=e=>{let{componentCls:t,calc:n}=e;return{["".concat(t)]:Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:"transform ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOutCirc),"&-spinning":{position:"static",display:"inline-block",opacity:1},["".concat(t,"-text")]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:"all ".concat(e.motionDurationMid),"&-show":{opacity:1,visibility:"visible"},["".concat(t,"-dot ").concat(t,"-dot-item")]:{backgroundColor:e.colorWhite},["".concat(t,"-text")]:{color:e.colorTextLightSolid}},"&-nested-loading":{position:"relative",["> div > ".concat(t)]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,["".concat(t,"-dot")]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},["".concat(t,"-text")]:{position:"absolute",top:"50%",width:"100%",textShadow:"0 1px 2px ".concat(e.colorBgContainer)},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{["".concat(t,"-dot")]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},["".concat(t,"-text")]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{["".concat(t,"-dot")]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},["".concat(t,"-text")]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},["".concat(t,"-container")]:{position:"relative",transition:"opacity ".concat(e.motionDurationSlow),"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:"all ".concat(e.motionDurationSlow),content:'""',pointerEvents:"none"}},["".concat(t,"-blur")]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},["".concat(t,"-dot")]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),backgroundColor:e.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:p,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:h,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&-sm ".concat(t,"-dot")]:{fontSize:e.dotSizeSM,i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},["&-lg ".concat(t,"-dot")]:{fontSize:e.dotSizeLG,i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},["&".concat(t,"-show-text ").concat(t,"-text")]:{display:"block"}})}};var g=(0,d.I$)("Spin",e=>[m((0,f.TS)(e,{spinDotDefault:e.colorTextDescription}))],e=>{let{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}}),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let y=null,b=e=>{let{prefixCls:t,spinning:n=!0,delay:o=0,className:c,rootClassName:u,size:d="default",tip:f,wrapperClassName:p,style:h,children:m,fullscreen:b}=e,x=v(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen"]),{getPrefixCls:w}=r.useContext(s.E_),k=w("spin",t),[S,E,O]=g(k),[C,j]=r.useState(()=>n&&(!n||!o||!!isNaN(Number(o))));r.useEffect(()=>{if(n){var e;let t=function(e,t,n){var r,o=n||{},a=o.noTrailing,i=void 0!==a&&a,l=o.noLeading,s=void 0!==l&&l,c=o.debounceMode,u=void 0===c?void 0:c,d=!1,f=0;function p(){r&&clearTimeout(r)}function h(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var l=this,c=Date.now()-f;function h(){f=Date.now(),t.apply(l,o)}function m(){r=void 0}!d&&(s||!u||r||h(),p(),void 0===u&&c>e?s?(f=Date.now(),i||(r=setTimeout(u?m:h,e))):h():!0!==i&&(r=setTimeout(u?m:h,void 0===u?e-c:e)))}return h.cancel=function(e){var t=(e||{}).upcomingOnly;p(),d=!(void 0!==t&&t)},h}(o,()=>{j(!0)},{debounceMode:!1!==(void 0!==(e=({}).atBegin)&&e)});return t(),()=>{var e;null===(e=null==t?void 0:t.cancel)||void 0===e||e.call(t)}}j(!1)},[o,n]);let _=r.useMemo(()=>void 0!==m&&!b,[m,b]),{direction:P,spin:N}=r.useContext(s.E_),T=a()(k,null==N?void 0:N.className,{["".concat(k,"-sm")]:"small"===d,["".concat(k,"-lg")]:"large"===d,["".concat(k,"-spinning")]:C,["".concat(k,"-show-text")]:!!f,["".concat(k,"-fullscreen")]:b,["".concat(k,"-fullscreen-show")]:b&&C,["".concat(k,"-rtl")]:"rtl"===P},c,u,E,O),A=a()("".concat(k,"-container"),{["".concat(k,"-blur")]:C}),M=(0,i.Z)(x,["indicator"]),I=Object.assign(Object.assign({},null==N?void 0:N.style),h),R=r.createElement("div",Object.assign({},M,{style:I,className:T,"aria-live":"polite","aria-busy":C}),function(e,t){let{indicator:n}=t,o="".concat(e,"-dot");return null===n?null:(0,l.l$)(n)?(0,l.Tm)(n,{className:a()(n.props.className,o)}):(0,l.l$)(y)?(0,l.Tm)(y,{className:a()(y.props.className,o)}):r.createElement("span",{className:a()(o,"".concat(e,"-dot-spin"))},r.createElement("i",{className:"".concat(e,"-dot-item"),key:1}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:2}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:3}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:4}))}(k,e),f&&(_||b)?r.createElement("div",{className:"".concat(k,"-text")},f):null);return S(_?r.createElement("div",Object.assign({},M,{className:a()("".concat(k,"-nested-loading"),p,E,O)}),C&&r.createElement("div",{key:"loading"},R),r.createElement("div",{className:A,key:"container"},m)):R)};b.setDefaultIndicator=e=>{y=e};var x=b},76122:function(e,t,n){"use strict";n.d(t,{N:function(){return r}});let r=e=>({color:e.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}})},63709:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var r=n(2265),o=n(61935),a=n(36760),i=n.n(a),l=n(1119),s=n(11993),c=n(26365),u=n(6989),d=n(50506),f=n(95814),p=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],h=r.forwardRef(function(e,t){var n,o=e.prefixCls,a=void 0===o?"rc-switch":o,h=e.className,m=e.checked,g=e.defaultChecked,v=e.disabled,y=e.loadingIcon,b=e.checkedChildren,x=e.unCheckedChildren,w=e.onClick,k=e.onChange,S=e.onKeyDown,E=(0,u.Z)(e,p),O=(0,d.Z)(!1,{value:m,defaultValue:g}),C=(0,c.Z)(O,2),j=C[0],_=C[1];function P(e,t){var n=j;return v||(_(n=e),null==k||k(n,t)),n}var N=i()(a,h,(n={},(0,s.Z)(n,"".concat(a,"-checked"),j),(0,s.Z)(n,"".concat(a,"-disabled"),v),n));return r.createElement("button",(0,l.Z)({},E,{type:"button",role:"switch","aria-checked":j,disabled:v,className:N,ref:t,onKeyDown:function(e){e.which===f.Z.LEFT?P(!1,e):e.which===f.Z.RIGHT&&P(!0,e),null==S||S(e)},onClick:function(e){var t=P(!j,e);null==w||w(t,e)}}),y,r.createElement("span",{className:"".concat(a,"-inner")},r.createElement("span",{className:"".concat(a,"-inner-checked")},b),r.createElement("span",{className:"".concat(a,"-inner-unchecked")},x)))});h.displayName="Switch";var m=n(6694),g=n(71744),v=n(86586),y=n(33759),b=n(352),x=n(36360),w=n(12918),k=n(80669),S=n(3104);let E=e=>{let{componentCls:t,trackHeightSM:n,trackPadding:r,trackMinWidthSM:o,innerMinMarginSM:a,innerMaxMarginSM:i,handleSizeSM:l,calc:s}=e,c="".concat(t,"-inner"),u=(0,b.bf)(s(l).add(s(r).mul(2)).equal()),d=(0,b.bf)(s(i).mul(2).equal());return{[t]:{["&".concat(t,"-small")]:{minWidth:o,height:n,lineHeight:(0,b.bf)(n),["".concat(t,"-inner")]:{paddingInlineStart:i,paddingInlineEnd:a,["".concat(c,"-checked")]:{marginInlineStart:"calc(-100% + ".concat(u," - ").concat(d,")"),marginInlineEnd:"calc(100% - ".concat(u," + ").concat(d,")")},["".concat(c,"-unchecked")]:{marginTop:s(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},["".concat(t,"-handle")]:{width:l,height:l},["".concat(t,"-loading-icon")]:{top:s(s(l).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},["&".concat(t,"-checked")]:{["".concat(t,"-inner")]:{paddingInlineStart:a,paddingInlineEnd:i,["".concat(c,"-checked")]:{marginInlineStart:0,marginInlineEnd:0},["".concat(c,"-unchecked")]:{marginInlineStart:"calc(100% - ".concat(u," + ").concat(d,")"),marginInlineEnd:"calc(-100% + ".concat(u," - ").concat(d,")")}},["".concat(t,"-handle")]:{insetInlineStart:"calc(100% - ".concat((0,b.bf)(s(l).add(r).equal()),")")}},["&:not(".concat(t,"-disabled):active")]:{["&:not(".concat(t,"-checked) ").concat(c)]:{["".concat(c,"-unchecked")]:{marginInlineStart:s(e.marginXXS).div(2).equal(),marginInlineEnd:s(e.marginXXS).mul(-1).div(2).equal()}},["&".concat(t,"-checked ").concat(c)]:{["".concat(c,"-checked")]:{marginInlineStart:s(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:s(e.marginXXS).div(2).equal()}}}}}}},O=e=>{let{componentCls:t,handleSize:n,calc:r}=e;return{[t]:{["".concat(t,"-loading-icon").concat(e.iconCls)]:{position:"relative",top:r(r(n).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},["&".concat(t,"-checked ").concat(t,"-loading-icon")]:{color:e.switchColor}}}},C=e=>{let{componentCls:t,trackPadding:n,handleBg:r,handleShadow:o,handleSize:a,calc:i}=e,l="".concat(t,"-handle");return{[t]:{[l]:{position:"absolute",top:n,insetInlineStart:n,width:a,height:a,transition:"all ".concat(e.switchDuration," ease-in-out"),"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:r,borderRadius:i(a).div(2).equal(),boxShadow:o,transition:"all ".concat(e.switchDuration," ease-in-out"),content:'""'}},["&".concat(t,"-checked ").concat(l)]:{insetInlineStart:"calc(100% - ".concat((0,b.bf)(i(a).add(n).equal()),")")},["&:not(".concat(t,"-disabled):active")]:{["".concat(l,"::before")]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},["&".concat(t,"-checked ").concat(l,"::before")]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},j=e=>{let{componentCls:t,trackHeight:n,trackPadding:r,innerMinMargin:o,innerMaxMargin:a,handleSize:i,calc:l}=e,s="".concat(t,"-inner"),c=(0,b.bf)(l(i).add(l(r).mul(2)).equal()),u=(0,b.bf)(l(a).mul(2).equal());return{[t]:{[s]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:a,paddingInlineEnd:o,transition:"padding-inline-start ".concat(e.switchDuration," ease-in-out, padding-inline-end ").concat(e.switchDuration," ease-in-out"),["".concat(s,"-checked, ").concat(s,"-unchecked")]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:"margin-inline-start ".concat(e.switchDuration," ease-in-out, margin-inline-end ").concat(e.switchDuration," ease-in-out"),pointerEvents:"none"},["".concat(s,"-checked")]:{marginInlineStart:"calc(-100% + ".concat(c," - ").concat(u,")"),marginInlineEnd:"calc(100% - ".concat(c," + ").concat(u,")")},["".concat(s,"-unchecked")]:{marginTop:l(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},["&".concat(t,"-checked ").concat(s)]:{paddingInlineStart:o,paddingInlineEnd:a,["".concat(s,"-checked")]:{marginInlineStart:0,marginInlineEnd:0},["".concat(s,"-unchecked")]:{marginInlineStart:"calc(100% - ".concat(c," + ").concat(u,")"),marginInlineEnd:"calc(-100% + ".concat(c," - ").concat(u,")")}},["&:not(".concat(t,"-disabled):active")]:{["&:not(".concat(t,"-checked) ").concat(s)]:{["".concat(s,"-unchecked")]:{marginInlineStart:l(r).mul(2).equal(),marginInlineEnd:l(r).mul(-1).mul(2).equal()}},["&".concat(t,"-checked ").concat(s)]:{["".concat(s,"-checked")]:{marginInlineStart:l(r).mul(-1).mul(2).equal(),marginInlineEnd:l(r).mul(2).equal()}}}}}},_=e=>{let{componentCls:t,trackHeight:n,trackMinWidth:r}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:r,height:n,lineHeight:"".concat((0,b.bf)(n)),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),userSelect:"none",["&:hover:not(".concat(t,"-disabled)")]:{background:e.colorTextTertiary}}),(0,w.Qy)(e)),{["&".concat(t,"-checked")]:{background:e.switchColor,["&:hover:not(".concat(t,"-disabled)")]:{background:e.colorPrimaryHover}},["&".concat(t,"-loading, &").concat(t,"-disabled")]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},["&".concat(t,"-rtl")]:{direction:"rtl"}})}};var P=(0,k.I$)("Switch",e=>{let t=(0,S.TS)(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:"rgba(0, 0, 0, ".concat(e.opacityLoading,")"),switchHandleActiveInset:"-30%"});return[_(t),j(t),C(t),O(t),E(t)]},e=>{let{fontSize:t,lineHeight:n,controlHeight:r,colorWhite:o}=e,a=t*n,i=r/2,l=a-4,s=i-4;return{trackHeight:a,trackHeightSM:i,trackMinWidth:2*l+8,trackMinWidthSM:2*s+4,trackPadding:2,handleBg:o,handleSize:l,handleSizeSM:s,handleShadow:"0 2px 4px 0 ".concat(new x.C("#00230b").setAlpha(.2).toRgbString()),innerMinMargin:l/2,innerMaxMargin:l+2+4,innerMinMarginSM:s/2,innerMaxMarginSM:s+2+4}}),N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let T=r.forwardRef((e,t)=>{let{prefixCls:n,size:a,disabled:l,loading:s,className:c,rootClassName:u,style:f,checked:p,value:b,defaultChecked:x,defaultValue:w,onChange:k}=e,S=N(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[E,O]=(0,d.Z)(!1,{value:null!=p?p:b,defaultValue:null!=x?x:w}),{getPrefixCls:C,direction:j,switch:_}=r.useContext(g.E_),T=r.useContext(v.Z),A=(null!=l?l:T)||s,M=C("switch",n),I=r.createElement("div",{className:"".concat(M,"-handle")},s&&r.createElement(o.Z,{className:"".concat(M,"-loading-icon")})),[R,D,L]=P(M),Z=(0,y.Z)(a),z=i()(null==_?void 0:_.className,{["".concat(M,"-small")]:"small"===Z,["".concat(M,"-loading")]:s,["".concat(M,"-rtl")]:"rtl"===j},c,u,D,L),B=Object.assign(Object.assign({},null==_?void 0:_.style),f);return R(r.createElement(m.Z,{component:"Switch"},r.createElement(h,Object.assign({},S,{checked:E,onChange:function(){O(arguments.length<=0?void 0:arguments[0]),null==k||k.apply(void 0,arguments)},prefixCls:M,className:z,style:B,disabled:A,ref:t,loadingIcon:I}))))});T.__ANT_SWITCH=!0;var A=T},72188:function(e,t,n){"use strict";n.d(t,{Z:function(){return oe}});var r,o,a=n(2265),i={},l="rc-table-internal-hook",s=n(26365),c=n(58525),u=n(27380),d=n(16671),f=n(54887);function p(e){var t=a.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,r=e.children,o=a.useRef(n);o.current=n;var i=a.useState(function(){return{getValue:function(){return o.current},listeners:new Set}}),l=(0,s.Z)(i,1)[0];return(0,u.Z)(function(){(0,f.unstable_batchedUpdates)(function(){l.listeners.forEach(function(e){e(n)})})},[n]),a.createElement(t.Provider,{value:l},r)},defaultValue:e}}function h(e,t){var n=(0,c.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),r=a.useContext(null==e?void 0:e.Context),o=r||{},i=o.listeners,l=o.getValue,f=a.useRef();f.current=n(r?l():null==e?void 0:e.defaultValue);var p=a.useState({}),h=(0,s.Z)(p,2)[1];return(0,u.Z)(function(){if(r)return i.add(e),function(){i.delete(e)};function e(e){var t=n(e);(0,d.Z)(f.current,t,!0)||h({})}},[r]),f.current}var m=n(1119),g=n(28791);function v(){var e=a.createContext(null);function t(){return a.useContext(e)}return{makeImmutable:function(n,r){var o=(0,g.Yr)(n),i=function(i,l){var s=o?{ref:l}:{},c=a.useRef(0),u=a.useRef(i);return null!==t()?a.createElement(n,(0,m.Z)({},i,s)):((!r||r(u.current,i))&&(c.current+=1),u.current=i,a.createElement(e.Provider,{value:c.current},a.createElement(n,(0,m.Z)({},i,s))))};return o?a.forwardRef(i):i},responseImmutable:function(e,n){var r=(0,g.Yr)(e),o=function(n,o){return t(),a.createElement(e,(0,m.Z)({},n,r?{ref:o}:{}))};return r?a.memo(a.forwardRef(o),n):a.memo(o,n)},useImmutableMark:t}}var y=v();y.makeImmutable,y.responseImmutable,y.useImmutableMark;var b=v(),x=b.makeImmutable,w=b.responseImmutable,k=b.useImmutableMark,S=p();a.memo(function(){var e,t,n,r,o,i=(t=a.useRef(0),t.current+=1,n=a.useRef(void 0),r=[],Object.keys(e||{}).map(function(t){var o;(null==e?void 0:e[t])!==(null===(o=n.current)||void 0===o?void 0:o[t])&&r.push(t)}),n.current=e,o=a.useRef([]),r.length&&(o.current=r),a.useDebugValue(t.current),a.useDebugValue(o.current.join(", ")),t.current);return a.createElement("h1",null,"Render Times: ",i)}).displayName="RenderBlock";var E=n(41154),O=n(31686),C=n(11993),j=n(36760),_=n.n(j),P=n(6397),N=n(16847),T=n(32559),A=a.createContext({renderWithProps:!1});function M(e){var t=[],n={};return e.forEach(function(e){for(var r=e||{},o=r.key,a=r.dataIndex,i=o||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[i];)i="".concat(i,"_next");n[i]=!0,t.push(i)}),t}var I=n(74126),R=function(e){var t,n=e.ellipsis,r=e.rowType,o=e.children,i=!0===n?{showTitle:!0}:n;return i&&(i.showTitle||"header"===r)&&("string"==typeof o||"number"==typeof o?t=o.toString():a.isValidElement(o)&&"string"==typeof o.props.children&&(t=o.props.children)),t},D=a.memo(function(e){var t,n,r,o,i,l,c,u,f,p,g=e.component,v=e.children,y=e.ellipsis,b=e.scope,x=e.prefixCls,w=e.className,j=e.align,T=e.record,M=e.render,D=e.dataIndex,L=e.renderIndex,Z=e.shouldCellUpdate,z=e.index,B=e.rowType,F=e.colSpan,H=e.rowSpan,q=e.fixLeft,W=e.fixRight,U=e.firstFixLeft,K=e.lastFixLeft,$=e.firstFixRight,V=e.lastFixRight,X=e.appendNode,G=e.additionalProps,Y=void 0===G?{}:G,Q=e.isSticky,J="".concat(x,"-cell"),ee=h(S,["supportSticky","allColumnsFixedLeft"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,er=(t=a.useContext(A),n=k(),(0,P.Z)(function(){if(null!=v)return[v];var e=null==D||""===D?[]:Array.isArray(D)?D:[D],n=(0,N.Z)(T,e),r=n,o=void 0;if(M){var i=M(n,T,L);!i||"object"!==(0,E.Z)(i)||Array.isArray(i)||a.isValidElement(i)?r=i:(r=i.children,o=i.props,t.renderWithProps=!0)}return[r,o]},[n,T,v,D,M,L],function(e,n){if(Z){var r=(0,s.Z)(e,2)[1];return Z((0,s.Z)(n,2)[1],r)}return!!t.renderWithProps||!(0,d.Z)(e,n,!0)})),eo=(0,s.Z)(er,2),ea=eo[0],ei=eo[1],el={},es="number"==typeof q&&et,ec="number"==typeof W&&et;es&&(el.position="sticky",el.left=q),ec&&(el.position="sticky",el.right=W);var eu=null!==(r=null!==(o=null!==(i=null==ei?void 0:ei.colSpan)&&void 0!==i?i:Y.colSpan)&&void 0!==o?o:F)&&void 0!==r?r:1,ed=null!==(l=null!==(c=null!==(u=null==ei?void 0:ei.rowSpan)&&void 0!==u?u:Y.rowSpan)&&void 0!==c?c:H)&&void 0!==l?l:1,ef=h(S,function(e){var t,n;return[(t=ed||1,n=e.hoverStartRow,z<=e.hoverEndRow&&z+t-1>=n),e.onHover]}),ep=(0,s.Z)(ef,2),eh=ep[0],em=ep[1],eg=(0,I.zX)(function(e){var t;T&&em(z,z+ed-1),null==Y||null===(t=Y.onMouseEnter)||void 0===t||t.call(Y,e)}),ev=(0,I.zX)(function(e){var t;T&&em(-1,-1),null==Y||null===(t=Y.onMouseLeave)||void 0===t||t.call(Y,e)});if(0===eu||0===ed)return null;var ey=null!==(f=Y.title)&&void 0!==f?f:R({rowType:B,ellipsis:y,children:ea}),eb=_()(J,w,(p={},(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)(p,"".concat(J,"-fix-left"),es&&et),"".concat(J,"-fix-left-first"),U&&et),"".concat(J,"-fix-left-last"),K&&et),"".concat(J,"-fix-left-all"),K&&en&&et),"".concat(J,"-fix-right"),ec&&et),"".concat(J,"-fix-right-first"),$&&et),"".concat(J,"-fix-right-last"),V&&et),"".concat(J,"-ellipsis"),y),"".concat(J,"-with-append"),X),"".concat(J,"-fix-sticky"),(es||ec)&&Q&&et),(0,C.Z)(p,"".concat(J,"-row-hover"),!ei&&eh)),Y.className,null==ei?void 0:ei.className),ex={};j&&(ex.textAlign=j);var ew=(0,O.Z)((0,O.Z)((0,O.Z)((0,O.Z)({},el),Y.style),ex),null==ei?void 0:ei.style),ek=ea;return"object"!==(0,E.Z)(ek)||Array.isArray(ek)||a.isValidElement(ek)||(ek=null),y&&(K||$)&&(ek=a.createElement("span",{className:"".concat(J,"-content")},ek)),a.createElement(g,(0,m.Z)({},ei,Y,{className:eb,style:ew,title:ey,scope:b,onMouseEnter:eg,onMouseLeave:ev,colSpan:1!==eu?eu:null,rowSpan:1!==ed?ed:null}),X,ek)});function L(e,t,n,r,o,a){var i,l,s=n[e]||{},c=n[t]||{};"left"===s.fixed?i=r.left["rtl"===o?t:e]:"right"===c.fixed&&(l=r.right["rtl"===o?e:t]);var u=!1,d=!1,f=!1,p=!1,h=n[t+1],m=n[e-1],g=!(null!=a&&a.children);return"rtl"===o?void 0!==i?p=!(m&&"left"===m.fixed)&&g:void 0!==l&&(f=!(h&&"right"===h.fixed)&&g):void 0!==i?u=!(h&&"left"===h.fixed)&&g:void 0!==l&&(d=!(m&&"right"===m.fixed)&&g),{fixLeft:i,fixRight:l,lastFixLeft:u,firstFixRight:d,lastFixRight:f,firstFixLeft:p,isSticky:r.isSticky}}var Z=a.createContext({}),z=n(6989),B=["children"];function F(e){return e.children}F.Row=function(e){var t=e.children,n=(0,z.Z)(e,B);return a.createElement("tr",n,t)},F.Cell=function(e){var t=e.className,n=e.index,r=e.children,o=e.colSpan,i=void 0===o?1:o,l=e.rowSpan,s=e.align,c=h(S,["prefixCls","direction"]),u=c.prefixCls,d=c.direction,f=a.useContext(Z),p=f.scrollColumnIndex,g=f.stickyOffsets,v=f.flattenColumns,y=f.columns,b=n+i-1+1===p?i+1:i,x=L(n,n+b-1,v,g,d,null==y?void 0:y[n]);return a.createElement(D,(0,m.Z)({className:t,index:n,component:"td",prefixCls:u,record:null,dataIndex:null,align:s,colSpan:b,rowSpan:l,render:function(){return r}},x))};var H=w(function(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,o=e.columns,i=h(S,"prefixCls"),l=r.length-1,s=r[l],c=a.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:null!=s&&s.scrollbar?l:null,columns:o}},[s,r,l,n,o]);return a.createElement(Z.Provider,{value:c},a.createElement("tfoot",{className:"".concat(i,"-summary")},t))}),q=n(31474),W=n(2857),U=n(10281),K=n(3208),$=n(18242);function V(e,t,n,r){return a.useMemo(function(){if(null!=n&&n.size){for(var o=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,r,o,a,i,l){t.push({record:n,indent:r,index:l});var s=i(n),c=null==a?void 0:a.has(s);if(n&&Array.isArray(n[o])&&c)for(var u=0;u<n[o].length;u+=1)e(t,n[o][u],r+1,o,a,i,u)}(o,e[a],0,t,n,r,a);return o}return null==e?void 0:e.map(function(e,t){return{record:e,indent:0,index:t}})},[e,t,n,r])}function X(e,t,n,r){var o,a=h(S,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),i=a.flattenColumns,l=a.expandableType,s=a.expandedKeys,c=a.childrenColumnName,u=a.onTriggerExpand,d=a.rowExpandable,f=a.onRow,p=a.expandRowByClick,m=a.rowClassName,g="nest"===l,v="row"===l&&(!d||d(e)),y=v||g,b=s&&s.has(t),x=c&&e&&e[c],w=(0,I.zX)(u),k=null==f?void 0:f(e,n),E=null==k?void 0:k.onClick;"string"==typeof m?o=m:"function"==typeof m&&(o=m(e,n,r));var C=M(i);return(0,O.Z)((0,O.Z)({},a),{},{columnsKey:C,nestExpandable:g,expanded:b,hasNestChildren:x,record:e,onTriggerExpand:w,rowSupportExpand:v,expandable:y,rowProps:(0,O.Z)((0,O.Z)({},k),{},{className:_()(o,null==k?void 0:k.className),onClick:function(t){p&&y&&u(e,t);for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];null==E||E.apply(void 0,[t].concat(r))}})})}var G=function(e){var t=e.prefixCls,n=e.children,r=e.component,o=e.cellComponent,i=e.className,l=e.expanded,s=e.colSpan,c=e.isEmpty,u=h(S,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),d=u.scrollbarSize,f=u.fixHeader,p=u.fixColumn,m=u.componentWidth,g=u.horizonScroll,v=n;return(c?g&&m:p)&&(v=a.createElement("div",{style:{width:m-(f?d:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(t,"-expanded-row-fixed")},v)),a.createElement(r,{className:i,style:{display:l?null:"none"}},a.createElement(D,{component:o,prefixCls:t,colSpan:s},v))};function Y(e,t,n,r,o){var i,l,s=e.record,c=e.prefixCls,u=e.columnsKey,d=e.fixedInfoList,f=e.expandIconColumnIndex,p=e.nestExpandable,h=e.indentSize,m=e.expandIcon,g=e.expanded,v=e.hasNestChildren,y=e.onTriggerExpand,b=u[n],x=d[n];return n===(f||0)&&p&&(i=a.createElement(a.Fragment,null,a.createElement("span",{style:{paddingLeft:"".concat(h*r,"px")},className:"".concat(c,"-row-indent indent-level-").concat(r)}),m({prefixCls:c,expanded:g,expandable:v,record:s,onExpand:y}))),t.onCell&&(l=t.onCell(s,o)),{key:b,fixedInfo:x,appendCellNode:i,additionalCellProps:l||{}}}function Q(e){var t,n=e.className,r=e.style,o=e.record,i=e.index,l=e.renderIndex,s=e.rowKey,c=e.indent,u=void 0===c?0:c,d=e.rowComponent,f=e.cellComponent,p=e.scopeCellComponent,h=X(o,s,i,u),g=h.prefixCls,v=h.flattenColumns,y=h.expandedRowClassName,b=h.expandedRowRender,x=h.rowProps,w=h.expanded,k=h.rowSupportExpand,S=a.useRef(!1);S.current||(S.current=w);var E=a.createElement(d,(0,m.Z)({},x,{"data-row-key":s,className:_()(n,"".concat(g,"-row"),"".concat(g,"-row-level-").concat(u),null==x?void 0:x.className),style:(0,O.Z)((0,O.Z)({},r),null==x?void 0:x.style)}),v.map(function(e,t){var n=e.render,r=e.dataIndex,s=e.className,c=Y(h,e,t,u,i),d=c.key,v=c.fixedInfo,y=c.appendCellNode,b=c.additionalCellProps;return a.createElement(D,(0,m.Z)({className:s,ellipsis:e.ellipsis,align:e.align,scope:e.rowScope,component:e.rowScope?p:f,prefixCls:g,key:d,record:o,index:i,renderIndex:l,dataIndex:r,render:n,shouldCellUpdate:e.shouldCellUpdate},v,{appendNode:y,additionalProps:b}))}));if(k&&(S.current||w)){var C=b(o,i,u+1,w),j=y&&y(o,i,u);t=a.createElement(G,{expanded:w,className:_()("".concat(g,"-expanded-row"),"".concat(g,"-expanded-row-level-").concat(u+1),j),prefixCls:g,component:d,cellComponent:f,colSpan:v.length,isEmpty:!1},C)}return a.createElement(a.Fragment,null,E,t)}Q.displayName="BodyRow";var J=w(Q);function ee(e){var t=e.columnKey,n=e.onColumnResize,r=a.useRef();return a.useEffect(function(){r.current&&n(t,r.current.offsetWidth)},[]),a.createElement(q.Z,{data:t},a.createElement("td",{ref:r,style:{padding:0,border:0,height:0}},a.createElement("div",{style:{height:0,overflow:"hidden"}},"\xa0")))}function et(e){var t=e.prefixCls,n=e.columnsKey,r=e.onColumnResize;return a.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),style:{height:0,fontSize:0}},a.createElement(q.Z.Collection,{onBatchResize:function(e){e.forEach(function(e){r(e.data,e.size.offsetWidth)})}},n.map(function(e){return a.createElement(ee,{key:e,columnKey:e,onColumnResize:r})})))}function en(e){var t,n=e.data,r=e.measureColumnWidth,o=h(S,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),i=o.prefixCls,l=o.getComponent,s=o.onColumnResize,c=o.flattenColumns,u=o.getRowKey,d=o.expandedKeys,f=o.childrenColumnName,p=o.emptyNode,m=V(n,f,d,u),g=a.useRef({renderWithProps:!1}),v=l(["body","wrapper"],"tbody"),y=l(["body","row"],"tr"),b=l(["body","cell"],"td"),x=l(["body","cell"],"th");t=n.length?m.map(function(e,t){var n=e.record,r=e.indent,o=e.index,i=u(n,t);return a.createElement(J,{key:i,rowKey:i,record:n,index:t,renderIndex:o,rowComponent:y,cellComponent:b,scopeCellComponent:x,getRowKey:u,indent:r})}):a.createElement(G,{expanded:!0,className:"".concat(i,"-placeholder"),prefixCls:i,component:y,cellComponent:b,colSpan:c.length,isEmpty:!0},p);var w=M(c);return a.createElement(A.Provider,{value:g.current},a.createElement(v,{className:"".concat(i,"-tbody")},r&&a.createElement(et,{prefixCls:i,columnsKey:w,onColumnResize:s}),t))}en.displayName="Body";var er=w(en),eo=["expandable"],ea="RC_TABLE_INTERNAL_COL_DEFINE",ei=["columnType"],el=function(e){for(var t=e.colWidths,n=e.columns,r=e.columCount,o=[],i=r||n.length,l=!1,s=i-1;s>=0;s-=1){var c=t[s],u=n&&n[s],d=u&&u[ea];if(c||d||l){var f=d||{},p=(f.columnType,(0,z.Z)(f,ei));o.unshift(a.createElement("col",(0,m.Z)({key:s,style:{width:c}},p))),l=!0}}return a.createElement("colgroup",null,o)},es=n(83145),ec=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"],eu=a.forwardRef(function(e,t){var n=e.className,r=e.noData,o=e.columns,i=e.flattenColumns,l=e.colWidths,s=e.columCount,c=e.stickyOffsets,u=e.direction,d=e.fixHeader,f=e.stickyTopOffset,p=e.stickyBottomOffset,m=e.stickyClassName,v=e.onScroll,y=e.maxContentScroll,b=e.children,x=(0,z.Z)(e,ec),w=h(S,["prefixCls","scrollbarSize","isSticky"]),k=w.prefixCls,E=w.scrollbarSize,j=w.isSticky,P=j&&!d?0:E,N=a.useRef(null),T=a.useCallback(function(e){(0,g.mH)(t,e),(0,g.mH)(N,e)},[]);a.useEffect(function(){var e;function t(e){var t=e.currentTarget,n=e.deltaX;n&&(v({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}return null===(e=N.current)||void 0===e||e.addEventListener("wheel",t),function(){var e;null===(e=N.current)||void 0===e||e.removeEventListener("wheel",t)}},[]);var A=a.useMemo(function(){return i.every(function(e){return e.width})},[i]),M=i[i.length-1],I={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(k,"-cell-scrollbar")}}},R=(0,a.useMemo)(function(){return P?[].concat((0,es.Z)(o),[I]):o},[P,o]),D=(0,a.useMemo)(function(){return P?[].concat((0,es.Z)(i),[I]):i},[P,i]),L=(0,a.useMemo)(function(){var e=c.right,t=c.left;return(0,O.Z)((0,O.Z)({},c),{},{left:"rtl"===u?[].concat((0,es.Z)(t.map(function(e){return e+P})),[0]):t,right:"rtl"===u?e:[].concat((0,es.Z)(e.map(function(e){return e+P})),[0]),isSticky:j})},[P,c,j]),Z=(0,a.useMemo)(function(){for(var e=[],t=0;t<s;t+=1){var n=l[t];if(void 0===n)return null;e[t]=n}return e},[l.join("_"),s]);return a.createElement("div",{style:(0,O.Z)({overflow:"hidden"},j?{top:f,bottom:p}:{}),ref:T,className:_()(n,(0,C.Z)({},m,!!m))},a.createElement("table",{style:{tableLayout:"fixed",visibility:r||Z?null:"hidden"}},(!r||!y||A)&&a.createElement(el,{colWidths:Z?[].concat((0,es.Z)(Z),[P]):[],columCount:s+1,columns:D}),b((0,O.Z)((0,O.Z)({},x),{},{stickyOffsets:L,columns:R,flattenColumns:D}))))});eu.displayName="FixedHolder";var ed=a.memo(eu);function ef(e){var t,n=e.cells,r=e.stickyOffsets,o=e.flattenColumns,i=e.rowComponent,l=e.cellComponent,s=e.tdCellComponent,c=e.onHeaderRow,u=e.index,d=h(S,["prefixCls","direction"]),f=d.prefixCls,p=d.direction;c&&(t=c(n.map(function(e){return e.column}),u));var g=M(n.map(function(e){return e.column}));return a.createElement(i,t,n.map(function(e,t){var n,i=e.column,c=L(e.colStart,e.colEnd,o,r,p,i);return i&&i.onHeaderCell&&(n=e.column.onHeaderCell(i)),a.createElement(D,(0,m.Z)({},e,{scope:i.title?e.colSpan>1?"colgroup":"col":null,ellipsis:i.ellipsis,align:i.align,component:i.title?l:s,prefixCls:f,key:g[t]},c,{additionalProps:n,rowType:"header"}))}))}ef.displayName="HeaderRow";var ep=w(function(e){var t=e.stickyOffsets,n=e.columns,r=e.flattenColumns,o=e.onHeaderRow,i=h(S,["prefixCls","getComponent"]),l=i.prefixCls,s=i.getComponent,c=a.useMemo(function(){return function(e){var t=[];!function e(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[o]=t[o]||[];var a=r;return n.filter(Boolean).map(function(n){var r={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},i=1,l=n.children;return l&&l.length>0&&(i=e(l,a,o+1).reduce(function(e,t){return e+t},0),r.hasSubColumns=!0),"colSpan"in n&&(i=n.colSpan),"rowSpan"in n&&(r.rowSpan=n.rowSpan),r.colSpan=i,r.colEnd=r.colStart+i-1,t[o].push(r),a+=i,i})}(e,0);for(var n=t.length,r=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},o=0;o<n;o+=1)r(o);return t}(n)},[n]),u=s(["header","wrapper"],"thead"),d=s(["header","row"],"tr"),f=s(["header","cell"],"th"),p=s(["header","cell"],"td");return a.createElement(u,{className:"".concat(l,"-thead")},c.map(function(e,n){return a.createElement(ef,{key:n,flattenColumns:r,cells:e,stickyOffsets:t,rowComponent:d,cellComponent:f,tdCellComponent:p,onHeaderRow:o,index:n})}))}),eh=n(45287);function em(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var eg=["children"],ev=["fixed"];function ey(e){return(0,eh.Z)(e).filter(function(e){return a.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,r=n.children,o=(0,z.Z)(n,eg),a=(0,O.Z)({key:t},o);return r&&(a.children=ey(r)),a})}function eb(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,E.Z)(e)}).reduce(function(e,n,r){var o=n.fixed,a=!0===o?"left":o,i="".concat(t,"-").concat(r),l=n.children;return l&&l.length>0?[].concat((0,es.Z)(e),(0,es.Z)(eb(l,i).map(function(e){return(0,O.Z)({fixed:a},e)}))):[].concat((0,es.Z)(e),[(0,O.Z)((0,O.Z)({key:i},n),{},{fixed:a})])},[])}var ex=function(e,t){var n=e.prefixCls,r=e.columns,o=e.children,l=e.expandable,c=e.expandedKeys,u=e.columnTitle,d=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,h=e.rowExpandable,m=e.expandIconColumnIndex,g=e.direction,v=e.expandRowByClick,y=e.columnWidth,b=e.fixed,x=e.scrollWidth,w=e.clientWidth,k=a.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,E.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,O.Z)((0,O.Z)({},t),{},{children:e(n)}):t})}((r||ey(o)||[]).slice())},[r,o]),S=a.useMemo(function(){if(l){var e,t=k.slice();if(!t.includes(i)){var r=m||0;r>=0&&t.splice(r,0,i)}var o=t.indexOf(i);t=t.filter(function(e,t){return e!==i||t===o});var s=k[o];e=("left"===b||b)&&!m?"left":("right"===b||b)&&m===k.length?"right":s?s.fixed:null;var g=(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},ea,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",u),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",y),"render",function(e,t,r){var o=d(t,r),i=p({prefixCls:n,expanded:c.has(o),expandable:!h||h(t),record:t,onExpand:f});return v?a.createElement("span",{onClick:function(e){return e.stopPropagation()}},i):i});return t.map(function(e){return e===i?g:e})}return k.filter(function(e){return e!==i})},[l,k,d,c,p,g]),j=a.useMemo(function(){var e=S;return t&&(e=t(e)),e.length||(e=[{render:function(){return null}}]),e},[t,S,g]),_=a.useMemo(function(){return"rtl"===g?eb(j).map(function(e){var t=e.fixed,n=(0,z.Z)(e,ev),r=t;return"left"===t?r="right":"right"===t&&(r="left"),(0,O.Z)({fixed:r},n)}):eb(j)},[j,g,x]),P=a.useMemo(function(){if(x&&x>0){var e=0,t=0;_.forEach(function(n){var r=em(x,n.width);r?e+=r:t+=1});var n=Math.max(x,w),r=Math.max(n-e,t),o=t,a=r/t,i=0,l=_.map(function(e){var t=(0,O.Z)({},e),n=em(x,t.width);if(n)t.width=n;else{var l=Math.floor(a);t.width=1===o?r:l,r-=l,o-=1}return i+=t.width,t});if(i<n){var s=n/i;r=n,l.forEach(function(e,t){var n=Math.floor(e.width*s);e.width=t===l.length-1?r:n,r-=n})}return[l,Math.max(i,n)]}return[_,x]},[_,x,w]),N=(0,s.Z)(P,2);return[j,N[0],N[1]]};function ew(e){var t=e.prefixCls,n=e.record,r=e.onExpand,o=e.expanded,i=e.expandable,l="".concat(t,"-row-expand-icon");return i?a.createElement("span",{className:_()(l,(0,C.Z)((0,C.Z)({},"".concat(t,"-row-expanded"),o),"".concat(t,"-row-collapsed"),!o)),onClick:function(e){r(n,e),e.stopPropagation()}}):a.createElement("span",{className:_()(l,"".concat(t,"-row-spaced"))})}function ek(e){var t=(0,a.useRef)(e),n=(0,a.useState)({}),r=(0,s.Z)(n,2)[1],o=(0,a.useRef)(null),i=(0,a.useRef)([]);return(0,a.useEffect)(function(){return function(){o.current=null}},[]),[t.current,function(e){i.current.push(e);var n=Promise.resolve();o.current=n,n.then(function(){if(o.current===n){var e=i.current,a=t.current;i.current=[],e.forEach(function(e){t.current=e(t.current)}),o.current=null,a!==t.current&&r({})}})}]}var eS=(0,n(94981).Z)()?window:null,eE=function(e){var t=e.className,n=e.children;return a.createElement("div",{className:t},n)};function eO(e,t,n,r){var o=f.unstable_batchedUpdates?function(e){f.unstable_batchedUpdates(n,e)}:n;return null!=e&&e.addEventListener&&e.addEventListener(t,o,r),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,o,r)}}}function eC(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var ej=a.forwardRef(function(e,t){var n,r,o=e.scrollBodyRef,i=e.onScroll,l=e.offsetScroll,c=e.container,u=h(S,"prefixCls"),d=(null===(n=o.current)||void 0===n?void 0:n.scrollWidth)||0,f=(null===(r=o.current)||void 0===r?void 0:r.clientWidth)||0,p=d&&f/d*f,m=a.useRef(),g=ek({scrollLeft:0,isHiddenScrollBar:!1}),v=(0,s.Z)(g,2),y=v[0],b=v[1],x=a.useRef({delta:0,x:0}),w=a.useState(!1),k=(0,s.Z)(w,2),E=k[0],j=k[1],P=function(){j(!1)},N=function(e){var t,n=(e||(null===(t=window)||void 0===t?void 0:t.event)).buttons;if(!E||0===n){E&&j(!1);return}var r=x.current.x+e.pageX-x.current.x-x.current.delta;r<=0&&(r=0),r+p>=f&&(r=f-p),i({scrollLeft:r/f*(d+2)}),x.current.x=e.pageX},T=function(){if(o.current){var e=eC(o.current).top,t=e+o.current.offsetHeight,n=c===window?document.documentElement.scrollTop+window.innerHeight:eC(c).top+c.clientHeight;t-(0,K.Z)()<=n||e>=n-l?b(function(e){return(0,O.Z)((0,O.Z)({},e),{},{isHiddenScrollBar:!0})}):b(function(e){return(0,O.Z)((0,O.Z)({},e),{},{isHiddenScrollBar:!1})})}},A=function(e){b(function(t){return(0,O.Z)((0,O.Z)({},t),{},{scrollLeft:e/d*f||0})})};return(a.useImperativeHandle(t,function(){return{setScrollLeft:A}}),a.useEffect(function(){var e=eO(document.body,"mouseup",P,!1),t=eO(document.body,"mousemove",N,!1);return T(),function(){e.remove(),t.remove()}},[p,E]),a.useEffect(function(){var e=eO(c,"scroll",T,!1),t=eO(window,"resize",T,!1);return function(){e.remove(),t.remove()}},[c]),a.useEffect(function(){y.isHiddenScrollBar||b(function(e){var t=o.current;return t?(0,O.Z)((0,O.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[y.isHiddenScrollBar]),d<=f||!p||y.isHiddenScrollBar)?null:a.createElement("div",{style:{height:(0,K.Z)(),width:f,bottom:l},className:"".concat(u,"-sticky-scroll")},a.createElement("div",{onMouseDown:function(e){e.persist(),x.current.delta=e.pageX-y.scrollLeft,x.current.x=0,j(!0),e.preventDefault()},ref:m,className:_()("".concat(u,"-sticky-scroll-bar"),(0,C.Z)({},"".concat(u,"-sticky-scroll-bar-active"),E)),style:{width:"".concat(p,"px"),transform:"translate3d(".concat(y.scrollLeft,"px, 0, 0)")}}))}),e_="rc-table",eP=[],eN={};function eT(){return"No Data"}var eA=a.forwardRef(function(e,t){var n,r=(0,O.Z)({rowKey:"key",prefixCls:e_,emptyText:eT},e),o=r.prefixCls,i=r.className,u=r.rowClassName,f=r.style,p=r.data,h=r.rowKey,g=r.scroll,v=r.tableLayout,y=r.direction,b=r.title,x=r.footer,w=r.summary,k=r.caption,j=r.id,T=r.showHeader,A=r.components,I=r.emptyText,R=r.onRow,D=r.onHeaderRow,Z=r.internalHooks,B=r.transformColumns,V=r.internalRefs,X=r.tailor,G=r.getContainerWidth,Y=r.sticky,Q=p||eP,J=!!Q.length,ee=Z===l,et=a.useCallback(function(e,t){return(0,N.Z)(A,e)||t},[A]),en=a.useMemo(function(){return"function"==typeof h?h:function(e){return e&&e[h]}},[h]),ea=et(["body"]),ei=(tH=a.useState(-1),tW=(tq=(0,s.Z)(tH,2))[0],tU=tq[1],tK=a.useState(-1),tV=(t$=(0,s.Z)(tK,2))[0],tX=t$[1],[tW,tV,a.useCallback(function(e,t){tU(e),tX(t)},[])]),ec=(0,s.Z)(ei,3),eu=ec[0],ef=ec[1],eh=ec[2],em=(tJ=(tY=r.expandable,tQ=(0,z.Z)(r,eo),!1===(tG="expandable"in r?(0,O.Z)((0,O.Z)({},tQ),tY):tQ).showExpandColumn&&(tG.expandIconColumnIndex=-1),tG).expandIcon,t0=tG.expandedRowKeys,t1=tG.defaultExpandedRowKeys,t2=tG.defaultExpandAllRows,t6=tG.expandedRowRender,t4=tG.onExpand,t3=tG.onExpandedRowsChange,t5=tG.childrenColumnName||"children",t8=a.useMemo(function(){return t6?"row":!!(r.expandable&&r.internalHooks===l&&r.expandable.__PARENT_RENDER_ICON__||Q.some(function(e){return e&&"object"===(0,E.Z)(e)&&e[t5]}))&&"nest"},[!!t6,Q]),t7=a.useState(function(){if(t1)return t1;if(t2){var e;return e=[],function t(n){(n||[]).forEach(function(n,r){e.push(en(n,r)),t(n[t5])})}(Q),e}return[]}),ne=(t9=(0,s.Z)(t7,2))[0],nt=t9[1],nn=a.useMemo(function(){return new Set(t0||ne||[])},[t0,ne]),nr=a.useCallback(function(e){var t,n=en(e,Q.indexOf(e)),r=nn.has(n);r?(nn.delete(n),t=(0,es.Z)(nn)):t=[].concat((0,es.Z)(nn),[n]),nt(t),t4&&t4(!r,e),t3&&t3(t)},[en,nn,Q,t4,t3]),[tG,t8,nn,tJ||ew,t5,nr]),eg=(0,s.Z)(em,6),ev=eg[0],ey=eg[1],eb=eg[2],eO=eg[3],eC=eg[4],eA=eg[5],eM=null==g?void 0:g.x,eI=a.useState(0),eR=(0,s.Z)(eI,2),eD=eR[0],eL=eR[1],eZ=ex((0,O.Z)((0,O.Z)((0,O.Z)({},r),ev),{},{expandable:!!ev.expandedRowRender,columnTitle:ev.columnTitle,expandedKeys:eb,getRowKey:en,onTriggerExpand:eA,expandIcon:eO,expandIconColumnIndex:ev.expandIconColumnIndex,direction:y,scrollWidth:ee&&X&&"number"==typeof eM?eM:null,clientWidth:eD}),ee?B:null),ez=(0,s.Z)(eZ,3),eB=ez[0],eF=ez[1],eH=ez[2],eq=null!=eH?eH:eM,eW=a.useMemo(function(){return{columns:eB,flattenColumns:eF}},[eB,eF]),eU=a.useRef(),eK=a.useRef(),e$=a.useRef(),eV=a.useRef();a.useImperativeHandle(t,function(){return{nativeElement:eU.current,scrollTo:function(e){var t;if(e$.current instanceof HTMLElement){var n=e.index,r=e.top,o=e.key;if(r)null===(a=e$.current)||void 0===a||a.scrollTo({top:r});else{var a,i,l=null!=o?o:en(Q[n]);null===(i=e$.current.querySelector('[data-row-key="'.concat(l,'"]')))||void 0===i||i.scrollIntoView()}}else null!==(t=e$.current)&&void 0!==t&&t.scrollTo&&e$.current.scrollTo(e)}}});var eX=a.useRef(),eG=a.useState(!1),eY=(0,s.Z)(eG,2),eQ=eY[0],eJ=eY[1],e0=a.useState(!1),e1=(0,s.Z)(e0,2),e2=e1[0],e6=e1[1],e4=ek(new Map),e3=(0,s.Z)(e4,2),e5=e3[0],e8=e3[1],e7=M(eF).map(function(e){return e5.get(e)}),e9=a.useMemo(function(){return e7},[e7.join("_")]),te=(no=eF.length,(0,a.useMemo)(function(){for(var e=[],t=[],n=0,r=0,o=0;o<no;o+=1)if("rtl"===y){t[o]=r,r+=e9[o]||0;var a=no-o-1;e[a]=n,n+=e9[a]||0}else{e[o]=n,n+=e9[o]||0;var i=no-o-1;t[i]=r,r+=e9[i]||0}return{left:e,right:t}},[e9,no,y])),tt=g&&null!=g.y,tn=g&&null!=eq||!!ev.fixed,tr=tn&&eF.some(function(e){return e.fixed}),to=a.useRef(),ta=(nl=void 0===(ni=(na="object"===(0,E.Z)(Y)?Y:{}).offsetHeader)?0:ni,nc=void 0===(ns=na.offsetSummary)?0:ns,nd=void 0===(nu=na.offsetScroll)?0:nu,np=(void 0===(nf=na.getContainer)?function(){return eS}:nf)()||eS,a.useMemo(function(){var e=!!Y;return{isSticky:e,stickyClassName:e?"".concat(o,"-sticky-holder"):"",offsetHeader:nl,offsetSummary:nc,offsetScroll:nd,container:np}},[nd,nl,nc,o,np])),ti=ta.isSticky,tl=ta.offsetHeader,ts=ta.offsetSummary,tc=ta.offsetScroll,tu=ta.stickyClassName,td=ta.container,tf=a.useMemo(function(){return null==w?void 0:w(Q)},[w,Q]),tp=(tt||ti)&&a.isValidElement(tf)&&tf.type===F&&tf.props.fixed;tt&&(nm={overflowY:"scroll",maxHeight:g.y}),tn&&(nh={overflowX:"auto"},tt||(nm={overflowY:"hidden"}),ng={width:!0===eq?"auto":eq,minWidth:"100%"});var th=a.useCallback(function(e,t){(0,W.Z)(eU.current)&&e8(function(n){if(n.get(e)!==t){var r=new Map(n);return r.set(e,t),r}return n})},[]),tm=function(e){var t=(0,a.useRef)(null),n=(0,a.useRef)();function r(){window.clearTimeout(n.current)}return(0,a.useEffect)(function(){return r},[]),[function(e){t.current=e,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)},function(){return t.current}]}(0),tg=(0,s.Z)(tm,2),tv=tg[0],ty=tg[1];function tb(e,t){t&&("function"==typeof t?t(e):t.scrollLeft!==e&&(t.scrollLeft=e,t.scrollLeft!==e&&setTimeout(function(){t.scrollLeft=e},0)))}var tx=(0,c.Z)(function(e){var t,n=e.currentTarget,r=e.scrollLeft,o="rtl"===y,a="number"==typeof r?r:n.scrollLeft,i=n||eN;ty()&&ty()!==i||(tv(i),tb(a,eK.current),tb(a,e$.current),tb(a,eX.current),tb(a,null===(t=to.current)||void 0===t?void 0:t.setScrollLeft));var l=n||eK.current;if(l){var s=l.scrollWidth,c=l.clientWidth;if(s===c){eJ(!1),e6(!1);return}o?(eJ(-a<s-c),e6(-a>0)):(eJ(a>0),e6(a<s-c))}}),tw=function(){tn&&e$.current?tx({currentTarget:e$.current}):(eJ(!1),e6(!1))},tk=a.useRef(!1);a.useEffect(function(){tk.current&&tw()},[tn,p,eB.length]),a.useEffect(function(){tk.current=!0},[]);var tS=a.useState(0),tE=(0,s.Z)(tS,2),tO=tE[0],tC=tE[1],tj=a.useState(!0),t_=(0,s.Z)(tj,2),tP=t_[0],tN=t_[1];a.useEffect(function(){X&&ee||(e$.current instanceof Element?tC((0,K.o)(e$.current).width):tC((0,K.o)(eV.current).width)),tN((0,U.G)("position","sticky"))},[]),a.useEffect(function(){ee&&V&&(V.body.current=e$.current)});var tT=a.useCallback(function(e){return a.createElement(a.Fragment,null,a.createElement(ep,e),"top"===tp&&a.createElement(H,e,tf))},[tp,tf]),tA=a.useCallback(function(e){return a.createElement(H,e,tf)},[tf]),tM=et(["table"],"table"),tI=a.useMemo(function(){return v||(tr?"max-content"===eq?"auto":"fixed":tt||ti||eF.some(function(e){return e.ellipsis})?"fixed":"auto")},[tt,tr,eF,v,ti]),tR={colWidths:e9,columCount:eF.length,stickyOffsets:te,onHeaderRow:D,fixHeader:tt,scroll:g},tD=a.useMemo(function(){return J?null:"function"==typeof I?I():I},[J,I]),tL=a.createElement(er,{data:Q,measureColumnWidth:tt||tn||ti}),tZ=a.createElement(el,{colWidths:eF.map(function(e){return e.width}),columns:eF}),tz=null!=k?a.createElement("caption",{className:"".concat(o,"-caption")},k):void 0,tB=(0,$.Z)(r,{data:!0}),tF=(0,$.Z)(r,{aria:!0});if(tt||ti){"function"==typeof ea?(ny=ea(Q,{scrollbarSize:tO,ref:e$,onScroll:tx}),tR.colWidths=eF.map(function(e,t){var n=e.width,r=t===eF.length-1?n-tO:n;return"number"!=typeof r||Number.isNaN(r)?0:r})):ny=a.createElement("div",{style:(0,O.Z)((0,O.Z)({},nh),nm),onScroll:tx,ref:e$,className:_()("".concat(o,"-body"))},a.createElement(tM,(0,m.Z)({style:(0,O.Z)((0,O.Z)({},ng),{},{tableLayout:tI})},tF),tz,tZ,tL,!tp&&tf&&a.createElement(H,{stickyOffsets:te,flattenColumns:eF,columns:eB},tf)));var tH,tq,tW,tU,tK,t$,tV,tX,tG,tY,tQ,tJ,t0,t1,t2,t6,t4,t3,t5,t8,t7,t9,ne,nt,nn,nr,no,na,ni,nl,ns,nc,nu,nd,nf,np,nh,nm,ng,nv,ny,nb=(0,O.Z)((0,O.Z)((0,O.Z)({noData:!Q.length,maxContentScroll:tn&&"max-content"===eq},tR),eW),{},{direction:y,stickyClassName:tu,onScroll:tx});nv=a.createElement(a.Fragment,null,!1!==T&&a.createElement(ed,(0,m.Z)({},nb,{stickyTopOffset:tl,className:"".concat(o,"-header"),ref:eK}),tT),ny,tp&&"top"!==tp&&a.createElement(ed,(0,m.Z)({},nb,{stickyBottomOffset:ts,className:"".concat(o,"-summary"),ref:eX}),tA),ti&&e$.current&&e$.current instanceof Element&&a.createElement(ej,{ref:to,offsetScroll:tc,scrollBodyRef:e$,onScroll:tx,container:td}))}else nv=a.createElement("div",{style:(0,O.Z)((0,O.Z)({},nh),nm),className:_()("".concat(o,"-content")),onScroll:tx,ref:e$},a.createElement(tM,(0,m.Z)({style:(0,O.Z)((0,O.Z)({},ng),{},{tableLayout:tI})},tF),tz,tZ,!1!==T&&a.createElement(ep,(0,m.Z)({},tR,eW)),tL,tf&&a.createElement(H,{stickyOffsets:te,flattenColumns:eF,columns:eB},tf)));var nx=a.createElement("div",(0,m.Z)({className:_()(o,i,(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},"".concat(o,"-rtl"),"rtl"===y),"".concat(o,"-ping-left"),eQ),"".concat(o,"-ping-right"),e2),"".concat(o,"-layout-fixed"),"fixed"===v),"".concat(o,"-fixed-header"),tt),"".concat(o,"-fixed-column"),tr),"".concat(o,"-scroll-horizontal"),tn),"".concat(o,"-has-fix-left"),eF[0]&&eF[0].fixed),"".concat(o,"-has-fix-right"),eF[eF.length-1]&&"right"===eF[eF.length-1].fixed)),style:f,id:j,ref:eU},tB),b&&a.createElement(eE,{className:"".concat(o,"-title")},b(Q)),a.createElement("div",{ref:eV,className:"".concat(o,"-container")},nv),x&&a.createElement(eE,{className:"".concat(o,"-footer")},x(Q)));tn&&(nx=a.createElement(q.Z,{onResize:function(e){var t=e.width,n=eU.current?eU.current.offsetWidth:t;ee&&G&&eU.current&&(n=G(eU.current,n)||n),n!==eD&&(tw(),eL(n))}},nx));var nw=(n=eF.map(function(e,t){return L(t,t,eF,te,y,null==eB?void 0:eB[t])}),(0,P.Z)(function(){return n},[n],function(e,t){return!(0,d.Z)(e,t)})),nk=a.useMemo(function(){return{scrollX:eq,prefixCls:o,getComponent:et,scrollbarSize:tO,direction:y,fixedInfoList:nw,isSticky:ti,supportSticky:tP,componentWidth:eD,fixHeader:tt,fixColumn:tr,horizonScroll:tn,tableLayout:tI,rowClassName:u,expandedRowClassName:ev.expandedRowClassName,expandIcon:eO,expandableType:ey,expandRowByClick:ev.expandRowByClick,expandedRowRender:ev.expandedRowRender,onTriggerExpand:eA,expandIconColumnIndex:ev.expandIconColumnIndex,indentSize:ev.indentSize,allColumnsFixedLeft:eF.every(function(e){return"left"===e.fixed}),emptyNode:tD,columns:eB,flattenColumns:eF,onColumnResize:th,hoverStartRow:eu,hoverEndRow:ef,onHover:eh,rowExpandable:ev.rowExpandable,onRow:R,getRowKey:en,expandedKeys:eb,childrenColumnName:eC}},[eq,o,et,tO,y,nw,ti,tP,eD,tt,tr,tn,tI,u,ev.expandedRowClassName,eO,ey,ev.expandRowByClick,ev.expandedRowRender,eA,ev.expandIconColumnIndex,ev.indentSize,tD,eB,eF,th,eu,ef,eh,ev.rowExpandable,R,en,eb,eC]);return a.createElement(S.Provider,{value:nk},nx)}),eM=x(eA,void 0);eM.EXPAND_COLUMN=i,eM.INTERNAL_HOOKS=l,eM.Column=function(e){return null},eM.ColumnGroup=function(e){return null},eM.Summary=F;var eI=n(48625),eR=p(null),eD=p(null),eL=function(e){var t,n=e.rowInfo,r=e.column,o=e.colIndex,i=e.indent,l=e.index,s=e.renderIndex,c=e.record,u=e.style,d=e.className,f=e.inverse,p=e.getHeight,g=r.render,v=r.dataIndex,y=r.className,b=r.width,x=h(eD,["columnsOffset"]).columnsOffset,w=Y(n,r,o,i,l),k=w.key,S=w.fixedInfo,E=w.appendCellNode,C=w.additionalCellProps,j=C.style,P=C.colSpan,N=void 0===P?1:P,T=C.rowSpan,A=void 0===T?1:T,M=x[(t=o-1)+(N||1)]-(x[t]||0),I=(0,O.Z)((0,O.Z)((0,O.Z)({},j),u),{},{flex:"0 0 ".concat(M,"px"),width:"".concat(M,"px"),marginRight:N>1?b-M:0,pointerEvents:"auto"}),R=a.useMemo(function(){return f?A<=1:0===N||0===A||A>1},[A,N,f]);R?I.visibility="hidden":f&&(I.height=null==p?void 0:p(A));var L={};return(0===A||0===N)&&(L.rowSpan=1,L.colSpan=1),a.createElement(D,(0,m.Z)({className:_()(y,d),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:"div",prefixCls:n.prefixCls,key:k,record:c,index:l,renderIndex:s,dataIndex:v,render:R?function(){return null}:g,shouldCellUpdate:r.shouldCellUpdate},S,{appendNode:E,additionalProps:(0,O.Z)((0,O.Z)({},C),{},{style:I},L)}))},eZ=["data","index","className","rowKey","style","extra","getHeight"],ez=w(a.forwardRef(function(e,t){var n,r=e.data,o=e.index,i=e.className,l=e.rowKey,s=e.style,c=e.extra,u=e.getHeight,d=(0,z.Z)(e,eZ),f=r.record,p=r.indent,g=r.index,v=h(S,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),y=v.scrollX,b=v.flattenColumns,x=v.prefixCls,w=v.fixColumn,k=v.componentWidth,E=X(f,l,o,p),j=E.rowSupportExpand,P=E.expanded,N=E.rowProps,T=E.expandedRowRender,A=E.expandedRowClassName;if(j&&P){var M=T(f,o,p+1,P),I=null==A?void 0:A(f,o,p),R={};w&&(R={style:(0,C.Z)({},"--virtual-width","".concat(k,"px"))});var L="".concat(x,"-expanded-row-cell");n=a.createElement("div",{className:_()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(p+1),I)},a.createElement(D,{component:"div",prefixCls:x,className:_()(L,(0,C.Z)({},"".concat(L,"-fixed"),w)),additionalProps:R},M))}var Z=(0,O.Z)((0,O.Z)({},s),{},{width:y});c&&(Z.position="absolute",Z.pointerEvents="none");var B=a.createElement("div",(0,m.Z)({},N,d,{ref:j?null:t,className:_()(i,"".concat(x,"-row"),null==N?void 0:N.className,(0,C.Z)({},"".concat(x,"-row-extra"),c)),style:(0,O.Z)((0,O.Z)({},Z),null==N?void 0:N.style)}),b.map(function(e,t){return a.createElement(eL,{key:t,rowInfo:E,column:e,colIndex:t,indent:p,index:o,renderIndex:g,record:f,inverse:c,getHeight:u})}));return j?a.createElement("div",{ref:t},B,n):B})),eB=w(a.forwardRef(function(e,t){var n,r=e.data,o=e.onScroll,i=h(S,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","emptyNode","scrollX"]),l=i.flattenColumns,c=i.onColumnResize,u=i.getRowKey,d=i.expandedKeys,f=i.prefixCls,p=i.childrenColumnName,g=i.emptyNode,v=i.scrollX,y=h(eR),b=y.sticky,x=y.scrollY,w=y.listItemHeight,k=a.useRef(),O=V(r,p,d,u),C=a.useMemo(function(){var e=0;return l.map(function(t){var n=t.width,r=t.key;return e+=n,[r,n,e]})},[l]),j=a.useMemo(function(){return C.map(function(e){return e[2]})},[C]);a.useEffect(function(){C.forEach(function(e){var t=(0,s.Z)(e,2);c(t[0],t[1])})},[C]),a.useImperativeHandle(t,function(){var e={scrollTo:function(e){var t;null===(t=k.current)||void 0===t||t.scrollTo(e)}};return Object.defineProperty(e,"scrollLeft",{get:function(){var e;return(null===(e=k.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=k.current)||void 0===t||t.scrollTo({left:e})}}),e});var P=function(e,t){var n=null===(o=O[t])||void 0===o?void 0:o.record,r=e.onCell;if(r){var o,a,i=r(n,t);return null!==(a=null==i?void 0:i.rowSpan)&&void 0!==a?a:1}return 1},N=a.useMemo(function(){return{columnsOffset:j}},[j]),T="".concat(f,"-tbody");if(O.length){var A={};b&&(A.position="sticky",A.bottom=0,"object"===(0,E.Z)(b)&&b.offsetScroll&&(A.bottom=b.offsetScroll)),n=a.createElement(eI.Z,{fullHeight:!1,ref:k,styles:{horizontalScrollBar:A},className:_()(T,"".concat(T,"-virtual")),height:x,itemHeight:w||24,data:O,itemKey:function(e){return u(e.record)},scrollWidth:v,onVirtualScroll:function(e){o({scrollLeft:e.x})},extraRender:function(e){var t=e.start,n=e.end,r=e.getSize,o=e.offsetY;if(n<0)return null;for(var i=l.filter(function(e){return 0===P(e,t)}),s=t,c=function(e){if(!(i=i.filter(function(t){return 0===P(t,e)})).length)return s=e,1},d=t;d>=0&&!c(d);d-=1);for(var f=l.filter(function(e){return 1!==P(e,n)}),p=n,h=function(e){if(!(f=f.filter(function(t){return 1!==P(t,e)})).length)return p=Math.max(e-1,n),1},m=n;m<O.length&&!h(m);m+=1);for(var g=[],v=function(e){if(!O[e])return 1;l.some(function(t){return P(t,e)>1})&&g.push(e)},y=s;y<=p;y+=1)if(v(y))continue;return g.map(function(e){var t=O[e],n=u(t.record,e),i=r(n);return a.createElement(ez,{key:e,data:t,rowKey:n,index:e,style:{top:-o+i.top},extra:!0,getHeight:function(t){var o=e+t-1,a=r(n,u(O[o].record,o));return a.bottom-a.top}})})}},function(e,t,n){var r=u(e.record,t);return a.createElement(ez,(0,m.Z)({data:e,rowKey:r,index:t},n))})}else n=a.createElement("div",{className:_()("".concat(f,"-placeholder"))},a.createElement(D,{component:"div",prefixCls:f},g));return a.createElement(eD.Provider,{value:N},n)})),eF=function(e,t){var n=t.ref,r=t.onScroll;return a.createElement(eB,{ref:n,data:e,onScroll:r})},eH=a.forwardRef(function(e,t){var n=e.columns,r=e.scroll,o=e.sticky,i=e.prefixCls,s=void 0===i?e_:i,c=e.className,u=e.listItemHeight,d=e.components,f=r||{},p=f.x,h=f.y;"number"!=typeof p&&(p=1),"number"!=typeof h&&(h=500);var g=a.useMemo(function(){return{sticky:o,scrollY:h,listItemHeight:u}},[o,h,u]);return a.createElement(eR.Provider,{value:g},a.createElement(eM,(0,m.Z)({},e,{className:_()(c,"".concat(s,"-virtual")),scroll:(0,O.Z)((0,O.Z)({},r),{},{x:p}),components:(0,O.Z)((0,O.Z)({},d),{},{body:eF}),columns:n,internalHooks:l,tailor:!0,ref:t})))});x(eH,void 0);var eq=n(70464),eW=n(76405),eU=n(25049),eK=n(63496),e$=n(15354),eV=n(15900),eX=a.createContext(null),eG=a.memo(function(e){for(var t,n=e.prefixCls,r=e.level,o=e.isStart,i=e.isEnd,l="".concat(n,"-indent-unit"),s=[],c=0;c<r;c+=1)s.push(a.createElement("span",{key:c,className:_()(l,(t={},(0,C.Z)(t,"".concat(l,"-start"),o[c]),(0,C.Z)(t,"".concat(l,"-end"),i[c]),t))}));return a.createElement("span",{"aria-hidden":"true",className:"".concat(n,"-indent")},s)}),eY=n(18694),eQ=["children"];function eJ(e,t){return"".concat(e,"-").concat(t)}function e0(e,t){return null!=e?e:t}function e1(e){var t=e||{},n=t.title,r=t._title,o=t.key,a=t.children,i=n||"title";return{title:i,_title:r||[i],key:o||"key",children:a||"children"}}function e2(e){return function e(t){return(0,eh.Z)(t).map(function(t){if(!(t&&t.type&&t.type.isTreeNode))return(0,T.ZP)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,r=t.props,o=r.children,a=(0,z.Z)(r,eQ),i=(0,O.Z)({key:n},a),l=e(o);return l.length&&(i.children=l),i}).filter(function(e){return e})}(e)}function e6(e,t,n){var r=e1(n),o=r._title,a=r.key,i=r.children,l=new Set(!0===t?[]:t),s=[];return!function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(c,u){for(var d,f=eJ(r?r.pos:"0",u),p=e0(c[a],f),h=0;h<o.length;h+=1){var m=o[h];if(void 0!==c[m]){d=c[m];break}}var g=(0,O.Z)((0,O.Z)({},(0,eY.Z)(c,[].concat((0,es.Z)(o),[a,i]))),{},{title:d,key:p,parent:r,pos:f,children:null,data:c,isStart:[].concat((0,es.Z)(r?r.isStart:[]),[0===u]),isEnd:[].concat((0,es.Z)(r?r.isEnd:[]),[u===n.length-1])});return s.push(g),!0===t||l.has(p)?g.children=e(c[i]||[],g):g.children=[],g})}(e),s}function e4(e){var t,n,r,o,a,i,l,s,c,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=d.initWrapper,p=d.processEntity,h=d.onProcessFinished,m=d.externalGetKey,g=d.childrenPropName,v=d.fieldNames,y=arguments.length>2?arguments[2]:void 0,b={},x={},w={posEntities:b,keyEntities:x};return f&&(w=f(w)||w),t=function(e){var t=e.node,n=e.index,r=e.pos,o=e.key,a=e.parentPos,i=e.level,l={node:t,nodes:e.nodes,index:n,key:o,pos:r,level:i},s=e0(o,r);b[r]=l,x[s]=l,l.parent=b[a],l.parent&&(l.parent.children=l.parent.children||[],l.parent.children.push(l)),p&&p(l,w)},n={externalGetKey:m||y,childrenPropName:g,fieldNames:v},a=(o=("object"===(0,E.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,i=o.externalGetKey,s=(l=e1(o.fieldNames)).key,c=l.children,u=a||c,i?"string"==typeof i?r=function(e){return e[i]}:"function"==typeof i&&(r=function(e){return i(e)}):r=function(e,t){return e0(e[s],t)},function n(o,a,i,l){var s=o?o[u]:e,c=o?eJ(i.pos,a):"0",d=o?[].concat((0,es.Z)(l),[o]):[];if(o){var f=r(o,c);t({node:o,index:a,pos:c,key:f,parentPos:i.node?i.pos:null,level:i.level+1,nodes:d})}s&&s.forEach(function(e,t){n(e,t,{node:o,pos:c,level:i?i.level+1:-1},d)})}(null),h&&h(w),w}function e3(e,t){var n=t.expandedKeys,r=t.selectedKeys,o=t.loadedKeys,a=t.loadingKeys,i=t.checkedKeys,l=t.halfCheckedKeys,s=t.dragOverNodeKey,c=t.dropPosition,u=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==r.indexOf(e),loaded:-1!==o.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==i.indexOf(e),halfChecked:-1!==l.indexOf(e),pos:String(u?u.pos:""),dragOver:s===e&&0===c,dragOverGapTop:s===e&&-1===c,dragOverGapBottom:s===e&&1===c}}function e5(e){var t=e.data,n=e.expanded,r=e.selected,o=e.checked,a=e.loaded,i=e.loading,l=e.halfChecked,s=e.dragOver,c=e.dragOverGapTop,u=e.dragOverGapBottom,d=e.pos,f=e.active,p=e.eventKey,h=(0,O.Z)((0,O.Z)({},t),{},{expanded:n,selected:r,checked:o,loaded:a,loading:i,halfChecked:l,dragOver:s,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:f,key:p});return"props"in h||Object.defineProperty(h,"props",{get:function(){return(0,T.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),h}var e8=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e7="open",e9="close",te=function(e){(0,e$.Z)(n,e);var t=(0,eV.Z)(n);function n(){var e;(0,eW.Z)(this,n);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={dragNodeHighlight:!1},e.selectHandle=void 0,e.cacheIndent=void 0,e.onSelectorClick=function(t){(0,e.props.context.onNodeClick)(t,e5(e.props)),e.isSelectable()?e.onSelect(t):e.onCheck(t)},e.onSelectorDoubleClick=function(t){(0,e.props.context.onNodeDoubleClick)(t,e5(e.props))},e.onSelect=function(t){e.isDisabled()||(0,e.props.context.onNodeSelect)(t,e5(e.props))},e.onCheck=function(t){if(!e.isDisabled()){var n=e.props,r=n.disableCheckbox,o=n.checked,a=e.props.context.onNodeCheck;e.isCheckable()&&!r&&a(t,e5(e.props),!o)}},e.onMouseEnter=function(t){(0,e.props.context.onNodeMouseEnter)(t,e5(e.props))},e.onMouseLeave=function(t){(0,e.props.context.onNodeMouseLeave)(t,e5(e.props))},e.onContextMenu=function(t){(0,e.props.context.onNodeContextMenu)(t,e5(e.props))},e.onDragStart=function(t){var n=e.props.context.onNodeDragStart;t.stopPropagation(),e.setState({dragNodeHighlight:!0}),n(t,(0,eK.Z)(e));try{t.dataTransfer.setData("text/plain","")}catch(e){}},e.onDragEnter=function(t){var n=e.props.context.onNodeDragEnter;t.preventDefault(),t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragOver=function(t){var n=e.props.context.onNodeDragOver;t.preventDefault(),t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragLeave=function(t){var n=e.props.context.onNodeDragLeave;t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragEnd=function(t){var n=e.props.context.onNodeDragEnd;t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,eK.Z)(e))},e.onDrop=function(t){var n=e.props.context.onNodeDrop;t.preventDefault(),t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,eK.Z)(e))},e.onExpand=function(t){var n=e.props,r=n.loading,o=n.context.onNodeExpand;r||o(t,e5(e.props))},e.setSelectHandle=function(t){e.selectHandle=t},e.getNodeState=function(){var t=e.props.expanded;return e.isLeaf()?null:t?e7:e9},e.hasChildren=function(){var t=e.props.eventKey;return!!((e.props.context.keyEntities[t]||{}).children||[]).length},e.isLeaf=function(){var t=e.props,n=t.isLeaf,r=t.loaded,o=e.props.context.loadData,a=e.hasChildren();return!1!==n&&(n||!o&&!a||o&&r&&!a)},e.isDisabled=function(){var t=e.props.disabled;return!!(e.props.context.disabled||t)},e.isCheckable=function(){var t=e.props.checkable,n=e.props.context.checkable;return!!n&&!1!==t&&n},e.syncLoadData=function(t){var n=t.expanded,r=t.loading,o=t.loaded,a=e.props.context,i=a.loadData,l=a.onNodeLoad;!r&&(!i||!n||e.isLeaf()||e.hasChildren()||o||l(e5(e.props)))},e.isDraggable=function(){var t=e.props,n=t.data,r=t.context.draggable;return!!(r&&(!r.nodeDraggable||r.nodeDraggable(n)))},e.renderDragHandler=function(){var t=e.props.context,n=t.draggable,r=t.prefixCls;return(null==n?void 0:n.icon)?a.createElement("span",{className:"".concat(r,"-draggable-icon")},n.icon):null},e.renderSwitcherIconDom=function(t){var n=e.props.switcherIcon,r=e.props.context.switcherIcon,o=n||r;return"function"==typeof o?o((0,O.Z)((0,O.Z)({},e.props),{},{isLeaf:t})):o},e.renderSwitcher=function(){var t=e.props.expanded,n=e.props.context.prefixCls;if(e.isLeaf()){var r=e.renderSwitcherIconDom(!0);return!1!==r?a.createElement("span",{className:_()("".concat(n,"-switcher"),"".concat(n,"-switcher-noop"))},r):null}var o=_()("".concat(n,"-switcher"),"".concat(n,"-switcher_").concat(t?e7:e9)),i=e.renderSwitcherIconDom(!1);return!1!==i?a.createElement("span",{onClick:e.onExpand,className:o},i):null},e.renderCheckbox=function(){var t=e.props,n=t.checked,r=t.halfChecked,o=t.disableCheckbox,i=e.props.context.prefixCls,l=e.isDisabled(),s=e.isCheckable();return s?a.createElement("span",{className:_()("".concat(i,"-checkbox"),n&&"".concat(i,"-checkbox-checked"),!n&&r&&"".concat(i,"-checkbox-indeterminate"),(l||o)&&"".concat(i,"-checkbox-disabled")),onClick:e.onCheck},"boolean"!=typeof s?s:null):null},e.renderIcon=function(){var t=e.props.loading,n=e.props.context.prefixCls;return a.createElement("span",{className:_()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(e.getNodeState()||"docu"),t&&"".concat(n,"-icon_loading"))})},e.renderSelector=function(){var t,n,r=e.state.dragNodeHighlight,o=e.props,i=o.title,l=void 0===i?"---":i,s=o.selected,c=o.icon,u=o.loading,d=o.data,f=e.props.context,p=f.prefixCls,h=f.showIcon,m=f.icon,g=f.loadData,v=f.titleRender,y=e.isDisabled(),b="".concat(p,"-node-content-wrapper");if(h){var x=c||m;t=x?a.createElement("span",{className:_()("".concat(p,"-iconEle"),"".concat(p,"-icon__customize"))},"function"==typeof x?x(e.props):x):e.renderIcon()}else g&&u&&(t=e.renderIcon());n="function"==typeof l?l(d):v?v(d):l;var w=a.createElement("span",{className:"".concat(p,"-title")},n);return a.createElement("span",{ref:e.setSelectHandle,title:"string"==typeof l?l:"",className:_()("".concat(b),"".concat(b,"-").concat(e.getNodeState()||"normal"),!y&&(s||r)&&"".concat(p,"-node-selected")),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onContextMenu:e.onContextMenu,onClick:e.onSelectorClick,onDoubleClick:e.onSelectorDoubleClick},t,w,e.renderDropIndicator())},e.renderDropIndicator=function(){var t=e.props,n=t.disabled,r=t.eventKey,o=e.props.context,a=o.draggable,i=o.dropLevelOffset,l=o.dropPosition,s=o.prefixCls,c=o.indent,u=o.dropIndicatorRender,d=o.dragOverNodeKey,f=o.direction,p=null!=c?c:e.cacheIndent;return e.cacheIndent=c,!n&&a&&d===r?u({dropPosition:l,dropLevelOffset:i,indent:p,prefixCls:s,direction:f}):null},e}return(0,eU.Z)(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var e=this.props.selectable,t=this.props.context.selectable;return"boolean"==typeof e?e:t}},{key:"render",value:function(){var e,t=this.props,n=t.eventKey,r=t.className,o=t.style,i=t.dragOver,l=t.dragOverGapTop,s=t.dragOverGapBottom,c=t.isLeaf,u=t.isStart,d=t.isEnd,f=t.expanded,p=t.selected,h=t.checked,g=t.halfChecked,v=t.loading,y=t.domRef,b=t.active,x=(t.data,t.onMouseMove),w=t.selectable,k=(0,z.Z)(t,e8),S=this.props.context,E=S.prefixCls,O=S.filterTreeNode,j=S.keyEntities,P=S.dropContainerKey,N=S.dropTargetKey,T=S.draggingNodeKey,A=this.isDisabled(),M=(0,$.Z)(k,{aria:!0,data:!0}),I=(j[n]||{}).level,R=d[d.length-1],D=this.isDraggable(),L=!A&&D,Z=T===n;return a.createElement("div",(0,m.Z)({ref:y,className:_()(r,"".concat(E,"-treenode"),(e={},(0,C.Z)(e,"".concat(E,"-treenode-disabled"),A),(0,C.Z)(e,"".concat(E,"-treenode-switcher-").concat(f?"open":"close"),!c),(0,C.Z)(e,"".concat(E,"-treenode-checkbox-checked"),h),(0,C.Z)(e,"".concat(E,"-treenode-checkbox-indeterminate"),g),(0,C.Z)(e,"".concat(E,"-treenode-selected"),p),(0,C.Z)(e,"".concat(E,"-treenode-loading"),v),(0,C.Z)(e,"".concat(E,"-treenode-active"),b),(0,C.Z)(e,"".concat(E,"-treenode-leaf-last"),R),(0,C.Z)(e,"".concat(E,"-treenode-draggable"),D),(0,C.Z)(e,"dragging",Z),(0,C.Z)(e,"drop-target",N===n),(0,C.Z)(e,"drop-container",P===n),(0,C.Z)(e,"drag-over",!A&&i),(0,C.Z)(e,"drag-over-gap-top",!A&&l),(0,C.Z)(e,"drag-over-gap-bottom",!A&&s),(0,C.Z)(e,"filter-node",O&&O(e5(this.props))),e)),style:o,draggable:L,"aria-grabbed":Z,onDragStart:L?this.onDragStart:void 0,onDragEnter:D?this.onDragEnter:void 0,onDragOver:D?this.onDragOver:void 0,onDragLeave:D?this.onDragLeave:void 0,onDrop:D?this.onDrop:void 0,onDragEnd:D?this.onDragEnd:void 0,onMouseMove:x},void 0!==w?{"aria-selected":!!w}:void 0,M),a.createElement(eG,{prefixCls:E,level:I,isStart:u,isEnd:d}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(a.Component),tt=function(e){return a.createElement(eX.Consumer,null,function(t){return a.createElement(te,(0,m.Z)({},e,{context:t}))})};function tn(e,t){if(!e)return[];var n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function tr(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function to(e){return e.split("-")}function ta(e,t,n,r,o,a,i,l,s,c){var u,d,f=e.clientX,p=e.clientY,h=e.target.getBoundingClientRect(),m=h.top,g=h.height,v=(("rtl"===c?-1:1)*(((null==o?void 0:o.x)||0)-f)-12)/r,y=l[n.props.eventKey];if(p<m+g/2){var b=i.findIndex(function(e){return e.key===y.key});y=l[i[b<=0?0:b-1].key]}var x=y.key,w=y,k=y.key,S=0,E=0;if(!s.includes(x))for(var O=0;O<v;O+=1)if(function(e){if(e.parent){var t=to(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}(y))y=y.parent,E+=1;else break;var C=t.props.data,j=y.node,_=!0;return 0===Number((u=to(y.pos))[u.length-1])&&0===y.level&&p<m+g/2&&a({dragNode:C,dropNode:j,dropPosition:-1})&&y.key===n.props.eventKey?S=-1:(w.children||[]).length&&s.includes(k)?a({dragNode:C,dropNode:j,dropPosition:0})?S=0:_=!1:0===E?v>-1.5?a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1:a({dragNode:C,dropNode:j,dropPosition:0})?S=0:a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1:a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1,{dropPosition:S,dropLevelOffset:E,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:k,dropContainerKey:0===S?null:(null===(d=y.parent)||void 0===d?void 0:d.key)||null,dropAllowed:_}}function ti(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function tl(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,E.Z)(e))return(0,T.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function ts(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(r){if(!n.has(r)){var o=t[r];if(o){n.add(r);var a=o.parent;!o.node.disabled&&a&&e(a.key)}}}(e)}),(0,es.Z)(n)}function tc(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function tu(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,o=t.checkable;return!!(n||r)||!1===o}function td(e,t,n,r){var o,a=[];o=r||tu;var i=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),l=new Map,s=0;return Object.keys(n).forEach(function(e){var t=n[e],r=t.level,o=l.get(r);o||(o=new Set,l.set(r,o)),o.add(t),s=Math.max(s,r)}),(0,T.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,r){for(var o=new Set(e),a=new Set,i=0;i<=n;i+=1)(t.get(i)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,i=void 0===a?[]:a;o.has(t)&&!r(n)&&i.filter(function(e){return!r(e.node)}).forEach(function(e){o.add(e.key)})});for(var l=new Set,s=n;s>=0;s-=1)(t.get(s)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||l.has(e.parent.key))){if(r(e.parent.node)){l.add(t.key);return}var n=!0,i=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=o.has(t);n&&!r&&(n=!1),!i&&(r||a.has(t))&&(i=!0)}),n&&o.add(t.key),i&&a.add(t.key),l.add(t.key)}});return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(tc(a,o))}}(i,l,s,o):function(e,t,n,r,o){for(var a=new Set(e),i=new Set(t),l=0;l<=r;l+=1)(n.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,r=e.children,l=void 0===r?[]:r;a.has(t)||i.has(t)||o(n)||l.filter(function(e){return!o(e.node)}).forEach(function(e){a.delete(e.key)})});i=new Set;for(var s=new Set,c=r;c>=0;c-=1)(n.get(c)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||s.has(e.parent.key))){if(o(e.parent.node)){s.add(t.key);return}var n=!0,r=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=a.has(t);n&&!o&&(n=!1),!r&&(o||i.has(t))&&(r=!0)}),n||a.delete(t.key),r&&i.add(t.key),s.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(tc(i,a))}}(i,t.halfCheckedKeys,l,s,o)}tt.displayName="TreeNode",tt.isTreeNode=1;var tf=n(50506),tp=n(13613),th=n(61994),tm=n(80795),tg=n(29967);let tv={},ty="SELECT_ALL",tb="SELECT_INVERT",tx="SELECT_NONE",tw=[],tk=(e,t)=>{let n=[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&(n=[].concat((0,es.Z)(n),(0,es.Z)(tk(e,t[e]))))}),n};var tS=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:r,defaultSelectedRowKeys:o,getCheckboxProps:i,onChange:l,onSelect:s,onSelectAll:c,onSelectInvert:u,onSelectNone:d,onSelectMultiple:f,columnWidth:p,type:h,selections:m,fixed:g,renderCell:v,hideSelectAll:y,checkStrictly:b=!0}=t||{},{prefixCls:x,data:w,pageData:k,getRecordByKey:S,getRowKey:E,expandType:O,childrenColumnName:C,locale:j,getPopupContainer:P}=e,N=(0,tp.ln)("Table"),[T,A]=function(e){let[t,n]=(0,a.useState)(null);return[(0,a.useCallback)((r,o,a)=>{let i=null!=t?t:r,l=Math.max(i||0,r),s=o.slice(Math.min(i||0,r),l+1).map(t=>e(t)),c=s.some(e=>!a.has(e)),u=[];return s.forEach(e=>{c?(a.has(e)||u.push(e),a.add(e)):(a.delete(e),u.push(e))}),n(c?l:null),u},[t]),e=>{n(e)}]}(e=>e),[M,I]=(0,tf.Z)(r||o||tw,{value:r}),R=a.useRef(new Map),D=(0,a.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=S(e);!n&&R.current.has(e)&&(n=R.current.get(e)),t.set(e,n)}),R.current=t}},[S,n]);a.useEffect(()=>{D(M)},[M]);let{keyEntities:L}=(0,a.useMemo)(()=>{if(b)return{keyEntities:null};let e=w;if(n){let t=new Set(w.map((e,t)=>E(e,t))),n=Array.from(R.current).reduce((e,n)=>{let[r,o]=n;return t.has(r)?e:e.concat(o)},[]);e=[].concat((0,es.Z)(e),(0,es.Z)(n))}return e4(e,{externalGetKey:E,childrenPropName:C})},[w,E,b,C,n]),Z=(0,a.useMemo)(()=>tk(C,k),[C,k]),z=(0,a.useMemo)(()=>{let e=new Map;return Z.forEach((t,n)=>{let r=E(t,n),o=(i?i(t):null)||{};e.set(r,o)}),e},[Z,E,i]),B=(0,a.useCallback)(e=>{var t;return!!(null===(t=z.get(E(e)))||void 0===t?void 0:t.disabled)},[z,E]),[F,H]=(0,a.useMemo)(()=>{if(b)return[M||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=td(M,!0,L,B);return[e||[],t]},[M,b,L,B]),q=(0,a.useMemo)(()=>new Set("radio"===h?F.slice(0,1):F),[F,h]),W=(0,a.useMemo)(()=>"radio"===h?new Set:new Set(H),[H,h]);a.useEffect(()=>{t||I(tw)},[!!t]);let U=(0,a.useCallback)((e,t)=>{let r,o;D(e),n?(r=e,o=e.map(e=>R.current.get(e))):(r=[],o=[],e.forEach(e=>{let t=S(e);void 0!==t&&(r.push(e),o.push(t))})),I(r),null==l||l(r,o,{type:t})},[I,S,l,n]),K=(0,a.useCallback)((e,t,n,r)=>{if(s){let o=n.map(e=>S(e));s(S(e),t,o,r)}U(n,"single")},[s,S,U]),$=(0,a.useMemo)(()=>!m||y?null:(!0===m?[ty,tb,tx]:m).map(e=>e===ty?{key:"all",text:j.selectionAll,onSelect(){U(w.map((e,t)=>E(e,t)).filter(e=>{let t=z.get(e);return!(null==t?void 0:t.disabled)||q.has(e)}),"all")}}:e===tb?{key:"invert",text:j.selectInvert,onSelect(){let e=new Set(q);k.forEach((t,n)=>{let r=E(t,n),o=z.get(r);(null==o?void 0:o.disabled)||(e.has(r)?e.delete(r):e.add(r))});let t=Array.from(e);u&&(N.deprecated(!1,"onSelectInvert","onChange"),u(t)),U(t,"invert")}}:e===tx?{key:"none",text:j.selectNone,onSelect(){null==d||d(),U(Array.from(q).filter(e=>{let t=z.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null===(t=e.onSelect)||void 0===t||t.call.apply(t,[e].concat(r)),A(null)}})),[m,q,k,E,u,U]);return[(0,a.useCallback)(e=>{var n;let r,o,i;if(!t)return e.filter(e=>e!==tv);let l=(0,es.Z)(e),s=new Set(q),u=Z.map(E).filter(e=>!z.get(e).disabled),d=u.every(e=>s.has(e)),w=u.some(e=>s.has(e));if("radio"!==h){let e;if($){let t={getPopupContainer:P,items:$.map((e,t)=>{let{key:n,text:r,onSelect:o}=e;return{key:null!=n?n:t,onClick:()=>{null==o||o(u)},label:r}})};e=a.createElement("div",{className:"".concat(x,"-selection-extra")},a.createElement(tm.Z,{menu:t,getPopupContainer:P},a.createElement("span",null,a.createElement(eq.Z,null))))}let t=Z.map((e,t)=>{let n=E(e,t),r=z.get(n)||{};return Object.assign({checked:s.has(n)},r)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===Z.length,i=n&&t.every(e=>{let{checked:t}=e;return t}),l=n&&t.some(e=>{let{checked:t}=e;return t});o=a.createElement(th.Z,{checked:n?i:!!Z.length&&d,indeterminate:n?!i&&l:!d&&w,onChange:()=>{let e=[];d?u.forEach(t=>{s.delete(t),e.push(t)}):u.forEach(t=>{s.has(t)||(s.add(t),e.push(t))});let t=Array.from(s);null==c||c(!d,t.map(e=>S(e)),e.map(e=>S(e))),U(t,"all"),A(null)},disabled:0===Z.length||n,"aria-label":e?"Custom selection":"Select all",skipGroup:!0}),r=!y&&a.createElement("div",{className:"".concat(x,"-selection")},o,e)}if(i="radio"===h?(e,t,n)=>{let r=E(t,n),o=s.has(r);return{node:a.createElement(tg.ZP,Object.assign({},z.get(r),{checked:o,onClick:e=>e.stopPropagation(),onChange:e=>{s.has(r)||K(r,!0,[r],e.nativeEvent)}})),checked:o}}:(e,t,n)=>{var r;let o;let i=E(t,n),l=s.has(i),c=W.has(i),d=z.get(i);return o="nest"===O?c:null!==(r=null==d?void 0:d.indeterminate)&&void 0!==r?r:c,{node:a.createElement(th.Z,Object.assign({},d,{indeterminate:o,checked:l,skipGroup:!0,onClick:e=>e.stopPropagation(),onChange:e=>{let{nativeEvent:t}=e,{shiftKey:n}=t,r=u.findIndex(e=>e===i),o=F.some(e=>u.includes(e));if(n&&b&&o){let e=T(r,u,s),t=Array.from(s);null==f||f(!l,t.map(e=>S(e)),e.map(e=>S(e))),U(t,"multiple")}else if(b){let e=l?tn(F,i):tr(F,i);K(i,!l,e,t)}else{let{checkedKeys:e,halfCheckedKeys:n}=td([].concat((0,es.Z)(F),[i]),!0,L,B),r=e;if(l){let t=new Set(e);t.delete(i),r=td(Array.from(t),{checked:!1,halfCheckedKeys:n},L,B).checkedKeys}K(i,!l,r,t)}l?A(null):A(r)}})),checked:l}},!l.includes(tv)){if(0===l.findIndex(e=>{var t;return(null===(t=e[ea])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=l;l=[e,tv].concat((0,es.Z)(t))}else l=[tv].concat((0,es.Z)(l))}let k=l.indexOf(tv),C=(l=l.filter((e,t)=>e!==tv||t===k))[k-1],j=l[k+1],N=g;void 0===N&&((null==j?void 0:j.fixed)!==void 0?N=j.fixed:(null==C?void 0:C.fixed)!==void 0&&(N=C.fixed)),N&&C&&(null===(n=C[ea])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===C.fixed&&(C.fixed=N);let M=_()("".concat(x,"-selection-col"),{["".concat(x,"-selection-col-with-dropdown")]:m&&"checkbox"===h}),I={fixed:N,width:p,className:"".concat(x,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(o):t.columnTitle:r,render:(e,t,n)=>{let{node:r,checked:o}=i(e,t,n);return v?v(o,t,n,r):r},onCell:t.onCell,[ea]:{className:M}};return l.map(e=>e===tv?I:e)},[E,Z,t,F,q,W,p,$,O,z,f,K,B]),q]},tE=n(53346);function tO(e){return null!=e&&e===e.window}var tC=n(71744),tj=n(91086),t_=n(64024),tP=n(33759),tN=n(28617),tT=n(13823),tA={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},tM=n(55015),tI=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:tA}))}),tR={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},tD=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:tR}))}),tL=n(15327),tZ=n(77565),tz=n(95814),tB={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},tF=["10","20","50","100"],tH=function(e){var t=e.pageSizeOptions,n=void 0===t?tF:t,r=e.locale,o=e.changeSize,i=e.pageSize,l=e.goButton,c=e.quickGo,u=e.rootPrefixCls,d=e.selectComponentClass,f=e.selectPrefixCls,p=e.disabled,h=e.buildOptionText,m=a.useState(""),g=(0,s.Z)(m,2),v=g[0],y=g[1],b=function(){return!v||Number.isNaN(v)?void 0:Number(v)},x="function"==typeof h?h:function(e){return"".concat(e," ").concat(r.items_per_page)},w=function(e){""!==v&&(e.keyCode===tz.Z.ENTER||"click"===e.type)&&(y(""),null==c||c(b()))},k="".concat(u,"-options");if(!o&&!c)return null;var S=null,E=null,O=null;if(o&&d){var C=(n.some(function(e){return e.toString()===i.toString()})?n:n.concat([i.toString()]).sort(function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))})).map(function(e,t){return a.createElement(d.Option,{key:t,value:e.toString()},x(e))});S=a.createElement(d,{disabled:p,prefixCls:f,showSearch:!1,className:"".concat(k,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(i||n[0]).toString(),onChange:function(e){null==o||o(Number(e))},getPopupContainer:function(e){return e.parentNode},"aria-label":r.page_size,defaultOpen:!1},C)}return c&&(l&&(O="boolean"==typeof l?a.createElement("button",{type:"button",onClick:w,onKeyUp:w,disabled:p,className:"".concat(k,"-quick-jumper-button")},r.jump_to_confirm):a.createElement("span",{onClick:w,onKeyUp:w},l)),E=a.createElement("div",{className:"".concat(k,"-quick-jumper")},r.jump_to,a.createElement("input",{disabled:p,type:"text",value:v,onChange:function(e){y(e.target.value)},onKeyUp:w,onBlur:function(e){!l&&""!==v&&(y(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(u,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(u,"-item"))>=0)||null==c||c(b()))},"aria-label":r.page}),r.page,O)),a.createElement("li",{className:k},S,E)},tq=function(e){var t,n=e.rootPrefixCls,r=e.page,o=e.active,i=e.className,l=e.showTitle,s=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),f=_()(d,"".concat(d,"-").concat(r),(t={},(0,C.Z)(t,"".concat(d,"-active"),o),(0,C.Z)(t,"".concat(d,"-disabled"),!r),t),i),p=u(r,"page",a.createElement("a",{rel:"nofollow"},r));return p?a.createElement("li",{title:l?String(r):null,className:f,onClick:function(){s(r)},onKeyDown:function(e){c(e,s,r)},tabIndex:0},p):null},tW=function(e,t,n){return n};function tU(){}function tK(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function t$(e,t,n){return Math.floor((n-1)/(void 0===e?t:e))+1}var tV=function(e){var t,n,r,o,i,l=e.prefixCls,c=void 0===l?"rc-pagination":l,u=e.selectPrefixCls,d=e.className,f=e.selectComponentClass,p=e.current,h=e.defaultCurrent,g=e.total,v=void 0===g?0:g,y=e.pageSize,b=e.defaultPageSize,x=e.onChange,w=void 0===x?tU:x,k=e.hideOnSinglePage,S=e.showPrevNextJumpers,E=e.showQuickJumper,j=e.showLessItems,P=e.showTitle,N=void 0===P||P,T=e.onShowSizeChange,A=void 0===T?tU:T,M=e.locale,I=void 0===M?tB:M,R=e.style,D=e.totalBoundaryShowSizeChanger,L=e.disabled,Z=e.simple,z=e.showTotal,B=e.showSizeChanger,F=e.pageSizeOptions,H=e.itemRender,q=void 0===H?tW:H,W=e.jumpPrevIcon,U=e.jumpNextIcon,K=e.prevIcon,V=e.nextIcon,X=a.useRef(null),G=(0,tf.Z)(10,{value:y,defaultValue:void 0===b?10:b}),Y=(0,s.Z)(G,2),Q=Y[0],J=Y[1],ee=(0,tf.Z)(1,{value:p,defaultValue:void 0===h?1:h,postState:function(e){return Math.max(1,Math.min(e,t$(void 0,Q,v)))}}),et=(0,s.Z)(ee,2),en=et[0],er=et[1],eo=a.useState(en),ea=(0,s.Z)(eo,2),ei=ea[0],el=ea[1];(0,a.useEffect)(function(){el(en)},[en]);var es=Math.max(1,en-(j?3:5)),ec=Math.min(t$(void 0,Q,v),en+(j?3:5));function eu(t,n){var r=t||a.createElement("button",{type:"button","aria-label":n,className:"".concat(c,"-item-link")});return"function"==typeof t&&(r=a.createElement(t,(0,O.Z)({},e))),r}function ed(e){var t=e.target.value,n=t$(void 0,Q,v);return""===t?t:Number.isNaN(Number(t))?ei:t>=n?n:Number(t)}var ef=v>Q&&E;function ep(e){var t=ed(e);switch(t!==ei&&el(t),e.keyCode){case tz.Z.ENTER:eh(t);break;case tz.Z.UP:eh(t-1);break;case tz.Z.DOWN:eh(t+1)}}function eh(e){if(tK(e)&&e!==en&&tK(v)&&v>0&&!L){var t=t$(void 0,Q,v),n=e;return e>t?n=t:e<1&&(n=1),n!==ei&&el(n),er(n),null==w||w(n,Q),n}return en}var em=en>1,eg=en<t$(void 0,Q,v),ev=null!=B?B:v>(void 0===D?50:D);function ey(){em&&eh(en-1)}function eb(){eg&&eh(en+1)}function ex(){eh(es)}function ew(){eh(ec)}function ek(e,t){if("Enter"===e.key||e.charCode===tz.Z.ENTER||e.keyCode===tz.Z.ENTER){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];t.apply(void 0,r)}}function eS(e){("click"===e.type||e.keyCode===tz.Z.ENTER)&&eh(ei)}var eE=null,eO=(0,$.Z)(e,{aria:!0,data:!0}),eC=z&&a.createElement("li",{className:"".concat(c,"-total-text")},z(v,[0===v?0:(en-1)*Q+1,en*Q>v?v:en*Q])),ej=null,e_=t$(void 0,Q,v);if(k&&v<=Q)return null;var eP=[],eN={rootPrefixCls:c,onClick:eh,onKeyPress:ek,showTitle:N,itemRender:q,page:-1},eT=en-1>0?en-1:0,eA=en+1<e_?en+1:e_,eM=E&&E.goButton,eI=eM,eR=null;Z&&(eM&&(eI="boolean"==typeof eM?a.createElement("button",{type:"button",onClick:eS,onKeyUp:eS},I.jump_to_confirm):a.createElement("span",{onClick:eS,onKeyUp:eS},eM),eI=a.createElement("li",{title:N?"".concat(I.jump_to).concat(en,"/").concat(e_):null,className:"".concat(c,"-simple-pager")},eI)),eR=a.createElement("li",{title:N?"".concat(en,"/").concat(e_):null,className:"".concat(c,"-simple-pager")},a.createElement("input",{type:"text",value:ei,disabled:L,onKeyDown:function(e){(e.keyCode===tz.Z.UP||e.keyCode===tz.Z.DOWN)&&e.preventDefault()},onKeyUp:ep,onChange:ep,onBlur:function(e){eh(ed(e))},size:3}),a.createElement("span",{className:"".concat(c,"-slash")},"/"),e_));var eD=j?1:2;if(e_<=3+2*eD){e_||eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:"noPager",page:1,className:"".concat(c,"-item-disabled")})));for(var eL=1;eL<=e_;eL+=1)eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:eL,page:eL,active:en===eL})))}else{var eZ=j?I.prev_3:I.prev_5,ez=j?I.next_3:I.next_5,eB=q(es,"jump-prev",eu(W,"prev page")),eF=q(ec,"jump-next",eu(U,"next page"));(void 0===S||S)&&(eE=eB?a.createElement("li",{title:N?eZ:null,key:"prev",onClick:ex,tabIndex:0,onKeyDown:function(e){ek(e,ex)},className:_()("".concat(c,"-jump-prev"),(0,C.Z)({},"".concat(c,"-jump-prev-custom-icon"),!!W))},eB):null,ej=eF?a.createElement("li",{title:N?ez:null,key:"next",onClick:ew,tabIndex:0,onKeyDown:function(e){ek(e,ew)},className:_()("".concat(c,"-jump-next"),(0,C.Z)({},"".concat(c,"-jump-next-custom-icon"),!!U))},eF):null);var eH=Math.max(1,en-eD),eq=Math.min(en+eD,e_);en-1<=eD&&(eq=1+2*eD),e_-en<=eD&&(eH=e_-2*eD);for(var eW=eH;eW<=eq;eW+=1)eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:eW,page:eW,active:en===eW})));if(en-1>=2*eD&&3!==en&&(eP[0]=a.cloneElement(eP[0],{className:_()("".concat(c,"-item-after-jump-prev"),eP[0].props.className)}),eP.unshift(eE)),e_-en>=2*eD&&en!==e_-2){var eU=eP[eP.length-1];eP[eP.length-1]=a.cloneElement(eU,{className:_()("".concat(c,"-item-before-jump-next"),eU.props.className)}),eP.push(ej)}1!==eH&&eP.unshift(a.createElement(tq,(0,m.Z)({},eN,{key:1,page:1}))),eq!==e_&&eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:e_,page:e_})))}var eK=(t=q(eT,"prev",eu(K,"prev page")),a.isValidElement(t)?a.cloneElement(t,{disabled:!em}):t);if(eK){var e$=!em||!e_;eK=a.createElement("li",{title:N?I.prev_page:null,onClick:ey,tabIndex:e$?null:0,onKeyDown:function(e){ek(e,ey)},className:_()("".concat(c,"-prev"),(0,C.Z)({},"".concat(c,"-disabled"),e$)),"aria-disabled":e$},eK)}var eV=(n=q(eA,"next",eu(V,"next page")),a.isValidElement(n)?a.cloneElement(n,{disabled:!eg}):n);eV&&(Z?(o=!eg,i=em?0:null):i=(o=!eg||!e_)?null:0,eV=a.createElement("li",{title:N?I.next_page:null,onClick:eb,tabIndex:i,onKeyDown:function(e){ek(e,eb)},className:_()("".concat(c,"-next"),(0,C.Z)({},"".concat(c,"-disabled"),o)),"aria-disabled":o},eV));var eX=_()(c,d,(r={},(0,C.Z)(r,"".concat(c,"-simple"),Z),(0,C.Z)(r,"".concat(c,"-disabled"),L),r));return a.createElement("ul",(0,m.Z)({className:eX,style:R,ref:X},eO),eC,eK,Z?eR:eP,eV,a.createElement(tH,{locale:I,rootPrefixCls:c,disabled:L,selectComponentClass:f,selectPrefixCls:void 0===u?"rc-select":u,changeSize:ev?function(e){var t=t$(e,Q,v),n=en>t&&0!==t?t:en;J(e),el(n),null==A||A(en,e),er(n),null==w||w(n,e)}:null,pageSize:Q,pageSizeOptions:F,quickGo:ef?eh:null,goButton:eI}))},tX=n(96257),tG=n(55274),tY=n(52787);let tQ=e=>a.createElement(tY.default,Object.assign({},e,{showSearch:!0,size:"small"})),tJ=e=>a.createElement(tY.default,Object.assign({},e,{showSearch:!0,size:"middle"}));tQ.Option=tY.default.Option,tJ.Option=tY.default.Option;var t0=n(352),t1=n(31282),t2=n(37433),t6=n(12918),t4=n(3104),t3=n(80669),t5=n(65265);let t8=e=>{let{componentCls:t}=e;return{["".concat(t,"-disabled")]:{"&, &:hover":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},["&".concat(t,"-disabled")]:{cursor:"not-allowed",["".concat(t,"-item")]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},["".concat(t,"-simple&")]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},["".concat(t,"-simple-pager")]:{color:e.colorTextDisabled},["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{["".concat(t,"-item-link-icon")]:{opacity:0},["".concat(t,"-item-ellipsis")]:{opacity:1}}},["&".concat(t,"-simple")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&".concat(t,"-disabled ").concat(t,"-item-link")]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},t7=e=>{let{componentCls:t}=e;return{["&".concat(t,"-mini ").concat(t,"-total-text, &").concat(t,"-mini ").concat(t,"-simple-pager")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-item")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.calc(e.itemSizeSM).sub(2).equal())},["&".concat(t,"-mini:not(").concat(t,"-disabled) ").concat(t,"-item:not(").concat(t,"-item-active)")]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},["&".concat(t,"-mini ").concat(t,"-prev, &").concat(t,"-mini ").concat(t,"-next")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini:not(").concat(t,"-disabled)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover ").concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["\n &".concat(t,"-mini ").concat(t,"-prev ").concat(t,"-item-link,\n &").concat(t,"-mini ").concat(t,"-next ").concat(t,"-item-link\n ")]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}},["&".concat(t,"-mini ").concat(t,"-jump-prev, &").concat(t,"-mini ").concat(t,"-jump-next")]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-options")]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),input:Object.assign(Object.assign({},(0,t1.x0)(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},t9=e=>{let{componentCls:t}=e;return{["\n &".concat(t,"-simple ").concat(t,"-prev,\n &").concat(t,"-simple ").concat(t,"-next\n ")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),verticalAlign:"top",["".concat(t,"-item-link")]:{height:e.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}}},["&".concat(t,"-simple ").concat(t,"-simple-pager")]:{display:"inline-block",height:e.itemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:e.marginXS,padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),textAlign:"center",backgroundColor:e.itemInputBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadius,outline:"none",transition:"border-color ".concat(e.motionDurationMid),color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:"".concat((0,t0.bf)(e.inputOutlineOffset)," 0 ").concat((0,t0.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}}}},ne=e=>{let{componentCls:t}=e;return{["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{outline:0,["".concat(t,"-item-container")]:{position:"relative",["".concat(t,"-item-link-icon")]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:"all ".concat(e.motionDurationMid),"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},["".concat(t,"-item-ellipsis")]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:"all ".concat(e.motionDurationMid)}},"&:hover":{["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}}},["\n ".concat(t,"-prev,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{marginInlineEnd:e.marginXS},["\n ".concat(t,"-prev,\n ").concat(t,"-next,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:"".concat((0,t0.bf)(e.itemSize)),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:"all ".concat(e.motionDurationMid)},["".concat(t,"-prev, ").concat(t,"-next")]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},["".concat(t,"-item-link")]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:"none",transition:"all ".concat(e.motionDurationMid)},["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover")]:{["".concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["".concat(t,"-slash")]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},["".concat(t,"-options")]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:(0,t0.bf)(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},(0,t1.ik)(e)),(0,t5.$U)(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},(0,t5.Xy)(e)),width:e.calc(e.controlHeightLG).mul(1.25).equal(),height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},nt=e=>{let{componentCls:t}=e;return{["".concat(t,"-item")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),color:e.colorText,"&:hover":{textDecoration:"none"}},["&:not(".concat(t,"-item-active)")]:{"&:hover":{transition:"all ".concat(e.motionDurationMid),backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}}}},nn=e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,t6.Wf)(e)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},["".concat(t,"-total-text")]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),nt(e)),ne(e)),t9(e)),t7(e)),t8(e)),{["@media only screen and (max-width: ".concat(e.screenLG,"px)")]:{["".concat(t,"-item")]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},["@media only screen and (max-width: ".concat(e.screenSM,"px)")]:{["".concat(t,"-options")]:{display:"none"}}}),["&".concat(e.componentCls,"-rtl")]:{direction:"rtl"}}},nr=e=>{let{componentCls:t}=e;return{["".concat(t,":not(").concat(t,"-disabled)")]:{["".concat(t,"-item")]:Object.assign({},(0,t6.Qy)(e)),["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{"&:focus-visible":Object.assign({["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}},(0,t6.oN)(e))},["".concat(t,"-prev, ").concat(t,"-next")]:{["&:focus-visible ".concat(t,"-item-link")]:Object.assign({},(0,t6.oN)(e))}}}},no=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},(0,t2.T)(e)),na=e=>(0,t4.TS)(e,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,t2.e)(e));var ni=(0,t3.I$)("Pagination",e=>{let t=na(e);return[nn(t),nr(t)]},no),nl=n(29961);let ns=e=>{let{componentCls:t}=e;return{["".concat(t).concat(t,"-bordered").concat(t,"-disabled:not(").concat(t,"-mini)")]:{"&, &:hover":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},"&:focus-visible":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},["".concat(t,"-item, ").concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,["&:hover:not(".concat(t,"-item-active)")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},["&".concat(t,"-item-active")]:{backgroundColor:e.itemActiveBgDisabled}},["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},["".concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},["".concat(t).concat(t,"-bordered:not(").concat(t,"-mini)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},["".concat(t,"-item-link")]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},["&:hover ".concat(t,"-item-link")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},["&".concat(t,"-disabled")]:{["".concat(t,"-item-link")]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},["".concat(t,"-item")]:{backgroundColor:e.itemBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),["&:hover:not(".concat(t,"-item-active)")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}};var nc=(0,t3.bk)(["Pagination","bordered"],e=>[ns(na(e))],no),nu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},nd=e=>{let{prefixCls:t,selectPrefixCls:n,className:r,rootClassName:o,style:i,size:l,locale:s,selectComponentClass:c,responsive:u,showSizeChanger:d}=e,f=nu(e,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:p}=(0,tN.Z)(u),[,h]=(0,nl.ZP)(),{getPrefixCls:m,direction:g,pagination:v={}}=a.useContext(tC.E_),y=m("pagination",t),[b,x,w]=ni(y),k=null!=d?d:v.showSizeChanger,S=a.useMemo(()=>{let e=a.createElement("span",{className:"".concat(y,"-item-ellipsis")},"•••"),t=a.createElement("button",{className:"".concat(y,"-item-link"),type:"button",tabIndex:-1},"rtl"===g?a.createElement(tZ.Z,null):a.createElement(tL.Z,null));return{prevIcon:t,nextIcon:a.createElement("button",{className:"".concat(y,"-item-link"),type:"button",tabIndex:-1},"rtl"===g?a.createElement(tL.Z,null):a.createElement(tZ.Z,null)),jumpPrevIcon:a.createElement("a",{className:"".concat(y,"-item-link")},a.createElement("div",{className:"".concat(y,"-item-container")},"rtl"===g?a.createElement(tD,{className:"".concat(y,"-item-link-icon")}):a.createElement(tI,{className:"".concat(y,"-item-link-icon")}),e)),jumpNextIcon:a.createElement("a",{className:"".concat(y,"-item-link")},a.createElement("div",{className:"".concat(y,"-item-container")},"rtl"===g?a.createElement(tI,{className:"".concat(y,"-item-link-icon")}):a.createElement(tD,{className:"".concat(y,"-item-link-icon")}),e))}},[g,y]),[E]=(0,tG.Z)("Pagination",tX.Z),O=Object.assign(Object.assign({},E),s),C=(0,tP.Z)(l),j="small"===C||!!(p&&!C&&u),P=m("select",n),N=_()({["".concat(y,"-mini")]:j,["".concat(y,"-rtl")]:"rtl"===g,["".concat(y,"-bordered")]:h.wireframe},null==v?void 0:v.className,r,o,x,w),T=Object.assign(Object.assign({},null==v?void 0:v.style),i);return b(a.createElement(a.Fragment,null,h.wireframe&&a.createElement(nc,{prefixCls:y}),a.createElement(tV,Object.assign({},S,f,{style:T,prefixCls:y,selectPrefixCls:P,className:N,selectComponentClass:c||(j?tQ:tJ),locale:O,showSizeChanger:k}))))},nf=n(87908);function np(e,t){return"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t}function nh(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}function nm(e,t){return"function"==typeof e?e(t):e}var ng={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},nv=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:ng}))}),ny=n(51646),nb=n(73002),nx=n(85180),nw=n(45937),nk=n(88208);function nS(e){if(null==e)throw TypeError("Cannot destructure "+e)}var nE=n(47970),nO=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],nC=function(e,t){var n,r,o,i,l,c=e.className,d=e.style,f=e.motion,p=e.motionNodes,h=e.motionType,g=e.onMotionStart,v=e.onMotionEnd,y=e.active,b=e.treeNodeRequiredProps,x=(0,z.Z)(e,nO),w=a.useState(!0),k=(0,s.Z)(w,2),S=k[0],E=k[1],O=a.useContext(eX).prefixCls,C=p&&"hide"!==h;(0,u.Z)(function(){p&&C!==S&&E(C)},[p]);var j=a.useRef(!1),P=function(){p&&!j.current&&(j.current=!0,v())};return(n=function(){p&&g()},r=a.useState(!1),i=(o=(0,s.Z)(r,2))[0],l=o[1],(0,u.Z)(function(){if(i)return n(),function(){P()}},[i]),(0,u.Z)(function(){return l(!0),function(){l(!1)}},[]),p)?a.createElement(nE.ZP,(0,m.Z)({ref:t,visible:S},f,{motionAppear:"show"===h,onVisibleChanged:function(e){C===e&&P()}}),function(e,t){var n=e.className,r=e.style;return a.createElement("div",{ref:t,className:_()("".concat(O,"-treenode-motion"),n),style:r},p.map(function(e){var t=(0,m.Z)({},(nS(e.data),e.data)),n=e.title,r=e.key,o=e.isStart,i=e.isEnd;delete t.children;var l=e3(r,b);return a.createElement(tt,(0,m.Z)({},t,l,{title:n,active:y,data:e.data,key:r,isStart:o,isEnd:i}))}))}):a.createElement(tt,(0,m.Z)({domRef:t,className:c,style:d},x,{active:y}))};nC.displayName="MotionTreeNode";var nj=a.forwardRef(nC);function n_(e,t,n){var r=e.findIndex(function(e){return e.key===n}),o=e[r+1],a=t.findIndex(function(e){return e.key===n});if(o){var i=t.findIndex(function(e){return e.key===o.key});return t.slice(a+1,i)}return t.slice(a+1)}var nP=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],nN={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},nT=function(){},nA="RC_TREE_MOTION_".concat(Math.random()),nM={key:nA},nI={key:nA,level:0,index:0,pos:"0",node:nM,nodes:[nM]},nR={parent:null,children:[],pos:nI.pos,data:nM,title:null,key:nA,isStart:[],isEnd:[]};function nD(e,t,n,r){return!1!==t&&n?e.slice(0,Math.ceil(n/r)+1):e}function nL(e){return e0(e.key,e.pos)}var nZ=a.forwardRef(function(e,t){var n=e.prefixCls,r=e.data,o=(e.selectable,e.checkable,e.expandedKeys),i=e.selectedKeys,l=e.checkedKeys,c=e.loadedKeys,d=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,h=e.disabled,g=e.dragging,v=e.dragOverNodeKey,y=e.dropPosition,b=e.motion,x=e.height,w=e.itemHeight,k=e.virtual,S=e.focusable,E=e.activeItem,O=e.focused,C=e.tabIndex,j=e.onKeyDown,_=e.onFocus,P=e.onBlur,N=e.onActiveChange,T=e.onListChangeStart,A=e.onListChangeEnd,M=(0,z.Z)(e,nP),I=a.useRef(null),R=a.useRef(null);a.useImperativeHandle(t,function(){return{scrollTo:function(e){I.current.scrollTo(e)},getIndentWidth:function(){return R.current.offsetWidth}}});var D=a.useState(o),L=(0,s.Z)(D,2),Z=L[0],B=L[1],F=a.useState(r),H=(0,s.Z)(F,2),q=H[0],W=H[1],U=a.useState(r),K=(0,s.Z)(U,2),$=K[0],V=K[1],X=a.useState([]),G=(0,s.Z)(X,2),Y=G[0],Q=G[1],J=a.useState(null),ee=(0,s.Z)(J,2),et=ee[0],en=ee[1],er=a.useRef(r);function eo(){var e=er.current;W(e),V(e),Q([]),en(null),A()}er.current=r,(0,u.Z)(function(){B(o);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,r=t.length;if(1!==Math.abs(n-r))return{add:!1,key:null};function o(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var r=t.filter(function(e){return!n.has(e)});return 1===r.length?r[0]:null}return n<r?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}(Z,o);if(null!==e.key){if(e.add){var t=q.findIndex(function(t){return t.key===e.key}),n=nD(n_(q,r,e.key),k,x,w),a=q.slice();a.splice(t+1,0,nR),V(a),Q(n),en("show")}else{var i=r.findIndex(function(t){return t.key===e.key}),l=nD(n_(r,q,e.key),k,x,w),s=r.slice();s.splice(i+1,0,nR),V(s),Q(l),en("hide")}}else q!==r&&(W(r),V(r))},[o,r]),a.useEffect(function(){g||eo()},[g]);var ea=b?$:r,ei={expandedKeys:o,selectedKeys:i,loadedKeys:c,loadingKeys:d,checkedKeys:l,halfCheckedKeys:f,dragOverNodeKey:v,dropPosition:y,keyEntities:p};return a.createElement(a.Fragment,null,O&&E&&a.createElement("span",{style:nN,"aria-live":"assertive"},function(e){for(var t=String(e.data.key),n=e;n.parent;)n=n.parent,t="".concat(n.data.key," > ").concat(t);return t}(E)),a.createElement("div",null,a.createElement("input",{style:nN,disabled:!1===S||h,tabIndex:!1!==S?C:null,onKeyDown:j,onFocus:_,onBlur:P,value:"",onChange:nT,"aria-label":"for screen reader"})),a.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},a.createElement("div",{className:"".concat(n,"-indent")},a.createElement("div",{ref:R,className:"".concat(n,"-indent-unit")}))),a.createElement(eI.Z,(0,m.Z)({},M,{data:ea,itemKey:nL,height:x,fullHeight:!1,virtual:k,itemHeight:w,prefixCls:"".concat(n,"-list"),ref:I,onVisibleChange:function(e,t){var n=new Set(e);t.filter(function(e){return!n.has(e)}).some(function(e){return nL(e)===nA})&&eo()}}),function(e){var t=e.pos,n=(0,m.Z)({},(nS(e.data),e.data)),r=e.title,o=e.key,i=e.isStart,l=e.isEnd,s=e0(o,t);delete n.key,delete n.children;var c=e3(s,ei);return a.createElement(nj,(0,m.Z)({},n,c,{title:r,active:!!E&&o===E.key,pos:t,data:e.data,isStart:i,isEnd:l,motion:b,motionNodes:o===nA?Y:null,motionType:et,onMotionStart:T,onMotionEnd:eo,treeNodeRequiredProps:ei,onMouseMove:function(){N(null)}}))}))});nZ.displayName="NodeList";var nz=function(e){(0,e$.Z)(n,e);var t=(0,eV.Z)(n);function n(){var e;(0,eW.Z)(this,n);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).destroyed=!1,e.delayedDragEnterLogic=void 0,e.loadingRetryTimes={},e.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:e1()},e.dragStartMousePosition=null,e.dragNode=void 0,e.currentMouseOverDroppableNodeKey=null,e.listRef=a.createRef(),e.onNodeDragStart=function(t,n){var r,o=e.state,a=o.expandedKeys,i=o.keyEntities,l=e.props.onDragStart,s=n.props.eventKey;e.dragNode=n,e.dragStartMousePosition={x:t.clientX,y:t.clientY};var c=tn(a,s);e.setState({draggingNodeKey:s,dragChildrenKeys:(r=[],function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,o=t.children;r.push(n),e(o)})}(i[s].children),r),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(c),window.addEventListener("dragend",e.onWindowDragEnd),null==l||l({event:t,node:e5(n.props)})},e.onNodeDragEnter=function(t,n){var r=e.state,o=r.expandedKeys,a=r.keyEntities,i=r.dragChildrenKeys,l=r.flattenNodes,s=r.indent,c=e.props,u=c.onDragEnter,d=c.onExpand,f=c.allowDrop,p=c.direction,h=n.props,m=h.pos,g=h.eventKey,v=(0,eK.Z)(e).dragNode;if(e.currentMouseOverDroppableNodeKey!==g&&(e.currentMouseOverDroppableNodeKey=g),!v){e.resetDragState();return}var y=ta(t,v,n,s,e.dragStartMousePosition,f,l,a,o,p),b=y.dropPosition,x=y.dropLevelOffset,w=y.dropTargetKey,k=y.dropContainerKey,S=y.dropTargetPos,E=y.dropAllowed,O=y.dragOverNodeKey;if(-1!==i.indexOf(w)||!E||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),v.props.eventKey!==n.props.eventKey&&(t.persist(),e.delayedDragEnterLogic[m]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var r=(0,es.Z)(o),i=a[n.props.eventKey];i&&(i.children||[]).length&&(r=tr(o,n.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(r),null==d||d(r,{node:e5(n.props),expanded:!0,nativeEvent:t.nativeEvent})}},800)),v.props.eventKey===w&&0===x)){e.resetDragState();return}e.setState({dragOverNodeKey:O,dropPosition:b,dropLevelOffset:x,dropTargetKey:w,dropContainerKey:k,dropTargetPos:S,dropAllowed:E}),null==u||u({event:t,node:e5(n.props),expandedKeys:o})},e.onNodeDragOver=function(t,n){var r=e.state,o=r.dragChildrenKeys,a=r.flattenNodes,i=r.keyEntities,l=r.expandedKeys,s=r.indent,c=e.props,u=c.onDragOver,d=c.allowDrop,f=c.direction,p=(0,eK.Z)(e).dragNode;if(p){var h=ta(t,p,n,s,e.dragStartMousePosition,d,a,i,l,f),m=h.dropPosition,g=h.dropLevelOffset,v=h.dropTargetKey,y=h.dropContainerKey,b=h.dropAllowed,x=h.dropTargetPos,w=h.dragOverNodeKey;-1===o.indexOf(v)&&b&&(p.props.eventKey===v&&0===g?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():m===e.state.dropPosition&&g===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&y===e.state.dropContainerKey&&x===e.state.dropTargetPos&&b===e.state.dropAllowed&&w===e.state.dragOverNodeKey||e.setState({dropPosition:m,dropLevelOffset:g,dropTargetKey:v,dropContainerKey:y,dropTargetPos:x,dropAllowed:b,dragOverNodeKey:w}),null==u||u({event:t,node:e5(n.props)}))}},e.onNodeDragLeave=function(t,n){e.currentMouseOverDroppableNodeKey!==n.props.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var r=e.props.onDragLeave;null==r||r({event:t,node:e5(n.props)})},e.onWindowDragEnd=function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(t,n){var r=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==r||r({event:t,node:e5(n.props)}),e.dragNode=null,window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDrop=function(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,i=a.dragChildrenKeys,l=a.dropPosition,s=a.dropTargetKey,c=a.dropTargetPos;if(a.dropAllowed){var u=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==s){var d=(0,O.Z)((0,O.Z)({},e3(s,e.getTreeNodeRequiredProps())),{},{active:(null===(r=e.getActiveItem())||void 0===r?void 0:r.key)===s,data:e.state.keyEntities[s].node}),f=-1!==i.indexOf(s);(0,T.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=to(c),h={event:t,node:e5(d),dragNode:e.dragNode?e5(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(i),dropToGap:0!==l,dropPosition:l+Number(p[p.length-1])};o||null==u||u(h),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(t,n){var r=e.state,o=r.expandedKeys,a=r.flattenNodes,i=n.expanded,l=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var s=a.filter(function(e){return e.key===l})[0],c=e5((0,O.Z)((0,O.Z)({},e3(l,e.getTreeNodeRequiredProps())),{},{data:s.data}));e.setExpandedKeys(i?tn(o,l):tr(o,l)),e.onNodeExpand(t,c)}},e.onNodeClick=function(t,n){var r=e.props,o=r.onClick;"click"===r.expandAction&&e.triggerExpandActionExpand(t,n),null==o||o(t,n)},e.onNodeDoubleClick=function(t,n){var r=e.props,o=r.onDoubleClick;"doubleClick"===r.expandAction&&e.triggerExpandActionExpand(t,n),null==o||o(t,n)},e.onNodeSelect=function(t,n){var r=e.state.selectedKeys,o=e.state,a=o.keyEntities,i=o.fieldNames,l=e.props,s=l.onSelect,c=l.multiple,u=n.selected,d=n[i.key],f=!u,p=(r=f?c?tr(r,d):[d]:tn(r,d)).map(function(e){var t=a[e];return t?t.node:null}).filter(function(e){return e});e.setUncontrolledState({selectedKeys:r}),null==s||s(r,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,r){var o,a=e.state,i=a.keyEntities,l=a.checkedKeys,s=a.halfCheckedKeys,c=e.props,u=c.checkStrictly,d=c.onCheck,f=n.key,p={event:"check",node:n,checked:r,nativeEvent:t.nativeEvent};if(u){var h=r?tr(l,f):tn(l,f);o={checked:h,halfChecked:tn(s,f)},p.checkedNodes=h.map(function(e){return i[e]}).filter(function(e){return e}).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:h})}else{var m=td([].concat((0,es.Z)(l),[f]),!0,i),g=m.checkedKeys,v=m.halfCheckedKeys;if(!r){var y=new Set(g);y.delete(f);var b=td(Array.from(y),{checked:!1,halfCheckedKeys:v},i);g=b.checkedKeys,v=b.halfCheckedKeys}o=g,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=v,g.forEach(function(e){var t=i[e];if(t){var n=t.node,r=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:r})}}),e.setUncontrolledState({checkedKeys:g},!1,{halfCheckedKeys:v})}null==d||d(o,p)},e.onNodeLoad=function(t){var n=t.key,r=new Promise(function(r,o){e.setState(function(a){var i=a.loadedKeys,l=a.loadingKeys,s=void 0===l?[]:l,c=e.props,u=c.loadData,d=c.onLoad;return u&&-1===(void 0===i?[]:i).indexOf(n)&&-1===s.indexOf(n)?(u(t).then(function(){var o=tr(e.state.loadedKeys,n);null==d||d(o,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:o}),e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),r()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),e.loadingRetryTimes[n]=(e.loadingRetryTimes[n]||0)+1,e.loadingRetryTimes[n]>=10){var a=e.state.loadedKeys;(0,T.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:tr(a,n)}),r()}o(t)}),{loadingKeys:tr(s,n)}):null})});return r.catch(function(){}),r},e.onNodeMouseEnter=function(t,n){var r=e.props.onMouseEnter;null==r||r({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var r=e.props.onMouseLeave;null==r||r({event:t,node:n})},e.onNodeContextMenu=function(t,n){var r=e.props.onRightClick;r&&(t.preventDefault(),r({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t||t.apply(void 0,r)},e.onBlur=function(){var t=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t||t.apply(void 0,r)},e.getTreeNodeRequiredProps=function(){var t=e.state;return{expandedKeys:t.expandedKeys||[],selectedKeys:t.selectedKeys||[],loadedKeys:t.loadedKeys||[],loadingKeys:t.loadingKeys||[],checkedKeys:t.checkedKeys||[],halfCheckedKeys:t.halfCheckedKeys||[],dragOverNodeKey:t.dragOverNodeKey,dropPosition:t.dropPosition,keyEntities:t.keyEntities}},e.setExpandedKeys=function(t){var n=e.state,r=e6(n.treeData,t,n.fieldNames);e.setUncontrolledState({expandedKeys:t,flattenNodes:r},!0)},e.onNodeExpand=function(t,n){var r=e.state.expandedKeys,o=e.state,a=o.listChanging,i=o.fieldNames,l=e.props,s=l.onExpand,c=l.loadData,u=n.expanded,d=n[i.key];if(!a){var f=r.indexOf(d),p=!u;if((0,T.ZP)(u&&-1!==f||!u&&-1===f,"Expand state not sync with index check"),r=p?tr(r,d):tn(r,d),e.setExpandedKeys(r),null==s||s(r,{node:n,expanded:p,nativeEvent:t.nativeEvent}),p&&c){var h=e.onNodeLoad(n);h&&h.then(function(){var t=e6(e.state.treeData,r,i);e.setUncontrolledState({flattenNodes:t})}).catch(function(){var t=tn(e.state.expandedKeys,d);e.setExpandedKeys(t)})}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout(function(){e.setUncontrolledState({listChanging:!1})})},e.onActiveChange=function(t){var n=e.state.activeKey,r=e.props,o=r.onActiveChange,a=r.itemScrollOffset;n!==t&&(e.setState({activeKey:t}),null!==t&&e.scrollTo({key:t,offset:void 0===a?0:a}),null==o||o(t))},e.getActiveItem=function(){var t=e.state,n=t.activeKey,r=t.flattenNodes;return null===n?null:r.find(function(e){return e.key===n})||null},e.offsetActiveKey=function(t){var n=e.state,r=n.flattenNodes,o=n.activeKey,a=r.findIndex(function(e){return e.key===o});-1===a&&t<0&&(a=r.length),a=(a+t+r.length)%r.length;var i=r[a];if(i){var l=i.key;e.onActiveChange(l)}else e.onActiveChange(null)},e.onKeyDown=function(t){var n=e.state,r=n.activeKey,o=n.expandedKeys,a=n.checkedKeys,i=n.fieldNames,l=e.props,s=l.onKeyDown,c=l.checkable,u=l.selectable;switch(t.which){case tz.Z.UP:e.offsetActiveKey(-1),t.preventDefault();break;case tz.Z.DOWN:e.offsetActiveKey(1),t.preventDefault()}var d=e.getActiveItem();if(d&&d.data){var f=e.getTreeNodeRequiredProps(),p=!1===d.data.isLeaf||!!(d.data[i.children]||[]).length,h=e5((0,O.Z)((0,O.Z)({},e3(r,f)),{},{data:d.data,active:!0}));switch(t.which){case tz.Z.LEFT:p&&o.includes(r)?e.onNodeExpand({},h):d.parent&&e.onActiveChange(d.parent.key),t.preventDefault();break;case tz.Z.RIGHT:p&&!o.includes(r)?e.onNodeExpand({},h):d.children&&d.children.length&&e.onActiveChange(d.children[0].key),t.preventDefault();break;case tz.Z.ENTER:case tz.Z.SPACE:!c||h.disabled||!1===h.checkable||h.disableCheckbox?c||!u||h.disabled||!1===h.selectable||e.onNodeSelect({},h):e.onNodeCheck({},h,!a.includes(r))}}null==s||s(t)},e.setUncontrolledState=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var o=!1,a=!0,i={};Object.keys(t).forEach(function(n){if(n in e.props){a=!1;return}o=!0,i[n]=t[n]}),o&&(!n||a)&&e.setState((0,O.Z)((0,O.Z)({},i),r))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return(0,eU.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t,n=this.state,r=n.focused,o=n.flattenNodes,i=n.keyEntities,l=n.draggingNodeKey,s=n.activeKey,c=n.dropLevelOffset,u=n.dropContainerKey,d=n.dropTargetKey,f=n.dropPosition,p=n.dragOverNodeKey,h=n.indent,g=this.props,v=g.prefixCls,y=g.className,b=g.style,x=g.showLine,w=g.focusable,k=g.tabIndex,S=g.selectable,O=g.showIcon,j=g.icon,P=g.switcherIcon,N=g.draggable,T=g.checkable,A=g.checkStrictly,M=g.disabled,I=g.motion,R=g.loadData,D=g.filterTreeNode,L=g.height,Z=g.itemHeight,z=g.virtual,B=g.titleRender,F=g.dropIndicatorRender,H=g.onContextMenu,q=g.onScroll,W=g.direction,U=g.rootClassName,K=g.rootStyle,V=(0,$.Z)(this.props,{aria:!0,data:!0});return N&&(t="object"===(0,E.Z)(N)?N:"function"==typeof N?{nodeDraggable:N}:{}),a.createElement(eX.Provider,{value:{prefixCls:v,selectable:S,showIcon:O,icon:j,switcherIcon:P,draggable:t,draggingNodeKey:l,checkable:T,checkStrictly:A,disabled:M,keyEntities:i,dropLevelOffset:c,dropContainerKey:u,dropTargetKey:d,dropPosition:f,dragOverNodeKey:p,indent:h,direction:W,dropIndicatorRender:F,loadData:R,filterTreeNode:D,titleRender:B,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},a.createElement("div",{role:"tree",className:_()(v,y,U,(e={},(0,C.Z)(e,"".concat(v,"-show-line"),x),(0,C.Z)(e,"".concat(v,"-focused"),r),(0,C.Z)(e,"".concat(v,"-active-focused"),null!==s),e)),style:K},a.createElement(nZ,(0,m.Z)({ref:this.listRef,prefixCls:v,style:b,data:o,disabled:M,selectable:S,checkable:!!T,motion:I,dragging:null!==l,height:L,itemHeight:Z,virtual:z,focusable:w,focused:r,tabIndex:void 0===k?0:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:H,onScroll:q},this.getTreeNodeRequiredProps(),V))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,r,o=t.prevProps,a={prevProps:e};function i(t){return!o&&t in e||o&&o[t]!==e[t]}var l=t.fieldNames;if(i("fieldNames")&&(l=e1(e.fieldNames),a.fieldNames=l),i("treeData")?n=e.treeData:i("children")&&((0,T.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=e2(e.children)),n){a.treeData=n;var s=e4(n,{fieldNames:l});a.keyEntities=(0,O.Z)((0,C.Z)({},nA,nI),s.keyEntities)}var c=a.keyEntities||t.keyEntities;if(i("expandedKeys")||o&&i("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!o&&e.defaultExpandParent?ts(e.expandedKeys,c):e.expandedKeys;else if(!o&&e.defaultExpandAll){var u=(0,O.Z)({},c);delete u[nA],a.expandedKeys=Object.keys(u).map(function(e){return u[e].key})}else!o&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?ts(e.defaultExpandedKeys,c):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var d=e6(n||t.treeData,a.expandedKeys||t.expandedKeys,l);a.flattenNodes=d}if(e.selectable&&(i("selectedKeys")?a.selectedKeys=ti(e.selectedKeys,e):!o&&e.defaultSelectedKeys&&(a.selectedKeys=ti(e.defaultSelectedKeys,e))),e.checkable&&(i("checkedKeys")?r=tl(e.checkedKeys)||{}:!o&&e.defaultCheckedKeys?r=tl(e.defaultCheckedKeys)||{}:n&&(r=tl(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),r)){var f=r,p=f.checkedKeys,h=void 0===p?[]:p,m=f.halfCheckedKeys,g=void 0===m?[]:m;if(!e.checkStrictly){var v=td(h,!0,c);h=v.checkedKeys,g=v.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=g}return i("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(a.Component);nz.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:o.top=0,o.left=-n*r;break;case 1:o.bottom=0,o.left=-n*r;break;case 0:o.bottom=0,o.left=r}return a.createElement("div",{style:o})},allowDrop:function(){return!0},expandAction:!1},nz.TreeNode=tt;var nB={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},nF=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nB}))}),nH={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nq=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nH}))}),nW={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nU=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nW}))}),nK={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},n$=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nK}))}),nV=n(68710),nX=n(23159),nG=n(63074);let nY=new t0.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nQ=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nJ=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,t0.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),n0=(e,t)=>{let{treeCls:n,treeNodeCls:r,treeNodePadding:o,titleHeight:a,nodeSelectedBg:i,nodeHoverBg:l}=t,s=t.paddingXS;return{[n]:Object.assign(Object.assign({},(0,t6.Wf)(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),["&".concat(n,"-rtl")]:{["".concat(n,"-switcher")]:{"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(90deg)"}}}}},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:Object.assign({},(0,t6.oN)(t)),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(r,".dragging")]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:nY,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},["".concat(r)]:{display:"flex",alignItems:"flex-start",padding:"0 0 ".concat((0,t0.bf)(o)," 0"),outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{["".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(r,"-disabled).filter-node ").concat(n,"-title")]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",visibility:"visible",opacity:.2,transition:"opacity ".concat(t.motionDurationSlow),["".concat(r,":hover &")]:{opacity:.45}},["&".concat(r,"-disabled")]:{["".concat(n,"-draggable-icon")]:{visibility:"hidden"}}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:a}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nQ(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,margin:0,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),borderRadius:t.borderRadius,"&-noop":{cursor:"unset"},["&:not(".concat(n,"-switcher-noop):hover")]:{backgroundColor:t.colorBgTextHover},"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-checkbox")]:{top:"initial",marginInlineEnd:s,alignSelf:"flex-start",marginTop:t.marginXXS},["".concat(n,"-node-content-wrapper, ").concat(n,"-checkbox + span")]:{position:"relative",zIndex:"auto",minHeight:a,margin:0,padding:"0 ".concat((0,t0.bf)(t.calc(t.paddingXS).div(2).equal())),color:"inherit",lineHeight:"".concat((0,t0.bf)(a)),background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s"),"&:hover":{backgroundColor:l},["&".concat(n,"-node-selected")]:{backgroundColor:i},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(n,"-node-content-wrapper")]:Object.assign({lineHeight:"".concat((0,t0.bf)(a)),userSelect:"none"},nJ(e,t)),["".concat(r,".drop-container")]:{"> [draggable]":{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)}},"&-show-line":{["".concat(n,"-indent")]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end":{"&:before":{display:"none"}}}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(r,"-leaf-last")]:{["".concat(n,"-switcher")]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:"".concat((0,t0.bf)(t.calc(a).div(2).equal())," !important")}}}}})}},n1=e=>{let{treeCls:t,treeNodeCls:n,treeNodePadding:r,directoryNodeSelectedBg:o,directoryNodeSelectedColor:a}=e;return{["".concat(t).concat(t,"-directory")]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,transition:"background-color ".concat(e.motionDurationMid),content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},["".concat(t,"-switcher")]:{transition:"color ".concat(e.motionDurationMid)},["".concat(t,"-node-content-wrapper")]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},["&".concat(t,"-node-selected")]:{color:a,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:o},["".concat(t,"-switcher")]:{color:a},["".concat(t,"-node-content-wrapper")]:{color:a,background:"transparent"}}}}}},n2=(e,t)=>{let n=".".concat(e),r=t.calc(t.paddingXS).div(2).equal(),o=(0,t4.TS)(t,{treeCls:n,treeNodeCls:"".concat(n,"-treenode"),treeNodePadding:r});return[n0(e,o),n1(o)]},n6=e=>{let{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}};var n4=(0,t3.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nX.C2)("".concat(n,"-checkbox"),e)},n2(n,e),(0,nG.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},n6(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})});function n3(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:o,direction:i="ltr"}=e,l="ltr"===i?"left":"right",s={[l]:-n*o+4,["ltr"===i?"right":"left"]:0};switch(t){case -1:s.top=-3;break;case 1:s.bottom=-3;break;default:s.bottom=-3,s[l]=o+4}return a.createElement("div",{style:s,className:"".concat(r,"-drop-indicator")})}var n5={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},n8=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:n5}))}),n7=n(61935),n9={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},re=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:n9}))}),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},rn=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rt}))}),rr=n(19722),ro=e=>{let t;let{prefixCls:n,switcherIcon:r,treeNodeProps:o,showLine:i}=e,{isLeaf:l,expanded:s,loading:c}=o;if(c)return a.createElement(n7.Z,{className:"".concat(n,"-switcher-loading-icon")});if(i&&"object"==typeof i&&(t=i.showLeafIcon),l){if(!i)return null;if("boolean"!=typeof t&&t){let e="function"==typeof t?t(o):t;return(0,rr.l$)(e)?(0,rr.Tm)(e,{className:_()(e.props.className||"","".concat(n,"-switcher-line-custom-icon"))}):e}return t?a.createElement(nF,{className:"".concat(n,"-switcher-line-icon")}):a.createElement("span",{className:"".concat(n,"-switcher-leaf-line")})}let u="".concat(n,"-switcher-icon"),d="function"==typeof r?r(o):r;return(0,rr.l$)(d)?(0,rr.Tm)(d,{className:_()(d.props.className||"",u)}):void 0!==d?d:i?s?a.createElement(re,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(rn,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(n8,{className:u})};let ra=a.forwardRef((e,t)=>{var n;let{getPrefixCls:r,direction:o,virtual:i,tree:l}=a.useContext(tC.E_),{prefixCls:s,className:c,showIcon:u=!1,showLine:d,switcherIcon:f,blockNode:p=!1,children:h,checkable:m=!1,selectable:g=!0,draggable:v,motion:y,style:b}=e,x=r("tree",s),w=r(),k=null!=y?y:Object.assign(Object.assign({},(0,nV.Z)(w)),{motionAppear:!1}),S=Object.assign(Object.assign({},e),{checkable:m,selectable:g,showIcon:u,motion:k,blockNode:p,showLine:!!d,dropIndicatorRender:n3}),[E,O,C]=n4(x),[,j]=(0,nl.ZP)(),P=j.paddingXS/2+((null===(n=j.Tree)||void 0===n?void 0:n.titleHeight)||j.controlHeightSM),N=a.useMemo(()=>{if(!v)return!1;let e={};switch(typeof v){case"function":e.nodeDraggable=v;break;case"object":e=Object.assign({},v)}return!1!==e.icon&&(e.icon=e.icon||a.createElement(n$,null)),e},[v]);return E(a.createElement(nz,Object.assign({itemHeight:P,ref:t,virtual:i},S,{style:Object.assign(Object.assign({},null==l?void 0:l.style),b),prefixCls:x,className:_()({["".concat(x,"-icon-hide")]:!u,["".concat(x,"-block-node")]:p,["".concat(x,"-unselectable")]:!g,["".concat(x,"-rtl")]:"rtl"===o},null==l?void 0:l.className,c,O,C),direction:o,checkable:m?a.createElement("span",{className:"".concat(x,"-checkbox-inner")}):m,selectable:g,switcherIcon:e=>a.createElement(ro,{prefixCls:x,switcherIcon:f,treeNodeProps:e,showLine:d}),draggable:N}),h))});function ri(e,t,n){let{key:r,children:o}=n;e.forEach(function(e){let a=e[r],i=e[o];!1!==t(a,e)&&ri(i||[],t,n)})}(r=o||(o={}))[r.None=0]="None",r[r.Start=1]="Start",r[r.End=2]="End";var rl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function rs(e){let{isLeaf:t,expanded:n}=e;return t?a.createElement(nF,null):n?a.createElement(nq,null):a.createElement(nU,null)}function rc(e){let{treeData:t,children:n}=e;return t||e2(n)}let ru=a.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:i}=e,l=rl(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let s=a.useRef(),c=a.useRef(),u=()=>{let{keyEntities:e}=e4(rc(l));return n?Object.keys(e):r?ts(l.expandedKeys||i||[],e):l.expandedKeys||i},[d,f]=a.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[p,h]=a.useState(()=>u());a.useEffect(()=>{"selectedKeys"in l&&f(l.selectedKeys)},[l.selectedKeys]),a.useEffect(()=>{"expandedKeys"in l&&h(l.expandedKeys)},[l.expandedKeys]);let{getPrefixCls:m,direction:g}=a.useContext(tC.E_),{prefixCls:v,className:y,showIcon:b=!0,expandAction:x="click"}=l,w=rl(l,["prefixCls","className","showIcon","expandAction"]),k=m("tree",v),S=_()("".concat(k,"-directory"),{["".concat(k,"-directory-rtl")]:"rtl"===g},y);return a.createElement(ra,Object.assign({icon:rs,ref:t,blockNode:!0},w,{showIcon:b,expandAction:x,prefixCls:k,className:S,expandedKeys:p,selectedKeys:d,onSelect:(e,t)=>{var n;let r;let{multiple:a,fieldNames:i}=l,{node:u,nativeEvent:d}=t,{key:h=""}=u,m=rc(l),g=Object.assign(Object.assign({},t),{selected:!0}),v=(null==d?void 0:d.ctrlKey)||(null==d?void 0:d.metaKey),y=null==d?void 0:d.shiftKey;a&&v?(r=e,s.current=h,c.current=r):a&&y?r=Array.from(new Set([].concat((0,es.Z)(c.current||[]),(0,es.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:r,endKey:a,fieldNames:i}=e,l=[],s=o.None;return r&&r===a?[r]:r&&a?(ri(t,e=>{if(s===o.End)return!1;if(e===r||e===a){if(l.push(e),s===o.None)s=o.Start;else if(s===o.Start)return s=o.End,!1}else s===o.Start&&l.push(e);return n.includes(e)},e1(i)),l):[]}({treeData:m,expandedKeys:p,startKey:h,endKey:s.current,fieldNames:i}))))):(r=[h],s.current=h,c.current=r),g.selectedNodes=function(e,t,n){let r=(0,es.Z)(t),o=[];return ri(e,(e,t)=>{let n=r.indexOf(e);return -1!==n&&(o.push(t),r.splice(n,1)),!!r.length},e1(n)),o}(m,r,i),null===(n=l.onSelect)||void 0===n||n.call(l,r,g),"selectedKeys"in l||f(r)},onExpand:(e,t)=>{var n;return"expandedKeys"in l||h(e),null===(n=l.onExpand)||void 0===n?void 0:n.call(l,e,t)}}))});ra.DirectoryTree=ru,ra.TreeNode=tt;var rd=n(29436),rf=n(64482),rp=function(e){let{value:t,onChange:n,filterSearch:r,tablePrefixCls:o,locale:i}=e;return r?a.createElement("div",{className:"".concat(o,"-filter-dropdown-search")},a.createElement(rf.default,{prefix:a.createElement(rd.Z,null),placeholder:i.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,className:"".concat(o,"-filter-dropdown-search-input")})):null};let rh=e=>{let{keyCode:t}=e;t===tz.Z.ENTER&&e.stopPropagation()},rm=a.forwardRef((e,t)=>a.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:rh,ref:t},e.children));function rg(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:r}=e;t.push(n),r&&(t=[].concat((0,es.Z)(t),(0,es.Z)(rg(r))))}),t}function rv(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var ry=function(e){var t,n;let r,o;let{tablePrefixCls:i,prefixCls:l,column:s,dropdownPrefixCls:c,columnKey:u,filterMultiple:f,filterMode:p="menu",filterSearch:h=!1,filterState:m,triggerFilter:g,locale:v,children:y,getPopupContainer:b,rootClassName:x}=e,{filterDropdownOpen:w,onFilterDropdownOpenChange:k,filterResetToDefaultFilteredValue:S,defaultFilteredValue:E,filterDropdownVisible:O,onFilterDropdownVisibleChange:C}=s,[j,P]=a.useState(!1),N=!!(m&&((null===(t=m.filteredKeys)||void 0===t?void 0:t.length)||m.forceFiltered)),T=e=>{P(e),null==k||k(e),null==C||C(e)},A=null!==(n=null!=w?w:O)&&void 0!==n?n:j,M=null==m?void 0:m.filteredKeys,[I,R]=function(e){let t=a.useRef(e),n=(0,ny.Z)();return[()=>t.current,e=>{t.current=e,n()}]}(M||[]),D=e=>{let{selectedKeys:t}=e;R(t)};a.useEffect(()=>{j&&D({selectedKeys:M||[]})},[M]);let[L,Z]=a.useState([]),[z,B]=a.useState(""),F=e=>{let{value:t}=e.target;B(t)};a.useEffect(()=>{j||B("")},[j]);let H=e=>{let t=e&&e.length?e:null;if(null===t&&(!m||!m.filteredKeys)||(0,d.Z)(t,null==m?void 0:m.filteredKeys,!0))return null;g({column:s,key:u,filteredKeys:t})},q=()=>{T(!1),H(I())},W=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&H([]),t&&T(!1),B(""),S?R((E||[]).map(e=>String(e))):R([])},U=_()({["".concat(c,"-menu-without-submenu")]:!(s.filters||[]).some(e=>{let{children:t}=e;return t})}),K=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),r={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(r.children=K({filters:e.children})),r})},$=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>$(e)))||[]})};if("function"==typeof s.filterDropdown)r=s.filterDropdown({prefixCls:"".concat(c,"-custom"),setSelectedKeys:e=>D({selectedKeys:e}),selectedKeys:I(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&T(!1),H(I())},clearFilters:W,filters:s.filters,visible:A,close:()=>{T(!1)}});else if(s.filterDropdown)r=s.filterDropdown;else{let e=I()||[];r=a.createElement(a.Fragment,null,0===(s.filters||[]).length?a.createElement(nx.Z,{image:nx.Z.PRESENTED_IMAGE_SIMPLE,description:v.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):"tree"===p?a.createElement(a.Fragment,null,a.createElement(rp,{filterSearch:h,value:z,onChange:F,tablePrefixCls:i,locale:v}),a.createElement("div",{className:"".concat(i,"-filter-dropdown-tree")},f?a.createElement(th.Z,{checked:e.length===rg(s.filters).length,indeterminate:e.length>0&&e.length<rg(s.filters).length,className:"".concat(i,"-filter-dropdown-checkall"),onChange:e=>{e.target.checked?R(rg(null==s?void 0:s.filters).map(e=>String(e))):R([])}},v.filterCheckall):null,a.createElement(ra,{checkable:!0,selectable:!1,blockNode:!0,multiple:f,checkStrictly:!f,className:"".concat(c,"-menu"),onCheck:(e,t)=>{let{node:n,checked:r}=t;f?D({selectedKeys:e}):D({selectedKeys:r&&n.key?[n.key]:[]})},checkedKeys:e,selectedKeys:e,showIcon:!1,treeData:K({filters:s.filters}),autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:z.trim()?e=>"function"==typeof h?h(z,$(e)):rv(z,e.title):void 0}))):a.createElement(a.Fragment,null,a.createElement(rp,{filterSearch:h,value:z,onChange:F,tablePrefixCls:i,locale:v}),a.createElement(nw.Z,{selectable:!0,multiple:f,prefixCls:"".concat(c,"-menu"),className:U,onSelect:D,onDeselect:D,selectedKeys:e,getPopupContainer:b,openKeys:L,onOpenChange:e=>{Z(e)},items:function e(t){let{filters:n,prefixCls:r,filteredKeys:o,filterMultiple:i,searchValue:l,filterSearch:s}=t;return n.map((t,n)=>{let c=String(t.value);if(t.children)return{key:c||n,label:t.text,popupClassName:"".concat(r,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:r,filteredKeys:o,filterMultiple:i,searchValue:l,filterSearch:s})};let u=i?th.Z:tg.ZP,d={key:void 0!==t.value?c:n,label:a.createElement(a.Fragment,null,a.createElement(u,{checked:o.includes(c)}),a.createElement("span",null,t.text))};return l.trim()?"function"==typeof s?s(l,t)?d:null:rv(l,t.text)?d:null:d})}({filters:s.filters||[],filterSearch:h,prefixCls:l,filteredKeys:I(),filterMultiple:f,searchValue:z})})),a.createElement("div",{className:"".concat(l,"-dropdown-btns")},a.createElement(nb.ZP,{type:"link",size:"small",disabled:S?(0,d.Z)((E||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>W()},v.filterReset),a.createElement(nb.ZP,{type:"primary",size:"small",onClick:q},v.filterConfirm)))}s.filterDropdown&&(r=a.createElement(nk.J,{selectable:void 0},r)),o="function"==typeof s.filterIcon?s.filterIcon(N):s.filterIcon?s.filterIcon:a.createElement(nv,null);let{direction:V}=a.useContext(tC.E_);return a.createElement("div",{className:"".concat(l,"-column")},a.createElement("span",{className:"".concat(i,"-column-title")},y),a.createElement(tm.Z,{dropdownRender:()=>a.createElement(rm,{className:"".concat(l,"-dropdown")},r),trigger:["click"],open:A,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==M&&R(M||[]),T(e),e||s.filterDropdown||q())},getPopupContainer:b,placement:"rtl"===V?"bottomLeft":"bottomRight",rootClassName:x},a.createElement("span",{role:"button",tabIndex:-1,className:_()("".concat(l,"-trigger"),{active:N}),onClick:e=>{e.stopPropagation()}},o)))};function rb(e,t,n){let r=[];return(e||[]).forEach((e,o)=>{var a;let i=nh(o,n);if(e.filters||"filterDropdown"in e||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;"filterDropdown"in e||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),r.push({column:e,key:np(e,i),filteredKeys:t,forceFiltered:e.filtered})}else r.push({column:e,key:np(e,i),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(r=[].concat((0,es.Z)(r),(0,es.Z)(rb(e.children,t,i))))}),r}function rx(e){let t={};return e.forEach(e=>{let{key:n,filteredKeys:r,column:o}=e,{filters:a,filterDropdown:i}=o;if(i)t[n]=r||null;else if(Array.isArray(r)){let e=rg(a);t[n]=e.filter(e=>r.includes(String(e)))}else t[n]=null}),t}function rw(e,t){return t.reduce((e,t)=>{let{column:{onFilter:n,filters:r},filteredKeys:o}=t;return n&&o&&o.length?e.filter(e=>o.some(t=>{let o=rg(r),a=o.findIndex(e=>String(e)===String(t));return n(-1!==a?o[a]:t,e)})):e},e)}let rk=e=>e.flatMap(e=>"children"in e?[e].concat((0,es.Z)(rk(e.children||[]))):[e]);var rS=function(e){let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,onFilterChange:o,getPopupContainer:i,locale:l,rootClassName:s}=e;(0,tp.ln)("Table");let c=a.useMemo(()=>rk(r||[]),[r]),[u,d]=a.useState(()=>rb(c,!0)),f=a.useMemo(()=>{let e=rb(c,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(c||[]).map((e,t)=>np(e,nh(t)));return u.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=c[e.findIndex(e=>e===t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[c,u]),p=a.useMemo(()=>rx(f),[f]),h=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),d(t),o(rx(t),t)};return[e=>(function e(t,n,r,o,i,l,s,c,u){return r.map((r,d)=>{let f=nh(d,c),{filterMultiple:p=!0,filterMode:h,filterSearch:m}=r,g=r;if(g.filters||g.filterDropdown){let e=np(g,f),c=o.find(t=>{let{key:n}=t;return e===n});g=Object.assign(Object.assign({},g),{title:o=>a.createElement(ry,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:g,columnKey:e,filterState:c,filterMultiple:p,filterMode:h,filterSearch:m,triggerFilter:l,locale:i,getPopupContainer:s,rootClassName:u},nm(r.title,o))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:e(t,n,g.children,o,i,l,s,f,u)})),g})})(t,n,e,f,l,h,i,void 0,s),f,p]},rE=function(){let e=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t<arguments.length;t++){let n=t<0||arguments.length<=t?void 0:arguments[t];n&&Object.keys(n).forEach(t=>{let r=n[t];void 0!==r&&(e[t]=r)})}return e},rO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},rC=function(e,t,n){let r=n&&"object"==typeof n?n:{},{total:o=0}=r,i=rO(r,["total"]),[l,s]=(0,a.useState)(()=>({current:"defaultCurrent"in i?i.defaultCurrent:1,pageSize:"defaultPageSize"in i?i.defaultPageSize:10})),c=rE(l,i,{total:o>0?o:e}),u=Math.ceil((o||e)/c.pageSize);c.current>u&&(c.current=u||1);let d=(e,t)=>{s({current:null!=e?e:1,pageSize:t||c.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},c),{onChange:(e,r)=>{var o;n&&(null===(o=n.onChange)||void 0===o||o.call(n,e,r)),d(e,r),t(e,r||(null==c?void 0:c.pageSize))}}),d]},rj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},r_=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rj}))}),rP={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},rN=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rP}))}),rT=n(89970);let rA="ascend",rM="descend";function rI(e){return"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple}function rR(e){return"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare}function rD(e,t,n){let r=[];function o(e,t){r.push({column:e,key:np(e,t),multiplePriority:rI(e),sortOrder:e.sortOrder})}return(e||[]).forEach((e,a)=>{let i=nh(a,n);e.children?("sortOrder"in e&&o(e,i),r=[].concat((0,es.Z)(r),(0,es.Z)(rD(e.children,t,i)))):e.sorter&&("sortOrder"in e?o(e,i):t&&e.defaultSortOrder&&r.push({column:e,key:np(e,i),multiplePriority:rI(e),sortOrder:e.defaultSortOrder}))}),r}function rL(e){let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function rZ(e){let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(rL);return 0===t.length&&e.length?Object.assign(Object.assign({},rL(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function rz(e,t,n){let r=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),o=e.slice(),a=r.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return rR(t)&&n});return a.length?o.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let{column:{sorter:r},sortOrder:o}=a[n],i=rR(r);if(i&&o){let n=i(e,t,o);if(0!==n)return o===rA?n:-n}}return 0}).map(e=>{let r=e[n];return r?Object.assign(Object.assign({},e),{[n]:rz(r,t,n)}):e}):o}var rB=x(eA,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),rF=x(eH,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),rH=n(36360),rq=e=>{let{componentCls:t,lineWidth:n,lineType:r,tableBorderColor:o,tableHeaderBg:a,tablePaddingVertical:i,tablePaddingHorizontal:l,calc:s}=e,c="".concat((0,t0.bf)(n)," ").concat(r," ").concat(o),u=(e,r,o)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(s(r).mul(-1).equal()),"\n ").concat((0,t0.bf)(s(s(o).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:c,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:c,borderTop:c,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:c},"> thead":{"> tr:not(:last-child) > th":{borderBottom:c},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:c}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(s(i).mul(-1).equal())," ").concat((0,t0.bf)(s(s(l).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:c,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},u("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),u("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:c,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,t0.bf)(n)," 0 ").concat((0,t0.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:c}}}},rW=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},t6.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},rU=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},rK=n(76122),r$=e=>{let{componentCls:t,antCls:n,motionDurationSlow:r,lineWidth:o,paddingXS:a,lineType:i,tableBorderColor:l,tableExpandIconBg:s,tableExpandColumnWidth:c,borderRadius:u,tablePaddingVertical:d,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:h,expandIconMarginTop:m,expandIconSize:g,expandIconHalfInner:v,expandIconScale:y,calc:b}=e,x="".concat((0,t0.bf)(o)," ").concat(i," ").concat(l),w=b(h).sub(o).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:c},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,rK.N)(e)),{position:"relative",float:"left",boxSizing:"border-box",width:g,height:g,padding:0,color:"inherit",lineHeight:(0,t0.bf)(g),background:s,border:x,borderRadius:u,transform:"scale(".concat(y,")"),transition:"all ".concat(r),userSelect:"none","&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(r," ease-out"),content:'""'},"&::before":{top:v,insetInlineEnd:w,insetInlineStart:w,height:o},"&::after":{top:w,bottom:w,insetInlineStart:v,width:o,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:m,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"auto"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,t0.bf)(b(d).mul(-1).equal())," ").concat((0,t0.bf)(b(f).mul(-1).equal())),padding:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(f))}}}},rV=e=>{let{componentCls:t,antCls:n,iconCls:r,tableFilterDropdownWidth:o,tableFilterDropdownSearchWidth:a,paddingXXS:i,paddingXS:l,colorText:s,lineWidth:c,lineType:u,tableBorderColor:d,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:h,borderRadius:m,motionDurationSlow:g,colorTextDescription:v,colorPrimary:y,tableHeaderFilterActiveBg:b,colorTextDisabled:x,tableFilterDropdownBg:w,tableFilterDropdownHeight:k,controlItemBgHover:S,controlItemBgActive:E,boxShadowSecondary:O,filterDropdownMenuBg:C,calc:j}=e,_="".concat(n,"-dropdown"),P="".concat(t,"-filter-dropdown"),N="".concat(n,"-tree"),T="".concat((0,t0.bf)(c)," ").concat(u," ").concat(d);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:j(i).mul(-1).equal(),marginInline:"".concat((0,t0.bf)(i)," ").concat((0,t0.bf)(j(h).div(2).mul(-1).equal())),padding:"0 ".concat((0,t0.bf)(i)),color:f,fontSize:p,borderRadius:m,cursor:"pointer",transition:"all ".concat(g),"&:hover":{color:v,background:b},"&.active":{color:y}}}},{["".concat(n,"-dropdown")]:{[P]:Object.assign(Object.assign({},(0,t6.Wf)(e)),{minWidth:o,backgroundColor:w,borderRadius:m,boxShadow:O,overflow:"hidden",["".concat(_,"-menu")]:{maxHeight:k,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:C,"&:empty::after":{display:"block",padding:"".concat((0,t0.bf)(l)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(P,"-tree")]:{paddingBlock:"".concat((0,t0.bf)(l)," 0"),paddingInline:l,[N]:{padding:0},["".concat(N,"-treenode ").concat(N,"-node-content-wrapper:hover")]:{backgroundColor:S},["".concat(N,"-treenode-checkbox-checked ").concat(N,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(P,"-search")]:{padding:l,borderBottom:T,"&-input":{input:{minWidth:a},[r]:{color:x}}},["".concat(P,"-checkall")]:{width:"100%",marginBottom:i,marginInlineStart:i},["".concat(P,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,t0.bf)(j(l).sub(c).equal())," ").concat((0,t0.bf)(l)),overflow:"hidden",borderTop:T}})}},{["".concat(n,"-dropdown ").concat(P,", ").concat(P,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:l,color:s},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},rX=e=>{let{componentCls:t,lineWidth:n,colorSplit:r,motionDurationSlow:o,zIndexTableFixed:a,tableBg:i,zIndexTableSticky:l,calc:s}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:i},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:s(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:s(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:s(l).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(r)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(r)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(r)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(r)}}}}},rG=e=>{let{componentCls:t,antCls:n,margin:r}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,t0.bf)(r)," 0")},["".concat(t,"-pagination")]:{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"> *":{flex:"none"},"&-left":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-right":{justifyContent:"flex-end"}}}}},rY=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n))}}}}},rQ=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},rJ=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSizeIcon:o,padding:a,paddingXS:i,headerIconColor:l,headerIconHoverColor:s,tableSelectionColumnWidth:c,tableSelectedRowBg:u,tableSelectedRowHoverBg:d,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:h}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:c,["&".concat(t,"-selection-col-with-dropdown")]:{width:h(c).add(o).add(h(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:h(c).add(h(i).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:h(c).add(o).add(h(a).div(4)).add(h(i).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:e.zIndexTableFixed+1},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,t0.bf)(h(p).div(4).equal()),[r]:{color:l,fontSize:o,verticalAlign:"baseline","&:hover":{color:s}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:u,"&-row-hover":{background:d}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},r0=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:r}=e,o=(e,o,a,i)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:i,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,t0.bf)(r(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(r(o).mul(-1).equal())," ").concat((0,t0.bf)(r(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,t0.bf)(r(o).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(r(n).sub(a).equal())," ").concat((0,t0.bf)(r(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,t0.bf)(r(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},o("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),o("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},r1=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:r,headerIconColor:o,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:o,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:r,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},r2=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:r,tableScrollThumbBgHover:o,tableScrollThumbSize:a,tableScrollBg:i,zIndexTableSticky:l,stickyScrollBarBorderRadius:s,lineWidth:c,lineType:u,tableBorderColor:d}=e,f="".concat((0,t0.bf)(c)," ").concat(u," ").concat(d);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:l,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,t0.bf)(a)," !important"),zIndex:l,display:"flex",alignItems:"center",background:i,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:r,borderRadius:s,transition:"all ".concat(e.motionDurationSlow,", transform none"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:o}}}}}}},r6=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:r,calc:o}=e,a="".concat((0,t0.bf)(n)," ").concat(e.lineType," ").concat(r);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,t0.bf)(o(n).mul(-1).equal())," 0 ").concat(r)}}}},r4=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:r,lineType:o,tableBorderColor:a,calc:i}=e,l="".concat((0,t0.bf)(r)," ").concat(o," ").concat(a),s="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-row")]:{display:"flex",boxSizing:"border-box",width:"100%"},["".concat(t,"-cell")]:{borderBottom:l,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(s).concat(s,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,t0.bf)(r),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:l,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:l,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:i(r).mul(-1).equal(),borderInlineStart:l}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:l,borderBottom:l}}}}}};let r3=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:r,tablePaddingHorizontal:o,tableExpandColumnWidth:a,lineWidth:i,lineType:l,tableBorderColor:s,tableFontSize:c,tableBg:u,tableRadius:d,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:h,tableHeaderCellSplitColor:m,tableFooterTextColor:g,tableFooterBg:v,calc:y}=e,b="".concat((0,t0.bf)(i)," ").concat(l," ").concat(s);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%"},(0,t6.dF)()),{[t]:Object.assign(Object.assign({},(0,t6.Wf)(e)),{fontSize:c,background:u,borderRadius:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(d)," 0 0")}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(d)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:h,borderBottom:b,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:m,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:b,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,t0.bf)(y(r).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(y(a).sub(o).equal()),"\n ").concat((0,t0.bf)(y(o).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:h,borderBottom:b,transition:"background ".concat(p," ease")}}},["".concat(t,"-footer")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o)),color:g,background:v}})}};var r5=(0,t3.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:r,controlInteractiveSize:o,headerBg:a,headerColor:i,headerSortActiveBg:l,headerSortHoverBg:s,bodySortBg:c,rowHoverBg:u,rowSelectedBg:d,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:h,cellPaddingInline:m,cellPaddingBlockMD:g,cellPaddingInlineMD:v,cellPaddingBlockSM:y,cellPaddingInlineSM:b,borderColor:x,footerBg:w,footerColor:k,headerBorderRadius:S,cellFontSize:E,cellFontSizeMD:O,cellFontSizeSM:C,headerSplitColor:j,fixedHeaderSortActiveBg:_,headerFilterHoverBg:P,filterDropdownBg:N,expandIconBg:T,selectionColumnWidth:A,stickyScrollBarBg:M,calc:I}=e,R=(0,t4.TS)(e,{tableFontSize:E,tableBg:r,tableRadius:S,tablePaddingVertical:h,tablePaddingHorizontal:m,tablePaddingVerticalMiddle:g,tablePaddingHorizontalMiddle:v,tablePaddingVerticalSmall:y,tablePaddingHorizontalSmall:b,tableBorderColor:x,tableHeaderTextColor:i,tableHeaderBg:a,tableFooterTextColor:k,tableFooterBg:w,tableHeaderCellSplitColor:j,tableHeaderSortBg:l,tableHeaderSortHoverBg:s,tableBodySortBg:c,tableFixedHeaderSortActiveBg:_,tableHeaderFilterActiveBg:P,tableFilterDropdownBg:N,tableRowHoverBg:u,tableSelectedRowBg:d,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:3,tableFontSizeMiddle:O,tableFontSizeSmall:C,tableSelectionColumnWidth:A,tableExpandIconBg:T,tableExpandColumnWidth:I(o).add(I(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:M,tableScrollThumbBgHover:t,tableScrollBg:n});return[r3(R),rG(R),r6(R),r1(R),rV(R),rq(R),rY(R),r$(R),r6(R),rU(R),rJ(R),rX(R),r2(R),rW(R),r0(R),rQ(R),r4(R)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:r,colorFillSecondary:o,colorFillContent:a,controlItemBgActive:i,controlItemBgActiveHover:l,padding:s,paddingSM:c,paddingXS:u,colorBorderSecondary:d,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:h,fontSize:m,fontSizeSM:g,lineHeight:v,lineWidth:y,colorIcon:b,colorIconHover:x,opacityLoading:w,controlInteractiveSize:k}=e,S=new rH.C(o).onBackground(n).toHexShortString(),E=new rH.C(a).onBackground(n).toHexShortString(),O=new rH.C(t).onBackground(n).toHexShortString(),C=new rH.C(b),j=new rH.C(x),_=k/2-y,P=2*_+3*y;return{headerBg:O,headerColor:r,headerSortActiveBg:S,headerSortHoverBg:E,bodySortBg:O,rowHoverBg:O,rowSelectedBg:i,rowSelectedHoverBg:l,rowExpandedBg:t,cellPaddingBlock:s,cellPaddingInline:s,cellPaddingBlockMD:c,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:d,headerBorderRadius:f,footerBg:O,footerColor:r,cellFontSize:m,cellFontSizeMD:m,cellFontSizeSM:m,headerSplitColor:d,fixedHeaderSortActiveBg:S,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:h,stickyScrollBarBorderRadius:100,expandIconMarginTop:(m*v-3*y)/2-Math.ceil((1.4*g-3*y)/2),headerIconColor:C.clone().setAlpha(C.getAlpha()*w).toRgbString(),headerIconHoverColor:j.clone().setAlpha(j.getAlpha()*w).toRgbString(),expandIconHalfInner:_,expandIconSize:P,expandIconScale:k/P}},{unitless:{expandIconScale:!0}});let r8=[];var r7=a.forwardRef((e,t)=>{var n,r;let o,i,s;let{prefixCls:c,className:u,rootClassName:d,style:f,size:p,bordered:h,dropdownPrefixCls:m,dataSource:g,pagination:v,rowSelection:y,rowKey:b="key",rowClassName:x,columns:w,children:k,childrenColumnName:S,onChange:E,getPopupContainer:O,loading:C,expandIcon:j,expandable:P,expandedRowRender:N,expandIconColumnIndex:T,indentSize:A,scroll:M,sortDirections:I,locale:R,showSorterTooltip:D=!0,virtual:L}=e;(0,tp.ln)("Table");let Z=a.useMemo(()=>w||ey(k),[w,k]),z=a.useMemo(()=>Z.some(e=>e.responsive),[Z]),B=(0,tN.Z)(z),F=a.useMemo(()=>{let e=new Set(Object.keys(B).filter(e=>B[e]));return Z.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[Z,B]),H=(0,eY.Z)(e,["className","style","columns"]),{locale:q=tT.Z,direction:W,table:U,renderEmpty:K,getPrefixCls:$,getPopupContainer:V}=a.useContext(tC.E_),X=(0,tP.Z)(p),G=Object.assign(Object.assign({},q.Table),R),Y=g||r8,Q=$("table",c),J=$("dropdown",m),[,ee]=(0,nl.ZP)(),et=(0,t_.Z)(Q),[en,er,eo]=r5(Q,et),ea=Object.assign({childrenColumnName:S,expandIconColumnIndex:T},P),{childrenColumnName:ei="children"}=ea,el=a.useMemo(()=>Y.some(e=>null==e?void 0:e[ei])?"nest":N||P&&P.expandedRowRender?"row":null,[Y]),ec={body:a.useRef()},eu=a.useRef(null),ed=a.useRef(null);n=()=>Object.assign(Object.assign({},ed.current),{nativeElement:eu.current}),(0,a.useImperativeHandle)(t,()=>{let e=n(),{nativeElement:t}=e;return"undefined"!=typeof Proxy?new Proxy(t,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(t._antProxy=t._antProxy||{},Object.keys(e).forEach(n=>{if(!(n in t._antProxy)){let r=t[n];t._antProxy[n]=r,t[n]=e[n]}}),t)});let ef=a.useMemo(()=>"function"==typeof b?b:e=>null==e?void 0:e[b],[b]),[ep]=function(e,t,n){let r=a.useRef({});return[function(o){if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){let o=new Map;!function e(r){r.forEach((r,a)=>{let i=n(r,a);o.set(i,r),r&&"object"==typeof r&&t in r&&e(r[t]||[])})}(e),r.current={data:e,childrenColumnName:t,kvMap:o,getRowKey:n}}return r.current.kvMap.get(o)}]}(Y,ei,ef),eh={},em=function(e,t){var n,r,o;let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Object.assign(Object.assign({},eh),e);a&&(null===(n=eh.resetPagination)||void 0===n||n.call(eh),(null===(r=i.pagination)||void 0===r?void 0:r.current)&&(i.pagination.current=1),v&&v.onChange&&v.onChange(1,null===(o=i.pagination)||void 0===o?void 0:o.pageSize)),M&&!1!==M.scrollToFirstRowOnChange&&ec.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:r,duration:o=450}=t,a=n(),i=function(e,t){var n,r;if("undefined"==typeof window)return 0;let o=t?"scrollTop":"scrollLeft",a=0;return tO(e)?a=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?a=e.documentElement[o]:e instanceof HTMLElement?a=e[o]:e&&(a=e[o]),e&&!tO(e)&&"number"!=typeof a&&(a=null===(r=(null!==(n=e.ownerDocument)&&void 0!==n?n:e).documentElement)||void 0===r?void 0:r[o]),a}(a,!0),l=Date.now(),s=()=>{let t=Date.now()-l,n=function(e,t,n,r){let o=n-t;return(e/=r/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t}(t>o?o:t,i,e,o);tO(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,t<o?(0,tE.Z)(s):"function"==typeof r&&r()};(0,tE.Z)(s)}(0,{getContainer:()=>ec.body.current}),null==E||E(i.pagination,i.filters,i.sorter,{currentDataSource:rw(rz(Y,i.sorterStates,ei),i.filterStates),action:t})},[eg,ev,eb,ex]=function(e){let{prefixCls:t,mergedColumns:n,onSorterChange:r,sortDirections:o,tableLocale:i,showSorterTooltip:l}=e,[s,c]=a.useState(rD(n,!0)),u=a.useMemo(()=>{let e=!0,t=rD(n,!1);if(!t.length)return s;let r=[];function o(t){e?r.push(t):r.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(o(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),o(t))}),r},[n,s]),d=a.useMemo(()=>{let e=u.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}},[u]);function f(e){let t;c(t=!1!==e.multiplePriority&&u.length&&!1!==u[0].multiplePriority?[].concat((0,es.Z)(u.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),r(rZ(t),t)}return[e=>(function e(t,n,r,o,i,l,s,c){return(n||[]).map((n,u)=>{let d=nh(u,c),f=n;if(f.sorter){let e;let c=f.sortDirections||i,u=void 0===f.showSorterTooltip?s:f.showSorterTooltip,p=np(f,d),h=r.find(e=>{let{key:t}=e;return t===p}),m=h?h.sortOrder:null,g=m?c[c.indexOf(m)+1]:c[0];if(n.sortIcon)e=n.sortIcon({sortOrder:m});else{let n=c.includes(rA)&&a.createElement(rN,{className:_()("".concat(t,"-column-sorter-up"),{active:m===rA})}),r=c.includes(rM)&&a.createElement(r_,{className:_()("".concat(t,"-column-sorter-down"),{active:m===rM})});e=a.createElement("span",{className:_()("".concat(t,"-column-sorter"),{["".concat(t,"-column-sorter-full")]:!!(n&&r)})},a.createElement("span",{className:"".concat(t,"-column-sorter-inner"),"aria-hidden":"true"},n,r))}let{cancelSort:v,triggerAsc:y,triggerDesc:b}=l||{},x=v;g===rM?x=b:g===rA&&(x=y);let w="object"==typeof u?Object.assign({title:x},u):{title:x};f=Object.assign(Object.assign({},f),{className:_()(f.className,{["".concat(t,"-column-sort")]:m}),title:r=>{let o=a.createElement("div",{className:"".concat(t,"-column-sorters")},a.createElement("span",{className:"".concat(t,"-column-title")},nm(n.title,r)),e);return u?a.createElement(rT.Z,Object.assign({},w),o):o},onHeaderCell:e=>{let r=n.onHeaderCell&&n.onHeaderCell(e)||{},a=r.onClick,i=r.onKeyDown;r.onClick=e=>{o({column:n,key:p,sortOrder:g,multiplePriority:rI(n)}),null==a||a(e)},r.onKeyDown=e=>{e.keyCode===tz.Z.ENTER&&(o({column:n,key:p,sortOrder:g,multiplePriority:rI(n)}),null==i||i(e))};let l=function(e,t){let n=nm(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n}(n.title,{}),s=null==l?void 0:l.toString();return m?r["aria-sort"]="ascend"===m?"ascending":"descending":r["aria-label"]=s||"",r.className=_()(r.className,"".concat(t,"-column-has-sorters")),r.tabIndex=0,n.ellipsis&&(r.title=(null!=l?l:"").toString()),r}})}return"children"in f&&(f=Object.assign(Object.assign({},f),{children:e(t,f.children,r,o,i,l,s,d)})),f})})(t,e,u,f,o,i,l),u,d,()=>rZ(u)]}({prefixCls:Q,mergedColumns:F,onSorterChange:(e,t)=>{em({sorter:e,sorterStates:t},"sort",!1)},sortDirections:I||["ascend","descend"],tableLocale:G,showSorterTooltip:D}),ew=a.useMemo(()=>rz(Y,ev,ei),[Y,ev]);eh.sorter=ex(),eh.sorterStates=ev;let[ek,eS,eE]=rS({prefixCls:Q,locale:G,dropdownPrefixCls:J,mergedColumns:F,onFilterChange:(e,t)=>{em({filters:e,filterStates:t},"filter",!0)},getPopupContainer:O||V,rootClassName:_()(d,et)}),eO=rw(ew,eS);eh.filters=eE,eh.filterStates=eS;let[eC]=(r=a.useMemo(()=>{let e={};return Object.keys(eE).forEach(t=>{null!==eE[t]&&(e[t]=eE[t])}),Object.assign(Object.assign({},eb),{filters:e})},[eb,eE]),[a.useCallback(e=>(function e(t,n){return t.map(t=>{let r=Object.assign({},t);return r.title=nm(t.title,n),"children"in r&&(r.children=e(r.children,n)),r})})(e,r),[r])]),[ej,e_]=rC(eO.length,(e,t)=>{em({pagination:Object.assign(Object.assign({},eh.pagination),{current:e,pageSize:t})},"paginate")},v);eh.pagination=!1===v?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let r=e[t];"function"!=typeof r&&(n[t]=r)}),n}(ej,v),eh.resetPagination=e_;let eP=a.useMemo(()=>{if(!1===v||!ej.pageSize)return eO;let{current:e=1,total:t,pageSize:n=10}=ej;return eO.length<t?eO.length>n?eO.slice((e-1)*n,e*n):eO:eO.slice((e-1)*n,e*n)},[!!v,eO,ej&&ej.current,ej&&ej.pageSize,ej&&ej.total]),[eN,eT]=tS({prefixCls:Q,data:eO,pageData:eP,getRowKey:ef,getRecordByKey:ep,expandType:el,childrenColumnName:ei,locale:G,getPopupContainer:O||V},y);ea.__PARENT_RENDER_ICON__=ea.expandIcon,ea.expandIcon=ea.expandIcon||j||function(e){let{prefixCls:t,onExpand:n,record:r,expanded:o,expandable:i}=e,l="".concat(t,"-row-expand-icon");return a.createElement("button",{type:"button",onClick:e=>{n(r,e),e.stopPropagation()},className:_()(l,{["".concat(l,"-spaced")]:!i,["".concat(l,"-expanded")]:i&&o,["".concat(l,"-collapsed")]:i&&!o}),"aria-label":o?G.collapse:G.expand,"aria-expanded":o})},"nest"===el&&void 0===ea.expandIconColumnIndex?ea.expandIconColumnIndex=y?1:0:ea.expandIconColumnIndex>0&&y&&(ea.expandIconColumnIndex-=1),"number"!=typeof ea.indentSize&&(ea.indentSize="number"==typeof A?A:15);let eA=a.useCallback(e=>eC(eN(ek(eg(e)))),[eg,ek,eN]);if(!1!==v&&(null==ej?void 0:ej.total)){let e;e=ej.size?ej.size:"small"===X||"middle"===X?"small":void 0;let t=t=>a.createElement(nd,Object.assign({},ej,{className:_()("".concat(Q,"-pagination ").concat(Q,"-pagination-").concat(t),ej.className),size:e})),n="rtl"===W?"left":"right",{position:r}=ej;if(null!==r&&Array.isArray(r)){let e=r.find(e=>e.includes("top")),a=r.find(e=>e.includes("bottom")),l=r.every(e=>"none"==="".concat(e));e||a||l||(i=t(n)),e&&(o=t(e.toLowerCase().replace("top",""))),a&&(i=t(a.toLowerCase().replace("bottom","")))}else i=t(n)}"boolean"==typeof C?s={spinning:C}:"object"==typeof C&&(s=Object.assign({spinning:!0},C));let eM=_()(eo,et,"".concat(Q,"-wrapper"),null==U?void 0:U.className,{["".concat(Q,"-wrapper-rtl")]:"rtl"===W},u,d,er),eI=Object.assign(Object.assign({},null==U?void 0:U.style),f),eR=R&&R.emptyText||(null==K?void 0:K("Table"))||a.createElement(tj.Z,{componentName:"Table"}),eD={},eL=a.useMemo(()=>{let{fontSize:e,lineHeight:t,padding:n,paddingXS:r,paddingSM:o}=ee,a=Math.floor(e*t);switch(X){case"large":return 2*n+a;case"small":return 2*r+a;default:return 2*o+a}},[ee,X]);return L&&(eD.listItemHeight=eL),en(a.createElement("div",{ref:eu,className:eM,style:eI},a.createElement(nf.Z,Object.assign({spinning:!1},s),o,a.createElement(L?rF:rB,Object.assign({},eD,H,{ref:ed,columns:F,direction:W,expandable:ea,prefixCls:Q,className:_()({["".concat(Q,"-middle")]:"middle"===X,["".concat(Q,"-small")]:"small"===X,["".concat(Q,"-bordered")]:h,["".concat(Q,"-empty")]:0===Y.length},eo,et,er),data:eP,rowKey:ef,rowClassName:(e,t,n)=>{let r;return r="function"==typeof x?_()(x(e,t,n)):_()(x),_()({["".concat(Q,"-row-selected")]:eT.has(ef(e,t))},r)},emptyText:eR,internalHooks:l,internalRefs:ec,transformColumns:eA,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(Q,"-container")),r=t;if(n){let e=getComputedStyle(n);r=t-parseInt(e.borderLeftWidth,10)-parseInt(e.borderRightWidth,10)}return r}})),i)))});let r9=a.forwardRef((e,t)=>{let n=a.useRef(0);return n.current+=1,a.createElement(r7,Object.assign({},e,{ref:t,_renderTimes:n.current}))});r9.SELECTION_COLUMN=tv,r9.EXPAND_COLUMN=i,r9.SELECTION_ALL=ty,r9.SELECTION_INVERT=tb,r9.SELECTION_NONE=tx,r9.Column=function(e){return null},r9.ColumnGroup=function(e){return null},r9.Summary=F;var oe=r9},93192:function(e,t,n){"use strict";n.d(t,{default:function(){return ef}});var r=n(2265),o=n(9738),a=n(23639),i=n(1119),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},s=n(55015),c=r.forwardRef(function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:l}))}),u=n(36760),d=n.n(u),f=n(49211),p=n.n(f),h=n(31474),m=n(45287),g=n(27380),v=n(50506),y=n(18694),b=n(28791),x=n(10281),w=n(95814),k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let S={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},E=r.forwardRef((e,t)=>{let{style:n,noStyle:o,disabled:a}=e,i=k(e,["style","noStyle","disabled"]),l={};return o||(l=Object.assign({},S)),a&&(l.pointerEvents="none"),l=Object.assign(Object.assign({},l),n),r.createElement("div",Object.assign({role:"button",tabIndex:0,ref:t},i,{onKeyDown:e=>{let{keyCode:t}=e;t===w.Z.ENTER&&e.preventDefault()},onKeyUp:t=>{let{keyCode:n}=t,{onClick:r}=e;n===w.Z.ENTER&&r&&r()},style:l}))});var O=n(71744),C=n(55274),j=n(89970),_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},P=r.forwardRef(function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:_}))}),N=n(19722),T=n(90464),A=n(76122),M=n(80669),I=n(31373),R=n(352);let D=(e,t,n,r)=>{let{titleMarginBottom:o,fontWeightStrong:a}=r;return{marginBottom:o,color:n,fontWeight:a,fontSize:e,lineHeight:t}},L=e=>{let t={};return[1,2,3,4,5].forEach(n=>{t["\n h".concat(n,"&,\n div&-h").concat(n,",\n div&-h").concat(n," > textarea,\n h").concat(n,"\n ")]=D(e["fontSizeHeading".concat(n)],e["lineHeightHeading".concat(n)],e.colorTextHeading,e)}),t},Z=e=>{let{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},(0,A.N)(e)),{textDecoration:e.linkDecoration,"&:active, &:hover":{textDecoration:e.linkHoverDecoration},["&[disabled], &".concat(t,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},z=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:I.EV[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),B=e=>{let{componentCls:t,paddingSM:n}=e;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),marginTop:e.calc(n).mul(-1).equal(),marginBottom:"calc(1em - ".concat((0,R.bf)(n),")")},["".concat(t,"-edit-content-confirm")]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorTextDescription,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},F=e=>({["".concat(e.componentCls,"-copy-success")]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},["".concat(e.componentCls,"-copy-icon-only")]:{marginInlineStart:0}}),H=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-single-line":{whiteSpace:"nowrap"},"&-ellipsis-single-line":{overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),q=e=>{let{componentCls:t,titleMarginTop:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,["&".concat(t,"-secondary")]:{color:e.colorTextDescription},["&".concat(t,"-success")]:{color:e.colorSuccess},["&".concat(t,"-warning")]:{color:e.colorWarning},["&".concat(t,"-danger")]:{color:e.colorError,"a&:active, a&:focus":{color:e.colorErrorActive},"a&:hover":{color:e.colorErrorHover}},["&".concat(t,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},L(e)),{["\n & + h1".concat(t,",\n & + h2").concat(t,",\n & + h3").concat(t,",\n & + h4").concat(t,",\n & + h5").concat(t,"\n ")]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),z(e)),Z(e)),{["\n ".concat(t,"-expand,\n ").concat(t,"-edit,\n ").concat(t,"-copy\n ")]:Object.assign(Object.assign({},(0,A.N)(e)),{marginInlineStart:e.marginXXS})}),B(e)),F(e)),H()),{"&-rtl":{direction:"rtl"}})}};var W=(0,M.I$)("Typography",e=>[q(e)],()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"})),U=e=>{let{prefixCls:t,"aria-label":n,className:o,style:a,direction:i,maxLength:l,autoSize:s=!0,value:c,onSave:u,onCancel:f,onEnd:p,component:h,enterIcon:m=r.createElement(P,null)}=e,g=r.useRef(null),v=r.useRef(!1),y=r.useRef(),[b,x]=r.useState(c);r.useEffect(()=>{x(c)},[c]),r.useEffect(()=>{if(g.current&&g.current.resizableTextArea){let{textArea:e}=g.current.resizableTextArea;e.focus();let{length:t}=e.value;e.setSelectionRange(t,t)}},[]);let k=()=>{u(b.trim())},S=h?"".concat(t,"-").concat(h):"",[E,O,C]=W(t),j=d()(t,"".concat(t,"-edit-content"),{["".concat(t,"-rtl")]:"rtl"===i},o,S,O,C);return E(r.createElement("div",{className:j,style:a},r.createElement(T.Z,{ref:g,maxLength:l,value:b,onChange:e=>{let{target:t}=e;x(t.value.replace(/[\n\r]/g,""))},onKeyDown:e=>{let{keyCode:t}=e;v.current||(y.current=t)},onKeyUp:e=>{let{keyCode:t,ctrlKey:n,altKey:r,metaKey:o,shiftKey:a}=e;y.current!==t||v.current||n||r||o||a||(t===w.Z.ENTER?(k(),null==p||p()):t===w.Z.ESC&&f())},onCompositionStart:()=>{v.current=!0},onCompositionEnd:()=>{v.current=!1},onBlur:()=>{k()},"aria-label":n,rows:1,autoSize:s}),null!==m?(0,N.Tm)(m,{className:"".concat(t,"-edit-content-confirm")}):null))};function K(e,t){return r.useMemo(()=>{let n=!!e;return[n,Object.assign(Object.assign({},t),n&&"object"==typeof e?e:null)]},[e])}var $=(e,t)=>{let n=r.useRef(!1);r.useEffect(()=>{n.current?e():n.current=!0},t)},V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let X=r.forwardRef((e,t)=>{let{prefixCls:n,component:o="article",className:a,rootClassName:i,setContentRef:l,children:s,direction:c,style:u}=e,f=V(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:p,direction:h,typography:m}=r.useContext(O.E_),g=t;l&&(g=(0,b.sQ)(t,l));let v=p("typography",n),[y,x,w]=W(v),k=d()(v,null==m?void 0:m.className,{["".concat(v,"-rtl")]:"rtl"===(null!=c?c:h)},a,i,x,w),S=Object.assign(Object.assign({},null==m?void 0:m.style),u);return y(r.createElement(o,Object.assign({className:k,style:S,ref:g},f),s))});function G(e){let t=typeof e;return"string"===t||"number"===t}function Y(e,t){let n=0,r=[];for(let o=0;o<e.length;o+=1){if(n===t)return r;let a=e[o],i=n+(G(a)?String(a).length:1);if(i>t){let e=t-n;return r.push(String(a).slice(0,e)),r}r.push(a),n=i}return e}var Q=e=>{let{enabledMeasure:t,children:n,text:o,width:a,fontSize:i,rows:l,onEllipsis:s}=e,[[c,u,d],f]=r.useState([0,0,0]),[p,h]=r.useState(0),[v,y]=r.useState(0),[b,x]=r.useState(0),w=r.useRef(null),k=r.useRef(null),S=r.useMemo(()=>(0,m.Z)(o),[o]),E=r.useMemo(()=>{let e;return e=0,S.forEach(t=>{G(t)?e+=String(t).length:e+=1}),e},[S]),O=r.useMemo(()=>t&&3===v?n(Y(S,u),u<E):p&&4!==v&&t?n(Y(S,p),p<E):n(S,!1),[t,v,n,S,u,E]);(0,g.Z)(()=>{t&&a&&i&&E&&(y(1),f([0,Math.ceil(E/2),E]))},[t,a,i,o,E,l]),(0,g.Z)(()=>{var e;1===v&&x((null===(e=w.current)||void 0===e?void 0:e.offsetHeight)||0)},[v]),(0,g.Z)(()=>{var e,t;if(b){if(1===v)((null===(e=k.current)||void 0===e?void 0:e.offsetHeight)||0)<=l*b?(y(4),s(!1)):y(2);else if(2===v){if(c!==d){let e=(null===(t=k.current)||void 0===t?void 0:t.offsetHeight)||0,n=l*b,r=c,o=d;c===d-1?o=c:e<=n?r=u:o=u;let a=Math.ceil((r+o)/2);f([r,a,o])}else y(3),h(u),s(!0)}}},[v,c,d,l,b]);let C=(e,t,n)=>r.createElement("span",{"aria-hidden":!0,ref:t,style:Object.assign({position:"fixed",display:"block",left:0,top:0,zIndex:-9999,visibility:"hidden",pointerEvents:"none",fontSize:2*Math.ceil(i/2)},n)},e);return r.createElement(r.Fragment,null,O,t&&3!==v&&4!==v&&r.createElement(r.Fragment,null,C("lg",w,{wordBreak:"keep-all",whiteSpace:"nowrap"}),C(1===v?n(S,!1):n(Y(S,u),!0),k,{width:a,whiteSpace:"normal",margin:0,padding:0})))},J=e=>{let{enabledEllipsis:t,isEllipsis:n,children:o,tooltipProps:a}=e;return(null==a?void 0:a.title)&&t?r.createElement(j.Z,Object.assign({open:!!n&&void 0},a),o):o},ee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function et(e,t,n){return!0===e||void 0===e?t:e||n&&t}function en(e){return!1===e?[!1,!1]:Array.isArray(e)?e:[e]}let er=r.forwardRef((e,t)=>{var n,i,l;let{prefixCls:s,className:u,style:f,type:w,disabled:k,children:S,ellipsis:_,editable:P,copyable:N,component:T,title:A}=e,M=ee(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:I,direction:R}=r.useContext(O.E_),[D]=(0,C.Z)("Text"),L=r.useRef(null),Z=r.useRef(null),z=I("typography",s),B=(0,y.Z)(M,["mark","code","delete","underline","strong","keyboard","italic"]),[F,H]=K(P),[q,W]=(0,v.Z)(!1,{value:H.editing}),{triggerType:V=["icon"]}=H,G=e=>{var t;e&&(null===(t=H.onStart)||void 0===t||t.call(H)),W(e)};$(()=>{var e;q||null===(e=Z.current)||void 0===e||e.focus()},[q]);let Y=e=>{null==e||e.preventDefault(),G(!0)},[er,eo]=K(N),[ea,ei]=r.useState(!1),el=r.useRef(null),es={};eo.format&&(es.format=eo.format);let ec=()=>{el.current&&clearTimeout(el.current)},eu=e=>{var t;null==e||e.preventDefault(),null==e||e.stopPropagation(),p()(eo.text||String(S)||"",es),ei(!0),ec(),el.current=setTimeout(()=>{ei(!1)},3e3),null===(t=eo.onCopy)||void 0===t||t.call(eo,e)};r.useEffect(()=>ec,[]);let[ed,ef]=r.useState(!1),[ep,eh]=r.useState(!1),[em,eg]=r.useState(!1),[ev,ey]=r.useState(!1),[eb,ex]=r.useState(!1),[ew,ek]=r.useState(!0),[eS,eE]=K(_,{expandable:!1}),eO=eS&&!em,{rows:eC=1}=eE,ej=r.useMemo(()=>!eO||void 0!==eE.suffix||eE.onEllipsis||eE.expandable||F||er,[eO,eE,F,er]);(0,g.Z)(()=>{eS&&!ej&&(ef((0,x.G)("webkitLineClamp")),eh((0,x.G)("textOverflow")))},[ej,eS]);let e_=r.useMemo(()=>!ej&&(1===eC?ep:ed),[ej,ep,ed]),eP=eO&&(e_?eb:ev),eN=eO&&1===eC&&e_,eT=eO&&eC>1&&e_,eA=e=>{var t;eg(!0),null===(t=eE.onExpand)||void 0===t||t.call(eE,e)},[eM,eI]=r.useState(0),[eR,eD]=r.useState(0),eL=e=>{var t;ey(e),ev!==e&&(null===(t=eE.onEllipsis)||void 0===t||t.call(eE,e))};r.useEffect(()=>{let e=L.current;if(eS&&e_&&e){let t=eT?e.offsetHeight<e.scrollHeight:e.offsetWidth<e.scrollWidth;eb!==t&&ex(t)}},[eS,e_,S,eT,ew,eM]),r.useEffect(()=>{let e=L.current;if("undefined"==typeof IntersectionObserver||!e||!e_||!eO)return;let t=new IntersectionObserver(()=>{ek(!!e.offsetParent)});return t.observe(e),()=>{t.disconnect()}},[e_,eO]);let eZ={};eZ=!0===eE.tooltip?{title:null!==(n=H.text)&&void 0!==n?n:S}:r.isValidElement(eE.tooltip)?{title:eE.tooltip}:"object"==typeof eE.tooltip?Object.assign({title:null!==(i=H.text)&&void 0!==i?i:S},eE.tooltip):{title:eE.tooltip};let ez=r.useMemo(()=>{let e=e=>["string","number"].includes(typeof e);return!eS||e_?void 0:e(H.text)?H.text:e(S)?S:e(A)?A:e(eZ.title)?eZ.title:void 0},[eS,e_,A,eZ.title,eP]);if(q)return r.createElement(U,{value:null!==(l=H.text)&&void 0!==l?l:"string"==typeof S?S:"",onSave:e=>{var t;null===(t=H.onChange)||void 0===t||t.call(H,e),G(!1)},onCancel:()=>{var e;null===(e=H.onCancel)||void 0===e||e.call(H),G(!1)},onEnd:H.onEnd,prefixCls:z,className:u,style:f,direction:R,component:T,maxLength:H.maxLength,autoSize:H.autoSize,enterIcon:H.enterIcon});let eB=()=>{let e;let{expandable:t,symbol:n}=eE;return t?(e=n||(null==D?void 0:D.expand),r.createElement("a",{key:"expand",className:"".concat(z,"-expand"),onClick:eA,"aria-label":null==D?void 0:D.expand},e)):null},eF=()=>{if(!F)return;let{icon:e,tooltip:t}=H,n=(0,m.Z)(t)[0]||(null==D?void 0:D.edit),o="string"==typeof n?n:"";return V.includes("icon")?r.createElement(j.Z,{key:"edit",title:!1===t?"":n},r.createElement(E,{ref:Z,className:"".concat(z,"-edit"),onClick:Y,"aria-label":o},e||r.createElement(c,{role:"button"}))):null},eH=()=>{if(!er)return null;let{tooltips:e,icon:t}=eo,n=en(e),i=en(t),l=ea?et(n[1],null==D?void 0:D.copied):et(n[0],null==D?void 0:D.copy),s=ea?null==D?void 0:D.copied:null==D?void 0:D.copy,c="string"==typeof l?l:s;return r.createElement(j.Z,{key:"copy",title:l},r.createElement(E,{className:d()("".concat(z,"-copy"),{["".concat(z,"-copy-success")]:ea,["".concat(z,"-copy-icon-only")]:null==S}),onClick:eu,"aria-label":c},ea?et(i[1],r.createElement(o.Z,null),!0):et(i[0],r.createElement(a.Z,null),!0)))},eq=e=>[e&&eB(),eF(),eH()],eW=e=>[e&&r.createElement("span",{"aria-hidden":!0,key:"ellipsis"},"..."),eE.suffix,eq(e)];return r.createElement(h.Z,{onResize:(e,t)=>{var n;let{offsetWidth:r}=e;eI(r),eD(parseInt(null===(n=window.getComputedStyle)||void 0===n?void 0:n.call(window,t).fontSize,10)||0)},disabled:!eO},n=>r.createElement(J,{tooltipProps:eZ,enabledEllipsis:eO,isEllipsis:eP},r.createElement(X,Object.assign({className:d()({["".concat(z,"-").concat(w)]:w,["".concat(z,"-disabled")]:k,["".concat(z,"-ellipsis")]:eS,["".concat(z,"-single-line")]:eO&&1===eC,["".concat(z,"-ellipsis-single-line")]:eN,["".concat(z,"-ellipsis-multiple-line")]:eT},u),prefixCls:s,style:Object.assign(Object.assign({},f),{WebkitLineClamp:eT?eC:void 0}),component:T,ref:(0,b.sQ)(n,L,t),direction:R,onClick:V.includes("text")?Y:void 0,"aria-label":null==ez?void 0:ez.toString(),title:A},B),r.createElement(Q,{enabledMeasure:eO&&!e_,text:S,rows:eC,width:eM,fontSize:eR,onEllipsis:eL},(t,n)=>{let o=t;return t.length&&n&&ez&&(o=r.createElement("span",{key:"show-content","aria-hidden":!0},o)),function(e,t){let{mark:n,code:o,underline:a,delete:i,strong:l,keyboard:s,italic:c}=e,u=t;function d(e,t){t&&(u=r.createElement(e,{},u))}return d("strong",l),d("u",a),d("del",i),d("code",o),d("mark",n),d("kbd",s),d("i",c),u}(e,r.createElement(r.Fragment,null,o,eW(n)))}))))});var eo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let ea=r.forwardRef((e,t)=>{var{ellipsis:n,rel:o}=e,a=eo(e,["ellipsis","rel"]);let i=Object.assign(Object.assign({},a),{rel:void 0===o&&"_blank"===a.target?"noopener noreferrer":o});return delete i.navigate,r.createElement(er,Object.assign({},i,{ref:t,ellipsis:!!n,component:"a"}))}),ei=r.forwardRef((e,t)=>r.createElement(er,Object.assign({ref:t},e,{component:"div"})));var el=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},es=r.forwardRef((e,t)=>{var{ellipsis:n}=e,o=el(e,["ellipsis"]);let a=r.useMemo(()=>n&&"object"==typeof n?(0,y.Z)(n,["expandable","rows"]):n,[n]);return r.createElement(er,Object.assign({ref:t},o,{ellipsis:a,component:"span"}))}),ec=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eu=[1,2,3,4,5],ed=r.forwardRef((e,t)=>{let n;let{level:o=1}=e,a=ec(e,["level"]);return n=eu.includes(o)?"h".concat(o):"h1",r.createElement(er,Object.assign({ref:t},a,{component:n}))});X.Text=es,X.Link=ea,X.Title=ed,X.Paragraph=ei;var ef=X},85010:function(e,t,n){"use strict";n.d(t,{default:function(){return eT}});var r=n(2265),o=n(83145),a=n(54887),i=n(36760),l=n.n(i),s=n(1119),c=n(76405),u=n(25049),d=n(63496),f=n(15354),p=n(15900),h=n(11993),m=n(31686),g=n(6989),v=n(73129),y=n(41154),b=n(54580),x=n(18242),w=n(32559),k=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){var n=r.toLowerCase(),i=t.toLowerCase(),l=[i];return(".jpg"===i||".jpeg"===i)&&(l=[".jpg",".jpeg"]),l.some(function(e){return n.endsWith(e)})}return/\/\*$/.test(t)?a===t.replace(/\/.*$/,""):o===t||!!/^\w+$/.test(t)&&((0,w.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(t,"'.Skip for check.")),!0)})}return!0};function S(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}var E=function(e,t,n){var r=function e(r,o){if(r){if(r.path=o||"",r.isFile)r.file(function(e){n(e)&&(r.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))});else if(r.isDirectory){var a,i,l;a=function(t){t.forEach(function(t){e(t,"".concat(o).concat(r.name,"/"))})},i=r.createReader(),l=[],function e(){i.readEntries(function(t){var n=Array.prototype.slice.apply(t);l=l.concat(n),n.length?e():a(l)})}()}}};e.forEach(function(e){r(e.webkitGetAsEntry())})},O=+new Date,C=0;function j(){return"rc-upload-".concat(O,"-").concat(++C)}var _=["component","prefixCls","className","classNames","disabled","id","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],P=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){(0,c.Z)(this,n);for(var e,r,a=arguments.length,i=Array(a),l=0;l<a;l++)i[l]=arguments[l];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,d.Z)(e),"state",{uid:j()}),(0,h.Z)((0,d.Z)(e),"reqs",{}),(0,h.Z)((0,d.Z)(e),"fileInput",void 0),(0,h.Z)((0,d.Z)(e),"_isMounted",void 0),(0,h.Z)((0,d.Z)(e),"onChange",function(t){var n=e.props,r=n.accept,a=n.directory,i=t.target.files,l=(0,o.Z)(i).filter(function(e){return!a||k(e,r)});e.uploadFiles(l),e.reset()}),(0,h.Z)((0,d.Z)(e),"onClick",function(t){var n=e.fileInput;if(n){var r=t.target,o=e.props.onClick;r&&"BUTTON"===r.tagName&&(n.parentNode.focus(),r.blur()),n.click(),o&&o(t)}}),(0,h.Z)((0,d.Z)(e),"onKeyDown",function(t){"Enter"===t.key&&e.onClick(t)}),(0,h.Z)((0,d.Z)(e),"onFileDrop",function(t){var n=e.props.multiple;if(t.preventDefault(),"dragover"!==t.type){if(e.props.directory)E(Array.prototype.slice.call(t.dataTransfer.items),e.uploadFiles,function(t){return k(t,e.props.accept)});else{var r=(0,o.Z)(t.dataTransfer.files).filter(function(t){return k(t,e.props.accept)});!1===n&&(r=r.slice(0,1)),e.uploadFiles(r)}}}),(0,h.Z)((0,d.Z)(e),"uploadFiles",function(t){var n=(0,o.Z)(t);Promise.all(n.map(function(t){return t.uid=j(),e.processFile(t,n)})).then(function(t){var n=e.props.onBatchStart;null==n||n(t.map(function(e){return{file:e.origin,parsedFile:e.parsedFile}})),t.filter(function(e){return null!==e.parsedFile}).forEach(function(t){e.post(t)})})}),(0,h.Z)((0,d.Z)(e),"processFile",(r=(0,b.Z)((0,v.Z)().mark(function t(n,r){var o,a,i,l,s,c,u,d,f;return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.props.beforeUpload,a=n,!o){t.next=14;break}return t.prev=3,t.next=6,o(n,r);case 6:a=t.sent,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),a=!1;case 12:if(!1!==a){t.next=14;break}return t.abrupt("return",{origin:n,parsedFile:null,action:null,data:null});case 14:if("function"!=typeof(i=e.props.action)){t.next=21;break}return t.next=18,i(n);case 18:l=t.sent,t.next=22;break;case 21:l=i;case 22:if("function"!=typeof(s=e.props.data)){t.next=29;break}return t.next=26,s(n);case 26:c=t.sent,t.next=30;break;case 29:c=s;case 30:return(u=("object"===(0,y.Z)(a)||"string"==typeof a)&&a?a:n)instanceof File?d=u:d=new File([u],n.name,{type:n.type}),(f=d).uid=n.uid,t.abrupt("return",{origin:n,data:c,parsedFile:f,action:l});case 35:case"end":return t.stop()}},t,null,[[3,9]])})),function(e,t){return r.apply(this,arguments)})),(0,h.Z)((0,d.Z)(e),"saveFileInput",function(t){e.fileInput=t}),e}return(0,u.Z)(n,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(e){var t=this,n=e.data,r=e.origin,o=e.action,a=e.parsedFile;if(this._isMounted){var i=this.props,l=i.onStart,s=i.customRequest,c=i.name,u=i.headers,d=i.withCredentials,f=i.method,p=r.uid;l(r),this.reqs[p]=(s||function(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(t){var r=e.data[t];if(Array.isArray(r)){r.forEach(function(e){n.append("".concat(t,"[]"),e)});return}n.append(t,r)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300){var n;return e.onError(((n=Error("cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"))).status=t.status,n.method=e.method,n.url=e.action,n),S(t))}return e.onSuccess(S(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return null!==r["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(e){null!==r[e]&&t.setRequestHeader(e,r[e])}),t.send(n),{abort:function(){t.abort()}}})({action:o,filename:c,data:n,file:a,headers:u,withCredentials:d,method:f||"post",onProgress:function(e){var n=t.props.onProgress;null==n||n(e,a)},onSuccess:function(e,n){var r=t.props.onSuccess;null==r||r(e,a,n),delete t.reqs[p]},onError:function(e,n){var r=t.props.onError;null==r||r(e,n,a),delete t.reqs[p]}})}}},{key:"reset",value:function(){this.setState({uid:j()})}},{key:"abort",value:function(e){var t=this.reqs;if(e){var n=e.uid?e.uid:e;t[n]&&t[n].abort&&t[n].abort(),delete t[n]}else Object.keys(t).forEach(function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]})}},{key:"render",value:function(){var e,t=this.props,n=t.component,o=t.prefixCls,a=t.className,i=t.classNames,c=t.disabled,u=t.id,d=t.style,f=t.styles,p=t.multiple,v=t.accept,y=t.capture,b=t.children,w=t.directory,k=t.openFileDialogOnClick,S=t.onMouseEnter,E=t.onMouseLeave,O=t.hasControlInside,C=(0,g.Z)(t,_),j=l()((e={},(0,h.Z)(e,o,!0),(0,h.Z)(e,"".concat(o,"-disabled"),c),(0,h.Z)(e,a,a),e)),P=c?{}:{onClick:k?this.onClick:function(){},onKeyDown:k?this.onKeyDown:function(){},onMouseEnter:S,onMouseLeave:E,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:O?void 0:"0"};return r.createElement(n,(0,s.Z)({},P,{className:j,role:O?void 0:"button",style:d}),r.createElement("input",(0,s.Z)({},(0,x.Z)(C,{aria:!0,data:!0}),{id:u,disabled:c,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:(0,m.Z)({display:"none"},(void 0===f?{}:f).input),className:(void 0===i?{}:i).input,accept:v},w?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},{multiple:p,onChange:this.onChange},null!=y?{capture:y}:{})),b)}}]),n}(r.Component);function N(){}var T=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;(0,c.Z)(this,n);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),(0,h.Z)((0,d.Z)(e),"uploader",void 0),(0,h.Z)((0,d.Z)(e),"saveUploader",function(t){e.uploader=t}),e}return(0,u.Z)(n,[{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){return r.createElement(P,(0,s.Z)({},this.props,{ref:this.saveUploader}))}}]),n}(r.Component);(0,h.Z)(T,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:N,onError:N,onSuccess:N,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});var A=n(50506),M=n(71744),I=n(86586),R=n(55274),D=n(13823),L=n(12918),Z=n(63074),z=n(80669),B=n(3104),F=n(352),H=e=>{let{componentCls:t,iconCls:n}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-drag")]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:"".concat((0,F.bf)(e.lineWidth)," dashed ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),[t]:{padding:e.padding},["".concat(t,"-btn")]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:"".concat((0,F.bf)(e.lineWidthFocus)," solid ").concat(e.colorPrimaryBorder)}},["".concat(t,"-drag-container")]:{display:"table-cell",verticalAlign:"middle"},["\n &:not(".concat(t,"-disabled):hover,\n &-hover:not(").concat(t,"-disabled)\n ")]:{borderColor:e.colorPrimaryHover},["p".concat(t,"-drag-icon")]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},["p".concat(t,"-text")]:{margin:"0 0 ".concat((0,F.bf)(e.marginXXS)),color:e.colorTextHeading,fontSize:e.fontSizeLG},["p".concat(t,"-hint")]:{color:e.colorTextDescription,fontSize:e.fontSize},["&".concat(t,"-disabled")]:{["p".concat(t,"-drag-icon ").concat(n,",\n p").concat(t,"-text,\n p").concat(t,"-hint\n ")]:{color:e.colorTextDisabled}}}}}},q=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSize:o,lineHeight:a,calc:i}=e,l="".concat(t,"-list-item"),s="".concat(l,"-actions"),c="".concat(l,"-action"),u=e.fontHeightSM;return{["".concat(t,"-wrapper")]:{["".concat(t,"-list")]:Object.assign(Object.assign({},(0,L.dF)()),{lineHeight:e.lineHeight,[l]:{position:"relative",height:i(e.lineHeight).mul(o).equal(),marginTop:e.marginXS,fontSize:o,display:"flex",alignItems:"center",transition:"background-color ".concat(e.motionDurationSlow),"&:hover":{backgroundColor:e.controlItemBgHover},["".concat(l,"-name")]:Object.assign(Object.assign({},L.vS),{padding:"0 ".concat((0,F.bf)(e.paddingXS)),lineHeight:a,flex:"auto",transition:"all ".concat(e.motionDurationSlow)}),[s]:{[c]:{opacity:0},[r]:{color:e.actionsColor,transition:"all ".concat(e.motionDurationSlow)},["\n ".concat(c,":focus-visible,\n &.picture ").concat(c,"\n ")]:{opacity:1},["".concat(c).concat(n,"-btn")]:{height:u,border:0,lineHeight:1}},["".concat(t,"-icon ").concat(r)]:{color:e.colorTextDescription,fontSize:o},["".concat(l,"-progress")]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:i(o).add(e.paddingXS).equal(),fontSize:o,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},["".concat(l,":hover ").concat(c)]:{opacity:1},["".concat(l,"-error")]:{color:e.colorError,["".concat(l,"-name, ").concat(t,"-icon ").concat(r)]:{color:e.colorError},[s]:{["".concat(r,", ").concat(r,":hover")]:{color:e.colorError},[c]:{opacity:1}}},["".concat(t,"-list-item-container")]:{transition:"opacity ".concat(e.motionDurationSlow,", height ").concat(e.motionDurationSlow),"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},W=n(11699);let U=new F.E4("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),K=new F.E4("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var $=e=>{let{componentCls:t}=e,n="".concat(t,"-animate-inline");return[{["".concat(t,"-wrapper")]:{["".concat(n,"-appear, ").concat(n,"-enter, ").concat(n,"-leave")]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},["".concat(n,"-appear, ").concat(n,"-enter")]:{animationName:U},["".concat(n,"-leave")]:{animationName:K}}},{["".concat(t,"-wrapper")]:(0,W.J$)(e)},U,K]},V=n(31373);let X=e=>{let{componentCls:t,iconCls:n,uploadThumbnailSize:r,uploadProgressOffset:o,calc:a}=e,i="".concat(t,"-list"),l="".concat(i,"-item");return{["".concat(t,"-wrapper")]:{["\n ".concat(i).concat(i,"-picture,\n ").concat(i).concat(i,"-picture-card,\n ").concat(i).concat(i,"-picture-circle\n ")]:{[l]:{position:"relative",height:a(r).add(a(e.lineWidth).mul(2)).add(a(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:"".concat((0,F.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},["".concat(l,"-thumbnail")]:Object.assign(Object.assign({},L.vS),{width:r,height:r,lineHeight:(0,F.bf)(a(r).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),["".concat(l,"-progress")]:{bottom:o,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingSM).mul(2).equal()),")"),marginTop:0,paddingInlineStart:a(r).add(e.paddingXS).equal()}},["".concat(l,"-error")]:{borderColor:e.colorError,["".concat(l,"-thumbnail ").concat(n)]:{["svg path[fill='".concat(V.iN[0],"']")]:{fill:e.colorErrorBg},["svg path[fill='".concat(V.iN.primary,"']")]:{fill:e.colorError}}},["".concat(l,"-uploading")]:{borderStyle:"dashed",["".concat(l,"-name")]:{marginBottom:o}}},["".concat(i).concat(i,"-picture-circle ").concat(l)]:{["&, &::before, ".concat(l,"-thumbnail")]:{borderRadius:"50%"}}}}},G=e=>{let{componentCls:t,iconCls:n,fontSizeLG:r,colorTextLightSolid:o,calc:a}=e,i="".concat(t,"-list"),l="".concat(i,"-item"),s=e.uploadPicCardSize;return{["\n ".concat(t,"-wrapper").concat(t,"-picture-card-wrapper,\n ").concat(t,"-wrapper").concat(t,"-picture-circle-wrapper\n ")]:Object.assign(Object.assign({},(0,L.dF)()),{display:"inline-block",width:"100%",["".concat(t).concat(t,"-select")]:{width:s,height:s,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:"".concat((0,F.bf)(e.lineWidth)," dashed ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),["> ".concat(t)]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},["&:not(".concat(t,"-disabled):hover")]:{borderColor:e.colorPrimary}},["".concat(i).concat(i,"-picture-card, ").concat(i).concat(i,"-picture-circle")]:{["".concat(i,"-item-container")]:{display:"inline-block",width:s,height:s,marginBlock:"0 ".concat((0,F.bf)(e.marginXS)),marginInline:"0 ".concat((0,F.bf)(e.marginXS)),verticalAlign:"top"},"&::after":{display:"none"},[l]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),height:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),backgroundColor:e.colorBgMask,opacity:0,transition:"all ".concat(e.motionDurationSlow),content:'" "'}},["".concat(l,":hover")]:{["&::before, ".concat(l,"-actions")]:{opacity:1}},["".concat(l,"-actions")]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:"all ".concat(e.motionDurationSlow),["\n ".concat(n,"-eye,\n ").concat(n,"-download,\n ").concat(n,"-delete\n ")]:{zIndex:10,width:r,margin:"0 ".concat((0,F.bf)(e.marginXXS)),fontSize:r,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},["".concat(l,"-thumbnail, ").concat(l,"-thumbnail img")]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},["".concat(l,"-name")]:{display:"none",textAlign:"center"},["".concat(l,"-file + ").concat(l,"-name")]:{position:"absolute",bottom:e.margin,display:"block",width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")")},["".concat(l,"-uploading")]:{["&".concat(l)]:{backgroundColor:e.colorFillAlter},["&::before, ".concat(n,"-eye, ").concat(n,"-download, ").concat(n,"-delete")]:{display:"none"}},["".concat(l,"-progress")]:{bottom:e.marginXL,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),paddingInlineStart:0}}}),["".concat(t,"-wrapper").concat(t,"-picture-circle-wrapper")]:{["".concat(t).concat(t,"-select")]:{borderRadius:"50%"}}}};var Y=e=>{let{componentCls:t}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"}}};let Q=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,L.Wf)(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},["".concat(t,"-select")]:{display:"inline-block"},["".concat(t,"-disabled")]:{color:n,cursor:"not-allowed"}})}};var J=(0,z.I$)("Upload",e=>{let{fontSizeHeading3:t,fontHeight:n,lineWidth:r,controlHeightLG:o,calc:a}=e,i=(0,B.TS)(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(n).div(2)).add(r).equal(),uploadPicCardSize:a(o).mul(2.55).equal()});return[Q(i),H(i),X(i),G(i),q(i),$(i),Y(i),(0,Z.Z)(i)]},e=>({actionsColor:e.colorTextDescription})),ee={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:e}}]}},name:"file",theme:"twotone"},et=n(55015),en=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:ee}))}),er=n(61935),eo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},ea=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:eo}))}),ei={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:e}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:e}}]}},name:"picture",theme:"twotone"},el=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:ei}))}),es=n(47970),ec=n(51646),eu=n(68710),ed=n(19722),ef=n(73002);function ep(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function eh(e,t){let n=(0,o.Z)(t),r=n.findIndex(t=>{let{uid:n}=t;return n===e.uid});return -1===r?n.push(e):n[r]=e,n}function em(e,t){let n=void 0!==e.uid?"uid":"name";return t.filter(t=>t[n]===e[n])[0]}let eg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},ev=e=>0===e.indexOf("image/"),ey=e=>{if(e.type&&!e.thumbUrl)return ev(e.type);let t=e.thumbUrl||e.url||"",n=eg(t);return!!(/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n))||!/^data:/.test(t)&&!n};function eb(e){return new Promise(t=>{if(!e.type||!ev(e.type)){t("");return}let n=document.createElement("canvas");n.width=200,n.height=200,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(200,"px; height: ").concat(200,"px; z-index: 9999; display: none;"),document.body.appendChild(n);let r=n.getContext("2d"),o=new Image;if(o.onload=()=>{let{width:e,height:a}=o,i=200,l=200,s=0,c=0;e>a?c=-((l=200/e*a)-i)/2:s=-((i=200/a*e)-l)/2,r.drawImage(o,s,c,i,l);let u=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(o.src),t(u)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){let t=new FileReader;t.onload=()=>{t.result&&(o.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){let n=new FileReader;n.onload=()=>{n.result&&t(n.result)},n.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var ex=n(26349),ew=n(73879),ek=n(6520),eS=n(68565),eE=n(89970);let eO=r.forwardRef((e,t)=>{var n,o;let{prefixCls:a,className:i,style:s,locale:c,listType:u,file:d,items:f,progress:p,iconRender:h,actionIconRender:m,itemRender:g,isImgUrl:v,showPreviewIcon:y,showRemoveIcon:b,showDownloadIcon:x,previewIcon:w,removeIcon:k,downloadIcon:S,onPreview:E,onDownload:O,onClose:C}=e,{status:j}=d,[_,P]=r.useState(j);r.useEffect(()=>{"removed"!==j&&P(j)},[j]);let[N,T]=r.useState(!1);r.useEffect(()=>{let e=setTimeout(()=>{T(!0)},300);return()=>{clearTimeout(e)}},[]);let A=h(d),I=r.createElement("div",{className:"".concat(a,"-icon")},A);if("picture"===u||"picture-card"===u||"picture-circle"===u){if("uploading"!==_&&(d.thumbUrl||d.url)){let e=(null==v?void 0:v(d))?r.createElement("img",{src:d.thumbUrl||d.url,alt:d.name,className:"".concat(a,"-list-item-image"),crossOrigin:d.crossOrigin}):A,t=l()("".concat(a,"-list-item-thumbnail"),{["".concat(a,"-list-item-file")]:v&&!v(d)});I=r.createElement("a",{className:t,onClick:e=>E(d,e),href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer"},e)}else{let e=l()("".concat(a,"-list-item-thumbnail"),{["".concat(a,"-list-item-file")]:"uploading"!==_});I=r.createElement("div",{className:e},A)}}let R=l()("".concat(a,"-list-item"),"".concat(a,"-list-item-").concat(_)),D="string"==typeof d.linkProps?JSON.parse(d.linkProps):d.linkProps,L=b?m(("function"==typeof k?k(d):k)||r.createElement(ex.Z,null),()=>C(d),a,c.removeFile,!0):null,Z=x&&"done"===_?m(("function"==typeof S?S(d):S)||r.createElement(ew.Z,null),()=>O(d),a,c.downloadFile):null,z="picture-card"!==u&&"picture-circle"!==u&&r.createElement("span",{key:"download-delete",className:l()("".concat(a,"-list-item-actions"),{picture:"picture"===u})},Z,L),B=l()("".concat(a,"-list-item-name")),F=d.url?[r.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:B,title:d.name},D,{href:d.url,onClick:e=>E(d,e)}),d.name),z]:[r.createElement("span",{key:"view",className:B,onClick:e=>E(d,e),title:d.name},d.name),z],H=y&&(d.url||d.thumbUrl)?r.createElement("a",{href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>E(d,e),title:c.previewFile},"function"==typeof w?w(d):w||r.createElement(ek.Z,null)):null,q=("picture-card"===u||"picture-circle"===u)&&"uploading"!==_&&r.createElement("span",{className:"".concat(a,"-list-item-actions")},H,"done"===_&&Z,L),{getPrefixCls:W}=r.useContext(M.E_),U=W(),K=r.createElement("div",{className:R},I,F,q,N&&r.createElement(es.ZP,{motionName:"".concat(U,"-fade"),visible:"uploading"===_,motionDeadline:2e3},e=>{let{className:t}=e,n="percent"in d?r.createElement(eS.Z,Object.assign({},p,{type:"line",percent:d.percent,"aria-label":d["aria-label"],"aria-labelledby":d["aria-labelledby"]})):null;return r.createElement("div",{className:l()("".concat(a,"-list-item-progress"),t)},n)})),$=d.response&&"string"==typeof d.response?d.response:(null===(n=d.error)||void 0===n?void 0:n.statusText)||(null===(o=d.error)||void 0===o?void 0:o.message)||c.uploadError,V="error"===_?r.createElement(eE.Z,{title:$,getPopupContainer:e=>e.parentNode},K):K;return r.createElement("div",{className:l()("".concat(a,"-list-item-container"),i),style:s,ref:t},g?g(V,d,f,{download:O.bind(null,d),preview:E.bind(null,d),remove:C.bind(null,d)}):V)}),eC=r.forwardRef((e,t)=>{let{listType:n="text",previewFile:a=eb,onPreview:i,onDownload:s,onRemove:c,locale:u,iconRender:d,isImageUrl:f=ey,prefixCls:p,items:h=[],showPreviewIcon:m=!0,showRemoveIcon:g=!0,showDownloadIcon:v=!1,removeIcon:y,previewIcon:b,downloadIcon:x,progress:w={size:[-1,2],showInfo:!1},appendAction:k,appendActionVisible:S=!0,itemRender:E,disabled:O}=e,C=(0,ec.Z)(),[j,_]=r.useState(!1);r.useEffect(()=>{("picture"===n||"picture-card"===n||"picture-circle"===n)&&(h||[]).forEach(e=>{"undefined"!=typeof document&&"undefined"!=typeof window&&window.FileReader&&window.File&&(e.originFileObj instanceof File||e.originFileObj instanceof Blob)&&void 0===e.thumbUrl&&(e.thumbUrl="",a&&a(e.originFileObj).then(t=>{e.thumbUrl=t||"",C()}))})},[n,h,a]),r.useEffect(()=>{_(!0)},[]);let P=(e,t)=>{if(i)return null==t||t.preventDefault(),i(e)},N=e=>{"function"==typeof s?s(e):e.url&&window.open(e.url)},T=e=>{null==c||c(e)},A=e=>{if(d)return d(e,n);let t="uploading"===e.status,o=f&&f(e)?r.createElement(el,null):r.createElement(en,null),a=t?r.createElement(er.Z,null):r.createElement(ea,null);return"picture"===n?a=t?r.createElement(er.Z,null):o:("picture-card"===n||"picture-circle"===n)&&(a=t?u.uploading:o),a},I=(e,t,n,o,a)=>{let i={type:"text",size:"small",title:o,onClick:n=>{t(),(0,ed.l$)(e)&&e.props.onClick&&e.props.onClick(n)},className:"".concat(n,"-list-item-action")};if(a&&(i.disabled=O),(0,ed.l$)(e)){let t=(0,ed.Tm)(e,Object.assign(Object.assign({},e.props),{onClick:()=>{}}));return r.createElement(ef.ZP,Object.assign({},i,{icon:t}))}return r.createElement(ef.ZP,Object.assign({},i),r.createElement("span",null,e))};r.useImperativeHandle(t,()=>({handlePreview:P,handleDownload:N}));let{getPrefixCls:R}=r.useContext(M.E_),D=R("upload",p),L=R(),Z=l()("".concat(D,"-list"),"".concat(D,"-list-").concat(n)),z=(0,o.Z)(h.map(e=>({key:e.uid,file:e}))),B={motionDeadline:2e3,motionName:"".concat(D,"-").concat("picture-card"===n||"picture-circle"===n?"animate-inline":"animate"),keys:z,motionAppear:j},F=r.useMemo(()=>{let e=Object.assign({},(0,eu.Z)(L));return delete e.onAppearEnd,delete e.onEnterEnd,delete e.onLeaveEnd,e},[L]);return"picture-card"!==n&&"picture-circle"!==n&&(B=Object.assign(Object.assign({},F),B)),r.createElement("div",{className:Z},r.createElement(es.V4,Object.assign({},B,{component:!1}),e=>{let{key:t,file:o,className:a,style:i}=e;return r.createElement(eO,{key:t,locale:u,prefixCls:D,className:a,style:i,file:o,items:h,progress:w,listType:n,isImgUrl:f,showPreviewIcon:m,showRemoveIcon:g,showDownloadIcon:v,removeIcon:y,previewIcon:b,downloadIcon:x,iconRender:A,actionIconRender:I,itemRender:E,onPreview:P,onDownload:N,onClose:T})}),k&&r.createElement(es.ZP,Object.assign({},B,{visible:S,forceRender:!0}),e=>{let{className:t,style:n}=e;return(0,ed.Tm)(k,e=>({className:l()(e.className,t),style:Object.assign(Object.assign(Object.assign({},n),{pointerEvents:t?"none":void 0}),e.style)}))}))}),ej="__LIST_IGNORE_".concat(Date.now(),"__"),e_=r.forwardRef((e,t)=>{let n;let{fileList:i,defaultFileList:s,onRemove:c,showUploadList:u=!0,listType:d="text",onPreview:f,onDownload:p,onChange:h,onDrop:m,previewFile:g,disabled:v,locale:y,iconRender:b,isImageUrl:x,progress:w,prefixCls:k,className:S,type:E="select",children:O,style:C,itemRender:j,maxCount:_,data:P={},multiple:N=!1,hasControlInside:L=!0,action:Z="",accept:z="",supportServerRender:B=!0,rootClassName:F}=e,H=r.useContext(I.Z),q=null!=v?v:H,[W,U]=(0,A.Z)(s||[],{value:i,postState:e=>null!=e?e:[]}),[K,$]=r.useState("drop"),V=r.useRef(null);r.useMemo(()=>{let e=Date.now();(i||[]).forEach((t,n)=>{t.uid||Object.isFrozen(t)||(t.uid="__AUTO__".concat(e,"_").concat(n,"__"))})},[i]);let X=(e,t,n)=>{let r=(0,o.Z)(t),i=!1;1===_?r=r.slice(-1):_&&(i=r.length>_,r=r.slice(0,_)),(0,a.flushSync)(()=>{U(r)});let l={file:e,fileList:r};n&&(l.event=n),(!i||r.some(t=>t.uid===e.uid))&&(0,a.flushSync)(()=>{null==h||h(l)})},G=e=>{let t=e.filter(e=>!e.file[ej]);if(!t.length)return;let n=t.map(e=>ep(e.file)),r=(0,o.Z)(W);n.forEach(e=>{r=eh(e,r)}),n.forEach((e,n)=>{let o=e;if(t[n].parsedFile)e.status="uploading";else{let t;let{originFileObj:n}=e;try{t=new File([n],n.name,{type:n.type})}catch(e){(t=new Blob([n],{type:n.type})).name=n.name,t.lastModifiedDate=new Date,t.lastModified=new Date().getTime()}t.uid=e.uid,o=t}X(o,r)})},Y=(e,t,n)=>{try{"string"==typeof e&&(e=JSON.parse(e))}catch(e){}if(!em(t,W))return;let r=ep(t);r.status="done",r.percent=100,r.response=e,r.xhr=n;let o=eh(r,W);X(r,o)},Q=(e,t)=>{if(!em(t,W))return;let n=ep(t);n.status="uploading",n.percent=e.percent;let r=eh(n,W);X(n,r,e)},ee=(e,t,n)=>{if(!em(n,W))return;let r=ep(n);r.error=e,r.response=t,r.status="error";let o=eh(r,W);X(r,o)},et=e=>{let t;Promise.resolve("function"==typeof c?c(e):c).then(n=>{var r;if(!1===n)return;let o=function(e,t){let n=void 0!==e.uid?"uid":"name",r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}(e,W);o&&(t=Object.assign(Object.assign({},e),{status:"removed"}),null==W||W.forEach(e=>{let n=void 0!==t.uid?"uid":"name";e[n]!==t[n]||Object.isFrozen(e)||(e.status="removed")}),null===(r=V.current)||void 0===r||r.abort(t),X(t,o))})},en=e=>{$(e.type),"drop"===e.type&&(null==m||m(e))};r.useImperativeHandle(t,()=>({onBatchStart:G,onSuccess:Y,onProgress:Q,onError:ee,fileList:W,upload:V.current}));let{getPrefixCls:er,direction:eo,upload:ea}=r.useContext(M.E_),ei=er("upload",k),el=Object.assign(Object.assign({onBatchStart:G,onError:ee,onProgress:Q,onSuccess:Y},e),{data:P,multiple:N,action:Z,accept:z,supportServerRender:B,prefixCls:ei,disabled:q,beforeUpload:(t,n)=>{var r,o,a,i;return r=void 0,o=void 0,a=void 0,i=function*(){let{beforeUpload:r,transformFile:o}=e,a=t;if(r){let e=yield r(t,n);if(!1===e)return!1;if(delete t[ej],e===ej)return Object.defineProperty(t,ej,{value:!0,configurable:!0}),!1;"object"==typeof e&&e&&(a=e)}return o&&(a=yield o(a)),a},new(a||(a=Promise))(function(e,t){function n(e){try{s(i.next(e))}catch(e){t(e)}}function l(e){try{s(i.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof a?r:new a(function(e){e(r)})).then(n,l)}s((i=i.apply(r,o||[])).next())})},onChange:void 0,hasControlInside:L});delete el.className,delete el.style,(!O||q)&&delete el.id;let es="".concat(ei,"-wrapper"),[ec,eu,ed]=J(ei,es),[ef]=(0,R.Z)("Upload",D.Z.Upload),{showRemoveIcon:eg,showPreviewIcon:ev,showDownloadIcon:ey,removeIcon:eb,previewIcon:ex,downloadIcon:ew}="boolean"==typeof u?{}:u,ek=void 0===eg?!q:!!eg,eS=(e,t)=>u?r.createElement(eC,{prefixCls:ei,listType:d,items:W,previewFile:g,onPreview:f,onDownload:p,onRemove:et,showRemoveIcon:ek,showPreviewIcon:ev,showDownloadIcon:ey,removeIcon:eb,previewIcon:ex,downloadIcon:ew,iconRender:b,locale:Object.assign(Object.assign({},ef),y),isImageUrl:x,progress:w,appendAction:e,appendActionVisible:t,itemRender:j,disabled:q}):e,eE=l()(es,S,F,eu,ed,null==ea?void 0:ea.className,{["".concat(ei,"-rtl")]:"rtl"===eo,["".concat(ei,"-picture-card-wrapper")]:"picture-card"===d,["".concat(ei,"-picture-circle-wrapper")]:"picture-circle"===d}),eO=Object.assign(Object.assign({},null==ea?void 0:ea.style),C);if("drag"===E){let e=l()(eu,ei,"".concat(ei,"-drag"),{["".concat(ei,"-drag-uploading")]:W.some(e=>"uploading"===e.status),["".concat(ei,"-drag-hover")]:"dragover"===K,["".concat(ei,"-disabled")]:q,["".concat(ei,"-rtl")]:"rtl"===eo});return ec(r.createElement("span",{className:eE},r.createElement("div",{className:e,style:eO,onDrop:en,onDragOver:en,onDragLeave:en},r.createElement(T,Object.assign({},el,{ref:V,className:"".concat(ei,"-btn")}),r.createElement("div",{className:"".concat(ei,"-drag-container")},O))),eS()))}let e_=l()(ei,"".concat(ei,"-select"),{["".concat(ei,"-disabled")]:q}),eP=(n=O?void 0:{display:"none"},r.createElement("div",{className:e_,style:n},r.createElement(T,Object.assign({},el,{ref:V}))));return ec("picture-card"===d||"picture-circle"===d?r.createElement("span",{className:eE},eS(eP,!!O)):r.createElement("span",{className:eE},eP,eS()))});var eP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eN=r.forwardRef((e,t)=>{var{style:n,height:o,hasControlInside:a=!1}=e,i=eP(e,["style","height","hasControlInside"]);return r.createElement(e_,Object.assign({ref:t,hasControlInside:a},i,{type:"drag",style:Object.assign(Object.assign({},n),{height:o})}))});e_.Dragger=eN,e_.LIST_IGNORE=ej;var eT=e_},49211:function(e,t,n){"use strict";var r=n(99623),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,i,l,s,c,u,d,f=!1;t||(t={}),i=t.debug||!1;try{if(s=r(),c=document.createRange(),u=document.getSelection(),(d=document.createElement("span")).textContent=e,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),void 0===n.clipboardData){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=o[t.format]||o.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),c.selectNodeContents(d),u.addRange(c),!document.execCommand("copy"))throw Error("copy command was unsuccessful");f=!0}catch(r){i&&console.error("unable to copy using execCommand: ",r),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(r){i&&console.error("unable to copy using clipboardData: ",r),i&&console.error("falling back to prompt"),n="message"in t?t.message:"Copy to clipboard: #{key}, Enter",a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",l=n.replace(/#{\s*key\s*}/g,a),window.prompt(l,e)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(c):u.removeAllRanges()),d&&document.body.removeChild(d),s()}return f}},7656:function(e,t,n){"use strict";function r(e,t){if(t.length<e)throw TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}n.d(t,{Z:function(){return r}})},47869:function(e,t,n){"use strict";function r(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n.d(t,{Z:function(){return r}})},7366:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(41154),o=n(25721),a=n(55463),i=n(99735),l=n(7656),s=n(47869);function c(e,t){if((0,l.Z)(2,arguments),!t||"object"!==(0,r.Z)(t))return new Date(NaN);var n=t.years?(0,s.Z)(t.years):0,c=t.months?(0,s.Z)(t.months):0,u=t.weeks?(0,s.Z)(t.weeks):0,d=t.days?(0,s.Z)(t.days):0,f=t.hours?(0,s.Z)(t.hours):0,p=t.minutes?(0,s.Z)(t.minutes):0,h=t.seconds?(0,s.Z)(t.seconds):0,m=(0,i.Z)(e),g=c||n?(0,a.Z)(m,c+12*n):m;return new Date((d||u?(0,o.Z)(g,d+7*u):g).getTime()+1e3*(h+60*(p+60*f)))}},25721:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47869),o=n(99735),a=n(7656);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e),i=(0,r.Z)(t);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}},55463:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47869),o=n(99735),a=n(7656);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e),i=(0,r.Z)(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),s=new Date(n.getTime());return(s.setMonth(n.getMonth()+i+1,0),l>=s.getDate())?s:(n.setFullYear(s.getFullYear(),s.getMonth(),l),n)}},99735:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(41154),o=n(7656);function a(e){(0,o.Z)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,r.Z)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):(("string"==typeof e||"[object String]"===t)&&"undefined"!=typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}},61134:function(e,t,n){var r;!function(o){"use strict";var a,i={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},l=!0,s="[DecimalError] ",c=s+"Invalid argument: ",u=s+"Exponent out of range: ",d=Math.floor,f=Math.pow,p=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=d(1286742750677284.5),m={};function g(e,t){var n,r,o,a,i,s,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),l?C(t,f):t;if(c=e.d,u=t.d,i=e.e,o=t.e,c=c.slice(),a=i-o){for(a<0?(r=c,a=-a,s=u.length):(r=u,o=i,s=c.length),a>(s=(i=Math.ceil(f/7))>s?i+1:s+1)&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for((s=c.length)-(a=u.length)<0&&(a=s,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/1e7|0,c[a]%=1e7;for(n&&(c.unshift(n),++o),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=o,l?C(t,f):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(c+e)}function y(e){var t,n,r,o=e.length-1,a="",i=e[0];if(o>0){for(a+=i,t=1;t<o;t++)(n=7-(r=e[t]+"").length)&&(a+=S(n)),a+=r;(n=7-(r=(i=e[t])+"").length)&&(a+=S(n))}else if(0===i)return"0";for(;i%10==0;)i/=10;return a+i}m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},m.comparedTo=m.cmp=function(e){var t,n,r,o;if(e=new this.constructor(e),this.s!==e.s)return this.s||-e.s;if(this.e!==e.e)return this.e>e.e^this.s<0?1:-1;for(t=0,n=(r=this.d.length)<(o=e.d.length)?r:o;t<n;++t)if(this.d[t]!==e.d[t])return this.d[t]>e.d[t]^this.s<0?1:-1;return r===o?0:r>o^this.s<0?1:-1},m.decimalPlaces=m.dp=function(){var e=this.d.length-1,t=(e-this.e)*7;if(e=this.d[e])for(;e%10==0;e/=10)t--;return t<0?0:t},m.dividedBy=m.div=function(e){return b(this,new this.constructor(e))},m.dividedToIntegerBy=m.idiv=function(e){var t=this.constructor;return C(b(this,new t(e),0,1),t.precision)},m.equals=m.eq=function(e){return!this.cmp(e)},m.exponent=function(){return w(this)},m.greaterThan=m.gt=function(e){return this.cmp(e)>0},m.greaterThanOrEqualTo=m.gte=function(e){return this.cmp(e)>=0},m.isInteger=m.isint=function(){return this.e>this.d.length-2},m.isNegative=m.isneg=function(){return this.s<0},m.isPositive=m.ispos=function(){return this.s>0},m.isZero=function(){return 0===this.s},m.lessThan=m.lt=function(e){return 0>this.cmp(e)},m.lessThanOrEqualTo=m.lte=function(e){return 1>this.cmp(e)},m.logarithm=m.log=function(e){var t,n=this.constructor,r=n.precision,o=r+5;if(void 0===e)e=new n(10);else if((e=new n(e)).s<1||e.eq(a))throw Error(s+"NaN");if(this.s<1)throw Error(s+(this.s?"NaN":"-Infinity"));return this.eq(a)?new n(0):(l=!1,t=b(E(this,o),E(e,o),o),l=!0,C(t,r))},m.minus=m.sub=function(e){return e=new this.constructor(e),this.s==e.s?j(this,e):g(this,(e.s=-e.s,e))},m.modulo=m.mod=function(e){var t,n=this.constructor,r=n.precision;if(!(e=new n(e)).s)throw Error(s+"NaN");return this.s?(l=!1,t=b(this,e,0,1).times(e),l=!0,this.minus(t)):C(new n(this),r)},m.naturalExponential=m.exp=function(){return x(this)},m.naturalLogarithm=m.ln=function(){return E(this)},m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},m.plus=m.add=function(e){return e=new this.constructor(e),this.s==e.s?g(this,e):j(this,(e.s=-e.s,e))},m.precision=m.sd=function(e){var t,n,r;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(c+e);if(t=w(this)+1,n=7*(r=this.d.length-1)+1,r=this.d[r]){for(;r%10==0;r/=10)n--;for(r=this.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},m.squareRoot=m.sqrt=function(){var e,t,n,r,o,a,i,c=this.constructor;if(this.s<1){if(!this.s)return new c(0);throw Error(s+"NaN")}for(e=w(this),l=!1,0==(o=Math.sqrt(+this))||o==1/0?(((t=y(this.d)).length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=d((e+1)/2)-(e<0||e%2),r=new c(t=o==1/0?"5e"+e:(t=o.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new c(o.toString()),o=i=(n=c.precision)+3;;)if(r=(a=r).plus(b(this,a,i+2)).times(.5),y(a.d).slice(0,i)===(t=y(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),o==i&&"4999"==t){if(C(a,n+1,0),a.times(a).eq(this)){r=a;break}}else if("9999"!=t)break;i+=4}return l=!0,C(r,n)},m.times=m.mul=function(e){var t,n,r,o,a,i,s,c,u,d=this.constructor,f=this.d,p=(e=new d(e)).d;if(!this.s||!e.s)return new d(0);for(e.s*=this.s,n=this.e+e.e,(c=f.length)<(u=p.length)&&(a=f,f=p,p=a,i=c,c=u,u=i),a=[],r=i=c+u;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,o=c+r;o>r;)s=a[o]+p[r]*f[o-r-1]+t,a[o--]=s%1e7|0,t=s/1e7|0;a[o]=(a[o]+t)%1e7|0}for(;!a[--i];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,l?C(e,d.precision):e},m.toDecimalPlaces=m.todp=function(e,t){var n=this,r=n.constructor;return(n=new r(n),void 0===e)?n:(v(e,0,1e9),void 0===t?t=r.rounding:v(t,0,8),C(n,e+w(n)+1,t))},m.toExponential=function(e,t){var n,r=this,o=r.constructor;return void 0===e?n=_(r,!0):(v(e,0,1e9),void 0===t?t=o.rounding:v(t,0,8),n=_(r=C(new o(r),e+1,t),!0,e+1)),n},m.toFixed=function(e,t){var n,r,o=this.constructor;return void 0===e?_(this):(v(e,0,1e9),void 0===t?t=o.rounding:v(t,0,8),n=_((r=C(new o(this),e+w(this)+1,t)).abs(),!1,e+w(r)+1),this.isneg()&&!this.isZero()?"-"+n:n)},m.toInteger=m.toint=function(){var e=this.constructor;return C(new e(this),w(this)+1,e.rounding)},m.toNumber=function(){return+this},m.toPower=m.pow=function(e){var t,n,r,o,i,c,u=this,f=u.constructor,p=+(e=new f(e));if(!e.s)return new f(a);if(!(u=new f(u)).s){if(e.s<1)throw Error(s+"Infinity");return u}if(u.eq(a))return u;if(r=f.precision,e.eq(a))return C(u,r);if(c=(t=e.e)>=(n=e.d.length-1),i=u.s,c){if((n=p<0?-p:p)<=9007199254740991){for(o=new f(a),t=Math.ceil(r/7+4),l=!1;n%2&&P((o=o.times(u)).d,t),0!==(n=d(n/2));)P((u=u.times(u)).d,t);return l=!0,e.s<0?new f(a).div(o):C(o,r)}}else if(i<0)throw Error(s+"NaN");return i=i<0&&1&e.d[Math.max(t,n)]?-1:1,u.s=1,l=!1,o=e.times(E(u,r+12)),l=!0,(o=x(o)).s=i,o},m.toPrecision=function(e,t){var n,r,o=this,a=o.constructor;return void 0===e?(n=w(o),r=_(o,n<=a.toExpNeg||n>=a.toExpPos)):(v(e,1,1e9),void 0===t?t=a.rounding:v(t,0,8),n=w(o=C(new a(o),e,t)),r=_(o,e<=n||n<=a.toExpNeg,e)),r},m.toSignificantDigits=m.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(v(e,1,1e9),void 0===t?t=n.rounding:v(t,0,8)),C(new n(this),e,t)},m.toString=m.valueOf=m.val=m.toJSON=function(){var e=w(this),t=this.constructor;return _(this,e<=t.toExpNeg||e>=t.toExpPos)};var b=function(){function e(e,t){var n,r=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+r,e[o]=n%1e7|0,r=n/1e7|0;return r&&e.unshift(r),e}function t(e,t,n,r){var o,a;if(n!=r)a=n>r?1:-1;else for(o=a=0;o<n;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=1e7*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,o,a,i){var l,c,u,d,f,p,h,m,g,v,y,b,x,k,S,E,O,j,_=r.constructor,P=r.s==o.s?1:-1,N=r.d,T=o.d;if(!r.s)return new _(r);if(!o.s)throw Error(s+"Division by zero");for(u=0,c=r.e-o.e,O=T.length,S=N.length,m=(h=new _(P)).d=[];T[u]==(N[u]||0);)++u;if(T[u]>(N[u]||0)&&--c,(b=null==a?a=_.precision:i?a+(w(r)-w(o))+1:a)<0)return new _(0);if(b=b/7+2|0,u=0,1==O)for(d=0,T=T[0],b++;(u<S||d)&&b--;u++)x=1e7*d+(N[u]||0),m[u]=x/T|0,d=x%T|0;else{for((d=1e7/(T[0]+1)|0)>1&&(T=e(T,d),N=e(N,d),O=T.length,S=N.length),k=O,v=(g=N.slice(0,O)).length;v<O;)g[v++]=0;(j=T.slice()).unshift(0),E=T[0],T[1]>=1e7/2&&++E;do d=0,(l=t(T,g,O,v))<0?(y=g[0],O!=v&&(y=1e7*y+(g[1]||0)),(d=y/E|0)>1?(d>=1e7&&(d=1e7-1),p=(f=e(T,d)).length,v=g.length,1==(l=t(f,g,p,v))&&(d--,n(f,O<p?j:T,p))):(0==d&&(l=d=1),f=T.slice()),(p=f.length)<v&&f.unshift(0),n(g,f,v),-1==l&&(v=g.length,(l=t(T,g,O,v))<1&&(d++,n(g,O<v?j:T,v))),v=g.length):0===l&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[v++]=N[k]||0:(g=[N[k]],v=1);while((k++<S||void 0!==g[0])&&b--)}return m[0]||m.shift(),h.e=c,C(h,i?a+w(h)+1:a)}}();function x(e,t){var n,r,o,i,s,c=0,d=0,p=e.constructor,h=p.precision;if(w(e)>16)throw Error(u+w(e));if(!e.s)return new p(a);for(null==t?(l=!1,s=h):s=t,i=new p(.03125);e.abs().gte(.1);)e=e.times(i),d+=5;for(s+=Math.log(f(2,d))/Math.LN10*2+5|0,n=r=o=new p(a),p.precision=s;;){if(r=C(r.times(e),s),n=n.times(++c),y((i=o.plus(b(r,n,s))).d).slice(0,s)===y(o.d).slice(0,s)){for(;d--;)o=C(o.times(o),s);return p.precision=h,null==t?(l=!0,C(o,h)):o}o=i}}function w(e){for(var t=7*e.e,n=e.d[0];n>=10;n/=10)t++;return t}function k(e,t,n){if(t>e.LN10.sd())throw l=!0,n&&(e.precision=n),Error(s+"LN10 precision limit exceeded");return C(new e(e.LN10),t)}function S(e){for(var t="";e--;)t+="0";return t}function E(e,t){var n,r,o,i,c,u,d,f,p,h=1,m=e,g=m.d,v=m.constructor,x=v.precision;if(m.s<1)throw Error(s+(m.s?"NaN":"-Infinity"));if(m.eq(a))return new v(0);if(null==t?(l=!1,f=x):f=t,m.eq(10))return null==t&&(l=!0),k(v,f);if(f+=10,v.precision=f,r=(n=y(g)).charAt(0),!(15e14>Math.abs(i=w(m))))return d=k(v,f+2,x).times(i+""),m=E(new v(r+"."+n.slice(1)),f-10).plus(d),v.precision=x,null==t?(l=!0,C(m,x)):m;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=y((m=m.times(e)).d)).charAt(0),h++;for(i=w(m),r>1?(m=new v("0."+n),i++):m=new v(r+"."+n.slice(1)),u=c=m=b(m.minus(a),m.plus(a),f),p=C(m.times(m),f),o=3;;){if(c=C(c.times(p),f),y((d=u.plus(b(c,new v(o),f))).d).slice(0,f)===y(u.d).slice(0,f))return u=u.times(2),0!==i&&(u=u.plus(k(v,f+2,x).times(i+""))),u=b(u,new v(h),f),v.precision=x,null==t?(l=!0,C(u,x)):u;u=d,o+=2}}function O(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(o=t.length;48===t.charCodeAt(o-1);)--o;if(t=t.slice(r,o)){if(o-=r,n=n-r-1,e.e=d(n/7),e.d=[],r=(n+1)%7,n<0&&(r+=7),r<o){for(r&&e.d.push(+t.slice(0,r)),o-=7;r<o;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=o;for(;r--;)t+="0";if(e.d.push(+t),l&&(e.e>h||e.e<-h))throw Error(u+n)}else e.s=0,e.e=0,e.d=[0];return e}function C(e,t,n){var r,o,a,i,s,c,p,m,g=e.d;for(i=1,a=g[0];a>=10;a/=10)i++;if((r=t-i)<0)r+=7,o=t,p=g[m=0];else{if((m=Math.ceil((r+1)/7))>=(a=g.length))return e;for(i=1,p=a=g[m];a>=10;a/=10)i++;r%=7,o=r-7+i}if(void 0!==n&&(s=p/(a=f(10,i-o-1))%10|0,c=t<0||void 0!==g[m+1]||p%a,c=n<4?(s||c)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||c||6==n&&(r>0?o>0?p/f(10,i-o):0:g[m-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return c?(a=w(e),g.length=1,t=t-a-1,g[0]=f(10,(7-t%7)%7),e.e=d(-t/7)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(0==r?(g.length=m,a=1,m--):(g.length=m+1,a=f(10,7-r),g[m]=o>0?(p/f(10,i-o)%f(10,o)|0)*a:0),c)for(;;){if(0==m){1e7==(g[0]+=a)&&(g[0]=1,++e.e);break}if(g[m]+=a,1e7!=g[m])break;g[m--]=0,a=1}for(r=g.length;0===g[--r];)g.pop();if(l&&(e.e>h||e.e<-h))throw Error(u+w(e));return e}function j(e,t){var n,r,o,a,i,s,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),l?C(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),i=u-r){for((d=i<0)?(n=c,i=-i,s=f.length):(n=f,r=u,s=c.length),i>(o=Math.max(Math.ceil(h/7),s)+2)&&(i=o,n.length=1),n.reverse(),o=i;o--;)n.push(0);n.reverse()}else{for((d=(o=c.length)<(s=f.length))&&(s=o),o=0;o<s;o++)if(c[o]!=f[o]){d=c[o]<f[o];break}i=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),s=c.length,o=f.length-s;o>0;--o)c[s++]=0;for(o=f.length;o>i;){if(c[--o]<f[o]){for(a=o;a&&0===c[--a];)c[a]=1e7-1;--c[a],c[o]+=1e7}c[o]-=f[o]}for(;0===c[--s];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(t.d=c,t.e=r,l?C(t,h):t):new p(0)}function _(e,t,n){var r,o=w(e),a=y(e.d),i=a.length;return t?(n&&(r=n-i)>0?a=a.charAt(0)+"."+a.slice(1)+S(r):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(o<0?"e":"e+")+o):o<0?(a="0."+S(-o-1)+a,n&&(r=n-i)>0&&(a+=S(r))):o>=i?(a+=S(o+1-i),n&&(r=n-o-1)>0&&(a=a+"."+S(r))):((r=o+1)<i&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-i)>0&&(o+1===i&&(a+="."),a+=S(r))),e.s<0?"-"+a:a}function P(e,t){if(e.length>t)return e.length=t,!0}function N(e){if(!e||"object"!=typeof e)throw Error(s+"Object expected");var t,n,r,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<o.length;t+=3)if(void 0!==(r=e[n=o[t]])){if(d(r)===r&&r>=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(c+n+": "+r)}if(void 0!==(r=e[n="LN10"])){if(r==Math.LN10)this[n]=new this(r);else throw Error(c+n+": "+r)}return this}(i=function e(t){var n,r,o;function a(e){if(!(this instanceof a))return new a(e);if(this.constructor=a,e instanceof a){this.s=e.s,this.e=e.e,this.d=(e=e.d)?e.slice():e;return}if("number"==typeof e){if(0*e!=0)throw Error(c+e);if(e>0)this.s=1;else if(e<0)e=-e,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(e===~~e&&e<1e7){this.e=0,this.d=[e];return}return O(this,e.toString())}if("string"!=typeof e)throw Error(c+e);if(45===e.charCodeAt(0)?(e=e.slice(1),this.s=-1):this.s=1,p.test(e))O(this,e);else throw Error(c+e)}if(a.prototype=m,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=e,a.config=a.set=N,void 0===t&&(t={}),t)for(n=0,o=["precision","rounding","toExpNeg","toExpPos","LN10"];n<o.length;)t.hasOwnProperty(r=o[n++])||(t[r]=this[r]);return a.config(t),a}(i)).default=i.Decimal=i,a=new i(1),void 0!==(r=(function(){return i}).call(t,n,t,e))&&(e.exports=r)}(0)},84617:function(e,t,n){"use strict";var r=n(9973);t.__esModule=!0,t.default=function(e,t){e.classList?e.classList.add(t):(0,o.default)(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))};var o=r(n(98598));e.exports=t.default},98598:function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")},e.exports=t.default},67973:function(e){"use strict";function t(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}e.exports=function(e,n){e.classList?e.classList.remove(n):"string"==typeof e.className?e.className=t(e.className,n):e.setAttribute("class",t(e.className&&e.className.baseVal||"",n))}},77625:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,i){if("function"!=typeof r)throw TypeError("The listener must be a function");var l=new o(r,a||e,i),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],l]:e._events[s].push(l):(e._events[s]=l,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),l.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,a=r.length,i=Array(a);o<a;o++)i[o]=r[o].fn;return i},l.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,o,a,i){var l=n?n+e:e;if(!this._events[l])return!1;var s,c,u=this._events[l],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,a),!0;case 6:return u.fn.call(u.context,t,r,o,a,i),!0}for(c=1,s=Array(d-1);c<d;c++)s[c-1]=arguments[c];u.fn.apply(u.context,s)}else{var f,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,o);break;default:if(!s)for(f=1,s=Array(d-1);f<d;f++)s[f-1]=arguments[f];u[c].fn.apply(u[c].context,s)}}return!0},l.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},l.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},l.prototype.removeListener=function(e,t,r,o){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return i(this,a),this;var l=this._events[a];if(l.fn)l.fn!==t||o&&!l.once||r&&l.context!==r||i(this,a);else{for(var s=0,c=[],u=l.length;s<u;s++)(l[s].fn!==t||o&&!l[s].once||r&&l[s].context!==r)&&c.push(l[s]);c.length?this._events[a]=1===c.length?c[0]:c:i(this,a)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l},6500:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},i=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!a)return!1;for(r in e);return void 0===r||t.call(e,r)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(t=arguments[f],null!=t)for(n in t)r=s(d,n),d!==(o=s(t,n))&&(h&&o&&(i(o)||(c=a(o)))?(c?(c=!1,u=r&&a(r)?r:[]):u=r&&i(r)?r:{},l(d,{name:n,newValue:e(h,u,o)})):void 0!==o&&l(d,{name:n,newValue:o}));return d}},80662:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g;function c(e){return e?e.replace(s,""):""}e.exports=function(e,s){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];s=s||{};var u=1,d=1;function f(e){var t=e.match(n);t&&(u+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(r),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=s.source}h.prototype.content=e;var m=[];function g(t){var n=Error(s.source+":"+u+":"+d+": "+t);if(n.reason=t,n.filename=s.source,n.line=u,n.column=d,n.source=e,s.silent)m.push(n);else throw n}function v(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function y(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return d+=2,f(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}return v(r),function(){var e,n=[];for(y(n);e=function(){var e=p(),n=v(o);if(n){if(b(),!v(a))return g("property missing ':'");var r=v(i),s=e({type:"declaration",property:c(n[0].replace(t,"")),value:r?c(r[0].replace(t,"")):""});return v(l),s}}();)!1!==e&&(n.push(e),y(n));return n}()}},94975:function(e,t,n){var r=n(39866)(n(74288),"DataView");e.exports=r},9855:function(e,t,n){var r=n(43596),o=n(35907),a=n(35355),i=n(39870),l=n(73372);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},99078:function(e,t,n){var r=n(62285),o=n(28706),a=n(63717),i=n(78410),l=n(13368);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},88675:function(e,t,n){var r=n(39866)(n(74288),"Map");e.exports=r},76219:function(e,t,n){var r=n(38764),o=n(78615),a=n(83391),i=n(53483),l=n(74724);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},69308:function(e,t,n){var r=n(39866)(n(74288),"Promise");e.exports=r},41497:function(e,t,n){var r=n(39866)(n(74288),"Set");e.exports=r},11549:function(e,t,n){var r=n(76219),o=n(54351),a=n(16096);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},85885:function(e,t,n){var r=n(99078),o=n(84092),a=n(31663),i=n(69135),l=n(39552),s=n(63960);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=l,c.prototype.set=s,e.exports=c},23910:function(e,t,n){var r=n(74288).Symbol;e.exports=r},80098:function(e,t,n){var r=n(74288).Uint8Array;e.exports=r},10880:function(e,t,n){var r=n(39866)(n(74288),"WeakMap");e.exports=r},60493:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},78897:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}},42774:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},26685:function(e,t,n){var r=n(47909);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},56883:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},28579:function(e,t,n){var r=n(89772),o=n(56569),a=n(25614),i=n(98051),l=n(84257),s=n(9792),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),u=!n&&o(e),d=!n&&!u&&i(e),f=!n&&!u&&!d&&s(e),p=n||u||d||f,h=p?r(e.length,String):[],m=h.length;for(var g in e)(t||c.call(e,g))&&!(p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||l(g,m)))&&h.push(g);return h}},73819:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},73817:function(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},25253:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},53417:function(e){e.exports=function(e){return e.split("")}},24457:function(e,t,n){var r=n(37560);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},83023:function(e,t,n){var r=n(4521);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},67676:function(e,t,n){var r=n(98060),o=n(97930)(r);e.exports=o},28935:function(e,t,n){var r=n(67676);e.exports=function(e,t){var n=!0;return r(e,function(e,r,o){return n=!!t(e,r,o)}),n}},67646:function(e,t,n){var r=n(78371);e.exports=function(e,t,n){for(var o=-1,a=e.length;++o<a;){var i=e[o],l=t(i);if(null!=l&&(void 0===s?l==l&&!r(l):n(l,s)))var s=l,c=i}return c}},8235:function(e){e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return -1}},72569:function(e,t,n){var r=n(73817),o=n(37134);e.exports=function e(t,n,a,i,l){var s=-1,c=t.length;for(a||(a=o),l||(l=[]);++s<c;){var u=t[s];n>0&&a(u)?n>1?e(u,n-1,a,i,l):r(l,u):i||(l[l.length]=u)}return l}},63321:function(e,t,n){var r=n(33023)();e.exports=r},98060:function(e,t,n){var r=n(63321),o=n(43228);e.exports=function(e,t){return e&&r(e,t,o)}},92167:function(e,t,n){var r=n(67906),o=n(70235);e.exports=function(e,t){t=r(t,e);for(var n=0,a=t.length;null!=e&&n<a;)e=e[o(t[n++])];return n&&n==a?e:void 0}},36452:function(e,t,n){var r=n(73817),o=n(25614);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},54506:function(e,t,n){var r=n(23910),o=n(4479),a=n(80910),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},58905:function(e){e.exports=function(e,t){return e>t}},93012:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},47909:function(e,t,n){var r=n(8235),o=n(31953),a=n(35281);e.exports=function(e,t,n){return t==t?a(e,t,n):r(e,o,n)}},90370:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},56318:function(e,t,n){var r=n(6791),o=n(10303);e.exports=function e(t,n,a,i,l){return t===n||(null!=t&&null!=n&&(o(t)||o(n))?r(t,n,a,i,e,l):t!=t&&n!=n)}},6791:function(e,t,n){var r=n(85885),o=n(97638),a=n(88030),i=n(64974),l=n(81690),s=n(25614),c=n(98051),u=n(9792),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,m,g,v){var y=s(e),b=s(t),x=y?f:l(e),w=b?f:l(t);x=x==d?p:x,w=w==d?p:w;var k=x==p,S=w==p,E=x==w;if(E&&c(e)){if(!c(t))return!1;y=!0,k=!1}if(E&&!k)return v||(v=new r),y||u(e)?o(e,t,n,m,g,v):a(e,t,x,n,m,g,v);if(!(1&n)){var O=k&&h.call(e,"__wrapped__"),C=S&&h.call(t,"__wrapped__");if(O||C){var j=O?e.value():e,_=C?t.value():t;return v||(v=new r),g(j,_,n,m,v)}}return!!E&&(v||(v=new r),i(e,t,n,m,g,v))}},62538:function(e,t,n){var r=n(85885),o=n(56318);e.exports=function(e,t,n,a){var i=n.length,l=i,s=!a;if(null==e)return!l;for(e=Object(e);i--;){var c=n[i];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<l;){var u=(c=n[i])[0],d=e[u],f=c[1];if(s&&c[2]){if(void 0===d&&!(u in e))return!1}else{var p=new r;if(a)var h=a(d,f,u,e,t,p);if(!(void 0===h?o(f,d,3,a,p):h))return!1}}return!0}},31953:function(e){e.exports=function(e){return e!=e}},57595:function(e,t,n){var r=n(86757),o=n(79551),a=n(28302),i=n(1292),l=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,u=s.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?d:l).test(i(e))}},59332:function(e,t,n){var r=n(54506),o=n(13973),a=n(10303),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},88157:function(e,t,n){var r=n(25569),o=n(51501),a=n(79586),i=n(25614),l=n(22350);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):l(e)}},4578:function(e,t,n){var r=n(35365),o=n(77184),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},20121:function(e){e.exports=function(e,t){return e<t}},24240:function(e,t,n){var r=n(67676),o=n(5629);e.exports=function(e,t){var n=-1,a=o(e)?Array(e.length):[];return r(e,function(e,r,o){a[++n]=t(e,r,o)}),a}},25569:function(e,t,n){var r=n(62538),o=n(58424),a=n(47073);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},51501:function(e,t,n){var r=n(56318),o=n(13735),a=n(17764),i=n(67352),l=n(45669),s=n(47073),c=n(70235);e.exports=function(e,t){return i(e)&&l(t)?s(c(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},84046:function(e,t,n){var r=n(73819),o=n(92167),a=n(88157),i=n(24240),l=n(89200),s=n(23305),c=n(80701),u=n(79586),d=n(25614);e.exports=function(e,t,n){t=t.length?r(t,function(e){return d(e)?function(t){return o(t,1===e.length?e[0]:e)}:e}):[u];var f=-1;return t=r(t,s(a)),l(i(e,function(e,n,o){return{criteria:r(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,n)})}},18155:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},73584:function(e,t,n){var r=n(92167);e.exports=function(e){return function(t){return r(t,e)}}},19608:function(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,o,a){for(var i=-1,l=n(t((r-e)/(o||1)),0),s=Array(l);l--;)s[a?l:++i]=e,e+=o;return s}},44843:function(e,t,n){var r=n(79586),o=n(49478),a=n(98796);e.exports=function(e,t){return a(o(e,t,r),e+"")}},9810:function(e,t,n){var r=n(92353),o=n(4521),a=n(79586),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=i},99558:function(e){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+t];return a}},12327:function(e,t,n){var r=n(67676);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},89200:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},89772:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},65020:function(e,t,n){var r=n(23910),o=n(73819),a=n(25614),i=n(78371),l=1/0,s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-l?"-0":n}},41087:function(e,t,n){var r=n(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},23305:function(e){e.exports=function(e){return function(t){return e(t)}}},13826:function(e,t,n){var r=n(11549),o=n(26685),a=n(56883),i=n(65734),l=n(57600),s=n(27794);e.exports=function(e,t,n){var c=-1,u=o,d=e.length,f=!0,p=[],h=p;if(n)f=!1,u=a;else if(d>=200){var m=t?null:l(e);if(m)return s(m);f=!1,u=i,h=new r}else h=t?[]:p;e:for(;++c<d;){var g=e[c],v=t?t(g):g;if(g=n||0!==g?g:0,f&&v==v){for(var y=h.length;y--;)if(h[y]===v)continue e;t&&h.push(v),p.push(g)}else u(h,v,n)||(h!==p&&h.push(v),p.push(g))}return p}},65734:function(e){e.exports=function(e,t){return e.has(t)}},67906:function(e,t,n){var r=n(25614),o=n(67352),a=n(39365),i=n(3641);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},91684:function(e,t,n){var r=n(99558);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},1536:function(e,t,n){var r=n(78371);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,a=e==e,i=r(e),l=void 0!==t,s=null===t,c=t==t,u=r(t);if(!s&&!u&&!i&&e>t||i&&l&&c&&!s&&!u||o&&l&&c||!n&&c||!a)return 1;if(!o&&!i&&!u&&e<t||u&&n&&a&&!o&&!i||s&&n&&a||!l&&a||!c)return -1}return 0}},80701:function(e,t,n){var r=n(1536);e.exports=function(e,t,n){for(var o=-1,a=e.criteria,i=t.criteria,l=a.length,s=n.length;++o<l;){var c=r(a[o],i[o]);if(c){if(o>=s)return c;return c*("desc"==n[o]?-1:1)}}return e.index-t.index}},92077:function(e,t,n){var r=n(74288)["__core-js_shared__"];e.exports=r},97930:function(e,t,n){var r=n(5629);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,l=Object(n);(t?i--:++i<a)&&!1!==o(l[i],i,l););return n}}},33023:function(e){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),l=i.length;l--;){var s=i[e?l:++o];if(!1===n(a[s],s,a))break}return t}}},80675:function(e,t,n){var r=n(91684),o=n(14503),a=n(88551),i=n(3641);e.exports=function(e){return function(t){var n=o(t=i(t))?a(t):void 0,l=n?n[0]:t.charAt(0),s=n?r(n,1).join(""):t.slice(1);return l[e]()+s}}},82602:function(e,t,n){var r=n(88157),o=n(5629),a=n(43228);e.exports=function(e){return function(t,n,i){var l=Object(t);if(!o(t)){var s=r(n,3);t=a(t),n=function(e){return s(l[e],e,l)}}var c=e(t,n,i);return c>-1?l[s?t[c]:c]:void 0}}},35464:function(e,t,n){var r=n(19608),o=n(49639),a=n(175);e.exports=function(e){return function(t,n,i){return i&&"number"!=typeof i&&o(t,n,i)&&(n=i=void 0),t=a(t),void 0===n?(n=t,t=0):n=a(n),i=void 0===i?t<n?1:-1:a(i),r(t,n,i,e)}}},57600:function(e,t,n){var r=n(41497),o=n(93810),a=n(27794),i=r&&1/a(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=i},4521:function(e,t,n){var r=n(39866),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},97638:function(e,t,n){var r=n(11549),o=n(25253),a=n(65734);e.exports=function(e,t,n,i,l,s){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],y=t[h];if(i)var b=c?i(y,v,h,t,e,s):i(v,y,h,e,t,s);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!o(t,function(e,t){if(!a(g,t)&&(v===e||l(v,e,n,i,s)))return g.push(t)})){m=!1;break}}else if(!(v===y||l(v,y,n,i,s))){m=!1;break}}return s.delete(e),s.delete(t),m}},88030:function(e,t,n){var r=n(23910),o=n(80098),a=n(37560),i=n(97638),l=n(22523),s=n(27794),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new o(e),new o(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=l;case"[object Set]":var h=1&r;if(p||(p=s),e.size!=t.size&&!h)break;var m=f.get(e);if(m)return m==t;r|=2,f.set(e,t);var g=i(p(e),p(t),r,c,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},64974:function(e,t,n){var r=n(28529),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,l){var s=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!s)return!1;for(var d=u;d--;){var f=c[d];if(!(s?f in t:o.call(t,f)))return!1}var p=l.get(e),h=l.get(t);if(p&&h)return p==t&&h==e;var m=!0;l.set(e,t),l.set(t,e);for(var g=s;++d<u;){var v=e[f=c[d]],y=t[f];if(a)var b=s?a(y,v,f,t,e,l):a(v,y,f,e,t,l);if(!(void 0===b?v===y||i(v,y,n,a,l):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(m=!1)}return l.delete(e),l.delete(t),m}},17071:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},28529:function(e,t,n){var r=n(36452),o=n(80466),a=n(43228);e.exports=function(e){return r(e,a,o)}},1507:function(e,t,n){var r=n(7545);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},58424:function(e,t,n){var r=n(45669),o=n(43228);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},39866:function(e,t,n){var r=n(57595),o=n(3138);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},62602:function(e,t,n){var r=n(45070)(Object.getPrototypeOf,Object);e.exports=r},4479:function(e,t,n){var r=n(23910),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[l]=n:delete e[l]),o}},80466:function(e,t,n){var r=n(42774),o=n(55716),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,l=i?function(e){return null==e?[]:r(i(e=Object(e)),function(t){return a.call(e,t)})}:o;e.exports=l},81690:function(e,t,n){var r=n(94975),o=n(88675),a=n(69308),i=n(41497),l=n(10880),s=n(54506),c=n(1292),u="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=c(r),g=c(o),v=c(a),y=c(i),b=c(l),x=s;(r&&x(new r(new ArrayBuffer(1)))!=h||o&&x(new o)!=u||a&&x(a.resolve())!=d||i&&x(new i)!=f||l&&x(new l)!=p)&&(x=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case m:return h;case g:return u;case v:return d;case y:return f;case b:return p}return t}),e.exports=x},3138:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},59592:function(e,t,n){var r=n(67906),o=n(56569),a=n(25614),i=n(84257),l=n(13973),s=n(70235);e.exports=function(e,t,n){t=r(t,e);for(var c=-1,u=t.length,d=!1;++c<u;){var f=s(t[c]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&l(u)&&i(f,u)&&(a(e)||o(e))}},14503:function(e){var t=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},43596:function(e,t,n){var r=n(20453);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},35907:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},35355:function(e,t,n){var r=n(20453),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},39870:function(e,t,n){var r=n(20453),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},73372:function(e,t,n){var r=n(20453);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},37134:function(e,t,n){var r=n(23910),o=n(56569),a=n(25614),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},84257:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},49639:function(e,t,n){var r=n(37560),o=n(5629),a=n(84257),i=n(28302);e.exports=function(e,t,n){if(!i(n))return!1;var l=typeof t;return("number"==l?!!(o(n)&&a(t,n.length)):"string"==l&&t in n)&&r(n[t],e)}},67352:function(e,t,n){var r=n(25614),o=n(78371),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},7545:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},79551:function(e,t,n){var r,o=n(92077),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},35365:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},45669:function(e,t,n){var r=n(28302);e.exports=function(e){return e==e&&!r(e)}},62285:function(e){e.exports=function(){this.__data__=[],this.size=0}},28706:function(e,t,n){var r=n(24457),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},63717:function(e,t,n){var r=n(24457);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},78410:function(e,t,n){var r=n(24457);e.exports=function(e){return r(this.__data__,e)>-1}},13368:function(e,t,n){var r=n(24457);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},38764:function(e,t,n){var r=n(9855),o=n(99078),a=n(88675);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},78615:function(e,t,n){var r=n(1507);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},83391:function(e,t,n){var r=n(1507);e.exports=function(e){return r(this,e).get(e)}},53483:function(e,t,n){var r=n(1507);e.exports=function(e){return r(this,e).has(e)}},74724:function(e,t,n){var r=n(1507);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},22523:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},47073:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},23787:function(e,t,n){var r=n(50967);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},20453:function(e,t,n){var r=n(39866)(Object,"create");e.exports=r},77184:function(e,t,n){var r=n(45070)(Object.keys,Object);e.exports=r},39931:function(e,t,n){e=n.nmd(e);var r=n(17071),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,l=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},45070:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},49478:function(e,t,n){var r=n(60493),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,i=-1,l=o(a.length-t,0),s=Array(l);++i<l;)s[i]=a[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=a[i];return c[t]=n(s),r(e,this,c)}}},74288:function(e,t,n){var r=n(17071),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},54351:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},16096:function(e){e.exports=function(e){return this.__data__.has(e)}},27794:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},98796:function(e,t,n){var r=n(9810),o=n(31610)(r);e.exports=o},31610:function(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),a=16-(o-r);if(r=o,a>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},84092:function(e,t,n){var r=n(99078);e.exports=function(){this.__data__=new r,this.size=0}},31663:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},69135:function(e){e.exports=function(e){return this.__data__.get(e)}},39552:function(e){e.exports=function(e){return this.__data__.has(e)}},63960:function(e,t,n){var r=n(99078),o=n(88675),a=n(76219);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},35281:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return -1}},88551:function(e,t,n){var r=n(53417),o=n(14503),a=n(26364);e.exports=function(e){return o(e)?a(e):r(e)}},39365:function(e,t,n){var r=n(23787),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)}),t});e.exports=i},70235:function(e,t,n){var r=n(78371),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},1292:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5035:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},26364:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",o="[^"+t+"]",a="(?:\ud83c[\udde6-\uddff]){2}",i="[\ud800-\udbff][\udc00-\udfff]",l="(?:"+n+"|"+r+")?",s="[\\ufe0e\\ufe0f]?",c="(?:\\u200d(?:"+[o,a,i].join("|")+")"+s+l+")*",u=RegExp(r+"(?="+r+")|(?:"+[o+n+"?",n,a,i,"["+t+"]"].join("|")+")"+(s+l+c),"g");e.exports=function(e){return e.match(u)||[]}},92353:function(e){e.exports=function(e){return function(){return e}}},7310:function(e,t,n){var r=n(28302),o=n(11121),a=n(6660),i=Math.max,l=Math.min;e.exports=function(e,t,n){var s,c,u,d,f,p,h=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,d=e.apply(r,n)}function b(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,a=o();if(b(a))return w(a);f=setTimeout(x,(e=a-p,n=a-h,r=t-e,g?l(r,u-n):r))}function w(e){return(f=void 0,v&&s)?y(e):(s=c=void 0,d)}function k(){var e,n=o(),r=b(n);if(s=arguments,c=this,p=n,r){if(void 0===f)return h=e=p,f=setTimeout(x,t),m?y(e):d;if(g)return clearTimeout(f),f=setTimeout(x,t),y(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?i(a(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),k.cancel=function(){void 0!==f&&clearTimeout(f),h=0,s=p=c=f=void 0},k.flush=function(){return void 0===f?d:w(o())},k}},37560:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},32242:function(e,t,n){var r=n(78897),o=n(28935),a=n(88157),i=n(25614),l=n(49639);e.exports=function(e,t,n){var s=i(e)?r:o;return n&&l(e,t,n)&&(t=void 0),s(e,a(t,3))}},84173:function(e,t,n){var r=n(82602)(n(12152));e.exports=r},12152:function(e,t,n){var r=n(8235),o=n(88157),a=n(85759),i=Math.max;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return -1;var s=null==n?0:a(n);return s<0&&(s=i(l+s,0)),r(e,o(t,3),s)}},11314:function(e,t,n){var r=n(72569),o=n(89238);e.exports=function(e,t){return r(o(e,t),1)}},13735:function(e,t,n){var r=n(92167);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},17764:function(e,t,n){var r=n(93012),o=n(59592);e.exports=function(e,t){return null!=e&&o(e,t,r)}},79586:function(e){e.exports=function(e){return e}},56569:function(e,t,n){var r=n(90370),o=n(10303),a=Object.prototype,i=a.hasOwnProperty,l=a.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!l.call(e,"callee")};e.exports=s},25614:function(e){var t=Array.isArray;e.exports=t},5629:function(e,t,n){var r=n(86757),o=n(13973);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},24342:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return!0===e||!1===e||o(e)&&"[object Boolean]"==r(e)}},98051:function(e,t,n){e=n.nmd(e);var r=n(74288),o=n(7406),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,l=i&&i.exports===a?r.Buffer:void 0,s=l?l.isBuffer:void 0;e.exports=s||o},21652:function(e,t,n){var r=n(56318);e.exports=function(e,t){return r(e,t)}},86757:function(e,t,n){var r=n(54506),o=n(28302);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},13973:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},82559:function(e,t,n){var r=n(22345);e.exports=function(e){return r(e)&&e!=+e}},77571:function(e){e.exports=function(e){return null==e}},22345:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"number"==typeof e||o(e)&&"[object Number]"==r(e)}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},90231:function(e,t,n){var r=n(54506),o=n(62602),a=n(10303),i=Object.prototype,l=Function.prototype.toString,s=i.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},42715:function(e,t,n){var r=n(54506),o=n(25614),a=n(10303);e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&"[object String]"==r(e)}},78371:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},9792:function(e,t,n){var r=n(59332),o=n(23305),a=n(39931),i=a&&a.isTypedArray,l=i?o(i):r;e.exports=l},43228:function(e,t,n){var r=n(28579),o=n(4578),a=n(5629);e.exports=function(e){return a(e)?r(e):o(e)}},86185:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},89238:function(e,t,n){var r=n(73819),o=n(88157),a=n(24240),i=n(25614);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},41443:function(e,t,n){var r=n(83023),o=n(98060),a=n(88157);e.exports=function(e,t){var n={};return t=a(t,3),o(e,function(e,o,a){r(n,o,t(e,o,a))}),n}},95645:function(e,t,n){var r=n(67646),o=n(58905),a=n(79586);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},35802:function(e,t,n){var r=n(67646),o=n(58905),a=n(88157);e.exports=function(e,t){return e&&e.length?r(e,a(t,2),o):void 0}},50967:function(e,t,n){var r=n(76219);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},99008:function(e,t,n){var r=n(67646),o=n(20121),a=n(79586);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),a=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),a):void 0}},93810:function(e){e.exports=function(){}},11121:function(e,t,n){var r=n(74288);e.exports=function(){return r.Date.now()}},22350:function(e,t,n){var r=n(18155),o=n(73584),a=n(67352),i=n(70235);e.exports=function(e){return a(e)?r(i(e)):o(e)}},99676:function(e,t,n){var r=n(35464)();e.exports=r},33645:function(e,t,n){var r=n(25253),o=n(88157),a=n(12327),i=n(25614),l=n(49639);e.exports=function(e,t,n){var s=i(e)?r:a;return n&&l(e,t,n)&&(t=void 0),s(e,o(t,3))}},34935:function(e,t,n){var r=n(72569),o=n(84046),a=n(44843),i=n(49639),l=a(function(e,t){if(null==e)return[];var n=t.length;return n>1&&i(e,t[0],t[1])?t=[]:n>2&&i(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])});e.exports=l},55716:function(e){e.exports=function(){return[]}},7406:function(e){e.exports=function(){return!1}},37065:function(e,t,n){var r=n(7310),o=n(28302);e.exports=function(e,t,n){var a=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(n)&&(a="leading"in n?!!n.leading:a,i="trailing"in n?!!n.trailing:i),r(e,t,{leading:a,maxWait:t,trailing:i})}},175:function(e,t,n){var r=n(6660),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},85759:function(e,t,n){var r=n(175);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},6660:function(e,t,n){var r=n(41087),o=n(28302),a=n(78371),i=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return i;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):l.test(e)?i:+e}},3641:function(e,t,n){var r=n(65020);e.exports=function(e){return null==e?"":r(e)}},47230:function(e,t,n){var r=n(88157),o=n(13826);e.exports=function(e,t){return e&&e.length?o(e,r(t,2)):[]}},75551:function(e,t,n){var r=n(80675)("toUpperCase");e.exports=r},30401:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},40875:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22135:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},64935:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},96362:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},87769:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},42208:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},29202:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},54001:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},21047:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},96137:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},80221:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},70525:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},76865:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},49663:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},95805:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},11239:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},24601:function(){},15452:function(e,t){var n,r,o;r=[],void 0!==(o="function"==typeof(n=function e(){var t,n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},r=!n.document&&!!n.postMessage,o=n.IS_PAPA_WORKER||!1,a={},i=0,l={};function s(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new p(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<r){let t=this._config.newline;t||(a=this._config.quoteChar||'"',t=this._handle.guessLineEndings(e,a)),e=[...e.split(t).slice(r)].join(t)}this.isFirstChunk&&w(this._config.beforeFirstChunk)&&void 0!==(a=this._config.beforeFirstChunk(e))&&(e=a),this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e,a=(this._partialLine="",this._handle.parse(r,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,this._finished||(this._partialLine=r.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),r=this._finished||this._config.preview&&this._rowCount>=this._config.preview,o)n.postMessage({results:a,workerId:l.WORKER_ID,finished:r});else if(w(this._config.chunk)&&!t){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!r||!w(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),r||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){w(this._config.error)?this._config.error(e):o&&this._config.error&&n.postMessage({workerId:l.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=l.RemoteChunkSize),s.call(this,e),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),r||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var e,n,o=this._config.downloadRequestHeaders;for(n in o)t.setRequestHeader(n,o[n])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}r&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function u(e){(e=e||{}).chunkSize||(e.chunkSize=l.LocalChunkSize),s.call(this,e);var t,n,r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,o=(this._config.chunkSize&&(o=Math.min(this._start+this._config.chunkSize,this._input.size),e=n.call(e,this._start,o)),t.readAsText(e,this._config.encoding));r||this._chunkLoaded({target:{result:o}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function d(e){var t;s.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,n;if(!this._finished)return t=(e=this._config.chunkSize)?(n=t.substring(0,e),t.substring(e)):(n=t,""),this._finished=!t,this.parseChunk(n)}}function f(e){s.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){s.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){s.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=x(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=x(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=x(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=x(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function p(e){var t,n,r,o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,s=this,c=0,u=0,d=!1,f=!1,p=[],g={data:[],errors:[],meta:{}};function v(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function y(){if(g&&r&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!v(e)})),x()){if(g){if(Array.isArray(g.data[0])){for(var t,n=0;x()&&n<g.data.length;n++)g.data[n].forEach(o);g.data.splice(0,1)}else g.data.forEach(o)}function o(t,n){w(e.transformHeader)&&(t=e.transformHeader(t,n)),p.push(t)}}function s(t,n){for(var r=e.header?{}:[],o=0;o<t.length;o++){let n,c;var l=o,s=t[o],s=(n=l=e.header?o>=p.length?"__parsed_extra":p[o]:l,c=s=e.transform?e.transform(s,l):s,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[n]&&(e.dynamicTyping[n]=e.dynamicTypingFunction(n)),!0===(e.dynamicTyping[n]||e.dynamicTyping))?"true"===c||"TRUE"===c||"false"!==c&&"FALSE"!==c&&((e=>{if(a.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(c)?parseFloat(c):i.test(c)?new Date(c):""===c?null:c):c);"__parsed_extra"===l?(r[l]=r[l]||[],r[l].push(s)):r[l]=s}return e.header&&(o>p.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+p.length+" fields but parsed "+o,u+n):o<p.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+p.length+" fields but parsed "+o,u+n)),r}g&&(e.header||e.dynamicTyping||e.transform)&&(t=1,!g.data.length||Array.isArray(g.data[0])?(g.data=g.data.map(s),t=g.data.length):g.data=s(g.data,0),e.header&&g.meta&&(g.meta.fields=p),u+=t)}function x(){return e.header&&0===p.length}function k(e,t,n,r){e={type:e,code:t,message:n},void 0!==r&&(e.row=r),g.errors.push(e)}w(e.step)&&(o=e.step,e.step=function(t){g=t,x()?y():(y(),0!==g.data.length&&(c+=t.data.length,e.preview&&c>e.preview?n.abort():(g.data=g.data[0],o(g,s))))}),this.parse=function(o,a,i){var s=e.quoteChar||'"',s=(e.newline||(e.newline=this.guessLineEndings(o,s)),r=!1,e.delimiter?w(e.delimiter)&&(e.delimiter=e.delimiter(o),g.meta.delimiter=e.delimiter):((s=((t,n,r,o,a)=>{var i,s,c,u;a=a||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var d=0;d<a.length;d++){for(var f,p=a[d],h=0,g=0,y=0,b=(c=void 0,new m({comments:o,delimiter:p,newline:n,preview:10}).parse(t)),x=0;x<b.data.length;x++)r&&v(b.data[x])?y++:(g+=f=b.data[x].length,void 0===c?c=f:0<f&&(h+=Math.abs(f-c),c=f));0<b.data.length&&(g/=b.data.length-y),(void 0===s||h<=s)&&(void 0===u||u<g)&&1.99<g&&(s=h,i=p,u=g)}return{successful:!!(e.delimiter=i),bestDelimiter:i}})(o,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=s.bestDelimiter:(r=!0,e.delimiter=l.DefaultDelimiter),g.meta.delimiter=e.delimiter),b(e));return e.preview&&e.header&&s.preview++,t=o,g=(n=new m(s)).parse(t,a,i),y(),d?{meta:{paused:!0}}:g||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,n.abort(),t=w(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){s.streamer._halted?(d=!1,s.streamer.parseChunk(t,!0)):setTimeout(s.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,n.abort(),g.meta.aborted=!0,w(e.complete)&&e.complete(g),t=""},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=RegExp(h(t)+"([^]*?)"+h(t),"gm"),n=(e=e.replace(t,"")).split("\r"),t=e.split("\n"),e=1<t.length&&t[0].length<n[0].length;if(1===n.length||e)return"\n";for(var r=0,o=0;o<n.length;o++)"\n"===n[o][0]&&r++;return r>=n.length/2?"\r\n":"\r"}}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,n=e.newline,r=e.comments,o=e.step,a=e.preview,i=e.fastMode,s=null,c=!1,u=null==e.quoteChar?'"':e.quoteChar,d=u;if(void 0!==e.escapeChar&&(d=e.escapeChar),("string"!=typeof t||-1<l.BAD_DELIMITERS.indexOf(t))&&(t=","),r===t)throw Error("Comment character same as delimiter");!0===r?r="#":("string"!=typeof r||-1<l.BAD_DELIMITERS.indexOf(r))&&(r=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var f=0,p=!1;this.parse=function(l,m,g){if("string"!=typeof l)throw Error("Input must be a string");var v=l.length,y=t.length,b=n.length,x=r.length,k=w(o),S=[],E=[],O=[],C=f=0;if(!l)return Z();if(i||!1!==i&&-1===l.indexOf(u)){for(var j=l.split(n),_=0;_<j.length;_++){if(O=j[_],f+=O.length,_!==j.length-1)f+=n.length;else if(g)break;if(!r||O.substring(0,x)!==r){if(k){if(S=[],I(O.split(t)),z(),p)return Z()}else I(O.split(t));if(a&&a<=_)return S=S.slice(0,a),Z(!0)}}return Z()}for(var P=l.indexOf(t,f),N=l.indexOf(n,f),T=RegExp(h(d)+h(u),"g"),A=l.indexOf(u,f);;)if(l[f]===u)for(A=f,f++;;){if(-1===(A=l.indexOf(u,A+1)))return g||E.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:S.length,index:f}),D();if(A===v-1)return D(l.substring(f,A).replace(T,u));if(u===d&&l[A+1]===d)A++;else if(u===d||0===A||l[A-1]!==d){-1!==P&&P<A+1&&(P=l.indexOf(t,A+1));var M=R(-1===(N=-1!==N&&N<A+1?l.indexOf(n,A+1):N)?P:Math.min(P,N));if(l.substr(A+1+M,y)===t){O.push(l.substring(f,A).replace(T,u)),l[f=A+1+M+y]!==u&&(A=l.indexOf(u,f)),P=l.indexOf(t,f),N=l.indexOf(n,f);break}if(M=R(N),l.substring(A+1+M,A+1+M+b)===n){if(O.push(l.substring(f,A).replace(T,u)),L(A+1+M+b),P=l.indexOf(t,f),A=l.indexOf(u,f),k&&(z(),p))return Z();if(a&&S.length>=a)return Z(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:S.length,index:f}),A++}}else if(r&&0===O.length&&l.substring(f,f+x)===r){if(-1===N)return Z();f=N+b,N=l.indexOf(n,f),P=l.indexOf(t,f)}else if(-1!==P&&(P<N||-1===N))O.push(l.substring(f,P)),f=P+y,P=l.indexOf(t,f);else{if(-1===N)break;if(O.push(l.substring(f,N)),L(N+b),k&&(z(),p))return Z();if(a&&S.length>=a)return Z(!0)}return D();function I(e){S.push(e),C=f}function R(e){return -1!==e&&(e=l.substring(A+1,e))&&""===e.trim()?e.length:0}function D(e){return g||(void 0===e&&(e=l.substring(f)),O.push(e),f=v,I(O),k&&z()),Z()}function L(e){f=e,I(O),O=[],N=l.indexOf(n,f)}function Z(r){if(e.header&&!m&&S.length&&!c){var o=S[0],a={},i=new Set(o);let t=!1;for(let n=0;n<o.length;n++){let r=o[n];if(a[r=w(e.transformHeader)?e.transformHeader(r,n):r]){let e,l=a[r];for(;e=r+"_"+l,l++,i.has(e););i.add(e),o[n]=e,a[r]++,t=!0,(s=null===s?{}:s)[e]=r}else a[r]=1,o[n]=r;i.add(r)}t&&console.warn("Duplicate headers found and renamed."),c=!0}return{data:S,errors:E,meta:{delimiter:t,linebreak:n,aborted:p,truncated:!!r,cursor:C+(m||0),renamedHeaders:s}}}function z(){o(Z()),S=[],E=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return f}}function g(e){var t=e.data,n=a[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var o={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(w(n.userStep)){for(var i=0;i<t.results.data.length&&(n.userStep({data:t.results.data[i],errors:t.results.errors,meta:t.results.meta},o),!r);i++);delete t.results}else w(n.userChunk)&&(n.userChunk(t.results,o,t.file),delete t.results)}t.finished&&!r&&v(t.workerId,t.results)}function v(e,t){var n=a[e];w(n.userComplete)&&n.userComplete(t),n.terminate(),delete a[e]}function y(){throw Error("Not implemented.")}function b(e){if("object"!=typeof e||null===e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=b(e[t]);return n}function x(e,t){return function(){e.apply(t,arguments)}}function w(e){return"function"==typeof e}return l.parse=function(t,r){var o,s,p,h=(r=r||{}).dynamicTyping||!1;if(w(h)&&(r.dynamicTypingFunction=h,h={}),r.dynamicTyping=h,r.transform=!!w(r.transform)&&r.transform,!r.worker||!l.WORKERS_SUPPORTED){let e;return h=null,l.NODE_STREAM_INPUT,"string"==typeof t?(t=65279!==(e=t).charCodeAt(0)?e:e.slice(1),h=new(r.download?c:d)(r)):!0===t.readable&&w(t.read)&&w(t.on)?h=new f(r):(n.File&&t instanceof File||t instanceof Object)&&(h=new u(r)),h.stream(t)}(h=!!l.WORKERS_SUPPORTED&&(s=n.URL||n.webkitURL||null,p=e.toString(),o=l.BLOB_URL||(l.BLOB_URL=s.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",p,")();"],{type:"text/javascript"}))),(o=new n.Worker(o)).onmessage=g,o.id=i++,a[o.id]=o)).userStep=r.step,h.userChunk=r.chunk,h.userComplete=r.complete,h.userError=r.error,r.step=w(r.step),r.chunk=w(r.chunk),r.complete=w(r.complete),r.error=w(r.error),delete r.worker,h.postMessage({input:t,config:r,workerId:h.id})},l.unparse=function(e,t){var n=!1,r=!0,o=",",a="\r\n",i='"',s=i+i,c=!1,u=null,d=!1,f=((()=>{if("object"==typeof t){if("string"!=typeof t.delimiter||l.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(o=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(a=t.newline),"string"==typeof t.quoteChar&&(i=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(s=t.escapeChar+i),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),RegExp(h(i),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,c);if("object"==typeof e[0])return p(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),p(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function p(e,t,n){var i="",l=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),s=!Array.isArray(t[0]);if(l&&r){for(var c=0;c<e.length;c++)0<c&&(i+=o),i+=m(e[c],c);0<t.length&&(i+=a)}for(var u=0;u<t.length;u++){var d=(l?e:t[u]).length,f=!1,p=l?0===Object.keys(t[u]).length:0===t[u].length;if(n&&!l&&(f="greedy"===n?""===t[u].join("").trim():1===t[u].length&&0===t[u][0].length),"greedy"===n&&l){for(var h=[],g=0;g<d;g++){var v=s?e[g]:g;h.push(t[u][v])}f=""===h.join("").trim()}if(!f){for(var y=0;y<d;y++){0<y&&!p&&(i+=o);var b=l&&s?e[y]:y;i+=m(t[u][b],y)}u<t.length-1&&(!n||0<d&&!p)&&(i+=a)}}return i}function m(e,t){var r,a;return null==e?"":e.constructor===Date?JSON.stringify(e).slice(1,25):(a=!1,d&&"string"==typeof e&&d.test(e)&&(e="'"+e,a=!0),r=e.toString().replace(f,s),(a=a||!0===n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1})(r,l.BAD_DELIMITERS)||-1<r.indexOf(o)||" "===r.charAt(0)||" "===r.charAt(r.length-1))?i+r+i:r)}},l.RECORD_SEP="\x1e",l.UNIT_SEP="\x1f",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r","\n",'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!r&&!!n.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=m,l.ParserHandle=p,l.NetworkStreamer=c,l.FileStreamer=u,l.StringStreamer=d,l.ReadableStreamStreamer=f,n.jQuery&&((t=n.jQuery).fn.parse=function(e){var r=e.config||{},o=[];return this.each(function(e){if(!("INPUT"===t(this).prop("tagName").toUpperCase()&&"file"===t(this).attr("type").toLowerCase()&&n.FileReader)||!this.files||0===this.files.length)return!0;for(var a=0;a<this.files.length;a++)o.push({file:this.files[a],inputElem:this,instanceConfig:t.extend({},r)})}),a(),this;function a(){if(0===o.length)w(e.complete)&&e.complete();else{var n,r,a,s,c=o[0];if(w(e.before)){var u=e.before(c.file,c.inputElem);if("object"==typeof u){if("abort"===u.action)return n="AbortError",r=c.file,a=c.inputElem,s=u.reason,void(w(e.error)&&e.error({name:n},r,a,s));if("skip"===u.action)return void i();"object"==typeof u.config&&(c.instanceConfig=t.extend(c.instanceConfig,u.config))}else if("skip"===u)return void i()}var d=c.instanceConfig.complete;c.instanceConfig.complete=function(e){w(d)&&d(e,c.file,c.inputElem),i()},l.parse(c.file,c.instanceConfig)}}function i(){o.splice(0,1),a()}}),o&&(n.onmessage=function(e){e=e.data,void 0===l.WORKER_ID&&e&&(l.WORKER_ID=e.workerId),"string"==typeof e.input?n.postMessage({workerId:l.WORKER_ID,results:l.parse(e.input,e.config),finished:!0}):(n.File&&e.input instanceof File||e.input instanceof Object)&&(e=l.parse(e.input,e.config))&&n.postMessage({workerId:l.WORKER_ID,results:e,finished:!0})}),(c.prototype=Object.create(s.prototype)).constructor=c,(u.prototype=Object.create(s.prototype)).constructor=u,(d.prototype=Object.create(d.prototype)).constructor=d,(f.prototype=Object.create(s.prototype)).constructor=f,l})?n.apply(t,r):n)&&(e.exports=o)},48049:function(e,t,n){"use strict";var r=n(14397);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},40718:function(e,t,n){e.exports=n(48049)()},14397:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},96032:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6989),o=n(31686),a=n(41154),i=n(2265),l=["show"];function s(e,t){return i.useMemo(function(){var n={};t&&(n.show="object"===(0,a.Z)(t)&&t.formatter?t.formatter:!!t);var i=n=(0,o.Z)((0,o.Z)({},n),e),s=i.show,c=(0,r.Z)(i,l);return(0,o.Z)((0,o.Z)({},c),{},{show:!!s,showFormatter:"function"==typeof s?s:void 0,strategy:c.strategy||function(e){return e.length}})},[e,t])}},2027:function(e,t,n){"use strict";n.d(t,{Q:function(){return d},Z:function(){return b}});var r=n(31686),o=n(1119),a=n(11993),i=n(41154),l=n(36760),s=n.n(l),c=n(2265),u=n(55041),d=function(e){var t=e.inputElement,n=e.children,l=e.prefixCls,d=e.prefix,f=e.suffix,p=e.addonBefore,h=e.addonAfter,m=e.className,g=e.style,v=e.disabled,y=e.readOnly,b=e.focused,x=e.triggerFocus,w=e.allowClear,k=e.value,S=e.handleReset,E=e.hidden,O=e.classes,C=e.classNames,j=e.dataAttrs,_=e.styles,P=e.components,N=null!=n?n:t,T=(null==P?void 0:P.affixWrapper)||"span",A=(null==P?void 0:P.groupWrapper)||"span",M=(null==P?void 0:P.wrapper)||"span",I=(null==P?void 0:P.groupAddon)||"span",R=(0,c.useRef)(null),D=(0,u.X3)(e),L=(0,c.cloneElement)(N,{value:k,className:s()(N.props.className,!D&&(null==C?void 0:C.variant))||null});if(D){var Z=null;if(w){var z,B,F,H,q=!v&&!y&&k,W="".concat(l,"-clear-icon"),U="object"===(0,i.Z)(w)&&null!=w&&w.clearIcon?w.clearIcon:"✖";Z=c.createElement("span",{onClick:S,onMouseDown:function(e){return e.preventDefault()},className:s()(W,(H={},(0,a.Z)(H,"".concat(W,"-hidden"),!q),(0,a.Z)(H,"".concat(W,"-has-suffix"),!!f),H)),role:"button",tabIndex:-1},U)}var K="".concat(l,"-affix-wrapper"),$=s()(K,(F={},(0,a.Z)(F,"".concat(l,"-disabled"),v),(0,a.Z)(F,"".concat(K,"-disabled"),v),(0,a.Z)(F,"".concat(K,"-focused"),b),(0,a.Z)(F,"".concat(K,"-readonly"),y),(0,a.Z)(F,"".concat(K,"-input-with-clear-btn"),f&&w&&k),F),null==O?void 0:O.affixWrapper,null==C?void 0:C.affixWrapper,null==C?void 0:C.variant),V=(f||w)&&c.createElement("span",{className:s()("".concat(l,"-suffix"),null==C?void 0:C.suffix),style:null==_?void 0:_.suffix},Z,f);L=c.createElement(T,(0,o.Z)({className:$,style:null==_?void 0:_.affixWrapper,onClick:function(e){var t;null!==(t=R.current)&&void 0!==t&&t.contains(e.target)&&(null==x||x())}},null==j?void 0:j.affixWrapper,{ref:R}),d&&c.createElement("span",{className:s()("".concat(l,"-prefix"),null==C?void 0:C.prefix),style:null==_?void 0:_.prefix},d),L,V)}if((0,u.He)(e)){var X="".concat(l,"-group"),G="".concat(X,"-addon"),Y="".concat(X,"-wrapper"),Q=s()("".concat(l,"-wrapper"),X,null==O?void 0:O.wrapper,null==C?void 0:C.wrapper),J=s()(Y,(0,a.Z)({},"".concat(Y,"-disabled"),v),null==O?void 0:O.group,null==C?void 0:C.groupWrapper);L=c.createElement(A,{className:J},c.createElement(M,{className:Q},p&&c.createElement(I,{className:G},p),L,h&&c.createElement(I,{className:G},h)))}return c.cloneElement(L,{className:s()(null===(z=L.props)||void 0===z?void 0:z.className,m)||null,style:(0,r.Z)((0,r.Z)({},null===(B=L.props)||void 0===B?void 0:B.style),g),hidden:E})},f=n(83145),p=n(26365),h=n(6989),m=n(50506),g=n(18694),v=n(96032),y=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],b=(0,c.forwardRef)(function(e,t){var n,i=e.autoComplete,l=e.onChange,b=e.onFocus,x=e.onBlur,w=e.onPressEnter,k=e.onKeyDown,S=e.prefixCls,E=void 0===S?"rc-input":S,O=e.disabled,C=e.htmlSize,j=e.className,_=e.maxLength,P=e.suffix,N=e.showCount,T=e.count,A=e.type,M=e.classes,I=e.classNames,R=e.styles,D=e.onCompositionStart,L=e.onCompositionEnd,Z=(0,h.Z)(e,y),z=(0,c.useState)(!1),B=(0,p.Z)(z,2),F=B[0],H=B[1],q=(0,c.useRef)(!1),W=(0,c.useRef)(null),U=function(e){W.current&&(0,u.nH)(W.current,e)},K=(0,m.Z)(e.defaultValue,{value:e.value}),$=(0,p.Z)(K,2),V=$[0],X=$[1],G=null==V?"":String(V),Y=(0,c.useState)(null),Q=(0,p.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,v.Z)(T,N),en=et.max||_,er=et.strategy(G),eo=!!en&&er>en;(0,c.useImperativeHandle)(t,function(){return{focus:U,blur:function(){var e;null===(e=W.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=W.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=W.current)||void 0===e||e.select()},input:W.current}}),(0,c.useEffect)(function(){H(function(e){return(!e||!O)&&e})},[O]);var ea=function(e,t,n){var r,o,a=t;if(!q.current&&et.exceedFormatter&&et.max&&et.strategy(t)>et.max)a=et.exceedFormatter(t,{max:et.max}),t!==a&&ee([(null===(r=W.current)||void 0===r?void 0:r.selectionStart)||0,(null===(o=W.current)||void 0===o?void 0:o.selectionEnd)||0]);else if("compositionEnd"===n.source)return;X(a),W.current&&(0,u.rJ)(W.current,e,l,a)};(0,c.useEffect)(function(){if(J){var e;null===(e=W.current)||void 0===e||e.setSelectionRange.apply(e,(0,f.Z)(J))}},[J]);var ei=eo&&"".concat(E,"-out-of-range");return c.createElement(d,(0,o.Z)({},Z,{prefixCls:E,className:s()(j,ei),handleReset:function(e){X(""),U(),W.current&&(0,u.rJ)(W.current,e,l)},value:G,focused:F,triggerFocus:U,suffix:function(){var e=Number(en)>0;if(P||et.show){var t=et.showFormatter?et.showFormatter({value:G,count:er,maxLength:en}):"".concat(er).concat(e?" / ".concat(en):"");return c.createElement(c.Fragment,null,et.show&&c.createElement("span",{className:s()("".concat(E,"-show-count-suffix"),(0,a.Z)({},"".concat(E,"-show-count-has-suffix"),!!P),null==I?void 0:I.count),style:(0,r.Z)({},null==R?void 0:R.count)},t),P)}return null}(),disabled:O,classes:M,classNames:I,styles:R}),(n=(0,g.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]),c.createElement("input",(0,o.Z)({autoComplete:i},n,{onChange:function(e){ea(e,e.target.value,{source:"change"})},onFocus:function(e){H(!0),null==b||b(e)},onBlur:function(e){H(!1),null==x||x(e)},onKeyDown:function(e){w&&"Enter"===e.key&&w(e),null==k||k(e)},className:s()(E,(0,a.Z)({},"".concat(E,"-disabled"),O),null==I?void 0:I.input),style:null==R?void 0:R.input,ref:W,size:C,type:void 0===A?"text":A,onCompositionStart:function(e){q.current=!0,null==D||D(e)},onCompositionEnd:function(e){q.current=!1,ea(e,e.currentTarget.value,{source:"compositionEnd"}),null==L||L(e)}}))))})},55041:function(e,t,n){"use strict";function r(e){return!!(e.addonBefore||e.addonAfter)}function o(e){return!!(e.prefix||e.suffix||e.allowClear)}function a(e,t,n,r){if(n){var o=t;if("click"===t.type){var a=e.cloneNode(!0);o=Object.create(t,{target:{value:a},currentTarget:{value:a}}),a.value="",n(o);return}if("file"!==e.type&&void 0!==r){var i=e.cloneNode(!0);o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value=r,n(o);return}n(o)}}function i(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}n.d(t,{He:function(){return r},X3:function(){return o},nH:function(){return i},rJ:function(){return a}})},10281:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(94981),o=function(e){if((0,r.Z)()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(e){return e in n.style})}return!1},a=function(e,t){if(!o(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function i(e,t){return Array.isArray(e)||void 0===t?o(e):a(e,t)}},6337:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=l(n(2265)),a=l(n(49211)),i=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(s,e);var t,n,l=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=f(s);return e=t?Reflect.construct(n,arguments,f(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return d(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return p(d(e=l.call.apply(l,[this].concat(n))),"onClick",function(t){var n=e.props,r=n.text,i=n.onCopy,l=n.children,s=n.options,c=o.default.Children.only(l),u=(0,a.default)(r,s);i&&i(r,u),c&&c.props&&"function"==typeof c.props.onClick&&c.props.onClick(t)}),e}return n=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),r=o.default.Children.only(t);return o.default.cloneElement(r,c(c({},n),{},{onClick:this.onClick}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,n),Object.defineProperty(s,"prototype",{writable:!1}),s}(o.default.PureComponent);t.CopyToClipboard=h,p(h,"defaultProps",{onCopy:void 0,options:void 0})},29233:function(e,t,n){"use strict";var r=n(6337).CopyToClipboard;r.CopyToClipboard=r,e.exports=r},13126:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),m=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope"),t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isFragment=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case l:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case m:case h:case s:return e;default:return t}}case o:return t}}}(e)===a}},82558:function(e,t,n){"use strict";e.exports=n(13126)},52181:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState((function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}).bind(this))}function a(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function i(e){var t=e.prototype;if(!t||!t.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,i=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?i="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(i="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==i||null!==l)throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(e.displayName||e.name)+" uses "+("function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==i?"\n "+i:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks");if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=a;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return i}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},59221:function(e,t,n){"use strict";n.d(t,{ZP:function(){return eB},bO:function(){return U}});var r=n(2265),o=n(40718),a=n.n(o),i=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty;function c(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function u(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);var o=r.cache,a=o.get(t),i=o.get(n);if(a&&i)return a===n&&i===t;o.set(t,n),o.set(n,t);var l=e(t,n,r);return o.delete(t),o.delete(n),l}}function d(e){return i(e).concat(l(e))}var f=Object.hasOwn||function(e,t){return s.call(e,t)};function p(e,t){return e||t?e===t:e===t||e!=e&&t!=t}var h="_owner",m=Object.getOwnPropertyDescriptor,g=Object.keys;function v(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function y(e,t){return p(e.getTime(),t.getTime())}function b(e,t,n){if(e.size!==t.size)return!1;for(var r,o,a={},i=e.entries(),l=0;(r=i.next())&&!r.done;){for(var s=t.entries(),c=!1,u=0;(o=s.next())&&!o.done;){var d=r.value,f=d[0],p=d[1],h=o.value,m=h[0],g=h[1];!c&&!a[u]&&(c=n.equals(f,m,l,u,e,t,n)&&n.equals(p,g,f,m,e,t,n))&&(a[u]=!0),u++}if(!c)return!1;l++}return!0}function x(e,t,n){var r,o=g(e),a=o.length;if(g(t).length!==a)return!1;for(;a-- >0;)if((r=o[a])===h&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!f(t,r)||!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function w(e,t,n){var r,o,a,i=d(e),l=i.length;if(d(t).length!==l)return!1;for(;l-- >0;)if((r=i[l])===h&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!f(t,r)||!n.equals(e[r],t[r],r,r,e,t,n)||(o=m(e,r),a=m(t,r),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function k(e,t){return p(e.valueOf(),t.valueOf())}function S(e,t){return e.source===t.source&&e.flags===t.flags}function E(e,t,n){if(e.size!==t.size)return!1;for(var r,o,a={},i=e.values();(r=i.next())&&!r.done;){for(var l=t.values(),s=!1,c=0;(o=l.next())&&!o.done;)!s&&!a[c]&&(s=n.equals(r.value,o.value,r.value,o.value,e,t,n))&&(a[c]=!0),c++;if(!s)return!1}return!0}function O(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var C=Array.isArray,j="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,_=Object.assign,P=Object.prototype.toString.call.bind(Object.prototype.toString),N=T();function T(e){void 0===e&&(e={});var t,n,r,o,a,i,l,s,d,f=e.circular,p=e.createInternalComparator,h=e.createState,m=e.strict,g=(n=(t=function(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,o={areArraysEqual:r?w:v,areDatesEqual:y,areMapsEqual:r?c(b,w):b,areObjectsEqual:r?w:x,arePrimitiveWrappersEqual:k,areRegExpsEqual:S,areSetsEqual:r?c(E,w):E,areTypedArraysEqual:r?w:O};if(n&&(o=_({},o,n(o))),t){var a=u(o.areArraysEqual),i=u(o.areMapsEqual),l=u(o.areObjectsEqual),s=u(o.areSetsEqual);o=_({},o,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:l,areSetsEqual:s})}return o}(e)).areArraysEqual,r=t.areDatesEqual,o=t.areMapsEqual,a=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,l=t.areRegExpsEqual,s=t.areSetsEqual,d=t.areTypedArraysEqual,function(e,t,c){if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return e!=e&&t!=t;var u=e.constructor;if(u!==t.constructor)return!1;if(u===Object)return a(e,t,c);if(C(e))return n(e,t,c);if(null!=j&&j(e))return d(e,t,c);if(u===Date)return r(e,t,c);if(u===RegExp)return l(e,t,c);if(u===Map)return o(e,t,c);if(u===Set)return s(e,t,c);var f=P(e);return"[object Date]"===f?r(e,t,c):"[object RegExp]"===f?l(e,t,c):"[object Map]"===f?o(e,t,c):"[object Set]"===f?s(e,t,c):"[object Object]"===f?"function"!=typeof e.then&&"function"!=typeof t.then&&a(e,t,c):"[object Arguments]"===f?a(e,t,c):("[object Boolean]"===f||"[object Number]"===f||"[object String]"===f)&&i(e,t,c)}),N=p?p(g):function(e,t,n,r,o,a,i){return g(e,t,i)};return function(e){var t=e.circular,n=e.comparator,r=e.createState,o=e.equals,a=e.strict;if(r)return function(e,i){var l=r(),s=l.cache;return n(e,i,{cache:void 0===s?t?new WeakMap:void 0:s,equals:o,meta:l.meta,strict:a})};if(t)return function(e,t){return n(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:a})};var i={cache:void 0,equals:o,meta:void 0,strict:a};return function(e,t){return n(e,t,i)}}({circular:void 0!==f&&f,comparator:g,createState:h,equals:N,strict:void 0!==m&&m})}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;requestAnimationFrame(function r(o){if(n<0&&(n=o),o-n>t)e(o),n=-1;else{var a;a=r,"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(a)}})}function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(e,t,n){var r;return(r=function(e,t){if("object"!==R(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==R(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===R(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}T({strict:!0}),T({circular:!0}),T({circular:!0,strict:!0}),T({createInternalComparator:function(){return p}}),T({strict:!0,createInternalComparator:function(){return p}}),T({circular:!0,createInternalComparator:function(){return p}}),T({circular:!0,createInternalComparator:function(){return p},strict:!0});var z=["Webkit","Moz","O","ms"],B=["-webkit-","-moz-","-o-","-ms-"],F=["transform","transformOrigin","transition"],H=function(e){return e},q=function(e,t){if(-1===F.indexOf(e))return Z({},e,Number.isNaN(t)?0:t);var n="transition"===e,r=e.replace(/(\w)/,function(e){return e.toUpperCase()}),o=t;return z.reduce(function(e,a,i){return n&&(o=t.replace(/(transform|transform-origin)/gim,"".concat(B[i],"$1"))),L(L({},e),{},Z({},a+r,o))},{})},W=function(e,t){return Object.keys(t).reduce(function(n,r){return L(L({},n),{},Z({},r,e(r,t[r])))},{})},U=function(e){return Object.keys(e).reduce(function(e,t){return L(L({},e),q(t,e[t]))},e)},K=function(e,t,n){return e.map(function(e){return"".concat(e.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())})," ").concat(t,"ms ").concat(n)}).join(",")},$=function(e,t,n,r,o,a,i,l){};function V(e,t){if(e){if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var G=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},Y=function(e,t){return e.map(function(e,n){return e*Math.pow(t,n)}).reduce(function(e,t){return e+t})},Q=function(e,t){return function(n){return Y(G(e,t),n)}},J=function(){for(var e,t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=r[0],i=r[1],l=r[2],s=r[3];if(1===r.length)switch(r[0]){case"linear":a=0,i=0,l=1,s=1;break;case"ease":a=.25,i=.1,l=.25,s=1;break;case"ease-in":a=.42,i=0,l=1,s=1;break;case"ease-out":a=.42,i=0,l=.58,s=1;break;case"ease-in-out":a=0,i=0,l=.58,s=1;break;default:var c=r[0].split("(");if("cubic-bezier"===c[0]&&4===c[1].split(")")[0].split(",").length){var u,d=function(e){if(Array.isArray(e))return e}(u=c[1].split(")")[0].split(",").map(function(e){return parseFloat(e)}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),4!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(u,4)||V(u,4)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a=d[0],i=d[1],l=d[2],s=d[3]}else $(!1,"[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s",r)}$([a,l,i,s].every(function(e){return"number"==typeof e&&e>=0&&e<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",r);var f=Q(a,l),p=Q(i,s),h=(e=a,t=l,function(n){var r;return Y([].concat(function(e){if(Array.isArray(e))return X(e)}(r=G(e,t).map(function(e,t){return e*t}).slice(1))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||V(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),n)}),m=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var o,a=f(n)-t,i=h(n);if(1e-4>Math.abs(a-t)||i<1e-4)break;n=(o=n-a/i)>1?1:o<0?0:o}return p(n)};return m.isStepper=!1,m},ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,n=void 0===t?100:t,r=e.damping,o=void 0===r?8:r,a=e.dt,i=void 0===a?17:a,l=function(e,t,r){var a=r+(-(e-t)*n-r*o)*i/1e3,l=r*i/1e3+e;return 1e-4>Math.abs(l-t)&&1e-4>Math.abs(a)?[t,0]:[l,a]};return l.isStepper=!0,l.dt=i,l},et=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0];if("string"==typeof r)switch(r){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return J(r);case"spring":return ee();default:if("cubic-bezier"===r.split("(")[0])return J(r);$(!1,"[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s",t)}return"function"==typeof r?r:($(!1,"[configEasing]: first argument type should be function or string, instead received %s",t),null)};function en(e){return(en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function er(e){return function(e){if(Array.isArray(e))return es(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||el(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach(function(t){ei(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ei(e,t,n){var r;return(r=function(e,t){if("object"!==en(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==en(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===en(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function el(e,t){if(e){if("string"==typeof e)return es(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return es(e,t)}}function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ec=function(e,t,n){return e+(t-e)*n},eu=function(e){return e.from!==e.to},ed=function e(t,n,r){var o=W(function(e,n){if(eu(n)){var r,o=function(e){if(Array.isArray(e))return e}(r=t(n.from,n.to,n.velocity))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(r,2)||el(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o[1];return ea(ea({},n),{},{from:a,velocity:i})}return n},n);return r<1?W(function(e,t){return eu(t)?ea(ea({},t),{},{velocity:ec(t.velocity,o[e].velocity,r),from:ec(t.from,o[e].from,r)}):t},n):e(t,o,r-1)},ef=function(e,t,n,r,o){var a,i,l=[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})}),s=l.reduce(function(n,r){return ea(ea({},n),{},ei({},r,[e[r],t[r]]))},{}),c=l.reduce(function(n,r){return ea(ea({},n),{},ei({},r,{from:e[r],velocity:0,to:t[r]}))},{}),u=-1,d=function(){return null};return d=n.isStepper?function(r){a||(a=r);var i=(r-a)/n.dt;c=ed(n,c,i),o(ea(ea(ea({},e),t),W(function(e,t){return t.from},c))),a=r,Object.values(c).filter(eu).length&&(u=requestAnimationFrame(d))}:function(a){i||(i=a);var l=(a-i)/r,c=W(function(e,t){return ec.apply(void 0,er(t).concat([n(l)]))},s);if(o(ea(ea(ea({},e),t),c)),l<1)u=requestAnimationFrame(d);else{var f=W(function(e,t){return ec.apply(void 0,er(t).concat([n(1)]))},s);o(ea(ea(ea({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(u)}}};function ep(e){return(ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eh=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function em(e){return function(e){if(Array.isArray(e))return eg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return eg(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ev(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ey(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ev(Object(n),!0).forEach(function(t){eb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ev(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eb(e,t,n){return(t=ex(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ex(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ep(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ep(t)?t:String(t)}function ew(e,t){return(ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ek(e,t){if(t&&("object"===ep(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eS(e)}function eS(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eE(e){return(eE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ew(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eE(a);return e=t?Reflect.construct(n,arguments,eE(this).constructor):n.apply(this,arguments),ek(this,e)});function a(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a);var n,r=(n=o.call(this,e,t)).props,i=r.isActive,l=r.attributeName,s=r.from,c=r.to,u=r.steps,d=r.children,f=r.duration;if(n.handleStyleChange=n.handleStyleChange.bind(eS(n)),n.changeStyle=n.changeStyle.bind(eS(n)),!i||f<=0)return n.state={style:{}},"function"==typeof d&&(n.state={style:c}),ek(n);if(u&&u.length)n.state={style:u[0].style};else if(s){if("function"==typeof d)return n.state={style:s},ek(n);n.state={style:l?eb({},l,s):s}}else n.state={style:{}};return n}return n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,o=t.attributeName,a=t.shouldReAnimate,i=t.to,l=t.from,s=this.state.style;if(r){if(!n){var c={style:o?eb({},o,i):i};this.state&&s&&(o&&s[o]!==i||!o&&s!==i)&&this.setState(c);return}if(!N(e.to,i)||!e.canBegin||!e.isActive){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?l:e.to;if(this.state&&s){var f={style:o?eb({},o,d):d};(o&&[o]!==d||!o&&s!==d)&&this.setState(f)}this.runAnimation(ey(ey({},this.props),{},{from:d,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"runJSAnimation",value:function(e){var t=this,n=e.from,r=e.to,o=e.duration,a=e.easing,i=e.begin,l=e.onAnimationEnd,s=e.onAnimationStart,c=ef(n,r,et(a),o,this.changeStyle);this.manager.start([s,i,function(){t.stopJSAnimation=c()},o,l])}},{key:"runStepAnimation",value:function(e){var t=this,n=e.steps,r=e.begin,o=e.onAnimationStart,a=n[0],i=a.style,l=a.duration;return this.manager.start([o].concat(em(n.reduce(function(e,r,o){if(0===o)return e;var a=r.duration,i=r.easing,l=void 0===i?"ease":i,s=r.style,c=r.properties,u=r.onAnimationEnd,d=o>0?n[o-1]:r,f=c||Object.keys(s);if("function"==typeof l||"spring"===l)return[].concat(em(e),[t.runJSAnimation.bind(t,{from:d.style,to:s,duration:a,easing:l}),a]);var p=K(f,a,l),h=ey(ey(ey({},d.style),s),{},{transition:p});return[].concat(em(e),[h,a,u]).filter(H)},[i,Math.max(void 0===l?0:l,r)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){if(!this.manager){var t,n,r;this.manager=(t=function(){return null},n=!1,r=function e(r){if(!n){if(Array.isArray(r)){if(!r.length)return;var o=function(e){if(Array.isArray(e))return e}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return I(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,void 0)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o.slice(1);if("number"==typeof a){A(e.bind(null,i),a);return}e(a),A(e.bind(null,i));return}"object"===M(r)&&t(r),"function"==typeof r&&r()}},{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}})}var o=e.begin,a=e.duration,i=e.attributeName,l=e.to,s=e.easing,c=e.onAnimationStart,u=e.onAnimationEnd,d=e.steps,f=e.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),"function"==typeof s||"function"==typeof f||"spring"===s){this.runJSAnimation(e);return}if(d.length>1){this.runStepAnimation(e);return}var h=i?eb({},i,l):l,m=K(Object.keys(h),a,s);p.start([c,o,ey(ey({},h),{},{transition:m}),a,u])}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration),o=(e.attributeName,e.easing,e.isActive),a=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eh)),i=r.Children.count(t),l=U(this.state.style);if("function"==typeof t)return t(l);if(!o||0===i||n<=0)return t;var s=function(e){var t=e.props,n=t.style,o=t.className;return(0,r.cloneElement)(e,ey(ey({},a),{},{style:ey(ey({},void 0===n?{}:n),l),className:o}))};return 1===i?s(r.Children.only(t)):r.createElement("div",null,r.Children.map(t,function(e){return s(e)}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ex(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);eO.displayName="Animate",eO.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},eO.propTypes={from:a().oneOfType([a().object,a().string]),to:a().oneOfType([a().object,a().string]),attributeName:a().string,duration:a().number,begin:a().number,easing:a().oneOfType([a().string,a().func]),steps:a().arrayOf(a().shape({duration:a().number.isRequired,style:a().object.isRequired,easing:a().oneOfType([a().oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),a().func]),properties:a().arrayOf("string"),onAnimationEnd:a().func})),children:a().oneOfType([a().node,a().func]),isActive:a().bool,canBegin:a().bool,onAnimationEnd:a().func,shouldReAnimate:a().bool,onAnimationStart:a().func,onAnimationReStart:a().func};var eC=n(30719),ej=["children","appearOptions","enterOptions","leaveOptions"];function e_(e){return(e_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eP(){return(eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eN(Object(n),!0).forEach(function(t){eR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eA(e,t){return(eA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eM(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eI(e){return(eI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eR(e,t,n){return(t=eD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eD(e){var t=function(e,t){if("object"!==e_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==e_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===e_(t)?t:String(t)}void 0===Number.isFinite&&(Number.isFinite=function(e){return"number"==typeof e&&isFinite(e)});var eL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.steps,n=e.duration;return t&&t.length?t.reduce(function(e,t){return e+(Number.isFinite(t.duration)&&t.duration>0?t.duration:0)},0):Number.isFinite(n)?n:0},eZ=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eA(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eI(a);return e=t?Reflect.construct(n,arguments,eI(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===e_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eM(e)}(this,e)});function a(){var e;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),eR(eM(e=o.call(this)),"handleEnter",function(t,n){var r=e.props,o=r.appearOptions,a=r.enterOptions;e.handleStyleActive(n?o:a)}),eR(eM(e),"handleExit",function(){var t=e.props.leaveOptions;e.handleStyleActive(t)}),e.state={isActive:!1},e}return n=[{key:"handleStyleActive",value:function(e){if(e){var t=e.onAnimationEnd?function(){e.onAnimationEnd()}:null;this.setState(eT(eT({},e),{},{onAnimationEnd:t,isActive:!0}))}}},{key:"parseTimeout",value:function(){var e=this.props,t=e.appearOptions,n=e.enterOptions,r=e.leaveOptions;return eL(t)+eL(n)+eL(r)}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,o=(t.appearOptions,t.enterOptions,t.leaveOptions,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,ej));return r.createElement(eC.Transition,eP({},o,{onEnter:this.handleEnter,onExit:this.handleExit,timeout:this.parseTimeout()}),function(){return r.createElement(eO,e.state,r.Children.only(n))})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eD(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.Component);function ez(e){var t=e.component,n=e.children,o=e.appear,a=e.enter,i=e.leave;return r.createElement(eC.TransitionGroup,{component:t},r.Children.map(n,function(e,t){return r.createElement(eZ,{appearOptions:o,enterOptions:a,leaveOptions:i,key:"child-".concat(t)},e)}))}eZ.propTypes={appearOptions:a().object,enterOptions:a().object,leaveOptions:a().object,children:a().element},ez.propTypes={appear:a().object,enter:a().object,leave:a().object,children:a().oneOfType([a().array,a().element]),component:a().any},ez.defaultProps={component:"span"};var eB=eO},94263:function(e,t){"use strict";t.Z={'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}},33664:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,function(e){if(!e||!e.__esModule){var t={};if(null!=e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}t.default=e}}(n(40718));var r=l(n(84617)),o=l(n(67973)),a=l(n(2265)),i=l(n(20536));function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n(32601);var c=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return(0,r.default)(e,t)})},u=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return(0,o.default)(e,t)})},d=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).onEnter=function(e,n){var r=t.getClassNames(n?"appear":"enter").className;t.removeClasses(e,"exit"),c(e,r),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.getClassNames(n?"appear":"enter").activeClassName;t.reflowAndAddClass(e,r),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.getClassNames("appear").doneClassName,o=t.getClassNames("enter").doneClassName;t.removeClasses(e,n?"appear":"enter"),c(e,n?r+" "+o:o),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.getClassNames("exit").className;t.removeClasses(e,"appear"),t.removeClasses(e,"enter"),c(e,n),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.getClassNames("exit").activeClassName;t.reflowAndAddClass(e,n),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.getClassNames("exit").doneClassName;t.removeClasses(e,"exit"),c(e,n),t.props.onExited&&t.props.onExited(e)},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?(r&&n?n+"-":"")+e:n[e],a=r?o+"-active":n[e+"Active"],i=r?o+"-done":n[e+"Done"];return{className:o,activeClassName:a,doneClassName:i}},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.removeClasses=function(e,t){var n=this.getClassNames(t),r=n.className,o=n.activeClassName,a=n.doneClassName;r&&u(e,r),o&&u(e,o),a&&u(e,a)},n.reflowAndAddClass=function(e,t){t&&(e&&e.scrollTop,c(e,t))},n.render=function(){var e=s({},this.props);return delete e.classNames,a.default.createElement(i.default,s({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(a.default.Component);d.defaultProps={classNames:""},d.propTypes={},t.default=d,e.exports=t.default},31601:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,i(n(40718));var r=i(n(2265)),o=n(54887),a=i(n(38244));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).handleEnter=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEnter",0,n)},t.handleEntering=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntering",0,n)},t.handleEntered=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntered",0,n)},t.handleExit=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExit",1,n)},t.handleExiting=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExiting",1,n)},t.handleExited=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExited",1,n)},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.handleLifecycle=function(e,t,n){var a,i=this.props.children,l=r.default.Children.toArray(i)[t];l.props[e]&&(a=l.props)[e].apply(a,n),this.props[e]&&this.props[e]((0,o.findDOMNode)(this))},n.render=function(){var e=this.props,t=e.children,n=e.in,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["children","in"]),i=r.default.Children.toArray(t),l=i[0],s=i[1];return delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,r.default.createElement(a.default,o,n?r.default.cloneElement(l,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(s,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},t}(r.default.Component);l.propTypes={},t.default=l,e.exports=t.default},20536:function(e,t,n){"use strict";t.__esModule=!0,t.default=t.EXITING=t.ENTERED=t.ENTERING=t.EXITED=t.UNMOUNTED=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}return t.default=e,t}(n(40718)),o=l(n(2265)),a=l(n(54887)),i=n(52181);function l(e){return e&&e.__esModule?e:{default:e}}n(32601);var s="unmounted";t.UNMOUNTED=s;var c="exited";t.EXITED=c;var u="entering";t.ENTERING=u;var d="entered";t.ENTERED=d;var f="exiting";t.EXITING=f;var p=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,o,a=n.transitionGroup,i=a&&!a.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=c,r.appearStatus=u):o=d:o=t.unmountOnExit||t.mountOnEnter?s:c,r.state={status:o},r.nextCallback=null,r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===s?{status:c}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==u&&n!==d&&(t=u):(n===u||n===d)&&(t=f)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=a.default.findDOMNode(this);t===u?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===c&&this.setState({status:s})},n.performEnter=function(e,t){var n=this,r=this.props.enter,o=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,a=this.getTimeouts(),i=o?a.appear:a.enter;if(!t&&!r){this.safeSetState({status:d},function(){n.props.onEntered(e)});return}this.props.onEnter(e,o),this.safeSetState({status:u},function(){n.props.onEntering(e,o),n.onTransitionEnd(e,i,function(){n.safeSetState({status:d},function(){n.props.onEntered(e,o)})})})},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();if(!n){this.safeSetState({status:c},function(){t.props.onExited(e)});return}this.props.onExit(e),this.safeSetState({status:f},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:c},function(){t.props.onExited(e)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;if(!e||r){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)},n.render=function(){var e=this.state.status;if(e===s)return null;var t=this.props,n=t.children,r=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var a=o.default.Children.only(n);return o.default.cloneElement(a,r)},t}(o.default.Component);function h(){}p.contextTypes={transitionGroup:r.object},p.childContextTypes={transitionGroup:function(){}},p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},p.UNMOUNTED=0,p.EXITED=1,p.ENTERING=2,p.ENTERED=3,p.EXITING=4;var m=(0,i.polyfill)(p);t.default=m},38244:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=l(n(40718)),o=l(n(2265)),a=n(52181),i=n(28710);function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var u=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},d=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(c(c(r)));return r.state={handleExited:o,firstRender:!0},r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},n.componentDidMount=function(){this.appeared=!0,this.mounted=!0},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?(0,i.getInitialChildMapping)(e,r):(0,i.getNextChildMapping)(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=(0,i.getChildMapping)(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=s({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["component","childFactory"]),a=u(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===t)?a:o.default.createElement(t,r,a)},t}(o.default.Component);d.childContextTypes={transitionGroup:r.default.object.isRequired},d.propTypes={},d.defaultProps={component:"div",childFactory:function(e){return e}};var f=(0,a.polyfill)(d);t.default=f,e.exports=t.default},30719:function(e,t,n){"use strict";var r=l(n(33664)),o=l(n(31601)),a=l(n(38244)),i=l(n(20536));function l(e){return e&&e.__esModule?e:{default:e}}e.exports={Transition:i.default,TransitionGroup:a.default,ReplaceTransition:o.default,CSSTransition:r.default}},28710:function(e,t,n){"use strict";t.__esModule=!0,t.getChildMapping=o,t.mergeChildMappings=a,t.getInitialChildMapping=function(e,t){return o(e.children,function(n){return(0,r.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:i(n,"appear",e),enter:i(n,"enter",e),exit:i(n,"exit",e)})})},t.getNextChildMapping=function(e,t,n){var l=o(e.children),s=a(t,l);return Object.keys(s).forEach(function(o){var a=s[o];if((0,r.isValidElement)(a)){var c=o in t,u=o in l,d=t[o],f=(0,r.isValidElement)(d)&&!d.props.in;u&&(!c||f)?s[o]=(0,r.cloneElement)(a,{onExited:n.bind(null,a),in:!0,exit:i(a,"exit",e),enter:i(a,"enter",e)}):u||!c||f?u&&c&&(0,r.isValidElement)(d)&&(s[o]=(0,r.cloneElement)(a,{onExited:n.bind(null,a),in:d.props.in,exit:i(a,"exit",e),enter:i(a,"enter",e)})):s[o]=(0,r.cloneElement)(a,{in:!1})}}),s};var r=n(2265);function o(e,t){var n=Object.create(null);return e&&r.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,r.isValidElement)(e)?t(e):e}),n}function a(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),a=[];for(var i in e)i in t?a.length&&(o[i]=a,a=[]):a.push(i);var l={};for(var s in t){if(o[s])for(r=0;r<o[s].length;r++){var c=o[s][r];l[o[s][r]]=n(c)}l[s]=n(s)}for(r=0;r<a.length;r++)l[a[r]]=n(a[r]);return l}function i(e,t,n){return null!=n[t]?n[t]:e.props[t]}},32601:function(e,t,n){"use strict";var r;t.__esModule=!0,t.classNamesShape=t.timeoutsShape=void 0,(r=n(40718))&&r.__esModule,t.timeoutsShape=null,t.classNamesShape=null},31699:function(e,t,n){"use strict";n.d(t,{$:function(){return Z}});var r=n(2265),o=n(87602),a=n(59221),i=n(21652),l=n.n(i),s=n(77571),c=n.n(s),u=n(9841),d=n(13137),f=n(20407),p=n(58772),h=n(16630),m=n(82944),g=n(34067),v=n(85355),y=n(41637),b=n(11638);function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var w=["x","y"];function k(){return(k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){var n=e.x,r=e.y,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,w),a=parseInt("".concat(n),10),i=parseInt("".concat(r),10),l=parseInt("".concat(t.height||o.height),10),s=parseInt("".concat(t.width||o.width),10);return E(E(E(E(E({},t),o),a?{x:a}:{}),i?{y:i}:{}),{},{height:l,width:s,name:t.name,radius:t.radius})}function C(e){return r.createElement(b.bn,k({shapeType:"rectangle",propTransformer:O,activeClassName:"recharts-active-bar"},e))}var j=["value","background"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(f,e);var t,n,i,s=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=R(f);return e=t?Reflect.construct(n,arguments,R(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return I(e)}(this,e)});function f(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,f);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return D(I(e=s.call.apply(s,[this].concat(n))),"state",{isAnimationFinished:!1}),D(I(e),"id",(0,h.EL)("recharts-bar-")),D(I(e),"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),D(I(e),"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return n=[{key:"renderRectanglesStatically",value:function(e){var t=this,n=this.props,o=n.shape,a=n.dataKey,i=n.activeIndex,l=n.activeBar,s=(0,m.L6)(this.props,!1);return e&&e.map(function(e,n){var c=n===i,d=T(T(T({},s),e),{},{isActive:c,option:c?l:o,index:n,dataKey:a,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return r.createElement(u.m,P({className:"recharts-bar-rectangle"},(0,y.bw)(t.props,e,n),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),r.createElement(C,d))})}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,n=t.data,o=t.layout,i=t.isAnimationActive,l=t.animationBegin,s=t.animationDuration,c=t.animationEasing,d=t.animationId,f=this.state.prevData;return r.createElement(a.ZP,{begin:l,duration:s,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var a=t.t,i=n.map(function(e,t){var n=f&&f[t];if(n){var r=(0,h.k4)(n.x,e.x),i=(0,h.k4)(n.y,e.y),l=(0,h.k4)(n.width,e.width),s=(0,h.k4)(n.height,e.height);return T(T({},e),{},{x:r(a),y:i(a),width:l(a),height:s(a)})}if("horizontal"===o){var c=(0,h.k4)(0,e.height)(a);return T(T({},e),{},{y:e.y+e.height-c,height:c})}var u=(0,h.k4)(0,e.width)(a);return T(T({},e),{},{width:u})});return r.createElement(u.m,null,e.renderRectanglesStatically(i))})}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!l()(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:"renderBackground",value:function(){var e=this,t=this.props,n=t.data,o=t.dataKey,a=t.activeIndex,i=(0,m.L6)(this.props.background,!1);return n.map(function(t,n){t.value;var l=t.background,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,j);if(!l)return null;var c=T(T(T(T(T({},s),{},{fill:"#eee"},l),i),(0,y.bw)(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:o,index:n,key:"background-bar-".concat(n),className:"recharts-bar-background-rectangle"});return r.createElement(C,P({option:e.props.background,isActive:n===a},c))})}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.data,a=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,m.NN)(s,d.W);if(!c)return null;var f="vertical"===l?o[0].height/2:o[0].width/2,p=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:(0,v.F$)(e,t)}};return r.createElement(u.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:o,xAxis:a,yAxis:i,layout:l,offset:f,dataPointFormatter:p})}))}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.data,a=e.className,i=e.xAxis,l=e.yAxis,s=e.left,d=e.top,f=e.width,h=e.height,m=e.isAnimationActive,g=e.background,v=e.id;if(t||!n||!n.length)return null;var y=this.state.isAnimationFinished,b=(0,o.Z)("recharts-bar",a),x=i&&i.allowDataOverflow,w=l&&l.allowDataOverflow,k=x||w,S=c()(v)?this.id:v;return r.createElement(u.m,{className:b},x||w?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(S)},r.createElement("rect",{x:x?s:s-f/2,y:w?d:d-h/2,width:x?f:2*f,height:w?h:2*h}))):null,r.createElement(u.m,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,S),(!m||y)&&p.e.renderCallByParent(this.props,n))}}],i=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],n&&A(f.prototype,n),i&&A(f,i),Object.defineProperty(f,"prototype",{writable:!1}),f}(r.PureComponent);D(Z,"displayName","Bar"),D(Z,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!g.x.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),D(Z,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,o=e.bandSize,a=e.xAxis,i=e.yAxis,l=e.xAxisTicks,s=e.yAxisTicks,c=e.stackedData,u=e.dataStartIndex,d=e.displayedData,p=e.offset,g=(0,v.Bu)(r,n);if(!g)return null;var y=t.layout,b=n.props,x=b.dataKey,w=b.children,k=b.minPointSize,S="horizontal"===y?i:a,E=c?S.scale.domain():null,O=(0,v.Yj)({numericAxis:S}),C=(0,m.NN)(w,f.b),j=d.map(function(e,t){var r,d,f,p,m,b;if(c?r=(0,v.Vv)(c[u+t],E):Array.isArray(r=(0,v.F$)(e,x))||(r=[O,r]),"horizontal"===y){var w,S=[i.scale(r[0]),i.scale(r[1])],j=S[0],_=S[1];d=(0,v.Fy)({axis:a,ticks:l,bandSize:o,offset:g.offset,entry:e,index:t}),f=null!==(w=null!=_?_:j)&&void 0!==w?w:void 0,p=g.size;var P=j-_;if(m=Number.isNaN(P)?0:P,b={x:d,y:i.y,width:p,height:i.height},Math.abs(k)>0&&Math.abs(m)<Math.abs(k)){var N=(0,h.uY)(m||k)*(Math.abs(k)-Math.abs(m));f-=N,m+=N}}else{var A=[a.scale(r[0]),a.scale(r[1])],M=A[0],I=A[1];if(d=M,f=(0,v.Fy)({axis:i,ticks:s,bandSize:o,offset:g.offset,entry:e,index:t}),p=I-M,m=g.size,b={x:a.x,y:f,width:a.width,height:m},Math.abs(k)>0&&Math.abs(p)<Math.abs(k)){var R=(0,h.uY)(p||k)*(Math.abs(k)-Math.abs(p));p+=R}}return T(T(T({},e),{},{x:d,y:f,width:p,height:m,value:c?r:r[1],payload:e,background:b},C&&C[t]&&C[t].props),{},{tooltipPayload:[(0,v.Qo)(n,e)],tooltipPosition:{x:d+p/2,y:f+m/2}})});return T({data:j,layout:y},p)})},80285:function(e,t,n){"use strict";n.d(t,{O:function(){return N}});var r=n(2265),o=n(86757),a=n.n(o),i=n(13735),l=n.n(i),s=n(87602),c=n(46485),u=n(9841),d=n(58811),f=n(26680),p=n(16630),h=n(41637),m=n(82944),g=n(78242),v=["viewBox"],y=["viewBox"],b=["ticks"];function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(){return(w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function E(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(k,e);var t,n,o,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=j(k);return e=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function k(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,k),(t=i.call(this,e)).state={fontSize:"",letterSpacing:""},t}return n=[{key:"shouldComponentUpdate",value:function(e,t){var n=e.viewBox,r=E(e,v),o=this.props,a=o.viewBox,i=E(o,y);return!(0,c.w)(n,a)||!(0,c.w)(r,i)||!(0,c.w)(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,n,r,o,a,i,l=this.props,s=l.x,c=l.y,u=l.width,d=l.height,f=l.orientation,h=l.tickSize,m=l.mirror,g=l.tickMargin,v=m?-1:1,y=e.tickSize||h,b=(0,p.hj)(e.tickCoord)?e.tickCoord:e.coordinate;switch(f){case"top":t=n=e.coordinate,i=(r=(o=c+ +!m*d)-v*y)-v*g,a=b;break;case"left":r=o=e.coordinate,a=(t=(n=s+ +!m*u)-v*y)-v*g,i=b;break;case"right":r=o=e.coordinate,a=(t=(n=s+ +m*u)+v*y)+v*g,i=b;break;default:t=n=e.coordinate,i=(r=(o=c+ +m*d)+v*y)+v*g,a=b}return{line:{x1:t,y1:r,x2:n,y2:o},tick:{x:a,y:i}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,n=t.orientation,r=t.mirror;switch(n){case"left":e=r?"start":"end";break;case"right":e=r?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,n=e.mirror,r="end";switch(t){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.orientation,c=e.mirror,u=e.axisLine,d=S(S(S({},(0,m.L6)(this.props,!1)),(0,m.L6)(u,!1)),{},{fill:"none"});if("top"===i||"bottom"===i){var f=+("top"===i&&!c||"bottom"===i&&c);d=S(S({},d),{},{x1:t,y1:n+f*a,x2:t+o,y2:n+f*a})}else{var p=+("left"===i&&!c||"right"===i&&c);d=S(S({},d),{},{x1:t+p*o,y1:n,x2:t+p*o,y2:n+a})}return r.createElement("line",w({},d,{className:(0,s.Z)("recharts-cartesian-axis-line",l()(u,"className"))}))}},{key:"renderTicks",value:function(e,t,n){var o=this,i=this.props,c=i.tickLine,d=i.stroke,f=i.tick,p=i.tickFormatter,v=i.unit,y=(0,g.f)(S(S({},this.props),{},{ticks:e}),t,n),b=this.getTickTextAnchor(),x=this.getTickVerticalAnchor(),E=(0,m.L6)(this.props,!1),O=(0,m.L6)(f,!1),C=S(S({},E),{},{fill:"none"},(0,m.L6)(c,!1)),j=y.map(function(e,t){var n=o.getTickLineCoord(e),i=n.line,m=n.tick,g=S(S(S(S({textAnchor:b,verticalAnchor:x},E),{},{stroke:"none",fill:d},O),m),{},{index:t,payload:e,visibleTicksCount:y.length,tickFormatter:p});return r.createElement(u.m,w({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},(0,h.bw)(o.props,e,t)),c&&r.createElement("line",w({},C,i,{className:(0,s.Z)("recharts-cartesian-axis-tick-line",l()(c,"className"))})),f&&k.renderTickItem(f,g,"".concat(a()(p)?p(e.value,t):e.value).concat(v||"")))});return r.createElement("g",{className:"recharts-cartesian-axis-ticks"},j)}},{key:"render",value:function(){var e=this,t=this.props,n=t.axisLine,o=t.width,i=t.height,l=t.ticksGenerator,c=t.className;if(t.hide)return null;var d=this.props,p=d.ticks,h=E(d,b),m=p;return(a()(l)&&(m=l(p&&p.length>0?this.props:h)),o<=0||i<=0||!m||!m.length)?null:r.createElement(u.m,{className:(0,s.Z)("recharts-cartesian-axis",c),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),f._.renderCallByParent(this.props))}}],o=[{key:"renderTickItem",value:function(e,t,n){return r.isValidElement(e)?r.cloneElement(e,t):a()(e)?e(t):r.createElement(d.x,w({},t,{className:"recharts-cartesian-axis-tick-value"}),n)}}],n&&O(k.prototype,n),o&&O(k,o),Object.defineProperty(k,"prototype",{writable:!1}),k}(r.Component);_(N,"displayName","CartesianAxis"),_(N,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"})},56940:function(e,t,n){"use strict";n.d(t,{q:function(){return P}});var r=n(2265),o=n(86757),a=n.n(o),i=n(1175),l=n(16630),s=n(82944),c=n(85355),u=n(78242),d=n(80285),f=n(25739),p=["x1","y1","x2","y2","key"],h=["offset"];function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var x=function(e){var t=e.fill;if(!t||"none"===t)return null;var n=e.fillOpacity,o=e.x,a=e.y,i=e.width,l=e.height;return r.createElement("rect",{x:o,y:a,width:i,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function w(e,t){var n;if(r.isValidElement(e))n=r.cloneElement(e,t);else if(a()(e))n=e(t);else{var o=t.x1,i=t.y1,l=t.x2,c=t.y2,u=t.key,d=b(t,p),f=(0,s.L6)(d,!1),m=(f.offset,b(f,h));n=r.createElement("line",y({},m,{x1:o,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function k(e){var t=e.x,n=e.width,o=e.horizontal,a=void 0===o||o,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(r,o){return w(a,v(v({},e),{},{x1:t,y1:r,x2:t+n,y2:r,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function S(e){var t=e.y,n=e.height,o=e.vertical,a=void 0===o||o,i=e.verticalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(r,o){return w(a,v(v({},e),{},{x1:r,y1:t,x2:r,y2:t+n,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function E(e){var t=e.horizontalFill,n=e.fillOpacity,o=e.x,a=e.y,i=e.width,l=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(void 0===c||c)||!t||!t.length)return null;var u=s.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,s){var c=u[s+1]?u[s+1]-e:a+l-e;if(c<=0)return null;var d=s%t.length;return r.createElement("rect",{key:"react-".concat(s),y:e,x:o,height:c,width:i,stroke:"none",fill:t[d],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function O(e){var t=e.vertical,n=e.verticalFill,o=e.fillOpacity,a=e.x,i=e.y,l=e.width,s=e.height,c=e.verticalPoints;if(!(void 0===t||t)||!n||!n.length)return null;var u=c.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,t){var c=u[t+1]?u[t+1]-e:a+l-e;if(c<=0)return null;var d=t%n.length;return r.createElement("rect",{key:"react-".concat(t),x:e,y:i,width:c,height:s,stroke:"none",fill:n[d],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var C=function(e,t){var n=e.xAxis,r=e.width,o=e.height,a=e.offset;return(0,c.Rf)((0,u.f)(v(v(v({},d.O.defaultProps),n),{},{ticks:(0,c.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),a.left,a.left+a.width,t)},j=function(e,t){var n=e.yAxis,r=e.width,o=e.height,a=e.offset;return(0,c.Rf)((0,u.f)(v(v(v({},d.O.defaultProps),n),{},{ticks:(0,c.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),a.top,a.top+a.height,t)},_={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function P(e){var t,n,o,s,c,u,d=(0,f.zn)(),p=(0,f.Mw)(),h=(0,f.qD)(),g=v(v({},e),{},{stroke:null!==(t=e.stroke)&&void 0!==t?t:_.stroke,fill:null!==(n=e.fill)&&void 0!==n?n:_.fill,horizontal:null!==(o=e.horizontal)&&void 0!==o?o:_.horizontal,horizontalFill:null!==(s=e.horizontalFill)&&void 0!==s?s:_.horizontalFill,vertical:null!==(c=e.vertical)&&void 0!==c?c:_.vertical,verticalFill:null!==(u=e.verticalFill)&&void 0!==u?u:_.verticalFill}),b=g.x,w=g.y,P=g.width,N=g.height,T=g.xAxis,A=g.yAxis,M=g.syncWithTicks,I=g.horizontalValues,R=g.verticalValues;if(!(0,l.hj)(P)||P<=0||!(0,l.hj)(N)||N<=0||!(0,l.hj)(b)||b!==+b||!(0,l.hj)(w)||w!==+w)return null;var D=g.verticalCoordinatesGenerator||C,L=g.horizontalCoordinatesGenerator||j,Z=g.horizontalPoints,z=g.verticalPoints;if((!Z||!Z.length)&&a()(L)){var B=I&&I.length,F=L({yAxis:A?v(v({},A),{},{ticks:B?I:A.ticks}):void 0,width:d,height:p,offset:h},!!B||M);(0,i.Z)(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(m(F),"]")),Array.isArray(F)&&(Z=F)}if((!z||!z.length)&&a()(D)){var H=R&&R.length,q=D({xAxis:T?v(v({},T),{},{ticks:H?R:T.ticks}):void 0,width:d,height:p,offset:h},!!H||M);(0,i.Z)(Array.isArray(q),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(m(q),"]")),Array.isArray(q)&&(z=q)}return r.createElement("g",{className:"recharts-cartesian-grid"},r.createElement(x,{fill:g.fill,fillOpacity:g.fillOpacity,x:g.x,y:g.y,width:g.width,height:g.height}),r.createElement(k,y({},g,{offset:h,horizontalPoints:Z})),r.createElement(S,y({},g,{offset:h,verticalPoints:z})),r.createElement(E,y({},g,{horizontalPoints:Z})),r.createElement(O,y({},g,{verticalPoints:z})))}P.displayName="CartesianGrid"},13137:function(e,t,n){"use strict";n.d(t,{W:function(){return u}});var r=n(2265),o=n(69398),a=n(9841),i=n(82944),l=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e){var t=e.offset,n=e.layout,u=e.width,d=e.dataKey,f=e.data,p=e.dataPointFormatter,h=e.xAxis,m=e.yAxis,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,l),v=(0,i.L6)(g,!1);"x"===e.direction&&"number"!==h.type&&(0,o.Z)(!1);var y=f.map(function(e){var o,i,l=p(e,d),f=l.x,g=l.y,y=l.value,b=l.errorVal;if(!b)return null;var x=[];if(Array.isArray(b)){var w=function(e){if(Array.isArray(e))return e}(b)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(b,2)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,2)}}(b,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=w[0],i=w[1]}else o=i=b;if("vertical"===n){var k=h.scale,S=g+t,E=S+u,O=S-u,C=k(y-o),j=k(y+i);x.push({x1:j,y1:E,x2:j,y2:O}),x.push({x1:C,y1:S,x2:j,y2:S}),x.push({x1:C,y1:E,x2:C,y2:O})}else if("horizontal"===n){var _=m.scale,P=f+t,N=P-u,T=P+u,A=_(y-o),M=_(y+i);x.push({x1:N,y1:M,x2:T,y2:M}),x.push({x1:P,y1:A,x2:P,y2:M}),x.push({x1:N,y1:A,x2:T,y2:A})}return r.createElement(a.m,s({className:"recharts-errorBar",key:"bar-".concat(x.map(function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))},v),x.map(function(e){return r.createElement("line",s({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))}))});return r.createElement(a.m,{className:"recharts-errorBars"},y)}u.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},u.displayName="ErrorBar"},54061:function(e,t,n){"use strict";n.d(t,{x:function(){return I}});var r=n(2265),o=n(59221),a=n(86757),i=n.n(a),l=n(77571),s=n.n(l),c=n(21652),u=n.n(c),d=n(87602),f=n(57165),p=n(81889),h=n(9841),m=n(58772),g=n(13137),v=n(16630),y=n(82944),b=n(34067),x=n(85355),w=["type","layout","connectNulls","ref"];function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(){return(S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return j(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,M(r.key),r)}}function P(e,t){return(P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function N(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t,n){return(t=M(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}var I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}(c,e);var t,n,a,l=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=T(c);return e=t?Reflect.construct(n,arguments,T(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return N(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return A(N(e=l.call.apply(l,[this].concat(n))),"state",{isAnimationFinished:!0,totalLength:0}),A(N(e),"generateSimpleStrokeDasharray",function(e,t){return"".concat(t,"px ").concat(e-t,"px")}),A(N(e),"getStrokeDasharray",function(t,n,r){var o=r.reduce(function(e,t){return e+t});if(!o)return e.generateSimpleStrokeDasharray(n,t);for(var a=t%o,i=n-t,l=[],s=0,u=0;s<r.length;u+=r[s],++s)if(u+r[s]>a){l=[].concat(C(r.slice(0,s)),[a-u]);break}var d=l.length%2==0?[0,i]:[i];return[].concat(C(c.repeat(r,Math.floor(t/o))),C(l),d).map(function(e){return"".concat(e,"px")}).join(", ")}),A(N(e),"id",(0,v.EL)("recharts-line-")),A(N(e),"pathRef",function(t){e.mainCurve=t}),A(N(e),"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),A(N(e),"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return n=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.points,a=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,y.NN)(s,g.W);if(!c)return null;var u=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:(0,x.F$)(e.payload,t)}};return r.createElement(h.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:o,xAxis:a,yAxis:i,layout:l,dataPointFormatter:u})}))}},{key:"renderDots",value:function(e,t,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.dot,i=o.points,l=o.dataKey,s=(0,y.L6)(this.props,!1),u=(0,y.L6)(a,!0),d=i.map(function(e,t){var n=O(O(O({key:"dot-".concat(t),r:3},s),u),{},{value:e.value,dataKey:l,cx:e.x,cy:e.y,index:t,payload:e.payload});return c.renderDotItem(a,n)}),f={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return r.createElement(h.m,S({className:"recharts-line-dots",key:"dots"},f),d)}},{key:"renderCurveStatically",value:function(e,t,n,o){var a=this.props,i=a.type,l=a.layout,s=a.connectNulls,c=(a.ref,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,w)),u=O(O(O({},(0,y.L6)(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},o),{},{type:i,layout:l,connectNulls:s});return r.createElement(f.H,S({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,a=this.props,i=a.points,l=a.strokeDasharray,s=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,p=a.animateNewValues,h=a.width,m=a.height,g=this.state,y=g.prevPoints,b=g.totalLength;return r.createElement(o.ZP,{begin:c,duration:u,isActive:s,easing:d,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o,a=r.t;if(y){var s=y.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(y[n]){var r=y[n],o=(0,v.k4)(r.x,e.x),i=(0,v.k4)(r.y,e.y);return O(O({},e),{},{x:o(a),y:i(a)})}if(p){var l=(0,v.k4)(2*h,e.x),c=(0,v.k4)(m/2,e.y);return O(O({},e),{},{x:l(a),y:c(a)})}return O(O({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var u=(0,v.k4)(0,b)(a);if(l){var d="".concat(l).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});o=n.getStrokeDasharray(u,b,d)}else o=n.generateSimpleStrokeDasharray(b,u);return n.renderCurveStatically(i,e,t,{strokeDasharray:o})})}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,o=n.isAnimationActive,a=this.state,i=a.prevPoints,l=a.totalLength;return o&&r&&r.length&&(!i&&l>0||!u()(i,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,o=t.dot,a=t.points,i=t.className,l=t.xAxis,c=t.yAxis,u=t.top,f=t.left,p=t.width,g=t.height,v=t.isAnimationActive,b=t.id;if(n||!a||!a.length)return null;var x=this.state.isAnimationFinished,w=1===a.length,k=(0,d.Z)("recharts-line",i),S=l&&l.allowDataOverflow,E=c&&c.allowDataOverflow,O=S||E,C=s()(b)?this.id:b,j=null!==(e=(0,y.L6)(o,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,y.$k)(o)?o:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return r.createElement(h.m,{className:k},S||E?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(C)},r.createElement("rect",{x:S?f:f-p/2,y:E?u:u-g/2,width:S?p:2*p,height:E?g:2*g})),!T&&r.createElement("clipPath",{id:"clipPath-dots-".concat(C)},r.createElement("rect",{x:f-A/2,y:u-A/2,width:p+A,height:g+A}))):null,!w&&this.renderCurve(O,C),this.renderErrorBar(O,C),(w||o)&&this.renderDots(O,T,C),(!v||x)&&m.e.renderCallByParent(this.props,a))}}],a=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!=0?[].concat(C(e),[0]):e,r=[],o=0;o<t;++o)r=[].concat(C(r),C(n));return r}},{key:"renderDotItem",value:function(e,t){var n;if(r.isValidElement(e))n=r.cloneElement(e,t);else if(i()(e))n=e(t);else{var o=(0,d.Z)("recharts-line-dot",e?e.className:"");n=r.createElement(p.o,S({},t,{className:o}))}return n}}],n&&_(c.prototype,n),a&&_(c,a),Object.defineProperty(c,"prototype",{writable:!1}),c}(r.PureComponent);A(I,"displayName","Line"),A(I,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!b.x.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),A(I,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,i=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout;return O({points:c.map(function(e,t){var c=(0,x.F$)(e,i);return"horizontal"===d?{x:(0,x.Hv)({axis:n,ticks:o,bandSize:l,entry:e,index:t}),y:s()(c)?null:r.scale(c),value:c,payload:e}:{x:s()(c)?null:n.scale(c),y:(0,x.Hv)({axis:r,ticks:a,bandSize:l,entry:e,index:t}),value:c,payload:e}}),layout:d},u)})},97059:function(e,t,n){"use strict";n.d(t,{K:function(){return c}});var r=n(2265),o=n(87602),a=n(25739),i=n(80285),l=n(85355);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=function(e){var t=e.xAxisId,n=(0,a.zn)(),c=(0,a.Mw)(),u=(0,a.bH)(t);return null==u?null:r.createElement(i.O,s({},u,{className:(0,o.Z)("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:n,height:c},ticksGenerator:function(e){return(0,l.uY)(e,!0)}}))};c.displayName="XAxis",c.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0}},62994:function(e,t,n){"use strict";n.d(t,{B:function(){return c}});var r=n(2265),o=n(87602),a=n(25739),i=n(80285),l=n(85355);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=function(e){var t=e.yAxisId,n=(0,a.zn)(),c=(0,a.Mw)(),u=(0,a.Ud)(t);return null==u?null:r.createElement(i.O,s({},u,{className:(0,o.Z)("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:n,height:c},ticksGenerator:function(e){return(0,l.uY)(e,!0)}}))};c.displayName="YAxis",c.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1}},78242:function(e,t,n){"use strict";n.d(t,{f:function(){return h}});var r=n(86757),o=n.n(r),a=n(16630),i=n(4094),l=n(34067),s=n(25311);function c(e,t,n){if(t<1)return[];if(1===t&&void 0===n)return e;for(var r=[],o=0;o<e.length;o+=t){if(void 0!==n&&!0!==n(e[o]))return;r.push(e[o])}return r}function u(e,t,n,r,o){if(e*t<e*r||e*t>e*o)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-o)<=0}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){var r,d,f,h,m,g=e.tick,v=e.ticks,y=e.viewBox,b=e.minTickGap,x=e.orientation,w=e.interval,k=e.tickFormatter,S=e.unit,E=e.angle;if(!v||!v.length||!g)return[];if((0,a.hj)(w)||l.x.isSsr)return c(v,("number"==typeof w&&(0,a.hj)(w)?w:0)+1);var O="top"===x||"bottom"===x?"width":"height",C=S&&"width"===O?(0,i.xE)(S,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=function(e,r){var a,l,c=o()(k)?k(e.value,r):e.value;return"width"===O?(l={width:(a=(0,i.xE)(c,{fontSize:t,letterSpacing:n})).width+C.width,height:a.height+C.height},(0,s.xE)(l,E)):(0,i.xE)(c,{fontSize:t,letterSpacing:n})[O]},_=v.length>=2?(0,a.uY)(v[1].coordinate-v[0].coordinate):1,P=(r="width"===O,d=y.x,f=y.y,h=y.width,m=y.height,1===_?{start:r?d:f,end:r?d+h:f+m}:{start:r?d+h:f+m,end:r?d:f});return"equidistantPreserveStart"===w?function(e,t,n,r,o){for(var a,i=(r||[]).slice(),l=t.start,s=t.end,d=0,f=1,p=l;f<=i.length;)if(a=function(){var t,a=null==r?void 0:r[d];if(void 0===a)return{v:c(r,f)};var i=d,h=function(){return void 0===t&&(t=n(a,i)),t},m=a.coordinate,g=0===d||u(e,m,h,p,s);g||(d=0,p=l,f+=1),g&&(p=m+e*(h()/2+o),d+=f)}())return a.v;return[]}(_,P,j,v,b):("preserveStart"===w||"preserveStartEnd"===w?function(e,t,n,r,o,a){var i=(r||[]).slice(),l=i.length,s=t.start,c=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-c);i[l-1]=d=p(p({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),u(e,d.tickCoord,function(){return f},s,c)&&(c=d.tickCoord-e*(f/2+o),i[l-1]=p(p({},d),{},{isShow:!0}))}for(var m=a?l-1:l,g=function(t){var r,a=i[t],l=function(){return void 0===r&&(r=n(a,t)),r};if(0===t){var d=e*(a.coordinate-e*l()/2-s);i[t]=a=p(p({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else i[t]=a=p(p({},a),{},{tickCoord:a.coordinate});u(e,a.tickCoord,l,s,c)&&(s=a.tickCoord+e*(l()/2+o),i[t]=p(p({},a),{},{isShow:!0}))},v=0;v<m;v++)g(v);return i}(_,P,j,v,b,"preserveStartEnd"===w):function(e,t,n,r,o){for(var a=(r||[]).slice(),i=a.length,l=t.start,s=t.end,c=function(t){var r,c=a[t],d=function(){return void 0===r&&(r=n(c,t)),r};if(t===i-1){var f=e*(c.coordinate+e*d()/2-s);a[t]=c=p(p({},c),{},{tickCoord:f>0?c.coordinate-f*e:c.coordinate})}else a[t]=c=p(p({},c),{},{tickCoord:c.coordinate});u(e,c.tickCoord,d,l,s)&&(s=c.tickCoord-e*(d()/2+o),a[t]=p(p({},c),{},{isShow:!0}))},d=i-1;d>=0;d--)c(d);return a}(_,P,j,v,b)).filter(function(e){return e.isShow})}},93765:function(e,t,n){"use strict";n.d(t,{z:function(){return tx}});var r=n(2265),o=n(77571),a=n.n(o),i=n(86757),l=n.n(i),s=n(99676),c=n.n(s),u=n(13735),d=n.n(u),f=n(34935),p=n.n(f),h=n(37065),m=n.n(h),g=n(84173),v=n.n(g),y=n(32242),b=n.n(y),x=n(87602),w=n(69398),k=n(48777),S=n(9841),E=n(8147),O=n(22190),C=n(81889),j=n(73649),_=n(82944),P=n(55284),N=n(58811),T=n(85355),A=n(16630);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t,n){var r;return(r=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===M(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var L=["Webkit","Moz","O","ms"],Z=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=L.reduce(function(e,r){return R(R({},e),{},D({},r+n,t))},{});return r[e]=t,r};function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(){return(B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach(function(t){$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V(r.key),r)}}function W(e,t){return(W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function U(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t,n){return(t=V(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e){var t=function(e,t){if("object"!==z(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==z(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===z(t)?t:String(t)}var X=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,o=e.x,a=e.width,i=e.travellerWidth;if(!t||!t.length)return{};var l=t.length,s=(0,P.x)().domain(c()(0,l)).range([o,o+a-i]),u=s.domain().map(function(e){return s(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:s(n),endX:s(r),scale:s,scaleValues:u}},G=function(e){return e.changedTouches&&!!e.changedTouches.length},Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(i,e);var t,n,o,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=K(i);return e=t?Reflect.construct(n,arguments,K(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===z(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return U(e)}(this,e)});function i(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),$(U(t=a.call(this,e)),"handleDrag",function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)}),$(U(t),"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])}),$(U(t),"handleDragEnd",function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=t.props,n=e.endIndex,r=e.onDragEnd,o=e.startIndex;null==r||r({endIndex:n,startIndex:o})}),t.detachDragEndListener()}),$(U(t),"handleLeaveWrapper",function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))}),$(U(t),"handleEnterSlideOrTraveller",function(){t.setState({isTextActive:!0})}),$(U(t),"handleLeaveSlideOrTraveller",function(){t.setState({isTextActive:!1})}),$(U(t),"handleSlideDragStart",function(e){var n=G(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:n.pageX}),t.attachDragEndListener()}),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(U(t),"startX"),endX:t.handleTravellerDragStart.bind(U(t),"endX")},t.state={},t}return n=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,n=e.endX,r=this.state.scaleValues,o=this.props,a=o.gap,l=o.data.length-1,s=i.getIndexInRange(r,Math.min(t,n)),c=i.getIndexInRange(r,Math.max(t,n));return{startIndex:s-s%a,endIndex:c===l?l:c-c%a}}},{key:"getTextOfTick",value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,o=t.dataKey,a=(0,T.F$)(n[e],o,e);return l()(r)?r(a,e):a}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,o=t.endX,a=this.props,i=a.x,l=a.width,s=a.travellerWidth,c=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,i+l-s-o,i+l-s-r):f<0&&(f=Math.max(f,i-r,i-o));var p=this.getIndex({startX:r+f,endX:o+f});(p.startIndex!==c||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:o+f,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var n=G(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,n=this.state,r=n.brushMoveStartX,o=n.movingTravellerId,a=n.endX,i=n.startX,l=this.state[o],s=this.props,c=s.x,u=s.width,d=s.travellerWidth,f=s.onChange,p=s.gap,h=s.data,m={startX:this.state.startX,endX:this.state.endX},g=e.pageX-r;g>0?g=Math.min(g,c+u-d-l):g<0&&(g=Math.max(g,c-l)),m[o]=l+g;var v=this.getIndex(m),y=v.startIndex,b=v.endIndex,x=function(){var e=h.length-1;return"startX"===o&&(a>i?y%p==0:b%p==0)||a<i&&b===e||"endX"===o&&(a>i?b%p==0:y%p==0)||a>i&&b===e};this.setState(($(t={},o,l+g),$(t,"brushMoveStartX",e.pageX),t),function(){f&&x()&&f(v)})}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var n=this,r=this.state,o=r.scaleValues,a=r.startX,i=r.endX,l=this.state[t],s=o.indexOf(l);if(-1!==s){var c=s+e;if(-1!==c&&!(c>=o.length)){var u=o[c];"startX"===t&&u>=i||"endX"===t&&u<=a||this.setState($({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.fill,l=e.stroke;return r.createElement("rect",{stroke:l,fill:i,x:t,y:n,width:o,height:a})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.data,l=e.children,s=e.padding,c=r.Children.only(l);return c?r.cloneElement(c,{x:t,y:n,width:o,height:a,margin:s,compact:!0,data:i}):null}},{key:"renderTravellerLayer",value:function(e,t){var n=this,o=this.props,a=o.y,l=o.travellerWidth,s=o.height,c=o.traveller,u=o.ariaLabel,d=o.data,f=o.startIndex,p=o.endIndex,h=Math.max(e,this.props.x),m=H(H({},(0,_.L6)(this.props,!1)),{},{x:h,y:a,width:l,height:s}),g=u||"Min value: ".concat(d[f].name,", Max value: ").concat(d[p].name);return r.createElement(S.m,{tabIndex:0,role:"slider","aria-label":g,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),n.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){n.setState({isTravellerFocused:!0})},onBlur:function(){n.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},i.renderTraveller(c,m))}},{key:"renderSlide",value:function(e,t){var n=this.props,o=n.y,a=n.height,i=n.stroke,l=n.travellerWidth;return r.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:i,fillOpacity:.2,x:Math.min(e,t)+l,y:o,width:Math.max(Math.abs(t-e)-l,0),height:a})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,o=e.y,a=e.height,i=e.travellerWidth,l=e.stroke,s=this.state,c=s.startX,u=s.endX,d={pointerEvents:"none",fill:l};return r.createElement(S.m,{className:"recharts-brush-texts"},r.createElement(N.x,B({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,u)-5,y:o+a/2},d),this.getTextOfTick(t)),r.createElement(N.x,B({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,u)+i+5,y:o+a/2},d),this.getTextOfTick(n)))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.className,o=e.children,a=e.x,i=e.y,l=e.width,s=e.height,c=e.alwaysShowText,u=this.state,d=u.startX,f=u.endX,p=u.isTextActive,h=u.isSlideMoving,m=u.isTravellerMoving,g=u.isTravellerFocused;if(!t||!t.length||!(0,A.hj)(a)||!(0,A.hj)(i)||!(0,A.hj)(l)||!(0,A.hj)(s)||l<=0||s<=0)return null;var v=(0,x.Z)("recharts-brush",n),y=1===r.Children.count(o),b=Z("userSelect","none");return r.createElement(S.m,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),y&&this.renderPanorama(),this.renderSlide(d,f),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(f,"endX"),(p||h||m||g||c)&&this.renderText())}}],o=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,n=e.y,o=e.width,a=e.height,i=e.stroke,l=Math.floor(n+a/2)-1;return r.createElement(r.Fragment,null,r.createElement("rect",{x:t,y:n,width:o,height:a,fill:i,stroke:"none"}),r.createElement("line",{x1:t+1,y1:l,x2:t+o-1,y2:l,fill:"none",stroke:"#fff"}),r.createElement("line",{x1:t+1,y1:l+2,x2:t+o-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):i.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var n=e.data,r=e.width,o=e.x,a=e.travellerWidth,i=e.updateId,l=e.startIndex,s=e.endIndex;if(n!==t.prevData||i!==t.prevUpdateId)return H({prevData:n,prevTravellerWidth:a,prevUpdateId:i,prevX:o,prevWidth:r},n&&n.length?X({data:n,width:r,x:o,travellerWidth:a,startIndex:l,endIndex:s}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||o!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([o,o+r-a]);var c=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:i,prevX:o,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:c}}return null}},{key:"getIndexInRange",value:function(e,t){for(var n=e.length,r=0,o=n-1;o-r>1;){var a=Math.floor((r+o)/2);e[a]>t?o=a:r=a}return t>=e[o]?o:r}}],n&&q(i.prototype,n),o&&q(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}(r.PureComponent);$(Y,"displayName","Brush"),$(Y,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Q=n(4094),J=n(38569),ee=n(26680),et=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r="extendDomain"),r===t},en=n(25311),er=n(1175);function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ea(){return(ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eo(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eo(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var es=function(e){var t=e.x,n=e.y,r=e.xAxis,o=e.yAxis,a=(0,en.Ky)({x:r.scale,y:o.scale}),i=a.apply({x:t,y:n},{bandAware:!0});return et(e,"discard")&&!a.isInRange(i)?null:i};function ec(e){var t=e.x,n=e.y,o=e.r,a=e.alwaysShow,i=e.clipPathId,l=(0,A.P2)(t),s=(0,A.P2)(n);if((0,er.Z)(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!l||!s)return null;var c=es(e);if(!c)return null;var u=c.x,d=c.y,f=e.shape,p=e.className,h=el(el({clipPath:et(e,"hidden")?"url(#".concat(i,")"):void 0},(0,_.L6)(e,!0)),{},{cx:u,cy:d});return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-dot",p)},ec.renderDot(f,h),ee._.renderCallByParent(e,{x:u-o,y:d-o,width:2*o,height:2*o}))}ec.displayName="ReferenceDot",ec.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1},ec.renderDot=function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):r.createElement(C.o,ea({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))};var eu=n(33645),ed=n.n(eu),ef=n(25739);function ep(e){return(ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function em(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eh(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ep(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ep(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ev(){return(ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ey=function(e,t,n,r,o,a,i,l,s){var c=o.x,u=o.y,d=o.width,f=o.height;if(n){var p=s.y,h=e.y.apply(p,{position:a});if(et(s,"discard")&&!e.y.isInRange(h))return null;var m=[{x:c+d,y:h},{x:c,y:h}];return"left"===l?m.reverse():m}if(t){var g=s.x,v=e.x.apply(g,{position:a});if(et(s,"discard")&&!e.x.isInRange(v))return null;var y=[{x:v,y:u+f},{x:v,y:u}];return"top"===i?y.reverse():y}if(r){var b=s.segment.map(function(t){return e.apply(t,{position:a})});return et(s,"discard")&&ed()(b,function(t){return!e.isInRange(t)})?null:b}return null};function eb(e){var t,n,o=e.x,a=e.y,i=e.segment,s=e.xAxisId,c=e.yAxisId,u=e.shape,d=e.className,f=e.alwaysShow,p=(0,ef.sp)(),h=(0,ef.bH)(s),m=(0,ef.Ud)(c),g=(0,ef.d2)();if(!p||!g)return null;(0,er.Z)(void 0===f,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=ey((0,en.Ky)({x:h.scale,y:m.scale}),(0,A.P2)(o),(0,A.P2)(a),i&&2===i.length,g,e.position,h.orientation,m.orientation,e);if(!v)return null;var y=function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(v,2)||function(e,t){if(e){if("string"==typeof e)return eg(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,2)}}(v,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],w=b.x,k=b.y,E=y[1],O=E.x,C=E.y,j=em(em({clipPath:et(e,"hidden")?"url(#".concat(p,")"):void 0},(0,_.L6)(e,!0)),{},{x1:w,y1:k,x2:O,y2:C});return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-line",d)},(t=u,n=j,r.isValidElement(t)?r.cloneElement(t,n):l()(t)?t(n):r.createElement("line",ev({},n,{className:"recharts-reference-line-line"}))),ee._.renderCallByParent(e,(0,en._b)({x1:w,y1:k,x2:O,y2:C})))}function ex(e){return(ex="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(){return(ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==ex(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ex(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ex(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}eb.displayName="ReferenceLine",eb.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"};var eE=function(e,t,n,r,o){var a=o.x1,i=o.x2,l=o.y1,s=o.y2,c=o.xAxis,u=o.yAxis;if(!c||!u)return null;var d=(0,en.Ky)({x:c.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(l,{position:"start"}):d.y.rangeMin},p={x:t?d.x.apply(i,{position:"end"}):d.x.rangeMax,y:r?d.y.apply(s,{position:"end"}):d.y.rangeMax};return!et(o,"discard")||d.isInRange(f)&&d.isInRange(p)?(0,en.O1)(f,p):null};function eO(e){var t=e.x1,n=e.x2,o=e.y1,a=e.y2,i=e.className,l=e.alwaysShow,s=e.clipPathId;(0,er.Z)(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var c=(0,A.P2)(t),u=(0,A.P2)(n),d=(0,A.P2)(o),f=(0,A.P2)(a),p=e.shape;if(!c&&!u&&!d&&!f&&!p)return null;var h=eE(c,u,d,f,e);if(!h&&!p)return null;var m=et(e,"hidden")?"url(#".concat(s,")"):void 0;return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-area",i)},eO.renderRect(p,eS(eS({clipPath:m},(0,_.L6)(e,!0)),h)),ee._.renderCallByParent(e,h))}function eC(e){return function(e){if(Array.isArray(e))return ej(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ej(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ej(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}eO.displayName="ReferenceArea",eO.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1},eO.renderRect=function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):r.createElement(j.A,ew({},t,{className:"recharts-reference-area-rect"}))};var e_=function(e,t,n,r,o){var a=(0,_.NN)(e,eb),i=(0,_.NN)(e,ec),l=[].concat(eC(a),eC(i)),s=(0,_.NN)(e,eO),c="".concat(r,"Id"),u=r[0],d=t;if(l.length&&(d=l.reduce(function(e,t){if(t.props[c]===n&&et(t.props,"extendDomain")&&(0,A.hj)(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),s.length){var f="".concat(u,"1"),p="".concat(u,"2");d=s.reduce(function(e,t){if(t.props[c]===n&&et(t.props,"extendDomain")&&(0,A.hj)(t.props[f])&&(0,A.hj)(t.props[p])){var r=t.props[f],o=t.props[p];return[Math.min(e[0],r,o),Math.max(e[1],r,o)]}return e},d)}return o&&o.length&&(d=o.reduce(function(e,t){return(0,A.hj)(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},eP=n(39206),eN=n(46485),eT=n(77625),eA=new(n.n(eT)()),eM="recharts.syncMouseEvents",eI=n(41637);function eR(e){return(eR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eD(e,t,n){return(t=eL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eL(e){var t=function(e,t){if("object"!==eR(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eR(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eR(t)?t:String(t)}var eZ=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),eD(this,"activeIndex",0),eD(this,"coordinateList",[]),eD(this,"layout","horizontal")}return e=[{key:"setDetails",value:function(e){var t,n=e.coordinateList,r=void 0===n?null:n,o=e.container,a=void 0===o?null:o,i=e.layout,l=void 0===i?null:i,s=e.offset,c=void 0===s?null:s,u=e.mouseHandlerCallback,d=void 0===u?null:u;this.coordinateList=null!==(t=null!=r?r:this.coordinateList)&&void 0!==t?t:[],this.container=null!=a?a:this.container,this.layout=null!=l?l:this.layout,this.offset=null!=c?c:this.offset,this.mouseHandlerCallback=null!=d?d:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"setIndex",value:function(e){this.activeIndex=e}},{key:"spoofMouse",value:function(){if("horizontal"===this.layout&&0!==this.coordinateList.length){var e,t,n=this.container.getBoundingClientRect(),r=n.x,o=n.y,a=n.height,i=this.coordinateList[this.activeIndex].coordinate,l=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,s=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,c=o+this.offset.top+a/2+s;this.mouseHandlerCallback({pageX:r+i+l,pageY:c})}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eL(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),ez=n(11638),eB=n(57165);function eF(e){return(eF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eH=["x","y","top","left","width","height","className"];function eq(){return(eq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var eU=function(e){var t=e.x,n=void 0===t?0:t,o=e.y,a=void 0===o?0:o,i=e.top,l=void 0===i?0:i,s=e.left,c=void 0===s?0:s,u=e.width,d=void 0===u?0:u,f=e.height,p=void 0===f?0:f,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eW(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eF(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eF(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eF(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({x:n,y:a,top:l,left:c,width:d,height:p},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eH));return(0,A.hj)(n)&&(0,A.hj)(a)&&(0,A.hj)(d)&&(0,A.hj)(p)&&(0,A.hj)(l)&&(0,A.hj)(c)?r.createElement("path",eq({},(0,_.L6)(m,!0),{className:(0,x.Z)("recharts-cross",h),d:"M".concat(n,",").concat(l,"v").concat(p,"M").concat(c,",").concat(a,"h").concat(d)})):null};function eK(e){var t=e.cx,n=e.cy,r=e.radius,o=e.startAngle,a=e.endAngle;return{points:[(0,eP.op)(t,n,r,o),(0,eP.op)(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:o,endAngle:a}}var e$=n(60474);function eV(e){return(eV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eX(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eV(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eV(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eV(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eY(e){var t,n,o=e.element,a=e.tooltipEventType,i=e.isActive,l=e.activeCoordinate,s=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,p=e.chartName;if(!o||!o.props.cursor||!i||!l||"ScatterChart"!==p&&"axis"!==a)return null;var h=eB.H;if("ScatterChart"===p)n=l,h=eU;else if("BarChart"===p)t=d/2,n={stroke:"none",fill:"#ccc",x:"horizontal"===f?l.x-t:c.left+.5,y:"horizontal"===f?c.top+.5:l.y-t,width:"horizontal"===f?d:c.width-1,height:"horizontal"===f?c.height-1:d},h=j.A;else if("radial"===f){var m=eK(l),g=m.cx,v=m.cy,y=m.radius;n={cx:g,cy:v,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:y,outerRadius:y},h=e$.L}else n={points:function(e,t,n){var r,o,a,i;if("horizontal"===e)a=r=t.x,o=n.top,i=n.top+n.height;else if("vertical"===e)i=o=t.y,r=n.left,a=n.left+n.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return eK(t);var l=t.cx,s=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.angle,f=(0,eP.op)(l,s,c,d),p=(0,eP.op)(l,s,u,d);r=f.x,o=f.y,a=p.x,i=p.y}return[{x:r,y:o},{x:a,y:i}]}(f,l,c)},h=eB.H;var b=eG(eG(eG(eG({stroke:"#ccc",pointerEvents:"none"},c),n),(0,_.L6)(o.props.cursor,!1)),{},{payload:s,payloadIndex:u,className:"recharts-tooltip-cursor"});return(0,r.isValidElement)(o.props.cursor)?(0,r.cloneElement)(o.props.cursor,b):(0,r.createElement)(h,b)}var eQ=["item"],eJ=["children","className","width","height","style","compact","title","desc"];function e0(e){return(e0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e1(){return(e1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function e2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||e7(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e6(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function e4(e,t){return(e4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function e3(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e5(e){return(e5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e8(e){return function(e){if(Array.isArray(e))return e9(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||e7(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e7(e,t){if(e){if("string"==typeof e)return e9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e9(e,t)}}function e9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){tn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tn(e,t,n){return(t=tr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(e){var t=function(e,t){if("object"!==e0(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==e0(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===e0(t)?t:String(t)}var to={xAxis:["bottom","top"],yAxis:["left","right"]},ta={width:"100%",height:"100%"},ti={x:0,y:0};function tl(e){return e}var ts=function(e,t,n,r){var o=t.find(function(e){return e&&e.index===n});if(o){if("horizontal"===e)return{x:o.coordinate,y:r.y};if("vertical"===e)return{x:r.x,y:o.coordinate};if("centric"===e){var a=o.coordinate,i=r.radius;return tt(tt(tt({},r),(0,eP.op)(r.cx,r.cy,i,a)),{},{angle:a,radius:i})}var l=o.coordinate,s=r.angle;return tt(tt(tt({},r),(0,eP.op)(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}return ti},tc=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,o=t.dataEndIndex,a=(null!=n?n:[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(e8(e),e8(n)):e},[]);return a.length>0?a:e&&e.length&&(0,A.hj)(r)&&(0,A.hj)(o)?e.slice(r,o+1):[]};function tu(e){return"number"===e?[0,"auto"]:void 0}var td=function(e,t,n,r){var o=e.graphicalItems,a=e.tooltipAxis,i=tc(t,e);return n<0||!o||!o.length||n>=i.length?null:o.reduce(function(o,l){var s,c,u=null!==(s=l.props.data)&&void 0!==s?s:t;if(u&&e.dataStartIndex+e.dataEndIndex!==0&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),a.dataKey&&!a.allowDuplicatedCategory){var d=void 0===u?i:u;c=(0,A.Ap)(d,a.dataKey,r)}else c=u&&u[n]||i[n];return c?[].concat(e8(o),[(0,T.Qo)(l,c)]):o},[])},tf=function(e,t,n,r){var o=r||{x:e.chartX,y:e.chartY},a="horizontal"===n?o.x:"vertical"===n?o.y:"centric"===n?o.angle:o.radius,i=e.orderedTooltipTicks,l=e.tooltipAxis,s=e.tooltipTicks,c=(0,T.VO)(a,i,s,l);if(c>=0&&s){var u=s[c]&&s[c].value,d=td(e,t,c,u),f=ts(n,i,c,o);return{activeTooltipIndex:c,activeLabel:u,activePayload:d,activeCoordinate:f}}return null},tp=function(e,t){var n=t.axes,r=t.graphicalItems,o=t.axisType,i=t.axisIdKey,l=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,d=e.layout,f=e.children,p=e.stackOffset,h=(0,T.NA)(d,o);return n.reduce(function(t,n){var m=n.props,g=m.type,v=m.dataKey,y=m.allowDataOverflow,b=m.allowDuplicatedCategory,x=m.scale,w=m.ticks,k=m.includeHidden,S=n.props[i];if(t[S])return t;var E=tc(e.data,{graphicalItems:r.filter(function(e){return e.props[i]===S}),dataStartIndex:s,dataEndIndex:u}),O=E.length;(function(e,t,n){if("number"===n&&!0===t&&Array.isArray(e)){var r=null==e?void 0:e[0],o=null==e?void 0:e[1];if(r&&o&&(0,A.hj)(r)&&(0,A.hj)(o))return!0}return!1})(n.props.domain,y,g)&&(_=(0,T.LG)(n.props.domain,null,y),h&&("number"===g||"auto"!==x)&&(N=(0,T.gF)(E,v,"category")));var C=tu(g);if(!_||0===_.length){var j,_,P,N,M,I=null!==(M=n.props.domain)&&void 0!==M?M:C;if(v){if(_=(0,T.gF)(E,v,g),"category"===g&&h){var R=(0,A.bv)(_);b&&R?(P=_,_=c()(0,O)):b||(_=(0,T.ko)(I,_,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(e8(e),[t])},[]))}else if("category"===g)_=b?_.filter(function(e){return""!==e&&!a()(e)}):(0,T.ko)(I,_,n).reduce(function(e,t){return e.indexOf(t)>=0||""===t||a()(t)?e:[].concat(e8(e),[t])},[]);else if("number"===g){var D=(0,T.ZI)(E,r.filter(function(e){return e.props[i]===S&&(k||!e.props.hide)}),v,o,d);D&&(_=D)}h&&("number"===g||"auto"!==x)&&(N=(0,T.gF)(E,v,"category"))}else _=h?c()(0,O):l&&l[S]&&l[S].hasStack&&"number"===g?"expand"===p?[0,1]:(0,T.EB)(l[S].stackGroups,s,u):(0,T.s6)(E,r.filter(function(e){return e.props[i]===S&&(k||!e.props.hide)}),g,d,!0);"number"===g?(_=e_(f,_,S,o,w),I&&(_=(0,T.LG)(I,_,y))):"category"===g&&I&&_.every(function(e){return I.indexOf(e)>=0})&&(_=I)}return tt(tt({},t),{},tn({},S,tt(tt({},n.props),{},{axisType:o,domain:_,categoricalDomain:N,duplicateDomain:P,originalDomain:null!==(j=n.props.domain)&&void 0!==j?j:C,isCategorical:h,layout:d})))},{})},th=function(e,t){var n=t.graphicalItems,r=t.Axis,o=t.axisType,a=t.axisIdKey,i=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,u=e.layout,f=e.children,p=tc(e.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:s}),h=p.length,m=(0,T.NA)(u,o),g=-1;return n.reduce(function(e,t){var v,y=t.props[a],b=tu("number");return e[y]?e:(g++,v=m?c()(0,h):i&&i[y]&&i[y].hasStack?e_(f,v=(0,T.EB)(i[y].stackGroups,l,s),y,o):e_(f,v=(0,T.LG)(b,(0,T.s6)(p,n.filter(function(e){return e.props[a]===y&&!e.props.hide}),"number",u),r.defaultProps.allowDataOverflow),y,o),tt(tt({},e),{},tn({},y,tt(tt({axisType:o},r.defaultProps),{},{hide:!0,orientation:d()(to,"".concat(o,".").concat(g%2),null),domain:v,originalDomain:b,isCategorical:m,layout:u}))))},{})},tm=function(e,t){var n=t.axisType,r=void 0===n?"xAxis":n,o=t.AxisComp,a=t.graphicalItems,i=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,c=e.children,u="".concat(r,"Id"),d=(0,_.NN)(c,o),f={};return d&&d.length?f=tp(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:l,dataEndIndex:s}):a&&a.length&&(f=th(e,{Axis:o,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:l,dataEndIndex:s})),f},tg=function(e){var t=(0,A.Kt)(e),n=(0,T.uY)(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:p()(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:(0,T.zT)(t,n)}},tv=function(e){var t=e.children,n=e.defaultShowTooltip,r=(0,_.sP)(t,Y),o=0,a=0;return e.data&&0!==e.data.length&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(o=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},ty=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},tb=function(e,t){var n=e.props,r=e.graphicalItems,o=e.xAxisMap,a=void 0===o?{}:o,i=e.yAxisMap,l=void 0===i?{}:i,s=n.width,c=n.height,u=n.children,f=n.margin||{},p=(0,_.sP)(u,Y),h=(0,_.sP)(u,O.D),m=Object.keys(l).reduce(function(e,t){var n=l[t],r=n.orientation;return n.mirror||n.hide?e:tt(tt({},e),{},tn({},r,e[r]+n.width))},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return n.mirror||n.hide?e:tt(tt({},e),{},tn({},r,d()(e,"".concat(r))+n.height))},{top:f.top||0,bottom:f.bottom||0}),v=tt(tt({},g),m),y=v.bottom;p&&(v.bottom+=p.props.height||Y.defaultProps.height),h&&t&&(v=(0,T.By)(v,r,n,t));var b=s-v.left-v.right,x=c-v.top-v.bottom;return tt(tt({brushBottom:y},v),{},{width:Math.max(b,0),height:Math.max(x,0)})},tx=function(e){var t,n=e.chartName,o=e.GraphicalChild,i=e.defaultTooltipEventType,s=void 0===i?"axis":i,c=e.validateTooltipEventTypes,u=void 0===c?["axis"]:c,f=e.axisComponents,p=e.legendContent,h=e.formatAxisMap,g=e.defaultProps,y=function(e,t){var n=t.graphicalItems,r=t.stackGroups,o=t.offset,i=t.updateId,l=t.dataStartIndex,s=t.dataEndIndex,c=e.barSize,u=e.layout,d=e.barGap,p=e.barCategoryGap,h=e.maxBarSize,m=ty(u),g=m.numericAxisName,v=m.cateAxisName,y=!!n&&!!n.length&&n.some(function(e){var t=(0,_.Gf)(e&&e.type);return t&&t.indexOf("Bar")>=0})&&(0,T.pt)({barSize:c,stackGroups:r}),b=[];return n.forEach(function(n,c){var m,x=tc(e.data,{graphicalItems:[n],dataStartIndex:l,dataEndIndex:s}),k=n.props,S=k.dataKey,E=k.maxBarSize,O=n.props["".concat(g,"Id")],C=n.props["".concat(v,"Id")],j=f.reduce(function(e,r){var o,a=t["".concat(r.axisType,"Map")],i=n.props["".concat(r.axisType,"Id")];a&&a[i]||"zAxis"===r.axisType||(0,w.Z)(!1);var l=a[i];return tt(tt({},e),{},(tn(o={},r.axisType,l),tn(o,"".concat(r.axisType,"Ticks"),(0,T.uY)(l)),o))},{}),P=j[v],N=j["".concat(v,"Ticks")],A=r&&r[O]&&r[O].hasStack&&(0,T.O3)(n,r[O].stackGroups),M=(0,_.Gf)(n.type).indexOf("Bar")>=0,I=(0,T.zT)(P,N),R=[];if(M){var D,L,Z=a()(E)?h:E,z=null!==(D=null!==(L=(0,T.zT)(P,N,!0))&&void 0!==L?L:Z)&&void 0!==D?D:0;R=(0,T.qz)({barGap:d,barCategoryGap:p,bandSize:z!==I?z:I,sizeList:y[C],maxBarSize:Z}),z!==I&&(R=R.map(function(e){return tt(tt({},e),{},{position:tt(tt({},e.position),{},{offset:e.position.offset-z/2})})}))}var B=n&&n.type&&n.type.getComposedData;B&&b.push({props:tt(tt({},B(tt(tt({},j),{},{displayedData:x,props:e,dataKey:S,item:n,bandSize:I,barPosition:R,offset:o,stackedData:A,layout:u,dataStartIndex:l,dataEndIndex:s}))),{},(tn(m={key:n.key||"item-".concat(c)},g,j[g]),tn(m,v,j[v]),tn(m,"animationId",i),m)),childIndex:(0,_.$R)(n,e.children),item:n})}),b},O=function(e,t){var r=e.props,a=e.dataStartIndex,i=e.dataEndIndex,l=e.updateId;if(!(0,_.TT)({props:r}))return null;var s=r.children,c=r.layout,u=r.stackOffset,d=r.data,p=r.reverseStackOrder,m=ty(c),g=m.numericAxisName,v=m.cateAxisName,b=(0,_.NN)(s,o),x=(0,T.wh)(d,b,"".concat(g,"Id"),"".concat(v,"Id"),u,p),w=f.reduce(function(e,t){var n="".concat(t.axisType,"Map");return tt(tt({},e),{},tn({},n,tm(r,tt(tt({},t),{},{graphicalItems:b,stackGroups:t.axisType===g&&x,dataStartIndex:a,dataEndIndex:i}))))},{}),k=tb(tt(tt({},w),{},{props:r,graphicalItems:b}),null==t?void 0:t.legendBBox);Object.keys(w).forEach(function(e){w[e]=h(r,w[e],k,e.replace("Map",""),n)});var S=tg(w["".concat(v,"Map")]),E=y(r,tt(tt({},w),{},{dataStartIndex:a,dataEndIndex:i,updateId:l,graphicalItems:b,stackGroups:x,offset:k}));return tt(tt({formattedGraphicalItems:E,graphicalItems:b,offset:k,stackGroups:x},S),w)};return t=function(e){(function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&e4(e,t)})(c,e);var t,o,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=e5(c);return e=t?Reflect.construct(n,arguments,e5(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===e0(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return e3(e)}(this,e)});function c(e){var t,o,s;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,c),tn(e3(s=i.call(this,e)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),tn(e3(s),"accessibilityManager",new eZ),tn(e3(s),"handleLegendBBoxUpdate",function(e){if(e){var t=s.state,n=t.dataStartIndex,r=t.dataEndIndex,o=t.updateId;s.setState(tt({legendBBox:e},O({props:s.props,dataStartIndex:n,dataEndIndex:r,updateId:o},tt(tt({},s.state),{},{legendBBox:e}))))}}),tn(e3(s),"handleReceiveSyncEvent",function(e,t,n){s.props.syncId===e&&(n!==s.eventEmitterSymbol||"function"==typeof s.props.syncMethod)&&s.applySyncEvent(t)}),tn(e3(s),"handleBrushChange",function(e){var t=e.startIndex,n=e.endIndex;if(t!==s.state.dataStartIndex||n!==s.state.dataEndIndex){var r=s.state.updateId;s.setState(function(){return tt({dataStartIndex:t,dataEndIndex:n},O({props:s.props,dataStartIndex:t,dataEndIndex:n,updateId:r},s.state))}),s.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),tn(e3(s),"handleMouseEnter",function(e){var t=s.getMouseInfo(e);if(t){var n=tt(tt({},t),{},{isTooltipActive:!0});s.setState(n),s.triggerSyncEvent(n);var r=s.props.onMouseEnter;l()(r)&&r(n,e)}}),tn(e3(s),"triggeredAfterMouseMove",function(e){var t=s.getMouseInfo(e),n=t?tt(tt({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};s.setState(n),s.triggerSyncEvent(n);var r=s.props.onMouseMove;l()(r)&&r(n,e)}),tn(e3(s),"handleItemMouseEnter",function(e){s.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),tn(e3(s),"handleItemMouseLeave",function(){s.setState(function(){return{isTooltipActive:!1}})}),tn(e3(s),"handleMouseMove",function(e){e.persist(),s.throttleTriggeredAfterMouseMove(e)}),tn(e3(s),"handleMouseLeave",function(e){var t={isTooltipActive:!1};s.setState(t),s.triggerSyncEvent(t);var n=s.props.onMouseLeave;l()(n)&&n(t,e)}),tn(e3(s),"handleOuterEvent",function(e){var t,n=(0,_.Bh)(e),r=d()(s.props,"".concat(n));n&&l()(r)&&r(null!==(t=/.*touch.*/i.test(n)?s.getMouseInfo(e.changedTouches[0]):s.getMouseInfo(e))&&void 0!==t?t:{},e)}),tn(e3(s),"handleClick",function(e){var t=s.getMouseInfo(e);if(t){var n=tt(tt({},t),{},{isTooltipActive:!0});s.setState(n),s.triggerSyncEvent(n);var r=s.props.onClick;l()(r)&&r(n,e)}}),tn(e3(s),"handleMouseDown",function(e){var t=s.props.onMouseDown;l()(t)&&t(s.getMouseInfo(e),e)}),tn(e3(s),"handleMouseUp",function(e){var t=s.props.onMouseUp;l()(t)&&t(s.getMouseInfo(e),e)}),tn(e3(s),"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),tn(e3(s),"handleTouchStart",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseDown(e.changedTouches[0])}),tn(e3(s),"handleTouchEnd",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseUp(e.changedTouches[0])}),tn(e3(s),"triggerSyncEvent",function(e){void 0!==s.props.syncId&&eA.emit(eM,s.props.syncId,e,s.eventEmitterSymbol)}),tn(e3(s),"applySyncEvent",function(e){var t=s.props,n=t.layout,r=t.syncMethod,o=s.state.updateId,a=e.dataStartIndex,i=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)s.setState(tt({dataStartIndex:a,dataEndIndex:i},O({props:s.props,dataStartIndex:a,dataEndIndex:i,updateId:o},s.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,c=e.chartY,u=e.activeTooltipIndex,d=s.state,f=d.offset,p=d.tooltipTicks;if(!f)return;if("function"==typeof r)u=r(p,e);else if("value"===r){u=-1;for(var h=0;h<p.length;h++)if(p[h].value===e.activeLabel){u=h;break}}var m=tt(tt({},f),{},{x:f.left,y:f.top}),g=Math.min(l,m.x+m.width),v=Math.min(c,m.y+m.height),y=p[u]&&p[u].value,b=td(s.state,s.props.data,u),x=p[u]?{x:"horizontal"===n?p[u].coordinate:g,y:"horizontal"===n?v:p[u].coordinate}:ti;s.setState(tt(tt({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else s.setState(e)}),tn(e3(s),"renderCursor",function(e){var t,o=s.state,a=o.isTooltipActive,i=o.activeCoordinate,l=o.activePayload,c=o.offset,u=o.activeTooltipIndex,d=o.tooltipAxisBandSize,f=s.getTooltipEventType(),p=null!==(t=e.props.active)&&void 0!==t?t:a,h=s.props.layout,m=e.key||"_recharts-cursor";return r.createElement(eY,{key:m,activeCoordinate:i,activePayload:l,activeTooltipIndex:u,chartName:n,element:e,isActive:p,layout:h,offset:c,tooltipAxisBandSize:d,tooltipEventType:f})}),tn(e3(s),"renderPolarAxis",function(e,t,n){var o=d()(e,"type.axisType"),a=d()(s.state,"".concat(o,"Map")),i=a&&a[e.props["".concat(o,"Id")]];return(0,r.cloneElement)(e,tt(tt({},i),{},{className:o,key:e.key||"".concat(t,"-").concat(n),ticks:(0,T.uY)(i,!0)}))}),tn(e3(s),"renderGrid",function(e){var t=s.state,n=t.xAxisMap,o=t.yAxisMap,a=t.offset,i=(0,A.Kt)(n),l=v()(o,function(e){return b()(e.domain,Number.isFinite)})||(0,A.Kt)(o),c=e.props||{};return(0,r.cloneElement)(e,{key:e.key||"grid",x:(0,A.hj)(c.x)?c.x:a.left,y:(0,A.hj)(c.y)?c.y:a.top,width:(0,A.hj)(c.width)?c.width:a.width,height:(0,A.hj)(c.height)?c.height:a.height,xAxis:i,yAxis:l,verticalCoordinatesGenerator:c.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:c.horizontalCoordinatesGenerator})}),tn(e3(s),"renderPolarGrid",function(e){var t=e.props,n=t.radialLines,o=t.polarAngles,a=t.polarRadius,i=s.state,l=i.radiusAxisMap,c=i.angleAxisMap,u=(0,A.Kt)(l),d=(0,A.Kt)(c),f=d.cx,p=d.cy,h=d.innerRadius,m=d.outerRadius;return(0,r.cloneElement)(e,{polarAngles:Array.isArray(o)?o:(0,T.uY)(d,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:(0,T.uY)(u,!0).map(function(e){return e.coordinate}),cx:f,cy:p,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:n})}),tn(e3(s),"renderLegend",function(){var e=s.state.formattedGraphicalItems,t=s.props,n=t.children,o=t.width,a=t.height,i=s.props.margin||{},l=o-(i.left||0)-(i.right||0),c=(0,J.z)({children:n,formattedGraphicalItems:e,legendWidth:l,legendContent:p});if(!c)return null;var u=c.item,d=e6(c,eQ);return(0,r.cloneElement)(u,tt(tt({},d),{},{chartWidth:o,chartHeight:a,margin:i,onBBoxUpdate:s.handleLegendBBoxUpdate}))}),tn(e3(s),"renderTooltip",function(){var e,t=s.props.children,n=(0,_.sP)(t,E.u);if(!n)return null;var o=s.state,a=o.isTooltipActive,i=o.activeCoordinate,l=o.activePayload,c=o.activeLabel,u=o.offset,d=null!==(e=n.props.active)&&void 0!==e?e:a;return(0,r.cloneElement)(n,{viewBox:tt(tt({},u),{},{x:u.left,y:u.top}),active:d,label:c,payload:d?l:[],coordinate:i})}),tn(e3(s),"renderBrush",function(e){var t=s.props,n=t.margin,o=t.data,a=s.state,i=a.offset,l=a.dataStartIndex,c=a.dataEndIndex,u=a.updateId;return(0,r.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:(0,T.DO)(s.handleBrushChange,e.props.onChange),data:o,x:(0,A.hj)(e.props.x)?e.props.x:i.left,y:(0,A.hj)(e.props.y)?e.props.y:i.top+i.height+i.brushBottom-(n.bottom||0),width:(0,A.hj)(e.props.width)?e.props.width:i.width,startIndex:l,endIndex:c,updateId:"brush-".concat(u)})}),tn(e3(s),"renderReferenceElement",function(e,t,n){if(!e)return null;var o=e3(s).clipPathId,a=s.state,i=a.xAxisMap,l=a.yAxisMap,c=a.offset,u=e.props,d=u.xAxisId,f=u.yAxisId;return(0,r.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(n),xAxis:i[d],yAxis:l[f],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:o})}),tn(e3(s),"renderActivePoints",function(e){var t=e.item,n=e.activePoint,r=e.basePoint,o=e.childIndex,a=e.isRange,i=[],l=t.props.key,s=t.item.props,u=s.activeDot,d=tt(tt({index:o,dataKey:s.dataKey,cx:n.x,cy:n.y,r:4,fill:(0,T.fk)(t.item),strokeWidth:2,stroke:"#fff",payload:n.payload,value:n.value,key:"".concat(l,"-activePoint-").concat(o)},(0,_.L6)(u,!1)),(0,eI.Ym)(u));return i.push(c.renderActiveDot(u,d)),r?i.push(c.renderActiveDot(u,tt(tt({},d),{},{cx:r.x,cy:r.y,key:"".concat(l,"-basePoint-").concat(o)}))):a&&i.push(null),i}),tn(e3(s),"renderGraphicChild",function(e,t,n){var o=s.filterFormatItem(e,t,n);if(!o)return null;var i=s.getTooltipEventType(),l=s.state,c=l.isTooltipActive,u=l.tooltipAxis,d=l.activeTooltipIndex,f=l.activeLabel,p=s.props.children,h=(0,_.sP)(p,E.u),m=o.props,g=m.points,v=m.isRange,y=m.baseLine,b=o.item.props,x=b.activeDot,w=b.hide,k=b.activeBar,S=b.activeShape,O={};"axis"!==i&&h&&"click"===h.props.trigger?O={onClick:(0,T.DO)(s.handleItemMouseEnter,e.props.onClick)}:"axis"!==i&&(O={onMouseLeave:(0,T.DO)(s.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:(0,T.DO)(s.handleItemMouseEnter,e.props.onMouseEnter)});var C=(0,r.cloneElement)(e,tt(tt({},o.props),O));if(!w&&c&&h&&(x||k||S)){if(d>=0){if(u.dataKey&&!u.allowDuplicatedCategory){var j="function"==typeof u.dataKey?function(e){return"function"==typeof u.dataKey?u.dataKey(e.payload):null}:"payload.".concat(u.dataKey.toString());N=(0,A.Ap)(g,j,f),M=v&&y&&(0,A.Ap)(y,j,f)}else N=null==g?void 0:g[d],M=v&&y&&y[d];if(S||k){var P=void 0!==e.props.activeIndex?e.props.activeIndex:d;return[(0,r.cloneElement)(e,tt(tt(tt({},o.props),O),{},{activeIndex:P})),null,null]}if(!a()(N))return[C].concat(e8(s.renderActivePoints({item:o,activePoint:N,basePoint:M,childIndex:d,isRange:v})))}else{var N,M,I,R=(null!==(I=s.getItemByXY(s.state.activeCoordinate))&&void 0!==I?I:{graphicalItem:C}).graphicalItem,D=R.item,L=void 0===D?e:D,Z=R.childIndex,z=tt(tt(tt({},o.props),O),{},{activeIndex:Z});return[(0,r.cloneElement)(L,z),null,null]}}return v?[C,null,null]:[C,null]}),tn(e3(s),"renderCustomized",function(e,t,n){return(0,r.cloneElement)(e,tt(tt({key:"recharts-customized-".concat(n)},s.props),s.state))}),tn(e3(s),"renderMap",{CartesianGrid:{handler:s.renderGrid,once:!0},ReferenceArea:{handler:s.renderReferenceElement},ReferenceLine:{handler:tl},ReferenceDot:{handler:s.renderReferenceElement},XAxis:{handler:tl},YAxis:{handler:tl},Brush:{handler:s.renderBrush,once:!0},Bar:{handler:s.renderGraphicChild},Line:{handler:s.renderGraphicChild},Area:{handler:s.renderGraphicChild},Radar:{handler:s.renderGraphicChild},RadialBar:{handler:s.renderGraphicChild},Scatter:{handler:s.renderGraphicChild},Pie:{handler:s.renderGraphicChild},Funnel:{handler:s.renderGraphicChild},Tooltip:{handler:s.renderCursor,once:!0},PolarGrid:{handler:s.renderPolarGrid,once:!0},PolarAngleAxis:{handler:s.renderPolarAxis},PolarRadiusAxis:{handler:s.renderPolarAxis},Customized:{handler:s.renderCustomized}}),s.clipPathId="".concat(null!==(t=e.id)&&void 0!==t?t:(0,A.EL)("recharts"),"-clip"),s.throttleTriggeredAfterMouseMove=m()(s.triggeredAfterMouseMove,null!==(o=e.throttleDelay)&&void 0!==o?o:1e3/60),s.state={},s}return o=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,o=e.layout,a=(0,_.sP)(t,E.u);if(a){var i=a.props.defaultIndex;if("number"==typeof i&&!(i<0)&&!(i>this.state.tooltipTicks.length)){var l=this.state.tooltipTicks[i]&&this.state.tooltipTicks[i].value,s=td(this.state,n,i,l),c=this.state.tooltipTicks[i].coordinate,u=(this.state.offset.top+r)/2,d="horizontal"===o?{x:c,y:u}:{y:c,x:u},f=this.state.formattedGraphicalItems.find(function(e){return"Scatter"===e.item.type.name});f&&(d=tt(tt({},d),f.props.points[i].tooltipPosition),s=f.props.points[i].tooltipPayload);var p={activeTooltipIndex:i,isTooltipActive:!0,activeLabel:l,activePayload:s,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(i)}}}},{key:"getSnapshotBeforeUpdate",value:function(e,t){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin){var n,r;this.accessibilityManager.setDetails({offset:{left:null!==(n=this.props.margin.left)&&void 0!==n?n:0,top:null!==(r=this.props.margin.top)&&void 0!==r?r:0}})}return null}},{key:"componentDidUpdate",value:function(e){(0,_.rL)([(0,_.sP)(e.children,E.u)],[(0,_.sP)(this.props.children,E.u)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=(0,_.sP)(this.props.children,E.u);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return u.indexOf(t)>=0?t:s}return s}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=(0,Q.os)(n),o={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,i=this.inRange(o.chartX,o.chartY,a);if(!i)return null;var l=this.state,s=l.xAxisMap,c=l.yAxisMap;if("axis"!==this.getTooltipEventType()&&s&&c){var u=(0,A.Kt)(s).scale,d=(0,A.Kt)(c).scale,f=u&&u.invert?u.invert(o.chartX):null,p=d&&d.invert?d.invert(o.chartY):null;return tt(tt({},o),{},{xValue:f,yValue:p})}var h=tf(this.state,this.props.data,this.props.layout,i);return h?tt(tt({},o),h):null}},{key:"inRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.props.layout,o=e/n,a=t/n;if("horizontal"===r||"vertical"===r){var i=this.state.offset;return o>=i.left&&o<=i.left+i.width&&a>=i.top&&a<=i.top+i.height?{x:o,y:a}:null}var l=this.state,s=l.angleAxisMap,c=l.radiusAxisMap;if(s&&c){var u=(0,A.Kt)(s);return(0,eP.z3)({x:o,y:a},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=(0,_.sP)(e,E.u),r={};return n&&"axis"===t&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),tt(tt({},(0,eI.Ym)(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){eA.on(eM,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eA.removeListener(eM,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,o=0,a=r.length;o<a;o++){var i=r[o];if(i.item===e||i.props.key===e.key||t===(0,_.Gf)(i.item.type)&&n===i.childIndex)return i}return null}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,o=t.top,a=t.height,i=t.width;return r.createElement("defs",null,r.createElement("clipPath",{id:e},r.createElement("rect",{x:n,y:o,height:a,width:i})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e2(t,2),r=n[0],o=n[1];return tt(tt({},e),{},tn({},r,o.scale))},{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e2(t,2),r=n[0],o=n[1];return tt(tt({},e),{},tn({},r,o.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var o=0,a=n.length;o<a;o++){var i=n[o],l=i.props,s=i.item,c=(0,_.Gf)(s.type);if("Bar"===c){var u=(l.data||[]).find(function(t){return(0,j.X)(e,t)});if(u)return{graphicalItem:i,payload:u}}else if("RadialBar"===c){var d=(l.data||[]).find(function(t){return(0,eP.z3)(e,t)});if(d)return{graphicalItem:i,payload:d}}else if((0,ez.lT)(i,r)||(0,ez.V$)(i,r)||(0,ez.w7)(i,r)){var f=(0,ez.a3)({graphicalItem:i,activeTooltipItem:r,itemData:s.props.data}),p=void 0===s.props.activeIndex?f:s.props.activeIndex;return{graphicalItem:tt(tt({},i),{},{childIndex:p}),payload:(0,ez.w7)(i,r)?s.props.data[f]:i.props.data[f]}}}return null}},{key:"render",value:function(){var e,t,n=this;if(!(0,_.TT)(this))return null;var o=this.props,a=o.children,i=o.className,l=o.width,s=o.height,c=o.style,u=o.compact,d=o.title,f=o.desc,p=e6(o,eJ),h=(0,_.L6)(p,!1);if(u)return r.createElement(k.T,e1({},h,{width:l,height:s,title:d,desc:f}),this.renderClipPath(),(0,_.eu)(a,this.renderMap));this.props.accessibilityLayer&&(h.tabIndex=null!==(e=this.props.tabIndex)&&void 0!==e?e:0,h.role=null!==(t=this.props.role)&&void 0!==t?t:"img",h.onKeyDown=function(e){n.accessibilityManager.keyboardEvent(e)},h.onFocus=function(){n.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return r.createElement(ef.br,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},r.createElement("div",e1({className:(0,x.Z)("recharts-wrapper",i),style:tt({position:"relative",cursor:"default",width:l,height:s},c)},m,{ref:function(e){n.container=e},role:"region"}),r.createElement(k.T,e1({},h,{width:l,height:s,title:d,desc:f,style:ta}),this.renderClipPath(),(0,_.eu)(a,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tr(r.key),r)}}(c.prototype,o),Object.defineProperty(c,"prototype",{writable:!1}),c}(r.Component),tn(t,"displayName",n),tn(t,"defaultProps",tt({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},g)),tn(t,"getDerivedStateFromProps",function(e,t){var n=e.dataKey,r=e.data,o=e.children,i=e.width,l=e.height,s=e.layout,c=e.stackOffset,u=e.margin,d=t.dataStartIndex,f=t.dataEndIndex;if(void 0===t.updateId){var p=tv(e);return tt(tt(tt({},p),{},{updateId:0},O(tt(tt({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:i,prevHeight:l,prevLayout:s,prevStackOffset:c,prevMargin:u,prevChildren:o})}if(n!==t.prevDataKey||r!==t.prevData||i!==t.prevWidth||l!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!(0,eN.w)(u,t.prevMargin)){var h=tv(e),m={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=tt(tt({},tf(t,r,s)),{},{updateId:t.updateId+1}),v=tt(tt(tt({},h),m),g);return tt(tt(tt({},v),O(tt({props:e},v),t)),{},{prevDataKey:n,prevData:r,prevWidth:i,prevHeight:l,prevLayout:s,prevStackOffset:c,prevMargin:u,prevChildren:o})}if(!(0,_.rL)(o,t.prevChildren)){var y,b,x,w,k=(0,_.sP)(o,Y),S=k&&null!==(y=null===(b=k.props)||void 0===b?void 0:b.startIndex)&&void 0!==y?y:d,E=k&&null!==(x=null===(w=k.props)||void 0===w?void 0:w.endIndex)&&void 0!==x?x:f,C=a()(r)||S!==d||E!==f?t.updateId+1:t.updateId;return tt(tt({updateId:C},O(tt(tt({props:e},t),{},{updateId:C,dataStartIndex:S,dataEndIndex:E}),t)),{},{prevChildren:o,dataStartIndex:S,dataEndIndex:E})}return null}),tn(t,"renderActiveDot",function(e,t){var n;return n=(0,r.isValidElement)(e)?(0,r.cloneElement)(e,t):l()(e)?e(t):r.createElement(C.o,t),r.createElement(S.m,{className:"recharts-active-dot",key:t.key},n)}),t}},20407:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});var r=function(e){return null};r.displayName="Cell"},26680:function(e,t,n){"use strict";n.d(t,{_:function(){return O}});var r=n(2265),o=n(77571),a=n.n(o),i=n(86757),l=n.n(i),s=n(28302),c=n.n(s),u=n(87602),d=n(58811),f=n(82944),p=n(16630),h=n(39206);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var g=["offset"];function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var w=function(e){var t=e.value,n=e.formatter,r=a()(e.children)?t:e.children;return l()(n)?n(r):r},k=function(e,t,n){var o,i,l=e.position,s=e.viewBox,c=e.offset,d=e.className,f=s.cx,m=s.cy,g=s.innerRadius,v=s.outerRadius,y=s.startAngle,b=s.endAngle,w=s.clockWise,k=(g+v)/2,S=(0,p.uY)(b-y)*Math.min(Math.abs(b-y),360),E=S>=0?1:-1;"insideStart"===l?(o=y+E*c,i=w):"insideEnd"===l?(o=b-E*c,i=!w):"end"===l&&(o=b+E*c,i=w),i=S<=0?i:!i;var O=(0,h.op)(f,m,k,o),C=(0,h.op)(f,m,k,o+(i?1:-1)*359),j="M".concat(O.x,",").concat(O.y,"\n A").concat(k,",").concat(k,",0,1,").concat(i?0:1,",\n ").concat(C.x,",").concat(C.y),_=a()(e.id)?(0,p.EL)("recharts-radial-line-"):e.id;return r.createElement("text",x({},n,{dominantBaseline:"central",className:(0,u.Z)("recharts-radial-bar-label",d)}),r.createElement("defs",null,r.createElement("path",{id:_,d:j})),r.createElement("textPath",{xlinkHref:"#".concat(_)},t))},S=function(e){var t=e.viewBox,n=e.offset,r=e.position,o=t.cx,a=t.cy,i=t.innerRadius,l=t.outerRadius,s=(t.startAngle+t.endAngle)/2;if("outside"===r){var c=(0,h.op)(o,a,l+n,s),u=c.x;return{x:u,y:c.y,textAnchor:u>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var d=(0,h.op)(o,a,(i+l)/2,s);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}},E=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,o=e.position,a=t.x,i=t.y,l=t.width,s=t.height,u=s>=0?1:-1,d=u*r,f=u>0?"end":"start",h=u>0?"start":"end",m=l>=0?1:-1,g=m*r,v=m>0?"end":"start",y=m>0?"start":"end";if("top"===o)return b(b({},{x:a+l/2,y:i-u*r,textAnchor:"middle",verticalAnchor:f}),n?{height:Math.max(i-n.y,0),width:l}:{});if("bottom"===o)return b(b({},{x:a+l/2,y:i+s+d,textAnchor:"middle",verticalAnchor:h}),n?{height:Math.max(n.y+n.height-(i+s),0),width:l}:{});if("left"===o){var x={x:a-g,y:i+s/2,textAnchor:v,verticalAnchor:"middle"};return b(b({},x),n?{width:Math.max(x.x-n.x,0),height:s}:{})}if("right"===o){var w={x:a+l+g,y:i+s/2,textAnchor:y,verticalAnchor:"middle"};return b(b({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:s}:{})}var k=n?{width:l,height:s}:{};return"insideLeft"===o?b({x:a+g,y:i+s/2,textAnchor:y,verticalAnchor:"middle"},k):"insideRight"===o?b({x:a+l-g,y:i+s/2,textAnchor:v,verticalAnchor:"middle"},k):"insideTop"===o?b({x:a+l/2,y:i+d,textAnchor:"middle",verticalAnchor:h},k):"insideBottom"===o?b({x:a+l/2,y:i+s-d,textAnchor:"middle",verticalAnchor:f},k):"insideTopLeft"===o?b({x:a+g,y:i+d,textAnchor:y,verticalAnchor:h},k):"insideTopRight"===o?b({x:a+l-g,y:i+d,textAnchor:v,verticalAnchor:h},k):"insideBottomLeft"===o?b({x:a+g,y:i+s-d,textAnchor:y,verticalAnchor:f},k):"insideBottomRight"===o?b({x:a+l-g,y:i+s-d,textAnchor:v,verticalAnchor:f},k):c()(o)&&((0,p.hj)(o.x)||(0,p.hU)(o.x))&&((0,p.hj)(o.y)||(0,p.hU)(o.y))?b({x:a+(0,p.h1)(o.x,l),y:i+(0,p.h1)(o.y,s),textAnchor:"end",verticalAnchor:"end"},k):b({x:a+l/2,y:i+s/2,textAnchor:"middle",verticalAnchor:"middle"},k)};function O(e){var t,n=e.offset,o=b({offset:void 0===n?5:n},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,g)),i=o.viewBox,s=o.position,c=o.value,h=o.children,m=o.content,v=o.className,y=o.textBreakAll;if(!i||a()(c)&&a()(h)&&!(0,r.isValidElement)(m)&&!l()(m))return null;if((0,r.isValidElement)(m))return(0,r.cloneElement)(m,o);if(l()(m)){if(t=(0,r.createElement)(m,o),(0,r.isValidElement)(t))return t}else t=w(o);var O="cx"in i&&(0,p.hj)(i.cx),C=(0,f.L6)(o,!0);if(O&&("insideStart"===s||"insideEnd"===s||"end"===s))return k(o,t,C);var j=O?S(o):E(o);return r.createElement(d.x,x({className:(0,u.Z)("recharts-label",void 0===v?"":v)},C,j,{breakAll:y}),t)}O.displayName="Label";var C=function(e){var t=e.cx,n=e.cy,r=e.angle,o=e.startAngle,a=e.endAngle,i=e.r,l=e.radius,s=e.innerRadius,c=e.outerRadius,u=e.x,d=e.y,f=e.top,h=e.left,m=e.width,g=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if((0,p.hj)(m)&&(0,p.hj)(g)){if((0,p.hj)(u)&&(0,p.hj)(d))return{x:u,y:d,width:m,height:g};if((0,p.hj)(f)&&(0,p.hj)(h))return{x:f,y:h,width:m,height:g}}return(0,p.hj)(u)&&(0,p.hj)(d)?{x:u,y:d,width:0,height:0}:(0,p.hj)(t)&&(0,p.hj)(n)?{cx:t,cy:n,startAngle:o||r||0,endAngle:a||r||0,innerRadius:s||0,outerRadius:c||l||i||0,clockWise:v}:e.viewBox?e.viewBox:{}};O.parseViewBox=C,O.renderCallByParent=function(e,t){var n,o,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&a&&!e.label)return null;var i=e.children,s=C(e),u=(0,f.NN)(i,O).map(function(e,n){return(0,r.cloneElement)(e,{viewBox:t||s,key:"label-".concat(n)})});return a?[(n=e.label,o=t||s,n?!0===n?r.createElement(O,{key:"label-implicit",viewBox:o}):(0,p.P2)(n)?r.createElement(O,{key:"label-implicit",viewBox:o,value:n}):(0,r.isValidElement)(n)?n.type===O?(0,r.cloneElement)(n,{key:"label-implicit",viewBox:o}):r.createElement(O,{key:"label-implicit",content:n,viewBox:o}):l()(n)?r.createElement(O,{key:"label-implicit",content:n,viewBox:o}):c()(n)?r.createElement(O,x({viewBox:o},n,{key:"label-implicit"})):null:null)].concat(function(e){if(Array.isArray(e))return v(e)}(u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,void 0)}}(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):u}},58772:function(e,t,n){"use strict";n.d(t,{e:function(){return O}});var r=n(2265),o=n(77571),a=n.n(o),i=n(28302),l=n.n(i),s=n(86757),c=n.n(s),u=n(86185),d=n.n(u),f=n(26680),p=n(9841),h=n(82944),m=n(85355);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var v=["valueAccessor"],y=["data","dataKey","clockWise","id","textBreakAll"];function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var E=function(e){return Array.isArray(e.value)?d()(e.value):e.value};function O(e){var t=e.valueAccessor,n=void 0===t?E:t,o=S(e,v),i=o.data,l=o.dataKey,s=o.clockWise,c=o.id,u=o.textBreakAll,d=S(o,y);return i&&i.length?r.createElement(p.m,{className:"recharts-label-list"},i.map(function(e,t){var o=a()(l)?n(e,t):(0,m.F$)(e&&e.payload,l),i=a()(c)?{}:{id:"".concat(c,"-").concat(t)};return r.createElement(f._,x({},(0,h.L6)(e,!0),d,i,{parentViewBox:e.parentViewBox,value:o,textBreakAll:u,viewBox:f._.parseViewBox(a()(s)?e:k(k({},e),{},{clockWise:s})),key:"label-".concat(t),index:t}))})):null}O.displayName="LabelList",O.renderCallByParent=function(e,t){var n,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&o&&!e.label)return null;var a=e.children,i=(0,h.NN)(a,O).map(function(e,n){return(0,r.cloneElement)(e,{data:t,key:"labelList-".concat(n)})});return o?[(n=e.label)?!0===n?r.createElement(O,{key:"labelList-implicit",data:t}):r.isValidElement(n)||c()(n)?r.createElement(O,{key:"labelList-implicit",data:t,content:n}):l()(n)?r.createElement(O,x({data:t},n,{key:"labelList-implicit"})):null:null].concat(function(e){if(Array.isArray(e))return b(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return b(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,void 0)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i}},22190:function(e,t,n){"use strict";n.d(t,{D:function(){return A}});var r=n(2265),o=n(86757),a=n.n(o),i=n(87602),l=n(1175),s=n(48777),c=n(14870),u=n(41637);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(){return(f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(y,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=m(y);return e=t?Reflect.construct(n,arguments,m(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function y(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,y),o.apply(this,arguments)}return n=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,n=32/6,o=32/3,a=e.inactive?t:e.color;if("plainline"===e.type)return r.createElement("line",{strokeWidth:4,fill:"none",stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:16,x2:32,y2:16,className:"recharts-legend-icon"});if("line"===e.type)return r.createElement("path",{strokeWidth:4,fill:"none",stroke:a,d:"M0,".concat(16,"h").concat(o,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*o,",").concat(16,"\n H").concat(32,"M").concat(2*o,",").concat(16,"\n A").concat(n,",").concat(n,",0,1,1,").concat(o,",").concat(16),className:"recharts-legend-icon"});if("rect"===e.type)return r.createElement("path",{stroke:"none",fill:a,d:"M0,".concat(4,"h").concat(32,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(r.isValidElement(e.legendIcon)){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);return delete i.legendIcon,r.cloneElement(e.legendIcon,i)}return r.createElement(c.v,{fill:a,cx:16,cy:16,size:32,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,n=t.payload,o=t.iconSize,c=t.layout,d=t.formatter,p=t.inactiveColor,h={x:0,y:0,width:32,height:32},m={display:"horizontal"===c?"inline-block":"block",marginRight:10},v={display:"inline-block",verticalAlign:"middle",marginRight:4};return n.map(function(t,n){var c,y=t.formatter||d,b=(0,i.Z)((g(c={"recharts-legend-item":!0},"legend-item-".concat(n),!0),g(c,"inactive",t.inactive),c));if("none"===t.type)return null;var x=a()(t.value)?null:t.value;(0,l.Z)(!a()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var w=t.inactive?p:t.color;return r.createElement("li",f({className:b,style:m,key:"legend-item-".concat(n)},(0,u.bw)(e.props,t,n)),r.createElement(s.T,{width:o,height:o,viewBox:h,style:v},e.renderIcon(t)),r.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},y?y(x,t,n):x))})}},{key:"render",value:function(){var e=this.props,t=e.payload,n=e.layout,o=e.align;return t&&t.length?r.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===n?o:"left"}},this.renderItems()):null}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}(y.prototype,n),Object.defineProperty(y,"prototype",{writable:!1}),y}(r.PureComponent);g(y,"displayName","Legend"),g(y,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var b=n(16630),x=n(93528);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k=["ref"];function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N(r.key),r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){var t=function(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===w(t)?t:String(t)}function T(e){return e.value}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(i,e);var t,n,o,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=_(i);return e=t?Reflect.construct(n,arguments,_(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return j(e)}(this,e)});function i(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return P(j(e=a.call.apply(a,[this].concat(n))),"lastBoundingBox",{width:-1,height:-1}),e}return n=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){return this.wrapperNode&&this.wrapperNode.getBoundingClientRect?this.wrapperNode.getBoundingClientRect():null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var t=this.wrapperNode.getBoundingClientRect();(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t))}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?E({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,n,r=this.props,o=r.layout,a=r.align,i=r.verticalAlign,l=r.margin,s=r.chartWidth,c=r.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===a&&"vertical"===o?{left:((s||0)-this.getBBoxSnapshot().width)/2}:"right"===a?{right:l&&l.right||0}:{left:l&&l.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(n="middle"===i?{top:((c||0)-this.getBBoxSnapshot().height)/2}:"bottom"===i?{bottom:l&&l.bottom||0}:{top:l&&l.top||0}),E(E({},t),n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.content,o=t.width,a=t.height,i=t.wrapperStyle,l=t.payloadUniqBy,s=t.payload,c=E(E({position:"absolute",width:o||"auto",height:a||"auto"},this.getDefaultPosition(i)),i);return r.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(t){e.wrapperNode=t}},function(e,t){if(r.isValidElement(e))return r.cloneElement(e,t);if("function"==typeof e)return r.createElement(e,t);t.ref;var n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,k);return r.createElement(y,n)}(n,E(E({},this.props),{},{payload:(0,x.z)(s,l,T)})))}}],o=[{key:"getWithHeight",value:function(e,t){var n=e.props.layout;return"vertical"===n&&(0,b.hj)(e.props.height)?{height:e.props.height}:"horizontal"===n?{width:e.props.width||t}:null}}],n&&O(i.prototype,n),o&&O(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}(r.PureComponent);P(A,"displayName","Legend"),P(A,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"})},47625:function(e,t,n){"use strict";n.d(t,{h:function(){return m}});var r=n(87602),o=n(2265),a=n(37065),i=n.n(a),l=n(82558),s=n(16630),c=n(1175),u=n(82944);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m=(0,o.forwardRef)(function(e,t){var n,a=e.aspect,d=e.initialDimension,f=void 0===d?{width:-1,height:-1}:d,m=e.width,g=void 0===m?"100%":m,v=e.height,y=void 0===v?"100%":v,b=e.minWidth,x=void 0===b?0:b,w=e.minHeight,k=e.maxHeight,S=e.children,E=e.debounce,O=void 0===E?0:E,C=e.id,j=e.className,_=e.onResize,P=e.style,N=(0,o.useRef)(null),T=(0,o.useRef)();T.current=_,(0,o.useImperativeHandle)(t,function(){return Object.assign(N.current,{get current(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current}})});var A=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)({containerWidth:f.width,containerHeight:f.height}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(n,2)||function(e,t){if(e){if("string"==typeof e)return h(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),M=A[0],I=A[1],R=(0,o.useCallback)(function(e,t){I(function(n){var r=Math.round(e),o=Math.round(t);return n.containerWidth===r&&n.containerHeight===o?n:{containerWidth:r,containerHeight:o}})},[]);(0,o.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,o=n.height;R(r,o),null===(t=T.current)||void 0===t||t.call(T,r,o)};O>0&&(e=i()(e,O,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=N.current.getBoundingClientRect();return R(n.width,n.height),t.observe(N.current),function(){t.disconnect()}},[R,O]);var D=(0,o.useMemo)(function(){var e=M.containerWidth,t=M.containerHeight;if(e<0||t<0)return null;(0,c.Z)((0,s.hU)(g)||(0,s.hU)(y),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",g,y),(0,c.Z)(!a||a>0,"The aspect(%s) must be greater than zero.",a);var n=(0,s.hU)(g)?e:g,r=(0,s.hU)(y)?t:y;a&&a>0&&(n?r=n/a:r&&(n=r*a),k&&r>k&&(r=k)),(0,c.Z)(n>0||r>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,r,g,y,x,w,a);var i=!Array.isArray(S)&&(0,l.isElement)(S)&&(0,u.Gf)(S.type).endsWith("Chart");return o.Children.map(S,function(e){return(0,l.isElement)(e)?(0,o.cloneElement)(e,p({width:n,height:r},i?{style:p({height:"100%",width:"100%",maxHeight:r,maxWidth:n},e.props.style)}:{})):e})},[a,S,y,k,w,x,M,g]);return o.createElement("div",{id:C?"".concat(C):void 0,className:(0,r.Z)("recharts-responsive-container",j),style:p(p({},void 0===P?{}:P),{},{width:g,height:y,minWidth:x,minHeight:w,maxHeight:k}),ref:N},D)})},58811:function(e,t,n){"use strict";n.d(t,{x:function(){return L}});var r=n(2265),o=n(77571),a=n.n(o),i=n(87602),l=n(16630),s=n(34067),c=n(82944),u=n(4094);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r.key),r)}}var m=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,g=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,v=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,y=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,b={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},x=Object.keys(b),w=function(){var e,t;function n(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this.num=e,this.unit=t,this.num=e,this.unit=t,Number.isNaN(e)&&(this.unit=""),""===t||v.test(t)||(this.num=NaN,this.unit=""),x.includes(t)&&(this.num=e*b[t],this.unit="px")}return e=[{key:"add",value:function(e){return this.unit!==e.unit?new n(NaN,""):new n(this.num+e.num,this.unit)}},{key:"subtract",value:function(e){return this.unit!==e.unit?new n(NaN,""):new n(this.num-e.num,this.unit)}},{key:"multiply",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(NaN,""):new n(this.num*e.num,this.unit||e.unit)}},{key:"divide",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(NaN,""):new n(this.num/e.num,this.unit||e.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],t=[{key:"parse",value:function(e){var t,r=f(null!==(t=y.exec(e))&&void 0!==t?t:[],3),o=r[1],a=r[2];return new n(parseFloat(o),null!=a?a:"")}}],e&&h(n.prototype,e),t&&h(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();function k(e){if(e.includes("NaN"))return"NaN";for(var t=e;t.includes("*")||t.includes("/");){var n,r=f(null!==(n=m.exec(t))&&void 0!==n?n:[],4),o=r[1],a=r[2],i=r[3],l=w.parse(null!=o?o:""),s=w.parse(null!=i?i:""),c="*"===a?l.multiply(s):l.divide(s);if(c.isNaN())return"NaN";t=t.replace(m,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,d=f(null!==(u=g.exec(t))&&void 0!==u?u:[],4),p=d[1],h=d[2],v=d[3],y=w.parse(null!=p?p:""),b=w.parse(null!=v?v:""),x="+"===h?y.add(b):y.subtract(b);if(x.isNaN())return"NaN";t=t.replace(g,x.toString())}return t}var S=/\(([^()]*)\)/;function E(e){var t=function(e){try{var t;return t=e.replace(/\s+/g,""),t=function(e){for(var t=e;t.includes("(");){var n=f(S.exec(t),2)[1];t=t.replace(S,k(n))}return t}(t),t=k(t)}catch(e){return"NaN"}}(e.slice(5,-1));return"NaN"===t?"":t}var O=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],C=["dx","dy","angle","className","breakAll"];function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var T=/[ \f\n\r\t\v\u2028\u2029]+/,A=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var o=[];a()(t)||(o=n?t.toString().split(""):t.toString().split(T));var i=o.map(function(e){return{word:e,width:(0,u.xE)(e,r).width}}),l=n?0:(0,u.xE)("\xa0",r).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch(e){return null}},M=function(e,t,n,r,o){var a,i=e.maxLines,s=e.children,c=e.style,u=e.breakAll,d=(0,l.hj)(i),f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(function(e,t){var a=t.word,i=t.width,l=e[e.length-1];return l&&(null==r||o||l.width+i+n<Number(r))?(l.words.push(a),l.width+=i+n):e.push({words:[a],width:i}),e},[])},p=f(t);if(!d)return p;for(var h=function(e){var t=f(A({breakAll:u,style:c,children:s.slice(0,e)+"…"}).wordsWithComputedWidth);return[t.length>i||t.reduce(function(e,t){return e.width>t.width?e:t}).width>Number(r),t]},m=0,g=s.length-1,v=0;m<=g&&v<=s.length-1;){var y=Math.floor((m+g)/2),b=P(h(y-1),2),x=b[0],w=b[1],k=P(h(y),1)[0];if(x||k||(m=y+1),x&&k&&(g=y-1),!x&&k){a=w;break}v++}return a||p},I=function(e){return[{words:a()(e)?[]:e.toString().split(T)}]},R=function(e){var t=e.width,n=e.scaleToFit,r=e.children,o=e.style,a=e.breakAll,i=e.maxLines;if((t||n)&&!s.x.isSsr){var l=A({breakAll:a,children:r,style:o});return l?M({breakAll:a,children:r,maxLines:i,style:o},l.wordsWithComputedWidth,l.spaceWidth,t,n):I(r)}return I(r)},D="#808080",L=function(e){var t,n=e.x,o=void 0===n?0:n,a=e.y,s=void 0===a?0:a,u=e.lineHeight,d=void 0===u?"1em":u,f=e.capHeight,p=void 0===f?"0.71em":f,h=e.scaleToFit,m=void 0!==h&&h,g=e.textAnchor,v=e.verticalAnchor,y=e.fill,b=void 0===y?D:y,x=_(e,O),w=(0,r.useMemo)(function(){return R({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:m,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,m,x.style,x.width]),k=x.dx,S=x.dy,P=x.angle,N=x.className,T=x.breakAll,A=_(x,C);if(!(0,l.P2)(o)||!(0,l.P2)(s))return null;var M=o+((0,l.hj)(k)?k:0),I=s+((0,l.hj)(S)?S:0);switch(void 0===v?"end":v){case"start":t=E("calc(".concat(p,")"));break;case"middle":t=E("calc(".concat((w.length-1)/2," * -").concat(d," + (").concat(p," / 2))"));break;default:t=E("calc(".concat(w.length-1," * -").concat(d,")"))}var L=[];if(m){var Z=w[0].width,z=x.width;L.push("scale(".concat(((0,l.hj)(z)?z/Z:1)/Z,")"))}return P&&L.push("rotate(".concat(P,", ").concat(M,", ").concat(I,")")),L.length&&(A.transform=L.join(" ")),r.createElement("text",j({},(0,c.L6)(A,!0),{x:M,y:I,className:(0,i.Z)("recharts-text",N),textAnchor:void 0===g?"start":g,fill:b.includes("url")?D:b}),w.map(function(e,n){var o=e.words.join(T?"":" ");return r.createElement("tspan",{x:M,dy:0===n?t:d,key:o},o)}))}},8147:function(e,t,n){"use strict";n.d(t,{u:function(){return F}});var r=n(2265),o=n(34935),a=n.n(o),i=n(77571),l=n.n(i),s=n(87602),c=n(16630);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==u(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===u(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e){return Array.isArray(e)&&(0,c.P2)(e[0])&&(0,c.P2)(e[1])?e.join(" ~ "):e}var m=function(e){var t=e.separator,n=void 0===t?" : ":t,o=e.contentStyle,i=e.itemStyle,u=void 0===i?{}:i,f=e.labelStyle,m=e.payload,g=e.formatter,v=e.itemSorter,y=e.wrapperClassName,b=e.labelClassName,x=e.label,w=e.labelFormatter,k=p({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},void 0===o?{}:o),S=p({margin:0},void 0===f?{}:f),E=!l()(x),O=E?x:"",C=(0,s.Z)("recharts-default-tooltip",y),j=(0,s.Z)("recharts-tooltip-label",b);return E&&w&&null!=m&&(O=w(x,m)),r.createElement("div",{className:C,style:k},r.createElement("p",{className:j,style:S},r.isValidElement(O)?O:"".concat(O)),function(){if(m&&m.length){var e=(v?a()(m,v):m).map(function(e,t){if("none"===e.type)return null;var o=p({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},u),a=e.formatter||g||h,i=e.value,l=e.name,s=i,f=l;if(a&&null!=s&&null!=f){var v=a(i,l,e,t,m);if(Array.isArray(v)){var y=function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(v,2)||function(e,t){if(e){if("string"==typeof e)return d(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,2)}}(v,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s=y[0],f=y[1]}else s=v}return r.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:o},(0,c.P2)(f)?r.createElement("span",{className:"recharts-tooltip-item-name"},f):null,(0,c.P2)(f)?r.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,r.createElement("span",{className:"recharts-tooltip-item-value"},s),r.createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))});return r.createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())},g=n(59221);function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t,n){var r;return(r=function(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==v(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===v(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b="recharts-tooltip-wrapper",x={visibility:"hidden"};function w(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,o=e.offsetTopLeft,a=e.position,i=e.reverseDirection,l=e.tooltipDimension,s=e.viewBox,u=e.viewBoxDimension;if(a&&(0,c.hj)(a[r]))return a[r];var d=n[r]-l-o,f=n[r]+o;return t[r]?i[r]?d:f:i[r]?d<s[r]?Math.max(f,s[r]):Math.max(d,s[r]):f+l>s[r]+u?Math.max(d,s[r]):Math.max(f,s[r])}function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){return(O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function C(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=j(a);return e=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return C(e)}(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return _(C(e=o.call.apply(o,[this].concat(n))),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),_(C(e),"lastBoundingBox",{width:-1,height:-1}),_(C(e),"handleKeyDown",function(t){if("Escape"===t.key){var n,r,o,a;e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(n=null===(r=e.props.coordinate)||void 0===r?void 0:r.x)&&void 0!==n?n:0,y:null!==(o=null===(a=e.props.coordinate)||void 0===a?void 0:a.y)&&void 0!==o?o:0}})}}),e}return n=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.lastBoundingBox.width)>1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height)}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)!==this.state.dismissedAtCoordinate.x||(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var e,t,n,o,a,i,l,u,d,f,p,h,m,v,k,S,O,C,j,_,P,N=this,T=this.props,A=T.active,M=T.allowEscapeViewBox,I=T.animationDuration,R=T.animationEasing,D=T.children,L=T.coordinate,Z=T.hasPayload,z=T.isAnimationActive,B=T.offset,F=T.position,H=T.reverseDirection,q=T.useTranslate3d,W=T.viewBox,U=T.wrapperStyle,K=(v=(e={allowEscapeViewBox:M,coordinate:L,offsetTopLeft:B,position:F,reverseDirection:H,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:q,viewBox:W}).allowEscapeViewBox,k=e.coordinate,S=e.offsetTopLeft,O=e.position,C=e.reverseDirection,j=e.tooltipBox,_=e.useTranslate3d,P=e.viewBox,j.height>0&&j.width>0&&k?(n=(t={translateX:h=w({allowEscapeViewBox:v,coordinate:k,key:"x",offsetTopLeft:S,position:O,reverseDirection:C,tooltipDimension:j.width,viewBox:P,viewBoxDimension:P.width}),translateY:m=w({allowEscapeViewBox:v,coordinate:k,key:"y",offsetTopLeft:S,position:O,reverseDirection:C,tooltipDimension:j.height,viewBox:P,viewBoxDimension:P.height}),useTranslate3d:_}).translateX,o=t.translateY,a=t.useTranslate3d,p=(0,g.bO)({transform:a?"translate3d(".concat(n,"px, ").concat(o,"px, 0)"):"translate(".concat(n,"px, ").concat(o,"px)")})):p=x,{cssProperties:p,cssClasses:(u=(i={translateX:h,translateY:m,coordinate:k}).coordinate,d=i.translateX,f=i.translateY,(0,s.Z)(b,(y(l={},"".concat(b,"-right"),(0,c.hj)(d)&&u&&(0,c.hj)(u.x)&&d>=u.x),y(l,"".concat(b,"-left"),(0,c.hj)(d)&&u&&(0,c.hj)(u.x)&&d<u.x),y(l,"".concat(b,"-bottom"),(0,c.hj)(f)&&u&&(0,c.hj)(u.y)&&f>=u.y),y(l,"".concat(b,"-top"),(0,c.hj)(f)&&u&&(0,c.hj)(u.y)&&f<u.y),l)))}),$=K.cssClasses,V=K.cssProperties,X=E(E(E({},z&&A&&(0,g.bO)({transition:"transform ".concat(I,"ms ").concat(R)})),V),{},{pointerEvents:"none",visibility:!this.state.dismissed&&A&&Z?"visible":"hidden",position:"absolute",top:0,left:0},U);return r.createElement("div",{tabIndex:-1,role:"dialog",className:$,style:X,ref:function(e){N.wrapperNode=e}},D)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent),T=n(34067),A=n(93528);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t){return(D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Z(e,t,n){return(t=z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e){var t=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===M(t)?t:String(t)}function B(e){return e.dataKey}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=L(a);return e=t?Reflect.construct(n,arguments,L(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"render",value:function(){var e,t=this,n=this.props,o=n.active,a=n.allowEscapeViewBox,i=n.animationDuration,l=n.animationEasing,s=n.content,c=n.coordinate,u=n.filterNull,d=n.isAnimationActive,f=n.offset,p=n.payload,h=n.payloadUniqBy,g=n.position,v=n.reverseDirection,y=n.useTranslate3d,b=n.viewBox,x=n.wrapperStyle,w=null!=p?p:[];u&&w.length&&(w=(0,A.z)(p.filter(function(e){return null!=e.value&&(!0!==e.hide||t.props.includeHidden)}),h,B));var k=w.length>0;return r.createElement(N,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:o,coordinate:c,hasPayload:k,offset:f,position:g,reverseDirection:v,useTranslate3d:y,viewBox:b,wrapperStyle:x},(e=R(R({},this.props),{},{payload:w}),r.isValidElement(s)?r.cloneElement(s,e):"function"==typeof s?r.createElement(s,e):r.createElement(m,e)))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,z(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);Z(F,"displayName","Tooltip"),Z(F,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!T.x.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}})},9841:function(e,t,n){"use strict";n.d(t,{m:function(){return s}});var r=n(2265),o=n(87602),a=n(82944),i=["children","className"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=r.forwardRef(function(e,t){var n=e.children,s=e.className,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),u=(0,o.Z)("recharts-layer",s);return r.createElement("g",l({className:u},(0,a.L6)(c,!0),{ref:t}),n)})},48777:function(e,t,n){"use strict";n.d(t,{T:function(){return s}});var r=n(2265),o=n(87602),a=n(82944),i=["children","width","height","viewBox","className","style","title","desc"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e){var t=e.children,n=e.width,s=e.height,c=e.viewBox,u=e.className,d=e.style,f=e.title,p=e.desc,h=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),m=c||{width:n,height:s,x:0,y:0},g=(0,o.Z)("recharts-surface",u);return r.createElement("svg",l({},(0,a.L6)(h,!0,"svg"),{className:g,width:n,height:s,style:d,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),r.createElement("title",null,f),r.createElement("desc",null,p),t)}},25739:function(e,t,n){"use strict";n.d(t,{br:function(){return h},Mw:function(){return w},zn:function(){return x},sp:function(){return m},qD:function(){return b},d2:function(){return y},bH:function(){return g},Ud:function(){return v}});var r=n(2265),o=n(69398),a=n(50967),i=n.n(a)()(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),l=(0,r.createContext)(void 0),s=(0,r.createContext)(void 0),c=(0,r.createContext)(void 0),u=(0,r.createContext)({}),d=(0,r.createContext)(void 0),f=(0,r.createContext)(0),p=(0,r.createContext)(0),h=function(e){var t=e.state,n=t.xAxisMap,o=t.yAxisMap,a=t.offset,h=e.clipPathId,m=e.children,g=e.width,v=e.height,y=i(a);return r.createElement(l.Provider,{value:n},r.createElement(s.Provider,{value:o},r.createElement(u.Provider,{value:a},r.createElement(c.Provider,{value:y},r.createElement(d.Provider,{value:h},r.createElement(f.Provider,{value:v},r.createElement(p.Provider,{value:g},m)))))))},m=function(){return(0,r.useContext)(d)},g=function(e){var t=(0,r.useContext)(l);null!=t||(0,o.Z)(!1);var n=t[e];return null!=n||(0,o.Z)(!1),n},v=function(e){var t=(0,r.useContext)(s);null!=t||(0,o.Z)(!1);var n=t[e];return null!=n||(0,o.Z)(!1),n},y=function(){return(0,r.useContext)(c)},b=function(){return(0,r.useContext)(u)},x=function(){return(0,r.useContext)(p)},w=function(){return(0,r.useContext)(f)}},57165:function(e,t,n){"use strict";n.d(t,{H:function(){return $}});var r=n(2265);function o(){}function a(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function i(e){this._context=e}function l(e){this._context=e}function s(e){this._context=e}i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:a(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},l.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},s.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class c{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function u(e){this._context=e}function d(e){this._context=e}function f(e){return new d(e)}function p(e,t,n){var r=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(r||o<0&&-0),i=(n-e._y1)/(o||r<0&&-0);return((a<0?-1:1)+(i<0?-1:1))*Math.min(Math.abs(a),Math.abs(i),.5*Math.abs((a*o+i*r)/(r+o)))||0}function h(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function m(e,t,n){var r=e._x0,o=e._y0,a=e._x1,i=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,o+l*t,a-l,i-l*n,a,i)}function g(e){this._context=e}function v(e){this._context=new y(e)}function y(e){this._context=e}function b(e){this._context=e}function x(e){var t,n,r=e.length-1,o=Array(r),a=Array(r),i=Array(r);for(o[0]=0,a[0]=2,i[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,i[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,i[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=o[t]/a[t-1],a[t]-=n,i[t]-=n*i[t-1];for(o[r-1]=i[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(i[t]-o[t+1])/a[t];for(t=0,a[r-1]=(e[r]+o[r-1])/2;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function w(e,t){this._context=e,this._t=t}u.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:m(this,this._t0,h(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,m(this,h(this,n=p(this,e,t)),n);break;default:m(this,this._t0,n=p(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(v.prototype=Object.create(g.prototype)).point=function(e,t){g.prototype.point.call(this,t,e)},y.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,a){this._context.bezierCurveTo(t,e,r,n,a,o)}},b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=x(e),o=x(t),a=0,i=1;i<n;++a,++i)this._context.bezierCurveTo(r[0][a],o[0][a],r[1][a],o[1][a],e[i],t[i])}(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var k=n(22516),S=n(76115),E=n(67790);function O(e){return e[0]}function C(e){return e[1]}function j(e,t){var n=(0,S.Z)(!0),r=null,o=f,a=null,i=(0,E.d)(l);function l(l){var s,c,u,d=(l=(0,k.Z)(l)).length,f=!1;for(null==r&&(a=o(u=i())),s=0;s<=d;++s)!(s<d&&n(c=l[s],s,l))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(c,s,l),+t(c,s,l));if(u)return a=null,u+""||null}return e="function"==typeof e?e:void 0===e?O:(0,S.Z)(e),t="function"==typeof t?t:void 0===t?C:(0,S.Z)(t),l.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),l):e},l.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),l):t},l.defined=function(e){return arguments.length?(n="function"==typeof e?e:(0,S.Z)(!!e),l):n},l.curve=function(e){return arguments.length?(o=e,null!=r&&(a=o(r)),l):o},l.context=function(e){return arguments.length?(null==e?r=a=null:a=o(r=e),l):r},l}function _(e,t,n){var r=null,o=(0,S.Z)(!0),a=null,i=f,l=null,s=(0,E.d)(c);function c(c){var u,d,f,p,h,m=(c=(0,k.Z)(c)).length,g=!1,v=Array(m),y=Array(m);for(null==a&&(l=i(h=s())),u=0;u<=m;++u){if(!(u<m&&o(p=c[u],u,c))===g){if(g=!g)d=u,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),f=u-1;f>=d;--f)l.point(v[f],y[f]);l.lineEnd(),l.areaEnd()}}g&&(v[u]=+e(p,u,c),y[u]=+t(p,u,c),l.point(r?+r(p,u,c):v[u],n?+n(p,u,c):y[u]))}if(h)return l=null,h+""||null}function u(){return j().defined(o).curve(i).context(a)}return e="function"==typeof e?e:void 0===e?O:(0,S.Z)(+e),t="function"==typeof t?t:void 0===t?(0,S.Z)(0):(0,S.Z)(+t),n="function"==typeof n?n:void 0===n?C:(0,S.Z)(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:(0,S.Z)(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:(0,S.Z)(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(o="function"==typeof e?e:(0,S.Z)(!!e),c):o},c.curve=function(e){return arguments.length?(i=e,null!=a&&(l=i(a)),c):i},c.context=function(e){return arguments.length?(null==e?a=l=null:l=i(a=e),c):a},c}var P=n(75551),N=n.n(P),T=n(86757),A=n.n(T),M=n(87602),I=n(41637),R=n(82944),D=n(16630);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(){return(Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==L(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==L(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===L(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var F={curveBasisClosed:function(e){return new l(e)},curveBasisOpen:function(e){return new s(e)},curveBasis:function(e){return new i(e)},curveBumpX:function(e){return new c(e,!0)},curveBumpY:function(e){return new c(e,!1)},curveLinearClosed:function(e){return new u(e)},curveLinear:f,curveMonotoneX:function(e){return new g(e)},curveMonotoneY:function(e){return new v(e)},curveNatural:function(e){return new b(e)},curveStep:function(e){return new w(e,.5)},curveStepAfter:function(e){return new w(e,1)},curveStepBefore:function(e){return new w(e,0)}},H=function(e){return e.x===+e.x&&e.y===+e.y},q=function(e){return e.x},W=function(e){return e.y},U=function(e,t){if(A()(e))return e;var n="curve".concat(N()(e));return("curveMonotone"===n||"curveBump"===n)&&t?F["".concat(n).concat("vertical"===t?"Y":"X")]:F[n]||f},K=function(e){var t,n=e.type,r=e.points,o=void 0===r?[]:r,a=e.baseLine,i=e.layout,l=e.connectNulls,s=void 0!==l&&l,c=U(void 0===n?"linear":n,i),u=s?o.filter(function(e){return H(e)}):o;if(Array.isArray(a)){var d=s?a.filter(function(e){return H(e)}):a,f=u.map(function(e,t){return B(B({},e),{},{base:d[t]})});return(t="vertical"===i?_().y(W).x1(q).x0(function(e){return e.base.x}):_().x(q).y1(W).y0(function(e){return e.base.y})).defined(H).curve(c),t(f)}return(t="vertical"===i&&(0,D.hj)(a)?_().y(W).x1(q).x0(a):(0,D.hj)(a)?_().x(q).y1(W).y0(a):j().x(q).y(W)).defined(H).curve(c),t(u)},$=function(e){var t=e.className,n=e.points,o=e.path,a=e.pathRef;if((!n||!n.length)&&!o)return null;var i=n&&n.length?K(e):o;return r.createElement("path",Z({},(0,R.L6)(e,!1),(0,I.Ym)(e),{className:(0,M.Z)("recharts-curve",t),d:i,ref:a}))}},81889:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(2265),o=n(87602),a=n(41637),i=n(82944);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=function(e){var t=e.cx,n=e.cy,s=e.r,c=e.className,u=(0,o.Z)("recharts-dot",c);return t===+t&&n===+n&&s===+s?r.createElement("circle",l({},(0,i.L6)(e,!1),(0,a.Ym)(e),{className:u,cx:t,cy:n,r:s})):null}},73649:function(e,t,n){"use strict";n.d(t,{A:function(){return m},X:function(){return p}});var r=n(2265),o=n(87602),a=n(59221),i=n(82944);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e,t,n,r,o){var a,i=Math.min(Math.abs(n)/2,Math.abs(r)/2),l=r>=0?1:-1,s=n>=0?1:-1,c=r>=0&&n>=0||r<0&&n<0?1:0;if(i>0&&o instanceof Array){for(var u=[0,0,0,0],d=0;d<4;d++)u[d]=o[d]>i?i:o[d];a="M".concat(e,",").concat(t+l*u[0]),u[0]>0&&(a+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+s*u[0],",").concat(t)),a+="L ".concat(e+n-s*u[1],",").concat(t),u[1]>0&&(a+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,",\n ").concat(e+n,",").concat(t+l*u[1])),a+="L ".concat(e+n,",").concat(t+r-l*u[2]),u[2]>0&&(a+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,",\n ").concat(e+n-s*u[2],",").concat(t+r)),a+="L ".concat(e+s*u[3],",").concat(t+r),u[3]>0&&(a+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,",\n ").concat(e,",").concat(t+r-l*u[3])),a+="Z"}else if(i>0&&o===+o&&o>0){var f=Math.min(i,o);a="M ".concat(e,",").concat(t+l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+s*f,",").concat(t,"\n L ").concat(e+n-s*f,",").concat(t,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n,",").concat(t+l*f,"\n L ").concat(e+n,",").concat(t+r-l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n-s*f,",").concat(t+r,"\n L ").concat(e+s*f,",").concat(t+r,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e,",").concat(t+r-l*f," Z")}else a="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return a},p=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,o=t.x,a=t.y,i=t.width,l=t.height;return!!(Math.abs(i)>0&&Math.abs(l)>0)&&n>=Math.min(o,o+i)&&n<=Math.max(o,o+i)&&r>=Math.min(a,a+l)&&r<=Math.max(a,a+l)},h={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},m=function(e){var t,n=d(d({},h),e),l=(0,r.useRef)(),u=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(-1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,2)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=u[0],m=u[1];(0,r.useEffect)(function(){if(l.current&&l.current.getTotalLength)try{var e=l.current.getTotalLength();e&&m(e)}catch(e){}},[]);var g=n.x,v=n.y,y=n.width,b=n.height,x=n.radius,w=n.className,k=n.animationEasing,S=n.animationDuration,E=n.animationBegin,O=n.isAnimationActive,C=n.isUpdateAnimationActive;if(g!==+g||v!==+v||y!==+y||b!==+b||0===y||0===b)return null;var j=(0,o.Z)("recharts-rectangle",w);return C?r.createElement(a.ZP,{canBegin:p>0,from:{width:y,height:b,x:g,y:v},to:{width:y,height:b,x:g,y:v},duration:S,animationEasing:k,isActive:C},function(e){var t=e.width,o=e.height,c=e.x,u=e.y;return r.createElement(a.ZP,{canBegin:p>0,from:"0px ".concat(-1===p?1:p,"px"),to:"".concat(p,"px 0px"),attributeName:"strokeDasharray",begin:E,duration:S,isActive:O,easing:k},r.createElement("path",s({},(0,i.L6)(n,!0),{className:j,d:f(c,u,t,o,x),ref:l})))}):r.createElement("path",s({},(0,i.L6)(n,!0),{className:j,d:f(g,v,y,b,x)}))}},60474:function(e,t,n){"use strict";n.d(t,{L:function(){return g}});var r=n(2265),o=n(87602),a=n(82944),i=n(39206),l=n(16630);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e){var t=e.cx,n=e.cy,r=e.radius,o=e.angle,a=e.sign,l=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,u=s*(l?1:-1)+r,d=Math.asin(s/u)/i.Wk,f=c?o:o+a*d;return{center:(0,i.op)(t,n,u,f),circleTangency:(0,i.op)(t,n,r,f),lineTangency:(0,i.op)(t,n,u*Math.cos(d*i.Wk),c?o-a*d:o),theta:d}},p=function(e){var t,n=e.cx,r=e.cy,o=e.innerRadius,a=e.outerRadius,s=e.startAngle,c=(t=e.endAngle,(0,l.uY)(t-s)*Math.min(Math.abs(t-s),359.999)),u=s+c,d=(0,i.op)(n,r,a,s),f=(0,i.op)(n,r,a,u),p="M ".concat(d.x,",").concat(d.y,"\n A ").concat(a,",").concat(a,",0,\n ").concat(+(Math.abs(c)>180),",").concat(+(s>u),",\n ").concat(f.x,",").concat(f.y,"\n ");if(o>0){var h=(0,i.op)(n,r,o,s),m=(0,i.op)(n,r,o,u);p+="L ".concat(m.x,",").concat(m.y,"\n A ").concat(o,",").concat(o,",0,\n ").concat(+(Math.abs(c)>180),",").concat(+(s<=u),",\n ").concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(n,",").concat(r," Z");return p},h=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,i=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=(0,l.uY)(u-c),h=f({cx:t,cy:n,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),m=h.circleTangency,g=h.lineTangency,v=h.theta,y=f({cx:t,cy:n,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:s}),b=y.circleTangency,x=y.lineTangency,w=y.theta,k=s?Math.abs(c-u):Math.abs(c-u)-v-w;if(k<0)return i?"M ".concat(g.x,",").concat(g.y,"\n a").concat(a,",").concat(a,",0,0,1,").concat(2*a,",0\n a").concat(a,",").concat(a,",0,0,1,").concat(-(2*a),",0\n "):p({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:c,endAngle:u});var S="M ".concat(g.x,",").concat(g.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,"\n A").concat(o,",").concat(o,",0,").concat(+(k>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,"\n ");if(r>0){var E=f({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),O=E.circleTangency,C=E.lineTangency,j=E.theta,_=f({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),P=_.circleTangency,N=_.lineTangency,T=_.theta,A=s?Math.abs(c-u):Math.abs(c-u)-j-T;if(A<0&&0===a)return"".concat(S,"L").concat(t,",").concat(n,"Z");S+="L".concat(N.x,",").concat(N.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,"\n A").concat(r,",").concat(r,",0,").concat(+(A>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(C.x,",").concat(C.y,"Z")}else S+="L".concat(t,",").concat(n,"Z");return S},m={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},g=function(e){var t,n=d(d({},m),e),i=n.cx,s=n.cy,u=n.innerRadius,f=n.outerRadius,g=n.cornerRadius,v=n.forceCornerRadius,y=n.cornerIsExternal,b=n.startAngle,x=n.endAngle,w=n.className;if(f<u||b===x)return null;var k=(0,o.Z)("recharts-sector",w),S=f-u,E=(0,l.h1)(g,S,0,!0);return t=E>0&&360>Math.abs(b-x)?h({cx:i,cy:s,innerRadius:u,outerRadius:f,cornerRadius:Math.min(E,S/2),forceCornerRadius:v,cornerIsExternal:y,startAngle:b,endAngle:x}):p({cx:i,cy:s,innerRadius:u,outerRadius:f,startAngle:b,endAngle:x}),r.createElement("path",c({},(0,a.L6)(n,!0),{className:k,d:t,role:"img"}))}},14870:function(e,t,n){"use strict";n.d(t,{v:function(){return M}});var r=n(2265),o=n(75551),a=n.n(o);let i=Math.cos,l=Math.sin,s=Math.sqrt,c=Math.PI,u=2*c;var d={draw(e,t){let n=s(t/c);e.moveTo(n,0),e.arc(0,0,n,0,u)}};let f=s(1/3),p=2*f,h=l(c/10)/l(7*c/10),m=l(u/10)*h,g=-i(u/10)*h,v=s(3),y=s(3)/2,b=1/s(12),x=(b/2+1)*3;var w=n(76115),k=n(67790);s(3),s(3);var S=n(87602),E=n(82944);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var C=["type","size","sizeType"];function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==O(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==O(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===O(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var N={symbolCircle:d,symbolCross:{draw(e,t){let n=s(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},symbolDiamond:{draw(e,t){let n=s(t/p),r=n*f;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},symbolSquare:{draw(e,t){let n=s(t),r=-n/2;e.rect(r,r,n,n)}},symbolStar:{draw(e,t){let n=s(.8908130915292852*t),r=m*n,o=g*n;e.moveTo(0,-n),e.lineTo(r,o);for(let t=1;t<5;++t){let a=u*t/5,s=i(a),c=l(a);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*o,c*r+s*o)}e.closePath()}},symbolTriangle:{draw(e,t){let n=-s(t/(3*v));e.moveTo(0,2*n),e.lineTo(-v*n,-n),e.lineTo(v*n,-n),e.closePath()}},symbolWye:{draw(e,t){let n=s(t/x),r=n/2,o=n*b,a=n*b+n,i=-r;e.moveTo(r,o),e.lineTo(r,a),e.lineTo(i,a),e.lineTo(-.5*r-y*o,y*r+-.5*o),e.lineTo(-.5*r-y*a,y*r+-.5*a),e.lineTo(-.5*i-y*a,y*i+-.5*a),e.lineTo(-.5*r+y*o,-.5*o-y*r),e.lineTo(-.5*r+y*a,-.5*a-y*r),e.lineTo(-.5*i+y*a,-.5*a-y*i),e.closePath()}}},T=Math.PI/180,A=function(e,t,n){if("area"===t)return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var r=18*T;return 1.25*e*e*(Math.tan(r)-Math.tan(2*r)*Math.pow(Math.tan(r),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},M=function(e){var t,n=e.type,o=void 0===n?"circle":n,i=e.size,l=void 0===i?64:i,s=e.sizeType,c=void 0===s?"area":s,u=P(P({},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,C)),{},{type:o,size:l,sizeType:c}),f=u.className,p=u.cx,h=u.cy,m=(0,E.L6)(u,!0);return p===+p&&h===+h&&l===+l?r.createElement("path",j({},m,{className:(0,S.Z)("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(h,")"),d:(t=N["symbol".concat(a()(o))]||d,(function(e,t){let n=null,r=(0,k.d)(o);function o(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return e="function"==typeof e?e:(0,w.Z)(e||d),t="function"==typeof t?t:(0,w.Z)(void 0===t?64:+t),o.type=function(t){return arguments.length?(e="function"==typeof t?t:(0,w.Z)(t),o):e},o.size=function(e){return arguments.length?(t="function"==typeof e?e:(0,w.Z)(+e),o):t},o.context=function(e){return arguments.length?(n=null==e?null:e,o):n},o})().type(t).size(A(l,c,o))())})):null};M.registerSymbol=function(e,t){N["symbol".concat(a()(e))]=t}},11638:function(e,t,n){"use strict";n.d(t,{bn:function(){return A},a3:function(){return z},lT:function(){return M},V$:function(){return I},w7:function(){return R}});var r=n(2265),o=n(86757),a=n.n(o),i=n(90231),l=n.n(i),s=n(24342),c=n.n(s),u=n(21652),d=n.n(u),f=n(73649),p=n(87602),h=n(59221),m=n(82944);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(){return(v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var w=function(e,t,n,r,o){var a=n-r;return"M ".concat(e,",").concat(t)+"L ".concat(e+n,",").concat(t)+"L ".concat(e+n-a/2,",").concat(t+o)+"L ".concat(e+n-a/2-r,",").concat(t+o)+"L ".concat(e,",").concat(t," Z")},k={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},S=function(e){var t,n=x(x({},k),e),o=(0,r.useRef)(),a=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(-1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,2)||function(e,t){if(e){if("string"==typeof e)return y(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],l=a[1];(0,r.useEffect)(function(){if(o.current&&o.current.getTotalLength)try{var e=o.current.getTotalLength();e&&l(e)}catch(e){}},[]);var s=n.x,c=n.y,u=n.upperWidth,d=n.lowerWidth,f=n.height,g=n.className,b=n.animationEasing,S=n.animationDuration,E=n.animationBegin,O=n.isUpdateAnimationActive;if(s!==+s||c!==+c||u!==+u||d!==+d||f!==+f||0===u&&0===d||0===f)return null;var C=(0,p.Z)("recharts-trapezoid",g);return O?r.createElement(h.ZP,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:f,x:s,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:s,y:c},duration:S,animationEasing:b,isActive:O},function(e){var t=e.upperWidth,a=e.lowerWidth,l=e.height,s=e.x,c=e.y;return r.createElement(h.ZP,{canBegin:i>0,from:"0px ".concat(-1===i?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:E,duration:S,easing:b},r.createElement("path",v({},(0,m.L6)(n,!0),{className:C,d:w(s,c,t,a,l),ref:o})))}):r.createElement("g",null,r.createElement("path",v({},(0,m.L6)(n,!0),{className:C,d:w(s,c,u,d,f)})))},E=n(60474),O=n(9841),C=n(14870),j=["option","shapeType","propTransformer","activeClassName","isActive"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return r.createElement(f.A,n);case"trapezoid":return r.createElement(S,n);case"sector":return r.createElement(E.L,n);case"symbols":if("symbols"===t)return r.createElement(C.v,n);break;default:return null}}function A(e){var t,n=e.option,o=e.shapeType,i=e.propTransformer,s=e.activeClassName,u=e.isActive,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,j);if((0,r.isValidElement)(n))t=(0,r.cloneElement)(n,N(N({},d),(0,r.isValidElement)(n)?n.props:n));else if(a()(n))t=n(d);else if(l()(n)&&!c()(n)){var f=(void 0===i?function(e,t){return N(N({},t),e)}:i)(n,d);t=r.createElement(T,{shapeType:o,elementProps:f})}else t=r.createElement(T,{shapeType:o,elementProps:d});return u?r.createElement(O.m,{className:void 0===s?"recharts-active-shape":s},t):t}function M(e,t){return null!=t&&"trapezoids"in e.props}function I(e,t){return null!=t&&"sectors"in e.props}function R(e,t){return null!=t&&"points"in e.props}function D(e,t){var n,r,o=e.x===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.x)||e.x===t.x,a=e.y===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.y)||e.y===t.y;return o&&a}function L(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Z(e,t){var n=e.x===t.x,r=e.y===t.y,o=e.z===t.z;return n&&r&&o}function z(e){var t,n,r,o=e.activeTooltipItem,a=e.graphicalItem,i=e.itemData,l=(M(a,o)?t="trapezoids":I(a,o)?t="sectors":R(a,o)&&(t="points"),t),s=M(a,o)?null===(n=o.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:I(a,o)?null===(r=o.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:R(a,o)?o.payload:{},c=i.filter(function(e,t){var n=d()(s,e),r=a.props[l].filter(function(e){var t;return(M(a,o)?t=D:I(a,o)?t=L:R(a,o)&&(t=Z),t)(e,o)}),i=a.props[l].indexOf(r[r.length-1]);return n&&t===i});return i.indexOf(c[c.length-1])}},25311:function(e,t,n){"use strict";n.d(t,{Ky:function(){return w},O1:function(){return y},_b:function(){return b},t9:function(){return v},xE:function(){return k}});var r=n(41443),o=n.n(r),a=n(32242),i=n.n(a),l=n(85355),s=n(82944),c=n(16630),u=n(31699);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var v=function(e,t,n,r,o){var a=e.width,i=e.height,d=e.layout,f=e.children,p=Object.keys(t),g={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:i-n.bottom,bottomMirror:i-n.bottom},v=!!(0,s.sP)(f,u.$);return p.reduce(function(a,i){var s,u,f,p,y,b=t[i],x=b.orientation,w=b.domain,k=b.padding,S=void 0===k?{}:k,E=b.mirror,O=b.reversed,C="".concat(x).concat(E?"Mirror":"");if("number"===b.type&&("gap"===b.padding||"no-gap"===b.padding)){var j=w[1]-w[0],_=1/0,P=b.categoricalDomain.sort();P.forEach(function(e,t){t>0&&(_=Math.min((e||0)-(P[t-1]||0),_))});var N=_/j,T="vertical"===b.layout?n.height:n.width;if("gap"===b.padding&&(s=N*T/2),"no-gap"===b.padding){var A=(0,c.h1)(e.barCategoryGap,N*T),M=N*T/2;s=M-A-(M-A)/T*A}}u="xAxis"===r?[n.left+(S.left||0)+(s||0),n.left+n.width-(S.right||0)-(s||0)]:"yAxis"===r?"horizontal"===d?[n.top+n.height-(S.bottom||0),n.top+(S.top||0)]:[n.top+(S.top||0)+(s||0),n.top+n.height-(S.bottom||0)-(s||0)]:b.range,O&&(u=[u[1],u[0]]);var I=(0,l.Hq)(b,o,v),R=I.scale,D=I.realScaleType;R.domain(w).range(u),(0,l.zF)(R);var L=(0,l.g$)(R,h(h({},b),{},{realScaleType:D}));"xAxis"===r?(y="top"===x&&!E||"bottom"===x&&E,f=n.left,p=g[C]-y*b.height):"yAxis"===r&&(y="left"===x&&!E||"right"===x&&E,f=g[C]-y*b.width,p=n.top);var Z=h(h(h({},b),L),{},{realScaleType:D,x:f,y:p,scale:R,width:"xAxis"===r?n.width:b.width,height:"yAxis"===r?n.height:b.height});return Z.bandSize=(0,l.zT)(Z,L),b.hide||"xAxis"!==r?b.hide||(g[C]+=(y?-1:1)*Z.width):g[C]+=(y?-1:1)*Z.height,h(h({},a),{},m({},i,Z))},{})},y=function(e,t){var n=e.x,r=e.y,o=t.x,a=t.y;return{x:Math.min(n,o),y:Math.min(r,a),width:Math.abs(o-n),height:Math.abs(a-r)}},b=function(e){return y({x:e.x1,y:e.y1},{x:e.x2,y:e.y2})},x=function(){var e,t;function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this.scale=e}return e=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=t.position;if(void 0!==e){if(r)switch(r){case"start":default:return this.scale(e);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o;case"end":var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a}if(n){var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],t=[{key:"create",value:function(e){return new n(e)}}],e&&f(n.prototype,e),t&&f(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();m(x,"EPS",1e-4);var w=function(e){var t=Object.keys(e).reduce(function(t,n){return h(h({},t),{},m({},n,x.create(e[n])))},{});return h(h({},t),{},{apply:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware,a=n.position;return o()(e,function(e,n){return t[n].apply(e,{bandAware:r,position:a})})},isInRange:function(e){return i()(e,function(e,n){return t[n].isInRange(e)})}})},k=function(e){var t=e.width,n=e.height,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(r%180+180)%180*Math.PI/180,a=Math.atan(n/t);return Math.abs(o>a&&o<Math.PI-a?n/Math.sin(o):t/Math.cos(o))}},85355:function(e,t,n){"use strict";n.d(t,{By:function(){return r4},VO:function(){return r0},zF:function(){return oo},DO:function(){return on},Bu:function(){return oa},zT:function(){return ob},qz:function(){return r6},pt:function(){return r2},Yj:function(){return op},Fy:function(){return of},Hv:function(){return od},Rf:function(){return r9},gF:function(){return rJ},s6:function(){return r8},EB:function(){return om},fk:function(){return r1},wh:function(){return oc},O3:function(){return oh},uY:function(){return oe},g$:function(){return ou},Qo:function(){return ow},F$:function(){return rQ},NA:function(){return r7},ko:function(){return ox},ZI:function(){return r5},Hq:function(){return or},LG:function(){return oy},Vv:function(){return oi}});var r,o,a,i,l,s,c,u={};n.r(u),n.d(u,{scaleBand:function(){return d.Z},scaleDiverging:function(){return function e(){var t=eR(nQ()(eg));return t.copy=function(){return nX(t,e())},eS.O.apply(t,arguments)}},scaleDivergingLog:function(){return function e(){var t=eW(nQ()).domain([.1,1,10]);return t.copy=function(){return nX(t,e()).base(t.base())},eS.O.apply(t,arguments)}},scaleDivergingPow:function(){return nJ},scaleDivergingSqrt:function(){return n0},scaleDivergingSymlog:function(){return function e(){var t=e$(nQ());return t.copy=function(){return nX(t,e()).constant(t.constant())},eS.O.apply(t,arguments)}},scaleIdentity:function(){return function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,eh),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,eh):[0,1],eR(r)}},scaleImplicit:function(){return eV.O},scaleLinear:function(){return eD},scaleLog:function(){return function e(){let t=eW(ew()).domain([1,10]);return t.copy=()=>ex(t,e()).base(t.base()),eS.o.apply(t,arguments),t}},scaleOrdinal:function(){return eV.Z},scalePoint:function(){return d.x},scalePow:function(){return eJ},scaleQuantile:function(){return function e(){var t,n=[],r=[],o=[];function a(){var e=0,t=Math.max(1,r.length);for(o=Array(t-1);++e<t;)o[e-1]=function(e,t,n=S){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,a=Math.floor(o),i=+n(e[a],a,e);return i+(+n(e[a+1],a+1,e)-i)*(o-a)}}(n,e/t);return i}function i(e){return null==e||isNaN(e=+e)?t:r[O(o,e)]}return i.invertExtent=function(e){var t=r.indexOf(e);return t<0?[NaN,NaN]:[t>0?o[t-1]:n[0],t<o.length?o[t]:n[n.length-1]]},i.domain=function(e){if(!arguments.length)return n.slice();for(let t of(n=[],e))null==t||isNaN(t=+t)||n.push(t);return n.sort(b),a()},i.range=function(e){return arguments.length?(r=Array.from(e),a()):r.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return o.slice()},i.copy=function(){return e().domain(n).range(r).unknown(t)},eS.o.apply(i,arguments)}},scaleQuantize:function(){return function e(){var t,n=0,r=1,o=1,a=[.5],i=[0,1];function l(e){return null!=e&&e<=e?i[O(a,e,0,o)]:t}function s(){var e=-1;for(a=Array(o);++e<o;)a[e]=((e+1)*r-(e-o)*n)/(o+1);return l}return l.domain=function(e){return arguments.length?([n,r]=e,n=+n,r=+r,s()):[n,r]},l.range=function(e){return arguments.length?(o=(i=Array.from(e)).length-1,s()):i.slice()},l.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,a[0]]:t>=o?[a[o-1],r]:[a[t-1],a[t]]},l.unknown=function(e){return arguments.length&&(t=e),l},l.thresholds=function(){return a.slice()},l.copy=function(){return e().domain([n,r]).range(i).unknown(t)},eS.o.apply(eR(l),arguments)}},scaleRadial:function(){return function e(){var t,n=ek(),r=[0,1],o=!1;function a(e){var r,a=Math.sign(r=n(e))*Math.sqrt(Math.abs(r));return isNaN(a)?t:o?Math.round(a):a}return a.invert=function(e){return n.invert(e1(e))},a.domain=function(e){return arguments.length?(n.domain(e),a):n.domain()},a.range=function(e){return arguments.length?(n.range((r=Array.from(e,eh)).map(e1)),a):r.slice()},a.rangeRound=function(e){return a.range(e).round(!0)},a.round=function(e){return arguments.length?(o=!!e,a):o},a.clamp=function(e){return arguments.length?(n.clamp(e),a):n.clamp()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e(n.domain(),r).round(o).clamp(n.clamp()).unknown(t)},eS.o.apply(a,arguments),eR(a)}},scaleSequential:function(){return function e(){var t=eR(nV()(eg));return t.copy=function(){return nX(t,e())},eS.O.apply(t,arguments)}},scaleSequentialLog:function(){return function e(){var t=eW(nV()).domain([1,10]);return t.copy=function(){return nX(t,e()).base(t.base())},eS.O.apply(t,arguments)}},scaleSequentialPow:function(){return nG},scaleSequentialQuantile:function(){return function e(){var t=[],n=eg;function r(e){if(null!=e&&!isNaN(e=+e))return n((O(t,e,1)-1)/(t.length-1))}return r.domain=function(e){if(!arguments.length)return t.slice();for(let n of(t=[],e))null==n||isNaN(n=+n)||t.push(n);return t.sort(b),r},r.interpolator=function(e){return arguments.length?(n=e,r):n},r.range=function(){return t.map((e,r)=>n(r/(t.length-1)))},r.quantiles=function(e){return Array.from({length:e+1},(n,r)=>(function(e,t,n){if(!(!(r=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,void 0))).length)||isNaN(t=+t))){if(t<=0||r<2)return e6(e);if(t>=1)return e2(e);var r,o=(r-1)*t,a=Math.floor(o),i=e2((function e(t,n,r=0,o=1/0,a){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),o=Math.floor(Math.min(t.length-1,o)),!(r<=n&&n<=o))return t;for(a=void 0===a?e4:function(e=b){if(e===b)return e4;if("function"!=typeof e)throw TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(a);o>r;){if(o-r>600){let i=o-r+1,l=n-r+1,s=Math.log(i),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(i-c)/i)*(l-i/2<0?-1:1),d=Math.max(r,Math.floor(n-l*c/i+u)),f=Math.min(o,Math.floor(n+(i-l)*c/i+u));e(t,n,d,f,a)}let i=t[n],l=r,s=o;for(e3(t,r,n),a(t[o],i)>0&&e3(t,r,o);l<s;){for(e3(t,l,s),++l,--s;0>a(t[l],i);)++l;for(;a(t[s],i)>0;)--s}0===a(t[r],i)?e3(t,r,s):e3(t,++s,o),s<=n&&(r=s+1),n<=s&&(o=s-1)}return t})(e,a).subarray(0,a+1));return i+(e6(e.subarray(a+1))-i)*(o-a)}})(t,r/e))},r.copy=function(){return e(n).domain(t)},eS.O.apply(r,arguments)}},scaleSequentialSqrt:function(){return nY},scaleSequentialSymlog:function(){return function e(){var t=e$(nV());return t.copy=function(){return nX(t,e()).constant(t.constant())},eS.O.apply(t,arguments)}},scaleSqrt:function(){return e0},scaleSymlog:function(){return function e(){var t=e$(ew());return t.copy=function(){return ex(t,e()).constant(t.constant())},eS.o.apply(t,arguments)}},scaleThreshold:function(){return function e(){var t,n=[.5],r=[0,1],o=1;function a(e){return null!=e&&e<=e?r[O(n,e,0,o)]:t}return a.domain=function(e){return arguments.length?(o=Math.min((n=Array.from(e)).length,r.length-1),a):n.slice()},a.range=function(e){return arguments.length?(r=Array.from(e),o=Math.min(n.length,r.length-1),a):r.slice()},a.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e().domain(n).range(r).unknown(t)},eS.o.apply(a,arguments)}},scaleTime:function(){return nK},scaleUtc:function(){return n$},tickFormat:function(){return eI}});var d=n(55284);let f=Math.sqrt(50),p=Math.sqrt(10),h=Math.sqrt(2);function m(e,t,n){let r,o,a;let i=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(i)),s=i/Math.pow(10,l),c=s>=f?10:s>=p?5:s>=h?2:1;return(l<0?(r=Math.round(e*(a=Math.pow(10,-l)/c)),o=Math.round(t*a),r/a<e&&++r,o/a>t&&--o,a=-a):(r=Math.round(e/(a=Math.pow(10,l)*c)),o=Math.round(t/a),r*a<e&&++r,o*a>t&&--o),o<r&&.5<=n&&n<2)?m(e,t,2*n):[r,o,a]}function g(e,t,n){if(t=+t,e=+e,!((n=+n)>0))return[];if(e===t)return[e];let r=t<e,[o,a,i]=r?m(t,e,n):m(e,t,n);if(!(a>=o))return[];let l=a-o+1,s=Array(l);if(r){if(i<0)for(let e=0;e<l;++e)s[e]=-((a-e)/i);else for(let e=0;e<l;++e)s[e]=(a-e)*i}else if(i<0)for(let e=0;e<l;++e)s[e]=-((o+e)/i);else for(let e=0;e<l;++e)s[e]=(o+e)*i;return s}function v(e,t,n){return m(e=+e,t=+t,n=+n)[2]}function y(e,t,n){t=+t,e=+e,n=+n;let r=t<e,o=r?v(t,e,n):v(e,t,n);return(r?-1:1)*(o<0?-(1/o):o)}function b(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function x(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function w(e){let t,n,r;function o(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>n(e[t],r)?o=t+1:a=t}while(o<a)}return o}return 2!==e.length?(t=b,n=(t,n)=>b(e(t),n),r=(t,n)=>e(t)-n):(t=e===b||e===x?e:k,n=e,r=e),{left:o,center:function(e,t,n=0,a=e.length){let i=o(e,t,n,a-1);return i>n&&r(e[i-1],t)>-r(e[i],t)?i-1:i},right:function(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>=n(e[t],r)?o=t+1:a=t}while(o<a)}return o}}}function k(){return 0}function S(e){return null===e?NaN:+e}let E=w(b),O=E.right;function C(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function j(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _(){}E.left,w(S).center;var P="\\s*([+-]?\\d+)\\s*",N="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",T="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A=/^#([0-9a-f]{3,8})$/,M=RegExp(`^rgb\\(${P},${P},${P}\\)$`),I=RegExp(`^rgb\\(${T},${T},${T}\\)$`),R=RegExp(`^rgba\\(${P},${P},${P},${N}\\)$`),D=RegExp(`^rgba\\(${T},${T},${T},${N}\\)$`),L=RegExp(`^hsl\\(${N},${T},${T}\\)$`),Z=RegExp(`^hsla\\(${N},${T},${T},${N}\\)$`),z={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function B(){return this.rgb().formatHex()}function F(){return this.rgb().formatRgb()}function H(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=A.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?q(t):3===n?new K(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?W(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?W(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=M.exec(e))?new K(t[1],t[2],t[3],1):(t=I.exec(e))?new K(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=R.exec(e))?W(t[1],t[2],t[3],t[4]):(t=D.exec(e))?W(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=L.exec(e))?Q(t[1],t[2]/100,t[3]/100,1):(t=Z.exec(e))?Q(t[1],t[2]/100,t[3]/100,t[4]):z.hasOwnProperty(e)?q(z[e]):"transparent"===e?new K(NaN,NaN,NaN,0):null}function q(e){return new K(e>>16&255,e>>8&255,255&e,1)}function W(e,t,n,r){return r<=0&&(e=t=n=NaN),new K(e,t,n,r)}function U(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof _||(o=H(o)),o)?new K((o=o.rgb()).r,o.g,o.b,o.opacity):new K:new K(e,t,n,null==r?1:r)}function K(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function $(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}`}function V(){let e=X(this.opacity);return`${1===e?"rgb(":"rgba("}${G(this.r)}, ${G(this.g)}, ${G(this.b)}${1===e?")":`, ${e})`}`}function X(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function G(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Y(e){return((e=G(e))<16?"0":"")+e.toString(16)}function Q(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ee(e,t,n,r)}function J(e){if(e instanceof ee)return new ee(e.h,e.s,e.l,e.opacity);if(e instanceof _||(e=H(e)),!e)return new ee;if(e instanceof ee)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,l=a-o,s=(a+o)/2;return l?(i=t===a?(n-r)/l+(n<r)*6:n===a?(r-t)/l+2:(t-n)/l+4,l/=s<.5?a+o:2-a-o,i*=60):l=s>0&&s<1?0:i,new ee(i,l,s,e.opacity)}function ee(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function et(e){return(e=(e||0)%360)<0?e+360:e}function en(e){return Math.max(0,Math.min(1,e||0))}function er(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function eo(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}C(_,H,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:B,formatHex:B,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return J(this).formatHsl()},formatRgb:F,toString:F}),C(K,U,j(_,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new K(G(this.r),G(this.g),G(this.b),X(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$,formatHex:$,formatHex8:function(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}${Y((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:V,toString:V})),C(ee,function(e,t,n,r){return 1==arguments.length?J(e):new ee(e,t,n,null==r?1:r)},j(_,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ee(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new K(er(e>=240?e-240:e+120,o,r),er(e,o,r),er(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ee(et(this.h),en(this.s),en(this.l),X(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=X(this.opacity);return`${1===e?"hsl(":"hsla("}${et(this.h)}, ${100*en(this.s)}%, ${100*en(this.l)}%${1===e?")":`, ${e})`}`}}));var ea=e=>()=>e;function ei(e,t){var n=t-e;return n?function(t){return e+t*n}:ea(isNaN(e)?t:e)}var el=function e(t){var n,r=1==(n=+(n=t))?ei:function(e,t){var r,o,a;return t-e?(r=e,o=t,r=Math.pow(r,a=n),o=Math.pow(o,a)-r,a=1/a,function(e){return Math.pow(r+e*o,a)}):ea(isNaN(e)?t:e)};function o(e,t){var n=r((e=U(e)).r,(t=U(t)).r),o=r(e.g,t.g),a=r(e.b,t.b),i=ei(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function es(e){return function(t){var n,r,o=t.length,a=Array(o),i=Array(o),l=Array(o);for(n=0;n<o;++n)r=U(t[n]),a[n]=r.r||0,i[n]=r.g||0,l[n]=r.b||0;return a=e(a),i=e(i),l=e(l),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=l(e),r+""}}}function ec(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}es(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,l=r<t-1?e[r+2]:2*a-o;return eo((n-r/t)*t,i,o,a,l)}}),es(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],l=e[(r+2)%t];return eo((n-r/t)*t,o,a,i,l)}});var eu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ed=RegExp(eu.source,"g");function ef(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?ea(t):("number"===o?ec:"string"===o?(r=H(t))?(t=r,el):function(e,t){var n,r,o,a,i,l=eu.lastIndex=ed.lastIndex=0,s=-1,c=[],u=[];for(e+="",t+="";(o=eu.exec(e))&&(a=ed.exec(t));)(i=a.index)>l&&(i=t.slice(l,i),c[s]?c[s]+=i:c[++s]=i),(o=o[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,u.push({i:s,x:ec(o,a)})),l=ed.lastIndex;return l<t.length&&(i=t.slice(l),c[s]?c[s]+=i:c[++s]=i),c.length<2?u[0]?(n=u[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=u.length,function(e){for(var n,r=0;r<t;++r)c[(n=u[r]).i]=n.x(e);return c.join("")})}:t instanceof H?el:t instanceof Date?function(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=Array(o),i=Array(r);for(n=0;n<o;++n)a[n]=ef(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=ef(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:ec:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}})(e,t)}function ep(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function eh(e){return+e}var em=[0,1];function eg(e){return e}function ev(e,t){var n;return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n})}function ey(e,t,n){var r=e[0],o=e[1],a=t[0],i=t[1];return o<r?(r=ev(o,r),a=n(i,a)):(r=ev(r,o),a=n(a,i)),function(e){return a(r(e))}}function eb(e,t,n){var r=Math.min(e.length,t.length)-1,o=Array(r),a=Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)o[i]=ev(e[i],e[i+1]),a[i]=n(t[i],t[i+1]);return function(t){var n=O(e,t,1,r)-1;return a[n](o[n](t))}}function ex(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ew(){var e,t,n,r,o,a,i=em,l=em,s=ef,c=eg;function u(){var e,t,n,s=Math.min(i.length,l.length);return c!==eg&&(e=i[0],t=i[s-1],e>t&&(n=e,e=t,t=n),c=function(n){return Math.max(e,Math.min(t,n))}),r=s>2?eb:ey,o=a=null,d}function d(t){return null==t||isNaN(t=+t)?n:(o||(o=r(i.map(e),l,s)))(e(c(t)))}return d.invert=function(n){return c(t((a||(a=r(l,i.map(e),ec)))(n)))},d.domain=function(e){return arguments.length?(i=Array.from(e,eh),u()):i.slice()},d.range=function(e){return arguments.length?(l=Array.from(e),u()):l.slice()},d.rangeRound=function(e){return l=Array.from(e),s=ep,u()},d.clamp=function(e){return arguments.length?(c=!!e||eg,u()):c!==eg},d.interpolate=function(e){return arguments.length?(s=e,u()):s},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function ek(){return ew()(eg,eg)}var eS=n(89999),eE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eO(e){var t;if(!(t=eE.exec(e)))throw Error("invalid format: "+e);return new eC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function eC(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ej(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function e_(e){return(e=ej(Math.abs(e)))?e[1]:NaN}function eP(e,t){var n=ej(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+Array(o-r.length+2).join("0")}eO.prototype=eC.prototype,eC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var eN={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eP(100*e,t),r:eP,s:function(e,t){var n=ej(e,t);if(!n)return e+"";var o=n[0],a=n[1],i=a-(r=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,l=o.length;return i===l?o:i>l?o+Array(i-l+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+Array(1-i).join("0")+ej(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function eT(e){return e}var eA=Array.prototype.map,eM=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function eI(e,t,n,r){var o,l,s=y(e,t,n);switch((r=eO(null==r?",f":r)).type){case"s":var c=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(l=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(e_(c)/3)))-e_(Math.abs(s))))||(r.precision=l),i(r,c);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(l=Math.max(0,e_(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(o=Math.abs(o=s)))-e_(o))+1)||(r.precision=l-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(l=Math.max(0,-e_(Math.abs(s))))||(r.precision=l-("%"===r.type)*2)}return a(r)}function eR(e){var t=e.domain;return e.ticks=function(e){var n=t();return g(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return eI(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,a=t(),i=0,l=a.length-1,s=a[i],c=a[l],u=10;for(c<s&&(o=s,s=c,c=o,o=i,i=l,l=o);u-- >0;){if((o=v(s,c,n))===r)return a[i]=s,a[l]=c,t(a);if(o>0)s=Math.floor(s/o)*o,c=Math.ceil(c/o)*o;else if(o<0)s=Math.ceil(s*o)/o,c=Math.floor(c*o)/o;else break;r=o}return e},e}function eD(){var e=ek();return e.copy=function(){return ex(e,eD())},eS.o.apply(e,arguments),eR(e)}function eL(e,t){e=e.slice();var n,r=0,o=e.length-1,a=e[r],i=e[o];return i<a&&(n=r,r=o,o=n,n=a,a=i,i=n),e[r]=t.floor(a),e[o]=t.ceil(i),e}function eZ(e){return Math.log(e)}function ez(e){return Math.exp(e)}function eB(e){return-Math.log(-e)}function eF(e){return-Math.exp(-e)}function eH(e){return isFinite(e)?+("1e"+e):e<0?0:e}function eq(e){return(t,n)=>-e(-t,n)}function eW(e){let t,n;let r=e(eZ,ez),o=r.domain,i=10;function l(){var a,l;return t=(a=i)===Math.E?Math.log:10===a&&Math.log10||2===a&&Math.log2||(a=Math.log(a),e=>Math.log(e)/a),n=10===(l=i)?eH:l===Math.E?Math.exp:e=>Math.pow(l,e),o()[0]<0?(t=eq(t),n=eq(n),e(eB,eF)):e(eZ,ez),r}return r.base=function(e){return arguments.length?(i=+e,l()):i},r.domain=function(e){return arguments.length?(o(e),l()):o()},r.ticks=e=>{let r,a;let l=o(),s=l[0],c=l[l.length-1],u=c<s;u&&([s,c]=[c,s]);let d=t(s),f=t(c),p=null==e?10:+e,h=[];if(!(i%1)&&f-d<p){if(d=Math.floor(d),f=Math.ceil(f),s>0){for(;d<=f;++d)for(r=1;r<i;++r)if(!((a=d<0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}}else for(;d<=f;++d)for(r=i-1;r>=1;--r)if(!((a=d>0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}2*h.length<p&&(h=g(s,c,p))}else h=g(d,f,Math.min(f-d,p)).map(n);return u?h.reverse():h},r.tickFormat=(e,o)=>{if(null==e&&(e=10),null==o&&(o=10===i?"s":","),"function"!=typeof o&&(i%1||null!=(o=eO(o)).precision||(o.trim=!0),o=a(o)),e===1/0)return o;let l=Math.max(1,i*e/r.ticks().length);return e=>{let r=e/n(Math.round(t(e)));return r*i<i-.5&&(r*=i),r<=l?o(e):""}},r.nice=()=>o(eL(o(),{floor:e=>n(Math.floor(t(e))),ceil:e=>n(Math.ceil(t(e)))})),r}function eU(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function eK(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function e$(e){var t=1,n=e(eU(1),eK(t));return n.constant=function(n){return arguments.length?e(eU(t=+n),eK(t)):t},eR(n)}a=(o=function(e){var t,n,o,a=void 0===e.grouping||void 0===e.thousands?eT:(t=eA.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,a=[],i=0,l=t[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),a.push(e.substring(o-=l,o+l)),!((s+=l+1)>r));)l=t[i=(i+1)%t.length];return a.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",l=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",c=void 0===e.numerals?eT:(o=eA.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return o[+e]})}),u=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"−":e.minus+"",f=void 0===e.nan?"NaN":e.nan+"";function p(e){var t=(e=eO(e)).fill,n=e.align,o=e.sign,p=e.symbol,h=e.zero,m=e.width,g=e.comma,v=e.precision,y=e.trim,b=e.type;"n"===b?(g=!0,b="g"):eN[b]||(void 0===v&&(v=12),y=!0,b="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var x="$"===p?i:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===p?l:/[%p]/.test(b)?u:"",k=eN[b],S=/[defgprs%]/.test(b);function E(e){var i,l,u,p=x,E=w;if("c"===b)E=k(e)+E,e="";else{var O=(e=+e)<0||1/e<0;if(e=isNaN(e)?f:k(Math.abs(e),v),y&&(e=function(e){t:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break t;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),O&&0==+e&&"+"!==o&&(O=!1),p=(O?"("===o?o:d:"-"===o||"("===o?"":o)+p,E=("s"===b?eM[8+r/3]:"")+E+(O&&"("===o?")":""),S){for(i=-1,l=e.length;++i<l;)if(48>(u=e.charCodeAt(i))||u>57){E=(46===u?s+e.slice(i+1):e.slice(i))+E,e=e.slice(0,i);break}}}g&&!h&&(e=a(e,1/0));var C=p.length+e.length+E.length,j=C<m?Array(m-C+1).join(t):"";switch(g&&h&&(e=a(j+e,j.length?m-E.length:1/0),j=""),n){case"<":e=p+e+E+j;break;case"=":e=p+j+e+E;break;case"^":e=j.slice(0,C=j.length>>1)+p+e+E+j.slice(C);break;default:e=j+p+e+E}return c(e)}return v=void 0===v?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),E.toString=function(){return e+""},E}return{format:p,formatPrefix:function(e,t){var n=p(((e=eO(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(e_(t)/3))),o=Math.pow(10,-r),a=eM[8+r/3];return function(e){return n(o*e)+a}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,i=o.formatPrefix;var eV=n(36967);function eX(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function eG(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function eY(e){return e<0?-e*e:e*e}function eQ(e){var t=e(eg,eg),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(eg,eg):.5===n?e(eG,eY):e(eX(n),eX(1/n)):n},eR(t)}function eJ(){var e=eQ(ew());return e.copy=function(){return ex(e,eJ()).exponent(e.exponent())},eS.o.apply(e,arguments),e}function e0(){return eJ.apply(null,arguments).exponent(.5)}function e1(e){return Math.sign(e)*e*e}function e2(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function e6(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function e4(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function e3(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}let e5=new Date,e8=new Date;function e7(e,t,n,r){function o(t){return e(t=0==arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{let t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,r,a)=>{let i;let l=[];if(n=o.ceil(n),a=null==a?1:Math.floor(a),!(n<r)||!(a>0))return l;do l.push(i=new Date(+n)),t(n,a),e(n);while(i<n&&n<r);return l},o.filter=n=>e7(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(o.count=(t,r)=>(e5.setTime(+t),e8.setTime(+r),e(e5),e(e8),Math.floor(n(e5,e8))),o.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?o.filter(r?t=>r(t)%e==0:t=>o.count(0,t)%e==0):o:null),o}let e9=e7(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);e9.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?e7(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):e9:null,e9.range;let te=e7(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());te.range;let tt=e7(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());tt.range;let tn=e7(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());tn.range;let tr=e7(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getHours());tr.range;let to=e7(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());to.range;let ta=e7(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);ta.range;let ti=e7(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);ti.range;let tl=e7(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));function ts(e){return e7(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}tl.range;let tc=ts(0),tu=ts(1),td=ts(2),tf=ts(3),tp=ts(4),th=ts(5),tm=ts(6);function tg(e){return e7(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/6048e5)}tc.range,tu.range,td.range,tf.range,tp.range,th.range,tm.range;let tv=tg(0),ty=tg(1),tb=tg(2),tx=tg(3),tw=tg(4),tk=tg(5),tS=tg(6);tv.range,ty.range,tb.range,tx.range,tw.range,tk.range,tS.range;let tE=e7(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());tE.range;let tO=e7(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());tO.range;let tC=e7(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());tC.every=e=>isFinite(e=Math.floor(e))&&e>0?e7(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,tC.range;let tj=e7(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function t_(e,t,n,r,o,a){let i=[[te,1,1e3],[te,5,5e3],[te,15,15e3],[te,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function l(t,n,r){let o=Math.abs(n-t)/r,a=w(([,,e])=>e).right(i,o);if(a===i.length)return e.every(y(t/31536e6,n/31536e6,r));if(0===a)return e9.every(Math.max(y(t,n,r),1));let[l,s]=i[o/i[a-1][2]<i[a][2]/o?a-1:a];return l.every(s)}return[function(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let o=n&&"function"==typeof n.range?n:l(e,t,n),a=o?o.range(e,+t+1):[];return r?a.reverse():a},l]}tj.every=e=>isFinite(e=Math.floor(e))&&e>0?e7(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,tj.range;let[tP,tN]=t_(tj,tO,tv,tl,to,tn),[tT,tA]=t_(tC,tE,tc,ta,tr,tt);function tM(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function tI(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tR(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var tD={"-":"",_:" ",0:"0"},tL=/^\s*\d+/,tZ=/^%/,tz=/[\\^$*+?|[\]().{}]/g;function tB(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",a=o.length;return r+(a<n?Array(n-a+1).join(t)+o:o)}function tF(e){return e.replace(tz,"\\$&")}function tH(e){return RegExp("^(?:"+e.map(tF).join("|")+")","i")}function tq(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function tW(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function tU(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function tK(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function t$(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function tV(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function tX(e,t,n){var r=tL.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function tG(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function tY(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function tQ(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function tJ(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function t0(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function t1(e,t,n){var r=tL.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function t2(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function t6(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function t4(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function t3(e,t,n){var r=tL.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function t5(e,t,n){var r=tL.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function t8(e,t,n){var r=tZ.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function t7(e,t,n){var r=tL.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function t9(e,t,n){var r=tL.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ne(e,t){return tB(e.getDate(),t,2)}function nt(e,t){return tB(e.getHours(),t,2)}function nn(e,t){return tB(e.getHours()%12||12,t,2)}function nr(e,t){return tB(1+ta.count(tC(e),e),t,3)}function no(e,t){return tB(e.getMilliseconds(),t,3)}function na(e,t){return no(e,t)+"000"}function ni(e,t){return tB(e.getMonth()+1,t,2)}function nl(e,t){return tB(e.getMinutes(),t,2)}function ns(e,t){return tB(e.getSeconds(),t,2)}function nc(e){var t=e.getDay();return 0===t?7:t}function nu(e,t){return tB(tc.count(tC(e)-1,e),t,2)}function nd(e){var t=e.getDay();return t>=4||0===t?tp(e):tp.ceil(e)}function nf(e,t){return e=nd(e),tB(tp.count(tC(e),e)+(4===tC(e).getDay()),t,2)}function np(e){return e.getDay()}function nh(e,t){return tB(tu.count(tC(e)-1,e),t,2)}function nm(e,t){return tB(e.getFullYear()%100,t,2)}function ng(e,t){return tB((e=nd(e)).getFullYear()%100,t,2)}function nv(e,t){return tB(e.getFullYear()%1e4,t,4)}function ny(e,t){var n=e.getDay();return tB((e=n>=4||0===n?tp(e):tp.ceil(e)).getFullYear()%1e4,t,4)}function nb(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tB(t/60|0,"0",2)+tB(t%60,"0",2)}function nx(e,t){return tB(e.getUTCDate(),t,2)}function nw(e,t){return tB(e.getUTCHours(),t,2)}function nk(e,t){return tB(e.getUTCHours()%12||12,t,2)}function nS(e,t){return tB(1+ti.count(tj(e),e),t,3)}function nE(e,t){return tB(e.getUTCMilliseconds(),t,3)}function nO(e,t){return nE(e,t)+"000"}function nC(e,t){return tB(e.getUTCMonth()+1,t,2)}function nj(e,t){return tB(e.getUTCMinutes(),t,2)}function n_(e,t){return tB(e.getUTCSeconds(),t,2)}function nP(e){var t=e.getUTCDay();return 0===t?7:t}function nN(e,t){return tB(tv.count(tj(e)-1,e),t,2)}function nT(e){var t=e.getUTCDay();return t>=4||0===t?tw(e):tw.ceil(e)}function nA(e,t){return e=nT(e),tB(tw.count(tj(e),e)+(4===tj(e).getUTCDay()),t,2)}function nM(e){return e.getUTCDay()}function nI(e,t){return tB(ty.count(tj(e)-1,e),t,2)}function nR(e,t){return tB(e.getUTCFullYear()%100,t,2)}function nD(e,t){return tB((e=nT(e)).getUTCFullYear()%100,t,2)}function nL(e,t){return tB(e.getUTCFullYear()%1e4,t,4)}function nZ(e,t){var n=e.getUTCDay();return tB((e=n>=4||0===n?tw(e):tw.ceil(e)).getUTCFullYear()%1e4,t,4)}function nz(){return"+0000"}function nB(){return"%"}function nF(e){return+e}function nH(e){return Math.floor(+e/1e3)}function nq(e){return new Date(e)}function nW(e){return e instanceof Date?+e:+new Date(+e)}function nU(e,t,n,r,o,a,i,l,s,c){var u=ek(),d=u.invert,f=u.domain,p=c(".%L"),h=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),x=c("%Y");function w(e){return(s(e)<e?p:l(e)<e?h:i(e)<e?m:a(e)<e?g:r(e)<e?o(e)<e?v:y:n(e)<e?b:x)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,nW)):f().map(nq)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?w:c(t)},u.nice=function(e){var n=f();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?f(eL(n,e)):u},u.copy=function(){return ex(u,nU(e,t,n,r,o,a,i,l,s,c))},u}function nK(){return eS.o.apply(nU(tT,tA,tC,tE,tc,ta,tr,tt,te,s).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function n$(){return eS.o.apply(nU(tP,tN,tj,tO,tv,ti,to,tn,te,c).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function nV(){var e,t,n,r,o,a=0,i=1,l=eg,s=!1;function c(t){return null==t||isNaN(t=+t)?o:l(0===n?.5:(t=(r(t)-e)*n,s?Math.max(0,Math.min(1,t)):t))}function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,l=e(n,r),c):[l(0),l(1)]}}return c.domain=function(o){return arguments.length?([a,i]=o,e=r(a=+a),t=r(i=+i),n=e===t?0:1/(t-e),c):[a,i]},c.clamp=function(e){return arguments.length?(s=!!e,c):s},c.interpolator=function(e){return arguments.length?(l=e,c):l},c.range=u(ef),c.rangeRound=u(ep),c.unknown=function(e){return arguments.length?(o=e,c):o},function(o){return r=o,e=o(a),t=o(i),n=e===t?0:1/(t-e),c}}function nX(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function nG(){var e=eQ(nV());return e.copy=function(){return nX(e,nG()).exponent(e.exponent())},eS.O.apply(e,arguments)}function nY(){return nG.apply(null,arguments).exponent(.5)}function nQ(){var e,t,n,r,o,a,i,l=0,s=.5,c=1,u=1,d=eg,f=!1;function p(e){return isNaN(e=+e)?i:(e=.5+((e=+a(e))-t)*(u*e<u*t?r:o),d(f?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var n,r,o;return arguments.length?([n,r,o]=t,d=function(e,t){void 0===t&&(t=e,e=ef);for(var n=0,r=t.length-1,o=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(o,o=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}(e,[n,r,o]),p):[d(0),d(.5),d(1)]}}return p.domain=function(i){return arguments.length?([l,s,c]=i,e=a(l=+l),t=a(s=+s),n=a(c=+c),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),u=t<e?-1:1,p):[l,s,c]},p.clamp=function(e){return arguments.length?(f=!!e,p):f},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=h(ef),p.rangeRound=h(ep),p.unknown=function(e){return arguments.length?(i=e,p):i},function(i){return a=i,e=i(l),t=i(s),n=i(c),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),u=t<e?-1:1,p}}function nJ(){var e=eQ(nQ());return e.copy=function(){return nX(e,nJ()).exponent(e.exponent())},eS.O.apply(e,arguments)}function n0(){return nJ.apply(null,arguments).exponent(.5)}function n1(e,t){if((o=e.length)>1)for(var n,r,o,a=1,i=e[t[0]],l=i.length;a<o;++a)for(r=i,i=e[t[a]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}s=(l=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,a=e.days,i=e.shortDays,l=e.months,s=e.shortMonths,c=tH(o),u=tq(o),d=tH(a),f=tq(a),p=tH(i),h=tq(i),m=tH(l),g=tq(l),v=tH(s),y=tq(s),b={a:function(e){return i[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:ne,e:ne,f:na,g:ng,G:ny,H:nt,I:nn,j:nr,L:no,m:ni,M:nl,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:nF,s:nH,S:ns,u:nc,U:nu,V:nf,w:np,W:nh,x:null,X:null,y:nm,Y:nv,Z:nb,"%":nB},x={a:function(e){return i[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:nx,e:nx,f:nO,g:nD,G:nZ,H:nw,I:nk,j:nS,L:nE,m:nC,M:nj,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:nF,s:nH,S:n_,u:nP,U:nN,V:nA,w:nM,W:nI,x:null,X:null,y:nR,Y:nL,Z:nz,"%":nB},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:t0,e:t0,f:t5,g:tG,G:tX,H:t2,I:t2,j:t1,L:t3,m:tJ,M:t6,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:tQ,Q:t7,s:t9,S:t4,u:tU,U:tK,V:t$,w:tW,W:tV,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:tG,Y:tX,Z:tY,"%":t8};function k(e,t){return function(n){var r,o,a,i=[],l=-1,s=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++l<c;)37===e.charCodeAt(l)&&(i.push(e.slice(s,l)),null!=(o=tD[r=e.charAt(++l)])?r=e.charAt(++l):o="e"===r?" ":"0",(a=t[r])&&(r=a(n,o)),i.push(r),s=l+1);return i.push(e.slice(s,l)),i.join("")}}function S(e,t){return function(n){var r,o,a=tR(1900,void 0,1);if(E(a,e,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!t||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(r=(o=(r=tI(tR(a.y,0,1))).getUTCDay())>4||0===o?ty.ceil(r):ty(r),r=ti.offset(r,(a.V-1)*7),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(r=(o=(r=tM(tR(a.y,0,1))).getDay())>4||0===o?tu.ceil(r):tu(r),r=ta.offset(r,(a.V-1)*7),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?tI(tR(a.y,0,1)).getUTCDay():tM(tR(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,tI(a)):tM(a)}}function E(e,t,n,r){for(var o,a,i=0,l=t.length,s=n.length;i<l;){if(r>=s)return -1;if(37===(o=t.charCodeAt(i++))){if(!(a=w[(o=t.charAt(i++))in tD?t.charAt(i++):o])||(r=a(e,n,r))<0)return -1}else if(o!=n.charCodeAt(r++))return -1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,l.parse,c=l.utcFormat,l.utcParse;var n2=n(22516),n6=n(76115);function n4(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function n3(e,t){return e[t]}function n5(e){let t=[];return t.key=e,t}var n8=n(95645),n7=n.n(n8),n9=n(99008),re=n.n(n9),rt=n(77571),rn=n.n(rt),rr=n(86757),ro=n.n(rr),ra=n(42715),ri=n.n(ra),rl=n(13735),rs=n.n(rl),rc=n(11314),ru=n.n(rc),rd=n(82559),rf=n.n(rd),rp=n(75551),rh=n.n(rp),rm=n(21652),rg=n.n(rm),rv=n(34935),ry=n.n(rv),rb=n(61134),rx=n.n(rb);function rw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var rk=function(e){return e},rS={},rE=function(e){return e===rS},rO=function(e){return function t(){return 0==arguments.length||1==arguments.length&&rE(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},rC=function(e){return function e(t,n){return 1===t?n:rO(function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var i=o.filter(function(e){return e!==rS}).length;return i>=t?n.apply(void 0,o):e(t-i,rO(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=o.map(function(e){return rE(e)?t.shift():e});return n.apply(void 0,((function(e){if(Array.isArray(e))return rw(e)})(a)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return rw(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rw(e,void 0)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(t))}))})}(e.length,e)},rj=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},r_=rC(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),rP=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t.length)return rk;var r=t.reverse(),o=r[0],a=r.slice(1);return function(){return a.reduce(function(e,t){return t(e)},o.apply(void 0,arguments))}},rN=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},rT=function(e){var t=null,n=null;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return t&&o.every(function(e,n){return e===t[n]})?n:(t=o,n=e.apply(void 0,o))}},rA=(rC(function(e,t,n){var r=+e;return r+n*(+t-r)}),rC(function(e,t,n){var r=t-+e;return(n-e)/(r=r||1/0)}),rC(function(e,t,n){var r=t-+e;return Math.max(0,Math.min(1,(n-e)/(r=r||1/0)))}),{rangeStep:function(e,t,n){for(var r=new(rx())(e),o=0,a=[];r.lt(t)&&o<1e5;)a.push(r.toNumber()),r=r.add(n),o++;return a},getDigitCount:function(e){return 0===e?1:Math.floor(new(rx())(e).abs().log(10).toNumber())+1}});function rM(e){return function(e){if(Array.isArray(e))return rD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||rR(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}}(e,t)||rR(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rR(e,t){if(e){if("string"==typeof e)return rD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rD(e,t)}}function rD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rL(e){var t=rI(e,2),n=t[0],r=t[1],o=n,a=r;return n>r&&(o=r,a=n),[o,a]}function rZ(e,t,n){if(e.lte(0))return new(rx())(0);var r=rA.getDigitCount(e.toNumber()),o=new(rx())(10).pow(r),a=e.div(o),i=1!==r?.05:.1,l=new(rx())(Math.ceil(a.div(i).toNumber())).add(n).mul(i).mul(o);return t?l:new(rx())(Math.ceil(l))}function rz(e,t,n){var r=1,o=new(rx())(e);if(!o.isint()&&n){var a=Math.abs(e);a<1?(r=new(rx())(10).pow(rA.getDigitCount(e)-1),o=new(rx())(Math.floor(o.div(r).toNumber())).mul(r)):a>1&&(o=new(rx())(Math.floor(e)))}else 0===e?o=new(rx())(Math.floor((t-1)/2)):n||(o=new(rx())(Math.floor(e)));var i=Math.floor((t-1)/2);return rP(r_(function(e){return o.add(new(rx())(e-i).mul(r)).toNumber()}),rj)(0,t)}var rB=rT(function(e){var t=rI(e,2),n=t[0],r=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=Math.max(o,2),l=rI(rL([n,r]),2),s=l[0],c=l[1];if(s===-1/0||c===1/0){var u=c===1/0?[s].concat(rM(rj(0,o-1).map(function(){return 1/0}))):[].concat(rM(rj(0,o-1).map(function(){return-1/0})),[c]);return n>r?rN(u):u}if(s===c)return rz(s,o,a);var d=function e(t,n,r,o){var a,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new(rx())(0),tickMin:new(rx())(0),tickMax:new(rx())(0)};var l=rZ(new(rx())(n).sub(t).div(r-1),o,i),s=Math.ceil((a=t<=0&&n>=0?new(rx())(0):(a=new(rx())(t).add(n).div(2)).sub(new(rx())(a).mod(l))).sub(t).div(l).toNumber()),c=Math.ceil(new(rx())(n).sub(a).div(l).toNumber()),u=s+c+1;return u>r?e(t,n,r,o,i+1):(u<r&&(c=n>0?c+(r-u):c,s=n>0?s:s+(r-u)),{step:l,tickMin:a.sub(new(rx())(s).mul(l)),tickMax:a.add(new(rx())(c).mul(l))})}(s,c,i,a),f=d.step,p=d.tickMin,h=d.tickMax,m=rA.rangeStep(p,h.add(new(rx())(.1).mul(f)),f);return n>r?rN(m):m});rT(function(e){var t=rI(e,2),n=t[0],r=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=Math.max(o,2),l=rI(rL([n,r]),2),s=l[0],c=l[1];if(s===-1/0||c===1/0)return[n,r];if(s===c)return rz(s,o,a);var u=rZ(new(rx())(c).sub(s).div(i-1),a,0),d=rP(r_(function(e){return new(rx())(s).add(new(rx())(e).mul(u)).toNumber()}),rj)(0,i).filter(function(e){return e>=s&&e<=c});return n>r?rN(d):d});var rF=rT(function(e,t){var n=rI(e,2),r=n[0],o=n[1],a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=rI(rL([r,o]),2),l=i[0],s=i[1];if(l===-1/0||s===1/0)return[r,o];if(l===s)return[l];var c=rZ(new(rx())(s).sub(l).div(Math.max(t,2)-1),a,0),u=[].concat(rM(rA.rangeStep(new(rx())(l),new(rx())(s).sub(new(rx())(.99).mul(c)),c)),[s]);return r>o?rN(u):u}),rH=n(13137),rq=n(16630),rW=n(82944),rU=n(38569);function rK(e){return(rK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r$(Object(n),!0).forEach(function(t){rX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rX(e,t,n){var r;return(r=function(e,t){if("object"!==rK(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==rK(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===rK(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rG(e){return function(e){if(Array.isArray(e))return rY(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rY(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rY(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rQ(e,t,n){return rn()(e)||rn()(t)?n:(0,rq.P2)(t)?rs()(e,t,n):ro()(t)?t(e):n}function rJ(e,t,n,r){var o=ru()(e,function(e){return rQ(e,t)});if("number"===n){var a=o.filter(function(e){return(0,rq.hj)(e)||parseFloat(e)});return a.length?[re()(a),n7()(a)]:[1/0,-1/0]}return(r?o.filter(function(e){return!rn()(e)}):o).map(function(e){return(0,rq.P2)(e)||e instanceof Date?e:""})}var r0=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,i=null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0;if(i<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var l=o.range,s=0;s<i;s++){var c=s>0?r[s-1].coordinate:r[i-1].coordinate,u=r[s].coordinate,d=s>=i-1?r[0].coordinate:r[s+1].coordinate,f=void 0;if((0,rq.uY)(u-c)!==(0,rq.uY)(d-u)){var p=[];if((0,rq.uY)(d-u)===(0,rq.uY)(l[1]-l[0])){f=d;var h=u+l[1]-l[0];p[0]=Math.min(h,(h+c)/2),p[1]=Math.max(h,(h+c)/2)}else{f=c;var m=d+l[1]-l[0];p[0]=Math.min(u,(m+u)/2),p[1]=Math.max(u,(m+u)/2)}var g=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>g[0]&&e<=g[1]||e>=p[0]&&e<=p[1]){a=r[s].index;break}}else{var v=Math.min(c,d),y=Math.max(c,d);if(e>(v+u)/2&&e<=(y+u)/2){a=r[s].index;break}}}else for(var b=0;b<i;b++)if(0===b&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b>0&&b<i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b===i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2){a=n[b].index;break}return a},r1=function(e){var t,n=e.type.displayName,r=e.props,o=r.stroke,a=r.fill;switch(n){case"Line":t=o;break;case"Area":case"Radar":t=o&&"none"!==o?o:a;break;default:t=a}return t},r2=function(e){var t=e.barSize,n=e.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var o={},a=Object.keys(r),i=0,l=a.length;i<l;i++)for(var s=r[a[i]].stackGroups,c=Object.keys(s),u=0,d=c.length;u<d;u++){var f=s[c[u]],p=f.items,h=f.cateAxisId,m=p.filter(function(e){return(0,rW.Gf)(e.type).indexOf("Bar")>=0});if(m&&m.length){var g=m[0].props.barSize,v=m[0].props[h];o[v]||(o[v]=[]),o[v].push({item:m[0],stackList:m.slice(1),barSize:rn()(g)?t:g})}}return o},r6=function(e){var t,n=e.barGap,r=e.barCategoryGap,o=e.bandSize,a=e.sizeList,i=void 0===a?[]:a,l=e.maxBarSize,s=i.length;if(s<1)return null;var c=(0,rq.h1)(n,o,0,!0),u=[];if(i[0].barSize===+i[0].barSize){var d=!1,f=o/s,p=i.reduce(function(e,t){return e+t.barSize||0},0);(p+=(s-1)*c)>=o&&(p-=(s-1)*c,c=0),p>=o&&f>0&&(d=!0,f*=.9,p=s*f);var h={offset:((o-p)/2>>0)-c,size:0};t=i.reduce(function(e,t){var n={item:t.item,position:{offset:h.offset+h.size+c,size:d?f:t.barSize}},r=[].concat(rG(e),[n]);return h=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:h})}),r},u)}else{var m=(0,rq.h1)(r,o,0,!0);o-2*m-(s-1)*c<=0&&(c=0);var g=(o-2*m-(s-1)*c)/s;g>1&&(g>>=0);var v=l===+l?Math.min(g,l):g;t=i.reduce(function(e,t,n){var r=[].concat(rG(e),[{item:t.item,position:{offset:m+(g+c)*n+(g-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return t},r4=function(e,t,n,r){var o=n.children,a=n.width,i=n.margin,l=a-(i.left||0)-(i.right||0),s=(0,rU.z)({children:o,legendWidth:l});if(s){var c=r||{},u=c.width,d=c.height,f=s.align,p=s.verticalAlign,h=s.layout;if(("vertical"===h||"horizontal"===h&&"middle"===p)&&"center"!==f&&(0,rq.hj)(e[f]))return rV(rV({},e),{},rX({},f,e[f]+(u||0)));if(("horizontal"===h||"vertical"===h&&"center"===f)&&"middle"!==p&&(0,rq.hj)(e[p]))return rV(rV({},e),{},rX({},p,e[p]+(d||0)))}return e},r3=function(e,t,n,r,o){var a=t.props.children,i=(0,rW.NN)(a,rH.W).filter(function(e){var t;return t=e.props.direction,!!rn()(o)||("horizontal"===r?"yAxis"===o:"vertical"===r||"x"===t?"xAxis"===o:"y"!==t||"yAxis"===o)});if(i&&i.length){var l=i.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=rQ(t,n,0),o=Array.isArray(r)?[re()(r),n7()(r)]:[r,r],a=l.reduce(function(e,n){var r=rQ(t,n,0),a=o[0]-Math.abs(Array.isArray(r)?r[0]:r),i=o[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(i,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},r5=function(e,t,n,r,o){var a=t.map(function(t){return r3(e,t,n,o,r)}).filter(function(e){return!rn()(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},r8=function(e,t,n,r,o){var a=t.map(function(t){var a=t.props.dataKey;return"number"===n&&a&&r3(e,t,a,r)||rJ(e,a,n,o)});if("number"===n)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var i={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)i[t[n]]||(i[t[n]]=!0,e.push(t[n]));return e},[])},r7=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},r9=function(e,t,n,r){if(r)return e.map(function(e){return e.coordinate});var o,a,i=e.map(function(e){return e.coordinate===t&&(o=!0),e.coordinate===n&&(a=!0),e.coordinate});return o||i.push(t),a||i.push(n),i},oe=function(e,t,n){if(!e)return null;var r=e.scale,o=e.duplicateDomain,a=e.type,i=e.range,l="scaleBand"===e.realScaleType?r.bandwidth()/2:2,s=(t||n)&&"category"===a&&r.bandwidth?r.bandwidth()/l:0;return(s="angleAxis"===e.axisType&&(null==i?void 0:i.length)>=2?2*(0,rq.uY)(i[0]-i[1])*s:s,t&&(e.ticks||e.niceTicks))?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(o?o.indexOf(e):e)+s,value:e,offset:s}}).filter(function(e){return!rf()(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+s,value:e,index:t,offset:s}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+s,value:e,offset:s}}):r.domain().map(function(e,t){return{coordinate:r(e)+s,value:o?o[e]:e,index:t,offset:s}})},ot=new WeakMap,on=function(e,t){if("function"!=typeof t)return e;ot.has(e)||ot.set(e,new WeakMap);var n=ot.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},or=function(e,t,n){var r=e.scale,o=e.type,a=e.layout,i=e.axisType;if("auto"===r)return"radial"===a&&"radiusAxis"===i?{scale:d.Z(),realScaleType:"band"}:"radial"===a&&"angleAxis"===i?{scale:eD(),realScaleType:"linear"}:"category"===o&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!n)?{scale:d.x(),realScaleType:"point"}:"category"===o?{scale:d.Z(),realScaleType:"band"}:{scale:eD(),realScaleType:"linear"};if(ri()(r)){var l="scale".concat(rh()(r));return{scale:(u[l]||d.x)(),realScaleType:u[l]?l:"point"}}return ro()(r)?{scale:r}:{scale:d.x(),realScaleType:"point"}},oo=function(e){var t=e.domain();if(t&&!(t.length<=2)){var n=t.length,r=e.range(),o=Math.min(r[0],r[1])-1e-4,a=Math.max(r[0],r[1])+1e-4,i=e(t[0]),l=e(t[n-1]);(i<o||i>a||l<o||l>a)&&e.domain([t[0],t[n-1]])}},oa=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},oi=function(e,t){if(!t||2!==t.length||!(0,rq.hj)(t[0])||!(0,rq.hj)(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),o=[e[0],e[1]];return(!(0,rq.hj)(e[0])||e[0]<n)&&(o[0]=n),(!(0,rq.hj)(e[1])||e[1]>r)&&(o[1]=r),o[0]>r&&(o[0]=r),o[1]<n&&(o[1]=n),o},ol={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var o=0,a=0,i=0;i<t;++i){var l=rf()(e[i][n][1])?e[i][n][0]:e[i][n][1];l>=0?(e[i][n][0]=o,e[i][n][1]=o+l,o=e[i][n][1]):(e[i][n][0]=a,e[i][n][1]=a+l,a=e[i][n][1])}},expand:function(e,t){if((r=e.length)>0){for(var n,r,o,a=0,i=e[0].length;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}n1(e,t)}},none:n1,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,o=e[t[0]],a=o.length;r<a;++r){for(var i=0,l=0;i<n;++i)l+=e[i][r][1]||0;o[r][1]+=o[r][0]=-l/2}n1(e,t)}},wiggle:function(e,t){if((o=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,o,a=0,i=1;i<r;++i){for(var l=0,s=0,c=0;l<o;++l){for(var u=e[t[l]],d=u[i][1]||0,f=(d-(u[i-1][1]||0))/2,p=0;p<l;++p){var h=e[t[p]];f+=(h[i][1]||0)-(h[i-1][1]||0)}s+=d,c+=f*d}n[i-1][1]+=n[i-1][0]=a,s&&(a-=c/s)}n[i-1][1]+=n[i-1][0]=a,n1(e,t)}},positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var o=0,a=0;a<t;++a){var i=rf()(e[a][n][1])?e[a][n][0]:e[a][n][1];i>=0?(e[a][n][0]=o,e[a][n][1]=o+i,o=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},os=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),o=ol[n];return(function(){var e=(0,n6.Z)([]),t=n4,n=n1,r=n3;function o(o){var a,i,l=Array.from(e.apply(this,arguments),n5),s=l.length,c=-1;for(let e of o)for(a=0,++c;a<s;++a)(l[a][c]=[0,+r(e,l[a].key,c,o)]).data=e;for(a=0,i=(0,n2.Z)(t(l));a<s;++a)l[i[a]].index=a;return n(l,i),l}return o.keys=function(t){return arguments.length?(e="function"==typeof t?t:(0,n6.Z)(Array.from(t)),o):e},o.value=function(e){return arguments.length?(r="function"==typeof e?e:(0,n6.Z)(+e),o):r},o.order=function(e){return arguments.length?(t=null==e?n4:"function"==typeof e?e:(0,n6.Z)(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(n=null==e?n1:e,o):n},o})().keys(r).value(function(e,t){return+rQ(e,t,0)}).order(n4).offset(o)(e)},oc=function(e,t,n,r,o,a){if(!e)return null;var i=(a?t.reverse():t).reduce(function(e,t){var o=t.props,a=o.stackId;if(o.hide)return e;var i=t.props[n],l=e[i]||{hasStack:!1,stackGroups:{}};if((0,rq.P2)(a)){var s=l.stackGroups[a]||{numericAxisId:n,cateAxisId:r,items:[]};s.items.push(t),l.hasStack=!0,l.stackGroups[a]=s}else l.stackGroups[(0,rq.EL)("_stackId_")]={numericAxisId:n,cateAxisId:r,items:[t]};return rV(rV({},e),{},rX({},i,l))},{});return Object.keys(i).reduce(function(t,a){var l=i[a];return l.hasStack&&(l.stackGroups=Object.keys(l.stackGroups).reduce(function(t,a){var i=l.stackGroups[a];return rV(rV({},t),{},rX({},a,{numericAxisId:n,cateAxisId:r,items:i.items,stackedData:os(e,i.items,o)}))},{})),rV(rV({},t),{},rX({},a,l))},{})},ou=function(e,t){var n=t.realScaleType,r=t.type,o=t.tickCount,a=t.originalDomain,i=t.allowDecimals,l=n||t.scale;if("auto"!==l&&"linear"!==l)return null;if(o&&"number"===r&&a&&("auto"===a[0]||"auto"===a[1])){var s=e.domain();if(!s.length)return null;var c=rB(s,o,i);return e.domain([re()(c),n7()(c)]),{niceTicks:c}}return o&&"number"===r?{niceTicks:rF(e.domain(),o,i)}:null},od=function(e){var t=e.axis,n=e.ticks,r=e.bandSize,o=e.entry,a=e.index,i=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!rn()(o[t.dataKey])){var l=(0,rq.Ap)(n,"value",o[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var s=rQ(o,rn()(i)?t.dataKey:i);return rn()(s)?null:t.scale(s)},of=function(e){var t=e.axis,n=e.ticks,r=e.offset,o=e.bandSize,a=e.entry,i=e.index;if("category"===t.type)return n[i]?n[i].coordinate+r:null;var l=rQ(a,t.dataKey,t.domain[i]);return rn()(l)?null:t.scale(l)-o/2+r},op=function(e){var t=e.numericAxis,n=t.scale.domain();if("number"===t.type){var r=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return r<=0&&o>=0?0:o<0?o:r}return n[0]},oh=function(e,t){var n=e.props.stackId;if((0,rq.P2)(n)){var r=t[n];if(r){var o=r.items.indexOf(e);return o>=0?r.stackedData[o]:null}}return null},om=function(e,t,n){return Object.keys(e).reduce(function(r,o){var a=e[o].stackedData.reduce(function(e,r){var o=r.slice(t,n+1).reduce(function(e,t){return[re()(t.concat([e[0]]).filter(rq.hj)),n7()(t.concat([e[1]]).filter(rq.hj))]},[1/0,-1/0]);return[Math.min(e[0],o[0]),Math.max(e[1],o[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},og=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ov=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oy=function(e,t,n){if(ro()(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if((0,rq.hj)(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(og.test(e[0])){var o=+og.exec(e[0])[1];r[0]=t[0]-o}else ro()(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if((0,rq.hj)(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(ov.test(e[1])){var a=+ov.exec(e[1])[1];r[1]=t[1]+a}else ro()(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},ob=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var o=ry()(t,function(e){return e.coordinate}),a=1/0,i=1,l=o.length;i<l;i++){var s=o[i],c=o[i-1];a=Math.min((s.coordinate||0)-(c.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},ox=function(e,t,n){return!e||!e.length||rg()(e,rs()(n,"type.defaultProps.domain"))?t:e},ow=function(e,t){var n=e.props,r=n.dataKey,o=n.name,a=n.unit,i=n.formatter,l=n.tooltipType,s=n.chartType,c=n.hide;return rV(rV({},(0,rW.L6)(e,!1)),{},{dataKey:r,unit:a,formatter:i,name:o||r,color:r1(e),value:rQ(t,r),type:l,payload:t,chartType:s,hide:c})}},4094:function(e,t,n){"use strict";n.d(t,{os:function(){return d},xE:function(){return u}});var r=n(34067);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){var r,a;r=t,a=n[t],(r=function(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var l={widthCache:{},cacheCount:0},s={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},c="recharts_measurement_span",u=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||r.x.isSsr)return{width:0,height:0};var o=(Object.keys(t=i({},n)).forEach(function(e){t[e]||delete t[e]}),t),a=JSON.stringify({text:e,copyStyle:o});if(l.widthCache[a])return l.widthCache[a];try{var u=document.getElementById(c);u||((u=document.createElement("span")).setAttribute("id",c),u.setAttribute("aria-hidden","true"),document.body.appendChild(u));var d=i(i({},s),o);Object.assign(u.style,d),u.textContent="".concat(e);var f=u.getBoundingClientRect(),p={width:f.width,height:f.height};return l.widthCache[a]=p,++l.cacheCount>2e3&&(l.cacheCount=0,l.widthCache={}),p}catch(e){return{width:0,height:0}}},d=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}}},16630:function(e,t,n){"use strict";n.d(t,{Ap:function(){return w},EL:function(){return g},Kt:function(){return y},P2:function(){return h},bv:function(){return b},h1:function(){return v},hU:function(){return f},hj:function(){return p},k4:function(){return x},uY:function(){return d}});var r=n(42715),o=n.n(r),a=n(82559),i=n.n(a),l=n(13735),s=n.n(l),c=n(22345),u=n.n(c),d=function(e){return 0===e?0:e>0?1:-1},f=function(e){return o()(e)&&e.indexOf("%")===e.length-1},p=function(e){return u()(e)&&!i()(e)},h=function(e){return p(e)||o()(e)},m=0,g=function(e){var t=++m;return"".concat(e||"").concat(t)},v=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!p(e)&&!o()(e))return r;if(f(e)){var l=e.indexOf("%");n=t*parseFloat(e.slice(0,l))/100}else n=+e;return i()(n)&&(n=r),a&&n>t&&(n=t),n},y=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},b=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++){if(n[e[r]])return!0;n[e[r]]=!0}return!1},x=function(e,t){return p(e)&&p(t)?function(n){return e+n*(t-e)}:function(){return t}};function w(e,t,n){return e&&e.length?e.find(function(e){return e&&("function"==typeof t?t(e):s()(e,t))===n}):null}},34067:function(e,t,n){"use strict";n.d(t,{x:function(){return r}});var r={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return r[e]},set:function(e,t){if("string"==typeof e)r[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){r[t]=e[t]})}}}},1175:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var r=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o]}},39206:function(e,t,n){"use strict";n.d(t,{$4:function(){return h},Wk:function(){return f},op:function(){return p},t9:function(){return m},z3:function(){return b}});var r=n(77571),o=n.n(r),a=n(16630),i=n(85355);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){var r;return(r=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===l(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f=Math.PI/180,p=function(e,t,n,r){return{x:e+Math.cos(-f*r)*n,y:t+Math.sin(-f*r)*n}},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},m=function(e,t,n,r,l){var s=e.width,f=e.height,p=e.startAngle,m=e.endAngle,g=(0,a.h1)(e.cx,s,s/2),v=(0,a.h1)(e.cy,f,f/2),y=h(s,f,n),b=(0,a.h1)(e.innerRadius,y,0),x=(0,a.h1)(e.outerRadius,y,.8*y);return Object.keys(t).reduce(function(e,n){var a,s=t[n],f=s.domain,h=s.reversed;if(o()(s.range))"angleAxis"===r?a=[p,m]:"radiusAxis"===r&&(a=[b,x]),h&&(a=[a[1],a[0]]);else{var y,w=function(e){if(Array.isArray(e))return e}(y=a=s.range)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(y,2)||function(e,t){if(e){if("string"==typeof e)return d(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,2)}}(y,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();p=w[0],m=w[1]}var k=(0,i.Hq)(s,l),S=k.realScaleType,E=k.scale;E.domain(f).range(a),(0,i.zF)(E);var O=(0,i.g$)(E,c(c({},s),{},{realScaleType:S})),C=c(c(c({},s),O),{},{range:a,radius:x,realScaleType:S,scale:E,cx:g,cy:v,innerRadius:b,outerRadius:x,startAngle:p,endAngle:m});return c(c({},e),{},u({},n,C))},{})},g=function(e,t){var n=e.x,r=e.y;return Math.sqrt(Math.pow(n-t.x,2)+Math.pow(r-t.y,2))},v=function(e,t){var n=e.x,r=e.y,o=t.cx,a=t.cy,i=g({x:n,y:r},{x:o,y:a});if(i<=0)return{radius:i};var l=Math.acos((n-o)/i);return r>a&&(l=2*Math.PI-l),{radius:i,angle:180*l/Math.PI,angleInRadian:l}},y=function(e){var t=e.startAngle,n=e.endAngle,r=Math.min(Math.floor(t/360),Math.floor(n/360));return{startAngle:t-360*r,endAngle:n-360*r}},b=function(e,t){var n,r=v({x:e.x,y:e.y},t),o=r.radius,a=r.angle,i=t.innerRadius,l=t.outerRadius;if(o<i||o>l)return!1;if(0===o)return!0;var s=y(t),u=s.startAngle,d=s.endAngle,f=a;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;n=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;n=f>=d&&f<=u}return n?c(c({},t),{},{radius:o,angle:f+360*Math.min(Math.floor(t.startAngle/360),Math.floor(t.endAngle/360))}):null}},82944:function(e,t,n){"use strict";n.d(t,{$R:function(){return Z},$k:function(){return T},Bh:function(){return L},Gf:function(){return S},L6:function(){return M},NN:function(){return j},TT:function(){return P},eu:function(){return D},rL:function(){return I},sP:function(){return _}});var r=n(13735),o=n.n(r),a=n(77571),i=n.n(a),l=n(42715),s=n.n(l),c=n(86757),u=n.n(c),d=n(28302),f=n.n(d),p=n(2265),h=n(82558),m=n(16630),g=n(46485),v=n(41637),y=["children"],b=["children"];function x(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},S=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},E=null,O=null,C=function e(t){if(t===E&&Array.isArray(O))return O;var n=[];return p.Children.forEach(t,function(t){i()(t)||((0,h.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),O=n,E=t,n};function j(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return S(e)}):[S(t)],C(e).forEach(function(e){var t=o()(e,"type.displayName")||o()(e,"type.name");-1!==r.indexOf(t)&&n.push(e)}),n}function _(e,t){var n=j(e,t);return n&&n[0]}var P=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!!(0,m.hj)(n)&&!(n<=0)&&!!(0,m.hj)(r)&&!(r<=0)},N=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],T=function(e){return e&&"object"===w(e)&&"cx"in e&&"cy"in e&&"r"in e},A=function(e,t,n,r){var o,a=null!==(o=null===v.ry||void 0===v.ry?void 0:v.ry[r])&&void 0!==o?o:[];return!u()(e)&&(r&&a.includes(t)||v.Yh.includes(t))||n&&v.nv.includes(t)},M=function(e,t,n){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,p.isValidElement)(e)&&(r=e.props),!f()(r))return null;var o={};return Object.keys(r).forEach(function(e){var a;A(null===(a=r)||void 0===a?void 0:a[e],e,t,n)&&(o[e]=r[e])}),o},I=function e(t,n){if(t===n)return!0;var r=p.Children.count(t);if(r!==p.Children.count(n))return!1;if(0===r)return!0;if(1===r)return R(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var o=0;o<r;o++){var a=t[o],i=n[o];if(Array.isArray(a)||Array.isArray(i)){if(!e(a,i))return!1}else if(!R(a,i))return!1}return!0},R=function(e,t){if(i()(e)&&i()(t))return!0;if(!i()(e)&&!i()(t)){var n=e.props||{},r=n.children,o=x(n,y),a=t.props||{},l=a.children,s=x(a,b);if(r&&l)return(0,g.w)(o,s)&&I(r,l);if(!r&&!l)return(0,g.w)(o,s)}return!1},D=function(e,t){var n=[],r={};return C(e).forEach(function(e,o){if(e&&e.type&&s()(e.type)&&N.indexOf(e.type)>=0)n.push(e);else if(e){var a=S(e.type),i=t[a]||{},l=i.handler,c=i.once;if(l&&(!c||!r[a])){var u=l(e,a,o);n.push(u),r[a]=!0}}}),n},L=function(e){var t=e&&e.type;return t&&k[t]?k[t]:null},Z=function(e,t){return C(t).indexOf(e)}},46485:function(e,t,n){"use strict";function r(e,t){for(var n in e)if(({}).hasOwnProperty.call(e,n)&&(!({}).hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if(({}).hasOwnProperty.call(t,r)&&!({}).hasOwnProperty.call(e,r))return!1;return!0}n.d(t,{w:function(){return r}})},38569:function(e,t,n){"use strict";n.d(t,{z:function(){return c}});var r=n(22190),o=n(85355),a=n(82944);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c=function(e){var t,n=e.children,i=e.formattedGraphicalItems,l=e.legendWidth,c=e.legendContent,u=(0,a.sP)(n,r.D);return u?(t=u.props&&u.props.payload?u.props&&u.props.payload:"children"===c?(i||[]).reduce(function(e,t){var n=t.item,r=t.props,o=r.sectors||r.data||[];return e.concat(o.map(function(e){return{type:u.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(i||[]).map(function(e){var t=e.item,n=t.props,r=n.dataKey,a=n.name,i=n.legendType;return{inactive:n.hide,dataKey:r,type:u.props.iconType||i||"square",color:(0,o.fk)(t),value:a||r,payload:t.props}}),s(s(s({},u.props),r.D.getWithHeight(u,l)),{},{payload:t,item:u})):null}},93528:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(47230),o=n.n(r),a=n(86757),i=n.n(a);function l(e,t,n){return!0===t?o()(e,n):i()(t)?o()(e,t):e}},41637:function(e,t,n){"use strict";n.d(t,{Yh:function(){return l},Ym:function(){return d},bw:function(){return f},nv:function(){return u},ry:function(){return c}});var r=n(2265),o=n(28302),a=n.n(o);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var l=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],s=["points","pathLength"],c={svg:["viewBox","children"],polygon:s,polyline:s},u=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],d=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,r.isValidElement)(e)&&(n=e.props),!a()(n))return null;var o={};return Object.keys(n).forEach(function(e){u.includes(e)&&(o[e]=t||function(t){return n[e](n,t)})}),o},f=function(e,t,n){if(!a()(e)||"object"!==i(e))return null;var r=null;return Object.keys(e).forEach(function(o){var a=e[o];u.includes(o)&&"function"==typeof a&&(r||(r={}),r[o]=function(e){return a(t,n,e),null})}),r}},52744:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(80662));t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,o.default)(e),a="function"==typeof t;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,o=e.value;a?t(r,o,e):o&&((n=n||{})[r]=o)}}),n}},18975:function(e,t,n){"use strict";var r=n(40257);n(24601);var o=n(2265),a=o&&"object"==typeof o&&"default"in o?o:{default:o},i=void 0!==r&&r.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},s=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,o=t.optimizeForSpeed,a=void 0===o?i:o;c(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var s="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=s?s.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},t.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var n="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){i||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},t.deleteRule=function(e){if("undefined"==typeof window){this._serverSheet.deleteRule(e);return}if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},t.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},t.makeStyleTag=function(e,t,n){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var o=document.head||document.getElementsByTagName("head")[0];return n?o.insertBefore(r,n):o.appendChild(r),r},function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,[{key:"length",get:function(){return this._rulesCount}}]),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var u=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},d={};function f(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return d[r]||(d[r]="jsx-"+u(e+"-"+n)),d[r]}function p(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return d[n]||(d[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[n]}var h=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,o=t.optimizeForSpeed,a=void 0!==o&&o;this._sheet=r||new s({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),r&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,o=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var a=o.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=a,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var o=f(r,n);return{styleId:o,rules:Array.isArray(t)?t.map(function(e){return p(o,e)}):[p(o,t)]}}return{styleId:f(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=o.createContext(null);m.displayName="StyleSheetContext";var g=a.default.useInsertionEffect||a.default.useLayoutEffect,v="undefined"!=typeof window?new h:void 0;function y(e){var t=v||o.useContext(m);return t&&("undefined"==typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}y.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},t.style=y},29:function(e,t,n){"use strict";e.exports=n(18975).style},99623:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}},21092:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,a=s(e),i=a[0],l=a[1],c=new o((i+l)*3/4-l),u=0,d=l>0?i-4:i;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,a=[],i=0,l=r-o;i<l;i+=16383)a.push(function(e,t,r){for(var o,a=[],i=t;i<r;i+=3)a.push(n[(o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}(e,i,i+16383>l?l:i+16383));return 1===o?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===o&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,l=a.length;i<l;++i)n[i]=a[i],r[a.charCodeAt(i)]=i;function s(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},10536:function(e,t,n){"use strict";var r=n(21092),o=n(32119),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!l.isEncoding(t))throw TypeError("Unknown encoding: "+t);var n=0|h(e,t),r=i(n),o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(P(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(P(e,SharedArrayBuffer)||e&&P(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);var o=function(e){if(l.isBuffer(e)){var t,n=0|p(e.length),r=i(n);return 0===r.length||e.copy(r,0,0,n),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?i(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),i(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),n=i(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function f(e,t,n){var r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),l.prototype),r}function p(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return C(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(o)return r?-1:C(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,n){var o,a,i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",a=t;a<n;++a)o+=N[e[a]];return o}(this,t,n);case"utf8":case"utf-8":return b(this,t,n);case"ascii":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}(this,t,n);case"base64":return o=t,a=n,0===o&&a===this.length?r.fromByteArray(this):r.fromByteArray(this.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),o="",a=0;a<r.length-1;a+=2)o+=String.fromCharCode(r[a]+256*r[a+1]);return o}(this,t,n);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,o){var a;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),(a=n=+n)!=a&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return -1;n=e.length-1}else if(n<0){if(!o)return -1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var a,i=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;i=2,l/=2,s/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var u=-1;for(a=n;a<l;a++)if(c(e,a)===c(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===s)return u*i}else -1!==u&&(a-=a-u),u=-1}else for(n+s>l&&(n=l-s),a=n;a>=0;a--){for(var d=!0,f=0;f<s;f++)if(c(e,a+f)!==c(t,f)){d=!1;break}if(d)return a}return -1}function b(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var a,i,l,s,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:(192&(a=e[o+1]))==128&&(s=(31&c)<<6|63&a)>127&&(u=s);break;case 3:a=e[o+1],i=e[o+2],(192&a)==128&&(192&i)==128&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:a=e[o+1],i=e[o+2],l=e[o+3],(192&a)==128&&(192&i)==128&&(192&l)==128&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&l)>65535&&s<1114112&&(u=s)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}function x(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function w(e,t,n,r,o,a){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function k(e,t,n,r,o,a){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function S(e,t,n,r,a){return t=+t,n>>>=0,a||k(e,t,n,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,n,r,23,4),n+4}function E(e,t,n,r,a){return t=+t,n>>>=0,a||k(e,t,n,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,n,r,52,8),n+8}t.lW=l,t.h2=50,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return s(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return(c(e),e<=0)?i(e):void 0!==t?"string"==typeof n?i(e).fill(t,n):i(e).fill(t):i(e)},l.allocUnsafe=function(e){return u(e)},l.allocUnsafeSlow=function(e){return u(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(P(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),P(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;var n,r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(P(a,Uint8Array))o+a.length>r.length?l.from(a).copy(r,o):Uint8Array.prototype.set.call(r,a,o);else if(l.isBuffer(a))a.copy(r,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},l.byteLength=h,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.h2;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,o){if(P(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var a=o-r,i=n-t,s=Math.min(a,i),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){a=c[d],i=u[d];break}return a<i?-1:i<a?1:0},l.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,a,i,l,s,c,u,d,f=this.length-t;if((void 0===n||n>f)&&(n=f),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var p=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var a=t.length;r>a/2&&(r=a/2);for(var i=0;i<r;++i){var l=parseInt(t.substr(2*i,2),16);if(l!=l)break;e[n+i]=l}return i}(this,e,t,n);case"utf8":case"utf-8":return o=t,a=n,_(C(e,this.length-o),this,o,a);case"ascii":case"latin1":case"binary":return i=t,l=n,_(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(e),this,i,l);case"base64":return s=t,c=n,_(j(e),this,s,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,d=n,_(function(e,t){for(var n,r,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o.push(n%256),o.push(r);return o}(e,this.length-u),this,u,d);default:if(p)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=t,o=1,a=this[e+--r];r>0&&(o*=256);)a+=this[e+--r]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return(e>>>=0,t||x(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var o=Math.pow(2,8*n)-1;w(this,e,t,n,o,0)}var a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var o=Math.pow(2,8*n)-1;w(this,e,t,n,o,0)}var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);w(this,e,t,n,o-1,-o)}var a=0,i=1,l=0;for(this[t]=255&e;++a<n&&(i*=256);)e<0&&0===l&&0!==this[t+a-1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);w(this,e,t,n,o-1,-o)}var a=n-1,i=1,l=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,n){return S(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return S(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return E(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return E(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var o,a=e.charCodeAt(0);("utf8"===r&&a<128||"latin1"===r)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var i=l.isBuffer(e)?e:l.from(e,r),s=i.length;if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=i[o%s]}return this};var O=/[^+/0-9A-Za-z-_]/g;function C(e,t){t=t||1/0;for(var n,r=e.length,o=null,a=[],i=0;i<r;++i){if((n=e.charCodeAt(i))>55295&&n<57344){if(!o){if(n>56319||i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return a}function j(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function _(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length)&&!(o>=e.length);++o)t[o+n]=e[o];return o}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var N=function(){for(var e="0123456789abcdef",t=Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)t[r+o]=e[n]+e[o];return t}()},32119:function(e,t){t.read=function(e,t,n,r,o){var a,i,l=8*o-r-1,s=(1<<l)-1,c=s>>1,u=-7,d=n?o-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=l;u>0;a=256*a+e[t+d],d+=f,u-=8);for(i=a&(1<<-u)-1,a>>=-u,u+=r;u>0;i=256*i+e[t+d],d+=f,u-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,r),a-=c}return(p?-1:1)*i*Math.pow(2,a-r)},t.write=function(e,t,n,r,o,a){var i,l,s,c=8*a-o-1,u=(1<<c)-1,d=u>>1,f=23===o?5960464477539062e-23:0,p=r?0:a-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(l=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),i+d>=1?t+=f/s:t+=f*Math.pow(2,1-d),t*s>=2&&(i++,s/=2),i+d>=u?(l=0,i=u):i+d>=1?(l=(t*s-1)*Math.pow(2,o),i+=d):(l=t*Math.pow(2,d-1)*Math.pow(2,o),i=0));o>=8;e[n+p]=255&l,p+=h,l/=256,o-=8);for(i=i<<o|l,c+=o;c>0;e[n+p]=255&i,p+=h,i/=256,c-=8);e[n+p-h]|=128*m}},9973:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},85498:function(e,t,n){"use strict";var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U,K,$,V,X,G,Y;let Q,J,ee;function et(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function en(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}n.d(t,{ZP:function(){return tF}});let er=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return er=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>255*Math.random()&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^n()&15>>+e/4).toString(16))};function eo(e){return"object"==typeof e&&null!==e&&("name"in e&&"AbortError"===e.name||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}let ea=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e){try{if("[object Error]"===Object.prototype.toString.call(e)){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class ei extends Error{}class el extends ei{constructor(e,t,n,r){super(`${el.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=t}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){return e&&r?400===e?new ed(e,t,n,r):401===e?new ef(e,t,n,r):403===e?new ep(e,t,n,r):404===e?new eh(e,t,n,r):409===e?new em(e,t,n,r):422===e?new eg(e,t,n,r):429===e?new ev(e,t,n,r):e>=500?new ey(e,t,n,r):new el(e,t,n,r):new ec({message:n,cause:ea(t)})}}class es extends el{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class ec extends el{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class eu extends ec{constructor({message:e}={}){super({message:e??"Request timed out."})}}class ed extends el{}class ef extends el{}class ep extends el{}class eh extends el{}class em extends el{}class eg extends el{}class ev extends el{}class ey extends el{}let eb=/^[a-z][a-z0-9+.-]*:/i,ex=e=>eb.test(e);function ew(e){return"object"!=typeof e?{}:e??{}}let ek=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new ei(`${e} must be an integer`);if(t<0)throw new ei(`${e} must be a positive integer`);return t},eS=e=>{try{return JSON.parse(e)}catch(e){return}},eE=e=>new Promise(t=>setTimeout(t,e)),eO={off:0,error:200,warn:300,info:400,debug:500},eC=(e,t,n)=>{if(e){if(Object.prototype.hasOwnProperty.call(eO,e))return e;eT(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(eO))}`)}};function ej(){}function e_(e,t,n){return!t||eO[e]>eO[n]?ej:t[e].bind(t)}let eP={error:ej,warn:ej,info:ej,debug:ej},eN=new WeakMap;function eT(e){let t=e.logger,n=e.logLevel??"off";if(!t)return eP;let r=eN.get(t);if(r&&r[0]===n)return r[1];let o={error:e_("error",t,n),warn:e_("warn",t,n),info:e_("info",t,n),debug:e_("debug",t,n)};return eN.set(t,[n,o]),o}let eA=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,"x-api-key"===e.toLowerCase()||"authorization"===e.toLowerCase()||"cookie"===e.toLowerCase()||"set-cookie"===e.toLowerCase()?"***":t]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),eM="0.54.0",eI=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,eR=()=>{let e="undefined"!=typeof Deno&&null!=Deno.build?"deno":"undefined"!=typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":eL(Deno.build.os),"X-Stainless-Arch":eD(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":eL(globalThis.process.platform??"unknown"),"X-Stainless-Arch":eD(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,o=n[3]||0;return{browser:e,version:`${t}.${r}.${o}`}}}return null}();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},eD=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",eL=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",eZ=()=>Q??(Q=eR());function ez(...e){let t=globalThis.ReadableStream;if(void 0===t)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function eB(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ez({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function eF(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function eH(e){if(null===e||"object"!=typeof e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}let eq=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function eW(e){let t;return(J??(J=(t=new globalThis.TextEncoder).encode.bind(t)))(e)}function eU(e){let t;return(ee??(ee=(t=new globalThis.TextDecoder).decode.bind(t)))(e)}class eK{constructor(){r.set(this,void 0),o.set(this,void 0),et(this,r,new Uint8Array,"f"),et(this,o,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?eW(e):e;et(this,r,function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}([en(this,r,"f"),n]),"f");let a=[];for(;null!=(t=function(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}(en(this,r,"f"),en(this,o,"f")));){if(t.carriage&&null==en(this,o,"f")){et(this,o,t.index,"f");continue}if(null!=en(this,o,"f")&&(t.index!==en(this,o,"f")+1||t.carriage)){a.push(eU(en(this,r,"f").subarray(0,en(this,o,"f")-1))),et(this,r,en(this,r,"f").subarray(en(this,o,"f")),"f"),et(this,o,null,"f");continue}let e=null!==en(this,o,"f")?t.preceding-1:t.preceding,n=eU(en(this,r,"f").subarray(0,e));a.push(n),et(this,r,en(this,r,"f").subarray(t.index),"f"),et(this,o,null,"f")}return a}flush(){return en(this,r,"f").length?this.decode("\n"):[]}}r=new WeakMap,o=new WeakMap,eK.NEWLINE_CHARS=new Set(["\n","\r"]),eK.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class e${constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new e$(async function*(){if(n)throw new ei("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of eV(e,t)){if("completion"===n.event)try{yield JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("message_start"===n.event||"message_delta"===n.event||"message_stop"===n.event||"content_block_start"===n.event||"content_block_delta"===n.event||"content_block_stop"===n.event)try{yield JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("ping"!==n.event&&"error"===n.event)throw new el(void 0,eS(n.data)??n.data,void 0,e.headers)}r=!0}catch(e){if(eo(e))return;throw e}finally{r||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;async function*r(){let t=new eK;for await(let n of eF(e))for(let e of t.decode(n))yield e;for(let e of t.flush())yield e}return new e$(async function*(){if(n)throw new ei("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let e=!1;try{for await(let t of r())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(eo(e))return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=r=>({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new e$(()=>r(e),this.controller),new e$(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this;return ez({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let o=eW(JSON.stringify(n)+"\n");t.enqueue(o)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*eV(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}let n=new eG,r=new eK;for await(let t of eX(eF(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*eX(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?eW(n):n,o=new Uint8Array(t.length+r.length);for(o.set(t),o.set(r,t.length),t=o;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class eG{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}async function eY(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:o,startTime:a}=t,i=await (async()=>{if(t.options.stream)return(eT(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass)?t.options.__streamClass.fromSSEResponse(n,t.controller):e$.fromSSEResponse(n,t.controller);if(204===n.status)return null;if(t.options.__binaryResponse)return n;let r=n.headers.get("content-type"),o=r?.split(";")[0]?.trim();return o?.includes("application/json")||o?.endsWith("+json")?eQ(await n.json(),n):await n.text()})();return eT(e).debug(`[${r}] response parsed`,eA({retryOfRequestLogID:o,url:n.url,status:n.status,body:i,durationMs:Date.now()-a})),i}function eQ(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}class eJ extends Promise{constructor(e,t,n=eY){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,a.set(this,void 0),et(this,a,e,"f")}_thenUnwrap(e){return new eJ(en(this,a,"f"),this.responsePromise,async(t,n)=>eQ(e(await this.parseResponse(t,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(en(this,a,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}a=new WeakMap;class e0{constructor(e,t,n,r){i.set(this,void 0),et(this,i,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageRequestOptions()}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new ei("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await en(this,i,"f").requestAPIList(this.constructor,e)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(i=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class e1 extends eJ{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await eY(e,t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}class e2 extends e0{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let e=this.first_id;return e?{...this.options,query:{...ew(this.options.query),before_id:e}}:null}let e=this.last_id;return e?{...this.options,query:{...ew(this.options.query),after_id:e}}:null}}let e6=()=>{if("undefined"==typeof File){let{process:e}=globalThis;throw Error("`File` is not defined as a global, which is required for file uploads."+("string"==typeof e?.versions?.node&&20>parseInt(e.versions.node.split("."))?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function e4(e,t,n){return e6(),new File(e,t??"unknown_file",n)}function e3(e){return("object"==typeof e&&null!==e&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}let e5=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],e8=async(e,t)=>({...e,body:await e9(e.body,t)}),e7=new WeakMap,e9=async(e,t)=>{if(!await function(e){let t="function"==typeof e?e:e.fetch,n=e7.get(t);if(n)return n;let r=(async()=>{try{let e="Response"in t?t.Response:(await t("data:,")).constructor,n=new FormData;if(n.toString()===await new e(n).text())return!1;return!0}catch{return!0}})();return e7.set(t,r),r}(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>tr(n,e,t))),n},te=e=>e instanceof Blob&&"name"in e,tt=e=>"object"==typeof e&&null!==e&&(e instanceof Response||e5(e)||te(e)),tn=e=>{if(tt(e))return!0;if(Array.isArray(e))return e.some(tn);if(e&&"object"==typeof e){for(let t in e)if(tn(e[t]))return!0}return!1},tr=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(n instanceof Response){let r={},o=n.headers.get("Content-Type");o&&(r={type:o}),e.append(t,e4([await n.blob()],e3(n),r))}else if(e5(n))e.append(t,e4([await new Response(eB(n)).blob()],e3(n)));else if(te(n))e.append(t,e4([n],e3(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(n=>tr(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>tr(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},to=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ta=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&to(e),ti=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob;async function tl(e,t,n){if(e6(),e=await e,t||(t=e3(e)),ta(e))return e instanceof File&&null==t&&null==n?e:e4([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(ti(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),e4(await ts(r),t,n)}let r=await ts(e);if(!n?.type){let e=r.find(e=>"object"==typeof e&&"type"in e&&e.type);"string"==typeof e&&(n={...n,type:e})}return e4(r,t,n)}async function ts(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(to(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(e5(e))for await(let n of e)t.push(...await ts(n));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:""}${function(e){if("object"!=typeof e||null===e)return"";let t=Object.getOwnPropertyNames(e);return`; props: [${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`)}return t}class tc{constructor(e){this._client=e}}let tu=Symbol.for("brand.privateNullableHeaders"),td=Array.isArray,tf=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[o,a]of function*(e){let t;if(!e)return;if(tu in e){let{values:t,nulls:n}=e;for(let e of(yield*t.entries(),n))yield[e,null];return}let n=!1;for(let r of(e instanceof Headers?t=e.entries():td(e)?t=e:(n=!0,t=Object.entries(e??{})),t)){let e=r[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=td(r[1])?r[1]:[r[1]],o=!1;for(let r of t)void 0!==r&&(n&&!o&&(o=!0,yield[e,null]),yield[e,r])}}(r)){let r=o.toLowerCase();e.has(r)||(t.delete(o),e.add(r)),null===a?(t.delete(o),n.add(r)):(t.append(o,a),n.delete(r))}}return{[tu]:!0,values:t,nulls:n}};function tp(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}let th=((e=tp)=>function(t,...n){let r;if(1===t.length)return t[0];let o=!1,a=t.reduce((t,r,a)=>(/[?#]/.test(r)&&(o=!0),t+r+(a===n.length?"":(o?encodeURIComponent:e)(String(n[a])))),""),i=a.split(/[?#]/,1)[0],l=[],s=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;for(;null!==(r=s.exec(i));)l.push({start:r.index,length:r[0].length});if(l.length>0){let e=0,t=l.reduce((t,n)=>{let r=" ".repeat(n.start-e),o="^".repeat(n.length);return e=n.start+n.length,t+r+o},"");throw new ei(`Path parameters result in path with invalid segments:+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199],{12660:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},88009:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},37527:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]},name:"bank",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},9775:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},68208:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83669:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26430:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},5540:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11894:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},44625:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26349:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62670:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},73879:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},29271:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41169:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11741:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},97416:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},6520:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34310:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM472 744a40 40 0 1080 0 40 40 0 10-80 0zm16-104h48c4.4 0 8-3.6 8-8V448c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8z"}}]},name:"file-exclamation",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},38434:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},10798:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71282:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},92403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},48231:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62272:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},45246:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},16601:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},99890:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},28595:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},96473:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},89245:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},69993:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},78355:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},23907:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},55322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},8881:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71891:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41361:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"}}]},name:"team",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58630:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},3632:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},35291:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58747:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}},75105:function(e,t,n){"use strict";n.d(t,{Z:function(){return et}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(87602),s=n(59221),c=n(86757),u=n.n(c),d=n(95645),f=n.n(d),p=n(77571),h=n.n(p),m=n(82559),g=n.n(m),v=n(21652),y=n.n(v),b=n(57165),x=n(81889),w=n(9841),k=n(58772),S=n(34067),E=n(16630),O=n(85355),C=n(82944),j=["layout","type","stroke","connectNulls","isRange","ref"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(i,e);var t,n,r,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=R(i);return e=t?Reflect.construct(n,arguments,R(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return I(e)}(this,e)});function i(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return D(I(e=a.call.apply(a,[this].concat(n))),"state",{isAnimationFinished:!0}),D(I(e),"id",(0,E.EL)("recharts-area-")),D(I(e),"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),u()(t)&&t()}),D(I(e),"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),u()(t)&&t()}),e}return n=[{key:"renderDots",value:function(e,t,n){var r=this.props.isAnimationActive,a=this.state.isAnimationFinished;if(r&&!a)return null;var l=this.props,s=l.dot,c=l.points,u=l.dataKey,d=(0,C.L6)(this.props,!1),f=(0,C.L6)(s,!0),p=c.map(function(e,t){var n=T(T(T({key:"dot-".concat(t),r:3},d),f),{},{dataKey:u,cx:e.x,cy:e.y,index:t,value:e.value,payload:e.payload});return i.renderDotItem(s,n)}),h={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return o.createElement(w.m,P({className:"recharts-area-dots"},h),p)}},{key:"renderHorizontalRect",value:function(e){var t=this.props,n=t.baseLine,r=t.points,a=t.strokeWidth,i=r[0].x,l=r[r.length-1].x,s=e*Math.abs(i-l),c=f()(r.map(function(e){return e.y||0}));return((0,E.hj)(n)&&"number"==typeof n?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(f()(n.map(function(e){return e.y||0})),c)),(0,E.hj)(c))?o.createElement("rect",{x:i<l?i:i-s,y:0,width:s,height:Math.floor(c+(a?parseInt("".concat(a),10):1))}):null}},{key:"renderVerticalRect",value:function(e){var t=this.props,n=t.baseLine,r=t.points,a=t.strokeWidth,i=r[0].y,l=r[r.length-1].y,s=e*Math.abs(i-l),c=f()(r.map(function(e){return e.x||0}));return((0,E.hj)(n)&&"number"==typeof n?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(f()(n.map(function(e){return e.x||0})),c)),(0,E.hj)(c))?o.createElement("rect",{x:0,y:i<l?i:i-s,width:c+(a?parseInt("".concat(a),10):1),height:Math.floor(s)}):null}},{key:"renderClipRect",value:function(e){return"vertical"===this.props.layout?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:"renderAreaStatically",value:function(e,t,n,r){var a=this.props,i=a.layout,l=a.type,s=a.stroke,c=a.connectNulls,u=a.isRange,d=(a.ref,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,j));return o.createElement(w.m,{clipPath:n?"url(#clipPath-".concat(r,")"):null},o.createElement(b.H,P({},(0,C.L6)(d,!0),{points:e,connectNulls:c,type:l,baseLine:t,layout:i,stroke:"none",className:"recharts-area-area"})),"none"!==s&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:e})),"none"!==s&&u&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var n=this,r=this.props,a=r.points,i=r.baseLine,l=r.isAnimationActive,c=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationId,p=this.state,m=p.prevPoints,v=p.prevBaseLine;return o.createElement(s.ZP,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"area-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var l=r.t;if(m){var s,c=m.length/a.length,u=a.map(function(e,t){var n=Math.floor(t*c);if(m[n]){var r=m[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e});return s=(0,E.hj)(i)&&"number"==typeof i?(0,E.k4)(v,i)(l):h()(i)||g()(i)?(0,E.k4)(v,0)(l):i.map(function(e,t){var n=Math.floor(t*c);if(v[n]){var r=v[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e}),n.renderAreaStatically(u,s,e,t)}return o.createElement(w.m,null,o.createElement("defs",null,o.createElement("clipPath",{id:"animationClipPath-".concat(t)},n.renderClipRect(l))),o.createElement(w.m,{clipPath:"url(#animationClipPath-".concat(t,")")},n.renderAreaStatically(a,i,e,t)))})}},{key:"renderArea",value:function(e,t){var n=this.props,r=n.points,o=n.baseLine,a=n.isAnimationActive,i=this.state,l=i.prevPoints,s=i.prevBaseLine,c=i.totalLength;return a&&r&&r.length&&(!l&&c>0||!y()(l,r)||!y()(s,o))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,o,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,a=t.points,i=t.className,s=t.top,c=t.left,u=t.xAxis,d=t.yAxis,f=t.width,p=t.height,m=t.isAnimationActive,g=t.id;if(n||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=1===a.length,b=(0,l.Z)("recharts-area",i),x=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,E=x||S,O=h()(g)?this.id:g,j=null!==(e=(0,C.L6)(r,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,C.$k)(r)?r:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return o.createElement(w.m,{className:b},x||S?o.createElement("defs",null,o.createElement("clipPath",{id:"clipPath-".concat(O)},o.createElement("rect",{x:x?c:c-f/2,y:S?s:s-p/2,width:x?f:2*f,height:S?p:2*p})),!T&&o.createElement("clipPath",{id:"clipPath-dots-".concat(O)},o.createElement("rect",{x:c-A/2,y:s-A/2,width:f+A,height:p+A}))):null,y?null:this.renderArea(E,O),(r||y)&&this.renderDots(E,T,O),(!m||v)&&k.e.renderCallByParent(this.props,a))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],n&&A(i.prototype,n),r&&A(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}(o.PureComponent);D(Z,"displayName","Area"),D(Z,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!S.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),D(Z,"getBaseValue",function(e,t,n,r){var o=e.layout,a=e.baseValue,i=t.props.baseValue,l=null!=i?i:a;if((0,E.hj)(l)&&"number"==typeof l)return l;var s="horizontal"===o?r:n,c=s.scale.domain();if("number"===s.type){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return"dataMin"===l?d:"dataMax"===l?u:u<0?u:Math.max(Math.min(c[0],c[1]),0)}return"dataMin"===l?c[0]:"dataMax"===l?c[1]:c[0]}),D(Z,"getComposedData",function(e){var t,n=e.props,r=e.item,o=e.xAxis,a=e.yAxis,i=e.xAxisTicks,l=e.yAxisTicks,s=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,p=e.offset,h=n.layout,m=u&&u.length,g=Z.getBaseValue(n,r,o,a),v="horizontal"===h,y=!1,b=f.map(function(e,t){m?n=u[d+t]:Array.isArray(n=(0,O.F$)(e,c))?y=!0:n=[g,n];var n,r=null==n[1]||m&&null==(0,O.F$)(e,c);return v?{x:(0,O.Hv)({axis:o,ticks:i,bandSize:s,entry:e,index:t}),y:r?null:a.scale(n[1]),value:n,payload:e}:{x:r?null:o.scale(n[1]),y:(0,O.Hv)({axis:a,ticks:l,bandSize:s,entry:e,index:t}),value:n,payload:e}});return t=m||y?b.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?a.scale(t):null}:{x:null!=t?o.scale(t):null,y:e.y}}):v?a.scale(g):o.scale(g),T({points:b,baseLine:t,layout:h,isRange:y},p)}),D(Z,"renderDotItem",function(e,t){return o.isValidElement(e)?o.cloneElement(e,t):u()(e)?e(t):o.createElement(x.o,P({},t,{className:"recharts-area-dot"}))});var z=n(97059),B=n(62994),F=n(25311),H=(0,i.z)({chartName:"AreaChart",GraphicalChild:Z,axisComponents:[{axisType:"xAxis",AxisComp:z.K},{axisType:"yAxis",AxisComp:B.B}],formatAxisMap:F.t9}),q=n(56940),W=n(8147),U=n(22190),K=n(54061),$=n(65278),V=n(98593),X=n(69448),G=n(32644),Y=n(7084),Q=n(26898),J=n(97324),ee=n(1153);let et=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:l,stack:s=!1,colors:c=Q.s,valueFormatter:u=ee.Cj,startEndOnly:d=!1,showXAxis:f=!0,showYAxis:p=!0,yAxisWidth:h=56,intervalType:m="equidistantPreserveStart",showAnimation:g=!1,animationDuration:v=900,showTooltip:y=!0,showLegend:b=!0,showGridLines:w=!0,showGradient:k=!0,autoMinValue:S=!1,curveType:E="linear",minValue:O,maxValue:C,connectNulls:j=!1,allowDecimals:_=!0,noDataText:P,className:N,onValueChange:T,enableLegendSlider:A=!1,customTooltip:M,rotateLabelX:I,tickGap:R=5}=e,D=(0,r._T)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),L=(f||p)&&(!d||p)?20:0,[F,et]=(0,o.useState)(60),[en,er]=(0,o.useState)(void 0),[eo,ea]=(0,o.useState)(void 0),ei=(0,G.me)(i,c),el=(0,G.i4)(S,O,C),es=!!T;function ec(e){es&&(e===eo&&!en||(0,G.FB)(n,e)&&en&&en.dataKey===e?(ea(void 0),null==T||T(null)):(ea(e),null==T||T({eventType:"category",categoryClicked:e})),er(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,J.q)("w-full h-80",N)},D),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(H,{data:n,onClick:es&&(eo||en)?()=>{er(void 0),ea(void 0),null==T||T(null)}:void 0},w?o.createElement(q.q,{className:(0,J.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(z.K,{padding:{left:L,right:L},hide:!f,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:d?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:d?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:R,angle:null==I?void 0:I.angle,dy:null==I?void 0:I.verticalShift,height:null==I?void 0:I.xAxisHeight}),o.createElement(B.B,{width:h,hide:!p,axisLine:!1,tickLine:!1,type:"number",domain:el,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:_}),o.createElement(W.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:y?e=>{let{active:t,payload:n,label:r}=e;return M?o.createElement(M,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:Y.fr.Gray})}),active:t,label:r}):o.createElement(V.ZP,{active:t,payload:n,label:r,valueFormatter:u,categoryColors:ei})}:o.createElement(o.Fragment,null),position:{y:0}}),b?o.createElement(U.D,{verticalAlign:"top",height:F,content:e=>{let{payload:t}=e;return(0,$.Z)({payload:t},ei,et,eo,es?e=>ec(e):void 0,A)}}):null,i.map(e=>{var t,n;return o.createElement("defs",{key:e},k?o.createElement("linearGradient",{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.15:.4}),o.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):o.createElement("linearGradient",{className:(0,ee.bM)(null!==(n=ei.get(e))&&void 0!==n?n:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.1:.3})))}),i.map(e=>{var t;return o.createElement(Z,{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).strokeColor,strokeOpacity:en||eo&&eo!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(x.o,{className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(t=ei.get(u))&&void 0!==t?t:Y.fr.Gray,Q.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),es&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,G.FB)(n,e.dataKey)&&eo&&eo===e.dataKey?(ea(void 0),er(void 0),null==T||T(null)):(ea(e.dataKey),er({index:e.index,dataKey:e.dataKey}),null==T||T(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,G.FB)(n,e)&&!(en||eo&&eo!==e)||(null==en?void 0:en.index)===f&&(null==en?void 0:en.dataKey)===e?o.createElement(x.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(r=ei.get(d))&&void 0!==r?r:Y.fr.Gray,Q.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:E,dataKey:e,stroke:"",fill:"url(#".concat(ei.get(e),")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:g,animationDuration:v,stackId:s?"a":void 0,connectNulls:j})}),T?i.map(e=>o.createElement(K.x,{className:(0,J.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:E,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:j,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ec(n)}})):null):o.createElement(X.Z,{noDataText:P})))});et.displayName="AreaChart"},40278:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(47625),u=n(93765),d=n(31699),f=n(97059),p=n(62994),h=n(25311),m=(0,u.z)({chartName:"BarChart",GraphicalChild:d.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:f.K},{axisType:"yAxis",AxisComp:p.B}],formatAxisMap:h.t9}),g=n(56940),v=n(8147),y=n(22190),b=n(65278),x=n(98593),w=n(69448),k=n(32644);let S=s.forwardRef((e,t)=>{let{data:n=[],categories:u=[],index:h,colors:S=a.s,valueFormatter:E=l.Cj,layout:O="horizontal",stack:C=!1,relative:j=!1,startEndOnly:_=!1,animationDuration:P=900,showAnimation:N=!1,showXAxis:T=!0,showYAxis:A=!0,yAxisWidth:M=56,intervalType:I="equidistantPreserveStart",showTooltip:R=!0,showLegend:D=!0,showGridLines:L=!0,autoMinValue:Z=!1,minValue:z,maxValue:B,allowDecimals:F=!0,noDataText:H,onValueChange:q,enableLegendSlider:W=!1,customTooltip:U,rotateLabelX:K,tickGap:$=5,className:V}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),G=T||A?20:0,[Y,Q]=(0,s.useState)(60),J=(0,k.me)(u,S),[ee,et]=s.useState(void 0),[en,er]=(0,s.useState)(void 0),eo=!!q;function ea(e,t,n){var r,o,a,i;n.stopPropagation(),q&&((0,k.vZ)(ee,Object.assign(Object.assign({},e.payload),{value:e.value}))?(er(void 0),et(void 0),null==q||q(null)):(er(null===(o=null===(r=e.tooltipPayload)||void 0===r?void 0:r[0])||void 0===o?void 0:o.dataKey),et(Object.assign(Object.assign({},e.payload),{value:e.value})),null==q||q(Object.assign({eventType:"bar",categoryClicked:null===(i=null===(a=e.tooltipPayload)||void 0===a?void 0:a[0])||void 0===i?void 0:i.dataKey},e.payload))))}let ei=(0,k.i4)(Z,z,B);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-80",V)},X),s.createElement(c.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(m,{data:n,stackOffset:C?"sign":j?"expand":"none",layout:"vertical"===O?"vertical":"horizontal",onClick:eo&&(en||ee)?()=>{et(void 0),er(void 0),null==q||q(null)}:void 0},L?s.createElement(g.q,{className:(0,i.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==O,vertical:"vertical"===O}):null,"vertical"!==O?s.createElement(f.K,{padding:{left:G,right:G},hide:!T,dataKey:h,interval:_?"preserveStartEnd":I,tick:{transform:"translate(0, 6)"},ticks:_?[n[0][h],n[n.length-1][h]]:void 0,fill:"",stroke:"",className:(0,i.q)("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight,minTickGap:$}):s.createElement(f.K,{hide:!T,type:"number",tick:{transform:"translate(-3, 0)"},domain:ei,fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:E,minTickGap:$,allowDecimals:F,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight}),"vertical"!==O?s.createElement(p.B,{width:M,hide:!A,axisLine:!1,tickLine:!1,type:"number",domain:ei,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:j?e=>"".concat((100*e).toString()," %"):E,allowDecimals:F}):s.createElement(p.B,{width:M,hide:!A,dataKey:h,axisLine:!1,tickLine:!1,ticks:_?[n[0][h],n[n.length-1][h]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),s.createElement(v.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:R?e=>{let{active:t,payload:n,label:r}=e;return U?s.createElement(U,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=J.get(e.dataKey))&&void 0!==t?t:o.fr.Gray})}),active:t,label:r}):s.createElement(x.ZP,{active:t,payload:n,label:r,valueFormatter:E,categoryColors:J})}:s.createElement(s.Fragment,null),position:{y:0}}),D?s.createElement(y.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,b.Z)({payload:t},J,Q,en,eo?e=>{eo&&(e!==en||ee?(er(e),null==q||q({eventType:"category",categoryClicked:e})):(er(void 0),null==q||q(null)),et(void 0))}:void 0,W)}}):null,u.map(e=>{var t;return s.createElement(d.$,{className:(0,i.q)((0,l.bM)(null!==(t=J.get(e))&&void 0!==t?t:o.fr.Gray,a.K.background).fillColor,q?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:C||j?"a":void 0,dataKey:e,fill:"",isAnimationActive:N,animationDuration:P,shape:e=>((e,t,n,r)=>{let{fillOpacity:o,name:a,payload:i,value:l}=e,{x:c,width:u,y:d,height:f}=e;return"horizontal"===r&&f<0?(d+=f,f=Math.abs(f)):"vertical"===r&&u<0&&(c+=u,u=Math.abs(u)),s.createElement("rect",{x:c,y:d,width:u,height:f,opacity:t||n&&n!==a?(0,k.vZ)(t,Object.assign(Object.assign({},i),{value:l}))?o:.3:o})})(e,ee,en,O),onClick:ea})})):s.createElement(w.Z,{noDataText:H})))});S.displayName="BarChart"},14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return ez}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(60474),u=n(47625),d=n(93765),f=n(86757),p=n.n(f),h=n(9841),m=n(81889),g=n(87602),v=n(82944),y=["points","className","baseLinePoints","connectNulls"];function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return w(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var k=function(e){return e&&e.x===+e.x&&e.y===+e.y},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){k(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),k(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},E=function(e,t){var n=S(e);t&&(n=[n.reduce(function(e,t){return[].concat(x(e),x(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},O=function(e,t,n){var r=E(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(E(t.reverse(),n).slice(1))},C=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,y);if(!t||!t.length)return null;var i=(0,g.Z)("recharts-polygon",n);if(r&&r.length){var l=a.stroke&&"none"!==a.stroke,c=O(t,r,o);return s.createElement("g",{className:i},s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===c.slice(-1)?a.fill:"none",stroke:"none",d:c})),l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(t,o)})):null,l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(r,o)})):null)}var u=E(t,o);return s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===u.slice(-1)?a.fill:"none",className:i,d:u}))},j=n(58811),_=n(41637),P=n(39206);function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(){return(T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(t){L(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z(r.key),r)}}function R(e,t){return(R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t,n){return(t=Z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){var t=function(e,t){if("object"!==N(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==N(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===N(t)?t:String(t)}var z=Math.PI/180,B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=D(a);return e=t?Reflect.construct(n,arguments,D(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===N(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"getTickLineCoord",value:function(e){var t=this.props,n=t.cx,r=t.cy,o=t.radius,a=t.orientation,i=t.tickSize,l=(0,P.op)(n,r,o,e.coordinate),s=(0,P.op)(n,r,o+("inner"===a?-1:1)*(i||8),e.coordinate);return{x1:l.x,y1:l.y,x2:s.x,y2:s.y}}},{key:"getTickTextAnchor",value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*z);return n>1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,a=e.axisLineType,i=M(M({},(0,v.L6)(this.props,!1)),{},{fill:"none"},(0,v.L6)(o,!1));if("circle"===a)return s.createElement(m.o,T({className:"recharts-polar-angle-axis-line"},i,{cx:t,cy:n,r:r}));var l=this.props.ticks.map(function(e){return(0,P.op)(t,n,r,e.coordinate)});return s.createElement(C,T({className:"recharts-polar-angle-axis-line"},i,{points:l}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,i=t.tickFormatter,l=t.stroke,c=(0,v.L6)(this.props,!1),u=(0,v.L6)(r,!1),d=M(M({},c),{},{fill:"none"},(0,v.L6)(o,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),p=M(M(M({textAnchor:e.getTickTextAnchor(t)},c),{},{stroke:"none",fill:l},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return s.createElement(h.m,T({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),o&&s.createElement("line",T({className:"recharts-polar-angle-axis-tick-line"},d,f)),r&&a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?s.createElement(h.m,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,T({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],n&&I(a.prototype,n),r&&I(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);L(B,"displayName","PolarAngleAxis"),L(B,"axisType","angleAxis"),L(B,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var F=n(35802),H=n.n(F),q=n(37891),W=n.n(q),U=n(26680),K=["cx","cy","angle","ticks","axisLine"],$=["ticks","tick","angle","tickFormatter","stroke"];function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(){return(X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach(function(t){en(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,er(r.key),r)}}function ee(e,t){return(ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function et(e){return(et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function en(e,t,n){return(t=er(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(e){var t=function(e,t){if("object"!==V(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==V(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===V(t)?t:String(t)}var eo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=et(a);return e=t?Reflect.construct(n,arguments,et(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===V(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"getTickValueCoord",value:function(e){var t=e.coordinate,n=this.props,r=n.angle,o=n.cx,a=n.cy;return(0,P.op)(o,a,t,r)}},{key:"getTickTextAnchor",value:function(){var e;switch(this.props.orientation){case"left":e="end";break;case"right":e="start";break;default:e="middle"}return e}},{key:"getViewBox",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,o=e.ticks,a=H()(o,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:W()(o,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,o=e.ticks,a=e.axisLine,i=Q(e,K),l=o.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=(0,P.op)(t,n,l[0],r),u=(0,P.op)(t,n,l[1],r),d=Y(Y(Y({},(0,v.L6)(i,!1)),{},{fill:"none"},(0,v.L6)(a,!1)),{},{x1:c.x,y1:c.y,x2:u.x,y2:u.y});return s.createElement("line",X({className:"recharts-polar-radius-axis-line"},d))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.angle,i=t.tickFormatter,l=t.stroke,c=Q(t,$),u=this.getTickTextAnchor(),d=(0,v.L6)(c,!1),f=(0,v.L6)(r,!1),p=n.map(function(t,n){var c=e.getTickValueCoord(t),p=Y(Y(Y(Y({textAnchor:u,transform:"rotate(".concat(90-o,", ").concat(c.x,", ").concat(c.y,")")},d),{},{stroke:"none",fill:l},f),{},{index:n},c),{},{payload:t});return s.createElement(h.m,X({className:"recharts-polar-radius-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return t&&t.length?s.createElement(h.m,{className:"recharts-polar-radius-axis"},n&&this.renderAxisLine(),r&&this.renderTicks(),U._.renderCallByParent(this.props,this.getViewBox())):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,X({},t,{className:"recharts-polar-radius-axis-tick-value"}),n)}}],n&&J(a.prototype,n),r&&J(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);en(eo,"displayName","PolarRadiusAxis"),en(eo,"axisType","radiusAxis"),en(eo,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});var ea=n(59221),ei=n(13735),el=n.n(ei),es=n(21652),ec=n.n(es),eu=n(77571),ed=n.n(eu),ef=n(57165),ep=n(58772),eh=n(20407),em=n(34067),eg=n(16630),ev=n(85355),ey=n(1175),eb=n(11638);function ex(e){return(ex="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(){return(ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(t){e_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eP(r.key),r)}}function eO(e,t){return(eO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eC(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ej(e){return(ej=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e_(e,t,n){return(t=eP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eP(e){var t=function(e,t){if("object"!==ex(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ex(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ex(t)?t:String(t)}var eN=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eO(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=ej(a);return e=t?Reflect.construct(n,arguments,ej(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===ex(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eC(e)}(this,e)});function a(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),e_(eC(t=o.call(this,e)),"pieRef",null),e_(eC(t),"sectorRefs",[]),e_(eC(t),"id",(0,eg.EL)("recharts-pie-")),e_(eC(t),"handleAnimationEnd",function(){var e=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),p()(e)&&e()}),e_(eC(t),"handleAnimationStart",function(){var e=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),p()(e)&&e()}),t.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},t}return n=[{key:"isActiveIndex",value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?-1!==t.indexOf(e):e===t}},{key:"hasActiveIndex",value:function(){var e=this.props.activeIndex;return Array.isArray(e)?0!==e.length:e||0===e}},{key:"renderLabels",value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var t=this.props,n=t.label,r=t.labelLine,o=t.dataKey,i=t.valueKey,l=(0,v.L6)(this.props,!1),c=(0,v.L6)(n,!1),u=(0,v.L6)(r,!1),d=n&&n.offsetRadius||20,f=e.map(function(e,t){var f=(e.startAngle+e.endAngle)/2,p=(0,P.op)(e.cx,e.cy,e.outerRadius+d,f),m=eS(eS(eS(eS({},l),e),{},{stroke:"none"},c),{},{index:t,textAnchor:a.getTextAnchor(p.x,e.cx)},p),g=eS(eS(eS(eS({},l),e),{},{fill:"none",stroke:e.fill},u),{},{index:t,points:[(0,P.op)(e.cx,e.cy,e.outerRadius,f),p],key:"line"}),v=o;return ed()(o)&&ed()(i)?v="value":ed()(o)&&(v=i),s.createElement(h.m,{key:"label-".concat(e.startAngle,"-").concat(e.endAngle)},r&&a.renderLabelLineItem(r,g),a.renderLabelItem(n,m,(0,ev.F$)(e,v)))});return s.createElement(h.m,{className:"recharts-pie-labels"},f)}},{key:"renderSectorsStatically",value:function(e){var t=this,n=this.props,r=n.activeShape,o=n.blendStroke,a=n.inactiveShape;return e.map(function(n,i){if((null==n?void 0:n.startAngle)===0&&(null==n?void 0:n.endAngle)===0&&1!==e.length)return null;var l=t.isActiveIndex(i),c=a&&t.hasActiveIndex()?a:null,u=eS(eS({},n),{},{stroke:o?n.fill:n.stroke,tabIndex:-1});return s.createElement(h.m,ew({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:"recharts-pie-sector"},(0,_.bw)(t.props,n,i),{key:"sector-".concat(null==n?void 0:n.startAngle,"-").concat(null==n?void 0:n.endAngle,"-").concat(n.midAngle)}),s.createElement(eb.bn,ew({option:l?r:c,isActive:l,shapeType:"sector"},u)))})}},{key:"renderSectorsWithAnimation",value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,i=t.animationEasing,l=t.animationId,c=this.state,u=c.prevSectors,d=c.prevIsAnimationActive;return s.createElement(ea.ZP,{begin:o,duration:a,isActive:r,easing:i,from:{t:0},to:{t:1},key:"pie-".concat(l,"-").concat(d),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,o=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=u&&u[t],i=t>0?el()(e,"paddingAngle",0):0;if(n){var l=(0,eg.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),s=eS(eS({},e),{},{startAngle:a+i,endAngle:a+l(r)+i});o.push(s),a=s.endAngle}else{var c=e.endAngle,d=e.startAngle,f=(0,eg.k4)(0,c-d)(r),p=eS(eS({},e),{},{startAngle:a+i,endAngle:a+f+i});o.push(p),a=p.endAngle}}),s.createElement(h.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!ec()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,a=t.label,i=t.cx,l=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eg.hj)(i)||!(0,eg.hj)(l)||!(0,eg.hj)(c)||!(0,eg.hj)(u))return null;var p=(0,g.Z)("recharts-pie",o);return s.createElement(h.m,{tabIndex:this.props.rootTabIndex,className:p,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),U._.renderCallByParent(this.props,null,!1),(!d||f)&&ep.e.renderCallByParent(this.props,r,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e<t?"end":"middle"}},{key:"renderLabelLineItem",value:function(e,t){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(ef.H,ew({},t,{type:"linear",className:"recharts-pie-label-line"}))}},{key:"renderLabelItem",value:function(e,t,n){if(s.isValidElement(e))return s.cloneElement(e,t);var r=n;return p()(e)&&(r=e(t),s.isValidElement(r))?r:s.createElement(j.x,ew({},t,{alignmentBaseline:"middle",className:"recharts-pie-label-text"}),r)}}],n&&eE(a.prototype,n),r&&eE(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);e_(eN,"displayName","Pie"),e_(eN,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!em.x.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0}),e_(eN,"parseDeltaAngle",function(e,t){return(0,eg.uY)(t-e)*Math.min(Math.abs(t-e),360)}),e_(eN,"getRealPieData",function(e){var t=e.props,n=t.data,r=t.children,o=(0,v.L6)(e.props,!1),a=(0,v.NN)(r,eh.b);return n&&n.length?n.map(function(e,t){return eS(eS(eS({payload:e},o),e),a&&a[t]&&a[t].props)}):a&&a.length?a.map(function(e){return eS(eS({},o),e.props)}):[]}),e_(eN,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,o=t.width,a=t.height,i=(0,P.$4)(o,a);return{cx:r+(0,eg.h1)(e.props.cx,o,o/2),cy:n+(0,eg.h1)(e.props.cy,a,a/2),innerRadius:(0,eg.h1)(e.props.innerRadius,i,0),outerRadius:(0,eg.h1)(e.props.outerRadius,i,.8*i),maxRadius:e.props.maxRadius||Math.sqrt(o*o+a*a)/2}}),e_(eN,"getComposedData",function(e){var t,n,r=e.item,o=e.offset,a=eN.getRealPieData(r);if(!a||!a.length)return null;var i=r.props,l=i.cornerRadius,s=i.startAngle,c=i.endAngle,u=i.paddingAngle,d=i.dataKey,f=i.nameKey,p=i.valueKey,h=i.tooltipType,m=Math.abs(r.props.minAngle),g=eN.parseCoordinateOfPie(r,o),v=eN.parseDeltaAngle(s,c),y=Math.abs(v),b=d;ed()(d)&&ed()(p)?((0,ey.Z)(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b="value"):ed()(d)&&((0,ey.Z)(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b=p);var x=a.filter(function(e){return 0!==(0,ev.F$)(e,b,0)}).length,w=y-x*m-(y>=360?x:x-1)*u,k=a.reduce(function(e,t){var n=(0,ev.F$)(t,b,0);return e+((0,eg.hj)(n)?n:0)},0);return k>0&&(t=a.map(function(e,t){var r,o=(0,ev.F$)(e,b,0),a=(0,ev.F$)(e,f,t),i=((0,eg.hj)(o)?o:0)/k,c=(r=t?n.endAngle+(0,eg.uY)(v)*u*(0!==o?1:0):s)+(0,eg.uY)(v)*((0!==o?m:0)+i*w),d=(r+c)/2,p=(g.innerRadius+g.outerRadius)/2,y=[{name:a,value:o,payload:e,dataKey:b,type:h}],x=(0,P.op)(g.cx,g.cy,p,d);return n=eS(eS(eS({percent:i,cornerRadius:l,name:a,tooltipPayload:y,midAngle:d,middleRadius:p,tooltipPosition:x},e),g),{},{value:(0,ev.F$)(e,b),startAngle:r,endAngle:c,payload:e,paddingAngle:(0,eg.uY)(v)*u})})),eS(eS({},g),{},{sectors:t,data:a})});var eT=(0,d.z)({chartName:"PieChart",GraphicalChild:eN,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:B},{axisType:"radiusAxis",AxisComp:eo}],formatAxisMap:P.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eA=n(8147),eM=n(69448),eI=n(98593);let eR=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return s.createElement(eI.$B,null,s.createElement("div",{className:(0,i.q)("px-4 py-2")},s.createElement(eI.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eD=(e,t)=>e.map((e,n)=>{let r=n<t.length?t[n]:o.fr.Gray;return Object.assign(Object.assign({},e),{color:r,className:(0,l.bM)(null!=r?r:o.fr.Gray,a.K.background).fillColor,fill:""})}),eL=(e,t,n,r)=>e||t((0,l.vP)(n.map(e=>e[r]))),eZ=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l}=e;return s.createElement("g",null,s.createElement(c.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l,fill:"",opacity:.3,style:{outline:"none"}}))},ez=s.forwardRef((e,t)=>{let{data:n=[],category:c="value",index:d="name",colors:f=a.s,variant:p="donut",valueFormatter:h=l.Cj,label:m,showLabel:g=!0,animationDuration:v=900,showAnimation:y=!1,showTooltip:b=!0,noDataText:x,onValueChange:w,customTooltip:k,className:S}=e,E=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),O="donut"==p,C=eL(m,h,n,c),[j,_]=s.useState(void 0),P=!!w;return(0,s.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[j]),s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-40",S)},E),s.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(eT,{onClick:P&&j?()=>{_(void 0),null==w||w(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},g&&O?s.createElement("text",{className:(0,i.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},C):null,s.createElement(eN,{className:(0,i.q)("stroke-tremor-background dark:stroke-dark-tremor-background",w?"cursor-pointer":"cursor-default"),data:eD(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:O?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:c,nameKey:d,isAnimationActive:y,animationDuration:v,onClick:function(e,t,n){n.stopPropagation(),P&&(j===t?(_(void 0),null==w||w(null)):(_(t),null==w||w(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:j,inactiveShape:eZ,style:{outline:"none"}}),s.createElement(eA.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:b?e=>{var t;let{active:n,payload:r}=e;return k?s.createElement(k,{payload:null==r?void 0:r.map(e=>{var t,n,a;return Object.assign(Object.assign({},e),{color:null!==(a=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==a?a:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):s.createElement(eR,{active:n,payload:r,valueFormatter:h})}:s.createElement(s.Fragment,null)})):s.createElement(eM.Z,{noDataText:x})))});ez.displayName="DonutChart"},59664:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(54061),s=n(97059),c=n(62994),u=n(25311),d=(0,i.z)({chartName:"LineChart",GraphicalChild:l.x,axisComponents:[{axisType:"xAxis",AxisComp:s.K},{axisType:"yAxis",AxisComp:c.B}],formatAxisMap:u.t9}),f=n(56940),p=n(8147),h=n(22190),m=n(81889),g=n(65278),v=n(98593),y=n(69448),b=n(32644),x=n(7084),w=n(26898),k=n(97324),S=n(1153);let E=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:u,colors:E=w.s,valueFormatter:O=S.Cj,startEndOnly:C=!1,showXAxis:j=!0,showYAxis:_=!0,yAxisWidth:P=56,intervalType:N="equidistantPreserveStart",animationDuration:T=900,showAnimation:A=!1,showTooltip:M=!0,showLegend:I=!0,showGridLines:R=!0,autoMinValue:D=!1,curveType:L="linear",minValue:Z,maxValue:z,connectNulls:B=!1,allowDecimals:F=!0,noDataText:H,className:q,onValueChange:W,enableLegendSlider:U=!1,customTooltip:K,rotateLabelX:$,tickGap:V=5}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),G=j||_?20:0,[Y,Q]=(0,o.useState)(60),[J,ee]=(0,o.useState)(void 0),[et,en]=(0,o.useState)(void 0),er=(0,b.me)(i,E),eo=(0,b.i4)(D,Z,z),ea=!!W;function ei(e){ea&&(e===et&&!J||(0,b.FB)(n,e)&&J&&J.dataKey===e?(en(void 0),null==W||W(null)):(en(e),null==W||W({eventType:"category",categoryClicked:e})),ee(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,k.q)("w-full h-80",q)},X),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(d,{data:n,onClick:ea&&(et||J)?()=>{ee(void 0),en(void 0),null==W||W(null)}:void 0},R?o.createElement(f.q,{className:(0,k.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(s.K,{padding:{left:G,right:G},hide:!j,dataKey:u,interval:C?"preserveStartEnd":N,tick:{transform:"translate(0, 6)"},ticks:C?[n[0][u],n[n.length-1][u]]:void 0,fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:V,angle:null==$?void 0:$.angle,dy:null==$?void 0:$.verticalShift,height:null==$?void 0:$.xAxisHeight}),o.createElement(c.B,{width:P,hide:!_,axisLine:!1,tickLine:!1,type:"number",domain:eo,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:O,allowDecimals:F}),o.createElement(p.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:r}=e;return K?o.createElement(K,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=er.get(e.dataKey))&&void 0!==t?t:x.fr.Gray})}),active:t,label:r}):o.createElement(v.ZP,{active:t,payload:n,label:r,valueFormatter:O,categoryColors:er})}:o.createElement(o.Fragment,null),position:{y:0}}),I?o.createElement(h.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,g.Z)({payload:t},er,Q,et,ea?e=>ei(e):void 0,U)}}):null,i.map(e=>{var t;return o.createElement(l.x,{className:(0,k.q)((0,S.bM)(null!==(t=er.get(e))&&void 0!==t?t:x.fr.Gray,w.K.text).strokeColor),strokeOpacity:J||et&&et!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(m.o,{className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(t=er.get(u))&&void 0!==t?t:x.fr.Gray,w.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),ea&&(e.index===(null==J?void 0:J.index)&&e.dataKey===(null==J?void 0:J.dataKey)||(0,b.FB)(n,e.dataKey)&&et&&et===e.dataKey?(en(void 0),ee(void 0),null==W||W(null)):(en(e.dataKey),ee({index:e.index,dataKey:e.dataKey}),null==W||W(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,b.FB)(n,e)&&!(J||et&&et!==e)||(null==J?void 0:J.index)===f&&(null==J?void 0:J.dataKey)===e?o.createElement(m.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(r=er.get(d))&&void 0!==r?r:x.fr.Gray,w.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:L,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:A,animationDuration:T,connectNulls:B})}),W?i.map(e=>o.createElement(l.x,{className:(0,k.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:L,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:B,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ei(n)}})):null):o.createElement(y.Z,{noDataText:H})))});E.displayName="LineChart"},65278:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(2265);let o=(e,t)=>{let[n,o]=(0,r.useState)(t);(0,r.useEffect)(()=>{let t=()=>{o(window.innerWidth),e()};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e,n])};var a=n(5853),i=n(26898),l=n(97324),s=n(1153);let c=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},u=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},d=(0,s.fn)("Legend"),f=e=>{let{name:t,color:n,onClick:o,activeLegend:a}=e,c=!!o;return r.createElement("li",{className:(0,l.q)(d("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",c?"cursor-pointer":"cursor-default","text-tremor-content",c?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",c?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:e=>{e.stopPropagation(),null==o||o(t,n)}},r.createElement("svg",{className:(0,l.q)("flex-none h-2 w-2 mr-1.5",(0,s.bM)(n,i.K.text).textColor,a&&a!==t?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},r.createElement("circle",{cx:4,cy:4,r:4})),r.createElement("p",{className:(0,l.q)("whitespace-nowrap truncate text-tremor-default","text-tremor-content",c?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",a&&a!==t?"opacity-40":"opacity-100",c?"dark:group-hover:text-dark-tremor-content-emphasis":"")},t))},p=e=>{let{icon:t,onClick:n,disabled:o}=e,[a,i]=r.useState(!1),s=r.useRef(null);return r.useEffect(()=>(a?s.current=setInterval(()=>{null==n||n()},300):clearInterval(s.current),()=>clearInterval(s.current)),[a,n]),(0,r.useEffect)(()=>{o&&(clearInterval(s.current),i(!1))},[o]),r.createElement("button",{type:"button",className:(0,l.q)(d("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:e=>{e.stopPropagation(),null==n||n()},onMouseDown:e=>{e.stopPropagation(),i(!0)},onMouseUp:e=>{e.stopPropagation(),i(!1)}},r.createElement(t,{className:"w-full"}))},h=r.forwardRef((e,t)=>{var n,o;let{categories:s,colors:h=i.s,className:m,onClickLegendItem:g,activeLegend:v,enableLegendSlider:y=!1}=e,b=(0,a._T)(e,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=r.useRef(null),[w,k]=r.useState(null),[S,E]=r.useState(null),O=r.useRef(null),C=(0,r.useCallback)(()=>{let e=null==x?void 0:x.current;e&&k({left:e.scrollLeft>0,right:e.scrollWidth-e.clientWidth>e.scrollLeft})},[k]),j=(0,r.useCallback)(e=>{var t;let n=null==x?void 0:x.current,r=null!==(t=null==n?void 0:n.clientWidth)&&void 0!==t?t:0;n&&y&&(n.scrollTo({left:"left"===e?n.scrollLeft-r:n.scrollLeft+r,behavior:"smooth"}),setTimeout(()=>{C()},400))},[y,C]);r.useEffect(()=>{let e=e=>{"ArrowLeft"===e?j("left"):"ArrowRight"===e&&j("right")};return S?(e(S),O.current=setInterval(()=>{e(S)},300)):clearInterval(O.current),()=>clearInterval(O.current)},[S,j]);let _=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),E(e.key))},P=e=>{e.stopPropagation(),E(null)};return r.useEffect(()=>{let e=null==x?void 0:x.current;return y&&(C(),null==e||e.addEventListener("keydown",_),null==e||e.addEventListener("keyup",P)),()=>{null==e||e.removeEventListener("keydown",_),null==e||e.removeEventListener("keyup",P)}},[C,y]),r.createElement("ol",Object.assign({ref:t,className:(0,l.q)(d("root"),"relative overflow-hidden",m)},b),r.createElement("div",{ref:x,tabIndex:0,className:(0,l.q)("h-full flex",y?(null==w?void 0:w.right)||(null==w?void 0:w.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},s.map((e,t)=>r.createElement(f,{key:"item-".concat(t),name:e,color:h[t],onClick:g,activeLegend:v}))),y&&((null==w?void 0:w.right)||(null==w?void 0:w.left))?r.createElement(r.Fragment,null,r.createElement("div",{className:(0,l.q)("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},r.createElement(p,{icon:c,onClick:()=>{E(null),j("left")},disabled:!(null==w?void 0:w.left)}),r.createElement(p,{icon:u,onClick:()=>{E(null),j("right")},disabled:!(null==w?void 0:w.right)}))):null)});h.displayName="Legend";let m=(e,t,n,a,i,l)=>{let{payload:s}=e,c=(0,r.useRef)(null);o(()=>{var e,t;n((t=null===(e=c.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)});let u=s.filter(e=>"none"!==e.type);return r.createElement("div",{ref:c,className:"flex items-center justify-end"},r.createElement(h,{categories:u.map(e=>e.value),colors:u.map(e=>t.get(e.value)),onClickLegendItem:i,activeLegend:a,enableLegendSlider:l}))}},98593:function(e,t,n){"use strict";n.d(t,{$B:function(){return s},ZP:function(){return u},zX:function(){return c}});var r=n(2265),o=n(7084),a=n(26898),i=n(97324),l=n(1153);let s=e=>{let{children:t}=e;return r.createElement("div",{className:(0,i.q)("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},t)},c=e=>{let{value:t,name:n,color:o}=e;return r.createElement("div",{className:"flex items-center justify-between space-x-8"},r.createElement("div",{className:"flex items-center space-x-2"},r.createElement("span",{className:(0,i.q)("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",(0,l.bM)(o,a.K.background).bgColor)}),r.createElement("p",{className:(0,i.q)("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},n)),r.createElement("p",{className:(0,i.q)("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},t))},u=e=>{let{active:t,payload:n,label:a,categoryColors:l,valueFormatter:u}=e;if(t&&n){let e=n.filter(e=>"none"!==e.type);return r.createElement(s,null,r.createElement("div",{className:(0,i.q)("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},r.createElement("p",{className:(0,i.q)("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},a)),r.createElement("div",{className:(0,i.q)("px-4 py-2 space-y-1")},e.map((e,t)=>{var n;let{value:a,name:i}=e;return r.createElement(c,{key:"id-".concat(t),value:u(a),name:i,color:null!==(n=l.get(i))&&void 0!==n?n:o.fr.Blue})})))}return null}},69448:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(97324),o=n(2265),a=n(5853);let i=(0,n(1153).fn)("Flex"),l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},c={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},u=o.forwardRef((e,t)=>{let{flexDirection:n="row",justifyContent:u="between",alignItems:d="center",children:f,className:p}=e,h=(0,a._T)(e,["flexDirection","justifyContent","alignItems","children","className"]);return o.createElement("div",Object.assign({ref:t,className:(0,r.q)(i("root"),"flex w-full",c[n],l[u],s[d],p)},h),f)});u.displayName="Flex";var d=n(84264);let f=e=>{let{noDataText:t="No data"}=e;return o.createElement(u,{alignItems:"center",justifyContent:"center",className:(0,r.q)("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},o.createElement(d.Z,{className:(0,r.q)("text-tremor-content","dark:text-dark-tremor-content")},t))}},32644:function(e,t,n){"use strict";n.d(t,{FB:function(){return a},i4:function(){return o},me:function(){return r},vZ:function(){return function e(t,n){if(t===n)return!0;if("object"!=typeof t||"object"!=typeof n||null===t||null===n)return!1;let r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(let a of r)if(!o.includes(a)||!e(t[a],n[a]))return!1;return!0}}});let r=(e,t)=>{let n=new Map;return e.forEach((e,r)=>{n.set(e,t[r])}),n},o=(e,t,n)=>[e?"auto":null!=t?t:0,null!=n?n:"auto"];function a(e,t){let n=[];for(let r of e)if(Object.prototype.hasOwnProperty.call(r,t)&&(n.push(r[t]),n.length>1))return!1;return!0}},47323:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(5853),o=n(2265),a=n(1526),i=n(7084),l=n(97324),s=n(1153),c=n(26898);let u={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},d={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},f={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,s.bM)(t,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,l.q)((0,s.bM)(t,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,s.fn)("Icon"),m=o.forwardRef((e,t)=>{let{icon:n,variant:c="simple",tooltip:m,size:g=i.u8.SM,color:v,className:y}=e,b=(0,r._T)(e,["icon","variant","tooltip","size","color","className"]),x=p(c,v),{tooltipProps:w,getReferenceProps:k}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,s.lq)([t,w.refs.setReference]),className:(0,l.q)(h("root"),"inline-flex flex-shrink-0 items-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,f[c].rounded,f[c].border,f[c].shadow,f[c].ring,u[g].paddingX,u[g].paddingY,y)},k,b),o.createElement(a.Z,Object.assign({text:m},w)),o.createElement(n,{className:(0,l.q)(h("icon"),"shrink-0",d[g].height,d[g].width)}))});m.displayName="Icon"},69262:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},l=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var s=n(96398),c=n(97324),u=n(1153);let d=o.forwardRef((e,t)=>{let{value:n,defaultValue:d,type:f,placeholder:p="Type...",icon:h,error:m=!1,errorMessage:g,disabled:v=!1,stepper:y,makeInputClassName:b,className:x,onChange:w,onValueChange:k,autoFocus:S}=e,E=(0,r._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[O,C]=(0,o.useState)(S||!1),[j,_]=(0,o.useState)(!1),P=(0,o.useCallback)(()=>_(!j),[j,_]),N=(0,o.useRef)(null),T=(0,s.Uh)(n||d);return o.useEffect(()=>{let e=()=>C(!0),t=()=>C(!1),n=N.current;return n&&(n.addEventListener("focus",e),n.addEventListener("blur",t),S&&n.focus()),()=>{n&&(n.removeEventListener("focus",e),n.removeEventListener("blur",t))}},[S]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,c.q)(b("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,s.um)(T,v,m),O&&(0,c.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),x)},h?o.createElement(h,{className:(0,c.q)(b("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,u.lq)([N,t]),defaultValue:d,value:n,type:j?"text":f,className:(0,c.q)(b("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",h?"pl-2":"pl-3",m?"pr-3":"pr-4",v?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:v,"data-testid":"base-input",onChange:e=>{null==w||w(e),null==k||k(e.target.value)}},E)),"password"!==f||v?null:o.createElement("button",{className:(0,c.q)(b("toggleButton"),"mr-2"),type:"button",onClick:()=>P(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(l,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(i,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),m?o.createElement(a,{className:(0,c.q)(b("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=y?y:null),m&&g?o.createElement("p",{className:(0,c.q)(b("errorMessage"),"text-sm text-red-500 mt-1")},g):null)});d.displayName="BaseInput"},53003:function(e,t,n){"use strict";let r,o,a;n.d(t,{Z:function(){return nF}});var i,l,s,c,u=n(5853),d=n(2265),f=n(54887),p=n(13323),h=n(64518),m=n(96822),g=n(40293);function v(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,d.useMemo)(()=>(0,g.r)(...t),[...t])}var y=n(72238),b=n(93689);let x=(0,d.createContext)(!1);var w=n(61424),k=n(27847);let S=d.Fragment,E=d.Fragment,O=(0,d.createContext)(null),C=(0,d.createContext)(null);Object.assign((0,k.yV)(function(e,t){var n;let r,o,a=(0,d.useRef)(null),i=(0,b.T)((0,b.h)(e=>{a.current=e}),t),l=v(a),s=function(e){let t=(0,d.useContext)(x),n=(0,d.useContext)(O),r=v(e),[o,a]=(0,d.useState)(()=>{if(!t&&null!==n||w.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return(0,d.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),(0,d.useEffect)(()=>{t||null!==n&&a(n.current)},[n,a,t]),o}(a),[c]=(0,d.useState)(()=>{var e;return w.O.isServer?null:null!=(e=null==l?void 0:l.createElement("div"))?e:null}),u=(0,d.useContext)(C),g=(0,y.H)();return(0,h.e)(()=>{!s||!c||s.contains(c)||(c.setAttribute("data-headlessui-portal",""),s.appendChild(c))},[s,c]),(0,h.e)(()=>{if(c&&u)return u.register(c)},[u,c]),n=()=>{var e;s&&c&&(c instanceof Node&&s.contains(c)&&s.removeChild(c),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))},r=(0,p.z)(n),o=(0,d.useRef)(!1),(0,d.useEffect)(()=>(o.current=!1,()=>{o.current=!0,(0,m.Y)(()=>{o.current&&r()})}),[r]),g&&s&&c?(0,f.createPortal)((0,k.sY)({ourProps:{ref:i},theirProps:e,defaultTag:S,name:"Portal"}),c):null}),{Group:(0,k.yV)(function(e,t){let{target:n,...r}=e,o={ref:(0,b.T)(t)};return d.createElement(O.Provider,{value:n},(0,k.sY)({ourProps:o,theirProps:r,defaultTag:E,name:"Popover.Group"}))})});var j=n(31948),_=n(17684),P=n(98505),N=n(80004),T=n(38198),A=n(3141),M=((r=M||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function I(){let e=(0,d.useRef)(0);return(0,A.s)("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}var R=n(37863),D=n(47634),L=n(37105),Z=n(24536),z=n(37388),B=((o=B||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),F=((a=F||{})[a.TogglePopover=0]="TogglePopover",a[a.ClosePopover=1]="ClosePopover",a[a.SetButton=2]="SetButton",a[a.SetButtonId=3]="SetButtonId",a[a.SetPanel=4]="SetPanel",a[a.SetPanelId=5]="SetPanelId",a);let H={0:e=>{let t={...e,popoverState:(0,Z.E)(e.popoverState,{0:1,1:0})};return 0===t.popoverState&&(t.__demoMode=!1),t},1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},q=(0,d.createContext)(null);function W(e){let t=(0,d.useContext)(q);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Popover /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,W),t}return t}q.displayName="PopoverContext";let U=(0,d.createContext)(null);function K(e){let t=(0,d.useContext)(U);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Popover /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return t}U.displayName="PopoverAPIContext";let $=(0,d.createContext)(null);function V(){return(0,d.useContext)($)}$.displayName="PopoverGroupContext";let X=(0,d.createContext)(null);function G(e,t){return(0,Z.E)(t.type,H,e,t)}X.displayName="PopoverPanelContext";let Y=k.AN.RenderStrategy|k.AN.Static,Q=k.AN.RenderStrategy|k.AN.Static,J=Object.assign((0,k.yV)(function(e,t){var n,r,o,a;let i,l,s,c,u,f;let{__demoMode:h=!1,...m}=e,g=(0,d.useRef)(null),y=(0,b.T)(t,(0,b.h)(e=>{g.current=e})),x=(0,d.useRef)([]),w=(0,d.useReducer)(G,{__demoMode:h,popoverState:h?0:1,buttons:x,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:(0,d.createRef)(),afterPanelSentinel:(0,d.createRef)()}),[{popoverState:S,button:E,buttonId:O,panel:_,panelId:N,beforePanelSentinel:A,afterPanelSentinel:M},I]=w,D=v(null!=(n=g.current)?n:E),z=(0,d.useMemo)(()=>{if(!E||!_)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(E))^Number(null==e?void 0:e.contains(_)))return!0;let e=(0,L.GO)(),t=e.indexOf(E),n=(t+e.length-1)%e.length,r=(t+1)%e.length,o=e[n],a=e[r];return!_.contains(o)&&!_.contains(a)},[E,_]),B=(0,j.E)(O),F=(0,j.E)(N),H=(0,d.useMemo)(()=>({buttonId:B,panelId:F,close:()=>I({type:1})}),[B,F,I]),W=V(),K=null==W?void 0:W.registerPopover,$=(0,p.z)(()=>{var e;return null!=(e=null==W?void 0:W.isFocusWithinPopoverGroup())?e:(null==D?void 0:D.activeElement)&&((null==E?void 0:E.contains(D.activeElement))||(null==_?void 0:_.contains(D.activeElement)))});(0,d.useEffect)(()=>null==K?void 0:K(H),[K,H]);let[Y,Q]=(i=(0,d.useContext)(C),l=(0,d.useRef)([]),s=(0,p.z)(e=>(l.current.push(e),i&&i.register(e),()=>c(e))),c=(0,p.z)(e=>{let t=l.current.indexOf(e);-1!==t&&l.current.splice(t,1),i&&i.unregister(e)}),u=(0,d.useMemo)(()=>({register:s,unregister:c,portals:l}),[s,c,l]),[l,(0,d.useMemo)(()=>function(e){let{children:t}=e;return d.createElement(C.Provider,{value:u},t)},[u])]),J=function(){var e;let{defaultContainers:t=[],portals:n,mainTreeNodeRef:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(0,d.useRef)(null!=(e=null==r?void 0:r.current)?e:null),a=v(o),i=(0,p.z)(()=>{var e,r,i;let l=[];for(let e of t)null!==e&&(e instanceof HTMLElement?l.push(e):"current"in e&&e.current instanceof HTMLElement&&l.push(e.current));if(null!=n&&n.current)for(let e of n.current)l.push(e);for(let t of null!=(e=null==a?void 0:a.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||t.contains(null==(i=null==(r=o.current)?void 0:r.getRootNode())?void 0:i.host)||l.some(e=>t.contains(e))||l.push(t));return l});return{resolveContainers:i,contains:(0,p.z)(e=>i().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,d.useMemo)(()=>function(){return null!=r?null:d.createElement(T._,{features:T.A.Hidden,ref:o})},[o,r])}}({mainTreeNodeRef:null==W?void 0:W.mainTreeNodeRef,portals:Y,defaultContainers:[E,_]});r=null==D?void 0:D.defaultView,o="focus",a=e=>{var t,n,r,o;e.target!==window&&e.target instanceof HTMLElement&&0===S&&($()||E&&_&&(J.contains(e.target)||null!=(n=null==(t=A.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(o=null==(r=M.current)?void 0:r.contains)&&o.call(r,e.target)||I({type:1})))},f=(0,j.E)(a),(0,d.useEffect)(()=>{function e(e){f.current(e)}return(r=null!=r?r:window).addEventListener(o,e,!0),()=>r.removeEventListener(o,e,!0)},[r,o,!0]),(0,P.O)(J.resolveContainers,(e,t)=>{I({type:1}),(0,L.sP)(t,L.tJ.Loose)||(e.preventDefault(),null==E||E.focus())},0===S);let ee=(0,p.z)(e=>{I({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:E:E;null==t||t.focus()}),et=(0,d.useMemo)(()=>({close:ee,isPortalled:z}),[ee,z]),en=(0,d.useMemo)(()=>({open:0===S,close:ee}),[S,ee]);return d.createElement(X.Provider,{value:null},d.createElement(q.Provider,{value:w},d.createElement(U.Provider,{value:et},d.createElement(R.up,{value:(0,Z.E)(S,{0:R.ZM.Open,1:R.ZM.Closed})},d.createElement(Q,null,(0,k.sY)({ourProps:{ref:y},theirProps:m,slot:en,defaultTag:"div",name:"Popover"}),d.createElement(J.MainTreeNode,null))))))}),{Button:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-button-".concat(n),...o}=e,[a,i]=W("Popover.Button"),{isPortalled:l}=K("Popover.Button"),s=(0,d.useRef)(null),c="headlessui-focus-sentinel-".concat((0,_.M)()),u=V(),f=null==u?void 0:u.closeOthers,h=null!==(0,d.useContext)(X);(0,d.useEffect)(()=>{if(!h)return i({type:3,buttonId:r}),()=>{i({type:3,buttonId:null})}},[h,r,i]);let[m]=(0,d.useState)(()=>Symbol()),g=(0,b.T)(s,t,h?null:e=>{if(e)a.buttons.current.push(m);else{let e=a.buttons.current.indexOf(m);-1!==e&&a.buttons.current.splice(e,1)}a.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),e&&i({type:2,button:e})}),y=(0,b.T)(s,t),x=v(s),w=(0,p.z)(e=>{var t,n,r;if(h){if(1===a.popoverState)return;switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),i({type:1}),null==(r=a.button)||r.focus()}}else switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0});break;case z.R.Escape:if(0!==a.popoverState)return null==f?void 0:f(a.buttonId);if(!s.current||null!=x&&x.activeElement&&!s.current.contains(x.activeElement))return;e.preventDefault(),e.stopPropagation(),i({type:1})}}),S=(0,p.z)(e=>{h||e.key===z.R.Space&&e.preventDefault()}),E=(0,p.z)(t=>{var n,r;(0,D.P)(t.currentTarget)||e.disabled||(h?(i({type:1}),null==(n=a.button)||n.focus()):(t.preventDefault(),t.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0}),null==(r=a.button)||r.focus()))}),O=(0,p.z)(e=>{e.preventDefault(),e.stopPropagation()}),C=0===a.popoverState,j=(0,d.useMemo)(()=>({open:C}),[C]),P=(0,N.f)(e,s),A=h?{ref:y,type:P,onKeyDown:w,onClick:E}:{ref:g,id:a.buttonId,type:P,"aria-expanded":0===a.popoverState,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:w,onKeyUp:S,onClick:E,onMouseDown:O},R=I(),B=(0,p.z)(()=>{let e=a.panel;e&&(0,Z.E)(R.current,{[M.Forwards]:()=>(0,L.jA)(e,L.TO.First),[M.Backwards]:()=>(0,L.jA)(e,L.TO.Last)})===L.fE.Error&&(0,L.jA)((0,L.GO)().filter(e=>"true"!==e.dataset.headlessuiFocusGuard),(0,Z.E)(R.current,{[M.Forwards]:L.TO.Next,[M.Backwards]:L.TO.Previous}),{relativeTo:a.button})});return d.createElement(d.Fragment,null,(0,k.sY)({ourProps:A,theirProps:o,slot:j,defaultTag:"button",name:"Popover.Button"}),C&&!h&&l&&d.createElement(T._,{id:c,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:B}))}),Overlay:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-overlay-".concat(n),...o}=e,[{popoverState:a},i]=W("Popover.Overlay"),l=(0,b.T)(t),s=(0,R.oJ)(),c=null!==s?(s&R.ZM.Open)===R.ZM.Open:0===a,u=(0,p.z)(e=>{if((0,D.P)(e.currentTarget))return e.preventDefault();i({type:1})}),f=(0,d.useMemo)(()=>({open:0===a}),[a]);return(0,k.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:u},theirProps:o,slot:f,defaultTag:"div",features:Y,visible:c,name:"Popover.Overlay"})}),Panel:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-panel-".concat(n),focus:o=!1,...a}=e,[i,l]=W("Popover.Panel"),{close:s,isPortalled:c}=K("Popover.Panel"),u="headlessui-focus-sentinel-before-".concat((0,_.M)()),f="headlessui-focus-sentinel-after-".concat((0,_.M)()),m=(0,d.useRef)(null),g=(0,b.T)(m,t,e=>{l({type:4,panel:e})}),y=v(m),x=(0,k.Y2)();(0,h.e)(()=>(l({type:5,panelId:r}),()=>{l({type:5,panelId:null})}),[r,l]);let w=(0,R.oJ)(),S=null!==w?(w&R.ZM.Open)===R.ZM.Open:0===i.popoverState,E=(0,p.z)(e=>{var t;if(e.key===z.R.Escape){if(0!==i.popoverState||!m.current||null!=y&&y.activeElement&&!m.current.contains(y.activeElement))return;e.preventDefault(),e.stopPropagation(),l({type:1}),null==(t=i.button)||t.focus()}});(0,d.useEffect)(()=>{var t;e.static||1===i.popoverState&&(null==(t=e.unmount)||t)&&l({type:4,panel:null})},[i.popoverState,e.unmount,e.static,l]),(0,d.useEffect)(()=>{if(i.__demoMode||!o||0!==i.popoverState||!m.current)return;let e=null==y?void 0:y.activeElement;m.current.contains(e)||(0,L.jA)(m.current,L.TO.First)},[i.__demoMode,o,m,i.popoverState]);let O=(0,d.useMemo)(()=>({open:0===i.popoverState,close:s}),[i,s]),C={ref:g,id:r,onKeyDown:E,onBlur:o&&0===i.popoverState?e=>{var t,n,r,o,a;let s=e.relatedTarget;s&&m.current&&(null!=(t=m.current)&&t.contains(s)||(l({type:1}),(null!=(r=null==(n=i.beforePanelSentinel.current)?void 0:n.contains)&&r.call(n,s)||null!=(a=null==(o=i.afterPanelSentinel.current)?void 0:o.contains)&&a.call(o,s))&&s.focus({preventScroll:!0})))}:void 0,tabIndex:-1},j=I(),P=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var t;(0,L.jA)(e,L.TO.First)===L.fE.Error&&(null==(t=i.afterPanelSentinel.current)||t.focus())},[M.Backwards]:()=>{var e;null==(e=i.button)||e.focus({preventScroll:!0})}})}),N=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var e;if(!i.button)return;let t=(0,L.GO)(),n=t.indexOf(i.button),r=t.slice(0,n+1),o=[...t.slice(n+1),...r];for(let t of o.slice())if("true"===t.dataset.headlessuiFocusGuard||null!=(e=i.panel)&&e.contains(t)){let e=o.indexOf(t);-1!==e&&o.splice(e,1)}(0,L.jA)(o,L.TO.First,{sorted:!1})},[M.Backwards]:()=>{var t;(0,L.jA)(e,L.TO.Previous)===L.fE.Error&&(null==(t=i.button)||t.focus())}})});return d.createElement(X.Provider,{value:r},S&&c&&d.createElement(T._,{id:u,ref:i.beforePanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:P}),(0,k.sY)({mergeRefs:x,ourProps:C,theirProps:a,slot:O,defaultTag:"div",features:Q,visible:S,name:"Popover.Panel"}),S&&c&&d.createElement(T._,{id:f,ref:i.afterPanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:N}))}),Group:(0,k.yV)(function(e,t){let n;let r=(0,d.useRef)(null),o=(0,b.T)(r,t),[a,i]=(0,d.useState)([]),l={mainTreeNodeRef:n=(0,d.useRef)(null),MainTreeNode:(0,d.useMemo)(()=>function(){return d.createElement(T._,{features:T.A.Hidden,ref:n})},[n])},s=(0,p.z)(e=>{i(t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t})}),c=(0,p.z)(e=>(i(t=>[...t,e]),()=>s(e))),u=(0,p.z)(()=>{var e;let t=(0,g.r)(r);if(!t)return!1;let n=t.activeElement;return!!(null!=(e=r.current)&&e.contains(n))||a.some(e=>{var r,o;return(null==(r=t.getElementById(e.buttonId.current))?void 0:r.contains(n))||(null==(o=t.getElementById(e.panelId.current))?void 0:o.contains(n))})}),f=(0,p.z)(e=>{for(let t of a)t.buttonId.current!==e&&t.close()}),h=(0,d.useMemo)(()=>({registerPopover:c,unregisterPopover:s,isFocusWithinPopoverGroup:u,closeOthers:f,mainTreeNodeRef:l.mainTreeNodeRef}),[c,s,u,f,l.mainTreeNodeRef]),m=(0,d.useMemo)(()=>({}),[]);return d.createElement($.Provider,{value:h},(0,k.sY)({ourProps:{ref:o},theirProps:e,slot:m,defaultTag:"div",name:"Popover.Group"}),d.createElement(l.MainTreeNode,null))})});var ee=n(33044),et=n(28517);let en=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};var er=n(4537),eo=n(99735),ea=n(7656);function ei(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setHours(0,0,0,0),t}function el(){return ei(Date.now())}function es(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setDate(1),t.setHours(0,0,0,0),t}var ec=n(97324),eu=n(96398),ed=n(41154);function ef(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)}),n||new Date(NaN)}function ep(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)}),n||new Date(NaN)}var eh=n(25721),em=n(47869);function eg(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,-n)}var ev=n(55463);function ey(e,t){if((0,ea.Z)(2,arguments),!t||"object"!==(0,ed.Z)(t))return new Date(NaN);var n=t.years?(0,em.Z)(t.years):0,r=t.months?(0,em.Z)(t.months):0,o=t.weeks?(0,em.Z)(t.weeks):0,a=t.days?(0,em.Z)(t.days):0,i=t.hours?(0,em.Z)(t.hours):0,l=t.minutes?(0,em.Z)(t.minutes):0,s=t.seconds?(0,em.Z)(t.seconds):0;return new Date(eg(function(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,-n)}(e,r+12*n),a+7*o).getTime()-1e3*(s+60*(l+60*i)))}function eb(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ex(e){return(0,ea.Z)(1,arguments),e instanceof Date||"object"===(0,ed.Z)(e)&&"[object Date]"===Object.prototype.toString.call(e)}function ew(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCDay();return t.setUTCDate(t.getUTCDate()-((n<1?7:0)+n-1)),t.setUTCHours(0,0,0,0),t}function ek(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=ew(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=ew(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}var eS={};function eE(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getUTCDay();return d.setUTCDate(d.getUTCDate()-((f<u?7:0)+f-u)),d.setUTCHours(0,0,0,0),d}function eO(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getUTCFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var h=eE(p,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var g=eE(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}function eC(e,t){for(var n=Math.abs(e).toString();n.length<t;)n="0"+n;return(e<0?"-":"")+n}var ej={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return eC("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):eC(n+1,2)},d:function(e,t){return eC(e.getUTCDate(),t.length)},h:function(e,t){return eC(e.getUTCHours()%12||12,t.length)},H:function(e,t){return eC(e.getUTCHours(),t.length)},m:function(e,t){return eC(e.getUTCMinutes(),t.length)},s:function(e,t){return eC(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length;return eC(Math.floor(e.getUTCMilliseconds()*Math.pow(10,n-3)),t.length)}},e_={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function eP(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+(t||"")+eC(a,2)}function eN(e,t){return e%60==0?(e>0?"-":"+")+eC(Math.abs(e)/60,2):eT(e,t)}function eT(e,t){var n=Math.abs(e);return(e>0?"-":"+")+eC(Math.floor(n/60),2)+(t||"")+eC(n%60,2)}var eA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return ej.y(e,t)},Y:function(e,t,n,r){var o=eO(e,r),a=o>0?o:1-o;return"YY"===t?eC(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):eC(a,t.length)},R:function(e,t){return eC(ek(e),t.length)},u:function(e,t){return eC(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return eC(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return eC(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return ej.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return eC(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((eE(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=eO(e,t),f=new Date(0);return f.setUTCFullYear(d,0,u),f.setUTCHours(0,0,0,0),eE(f,t)})(n,t).getTime())/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):eC(o,t.length)},I:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((ew(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=ek(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),ew(n)})(t).getTime())/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):eC(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):ej.d(e,t)},D:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getTime();return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),Math.floor((n-t.getTime())/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):eC(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return eC(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return eC(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return eC(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?e_.noon:0===o?e_.midnight:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?e_.evening:o>=12?e_.afternoon:o>=4?e_.morning:e_.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ej.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ej.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):ej.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):ej.s(e,t)},S:function(e,t){return ej.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return eN(o);case"XXXX":case"XX":return eT(o);default:return eT(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return eN(o);case"xxxx":case"xx":return eT(o);default:return eT(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},t:function(e,t,n,r){return eC(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return eC((r._originalDate||e).getTime(),t.length)}},eM=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},eI=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},eR={p:eI,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],a=r[2];if(!a)return eM(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",eM(o,t)).replace("{{time}}",eI(a,t))}};function eD(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var eL=["D","DD"],eZ=["YY","YYYY"];function ez(e,t,n){if("YYYY"===e)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var eB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function eF(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var eH={date:eF({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:eF({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:eF({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},eq={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function eW(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!=n&&n.width?String(n.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var i=e.defaultWidth,l=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[i]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function eU(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var l=i[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(s,function(e){return e.test(l)}):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(s,function(e){return e.test(l)});return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(l.length)}}}var eK={code:"en-US",formatDistance:function(e,t,n){var r,o=eB[e];return(r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix)?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:eH,formatRelative:function(e,t,n,r){return eq[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:eW({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:eW({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:eW({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:eW({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:eW({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(i={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(i.matchPattern);if(!n)return null;var r=n[0],o=e.match(i.parsePattern);if(!o)return null;var a=i.valueCallback?i.valueCallback(o[0]):o[0];return{value:a=t.valueCallback?t.valueCallback(a):a,rest:e.slice(r.length)}}),era:eU({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:eU({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:eU({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:eU({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:eU({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},e$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eX=/^'([^]*?)'?$/,eG=/''/g,eY=/[a-zA-Z]/;function eQ(e,t,n){(0,ea.Z)(2,arguments);var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w=String(t),k=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:eS.locale)&&void 0!==r?r:eK,S=(0,em.Z)(null!==(a=null!==(i=null!==(l=null!==(s=null==n?void 0:n.firstWeekContainsDate)&&void 0!==s?s:null==n?void 0:null===(c=n.locale)||void 0===c?void 0:null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==l?l:eS.firstWeekContainsDate)&&void 0!==i?i:null===(d=eS.locale)||void 0===d?void 0:null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==a?a:1);if(!(S>=1&&S<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=(0,em.Z)(null!==(p=null!==(h=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n?void 0:null===(v=n.locale)||void 0===v?void 0:null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:eS.weekStartsOn)&&void 0!==h?h:null===(b=eS.locale)||void 0===b?void 0:null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(E>=0&&E<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw RangeError("locale must contain localize property");if(!k.formatLong)throw RangeError("locale must contain formatLong property");var O=(0,eo.Z)(e);if(!function(e){return(0,ea.Z)(1,arguments),(!!ex(e)||"number"==typeof e)&&!isNaN(Number((0,eo.Z)(e)))}(O))throw RangeError("Invalid time value");var C=eD(O),j=function(e,t){return(0,ea.Z)(2,arguments),function(e,t){return(0,ea.Z)(2,arguments),new Date((0,eo.Z)(e).getTime()+(0,em.Z)(t))}(e,-(0,em.Z)(t))}(O,C),_={firstWeekContainsDate:S,weekStartsOn:E,locale:k,_originalDate:O};return w.match(eV).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,eR[t])(e,k.formatLong):e}).join("").match(e$).map(function(r){if("''"===r)return"'";var o,a=r[0];if("'"===a)return(o=r.match(eX))?o[1].replace(eG,"'"):r;var i=eA[a];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===eZ.indexOf(r)||ez(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||-1===eL.indexOf(r)||ez(r,t,String(e)),i(j,r,k.localize,_);if(a.match(eY))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r}).join("")}var eJ=n(1153);let e0=(0,eJ.fn)("DateRangePicker"),e1=(e,t,n,r)=>{var o;if(n&&(e=null===(o=r.get(n))||void 0===o?void 0:o.from),e)return ei(e&&!t?e:ef([e,t]))},e2=(e,t,n,r)=>{var o,a;if(n&&(e=ei(null!==(a=null===(o=r.get(n))||void 0===o?void 0:o.to)&&void 0!==a?a:el())),e)return ei(e&&!t?e:ep([e,t]))},e6=[{value:"tdy",text:"Today",from:el()},{value:"w",text:"Last 7 days",from:ey(el(),{days:7})},{value:"t",text:"Last 30 days",from:ey(el(),{days:30})},{value:"m",text:"Month to Date",from:es(el())},{value:"y",text:"Year to Date",from:eb(el())}],e4=(e,t,n,r)=>{let o=(null==n?void 0:n.code)||"en-US";if(!e&&!t)return"";if(e&&!t)return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e&&t){if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()===r.getTime()}(e,t))return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())return r?"".concat(eQ(e,r)," - ").concat(eQ(t,r)):"".concat(e.toLocaleDateString(o,{month:"short",day:"numeric"})," - \n ").concat(t.getDate(),", ").concat(t.getFullYear());{if(r)return"".concat(eQ(e,r)," - ").concat(eQ(t,r));let n={year:"numeric",month:"short",day:"numeric"};return"".concat(e.toLocaleDateString(o,n)," - \n ").concat(t.toLocaleDateString(o,n))}}return""};function e3(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function e5(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t),o=n.getFullYear(),a=n.getDate(),i=new Date(0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);var l=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(i);return n.setMonth(r,Math.min(a,l)),n}function e8(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function e7(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function e9(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function te(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()<r.getTime()}function tt(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()-((f<u?7:0)+f-u)),d.setHours(0,0,0,0),d}function tn(e){return(0,ea.Z)(1,arguments),tt(e,{weekStartsOn:1})}function tr(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return n.getTime()===r.getTime()}function to(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()>r.getTime()}function ta(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return Math.round((n.getTime()-eD(n)-(r.getTime()-eD(r)))/864e5)}function ti(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,7*n)}function tl(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,12*n)}function ts(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()+((f<u?-7:0)+6-(f-u))),d.setHours(23,59,59,999),d}function tc(e){return(0,ea.Z)(1,arguments),ts(e,{weekStartsOn:1})}var tu=function(){return(tu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function td(e,t,n){if(n||2==arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tf={exports:{}},tp={};tf.exports=function(){if(s)return tp;s=1;var e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(t,a,i){var l,s={},c=null,u=null;for(l in void 0!==i&&(c=""+i),void 0!==a.key&&(c=""+a.key),void 0!==a.ref&&(u=a.ref),a)n.call(a,l)&&!o.hasOwnProperty(l)&&(s[l]=a[l]);if(t&&t.defaultProps)for(l in a=t.defaultProps)void 0===s[l]&&(s[l]=a[l]);return{$$typeof:e,type:t,key:c,ref:u,props:s,_owner:r.current}}return tp.Fragment=t,tp.jsx=a,tp.jsxs=a,tp}();var th=tf.exports;function tm(e){return"multiple"===e.mode}function tg(e){return"range"===e.mode}function tv(e){return"single"===e.mode}var ty={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"},tb=Object.freeze({__proto__:null,formatCaption:function(e,t){return eQ(e,"LLLL y",t)},formatDay:function(e,t){return eQ(e,"d",t)},formatMonthCaption:function(e,t){return eQ(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return eQ(e,"cccccc",t)},formatYearCaption:function(e,t){return eQ(e,"yyyy",t)}}),tx=Object.freeze({__proto__:null,labelDay:function(e,t,n){return eQ(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return eQ(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}}),tw=(0,d.createContext)(void 0);function tk(e){var t,n,r,o,a,i,l,s,c=e.initialProps,u={captionLayout:"buttons",classNames:ty,formatters:tb,labels:tx,locale:eK,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},d=(t=c.fromYear,n=c.toYear,r=c.fromMonth,o=c.toMonth,a=c.fromDate,i=c.toDate,r?a=es(r):t&&(a=new Date(t,0,1)),o?i=e3(o):n&&(i=new Date(n,11,31)),{fromDate:a?ei(a):void 0,toDate:i?ei(i):void 0}),f=d.fromDate,p=d.toDate,h=null!==(l=c.captionLayout)&&void 0!==l?l:u.captionLayout;"buttons"===h||f&&p||(h="buttons"),(tv(c)||tm(c)||tg(c))&&(s=c.onSelect);var m=tu(tu(tu({},u),c),{captionLayout:h,classNames:tu(tu({},u.classNames),c.classNames),components:tu({},c.components),formatters:tu(tu({},u.formatters),c.formatters),fromDate:f,labels:tu(tu({},u.labels),c.labels),mode:c.mode||u.mode,modifiers:tu(tu({},u.modifiers),c.modifiers),modifiersClassNames:tu(tu({},u.modifiersClassNames),c.modifiersClassNames),onSelect:s,styles:tu(tu({},u.styles),c.styles),toDate:p});return th.jsx(tw.Provider,{value:m,children:e.children})}function tS(){var e=(0,d.useContext)(tw);if(!e)throw Error("useDayPicker must be used within a DayPickerProvider.");return e}function tE(e){var t=tS(),n=t.locale,r=t.classNames,o=t.styles,a=t.formatters.formatCaption;return th.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:n})})}function tO(e){return th.jsx("svg",tu({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:th.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tC(e){var t,n,r=e.onChange,o=e.value,a=e.children,i=e.caption,l=e.className,s=e.style,c=tS(),u=null!==(n=null===(t=c.components)||void 0===t?void 0:t.IconDropdown)&&void 0!==n?n:tO;return th.jsxs("div",{className:l,style:s,children:[th.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),th.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:a}),th.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[i,th.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function tj(e){var t,n=tS(),r=n.fromDate,o=n.toDate,a=n.styles,i=n.locale,l=n.formatters.formatMonthCaption,s=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r||!o)return th.jsx(th.Fragment,{});var d=[];if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()}(r,o))for(var f=es(r),p=r.getMonth();p<=o.getMonth();p++)d.push(e5(f,p));else for(var f=es(new Date),p=0;p<=11;p++)d.push(e5(f,p));var h=null!==(t=null==c?void 0:c.Dropdown)&&void 0!==t?t:tC;return th.jsx(h,{name:"months","aria-label":u(),className:s.dropdown_month,style:a.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=e5(es(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:i}),children:d.map(function(e){return th.jsx("option",{value:e.getMonth(),children:l(e,{locale:i})},e.getMonth())})})}function t_(e){var t,n=e.displayMonth,r=tS(),o=r.fromDate,a=r.toDate,i=r.locale,l=r.styles,s=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!o||!a)return th.jsx(th.Fragment,{});for(var p=o.getFullYear(),h=a.getFullYear(),m=p;m<=h;m++)f.push(e8(eb(new Date),m));var g=null!==(t=null==c?void 0:c.Dropdown)&&void 0!==t?t:tC;return th.jsx(g,{name:"years","aria-label":d(),className:s.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=e8(es(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:u(n,{locale:i}),children:f.map(function(e){return th.jsx("option",{value:e.getFullYear(),children:u(e,{locale:i})},e.getFullYear())})})}var tP=(0,d.createContext)(void 0);function tN(e){var t,n,r,o,a,i,l,s,c,u,f,p,h,m,g,v,y=tS(),b=(g=(r=(n=t=tS()).month,o=n.defaultMonth,a=n.today,i=r||o||a||new Date,l=n.toDate,s=n.fromDate,c=n.numberOfMonths,l&&0>e7(l,i)&&(i=(0,ev.Z)(l,-1*((void 0===c?1:c)-1))),s&&0>e7(i,s)&&(i=s),u=es(i),f=t.month,h=(p=(0,d.useState)(u))[0],m=[void 0===f?h:f,p[1]])[0],v=m[1],[g,function(e){if(!t.disableNavigation){var n,r=es(e);v(r),null===(n=t.onMonthChange)||void 0===n||n.call(t,r)}}]),x=b[0],w=b[1],k=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=es(e),a=e7(es((0,ev.Z)(o,r)),o),i=[],l=0;l<a;l++){var s=(0,ev.Z)(o,l);i.push(s)}return n&&(i=i.reverse()),i}(x,y),S=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=es(e);if(!n||!(e7(n,e)<a))return(0,ev.Z)(i,r?a:1)}}(x,y),E=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,a=es(e);if(!n||!(0>=e7(a,n)))return(0,ev.Z)(a,-(r?void 0===o?1:o:1))}}(x,y),O=function(e){return k.some(function(t){return e9(e,t)})};return th.jsx(tP.Provider,{value:{currentMonth:x,displayMonths:k,goToMonth:w,goToDate:function(e,t){O(e)||(t&&te(e,t)?w((0,ev.Z)(e,1+-1*y.numberOfMonths)):w(e))},previousMonth:E,nextMonth:S,isDateDisplayed:O},children:e.children})}function tT(){var e=(0,d.useContext)(tP);if(!e)throw Error("useNavigation must be used within a NavigationProvider");return e}function tA(e){var t,n=tS(),r=n.classNames,o=n.styles,a=n.components,i=tT().goToMonth,l=function(t){i((0,ev.Z)(t,e.displayIndex?-e.displayIndex:0))},s=null!==(t=null==a?void 0:a.CaptionLabel)&&void 0!==t?t:tE,c=th.jsx(s,{id:e.id,displayMonth:e.displayMonth});return th.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[th.jsx("div",{className:r.vhidden,children:c}),th.jsx(tj,{onChange:l,displayMonth:e.displayMonth}),th.jsx(t_,{onChange:l,displayMonth:e.displayMonth})]})}function tM(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tI(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var tR=(0,d.forwardRef)(function(e,t){var n=tS(),r=n.classNames,o=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var i=a.join(" "),l=tu(tu({},o.button_reset),o.button);return e.style&&Object.assign(l,e.style),th.jsx("button",tu({},e,{ref:t,type:"button",className:i,style:l}))});function tD(e){var t,n,r=tS(),o=r.dir,a=r.locale,i=r.classNames,l=r.styles,s=r.labels,c=s.labelPrevious,u=s.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return th.jsx(th.Fragment,{});var f=c(e.previousMonth,{locale:a}),p=[i.nav_button,i.nav_button_previous].join(" "),h=u(e.nextMonth,{locale:a}),m=[i.nav_button,i.nav_button_next].join(" "),g=null!==(t=null==d?void 0:d.IconRight)&&void 0!==t?t:tI,v=null!==(n=null==d?void 0:d.IconLeft)&&void 0!==n?n:tM;return th.jsxs("div",{className:i.nav,style:l.nav,children:[!e.hidePrevious&&th.jsx(tR,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===o?th.jsx(g,{className:i.nav_icon,style:l.nav_icon}):th.jsx(v,{className:i.nav_icon,style:l.nav_icon})}),!e.hideNext&&th.jsx(tR,{name:"next-month","aria-label":h,className:m,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===o?th.jsx(v,{className:i.nav_icon,style:l.nav_icon}):th.jsx(g,{className:i.nav_icon,style:l.nav_icon})})]})}function tL(e){var t=tS().numberOfMonths,n=tT(),r=n.previousMonth,o=n.nextMonth,a=n.goToMonth,i=n.displayMonths,l=i.findIndex(function(t){return e9(e.displayMonth,t)}),s=0===l,c=l===i.length-1;return th.jsx(tD,{displayMonth:e.displayMonth,hideNext:t>1&&(s||!c),hidePrevious:t>1&&(c||!s),nextMonth:o,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){o&&a(o)}})}function tZ(e){var t,n,r=tS(),o=r.classNames,a=r.disableNavigation,i=r.styles,l=r.captionLayout,s=r.components,c=null!==(t=null==s?void 0:s.CaptionLabel)&&void 0!==t?t:tE;return n=a?th.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?th.jsx(tA,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?th.jsxs(th.Fragment,{children:[th.jsx(tA,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),th.jsx(tL,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):th.jsxs(th.Fragment,{children:[th.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(tL,{displayMonth:e.displayMonth,id:e.id})]}),th.jsx("div",{className:o.caption,style:i.caption,children:n})}function tz(e){var t=tS(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?th.jsx("tfoot",{className:o,style:r.tfoot,children:th.jsx("tr",{children:th.jsx("td",{colSpan:8,children:n})})}):th.jsx(th.Fragment,{})}function tB(){var e=tS(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,a=e.weekStartsOn,i=e.ISOWeek,l=e.formatters.formatWeekdayName,s=e.labels.labelWeekday,c=function(e,t,n){for(var r=n?tn(new Date):tt(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=(0,eh.Z)(r,a);o.push(i)}return o}(o,a,i);return th.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&th.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(e,r){return th.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":s(e,{locale:o}),children:l(e,{locale:o})},r)})]})}function tF(){var e,t=tS(),n=t.classNames,r=t.styles,o=t.components,a=null!==(e=null==o?void 0:o.HeadRow)&&void 0!==e?e:tB;return th.jsx("thead",{style:r.head,className:n.head,children:th.jsx(a,{})})}function tH(e){var t=tS(),n=t.locale,r=t.formatters.formatDay;return th.jsx(th.Fragment,{children:r(e.date,{locale:n})})}var tq=(0,d.createContext)(void 0);function tW(e){return tm(e.initialProps)?th.jsx(tU,{initialProps:e.initialProps,children:e.children}):th.jsx(tq.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function tU(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,a=t.max,i={disabled:[]};return r&&i.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return tr(t,e)});return!!(t&&!n)}),th.jsx(tq.Provider,{value:{selected:r,onDayClick:function(e,n,i){if(null===(l=t.onDayClick)||void 0===l||l.call(t,e,n,i),(!n.selected||!o||(null==r?void 0:r.length)!==o)&&(n.selected||!a||(null==r?void 0:r.length)!==a)){var l,s,c=r?td([],r,!0):[];if(n.selected){var u=c.findIndex(function(t){return tr(e,t)});c.splice(u,1)}else c.push(e);null===(s=t.onSelect)||void 0===s||s.call(t,c,e,n,i)}},modifiers:i},children:n})}function tK(){var e=(0,d.useContext)(tq);if(!e)throw Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var t$=(0,d.createContext)(void 0);function tV(e){return tg(e.initialProps)?th.jsx(tX,{initialProps:e.initialProps,children:e.children}):th.jsx(t$.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function tX(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},a=o.from,i=o.to,l=t.min,s=t.max,c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(c.range_start=[a],i?(c.range_end=[i],tr(a,i)||(c.range_middle=[{after:a,before:i}])):c.range_end=[a]):i&&(c.range_start=[i],c.range_end=[i]),l&&(a&&!i&&c.disabled.push({after:eg(a,l-1),before:(0,eh.Z)(a,l-1)}),a&&i&&c.disabled.push({after:a,before:(0,eh.Z)(a,l-1)}),!a&&i&&c.disabled.push({after:eg(i,l-1),before:(0,eh.Z)(i,l-1)})),s){if(a&&!i&&(c.disabled.push({before:(0,eh.Z)(a,-s+1)}),c.disabled.push({after:(0,eh.Z)(a,s-1)})),a&&i){var u=s-(ta(i,a)+1);c.disabled.push({before:eg(a,u)}),c.disabled.push({after:(0,eh.Z)(i,u)})}!a&&i&&(c.disabled.push({before:(0,eh.Z)(i,-s+1)}),c.disabled.push({after:(0,eh.Z)(i,s-1)}))}return th.jsx(t$.Provider,{value:{selected:r,onDayClick:function(e,n,o){null===(s=t.onDayClick)||void 0===s||s.call(t,e,n,o);var a,i,l,s,c,u=(i=(a=r||{}).from,l=a.to,i&&l?tr(l,e)&&tr(i,e)?void 0:tr(l,e)?{from:l,to:void 0}:tr(i,e)?void 0:to(i,e)?{from:e,to:l}:{from:i,to:e}:l?to(e,l)?{from:l,to:e}:{from:e,to:l}:i?te(e,i)?{from:e,to:i}:{from:i,to:e}:{from:e,to:void 0});null===(c=t.onSelect)||void 0===c||c.call(t,u,e,n,o)},modifiers:c},children:n})}function tG(){var e=(0,d.useContext)(t$);if(!e)throw Error("useSelectRange must be used within a SelectRangeProvider");return e}function tY(e){return Array.isArray(e)?td([],e,!0):void 0!==e?[e]:[]}(l=c||(c={})).Outside="outside",l.Disabled="disabled",l.Selected="selected",l.Hidden="hidden",l.Today="today",l.RangeStart="range_start",l.RangeEnd="range_end",l.RangeMiddle="range_middle";var tQ=c.Selected,tJ=c.Disabled,t0=c.Hidden,t1=c.Today,t2=c.RangeEnd,t6=c.RangeMiddle,t4=c.RangeStart,t3=c.Outside,t5=(0,d.createContext)(void 0);function t8(e){var t,n,r,o=tS(),a=tK(),i=tG(),l=((t={})[tQ]=tY(o.selected),t[tJ]=tY(o.disabled),t[t0]=tY(o.hidden),t[t1]=[o.today],t[t2]=[],t[t6]=[],t[t4]=[],t[t3]=[],o.fromDate&&t[tJ].push({before:o.fromDate}),o.toDate&&t[tJ].push({after:o.toDate}),tm(o)?t[tJ]=t[tJ].concat(a.modifiers[tJ]):tg(o)&&(t[tJ]=t[tJ].concat(i.modifiers[tJ]),t[t4]=i.modifiers[t4],t[t6]=i.modifiers[t6],t[t2]=i.modifiers[t2]),t),s=(n=o.modifiers,r={},Object.entries(n).forEach(function(e){var t=e[0],n=e[1];r[t]=tY(n)}),r),c=tu(tu({},l),s);return th.jsx(t5.Provider,{value:c,children:e.children})}function t7(){var e=(0,d.useContext)(t5);if(!e)throw Error("useModifiers must be used within a ModifiersProvider");return e}function t9(e,t,n){var r=Object.keys(t).reduce(function(n,r){return t[r].some(function(t){if("boolean"==typeof t)return t;if(ex(t))return tr(e,t);if(Array.isArray(t)&&t.every(ex))return t.includes(e);if(t&&"object"==typeof t&&"from"in t)return r=t.from,o=t.to,r&&o?(0>ta(o,r)&&(r=(n=[o,r])[0],o=n[1]),ta(e,r)>=0&&ta(o,e)>=0):o?tr(o,e):!!r&&tr(r,e);if(t&&"object"==typeof t&&"dayOfWeek"in t)return t.dayOfWeek.includes(e.getDay());if(t&&"object"==typeof t&&"before"in t&&"after"in t){var n,r,o,a=ta(t.before,e),i=ta(t.after,e),l=a>0,s=i<0;return to(t.before,t.after)?s&&l:l||s}return t&&"object"==typeof t&&"after"in t?ta(e,t.after)>0:t&&"object"==typeof t&&"before"in t?ta(t.before,e)>0:"function"==typeof t&&t(e)})&&n.push(r),n},[]),o={};return r.forEach(function(e){return o[e]=!0}),n&&!e9(e,n)&&(o.outside=!0),o}var ne=(0,d.createContext)(void 0);function nt(e){var t=tT(),n=t7(),r=(0,d.useState)(),o=r[0],a=r[1],i=(0,d.useState)(),l=i[0],s=i[1],c=function(e,t){for(var n,r,o=es(e[0]),a=e3(e[e.length-1]),i=o;i<=a;){var l=t9(i,t);if(!(!l.disabled&&!l.hidden)){i=(0,eh.Z)(i,1);continue}if(l.selected)return i;l.today&&!r&&(r=i),n||(n=i),i=(0,eh.Z)(i,1)}return r||n}(t.displayMonths,n),u=(null!=o?o:l&&t.isDateDisplayed(l))?l:c,f=function(e){a(e)},p=tS(),h=function(e,r){if(o){var a=function e(t,n){var r=n.moveBy,o=n.direction,a=n.context,i=n.modifiers,l=n.retry,s=void 0===l?{count:0,lastFocused:t}:l,c=a.weekStartsOn,u=a.fromDate,d=a.toDate,f=a.locale,p=({day:eh.Z,week:ti,month:ev.Z,year:tl,startOfWeek:function(e){return a.ISOWeek?tn(e):tt(e,{locale:f,weekStartsOn:c})},endOfWeek:function(e){return a.ISOWeek?tc(e):ts(e,{locale:f,weekStartsOn:c})}})[r](t,"after"===o?1:-1);"before"===o&&u?p=ef([u,p]):"after"===o&&d&&(p=ep([d,p]));var h=!0;if(i){var m=t9(p,i);h=!m.disabled&&!m.hidden}return h?p:s.count>365?s.lastFocused:e(p,{moveBy:r,direction:o,context:a,modifiers:i,retry:tu(tu({},s),{count:s.count+1})})}(o,{moveBy:e,direction:r,context:p,modifiers:n});tr(o,a)||(t.goToDate(a,o),f(a))}};return th.jsx(ne.Provider,{value:{focusedDay:o,focusTarget:u,blur:function(){s(o),a(void 0)},focus:f,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}},children:e.children})}function nn(){var e=(0,d.useContext)(ne);if(!e)throw Error("useFocusContext must be used within a FocusProvider");return e}var nr=(0,d.createContext)(void 0);function no(e){return tv(e.initialProps)?th.jsx(na,{initialProps:e.initialProps,children:e.children}):th.jsx(nr.Provider,{value:{selected:void 0},children:e.children})}function na(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var o,a,i;if(null===(o=t.onDayClick)||void 0===o||o.call(t,e,n,r),n.selected&&!t.required){null===(a=t.onSelect)||void 0===a||a.call(t,void 0,e,n,r);return}null===(i=t.onSelect)||void 0===i||i.call(t,e,e,n,r)}};return th.jsx(nr.Provider,{value:r,children:n})}function ni(){var e=(0,d.useContext)(nr);if(!e)throw Error("useSelectSingle must be used within a SelectSingleProvider");return e}function nl(e){var t,n,r,o,a,i,l,s,u,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U=(0,d.useRef)(null),K=(t=e.date,n=e.displayMonth,i=tS(),l=nn(),s=t9(t,t7(),n),u=tS(),f=ni(),p=tK(),h=tG(),g=(m=nn()).focusDayAfter,v=m.focusDayBefore,y=m.focusWeekAfter,b=m.focusWeekBefore,x=m.blur,w=m.focus,k=m.focusMonthBefore,S=m.focusMonthAfter,E=m.focusYearBefore,O=m.focusYearAfter,C=m.focusStartOfWeek,j=m.focusEndOfWeek,_={onClick:function(e){var n,r,o,a;tv(u)?null===(n=f.onDayClick)||void 0===n||n.call(f,t,s,e):tm(u)?null===(r=p.onDayClick)||void 0===r||r.call(p,t,s,e):tg(u)?null===(o=h.onDayClick)||void 0===o||o.call(h,t,s,e):null===(a=u.onDayClick)||void 0===a||a.call(u,t,s,e)},onFocus:function(e){var n;w(t),null===(n=u.onDayFocus)||void 0===n||n.call(u,t,s,e)},onBlur:function(e){var n;x(),null===(n=u.onDayBlur)||void 0===n||n.call(u,t,s,e)},onKeyDown:function(e){var n;switch(e.key){case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?g():v();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?v():g();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),y();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),b();break;case"PageUp":e.preventDefault(),e.stopPropagation(),e.shiftKey?E():k();break;case"PageDown":e.preventDefault(),e.stopPropagation(),e.shiftKey?O():S();break;case"Home":e.preventDefault(),e.stopPropagation(),C();break;case"End":e.preventDefault(),e.stopPropagation(),j()}null===(n=u.onDayKeyDown)||void 0===n||n.call(u,t,s,e)},onKeyUp:function(e){var n;null===(n=u.onDayKeyUp)||void 0===n||n.call(u,t,s,e)},onMouseEnter:function(e){var n;null===(n=u.onDayMouseEnter)||void 0===n||n.call(u,t,s,e)},onMouseLeave:function(e){var n;null===(n=u.onDayMouseLeave)||void 0===n||n.call(u,t,s,e)},onPointerEnter:function(e){var n;null===(n=u.onDayPointerEnter)||void 0===n||n.call(u,t,s,e)},onPointerLeave:function(e){var n;null===(n=u.onDayPointerLeave)||void 0===n||n.call(u,t,s,e)},onTouchCancel:function(e){var n;null===(n=u.onDayTouchCancel)||void 0===n||n.call(u,t,s,e)},onTouchEnd:function(e){var n;null===(n=u.onDayTouchEnd)||void 0===n||n.call(u,t,s,e)},onTouchMove:function(e){var n;null===(n=u.onDayTouchMove)||void 0===n||n.call(u,t,s,e)},onTouchStart:function(e){var n;null===(n=u.onDayTouchStart)||void 0===n||n.call(u,t,s,e)}},P=tS(),N=ni(),T=tK(),A=tG(),M=tv(P)?N.selected:tm(P)?T.selected:tg(P)?A.selected:void 0,I=!!(i.onDayClick||"default"!==i.mode),(0,d.useEffect)(function(){var e;!s.outside&&l.focusedDay&&I&&tr(l.focusedDay,t)&&(null===(e=U.current)||void 0===e||e.focus())},[l.focusedDay,t,U,I,s.outside]),D=(R=[i.classNames.day],Object.keys(s).forEach(function(e){var t=i.modifiersClassNames[e];if(t)R.push(t);else if(Object.values(c).includes(e)){var n=i.classNames["day_".concat(e)];n&&R.push(n)}}),R).join(" "),L=tu({},i.styles.day),Object.keys(s).forEach(function(e){var t;L=tu(tu({},L),null===(t=i.modifiersStyles)||void 0===t?void 0:t[e])}),Z=L,z=!!(s.outside&&!i.showOutsideDays||s.hidden),B=null!==(a=null===(o=i.components)||void 0===o?void 0:o.DayContent)&&void 0!==a?a:tH,F={style:Z,className:D,children:th.jsx(B,{date:t,displayMonth:n,activeModifiers:s}),role:"gridcell"},H=l.focusTarget&&tr(l.focusTarget,t)&&!s.outside,q=l.focusedDay&&tr(l.focusedDay,t),W=tu(tu(tu({},F),((r={disabled:s.disabled,role:"gridcell"})["aria-selected"]=s.selected,r.tabIndex=q||H?0:-1,r)),_),{isButton:I,isHidden:z,activeModifiers:s,selectedDays:M,buttonProps:W,divProps:F});return K.isHidden?th.jsx("div",{role:"gridcell"}):K.isButton?th.jsx(tR,tu({name:"day",ref:U},K.buttonProps)):th.jsx("div",tu({},K.divProps))}function ns(e){var t=e.number,n=e.dates,r=tS(),o=r.onWeekNumberClick,a=r.styles,i=r.classNames,l=r.locale,s=r.labels.labelWeekNumber,c=(0,r.formatters.formatWeekNumber)(Number(t),{locale:l});if(!o)return th.jsx("span",{className:i.weeknumber,style:a.weeknumber,children:c});var u=s(Number(t),{locale:l});return th.jsx(tR,{name:"week-number","aria-label":u,className:i.weeknumber,style:a.weeknumber,onClick:function(e){o(t,n,e)},children:c})}function nc(e){var t,n,r,o=tS(),a=o.styles,i=o.classNames,l=o.showWeekNumber,s=o.components,c=null!==(t=null==s?void 0:s.Day)&&void 0!==t?t:nl,u=null!==(n=null==s?void 0:s.WeekNumber)&&void 0!==n?n:ns;return l&&(r=th.jsx("td",{className:i.cell,style:a.cell,children:th.jsx(u,{number:e.weekNumber,dates:e.dates})})),th.jsxs("tr",{className:i.row,style:a.row,children:[r,e.dates.map(function(t){return th.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:th.jsx(c,{displayMonth:e.displayMonth,date:t})},function(e){return(0,ea.Z)(1,arguments),Math.floor(function(e){return(0,ea.Z)(1,arguments),(0,eo.Z)(e).getTime()}(e)/1e3)}(t))})]})}function nu(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?tc(t):ts(t,n),o=(null==n?void 0:n.ISOWeek)?tn(e):tt(e,n),a=ta(r,o),i=[],l=0;l<=a;l++)i.push((0,eh.Z)(o,l));return i.reduce(function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((tn(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=tn(r),a=new Date(0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);var i=tn(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),tn(n)})(t).getTime())/6048e5)+1}(t):function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((tt(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var h=tt(p,t),m=new Date(0);m.setFullYear(d,0,f),m.setHours(0,0,0,0);var g=tt(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(d,0,u),f.setHours(0,0,0,0),tt(f,t)})(n,t).getTime())/6048e5)+1}(t,n),o=e.find(function(e){return e.weekNumber===r});return o?o.dates.push(t):e.push({weekNumber:r,dates:[t]}),e},[])}function nd(e){var t,n,r,o=tS(),a=o.locale,i=o.classNames,l=o.styles,s=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,p=o.ISOWeek,h=function(e,t){var n=nu(es(e),e3(e),t);if(null==t?void 0:t.useFixedWeeks){var r=function(e,t){return(0,ea.Z)(1,arguments),function(e,t,n){(0,ea.Z)(2,arguments);var r=tt(e,n),o=tt(t,n);return Math.round((r.getTime()-eD(r)-(o.getTime()-eD(o)))/6048e5)}(function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),es(e),t)+1}(e,t);if(r<6){var o=n[n.length-1],a=o.dates[o.dates.length-1],i=ti(a,6-r),l=nu(ti(a,1),i,t);n.push.apply(n,l)}}return n}(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:a,weekStartsOn:d,firstWeekContainsDate:f}),m=null!==(t=null==u?void 0:u.Head)&&void 0!==t?t:tF,g=null!==(n=null==u?void 0:u.Row)&&void 0!==n?n:nc,v=null!==(r=null==u?void 0:u.Footer)&&void 0!==r?r:tz;return th.jsxs("table",{id:e.id,className:i.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!s&&th.jsx(m,{}),th.jsx("tbody",{className:i.tbody,style:l.tbody,children:h.map(function(t){return th.jsx(g,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),th.jsx(v,{displayMonth:e.displayMonth})]})}var nf="undefined"!=typeof window&&window.document&&window.document.createElement?d.useLayoutEffect:d.useEffect,np=!1,nh=0;function nm(){return"react-day-picker-".concat(++nh)}function ng(e){var t,n,r,o,a,i,l,s,c=tS(),u=c.dir,f=c.classNames,p=c.styles,h=c.components,m=tT().displayMonths,g=(r=null!=(t=c.id?"".concat(c.id,"-").concat(e.displayIndex):void 0)?t:np?nm():null,a=(o=(0,d.useState)(r))[0],i=o[1],nf(function(){null===a&&i(nm())},[]),(0,d.useEffect)(function(){!1===np&&(np=!0)},[]),null!==(n=null!=t?t:a)&&void 0!==n?n:void 0),v=c.id?"".concat(c.id,"-grid-").concat(e.displayIndex):void 0,y=[f.month],b=p.month,x=0===e.displayIndex,w=e.displayIndex===m.length-1,k=!x&&!w;"rtl"===u&&(w=(l=[x,w])[0],x=l[1]),x&&(y.push(f.caption_start),b=tu(tu({},b),p.caption_start)),w&&(y.push(f.caption_end),b=tu(tu({},b),p.caption_end)),k&&(y.push(f.caption_between),b=tu(tu({},b),p.caption_between));var S=null!==(s=null==h?void 0:h.Caption)&&void 0!==s?s:tZ;return th.jsxs("div",{className:y.join(" "),style:b,children:[th.jsx(S,{id:g,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(nd,{id:v,"aria-labelledby":g,displayMonth:e.displayMonth})]},e.displayIndex)}function nv(e){var t=tS(),n=t.classNames,r=t.styles;return th.jsx("div",{className:n.months,style:r.months,children:e.children})}function ny(e){var t,n,r=e.initialProps,o=tS(),a=nn(),i=tT(),l=(0,d.useState)(!1),s=l[0],c=l[1];(0,d.useEffect)(function(){o.initialFocus&&a.focusTarget&&(s||(a.focus(a.focusTarget),c(!0)))},[o.initialFocus,s,a.focus,a.focusTarget,a]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=tu(tu({},o.styles.root),o.style),p=Object.keys(r).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var n;return tu(tu({},e),((n={})[t]=r[t],n))},{}),h=null!==(n=null===(t=r.components)||void 0===t?void 0:t.Months)&&void 0!==n?n:nv;return th.jsx("div",tu({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:th.jsx(h,{children:i.displayMonths.map(function(e,t){return th.jsx(ng,{displayIndex:t,displayMonth:e},t)})})}))}function nb(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}(e,["children"]);return th.jsx(tk,{initialProps:n,children:th.jsx(tN,{children:th.jsx(no,{initialProps:n,children:th.jsx(tW,{initialProps:n,children:th.jsx(tV,{initialProps:n,children:th.jsx(t8,{children:th.jsx(nt,{children:t})})})})})})})}function nx(e){return th.jsx(nb,tu({},e,{children:th.jsx(ny,{initialProps:e})}))}let nw=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))},nk=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))},nS=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))},nE=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))};var nO=n(84264);n(41649);var nC=n(1526),nj=n(7084),n_=n(26898);let nP={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},nN={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},nT={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},nA={[nj.wu.Increase]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.ModerateIncrease]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.Decrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.ModerateDecrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.Unchanged]:{bgColor:(0,eJ.bM)(nj.fr.Orange,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Orange,n_.K.text).textColor}},nM={[nj.wu.Increase]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))},[nj.wu.ModerateIncrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))},[nj.wu.Decrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))},[nj.wu.ModerateDecrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))},[nj.wu.Unchanged]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))}},nI=(0,eJ.fn)("BadgeDelta");d.forwardRef((e,t)=>{let{deltaType:n=nj.wu.Increase,isIncreasePositive:r=!0,size:o=nj.u8.SM,tooltip:a,children:i,className:l}=e,s=(0,u._T)(e,["deltaType","isIncreasePositive","size","tooltip","children","className"]),c=nM[n],f=(0,eJ.Fo)(n,r),p=i?nN:nP,{tooltipProps:h,getReferenceProps:m}=(0,nC.l)();return d.createElement("span",Object.assign({ref:(0,eJ.lq)([t,h.refs.setReference]),className:(0,ec.q)(nI("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full bg-opacity-20 dark:bg-opacity-25",nA[f].bgColor,nA[f].textColor,p[o].paddingX,p[o].paddingY,p[o].fontSize,l)},m,s),d.createElement(nC.Z,Object.assign({text:a},h)),d.createElement(c,{className:(0,ec.q)(nI("icon"),"shrink-0",i?(0,ec.q)("-ml-1 mr-1.5"):nT[o].height,nT[o].width)}),i?d.createElement("p",{className:(0,ec.q)(nI("text"),"text-sm whitespace-nowrap")},i):null)}).displayName="BadgeDelta";var nR=n(47323);let nD=e=>{var{onClick:t,icon:n}=e,r=(0,u._T)(e,["onClick","icon"]);return d.createElement("button",Object.assign({type:"button",className:(0,ec.q)("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},r),d.createElement(nR.Z,{onClick:t,icon:n,variant:"simple",color:"slate",size:"sm"}))};function nL(e){var{mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,enableYearNavigation:l,classNames:s,weekStartsOn:c=0}=e,f=(0,u._T)(e,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return d.createElement(nx,Object.assign({showOutsideDays:!0,mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,weekStartsOn:c,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},s),components:{IconLeft:e=>{var t=(0,u._T)(e,[]);return d.createElement(nw,Object.assign({className:"h-4 w-4"},t))},IconRight:e=>{var t=(0,u._T)(e,[]);return d.createElement(nk,Object.assign({className:"h-4 w-4"},t))},Caption:e=>{var t=(0,u._T)(e,[]);let{goToMonth:n,nextMonth:r,previousMonth:o,currentMonth:i}=tT();return d.createElement("div",{className:"flex justify-between items-center"},d.createElement("div",{className:"flex items-center space-x-1"},l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,-1)),icon:nS}),d.createElement(nD,{onClick:()=>o&&n(o),icon:nw})),d.createElement(nO.Z,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},eQ(t.displayMonth,"LLLL yyy",{locale:a})),d.createElement("div",{className:"flex items-center space-x-1"},d.createElement(nD,{onClick:()=>r&&n(r),icon:nk}),l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,1)),icon:nE})))}}},f))}nL.displayName="DateRangePicker",n(27281);var nZ=n(57365),nz=n(44140);let nB=el(),nF=d.forwardRef((e,t)=>{var n,r;let{value:o,defaultValue:a,onValueChange:i,enableSelect:l=!0,minDate:s,maxDate:c,placeholder:f="Select range",selectPlaceholder:p="Select range",disabled:h=!1,locale:m=eK,enableClear:g=!0,displayFormat:v,children:y,className:b,enableYearNavigation:x=!1,weekStartsOn:w=0,disabledDates:k}=e,S=(0,u._T)(e,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[E,O]=(0,nz.Z)(a,o),[C,j]=(0,d.useState)(!1),[_,P]=(0,d.useState)(!1),N=(0,d.useMemo)(()=>{let e=[];return s&&e.push({before:s}),c&&e.push({after:c}),[...e,...null!=k?k:[]]},[s,c,k]),T=(0,d.useMemo)(()=>{let e=new Map;return y?d.Children.forEach(y,t=>{var n;e.set(t.props.value,{text:null!==(n=(0,eu.qg)(t))&&void 0!==n?n:t.props.value,from:t.props.from,to:t.props.to})}):e6.forEach(t=>{e.set(t.value,{text:t.text,from:t.from,to:nB})}),e},[y]),A=(0,d.useMemo)(()=>{if(y)return(0,eu.sl)(y);let e=new Map;return e6.forEach(t=>e.set(t.value,t.text)),e},[y]),M=(null==E?void 0:E.selectValue)||"",I=e1(null==E?void 0:E.from,s,M,T),R=e2(null==E?void 0:E.to,c,M,T),D=I||R?e4(I,R,m,v):f,L=es(null!==(r=null!==(n=null!=R?R:I)&&void 0!==n?n:c)&&void 0!==r?r:nB),Z=g&&!h;return d.createElement("div",Object.assign({ref:t,className:(0,ec.q)("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",b)},S),d.createElement(J,{as:"div",className:(0,ec.q)("w-full",l?"rounded-l-tremor-default":"rounded-tremor-default",C&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},d.createElement("div",{className:"relative w-full"},d.createElement(J.Button,{onFocus:()=>j(!0),onBlur:()=>j(!1),disabled:h,className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",l?"rounded-l-tremor-default":"rounded-tremor-default",Z?"pr-8":"pr-4",(0,eu.um)((0,eu.Uh)(I||R),h))},d.createElement(en,{className:(0,ec.q)(e0("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),d.createElement("p",{className:"truncate"},D)),Z&&I?d.createElement("button",{type:"button",className:(0,ec.q)("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==i||i({}),O({})}},d.createElement(er.Z,{className:(0,ec.q)(e0("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),d.createElement(ee.u,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(J.Panel,{focus:!0,className:(0,ec.q)("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},d.createElement(nL,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:L,selected:{from:I,to:R},onSelect:e=>{null==i||i({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),O({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:m,disabled:N,enableYearNavigation:x,classNames:{day_range_middle:(0,ec.q)("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:w},e))))),l&&d.createElement(et.R,{as:"div",className:(0,ec.q)("w-48 -ml-px rounded-r-tremor-default",_&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:M,onChange:e=>{let{from:t,to:n}=T.get(e),r=null!=n?n:nB;null==i||i({from:t,to:r,selectValue:e}),O({from:t,to:r,selectValue:e})},disabled:h},e=>{var t;let{value:n}=e;return d.createElement(d.Fragment,null,d.createElement(et.R.Button,{onFocus:()=>P(!0),onBlur:()=>P(!1),className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",(0,eu.um)((0,eu.Uh)(n),h))},n&&null!==(t=A.get(n))&&void 0!==t?t:p),d.createElement(ee.u,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(et.R.Options,{className:(0,ec.q)("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=y?y:e6.map(e=>d.createElement(nZ.Z,{key:e.value,value:e.value},e.text)))))}))});nF.displayName="DateRangePicker"},92414:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(5853),o=n(2265);n(42698),n(64016),n(8710);var a=n(33232),i=n(44140),l=n(58747);let s=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var c=n(4537),u=n(28517),d=n(33044);let f=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),o.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var p=n(97324),h=n(1153),m=n(96398);let g=(0,h.fn)("MultiSelect"),v=o.forwardRef((e,t)=>{let{defaultValue:n,value:h,onValueChange:v,placeholder:y="Select...",placeholderSearch:b="Search",disabled:x=!1,icon:w,children:k,className:S}=e,E=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[O,C]=(0,i.Z)(n,h),{reactElementChildren:j,optionsAvailable:_}=(0,o.useMemo)(()=>{let e=o.Children.toArray(k).filter(o.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,m.n0)("",e)}},[k]),[P,N]=(0,o.useState)(""),T=(null!=O?O:[]).length>0,A=(0,o.useMemo)(()=>P?(0,m.n0)(P,j):_,[P,j,_]),M=()=>{N("")};return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:O,value:O,onChange:e=>{null==v||v(e),C(e)},disabled:x,className:(0,p.q)("w-full min-w-[10rem] relative text-tremor-default",S)},E,{multiple:!0}),e=>{let{value:t}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,p.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,m.um)(t.length>0,x))},w&&o.createElement("span",{className:(0,p.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(w,{className:(0,p.q)(g("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("div",{className:"h-6 flex items-center"},t.length>0?o.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,n)=>{var r;return o.createElement("div",{key:n,className:(0,p.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},o.createElement("div",{className:"text-xs truncate "},null!==(r=e.props.children)&&void 0!==r?r:e.props.value),o.createElement("div",{onClick:n=>{n.preventDefault();let r=t.filter(t=>t!==e.props.value);null==v||v(r),C(r)}},o.createElement(f,{className:(0,p.q)(g("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):o.createElement("span",null,y)),o.createElement("span",{className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},o.createElement(l.Z,{className:(0,p.q)(g("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),T&&!x?o.createElement("button",{type:"button",className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),C([]),null==v||v([])}},o.createElement(c.Z,{className:(0,p.q)(g("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,p.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},o.createElement("div",{className:(0,p.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},o.createElement("span",null,o.createElement(s,{className:(0,p.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:b,className:(0,p.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>N(e.target.value),value:P})),o.createElement(a.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:M}},{value:{selectedValue:t}}),A))))})});v.displayName="MultiSelect"},46030:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698),n(64016),n(8710);var o=n(33232),a=n(2265),i=n(97324),l=n(1153),s=n(28517);let c=(0,l.fn)("MultiSelectItem"),u=a.forwardRef((e,t)=>{let{value:n,className:u,children:d}=e,f=(0,r._T)(e,["value","className","children"]),{selectedValue:p}=(0,a.useContext)(o.Z),h=(0,l.NZ)(n,p);return a.createElement(s.R.Option,Object.assign({className:(0,i.q)(c("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",u),ref:t,key:n,value:n},f),a.createElement("input",{type:"checkbox",className:(0,i.q)(c("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),a.createElement("span",{className:"whitespace-nowrap truncate"},null!=d?d:n))});u.displayName="MultiSelectItem"},30150:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var l=n(97324),s=n(1153),c=n(69262);let u="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",f=o.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:f=!0,disabled:p,onValueChange:h,onChange:m}=e,g=(0,r._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),v=(0,o.useRef)(null),[y,b]=o.useState(!1),x=o.useCallback(()=>{b(!0)},[]),w=o.useCallback(()=>{b(!1)},[]),[k,S]=o.useState(!1),E=o.useCallback(()=>{S(!0)},[]),O=o.useCallback(()=>{S(!1)},[]);return o.createElement(c.Z,Object.assign({type:"number",ref:(0,s.lq)([v,t]),disabled:p,makeInputClassName:(0,s.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=v.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&O()},onChange:e=>{p||(null==h||h(parseFloat(e.target.value)),null==m||m(e))},stepper:f?o.createElement("div",{className:(0,l.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepDown(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(i,{"data-testid":"step-down",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepUp(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-up",className:(k?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},g))});f.displayName="NumberInput"},27281:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(5853),o=n(2265),a=n(58747),i=n(4537),l=n(97324),s=n(1153),c=n(96398),u=n(28517),d=n(33044),f=n(44140);let p=(0,s.fn)("Select"),h=o.forwardRef((e,t)=>{let{defaultValue:n,value:s,onValueChange:h,placeholder:m="Select...",disabled:g=!1,icon:v,enableClear:y=!0,children:b,className:x}=e,w=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","children","className"]),[k,S]=(0,f.Z)(n,s),E=(0,o.useMemo)(()=>{let e=o.Children.toArray(b).filter(o.isValidElement);return(0,c.sl)(e)},[b]);return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:k,value:k,onChange:e=>{null==h||h(e),S(e)},disabled:g,className:(0,l.q)("w-full min-w-[10rem] relative text-tremor-default",x)},w),e=>{var t;let{value:n}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,l.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",v?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(n),g))},v&&o.createElement("span",{className:(0,l.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(v,{className:(0,l.q)(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},n&&null!==(t=E.get(n))&&void 0!==t?t:m),o.createElement("span",{className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,l.q)(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),y&&k?o.createElement("button",{type:"button",className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),S(""),null==h||h("")}},o.createElement(i.Z,{className:(0,l.q)(p("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,l.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},b)))})});h.displayName="Select"},57365:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(28517),i=n(97324);let l=(0,n(1153).fn)("SelectItem"),s=o.forwardRef((e,t)=>{let{value:n,icon:s,className:c,children:u}=e,d=(0,r._T)(e,["value","icon","className","children"]);return o.createElement(a.R.Option,Object.assign({className:(0,i.q)(l("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:n,value:n},d),s&&o.createElement(s,{className:(0,i.q)(l("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),o.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:n))});s.displayName="SelectItem"},92858:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var r=n(5853),o=n(2265),a=n(62963),i=n(90945),l=n(13323),s=n(17684),c=n(80004),u=n(93689),d=n(38198),f=n(47634),p=n(56314),h=n(27847),m=n(64518);let g=(0,o.createContext)(null),v=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-description-".concat(n),...a}=e,i=function e(){let t=(0,o.useContext)(g);if(null===t){let t=Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),l=(0,u.T)(t);(0,m.e)(()=>i.register(r),[r,i.register]);let c={ref:l,...i.props,id:r};return(0,h.sY)({ourProps:c,theirProps:a,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})}),{});var y=n(37388);let b=(0,o.createContext)(null),x=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-label-".concat(n),passive:a=!1,...i}=e,l=function e(){let t=(0,o.useContext)(b);if(null===t){let t=Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),c=(0,u.T)(t);(0,m.e)(()=>l.register(r),[r,l.register]);let d={ref:c,...l.props,id:r};return a&&("onClick"in d&&(delete d.htmlFor,delete d.onClick),"onClick"in i&&delete i.onClick),(0,h.sY)({ourProps:d,theirProps:i,slot:l.slot||{},defaultTag:"label",name:l.name||"Label"})}),{}),w=(0,o.createContext)(null);w.displayName="GroupContext";let k=o.Fragment,S=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-switch-".concat(n),checked:m,defaultChecked:g=!1,onChange:v,name:b,value:x,form:k,...S}=e,E=(0,o.useContext)(w),O=(0,o.useRef)(null),C=(0,u.T)(O,t,null===E?null:E.setSwitch),[j,_]=(0,a.q)(m,v,g),P=(0,l.z)(()=>null==_?void 0:_(!j)),N=(0,l.z)(e=>{if((0,f.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),P()}),T=(0,l.z)(e=>{e.key===y.R.Space?(e.preventDefault(),P()):e.key===y.R.Enter&&(0,p.g)(e.currentTarget)}),A=(0,l.z)(e=>e.preventDefault()),M=(0,o.useMemo)(()=>({checked:j}),[j]),I={id:r,ref:C,role:"switch",type:(0,c.f)(e,O),tabIndex:0,"aria-checked":j,"aria-labelledby":null==E?void 0:E.labelledby,"aria-describedby":null==E?void 0:E.describedby,onClick:N,onKeyUp:T,onKeyPress:A},R=(0,i.G)();return(0,o.useEffect)(()=>{var e;let t=null==(e=O.current)?void 0:e.closest("form");t&&void 0!==g&&R.addEventListener(t,"reset",()=>{_(g)})},[O,_]),o.createElement(o.Fragment,null,null!=b&&j&&o.createElement(d._,{features:d.A.Hidden,...(0,h.oA)({as:"input",type:"checkbox",hidden:!0,readOnly:!0,form:k,checked:j,name:b,value:x})}),(0,h.sY)({ourProps:I,theirProps:S,slot:M,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[n,r]=(0,o.useState)(null),[a,i]=function(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(b.Provider,{value:r},e.children)},[t])]}(),[s,c]=function(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(g.Provider,{value:r},e.children)},[t])]}(),u=(0,o.useMemo)(()=>({switch:n,setSwitch:r,labelledby:a,describedby:s}),[n,r,a,s]);return o.createElement(c,{name:"Switch.Description"},o.createElement(i,{name:"Switch.Label",props:{htmlFor:null==(t=u.switch)?void 0:t.id,onClick(e){n&&("LABEL"===e.currentTarget.tagName&&e.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},o.createElement(w.Provider,{value:u},(0,h.sY)({ourProps:{},theirProps:e,defaultTag:k,name:"Switch.Group"}))))},Label:x,Description:v});var E=n(44140),O=n(26898),C=n(97324),j=n(1153),_=n(1526);let P=(0,j.fn)("Switch"),N=o.forwardRef((e,t)=>{let{checked:n,defaultChecked:a=!1,onChange:i,color:l,name:s,error:c,errorMessage:u,disabled:d,required:f,tooltip:p,id:h}=e,m=(0,r._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:l?(0,j.bM)(l,O.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:l?(0,j.bM)(l,O.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,y]=(0,E.Z)(a,n),[b,x]=(0,o.useState)(!1),{tooltipProps:w,getReferenceProps:k}=(0,_.l)(300);return o.createElement("div",{className:"flex flex-row items-center justify-start"},o.createElement(_.Z,Object.assign({text:p},w)),o.createElement("div",Object.assign({ref:(0,j.lq)([t,w.refs.setReference]),className:(0,C.q)(P("root"),"flex flex-row relative h-5")},m,k),o.createElement("input",{type:"checkbox",className:(0,C.q)(P("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:s,required:f,checked:v,onChange:e=>{e.preventDefault()}}),o.createElement(S,{checked:v,onChange:e=>{y(e),null==i||i(e)},disabled:d,className:(0,C.q)(P("switch"),"w-10 h-5 group relative inline-flex flex-shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>x(!0),onBlur:()=>x(!1),id:h},o.createElement("span",{className:(0,C.q)(P("sr-only"),"sr-only")},"Switch ",v?"on":"off"),o.createElement("span",{"aria-hidden":"true",className:(0,C.q)(P("background"),v?g.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),o.createElement("span",{"aria-hidden":"true",className:(0,C.q)(P("round"),v?(0,C.q)(g.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",b?(0,C.q)("ring-2",g.ringColor):"")}))),c&&u?o.createElement("p",{className:(0,C.q)(P("errorMessage"),"text-sm text-red-500 mt-1 ")},u):null)});N.displayName="Switch"},12485:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(31492),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(35242),u=n(42698);n(64016),n(8710),n(33232);let d=(0,l.fn)("Tab"),f=s.forwardRef((e,t)=>{let{icon:n,className:f,children:p}=e,h=(0,r._T)(e,["icon","className","children"]),m=(0,s.useContext)(c.O),g=(0,s.useContext)(u.Z);return s.createElement(o.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",g?(0,l.bM)(g,a.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,l.bM)(t,a.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,l.bM)(t,a.K.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}(m,g),f)},h),n?s.createElement(n,{className:(0,i.q)(d("icon"),"flex-none h-5 w-5",p?"mr-2":"")}):null,p?s.createElement("span",null,p):null)});f.displayName="Tab"},18135:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(31492),a=n(97324),i=n(1153),l=n(2265);let s=(0,i.fn)("TabGroup"),c=l.forwardRef((e,t)=>{let{defaultIndex:n,index:i,onIndexChange:c,children:u,className:d}=e,f=(0,r._T)(e,["defaultIndex","index","onIndexChange","children","className"]);return l.createElement(o.O.Group,Object.assign({as:"div",ref:t,defaultIndex:n,selectedIndex:i,onChange:c,className:(0,a.q)(s("root"),"w-full",d)},f),u)});c.displayName="TabGroup"},35242:function(e,t,n){"use strict";n.d(t,{O:function(){return c},Z:function(){return d}});var r=n(5853),o=n(2265),a=n(42698);n(64016),n(8710),n(33232);var i=n(31492),l=n(97324);let s=(0,n(1153).fn)("TabList"),c=(0,o.createContext)("line"),u={line:(0,l.q)("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:(0,l.q)("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},d=o.forwardRef((e,t)=>{let{color:n,variant:d="line",children:f,className:p}=e,h=(0,r._T)(e,["color","variant","children","className"]);return o.createElement(i.O.List,Object.assign({ref:t,className:(0,l.q)(s("root"),"justify-start overflow-x-clip",u[d],p)},h),o.createElement(c.Provider,{value:d},o.createElement(a.Z.Provider,{value:n},f)))});d.displayName="TabList"},29706:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698);var o=n(64016);n(8710);var a=n(33232),i=n(97324),l=n(1153),s=n(2265);let c=(0,l.fn)("TabPanel"),u=s.forwardRef((e,t)=>{let{children:n,className:l}=e,u=(0,r._T)(e,["children","className"]),{selectedValue:d}=(0,s.useContext)(a.Z),f=d===(0,s.useContext)(o.Z);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)(c("root"),"w-full mt-2",f?"":"hidden",l),"aria-selected":f?"true":"false"},u),n)});u.displayName="TabPanel"},77991:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(31492);n(42698);var a=n(64016);n(8710);var i=n(33232),l=n(97324),s=n(1153),c=n(2265);let u=(0,s.fn)("TabPanels"),d=c.forwardRef((e,t)=>{let{children:n,className:s}=e,d=(0,r._T)(e,["children","className"]);return c.createElement(o.O.Panels,Object.assign({as:"div",ref:t,className:(0,l.q)(u("root"),"w-full",s)},d),e=>{let{selectedIndex:t}=e;return c.createElement(i.Z.Provider,{value:{selectedValue:t}},c.Children.map(n,(e,t)=>c.createElement(a.Z.Provider,{value:t},e)))})});d.displayName="TabPanels"},49566:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265);n(97324);var a=n(1153),i=n(69262);let l=(0,a.fn)("TextInput"),s=o.forwardRef((e,t)=>{let{type:n="text"}=e,a=(0,r._T)(e,["type"]);return o.createElement(i.Z,Object.assign({ref:t,type:n,makeInputClassName:l},a))});s.displayName="TextInput"},16853:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(96398),a=n(44140),i=n(2265),l=n(97324),s=n(1153);let c=(0,s.fn)("Textarea"),u=i.forwardRef((e,t)=>{let{value:n,defaultValue:u="",placeholder:d="Type...",error:f=!1,errorMessage:p,disabled:h=!1,className:m,onChange:g,onValueChange:v}=e,y=(0,r._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[b,x]=(0,a.Z)(u,n),w=(0,i.useRef)(null),k=(0,o.Uh)(b);return i.createElement(i.Fragment,null,i.createElement("textarea",Object.assign({ref:(0,s.lq)([w,t]),value:b,placeholder:d,disabled:h,className:(0,l.q)(c("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,o.um)(k,h,f),h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",m),"data-testid":"text-area",onChange:e=>{null==g||g(e),x(e.target.value),null==v||v(e.target.value)}},y)),f&&p?i.createElement("p",{className:(0,l.q)(c("errorMessage"),"text-sm text-red-500 mt-1")},p):null)});u.displayName="Textarea"},96398:function(e,t,n){"use strict";n.d(t,{Uh:function(){return c},n0:function(){return l},qg:function(){return a},sl:function(){return i},um:function(){return s}});var r=n(97324),o=n(2265);let a=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(a).join(""):"object"==typeof e&&e?a(e.props.children):void 0;function i(e){let t=new Map;return o.Children.map(e,e=>{var n;t.set(e.props.value,null!==(n=a(e))&&void 0!==n?n:e.props.value)}),t}function l(e,t){return o.Children.map(t,t=>{var n;if((null!==(n=a(t))&&void 0!==n?n:t.props.value).toLowerCase().includes(e.toLowerCase()))return t})}let s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.q)(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",n&&"text-red-500",n?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function c(e){return null!=e&&""!==e}},87452:function(e,t,n){"use strict";n.d(t,{Z:function(){return d},r:function(){return u}});var r=n(5853),o=n(21886);n(42698),n(64016);var a=n(8710);n(33232);var i=n(97324),l=n(1153),s=n(2265);let c=(0,l.fn)("Accordion"),u=(0,s.createContext)({isOpen:!1}),d=s.forwardRef((e,t)=>{var n;let{defaultOpen:l=!1,children:d,className:f}=e,p=(0,r._T)(e,["defaultOpen","children","className"]),h=null!==(n=(0,s.useContext)(a.Z))&&void 0!==n?n:(0,i.q)("rounded-tremor-default border");return s.createElement(o.p,Object.assign({as:"div",ref:t,className:(0,i.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",h,f),defaultOpen:l},p),e=>{let{open:t}=e;return s.createElement(u.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(21886),i=n(97324);let l=(0,n(1153).fn)("AccordionBody"),s=o.forwardRef((e,t)=>{let{children:n,className:s}=e,c=(0,r._T)(e,["children","className"]);return o.createElement(a.p.Panel,Object.assign({ref:t,className:(0,i.q)(l("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",s)},c),n)});s.displayName="AccordionBody"},72208:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(2265),a=n(21886);let i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var l=n(87452),s=n(97324);let c=(0,n(1153).fn)("AccordionHeader"),u=o.forwardRef((e,t)=>{let{children:n,className:u}=e,d=(0,r._T)(e,["children","className"]),{isOpen:f}=(0,o.useContext)(l.r);return o.createElement(a.p.Button,Object.assign({ref:t,className:(0,s.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),o.createElement("div",{className:(0,s.q)(c("children"),"flex flex-1 text-inherit mr-4")},n),o.createElement("div",null,o.createElement(i,{className:(0,s.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",f?"transition-all":"transition-all -rotate-180")})))});u.displayName="AccordionHeader"},67982:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265);let l=(0,a.fn)("Divider"),s=i.forwardRef((e,t)=>{let{className:n,children:a}=e,s=(0,r._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(l("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",n)},s),a?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,o.q)("text-inherit whitespace-nowrap")},a),i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});s.displayName="Divider"},49804:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265),l=n(9496);let s=(0,a.fn)("Col"),c=i.forwardRef((e,t)=>{let{numColSpan:n=1,numColSpanSm:a,numColSpanMd:c,numColSpanLg:u,children:d,className:f}=e,p=(0,r._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),h=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),(()=>{let e=h(n,l.PT),t=h(a,l.SP),r=h(c,l.VS),i=h(u,l._w);return(0,o.q)(e,t,r,i)})(),f)},p),d)});c.displayName="Col"},67101:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265),l=n(9496);let s=(0,a.fn)("Grid"),c=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",u=i.forwardRef((e,t)=>{let{numItems:n=1,numItemsSm:a,numItemsMd:u,numItemsLg:d,children:f,className:p}=e,h=(0,r._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),m=c(n,l._m),g=c(a,l.LH),v=c(u,l.l5),y=c(d,l.N4),b=(0,o.q)(m,g,v,y);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),"grid",b,p)},h),f)});u.displayName="Grid"},9496:function(e,t,n){"use strict";n.d(t,{LH:function(){return o},N4:function(){return i},PT:function(){return l},SP:function(){return s},VS:function(){return c},_m:function(){return r},_w:function(){return u},l5:function(){return a}});let r={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},o={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},a={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},i={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},l={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},s={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},c={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},u={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},94789:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(2265),a=n(26898),i=n(97324),l=n(1153);let s=(0,l.fn)("Callout"),c=o.forwardRef((e,t)=>{let{title:n,icon:c,color:u,className:d,children:f}=e,p=(0,r._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",u?(0,i.q)((0,l.bM)(u,a.K.background).bgColor,(0,l.bM)(u,a.K.darkBorder).borderColor,(0,l.bM)(u,a.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,i.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),d)},p),o.createElement("div",{className:(0,i.q)(s("header"),"flex items-start")},c?o.createElement(c,{className:(0,i.q)(s("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,i.q)(s("title"),"font-semibold")},n)),o.createElement("p",{className:(0,i.q)(s("body"),"overflow-y-auto",f?"mt-2":"")},f))});c.displayName="Callout"},35829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(26898),a=n(97324),i=n(1153),l=n(2265);let s=l.forwardRef((e,t)=>{let{color:n,children:s,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)("font-semibold text-tremor-metric",n?(0,i.bM)(n,o.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},u),s)});s.displayName="Metric"},97765:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(26898),a=n(97324),i=n(1153),l=n(2265);let s=l.forwardRef((e,t)=>{let{color:n,children:s,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)(n?(0,i.bM)(n,o.K.lightText).textColor:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c)},u),s)});s.displayName="Subtitle"},96889:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(2265),a=n(26898),i=n(97324),l=n(1153);let s=(0,l.fn)("BarList"),c=o.forwardRef((e,t)=>{var n;let c;let{data:u=[],color:d,valueFormatter:f=l.Cj,showAnimation:p=!1,className:h}=e,m=(0,r._T)(e,["data","color","valueFormatter","showAnimation","className"]),g=(n=u.map(e=>e.value),c=-1/0,n.forEach(e=>{c=Math.max(c,e)}),n.map(e=>0===e?0:Math.max(e/c*100,1)));return o.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex justify-between space-x-6",h)},m),o.createElement("div",{className:(0,i.q)(s("bars"),"relative w-full")},u.map((e,t)=>{var n,r,c;let f=e.icon;return o.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:(0,i.q)(s("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||d?(0,l.bM)(null!==(r=e.color)&&void 0!==r?r:d,a.K.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===u.length-1?"mb-0":"mb-2"),style:{width:"".concat(g[t],"%"),transition:p?"all 1s":""}},o.createElement("div",{className:(0,i.q)("absolute max-w-full flex left-2")},f?o.createElement(f,{className:(0,i.q)(s("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?o.createElement("a",{href:e.href,target:null!==(c=e.target)&&void 0!==c?c:"_blank",rel:"noreferrer",className:(0,i.q)(s("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name):o.createElement("p",{className:(0,i.q)(s("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name)))})),o.createElement("div",{className:"text-right min-w-min"},u.map((e,t)=>{var n;return o.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:(0,i.q)(s("labelWrapper"),"flex justify-end items-center","h-9",t===u.length-1?"mb-0":"mb-2")},o.createElement("p",{className:(0,i.q)(s("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},f(e.value)))})))});c.displayName="BarList"},42698:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2265),o=n(7084);n(97324);let a=(0,r.createContext)(o.fr.Blue)},64016:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)(0)},8710:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)(void 0)},33232:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)({selectedValue:void 0,handleValueChange:void 0})},44140:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);let o=(e,t)=>{let n=void 0!==t,[o,a]=(0,r.useState)(e);return[n?t:o,e=>{n||a(e)}]}},61778:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}});var r=n(2265),o=n(8900),a=n(39725),i=n(49638),l=n(54537),s=n(55726),c=n(36760),u=n.n(c),d=n(47970),f=n(18242),p=n(19722),h=n(71744),m=n(352),g=n(12918),v=n(80669);let y=(e,t,n,r,o)=>({background:e,border:"".concat((0,m.bf)(r.lineWidth)," ").concat(r.lineType," ").concat(t),["".concat(o,"-icon")]:{color:n}}),b=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:o,fontSize:a,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:u,colorText:d,colorTextHeading:f,withDescriptionPadding:p,defaultPadding:h}=e;return{[t]:Object.assign(Object.assign({},(0,g.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:s,["&".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-content")]:{flex:1,minWidth:0},["".concat(t,"-icon")]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-message":{color:f},["&".concat(t,"-motion-leave")]:{overflow:"hidden",opacity:1,transition:"max-height ".concat(n," ").concat(c,", opacity ").concat(n," ").concat(c,",\n padding-top ").concat(n," ").concat(c,", padding-bottom ").concat(n," ").concat(c,",\n margin-bottom ").concat(n," ").concat(c)},["&".concat(t,"-motion-leave-active")]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),["".concat(t,"-with-description")]:{alignItems:"flex-start",padding:p,["".concat(t,"-icon")]:{marginInlineEnd:o,fontSize:u,lineHeight:0},["".concat(t,"-message")]:{display:"block",marginBottom:r,color:f,fontSize:i},["".concat(t,"-description")]:{display:"block",color:d}},["".concat(t,"-banner")]:{marginBottom:0,border:"0 !important",borderRadius:0}}},x=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:o,colorWarning:a,colorWarningBorder:i,colorWarningBg:l,colorError:s,colorErrorBorder:c,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":y(o,r,n,e,t),"&-info":y(p,f,d,e,t),"&-warning":y(l,i,a,e,t),"&-error":Object.assign(Object.assign({},y(u,c,s,e,t)),{["".concat(t,"-description > pre")]:{margin:0,padding:0}})}}},w=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:o,fontSizeIcon:a,colorIcon:i,colorIconHover:l}=e;return{[t]:{"&-action":{marginInlineStart:o},["".concat(t,"-close-icon")]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,m.bf)(a),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",["".concat(n,"-close")]:{color:i,transition:"color ".concat(r),"&:hover":{color:l}}},"&-close-text":{color:i,transition:"color ".concat(r),"&:hover":{color:l}}}}};var k=(0,v.I$)("Alert",e=>[b(e),x(e),w(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:"".concat(e.paddingContentVerticalSM,"px ").concat(12,"px"),withDescriptionPadding:"".concat(e.paddingMD,"px ").concat(e.paddingContentHorizontalLG,"px")})),S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let E={success:o.Z,info:s.Z,error:a.Z,warning:l.Z},O=e=>{let{icon:t,prefixCls:n,type:o}=e,a=E[o]||null;return t?(0,p.wm)(t,r.createElement("span",{className:"".concat(n,"-icon")},t),()=>({className:u()("".concat(n,"-icon"),{[t.props.className]:t.props.className})})):r.createElement(a,{className:"".concat(n,"-icon")})},C=e=>{let{isClosable:t,prefixCls:n,closeIcon:o,handleClose:a}=e,l=!0===o||void 0===o?r.createElement(i.Z,null):o;return t?r.createElement("button",{type:"button",onClick:a,className:"".concat(n,"-close-icon"),tabIndex:0},l):null};var j=e=>{let{description:t,prefixCls:n,message:o,banner:a,className:i,rootClassName:l,style:s,onMouseEnter:c,onMouseLeave:p,onClick:m,afterClose:g,showIcon:v,closable:y,closeText:b,closeIcon:x,action:w}=e,E=S(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action"]),[j,_]=r.useState(!1),P=r.useRef(null),{getPrefixCls:N,direction:T,alert:A}=r.useContext(h.E_),M=N("alert",n),[I,R,D]=k(M),L=t=>{var n;_(!0),null===(n=e.onClose)||void 0===n||n.call(e,t)},Z=r.useMemo(()=>void 0!==e.type?e.type:a?"warning":"info",[e.type,a]),z=r.useMemo(()=>!!b||("boolean"==typeof y?y:!1!==x&&null!=x),[b,x,y]),B=!!a&&void 0===v||v,F=u()(M,"".concat(M,"-").concat(Z),{["".concat(M,"-with-description")]:!!t,["".concat(M,"-no-icon")]:!B,["".concat(M,"-banner")]:!!a,["".concat(M,"-rtl")]:"rtl"===T},null==A?void 0:A.className,i,l,D,R),H=(0,f.Z)(E,{aria:!0,data:!0});return I(r.createElement(d.ZP,{visible:!j,motionName:"".concat(M,"-motion"),motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:g},n=>{let{className:a,style:i}=n;return r.createElement("div",Object.assign({ref:P,"data-show":!j,className:u()(F,a),style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.style),s),i),onMouseEnter:c,onMouseLeave:p,onClick:m,role:"alert"},H),B?r.createElement(O,{description:t,icon:e.icon,prefixCls:M,type:Z}):null,r.createElement("div",{className:"".concat(M,"-content")},o?r.createElement("div",{className:"".concat(M,"-message")},o):null,t?r.createElement("div",{className:"".concat(M,"-description")},t):null),w?r.createElement("div",{className:"".concat(M,"-action")},w):null,r.createElement(C,{isClosable:z,prefixCls:M,closeIcon:b||x,handleClose:L}))}))},_=n(76405),P=n(25049),N=n(37977),T=n(63929),A=n(24995),M=n(15354);let I=function(e){function t(){var e,n,r;return(0,_.Z)(this,t),n=t,r=arguments,n=(0,A.Z)(n),(e=(0,N.Z)(this,(0,T.Z)()?Reflect.construct(n,r||[],(0,A.Z)(this).constructor):n.apply(this,r))).state={error:void 0,info:{componentStack:""}},e}return(0,M.Z)(t,e),(0,P.Z)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:t,children:n}=this.props,{error:o,info:a}=this.state,i=a&&a.componentStack?a.componentStack:null,l=void 0===e?(o||"").toString():e;return o?r.createElement(j,{type:"error",message:l,description:r.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===t?i:t)}):n}}]),t}(r.Component);j.ErrorBoundary=I;var R=j},33866:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var r=n(2265),o=n(36760),a=n.n(o),i=n(47970),l=n(93350),s=n(19722),c=n(71744),u=n(352),d=n(12918),f=n(18536),p=n(3104),h=n(80669);let m=new u.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=new u.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),v=new u.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),y=new u.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),b=new u.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),x=new u.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),w=e=>{let{componentCls:t,iconCls:n,antCls:r,badgeShadowSize:o,motionDurationSlow:a,textFontSize:i,textFontSizeSM:l,statusSize:s,dotSize:c,textFontWeight:p,indicatorHeight:h,indicatorHeightSM:w,marginXS:k,calc:S}=e,E="".concat(r,"-scroll-number"),O=(0,f.Z)(e,(e,n)=>{let{darkColor:r}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:r,["&:not(".concat(t,"-count)")]:{color:r}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{zIndex:e.indicatorZIndex,minWidth:h,height:h,color:e.badgeTextColor,fontWeight:p,fontSize:i,lineHeight:(0,u.bf)(h),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:S(h).div(2).equal(),boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor),transition:"background ".concat(e.motionDurationMid),a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},["".concat(t,"-count-sm")]:{minWidth:w,height:w,fontSize:l,lineHeight:(0,u.bf)(w),borderRadius:S(w).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,u.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:c,minWidth:c,height:c,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor)},["".concat(t,"-dot").concat(E)]:{transition:"background ".concat(a)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(E,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(t,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(t,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},["".concat(t,"-status-success")]:{backgroundColor:e.colorSuccess},["".concat(t,"-status-processing")]:{overflow:"visible",color:e.colorPrimary,backgroundColor:e.colorPrimary,"&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:m,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(t,"-status-default")]:{backgroundColor:e.colorTextPlaceholder},["".concat(t,"-status-error")]:{backgroundColor:e.colorError},["".concat(t,"-status-warning")]:{backgroundColor:e.colorWarning},["".concat(t,"-status-text")]:{marginInlineStart:k,color:e.colorText,fontSize:e.fontSize}}}),O),{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:g,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["".concat(t,"-zoom-leave")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:b,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(E,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(E,"-custom-component, ").concat(E)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},["".concat(E)]:{overflow:"hidden",["".concat(E,"-only")]:{position:"relative",display:"inline-block",height:h,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(E,"-only-unit")]:{height:h,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(E,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(E,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},k=e=>{let{fontHeight:t,lineWidth:n,marginXS:r,colorBorderBg:o}=e,a=e.colorBgContainer,i=e.colorError,l=e.colorErrorHover;return(0,p.TS)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:a,badgeColor:i,badgeColorHover:l,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:r,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},S=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:r,lineWidth:o}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*o,indicatorHeightSM:t,dotSize:r/2,textFontSize:r,textFontSizeSM:r,textFontWeight:"normal",statusSize:r/2}};var E=(0,h.I$)("Badge",e=>w(k(e)),S);let O=e=>{let{antCls:t,badgeFontHeight:n,marginXS:r,badgeRibbonOffset:o,calc:a}=e,i="".concat(t,"-ribbon"),l=(0,f.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(i,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat("".concat(t,"-ribbon-wrapper"))]:{position:"relative"},["".concat(i)]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:r,padding:"0 ".concat((0,u.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,u.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(i,"-text")]:{color:e.colorTextLightSolid},["".concat(i,"-corner")]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:"".concat((0,u.bf)(a(o).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),l),{["&".concat(i,"-placement-end")]:{insetInlineEnd:a(o).mul(-1).equal(),borderEndEndRadius:0,["".concat(i,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(i,"-placement-start")]:{insetInlineStart:a(o).mul(-1).equal(),borderEndStartRadius:0,["".concat(i,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var C=(0,h.I$)(["Badge","Ribbon"],e=>O(k(e)),S);function j(e){let t,{prefixCls:n,value:o,current:i,offset:l=0}=e;return l&&(t={position:"absolute",top:"".concat(l,"00%"),left:0}),r.createElement("span",{style:t,className:a()("".concat(n,"-only-unit"),{current:i})},o)}function _(e){let t,n;let{prefixCls:o,count:a,value:i}=e,l=Number(i),s=Math.abs(a),[c,u]=r.useState(l),[d,f]=r.useState(s),p=()=>{u(l),f(s)};if(r.useEffect(()=>{let e=setTimeout(()=>{p()},1e3);return()=>{clearTimeout(e)}},[l]),c===l||Number.isNaN(l)||Number.isNaN(c))t=[r.createElement(j,Object.assign({},e,{key:l,current:!0}))],n={transition:"none"};else{t=[];let o=l+10,a=[];for(let e=l;e<=o;e+=1)a.push(e);let i=a.findIndex(e=>e%10===c);t=a.map((t,n)=>r.createElement(j,Object.assign({},e,{key:t,value:t%10,offset:n-i,current:n===i}))),n={transform:"translateY(".concat(-function(e,t,n){let r=e,o=0;for(;(r+10)%10!==t;)r+=n,o+=n;return o}(c,l,d<s?1:-1),"00%)")}}return r.createElement("span",{className:"".concat(o,"-only"),style:n,onTransitionEnd:p},t)}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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=r.forwardRef((e,t)=>{let{prefixCls:n,count:o,className:i,motionClassName:l,style:u,title:d,show:f,component:p="sup",children:h}=e,m=P(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:g}=r.useContext(c.E_),v=g("scroll-number",n),y=Object.assign(Object.assign({},m),{"data-show":f,style:u,className:a()(v,i,l),title:d}),b=o;if(o&&Number(o)%1==0){let e=String(o).split("");b=r.createElement("bdi",null,e.map((t,n)=>r.createElement(_,{prefixCls:v,count:Number(o),value:t,key:e.length-n})))}return(u&&u.borderColor&&(y.style=Object.assign(Object.assign({},u),{boxShadow:"0 0 0 1px ".concat(u.borderColor," inset")})),h)?(0,s.Tm)(h,e=>({className:a()("".concat(v,"-custom-component"),null==e?void 0:e.className,l)})):r.createElement(p,Object.assign({},y,{ref:t}),b)});var T=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let A=r.forwardRef((e,t)=>{var n,o,u,d,f;let{prefixCls:p,scrollNumberPrefixCls:h,children:m,status:g,text:v,color:y,count:b=null,overflowCount:x=99,dot:w=!1,size:k="default",title:S,offset:O,style:C,className:j,rootClassName:_,classNames:P,styles:A,showZero:M=!1}=e,I=T(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:R,direction:D,badge:L}=r.useContext(c.E_),Z=R("badge",p),[z,B,F]=E(Z),H=b>x?"".concat(x,"+"):b,q="0"===H||0===H,W=(null!=g||null!=y)&&(null===b||q&&!M),U=w&&!q,K=U?"":H,$=(0,r.useMemo)(()=>(null==K||""===K||q&&!M)&&!U,[K,q,M,U]),V=(0,r.useRef)(b);$||(V.current=b);let X=V.current,G=(0,r.useRef)(K);$||(G.current=K);let Y=G.current,Q=(0,r.useRef)(U);$||(Q.current=U);let J=(0,r.useMemo)(()=>{if(!O)return Object.assign(Object.assign({},null==L?void 0:L.style),C);let e={marginTop:O[1]};return"rtl"===D?e.left=parseInt(O[0],10):e.right=-parseInt(O[0],10),Object.assign(Object.assign(Object.assign({},e),null==L?void 0:L.style),C)},[D,O,C,null==L?void 0:L.style]),ee=null!=S?S:"string"==typeof X||"number"==typeof X?X:void 0,et=$||!v?null:r.createElement("span",{className:"".concat(Z,"-status-text")},v),en=X&&"object"==typeof X?(0,s.Tm)(X,e=>({style:Object.assign(Object.assign({},J),e.style)})):void 0,er=(0,l.o2)(y,!1),eo=a()(null==P?void 0:P.indicator,null===(n=null==L?void 0:L.classNames)||void 0===n?void 0:n.indicator,{["".concat(Z,"-status-dot")]:W,["".concat(Z,"-status-").concat(g)]:!!g,["".concat(Z,"-color-").concat(y)]:er}),ea={};y&&!er&&(ea.color=y,ea.background=y);let ei=a()(Z,{["".concat(Z,"-status")]:W,["".concat(Z,"-not-a-wrapper")]:!m,["".concat(Z,"-rtl")]:"rtl"===D},j,_,null==L?void 0:L.className,null===(o=null==L?void 0:L.classNames)||void 0===o?void 0:o.root,null==P?void 0:P.root,B,F);if(!m&&W){let e=J.color;return z(r.createElement("span",Object.assign({},I,{className:ei,style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.root),null===(u=null==L?void 0:L.styles)||void 0===u?void 0:u.root),J)}),r.createElement("span",{className:eo,style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.indicator),null===(d=null==L?void 0:L.styles)||void 0===d?void 0:d.indicator),ea)}),v&&r.createElement("span",{style:{color:e},className:"".concat(Z,"-status-text")},v)))}return z(r.createElement("span",Object.assign({ref:t},I,{className:ei,style:Object.assign(Object.assign({},null===(f=null==L?void 0:L.styles)||void 0===f?void 0:f.root),null==A?void 0:A.root)}),m,r.createElement(i.ZP,{visible:!$,motionName:"".concat(Z,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:o,ref:i}=e,l=R("scroll-number",h),s=Q.current,c=a()(null==P?void 0:P.indicator,null===(t=null==L?void 0:L.classNames)||void 0===t?void 0:t.indicator,{["".concat(Z,"-dot")]:s,["".concat(Z,"-count")]:!s,["".concat(Z,"-count-sm")]:"small"===k,["".concat(Z,"-multiple-words")]:!s&&Y&&Y.toString().length>1,["".concat(Z,"-status-").concat(g)]:!!g,["".concat(Z,"-color-").concat(y)]:er}),u=Object.assign(Object.assign(Object.assign({},null==A?void 0:A.indicator),null===(n=null==L?void 0:L.styles)||void 0===n?void 0:n.indicator),J);return y&&!er&&((u=u||{}).background=y),r.createElement(N,{prefixCls:l,show:!$,motionClassName:o,className:c,count:Y,title:ee,style:u,key:"scrollNumber",ref:i},en)}),et))});A.Ribbon=e=>{let{className:t,prefixCls:n,style:o,color:i,children:s,text:u,placement:d="end",rootClassName:f}=e,{getPrefixCls:p,direction:h}=r.useContext(c.E_),m=p("ribbon",n),g="".concat(m,"-wrapper"),[v,y,b]=C(m,g),x=(0,l.o2)(i,!1),w=a()(m,"".concat(m,"-placement-").concat(d),{["".concat(m,"-rtl")]:"rtl"===h,["".concat(m,"-color-").concat(i)]:x},t),k={},S={};return i&&!x&&(k.background=i,S.color=i),v(r.createElement("div",{className:a()(g,f,y,b)},s,r.createElement("div",{className:a()(w,y),style:Object.assign(Object.assign({},k),o)},r.createElement("span",{className:"".concat(m,"-text")},u),r.createElement("div",{className:"".concat(m,"-corner"),style:S}))))};var M=A},67960:function(e,t,n){"use strict";n.d(t,{Z:function(){return e8}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),l=n(71744),s=n(33759),c=e=>{let{prefixCls:t,className:n,style:o,size:i,shape:l}=e,s=a()({["".concat(t,"-lg")]:"large"===i,["".concat(t,"-sm")]:"small"===i}),c=a()({["".concat(t,"-circle")]:"circle"===l,["".concat(t,"-square")]:"square"===l,["".concat(t,"-round")]:"round"===l}),u=r.useMemo(()=>"number"==typeof i?{width:i,height:i,lineHeight:"".concat(i,"px")}:{},[i]);return r.createElement("span",{className:a()(t,s,c,n),style:Object.assign(Object.assign({},u),o)})},u=n(352),d=n(80669),f=n(3104);let p=new u.E4("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),h=e=>({height:e,lineHeight:(0,u.bf)(e)}),m=e=>Object.assign({width:e},h(e)),g=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:p,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),v=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},h(e)),y=e=>{let{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:o,controlHeightSM:a}=e;return{["".concat(t)]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},m(r)),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"},["".concat(t).concat(t,"-lg")]:Object.assign({},m(o)),["".concat(t).concat(t,"-sm")]:Object.assign({},m(a))}},b=e=>{let{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:o,controlHeightSM:a,gradientFromColor:i,calc:l}=e;return{["".concat(r)]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:n},v(t,l)),["".concat(r,"-lg")]:Object.assign({},v(o,l)),["".concat(r,"-sm")]:Object.assign({},v(a,l))}},x=e=>Object.assign({width:e},h(e)),w=e=>{let{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:o,calc:a}=e;return{["".concat(t)]:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:r,borderRadius:o},x(a(n).mul(2).equal())),{["".concat(t,"-path")]:{fill:"#bfbfbf"},["".concat(t,"-svg")]:Object.assign(Object.assign({},x(n)),{maxWidth:a(n).mul(4).equal(),maxHeight:a(n).mul(4).equal()}),["".concat(t,"-svg").concat(t,"-svg-circle")]:{borderRadius:"50%"}}),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"}}},k=(e,t,n)=>{let{skeletonButtonCls:r}=e;return{["".concat(n).concat(r,"-circle")]:{width:t,minWidth:t,borderRadius:"50%"},["".concat(n).concat(r,"-round")]:{borderRadius:t}}},S=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},h(e)),E=e=>{let{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:o,controlHeightSM:a,gradientFromColor:i,calc:l}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:l(r).mul(2).equal(),minWidth:l(r).mul(2).equal()},S(r,l))},k(e,r,n)),{["".concat(n,"-lg")]:Object.assign({},S(o,l))}),k(e,o,"".concat(n,"-lg"))),{["".concat(n,"-sm")]:Object.assign({},S(a,l))}),k(e,a,"".concat(n,"-sm")))},O=e=>{let{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:o,skeletonButtonCls:a,skeletonInputCls:i,skeletonImageCls:l,controlHeight:s,controlHeightLG:c,controlHeightSM:u,gradientFromColor:d,padding:f,marginSM:p,borderRadius:h,titleHeight:v,blockRadius:x,paragraphLiHeight:k,controlHeightXS:S,paragraphMarginTop:O}=e;return{["".concat(t)]:{display:"table",width:"100%",["".concat(t,"-header")]:{display:"table-cell",paddingInlineEnd:f,verticalAlign:"top",["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:d},m(s)),["".concat(n,"-circle")]:{borderRadius:"50%"},["".concat(n,"-lg")]:Object.assign({},m(c)),["".concat(n,"-sm")]:Object.assign({},m(u))},["".concat(t,"-content")]:{display:"table-cell",width:"100%",verticalAlign:"top",["".concat(r)]:{width:"100%",height:v,background:d,borderRadius:x,["+ ".concat(o)]:{marginBlockStart:u}},["".concat(o)]:{padding:0,"> li":{width:"100%",height:k,listStyle:"none",background:d,borderRadius:x,"+ li":{marginBlockStart:S}}},["".concat(o,"> li:last-child:not(:first-child):not(:nth-child(2))")]:{width:"61%"}},["&-round ".concat(t,"-content")]:{["".concat(r,", ").concat(o," > li")]:{borderRadius:h}}},["".concat(t,"-with-avatar ").concat(t,"-content")]:{["".concat(r)]:{marginBlockStart:p,["+ ".concat(o)]:{marginBlockStart:O}}},["".concat(t).concat(t,"-element")]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},E(e)),y(e)),b(e)),w(e)),["".concat(t).concat(t,"-block")]:{width:"100%",["".concat(a)]:{width:"100%"},["".concat(i)]:{width:"100%"}},["".concat(t).concat(t,"-active")]:{["\n ".concat(r,",\n ").concat(o," > li,\n ").concat(n,",\n ").concat(a,",\n ").concat(i,",\n ").concat(l,"\n ")]:Object.assign({},g(e))}}};var C=(0,d.I$)("Skeleton",e=>{let{componentCls:t,calc:n}=e;return[O((0,f.TS)(e,{skeletonAvatarCls:"".concat(t,"-avatar"),skeletonTitleCls:"".concat(t,"-title"),skeletonParagraphCls:"".concat(t,"-paragraph"),skeletonButtonCls:"".concat(t,"-button"),skeletonInputCls:"".concat(t,"-input"),skeletonImageCls:"".concat(t,"-image"),imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:"linear-gradient(90deg, ".concat(e.gradientFromColor," 25%, ").concat(e.gradientToColor," 37%, ").concat(e.gradientFromColor," 63%)"),skeletonLoadingMotionDuration:"1.4s"}))]},e=>{let{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n,gradientFromColor:t,gradientToColor:n,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),j=n(1119),_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},P=n(55015),N=r.forwardRef(function(e,t){return r.createElement(P.Z,(0,j.Z)({},e,{ref:t,icon:_}))}),T=n(83145),A=e=>{let t=t=>{let{width:n,rows:r=2}=e;return Array.isArray(n)?n[t]:r-1===t?n:void 0},{prefixCls:n,className:o,style:i,rows:l}=e,s=(0,T.Z)(Array(l)).map((e,n)=>r.createElement("li",{key:n,style:{width:t(n)}}));return r.createElement("ul",{className:a()(n,o),style:i},s)},M=e=>{let{prefixCls:t,className:n,width:o,style:i}=e;return r.createElement("h3",{className:a()(t,n),style:Object.assign({width:o},i)})};function I(e){return e&&"object"==typeof e?e:{}}let R=e=>{let{prefixCls:t,loading:n,className:o,rootClassName:i,style:s,children:u,avatar:d=!1,title:f=!0,paragraph:p=!0,active:h,round:m}=e,{getPrefixCls:g,direction:v,skeleton:y}=r.useContext(l.E_),b=g("skeleton",t),[x,w,k]=C(b);if(n||!("loading"in e)){let e,t;let n=!!d,l=!!f,u=!!p;if(n){let t=Object.assign(Object.assign({prefixCls:"".concat(b,"-avatar")},l&&!u?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),I(d));e=r.createElement("div",{className:"".concat(b,"-header")},r.createElement(c,Object.assign({},t)))}if(l||u){let e,o;if(l){let t=Object.assign(Object.assign({prefixCls:"".concat(b,"-title")},!n&&u?{width:"38%"}:n&&u?{width:"50%"}:{}),I(f));e=r.createElement(M,Object.assign({},t))}if(u){let e=Object.assign(Object.assign({prefixCls:"".concat(b,"-paragraph")},function(e,t){let n={};return e&&t||(n.width="61%"),!e&&t?n.rows=3:n.rows=2,n}(n,l)),I(p));o=r.createElement(A,Object.assign({},e))}t=r.createElement("div",{className:"".concat(b,"-content")},e,o)}let g=a()(b,{["".concat(b,"-with-avatar")]:n,["".concat(b,"-active")]:h,["".concat(b,"-rtl")]:"rtl"===v,["".concat(b,"-round")]:m},null==y?void 0:y.className,o,i,w,k);return x(r.createElement("div",{className:g,style:Object.assign(Object.assign({},null==y?void 0:y.style),s)},e,t))}return void 0!==u?u:null};R.Button=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,block:u=!1,size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s,["".concat(p,"-block")]:u},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-button"),size:d},v))))},R.Avatar=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,shape:u="circle",size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls","className"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-avatar"),shape:u,size:d},v))))},R.Input=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,block:u,size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s,["".concat(p,"-block")]:u},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-input"),size:d},v))))},R.Image=e=>{let{prefixCls:t,className:n,rootClassName:o,style:i,active:s}=e,{getPrefixCls:c}=r.useContext(l.E_),u=c("skeleton",t),[d,f,p]=C(u),h=a()(u,"".concat(u,"-element"),{["".concat(u,"-active")]:s},n,o,f,p);return d(r.createElement("div",{className:h},r.createElement("div",{className:a()("".concat(u,"-image"),n),style:i},r.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(u,"-image-svg")},r.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(u,"-image-path")})))))},R.Node=e=>{let{prefixCls:t,className:n,rootClassName:o,style:i,active:s,children:c}=e,{getPrefixCls:u}=r.useContext(l.E_),d=u("skeleton",t),[f,p,h]=C(d),m=a()(d,"".concat(d,"-element"),{["".concat(d,"-active")]:s},p,n,o,h),g=null!=c?c:r.createElement(N,null);return f(r.createElement("div",{className:m},r.createElement("div",{className:a()("".concat(d,"-image"),n),style:i},g)))};var D=n(49638),L=n(39760),Z=n(96473),z=n(11993),B=n(31686),F=n(26365),H=n(41154),q=n(6989),W=n(50506),U=n(79267),K=(0,r.createContext)(null),$=n(31474),V=n(58525),X=n(28791),G=n(53346),Y=function(e){var t=e.activeTabOffset,n=e.horizontal,o=e.rtl,a=e.indicator,i=void 0===a?{}:a,l=i.size,s=i.align,c=void 0===s?"center":s,u=(0,r.useState)(),d=(0,F.Z)(u,2),f=d[0],p=d[1],h=(0,r.useRef)(),m=r.useCallback(function(e){return"function"==typeof l?l(e):"number"==typeof l?l:e},[l]);function g(){G.Z.cancel(h.current)}return(0,r.useEffect)(function(){var e={};if(t){if(n){e.width=m(t.width);var r=o?"right":"left";"start"===c&&(e[r]=t[r]),"center"===c&&(e[r]=t[r]+t.width/2,e.transform=o?"translateX(50%)":"translateX(-50%)"),"end"===c&&(e[r]=t[r]+t.width,e.transform="translateX(-100%)")}else e.height=m(t.height),"start"===c&&(e.top=t.top),"center"===c&&(e.top=t.top+t.height/2,e.transform="translateY(-50%)"),"end"===c&&(e.top=t.top+t.height,e.transform="translateY(-100%)")}return g(),h.current=(0,G.Z)(function(){p(e)}),g},[t,n,o,c,m]),{style:f}},Q={width:0,height:0,left:0,top:0};function J(e,t){var n=r.useRef(e),o=r.useState({}),a=(0,F.Z)(o,2)[1];return[n.current,function(e){var r="function"==typeof e?e(n.current):e;r!==n.current&&t(r,n.current),n.current=r,a({})}]}var ee=n(27380);function et(e){var t=(0,r.useState)(0),n=(0,F.Z)(t,2),o=n[0],a=n[1],i=(0,r.useRef)(0),l=(0,r.useRef)();return l.current=e,(0,ee.o)(function(){var e;null===(e=l.current)||void 0===e||e.call(l)},[o]),function(){i.current===o&&(i.current+=1,a(i.current))}}var en={width:0,height:0,left:0,top:0,right:0};function er(e){var t;return e instanceof Map?(t={},e.forEach(function(e,n){t[n]=e})):t=e,JSON.stringify(t)}function eo(e){return String(e).replace(/"/g,"TABS_DQ")}function ea(e,t,n,r){return!!n&&!r&&!1!==e&&(void 0!==e||!1!==t&&null!==t)}var ei=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.editable,a=e.locale,i=e.style;return o&&!1!==o.showAdd?r.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(null==a?void 0:a.addAriaLabel)||"Add tab",onClick:function(e){o.onEdit("add",{event:e})}},o.addIcon||"+"):null}),el=r.forwardRef(function(e,t){var n,o=e.position,a=e.prefixCls,i=e.extra;if(!i)return null;var l={};return"object"!==(0,H.Z)(i)||r.isValidElement(i)?l.right=i:l=i,"right"===o&&(n=l.right),"left"===o&&(n=l.left),n?r.createElement("div",{className:"".concat(a,"-extra-content"),ref:t},n):null}),es=n(71030),ec=n(33082),eu=n(95814),ed=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.id,i=e.tabs,l=e.locale,s=e.mobile,c=e.moreIcon,u=e.moreTransitionName,d=e.style,f=e.className,p=e.editable,h=e.tabBarGutter,m=e.rtl,g=e.removeAriaLabel,v=e.onTabClick,y=e.getPopupContainer,b=e.popupClassName,x=(0,r.useState)(!1),w=(0,F.Z)(x,2),k=w[0],S=w[1],E=(0,r.useState)(null),O=(0,F.Z)(E,2),C=O[0],j=O[1],_="".concat(o,"-more-popup"),P="".concat(n,"-dropdown"),N=null!==C?"".concat(_,"-").concat(C):null,T=null==l?void 0:l.dropdownAriaLabel,A=r.createElement(ec.ZP,{onClick:function(e){v(e.key,e.domEvent),S(!1)},prefixCls:"".concat(P,"-menu"),id:_,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[C],"aria-label":void 0!==T?T:"expanded dropdown"},i.map(function(e){var t=e.closable,n=e.disabled,a=e.closeIcon,i=e.key,l=e.label,s=ea(t,a,p,n);return r.createElement(ec.sN,{key:i,id:"".concat(_,"-").concat(i),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(i),disabled:n},r.createElement("span",null,l),s&&r.createElement("button",{type:"button","aria-label":g||"remove",tabIndex:0,className:"".concat(P,"-menu-item-remove"),onClick:function(e){e.stopPropagation(),e.preventDefault(),e.stopPropagation(),p.onEdit("remove",{key:i,event:e})}},a||p.removeIcon||"\xd7"))}));function M(e){for(var t=i.filter(function(e){return!e.disabled}),n=t.findIndex(function(e){return e.key===C})||0,r=t.length,o=0;o<r;o+=1){var a=t[n=(n+e+r)%r];if(!a.disabled){j(a.key);return}}}(0,r.useEffect)(function(){var e=document.getElementById(N);e&&e.scrollIntoView&&e.scrollIntoView(!1)},[C]),(0,r.useEffect)(function(){k||j(null)},[k]);var I=(0,z.Z)({},m?"marginRight":"marginLeft",h);i.length||(I.visibility="hidden",I.order=1);var R=a()((0,z.Z)({},"".concat(P,"-rtl"),m)),D=s?null:r.createElement(es.Z,{prefixCls:P,overlay:A,trigger:["hover"],visible:!!i.length&&k,transitionName:u,onVisibleChange:S,overlayClassName:a()(R,b),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:y},r.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:I,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":_,id:"".concat(o,"-more"),"aria-expanded":k,onKeyDown:function(e){var t=e.which;if(!k){[eu.Z.DOWN,eu.Z.SPACE,eu.Z.ENTER].includes(t)&&(S(!0),e.preventDefault());return}switch(t){case eu.Z.UP:M(-1),e.preventDefault();break;case eu.Z.DOWN:M(1),e.preventDefault();break;case eu.Z.ESC:S(!1);break;case eu.Z.SPACE:case eu.Z.ENTER:null!==C&&v(C,e)}}},void 0===c?"More":c));return r.createElement("div",{className:a()("".concat(n,"-nav-operations"),f),style:d,ref:t},D,r.createElement(ei,{prefixCls:n,locale:l,editable:p}))}),ef=r.memo(ed,function(e,t){return t.tabMoving}),ep=function(e){var t=e.prefixCls,n=e.id,o=e.active,i=e.tab,l=i.key,s=i.label,c=i.disabled,u=i.closeIcon,d=i.icon,f=e.closable,p=e.renderWrapper,h=e.removeAriaLabel,m=e.editable,g=e.onClick,v=e.onFocus,y=e.style,b="".concat(t,"-tab"),x=ea(f,u,m,c);function w(e){c||g(e)}var k=r.useMemo(function(){return d&&"string"==typeof s?r.createElement("span",null,s):s},[s,d]),S=r.createElement("div",{key:l,"data-node-key":eo(l),className:a()(b,(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(b,"-with-remove"),x),"".concat(b,"-active"),o),"".concat(b,"-disabled"),c)),style:y,onClick:w},r.createElement("div",{role:"tab","aria-selected":o,id:n&&"".concat(n,"-tab-").concat(l),className:"".concat(b,"-btn"),"aria-controls":n&&"".concat(n,"-panel-").concat(l),"aria-disabled":c,tabIndex:c?null:0,onClick:function(e){e.stopPropagation(),w(e)},onKeyDown:function(e){[eu.Z.SPACE,eu.Z.ENTER].includes(e.which)&&(e.preventDefault(),w(e))},onFocus:v},d&&r.createElement("span",{className:"".concat(b,"-icon")},d),s&&k),x&&r.createElement("button",{type:"button","aria-label":h||"remove",tabIndex:0,className:"".concat(b,"-remove"),onClick:function(e){e.stopPropagation(),e.preventDefault(),e.stopPropagation(),m.onEdit("remove",{key:l,event:e})}},u||m.removeIcon||"\xd7"));return p?p(S):S},eh=function(e,t){var n=e.offsetWidth,r=e.offsetHeight,o=e.offsetTop,a=e.offsetLeft,i=e.getBoundingClientRect(),l=i.width,s=i.height,c=i.x,u=i.y;return 1>Math.abs(l-n)?[l,s,c-t.x,u-t.y]:[n,r,a,o]},em=function(e){var t=e.current||{},n=t.offsetWidth,r=void 0===n?0:n,o=t.offsetHeight;if(e.current){var a=e.current.getBoundingClientRect(),i=a.width,l=a.height;if(1>Math.abs(i-r))return[i,l]}return[r,void 0===o?0:o]},eg=function(e,t){return e[t?0:1]},ev=r.forwardRef(function(e,t){var n,o,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,_,P,N,A,M,I,R,D,L,Z,H,q,W,U,G,ee,ea=e.className,es=e.style,ec=e.id,eu=e.animated,ed=e.activeKey,ev=e.rtl,ey=e.extra,eb=e.editable,ex=e.locale,ew=e.tabPosition,ek=e.tabBarGutter,eS=e.children,eE=e.onTabClick,eO=e.onTabScroll,eC=e.indicator,ej=r.useContext(K),e_=ej.prefixCls,eP=ej.tabs,eN=(0,r.useRef)(null),eT=(0,r.useRef)(null),eA=(0,r.useRef)(null),eM=(0,r.useRef)(null),eI=(0,r.useRef)(null),eR=(0,r.useRef)(null),eD=(0,r.useRef)(null),eL="top"===ew||"bottom"===ew,eZ=J(0,function(e,t){eL&&eO&&eO({direction:e>t?"left":"right"})}),ez=(0,F.Z)(eZ,2),eB=ez[0],eF=ez[1],eH=J(0,function(e,t){!eL&&eO&&eO({direction:e>t?"top":"bottom"})}),eq=(0,F.Z)(eH,2),eW=eq[0],eU=eq[1],eK=(0,r.useState)([0,0]),e$=(0,F.Z)(eK,2),eV=e$[0],eX=e$[1],eG=(0,r.useState)([0,0]),eY=(0,F.Z)(eG,2),eQ=eY[0],eJ=eY[1],e0=(0,r.useState)([0,0]),e1=(0,F.Z)(e0,2),e2=e1[0],e6=e1[1],e4=(0,r.useState)([0,0]),e3=(0,F.Z)(e4,2),e5=e3[0],e8=e3[1],e7=(n=new Map,o=(0,r.useRef)([]),i=(0,r.useState)({}),l=(0,F.Z)(i,2)[1],s=(0,r.useRef)("function"==typeof n?n():n),c=et(function(){var e=s.current;o.current.forEach(function(t){e=t(e)}),o.current=[],s.current=e,l({})}),[s.current,function(e){o.current.push(e),c()}]),e9=(0,F.Z)(e7,2),te=e9[0],tt=e9[1],tn=(u=eQ[0],(0,r.useMemo)(function(){for(var e=new Map,t=te.get(null===(o=eP[0])||void 0===o?void 0:o.key)||Q,n=t.left+t.width,r=0;r<eP.length;r+=1){var o,a,i=eP[r].key,l=te.get(i);l||(l=te.get(null===(a=eP[r-1])||void 0===a?void 0:a.key)||Q);var s=e.get(i)||(0,B.Z)({},l);s.right=n-s.left-s.width,e.set(i,s)}return e},[eP.map(function(e){return e.key}).join("_"),te,u])),tr=eg(eV,eL),to=eg(eQ,eL),ta=eg(e2,eL),ti=eg(e5,eL),tl=tr<to+ta,ts=tl?tr-ti:tr-ta,tc="".concat(e_,"-nav-operations-hidden"),tu=0,td=0;function tf(e){return e<tu?tu:e>td?td:e}eL&&ev?(tu=0,td=Math.max(0,to-ts)):(tu=Math.min(0,ts-to),td=0);var tp=(0,r.useRef)(null),th=(0,r.useState)(),tm=(0,F.Z)(th,2),tg=tm[0],tv=tm[1];function ty(){tv(Date.now())}function tb(){tp.current&&clearTimeout(tp.current)}d=function(e,t){function n(e,t){e(function(e){return tf(e+t)})}return!!tl&&(eL?n(eF,e):n(eU,t),tb(),ty(),!0)},f=(0,r.useState)(),h=(p=(0,F.Z)(f,2))[0],m=p[1],g=(0,r.useState)(0),y=(v=(0,F.Z)(g,2))[0],b=v[1],x=(0,r.useState)(0),k=(w=(0,F.Z)(x,2))[0],S=w[1],E=(0,r.useState)(),C=(O=(0,F.Z)(E,2))[0],_=O[1],P=(0,r.useRef)(),N=(0,r.useRef)(),(A=(0,r.useRef)(null)).current={onTouchStart:function(e){var t=e.touches[0];m({x:t.screenX,y:t.screenY}),window.clearInterval(P.current)},onTouchMove:function(e){if(h){e.preventDefault();var t=e.touches[0],n=t.screenX,r=t.screenY;m({x:n,y:r});var o=n-h.x,a=r-h.y;d(o,a);var i=Date.now();b(i),S(i-y),_({x:o,y:a})}},onTouchEnd:function(){if(h&&(m(null),_(null),C)){var e=C.x/k,t=C.y/k;if(!(.1>Math.max(Math.abs(e),Math.abs(t)))){var n=e,r=t;P.current=window.setInterval(function(){if(.01>Math.abs(n)&&.01>Math.abs(r)){window.clearInterval(P.current);return}n*=.9046104802746175,r*=.9046104802746175,d(20*n,20*r)},20)}}},onWheel:function(e){var t=e.deltaX,n=e.deltaY,r=0,o=Math.abs(t),a=Math.abs(n);o===a?r="x"===N.current?t:n:o>a?(r=t,N.current="x"):(r=n,N.current="y"),d(-r,-r)&&e.preventDefault()}},r.useEffect(function(){function e(e){A.current.onTouchMove(e)}function t(e){A.current.onTouchEnd(e)}return document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",t,{passive:!1}),eM.current.addEventListener("touchstart",function(e){A.current.onTouchStart(e)},{passive:!1}),eM.current.addEventListener("wheel",function(e){A.current.onWheel(e)}),function(){document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)}},[]),(0,r.useEffect)(function(){return tb(),tg&&(tp.current=setTimeout(function(){tv(0)},100)),tb},[tg]);var tx=(M=eL?eB:eW,Z=(I=(0,B.Z)((0,B.Z)({},e),{},{tabs:eP})).tabs,H=I.tabPosition,q=I.rtl,["top","bottom"].includes(H)?(R="width",D=q?"right":"left",L=Math.abs(M)):(R="height",D="top",L=-M),(0,r.useMemo)(function(){if(!Z.length)return[0,0];for(var e=Z.length,t=e,n=0;n<e;n+=1){var r=tn.get(Z[n].key)||en;if(r[D]+r[R]>L+ts){t=n-1;break}}for(var o=0,a=e-1;a>=0;a-=1)if((tn.get(Z[a].key)||en)[D]<L){o=a+1;break}return o>=t?[0,0]:[o,t]},[tn,ts,to,ta,ti,L,H,Z.map(function(e){return e.key}).join("_"),q])),tw=(0,F.Z)(tx,2),tk=tw[0],tS=tw[1],tE=(0,V.Z)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ed,t=tn.get(e)||{width:0,height:0,left:0,right:0,top:0};if(eL){var n=eB;ev?t.right<eB?n=t.right:t.right+t.width>eB+ts&&(n=t.right+t.width-ts):t.left<-eB?n=-t.left:t.left+t.width>-eB+ts&&(n=-(t.left+t.width-ts)),eU(0),eF(tf(n))}else{var r=eW;t.top<-eW?r=-t.top:t.top+t.height>-eW+ts&&(r=-(t.top+t.height-ts)),eF(0),eU(tf(r))}}),tO={};"top"===ew||"bottom"===ew?tO[ev?"marginRight":"marginLeft"]=ek:tO.marginTop=ek;var tC=eP.map(function(e,t){var n=e.key;return r.createElement(ep,{id:ec,prefixCls:e_,key:n,tab:e,style:0===t?void 0:tO,closable:e.closable,editable:eb,active:n===ed,renderWrapper:eS,removeAriaLabel:null==ex?void 0:ex.removeAriaLabel,onClick:function(e){eE(n,e)},onFocus:function(){tE(n),ty(),eM.current&&(ev||(eM.current.scrollLeft=0),eM.current.scrollTop=0)}})}),tj=function(){return tt(function(){var e,t=new Map,n=null===(e=eI.current)||void 0===e?void 0:e.getBoundingClientRect();return eP.forEach(function(e){var r,o=e.key,a=null===(r=eI.current)||void 0===r?void 0:r.querySelector('[data-node-key="'.concat(eo(o),'"]'));if(a){var i=eh(a,n),l=(0,F.Z)(i,4),s=l[0],c=l[1],u=l[2],d=l[3];t.set(o,{width:s,height:c,left:u,top:d})}}),t})};(0,r.useEffect)(function(){tj()},[eP.map(function(e){return e.key}).join("_")]);var t_=et(function(){var e=em(eN),t=em(eT),n=em(eA);eX([e[0]-t[0]-n[0],e[1]-t[1]-n[1]]);var r=em(eD);e6(r),e8(em(eR));var o=em(eI);eJ([o[0]-r[0],o[1]-r[1]]),tj()}),tP=eP.slice(0,tk),tN=eP.slice(tS+1),tT=[].concat((0,T.Z)(tP),(0,T.Z)(tN)),tA=tn.get(ed),tM=Y({activeTabOffset:tA,horizontal:eL,indicator:eC,rtl:ev}).style;(0,r.useEffect)(function(){tE()},[ed,tu,td,er(tA),er(tn),eL]),(0,r.useEffect)(function(){t_()},[ev]);var tI=!!tT.length,tR="".concat(e_,"-nav-wrap");return eL?ev?(U=eB>0,W=eB!==td):(W=eB<0,U=eB!==tu):(G=eW<0,ee=eW!==tu),r.createElement($.Z,{onResize:t_},r.createElement("div",{ref:(0,X.x1)(t,eN),role:"tablist",className:a()("".concat(e_,"-nav"),ea),style:es,onKeyDown:function(){ty()}},r.createElement(el,{ref:eT,position:"left",extra:ey,prefixCls:e_}),r.createElement($.Z,{onResize:t_},r.createElement("div",{className:a()(tR,(0,z.Z)((0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(tR,"-ping-left"),W),"".concat(tR,"-ping-right"),U),"".concat(tR,"-ping-top"),G),"".concat(tR,"-ping-bottom"),ee)),ref:eM},r.createElement($.Z,{onResize:t_},r.createElement("div",{ref:eI,className:"".concat(e_,"-nav-list"),style:{transform:"translate(".concat(eB,"px, ").concat(eW,"px)"),transition:tg?"none":void 0}},tC,r.createElement(ei,{ref:eD,prefixCls:e_,locale:ex,editable:eb,style:(0,B.Z)((0,B.Z)({},0===tC.length?void 0:tO),{},{visibility:tI?"hidden":null})}),r.createElement("div",{className:a()("".concat(e_,"-ink-bar"),(0,z.Z)({},"".concat(e_,"-ink-bar-animated"),eu.inkBar)),style:tM}))))),r.createElement(ef,(0,j.Z)({},e,{removeAriaLabel:null==ex?void 0:ex.removeAriaLabel,ref:eR,prefixCls:e_,tabs:tT,className:!tI&&tc,tabMoving:!!tg})),r.createElement(el,{ref:eA,position:"right",extra:ey,prefixCls:e_})))}),ey=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.className,i=e.style,l=e.id,s=e.active,c=e.tabKey,u=e.children;return r.createElement("div",{id:l&&"".concat(l,"-panel-").concat(c),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":l&&"".concat(l,"-tab-").concat(c),"aria-hidden":!s,style:i,className:a()(n,s&&"".concat(n,"-active"),o),ref:t},u)}),eb=["renderTabBar"],ex=["label","key"],ew=function(e){var t=e.renderTabBar,n=(0,q.Z)(e,eb),o=r.useContext(K).tabs;return t?t((0,B.Z)((0,B.Z)({},n),{},{panes:o.map(function(e){var t=e.label,n=e.key,o=(0,q.Z)(e,ex);return r.createElement(ey,(0,j.Z)({tab:t,key:n,tabKey:n},o))})}),ev):r.createElement(ev,n)},ek=n(47970),eS=["key","forceRender","style","className","destroyInactiveTabPane"],eE=function(e){var t=e.id,n=e.activeKey,o=e.animated,i=e.tabPosition,l=e.destroyInactiveTabPane,s=r.useContext(K),c=s.prefixCls,u=s.tabs,d=o.tabPane,f="".concat(c,"-tabpane");return r.createElement("div",{className:a()("".concat(c,"-content-holder"))},r.createElement("div",{className:a()("".concat(c,"-content"),"".concat(c,"-content-").concat(i),(0,z.Z)({},"".concat(c,"-content-animated"),d))},u.map(function(e){var i=e.key,s=e.forceRender,c=e.style,u=e.className,p=e.destroyInactiveTabPane,h=(0,q.Z)(e,eS),m=i===n;return r.createElement(ek.ZP,(0,j.Z)({key:i,visible:m,forceRender:s,removeOnLeave:!!(l||p),leavedClassName:"".concat(f,"-hidden")},o.tabPaneMotion),function(e,n){var o=e.style,l=e.className;return r.createElement(ey,(0,j.Z)({},h,{prefixCls:f,id:t,tabKey:i,animated:d,active:m,style:(0,B.Z)((0,B.Z)({},c),o),className:a()(u,l),ref:n}))})})))};n(32559);var eO=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],eC=0,ej=r.forwardRef(function(e,t){var n=e.id,o=e.prefixCls,i=void 0===o?"rc-tabs":o,l=e.className,s=e.items,c=e.direction,u=e.activeKey,d=e.defaultActiveKey,f=e.editable,p=e.animated,h=e.tabPosition,m=void 0===h?"top":h,g=e.tabBarGutter,v=e.tabBarStyle,y=e.tabBarExtraContent,b=e.locale,x=e.moreIcon,w=e.moreTransitionName,k=e.destroyInactiveTabPane,S=e.renderTabBar,E=e.onChange,O=e.onTabClick,C=e.onTabScroll,_=e.getPopupContainer,P=e.popupClassName,N=e.indicator,T=(0,q.Z)(e,eO),A=r.useMemo(function(){return(s||[]).filter(function(e){return e&&"object"===(0,H.Z)(e)&&"key"in e})},[s]),M="rtl"===c,I=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(e=!1===t?{inkBar:!1,tabPane:!1}:!0===t?{inkBar:!0,tabPane:!1}:(0,B.Z)({inkBar:!0},"object"===(0,H.Z)(t)?t:{})).tabPaneMotion&&void 0===e.tabPane&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}(p),R=(0,r.useState)(!1),D=(0,F.Z)(R,2),L=D[0],Z=D[1];(0,r.useEffect)(function(){Z((0,U.Z)())},[]);var $=(0,W.Z)(function(){var e;return null===(e=A[0])||void 0===e?void 0:e.key},{value:u,defaultValue:d}),V=(0,F.Z)($,2),X=V[0],G=V[1],Y=(0,r.useState)(function(){return A.findIndex(function(e){return e.key===X})}),Q=(0,F.Z)(Y,2),J=Q[0],ee=Q[1];(0,r.useEffect)(function(){var e,t=A.findIndex(function(e){return e.key===X});-1===t&&(t=Math.max(0,Math.min(J,A.length-1)),G(null===(e=A[t])||void 0===e?void 0:e.key)),ee(t)},[A.map(function(e){return e.key}).join("_"),X,J]);var et=(0,W.Z)(null,{value:n}),en=(0,F.Z)(et,2),er=en[0],eo=en[1];(0,r.useEffect)(function(){n||(eo("rc-tabs-".concat(eC)),eC+=1)},[]);var ea={id:er,activeKey:X,animated:I,tabPosition:m,rtl:M,mobile:L},ei=(0,B.Z)((0,B.Z)({},ea),{},{editable:f,locale:b,moreIcon:x,moreTransitionName:w,tabBarGutter:g,onTabClick:function(e,t){null==O||O(e,t);var n=e!==X;G(e),n&&(null==E||E(e))},onTabScroll:C,extra:y,style:v,panes:null,getPopupContainer:_,popupClassName:P,indicator:N});return r.createElement(K.Provider,{value:{tabs:A,prefixCls:i}},r.createElement("div",(0,j.Z)({ref:t,id:n,className:a()(i,"".concat(i,"-").concat(m),(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(i,"-mobile"),L),"".concat(i,"-editable"),f),"".concat(i,"-rtl"),M),l)},T),r.createElement(ew,(0,j.Z)({},ei,{renderTabBar:S})),r.createElement(eE,(0,j.Z)({destroyInactiveTabPane:k},ea,{animated:I}))))}),e_=n(64024),eP=n(68710);let eN={motionAppear:!1,motionEnter:!0,motionLeave:!0};var eT=n(45287),eA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},eM=n(12918),eI=n(18544),eR=e=>{let{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{["".concat(t,"-switch")]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:"opacity ".concat(n)}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:"opacity ".concat(n)}}}}},[(0,eI.oN)(e,"slide-up"),(0,eI.oN)(e,"slide-down")]]};let eD=e=>{let{componentCls:t,tabsCardPadding:n,cardBg:r,cardGutter:o,colorBorderSecondary:a,itemSelectedColor:i}=e;return{["".concat(t,"-card")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{margin:0,padding:n,background:r,border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut)},["".concat(t,"-tab-active")]:{color:i,background:e.colorBgContainer},["".concat(t,"-ink-bar")]:{visibility:"hidden"}},["&".concat(t,"-top, &").concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginLeft:{_skip_check_:!0,value:(0,u.bf)(o)}}}},["&".concat(t,"-top")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")},["".concat(t,"-tab-active")]:{borderBottomColor:e.colorBgContainer}}},["&".concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},["".concat(t,"-tab-active")]:{borderTopColor:e.colorBgContainer}}},["&".concat(t,"-left, &").concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginTop:(0,u.bf)(o)}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,u.bf)(e.borderRadiusLG)," 0 0 ").concat((0,u.bf)(e.borderRadiusLG))}},["".concat(t,"-tab-active")]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0")}},["".concat(t,"-tab-active")]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},eL=e=>{let{componentCls:t,itemHoverColor:n,dropdownEdgeChildVerticalPadding:r}=e;return{["".concat(t,"-dropdown")]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},["".concat(t,"-dropdown-menu")]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:"".concat((0,u.bf)(r)," 0"),overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},eM.vS),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:"".concat((0,u.bf)(e.paddingXXS)," ").concat((0,u.bf)(e.paddingSM)),color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},eZ=e=>{let{componentCls:t,margin:n,colorBorderSecondary:r,horizontalMargin:o,verticalItemPadding:a,verticalItemMargin:i,calc:l}=e;return{["".concat(t,"-top, ").concat(t,"-bottom")]:{flexDirection:"column",["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r),content:"''"},["".concat(t,"-ink-bar")]:{height:e.lineWidthBold,"&-animated":{transition:"width ".concat(e.motionDurationSlow,", left ").concat(e.motionDurationSlow,",\n right ").concat(e.motionDurationSlow)}},["".concat(t,"-nav-wrap")]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},["&".concat(t,"-nav-wrap-ping-left::before")]:{opacity:1},["&".concat(t,"-nav-wrap-ping-right::after")]:{opacity:1}}}},["".concat(t,"-top")]:{["> ".concat(t,"-nav,\n > div > ").concat(t,"-nav")]:{"&::before":{bottom:0},["".concat(t,"-ink-bar")]:{bottom:0}}},["".concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},["".concat(t,"-ink-bar")]:{top:0}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{order:0}},["".concat(t,"-left, ").concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{flexDirection:"column",minWidth:l(e.controlHeight).mul(1.25).equal(),["".concat(t,"-tab")]:{padding:a,textAlign:"center"},["".concat(t,"-tab + ").concat(t,"-tab")]:{margin:i},["".concat(t,"-nav-wrap")]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},["&".concat(t,"-nav-wrap-ping-top::before")]:{opacity:1},["&".concat(t,"-nav-wrap-ping-bottom::after")]:{opacity:1}},["".concat(t,"-ink-bar")]:{width:e.lineWidthBold,"&-animated":{transition:"height ".concat(e.motionDurationSlow,", top ").concat(e.motionDurationSlow)}},["".concat(t,"-nav-list, ").concat(t,"-nav-operations")]:{flex:"1 0 auto",flexDirection:"column"}}},["".concat(t,"-left")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-ink-bar")]:{right:{_skip_check_:!0,value:0}}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{marginLeft:{_skip_check_:!0,value:(0,u.bf)(l(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},["> ".concat(t,"-content > ").concat(t,"-tabpane")]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},["".concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{order:1,["".concat(t,"-ink-bar")]:{left:{_skip_check_:!0,value:0}}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{order:0,marginRight:{_skip_check_:!0,value:l(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},["> ".concat(t,"-content > ").concat(t,"-tabpane")]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},ez=e=>{let{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,horizontalItemPaddingSM:o,horizontalItemPaddingLG:a}=e;return{[t]:{"&-small":{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:o,fontSize:e.titleFontSizeSM}}},"&-large":{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:a,fontSize:e.titleFontSizeLG}}}},["".concat(t,"-card")]:{["&".concat(t,"-small")]:{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:n}},["&".concat(t,"-bottom")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius))}},["&".concat(t,"-top")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:"".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius)," 0 0")}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius)," 0")}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,u.bf)(e.borderRadius)," 0 0 ").concat((0,u.bf)(e.borderRadius))}}}},["&".concat(t,"-large")]:{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:r}}}}}},eB=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:o,tabsHorizontalItemMargin:a,horizontalItemPadding:i,itemSelectedColor:l,itemColor:s}=e,c="".concat(t,"-tab");return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:i,fontSize:e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:s,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},(0,eM.Qy)(e)),"&-btn":{outline:"none",transition:"all 0.3s",["".concat(c,"-icon:not(:last-child)")]:{marginInlineEnd:e.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextHeading}},"&:hover":{color:r},["&".concat(c,"-active ").concat(c,"-btn")]:{color:l,textShadow:e.tabsActiveTextShadow},["&".concat(c,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed"},["&".concat(c,"-disabled ").concat(c,"-btn, &").concat(c,"-disabled ").concat(t,"-remove")]:{"&:focus, &:active":{color:e.colorTextDisabled}},["& ".concat(c,"-remove ").concat(o)]:{margin:0},["".concat(o,":not(:last-child)")]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},["".concat(c," + ").concat(c)]:{margin:{_skip_check_:!0,value:a}}}},eF=e=>{let{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:o,calc:a}=e;return{["".concat(t,"-rtl")]:{direction:"rtl",["".concat(t,"-nav")]:{["".concat(t,"-tab")]:{margin:{_skip_check_:!0,value:n},["".concat(t,"-tab:last-of-type")]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,u.bf)(e.marginSM)}},["".concat(t,"-tab-remove")]:{marginRight:{_skip_check_:!0,value:(0,u.bf)(e.marginXS)},marginLeft:{_skip_check_:!0,value:(0,u.bf)(a(e.marginXXS).mul(-1).equal())},[r]:{margin:0}}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav")]:{order:1},["> ".concat(t,"-content-holder")]:{order:0}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav")]:{order:0},["> ".concat(t,"-content-holder")]:{order:1}},["&".concat(t,"-card").concat(t,"-top, &").concat(t,"-card").concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},["".concat(t,"-dropdown-rtl")]:{direction:"rtl"},["".concat(t,"-menu-item")]:{["".concat(t,"-dropdown-rtl")]:{textAlign:{_skip_check_:!0,value:"right"}}}}},eH=e=>{let{componentCls:t,tabsCardPadding:n,cardHeight:r,cardGutter:o,itemHoverColor:a,itemActiveColor:i,colorBorderSecondary:l}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,eM.Wf)(e)),{display:"flex",["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{position:"relative",display:"flex",flex:"none",alignItems:"center",["".concat(t,"-nav-wrap")]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:"opacity ".concat(e.motionDurationSlow),content:"''",pointerEvents:"none"}},["".concat(t,"-nav-list")]:{position:"relative",display:"flex",transition:"opacity ".concat(e.motionDurationSlow)},["".concat(t,"-nav-operations")]:{display:"flex",alignSelf:"stretch"},["".concat(t,"-nav-operations-hidden")]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},["".concat(t,"-nav-more")]:{position:"relative",padding:n,background:"transparent",border:0,color:e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},["".concat(t,"-nav-add")]:Object.assign({minWidth:r,minHeight:r,marginLeft:{_skip_check_:!0,value:o},padding:"0 ".concat((0,u.bf)(e.paddingXS)),background:"transparent",border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(l),borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0"),outline:"none",cursor:"pointer",color:e.colorText,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut),"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:i}},(0,eM.Qy)(e))},["".concat(t,"-extra-content")]:{flex:"none"},["".concat(t,"-ink-bar")]:{position:"absolute",background:e.inkBarColor,pointerEvents:"none"}}),eB(e)),{["".concat(t,"-content")]:{position:"relative",width:"100%"},["".concat(t,"-content-holder")]:{flex:"auto",minWidth:0,minHeight:0},["".concat(t,"-tabpane")]:{outline:"none","&-hidden":{display:"none"}}}),["".concat(t,"-centered")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-nav-wrap")]:{["&:not([class*='".concat(t,"-nav-wrap-ping'])")]:{justifyContent:"center"}}}}}};var eq=(0,d.I$)("Tabs",e=>{let t=(0,f.TS)(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:"0 0 0 ".concat((0,u.bf)(e.horizontalItemGutter)),tabsHorizontalItemMarginRTL:"0 0 0 ".concat((0,u.bf)(e.horizontalItemGutter))});return[ez(t),eF(t),eZ(t),eL(t),eD(t),eH(t),eR(t)]},e=>{let t=e.controlHeightLG;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:t,cardPadding:"".concat((t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth,"px ").concat(e.padding,"px"),cardPaddingSM:"".concat(1.5*e.paddingXXS,"px ").concat(e.padding,"px"),cardPaddingLG:"".concat(e.paddingXS,"px ").concat(e.padding,"px ").concat(1.5*e.paddingXXS,"px"),titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:"0 0 ".concat(e.margin,"px 0"),horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:"".concat(e.paddingSM,"px 0"),horizontalItemPaddingSM:"".concat(e.paddingXS,"px 0"),horizontalItemPaddingLG:"".concat(e.padding,"px 0"),verticalItemPadding:"".concat(e.paddingXS,"px ").concat(e.paddingLG,"px"),verticalItemMargin:"".concat(e.margin,"px 0 0 0"),itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}}),eW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eU=e=>{var t,n,o,i,c,u;let d;let{type:f,className:p,rootClassName:h,size:m,onEdit:g,hideAdd:v,centered:y,addIcon:b,popupClassName:x,children:w,items:k,animated:S,style:E,indicatorSize:O,indicator:C}=e,j=eW(e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:_,moreIcon:P=r.createElement(L.Z,null)}=j,{direction:N,tabs:T,getPrefixCls:A,getPopupContainer:M}=r.useContext(l.E_),I=A("tabs",_),R=(0,e_.Z)(I),[z,B,F]=eq(I,R);"editable-card"===f&&(d={onEdit:(e,t)=>{let{key:n,event:r}=t;null==g||g("add"===e?r:n,e)},removeIcon:r.createElement(D.Z,null),addIcon:b||r.createElement(Z.Z,null),showAdd:!0!==v});let H=A(),q=(0,s.Z)(m),W=k||(0,eT.Z)(w).map(e=>{if(r.isValidElement(e)){let{key:t,props:n}=e,r=n||{},{tab:o}=r,a=eA(r,["tab"]);return Object.assign(Object.assign({key:String(t)},a),{label:o})}return null}).filter(e=>e),U=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return(t=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{})).tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},eN),{motionName:(0,eP.m)(e,"switch")})),t}(I,S),K=Object.assign(Object.assign({},null==T?void 0:T.style),E),$={align:null!==(t=null==C?void 0:C.align)&&void 0!==t?t:null===(n=null==T?void 0:T.indicator)||void 0===n?void 0:n.align,size:null!==(u=null!==(i=null!==(o=null==C?void 0:C.size)&&void 0!==o?o:O)&&void 0!==i?i:null===(c=null==T?void 0:T.indicator)||void 0===c?void 0:c.size)&&void 0!==u?u:null==T?void 0:T.indicatorSize};return z(r.createElement(ej,Object.assign({direction:N,getPopupContainer:M,moreTransitionName:"".concat(H,"-slide-up")},j,{items:W,className:a()({["".concat(I,"-").concat(q)]:q,["".concat(I,"-card")]:["card","editable-card"].includes(f),["".concat(I,"-editable-card")]:"editable-card"===f,["".concat(I,"-centered")]:y},null==T?void 0:T.className,p,h,B,F,R),popupClassName:a()(x,B,F,R),style:K,editable:d,moreIcon:P,prefixCls:I,animated:U,indicator:$})))};eU.TabPane=()=>null;var eK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},e$=e=>{var{prefixCls:t,className:n,hoverable:o=!0}=e,i=eK(e,["prefixCls","className","hoverable"]);let{getPrefixCls:s}=r.useContext(l.E_),c=s("card",t),u=a()("".concat(c,"-grid"),n,{["".concat(c,"-grid-hoverable")]:o});return r.createElement("div",Object.assign({},i,{className:u}))};let eV=e=>{let{antCls:t,componentCls:n,headerHeight:r,cardPaddingBase:o,tabsMarginBottom:a}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:r,marginBottom:-1,padding:"0 ".concat((0,u.bf)(o)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")},(0,eM.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},eM.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:a,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},eX=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:o}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,u.bf)(o)," 0 0 0 ").concat(n,",\n 0 ").concat((0,u.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,u.bf)(o)," ").concat((0,u.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,u.bf)(o)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,u.bf)(o)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:r}}},eG=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:r,cardActionsIconSize:o,colorBorderSecondary:a,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),display:"flex",borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},(0,eM.dF)()),{"& > li":{margin:r,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:"color ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:e.colorTextDescription,lineHeight:(0,u.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(n)]:{fontSize:o,lineHeight:(0,u.bf)(e.calc(o).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a)}}})},eY=e=>Object.assign(Object.assign({margin:"".concat((0,u.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,eM.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},eM.vS),"&-description":{color:e.colorTextDescription}}),eQ=e=>{let{componentCls:t,cardPaddingBase:n,colorFillAlter:r}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,u.bf)(n)),background:r,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,u.bf)(e.padding)," ").concat((0,u.bf)(n))}}},eJ=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},e0=e=>{let{antCls:t,componentCls:n,cardShadow:r,cardHeadPadding:o,colorBorderSecondary:a,boxShadowTertiary:i,cardPaddingBase:l,extraColor:s}=e;return{[n]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(n,"-bordered)")]:{boxShadow:i},["".concat(n,"-head")]:eV(e),["".concat(n,"-extra")]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},["".concat(n,"-body")]:Object.assign({padding:l,borderRadius:" 0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},(0,eM.dF)()),["".concat(n,"-grid")]:eX(e),["".concat(n,"-cover")]:{"> *":{display:"block",width:"100%"},["img, img + ".concat(t,"-image-mask")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")}},["".concat(n,"-actions")]:eG(e),["".concat(n,"-meta")]:eY(e)}),["".concat(n,"-bordered")]:{border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(n,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(n,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:r}},["".concat(n,"-contain-grid")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0 "),["".concat(n,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(n,"-loading) ").concat(n,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(n,"-contain-tabs")]:{["> ".concat(n,"-head")]:{minHeight:0,["".concat(n,"-head-title, ").concat(n,"-extra")]:{paddingTop:o}}},["".concat(n,"-type-inner")]:eQ(e),["".concat(n,"-loading")]:eJ(e),["".concat(n,"-rtl")]:{direction:"rtl"}}},e1=e=>{let{componentCls:t,cardPaddingSM:n,headerHeightSM:r,headerFontSizeSM:o}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:r,padding:"0 ".concat((0,u.bf)(n)),fontSize:o,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:n}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var e2=(0,d.I$)("Card",e=>{let t=(0,f.TS)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[e0(t),e1(t)]},e=>({headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText})),e6=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let e4=e=>{let{prefixCls:t,actions:n=[]}=e;return r.createElement("ul",{className:"".concat(t,"-actions")},n.map((e,t)=>r.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(t)},r.createElement("span",null,e))))},e3=r.forwardRef((e,t)=>{let n;let{prefixCls:o,className:c,rootClassName:u,style:d,extra:f,headStyle:p={},bodyStyle:h={},title:m,loading:g,bordered:v=!0,size:y,type:b,cover:x,actions:w,tabList:k,children:S,activeTabKey:E,defaultActiveTabKey:O,tabBarExtraContent:C,hoverable:j,tabProps:_={}}=e,P=e6(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:N,direction:T,card:A}=r.useContext(l.E_),M=r.useMemo(()=>{let e=!1;return r.Children.forEach(S,t=>{t&&t.type&&t.type===e$&&(e=!0)}),e},[S]),I=N("card",o),[D,L,Z]=e2(I),z=r.createElement(R,{loading:!0,active:!0,paragraph:{rows:4},title:!1},S),B=void 0!==E,F=Object.assign(Object.assign({},_),{[B?"activeKey":"defaultActiveKey"]:B?E:O,tabBarExtraContent:C}),H=(0,s.Z)(y),q=H&&"default"!==H?H:"large",W=k?r.createElement(eU,Object.assign({size:q},F,{className:"".concat(I,"-head-tabs"),onChange:t=>{var n;null===(n=e.onTabChange)||void 0===n||n.call(e,t)},items:k.map(e=>{var{tab:t}=e;return Object.assign({label:t},e6(e,["tab"]))})})):null;(m||f||W)&&(n=r.createElement("div",{className:"".concat(I,"-head"),style:p},r.createElement("div",{className:"".concat(I,"-head-wrapper")},m&&r.createElement("div",{className:"".concat(I,"-head-title")},m),f&&r.createElement("div",{className:"".concat(I,"-extra")},f)),W));let U=x?r.createElement("div",{className:"".concat(I,"-cover")},x):null,K=r.createElement("div",{className:"".concat(I,"-body"),style:h},g?z:S),$=w&&w.length?r.createElement(e4,{prefixCls:I,actions:w}):null,V=(0,i.Z)(P,["onTabChange"]),X=a()(I,null==A?void 0:A.className,{["".concat(I,"-loading")]:g,["".concat(I,"-bordered")]:v,["".concat(I,"-hoverable")]:j,["".concat(I,"-contain-grid")]:M,["".concat(I,"-contain-tabs")]:k&&k.length,["".concat(I,"-").concat(H)]:H,["".concat(I,"-type-").concat(b)]:!!b,["".concat(I,"-rtl")]:"rtl"===T},c,u,L,Z),G=Object.assign(Object.assign({},null==A?void 0:A.style),d);return D(r.createElement("div",Object.assign({ref:t},V,{className:X,style:G}),n,U,K,$))});var e5=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};e3.Grid=e$,e3.Meta=e=>{let{prefixCls:t,className:n,avatar:o,title:i,description:s}=e,c=e5(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=r.useContext(l.E_),d=u("card",t),f=a()("".concat(d,"-meta"),n),p=o?r.createElement("div",{className:"".concat(d,"-meta-avatar")},o):null,h=i?r.createElement("div",{className:"".concat(d,"-meta-title")},i):null,m=s?r.createElement("div",{className:"".concat(d,"-meta-description")},s):null,g=h||m?r.createElement("div",{className:"".concat(d,"-meta-detail")},h,m):null;return r.createElement("div",Object.assign({},c,{className:f}),p,g)};var e8=e3},69410:function(e,t,n){"use strict";var r=n(54998);t.Z=r.Z},44851:function(e,t,n){"use strict";n.d(t,{default:function(){return H}});var r=n(2265),o=n(77565),a=n(36760),i=n.n(a),l=n(83145),s=n(26365),c=n(41154),u=n(50506),d=n(32559),f=n(1119),p=n(6989),h=n(45287),m=n(11993),g=n(47970),v=n(95814),y=r.forwardRef(function(e,t){var n,o=e.prefixCls,a=e.forceRender,l=e.className,c=e.style,u=e.children,d=e.isActive,f=e.role,p=r.useState(d||a),h=(0,s.Z)(p,2),g=h[0],v=h[1];return(r.useEffect(function(){(a||d)&&v(!0)},[a,d]),g)?r.createElement("div",{ref:t,className:i()("".concat(o,"-content"),(n={},(0,m.Z)(n,"".concat(o,"-content-active"),d),(0,m.Z)(n,"".concat(o,"-content-inactive"),!d),n),l),style:c,role:f},r.createElement("div",{className:"".concat(o,"-content-box")},u)):null});y.displayName="PanelContent";var b=["showArrow","headerClass","isActive","onItemClick","forceRender","className","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],x=r.forwardRef(function(e,t){var n,o,a=e.showArrow,l=e.headerClass,s=e.isActive,c=e.onItemClick,u=e.forceRender,d=e.className,h=e.prefixCls,x=e.collapsible,w=e.accordion,k=e.panelKey,S=e.extra,E=e.header,O=e.expandIcon,C=e.openMotion,j=e.destroyInactivePanel,_=e.children,P=(0,p.Z)(e,b),N="disabled"===x,T="header"===x,A="icon"===x,M=function(){null==c||c(k)},I="function"==typeof O?O(e):r.createElement("i",{className:"arrow"});I&&(I=r.createElement("div",{className:"".concat(h,"-expand-icon"),onClick:["header","icon"].includes(x)?M:void 0},I));var R=i()((n={},(0,m.Z)(n,"".concat(h,"-item"),!0),(0,m.Z)(n,"".concat(h,"-item-active"),s),(0,m.Z)(n,"".concat(h,"-item-disabled"),N),n),d),D={className:i()(l,(o={},(0,m.Z)(o,"".concat(h,"-header"),!0),(0,m.Z)(o,"".concat(h,"-header-collapsible-only"),T),(0,m.Z)(o,"".concat(h,"-icon-collapsible-only"),A),o)),"aria-expanded":s,"aria-disabled":N,onKeyDown:function(e){("Enter"===e.key||e.keyCode===v.Z.ENTER||e.which===v.Z.ENTER)&&M()}};return T||A||(D.onClick=M,D.role=w?"tab":"button",D.tabIndex=N?-1:0),r.createElement("div",(0,f.Z)({},P,{ref:t,className:R}),r.createElement("div",D,(void 0===a||a)&&I,r.createElement("span",{className:"".concat(h,"-header-text"),onClick:"header"===x?M:void 0},E),null!=S&&"boolean"!=typeof S&&r.createElement("div",{className:"".concat(h,"-extra")},S)),r.createElement(g.ZP,(0,f.Z)({visible:s,leavedClassName:"".concat(h,"-content-hidden")},C,{forceRender:u,removeOnLeave:j}),function(e,t){var n=e.className,o=e.style;return r.createElement(y,{ref:t,prefixCls:h,className:n,style:o,isActive:s,forceRender:u,role:w?"tabpanel":void 0},_)}))}),w=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],k=function(e,t){var n=t.prefixCls,o=t.accordion,a=t.collapsible,i=t.destroyInactivePanel,l=t.onItemClick,s=t.activeKey,c=t.openMotion,u=t.expandIcon;return e.map(function(e,t){var d=e.children,h=e.label,m=e.key,g=e.collapsible,v=e.onItemClick,y=e.destroyInactivePanel,b=(0,p.Z)(e,w),k=String(null!=m?m:t),S=null!=g?g:a,E=!1;return E=o?s[0]===k:s.indexOf(k)>-1,r.createElement(x,(0,f.Z)({},b,{prefixCls:n,key:k,panelKey:k,isActive:E,accordion:o,openMotion:c,expandIcon:u,header:h,collapsible:S,onItemClick:function(e){"disabled"!==S&&(l(e),null==v||v(e))},destroyInactivePanel:null!=y?y:i}),d)})},S=function(e,t,n){if(!e)return null;var o=n.prefixCls,a=n.accordion,i=n.collapsible,l=n.destroyInactivePanel,s=n.onItemClick,c=n.activeKey,u=n.openMotion,d=n.expandIcon,f=e.key||String(t),p=e.props,h=p.header,m=p.headerClass,g=p.destroyInactivePanel,v=p.collapsible,y=p.onItemClick,b=!1;b=a?c[0]===f:c.indexOf(f)>-1;var x=null!=v?v:i,w={key:f,panelKey:f,header:h,headerClass:m,isActive:b,prefixCls:o,destroyInactivePanel:null!=g?g:l,openMotion:u,accordion:a,children:e.props.children,onItemClick:function(e){"disabled"!==x&&(s(e),null==y||y(e))},expandIcon:d,collapsible:x};return"string"==typeof e.type?e:(Object.keys(w).forEach(function(e){void 0===w[e]&&delete w[e]}),r.cloneElement(e,w))};function E(e){var t=e;if(!Array.isArray(t)){var n=(0,c.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var O=Object.assign(r.forwardRef(function(e,t){var n,o=e.prefixCls,a=void 0===o?"rc-collapse":o,c=e.destroyInactivePanel,f=e.style,p=e.accordion,m=e.className,g=e.children,v=e.collapsible,y=e.openMotion,b=e.expandIcon,x=e.activeKey,w=e.defaultActiveKey,O=e.onChange,C=e.items,j=i()(a,m),_=(0,u.Z)([],{value:x,onChange:function(e){return null==O?void 0:O(e)},defaultValue:w,postState:E}),P=(0,s.Z)(_,2),N=P[0],T=P[1];(0,d.ZP)(!g,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var A=(n={prefixCls:a,accordion:p,openMotion:y,expandIcon:b,collapsible:v,destroyInactivePanel:void 0!==c&&c,onItemClick:function(e){return T(function(){return p?N[0]===e?[]:[e]:N.indexOf(e)>-1?N.filter(function(t){return t!==e}):[].concat((0,l.Z)(N),[e])})},activeKey:N},Array.isArray(C)?k(C,n):(0,h.Z)(g).map(function(e,t){return S(e,t,n)}));return r.createElement("div",{ref:t,className:j,style:f,role:p?"tablist":void 0},A)}),{Panel:x});O.Panel;var C=n(18694),j=n(68710),_=n(19722),P=n(71744),N=n(33759);let T=r.forwardRef((e,t)=>{let{getPrefixCls:n}=r.useContext(P.E_),{prefixCls:o,className:a,showArrow:l=!0}=e,s=n("collapse",o),c=i()({["".concat(s,"-no-arrow")]:!l},a);return r.createElement(O.Panel,Object.assign({ref:t},e,{prefixCls:s,className:c}))});var A=n(352),M=n(12918),I=n(63074),R=n(80669),D=n(3104);let L=e=>{let{componentCls:t,contentBg:n,padding:r,headerBg:o,headerPadding:a,collapseHeaderPaddingSM:i,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:s,lineWidth:c,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:h,fontSizeLG:m,lineHeight:g,lineHeightLG:v,marginSM:y,paddingSM:b,paddingLG:x,paddingXS:w,motionDurationSlow:k,fontSizeIcon:S,contentPadding:E,fontHeight:O,fontHeightLG:C}=e,j="".concat((0,A.bf)(c)," ").concat(u," ").concat(d);return{[t]:Object.assign(Object.assign({},(0,M.Wf)(e)),{backgroundColor:o,border:j,borderBottom:0,borderRadius:s,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:j,"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["> ".concat(t,"-header")]:{position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:a,color:p,lineHeight:g,cursor:"pointer",transition:"all ".concat(k,", visibility 0s"),["> ".concat(t,"-header-text")]:{flex:"auto"},"&:focus":{outline:"none"},["".concat(t,"-expand-icon")]:{height:O,display:"flex",alignItems:"center",paddingInlineEnd:y},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,M.Ro)()),{fontSize:S,svg:{transition:"transform ".concat(k)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}},["".concat(t,"-icon-collapsible-only")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:f,backgroundColor:n,borderTop:j,["& > ".concat(t,"-content-box")]:{padding:E},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:i,paddingInlineStart:w,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(b).sub(w).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:b}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:m,lineHeight:v,["> ".concat(t,"-header")]:{padding:l,paddingInlineStart:r,["> ".concat(t,"-expand-icon")]:{height:C,marginInlineStart:e.calc(x).sub(r).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:x}}},["".concat(t,"-item:last-child")]:{["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:h,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:y}}}}})}},Z=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow svg");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},z=e=>{let{componentCls:t,headerBg:n,paddingXXS:r,colorBorder:o}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(o)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:"transparent",borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{paddingTop:r}}}},B=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var F=(0,R.I$)("Collapse",e=>{let t=(0,D.TS)(e,{collapseHeaderPaddingSM:"".concat((0,A.bf)(e.paddingXS)," ").concat((0,A.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,A.bf)(e.padding)," ").concat((0,A.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[L(t),z(t),B(t),Z(t),(0,I.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer})),H=Object.assign(r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a,collapse:l}=r.useContext(P.E_),{prefixCls:s,className:c,rootClassName:u,style:d,bordered:f=!0,ghost:p,size:m,expandIconPosition:g="start",children:v,expandIcon:y}=e,b=(0,N.Z)(e=>{var t;return null!==(t=null!=m?m:e)&&void 0!==t?t:"middle"}),x=n("collapse",s),w=n(),[k,S,E]=F(x),T=r.useMemo(()=>"left"===g?"start":"right"===g?"end":g,[g]),A=i()("".concat(x,"-icon-position-").concat(T),{["".concat(x,"-borderless")]:!f,["".concat(x,"-rtl")]:"rtl"===a,["".concat(x,"-ghost")]:!!p,["".concat(x,"-").concat(b)]:"middle"!==b},null==l?void 0:l.className,c,u,S,E),M=Object.assign(Object.assign({},(0,j.Z)(w)),{motionAppear:!1,leavedClassName:"".concat(x,"-content-hidden")}),I=r.useMemo(()=>v?(0,h.Z)(v).map((e,t)=>{var n,r;if(null===(n=e.props)||void 0===n?void 0:n.disabled){let n=null!==(r=e.key)&&void 0!==r?r:String(t),{disabled:o,collapsible:a}=e.props,i=Object.assign(Object.assign({},(0,C.Z)(e.props,["disabled"])),{key:n,collapsible:null!=a?a:o?"disabled":void 0});return(0,_.Tm)(e,i)}return e}):null,[v]);return k(r.createElement(O,Object.assign({ref:t,openMotion:M},(0,C.Z)(e,["rootClassName"]),{expandIcon:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=y?y(e):r.createElement(o.Z,{rotate:e.isActive?90:void 0});return(0,_.Tm)(t,()=>({className:i()(t.props.className,"".concat(x,"-arrow"))}))},prefixCls:x,className:A,style:Object.assign(Object.assign({},null==l?void 0:l.style),d)}),I))}),{Panel:T})},23496:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),l=n(352),s=n(12918),c=n(80669),u=n(3104);let d=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:o,textPaddingInline:a,orientationMargin:i,verticalMarginInline:c}=e;return{[t]:Object.assign(Object.assign({},(0,s.Wf)(e)),{borderBlockStart:"".concat((0,l.bf)(o)," solid ").concat(r),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:c,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat((0,l.bf)(o)," solid ").concat(r)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat((0,l.bf)(e.dividerHorizontalGutterMargin)," 0")},["&-horizontal".concat(t,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat((0,l.bf)(e.dividerHorizontalWithTextGutterMargin)," 0"),color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(r),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat((0,l.bf)(o)," solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(t,"-with-text-left")]:{"&::before":{width:"calc(".concat(i," * 100%)")},"&::after":{width:"calc(100% - ".concat(i," * 100%)")}},["&-horizontal".concat(t,"-with-text-right")]:{"&::before":{width:"calc(100% - ".concat(i," * 100%)")},"&::after":{width:"calc(".concat(i," * 100%)")}},["".concat(t,"-inner-text")]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:"".concat((0,l.bf)(o)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(t,"-dashed")]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(t,"-with-text")]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},["&-horizontal".concat(t,"-with-text-left").concat(t,"-no-default-orientation-margin-left")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(t,"-inner-text")]:{paddingInlineStart:n}},["&-horizontal".concat(t,"-with-text-right").concat(t,"-no-default-orientation-margin-right")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(t,"-inner-text")]:{paddingInlineEnd:n}}})}};var f=(0,c.I$)("Divider",e=>[d((0,u.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0}))],e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},h=e=>{let{getPrefixCls:t,direction:n,divider:o}=r.useContext(i.E_),{prefixCls:l,type:s="horizontal",orientation:c="center",orientationMargin:u,className:d,rootClassName:h,children:m,dashed:g,plain:v,style:y}=e,b=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),x=t("divider",l),[w,k,S]=f(x),E=c.length>0?"-".concat(c):c,O=!!m,C="left"===c&&null!=u,j="right"===c&&null!=u,_=a()(x,null==o?void 0:o.className,k,S,"".concat(x,"-").concat(s),{["".concat(x,"-with-text")]:O,["".concat(x,"-with-text").concat(E)]:O,["".concat(x,"-dashed")]:!!g,["".concat(x,"-plain")]:!!v,["".concat(x,"-rtl")]:"rtl"===n,["".concat(x,"-no-default-orientation-margin-left")]:C,["".concat(x,"-no-default-orientation-margin-right")]:j},d,h),P=r.useMemo(()=>"number"==typeof u?u:/^\d+$/.test(u)?Number(u):u,[u]),N=Object.assign(Object.assign({},C&&{marginLeft:P}),j&&{marginRight:P});return w(r.createElement("div",Object.assign({className:_,style:Object.assign(Object.assign({},null==o?void 0:o.style),y)},b,{role:"separator"}),m&&"vertical"!==s&&r.createElement("span",{className:"".concat(x,"-inner-text"),style:N},m)))}},20577:function(e,t,n){"use strict";n.d(t,{Z:function(){return em}});var r=n(2265),o=n(70464),a=n(1119),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},l=n(55015),s=r.forwardRef(function(e,t){return r.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:i}))}),c=n(36760),u=n.n(c),d=n(11993),f=n(41154),p=n(26365),h=n(6989),m=n(76405),g=n(25049);function v(){return"function"==typeof BigInt}function y(e){return!e&&0!==e&&!Number.isNaN(e)||!String(e).trim()}function b(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var r=t||"0",o=r.split("."),a=o[0]||"0",i=o[1]||"0";"0"===a&&"0"===i&&(n=!1);var l=n?"-":"";return{negative:n,negativeStr:l,trimStr:r,integerStr:a,decimalStr:i,fullStr:"".concat(l).concat(r)}}function x(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function w(e){var t=String(e);if(x(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&S(t)?t.length-t.indexOf(".")-1:0}function k(e){var t=String(e);if(x(e)){if(e>Number.MAX_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);t=e.toFixed(w(t))}return b(t).fullStr}function S(e){return"number"==typeof e?!Number.isNaN(e):!!e&&(/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e))}var E=function(){function e(t){if((0,m.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"negative",void 0),(0,d.Z)(this,"integer",void 0),(0,d.Z)(this,"decimal",void 0),(0,d.Z)(this,"decimalLen",void 0),(0,d.Z)(this,"empty",void 0),(0,d.Z)(this,"nan",void 0),y(t)){this.empty=!0;return}if(this.origin=String(t),"-"===t||Number.isNaN(t)){this.nan=!0;return}var n=t;if(x(n)&&(n=Number(n)),S(n="string"==typeof n?n:k(n))){var r=b(n);this.negative=r.negative;var o=r.trimStr.split(".");this.integer=BigInt(o[0]);var a=o[1]||"0";this.decimal=BigInt(a),this.decimalLen=a.length}else this.nan=!0}return(0,g.Z)(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(e){return BigInt("".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(e,"0")))}},{key:"negate",value:function(){var t=new e(this.toString());return t.negative=!t.negative,t}},{key:"cal",value:function(t,n,r){var o=Math.max(this.getDecimalStr().length,t.getDecimalStr().length),a=n(this.alignDecimal(o),t.alignDecimal(o)).toString(),i=r(o),l=b(a),s=l.negativeStr,c=l.trimStr,u="".concat(s).concat(c.padStart(i+1,"0"));return new e("".concat(u.slice(0,-i),".").concat(u.slice(-i)))}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=new e(t);return n.isInvalidate()?this:this.cal(n,function(e,t){return e+t},function(e){return e})}},{key:"multi",value:function(t){var n=new e(t);return this.isInvalidate()||n.isInvalidate()?new e(NaN):this.cal(n,function(e,t){return e*t},function(e){return 2*e})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toString()===(null==e?void 0:e.toString())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":b("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}(),O=function(){function e(t){if((0,m.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"number",void 0),(0,d.Z)(this,"empty",void 0),y(t)){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return(0,g.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(w(this.number),w(n));return new e(r.toFixed(o))}},{key:"multi",value:function(t){var n=Number(t);if(this.isInvalidate()||Number.isNaN(n))return new e(NaN);var r=this.number*n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(w(this.number),w(n));return new e(r.toFixed(o))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toNumber()===(null==e?void 0:e.toNumber())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":k(this.number):this.origin}}]),e}();function C(e){return v()?new E(e):new O(e)}function j(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var o=b(e),a=o.negativeStr,i=o.integerStr,l=o.decimalStr,s="".concat(t).concat(l),c="".concat(a).concat(i);if(n>=0){var u=Number(l[n]);return u>=5&&!r?j(C(e).add("".concat(a,"0.").concat("0".repeat(n)).concat(10-u)).toString(),t,n,r):0===n?c:"".concat(c).concat(t).concat(l.padEnd(n,"0").slice(0,n))}return".0"===s?c:"".concat(c).concat(s)}var _=n(2027),P=n(27380),N=n(28791),T=n(32559),A=n(79267),M=function(){var e=(0,r.useState)(!1),t=(0,p.Z)(e,2),n=t[0],o=t[1];return(0,P.Z)(function(){o((0,A.Z)())},[]),n},I=n(53346);function R(e){var t=e.prefixCls,n=e.upNode,o=e.downNode,i=e.upDisabled,l=e.downDisabled,s=e.onStep,c=r.useRef(),f=r.useRef([]),p=r.useRef();p.current=s;var h=function(){clearTimeout(c.current)},m=function(e,t){e.preventDefault(),h(),p.current(t),c.current=setTimeout(function e(){p.current(t),c.current=setTimeout(e,200)},600)};if(r.useEffect(function(){return function(){h(),f.current.forEach(function(e){return I.Z.cancel(e)})}},[]),M())return null;var g="".concat(t,"-handler"),v=u()(g,"".concat(g,"-up"),(0,d.Z)({},"".concat(g,"-up-disabled"),i)),y=u()(g,"".concat(g,"-down"),(0,d.Z)({},"".concat(g,"-down-disabled"),l)),b=function(){return f.current.push((0,I.Z)(h))},x={unselectable:"on",role:"button",onMouseUp:b,onMouseLeave:b};return r.createElement("div",{className:"".concat(g,"-wrap")},r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){m(e,!0)},"aria-label":"Increase Value","aria-disabled":i,className:v}),n||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){m(e,!1)},"aria-label":"Decrease Value","aria-disabled":l,className:y}),o||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function D(e){var t="number"==typeof e?k(e):b(e).fullStr;return t.includes(".")?b(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var L=n(55041),Z=function(){var e=(0,r.useRef)(0),t=function(){I.Z.cancel(e.current)};return(0,r.useEffect)(function(){return t},[]),function(n){t(),e.current=(0,I.Z)(function(){n()})}},z=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","wheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur"],B=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],F=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},H=function(e){var t=C(e);return t.isInvalidate()?null:t},q=r.forwardRef(function(e,t){var n,o,i,l=e.prefixCls,s=void 0===l?"rc-input-number":l,c=e.className,m=e.style,g=e.min,v=e.max,y=e.step,b=void 0===y?1:y,x=e.defaultValue,E=e.value,O=e.disabled,_=e.readOnly,A=e.upHandler,M=e.downHandler,I=e.keyboard,L=e.wheel,B=e.controls,q=(e.classNames,e.stringMode),W=e.parser,U=e.formatter,K=e.precision,$=e.decimalSeparator,V=e.onChange,X=e.onInput,G=e.onPressEnter,Y=e.onStep,Q=e.changeOnBlur,J=void 0===Q||Q,ee=(0,h.Z)(e,z),et="".concat(s,"-input"),en=r.useRef(null),er=r.useState(!1),eo=(0,p.Z)(er,2),ea=eo[0],ei=eo[1],el=r.useRef(!1),es=r.useRef(!1),ec=r.useRef(!1),eu=r.useState(function(){return C(null!=E?E:x)}),ed=(0,p.Z)(eu,2),ef=ed[0],ep=ed[1],eh=r.useCallback(function(e,t){return t?void 0:K>=0?K:Math.max(w(e),w(b))},[K,b]),em=r.useCallback(function(e){var t=String(e);if(W)return W(t);var n=t;return $&&(n=n.replace($,".")),n.replace(/[^\w.-]+/g,"")},[W,$]),eg=r.useRef(""),ev=r.useCallback(function(e,t){if(U)return U(e,{userTyping:t,input:String(eg.current)});var n="number"==typeof e?k(e):e;if(!t){var r=eh(n,t);S(n)&&($||r>=0)&&(n=j(n,$||".",r))}return n},[U,eh,$]),ey=r.useState(function(){var e=null!=x?x:E;return ef.isInvalidate()&&["string","number"].includes((0,f.Z)(e))?Number.isNaN(e)?"":e:ev(ef.toString(),!1)}),eb=(0,p.Z)(ey,2),ex=eb[0],ew=eb[1];function ek(e,t){ew(ev(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}eg.current=ex;var eS=r.useMemo(function(){return H(v)},[v,K]),eE=r.useMemo(function(){return H(g)},[g,K]),eO=r.useMemo(function(){return!(!eS||!ef||ef.isInvalidate())&&eS.lessEquals(ef)},[eS,ef]),eC=r.useMemo(function(){return!(!eE||!ef||ef.isInvalidate())&&ef.lessEquals(eE)},[eE,ef]),ej=(n=en.current,o=(0,r.useRef)(null),[function(){try{var e=n.selectionStart,t=n.selectionEnd,r=n.value,a=r.substring(0,e),i=r.substring(t);o.current={start:e,end:t,value:r,beforeTxt:a,afterTxt:i}}catch(e){}},function(){if(n&&o.current&&ea)try{var e=n.value,t=o.current,r=t.beforeTxt,a=t.afterTxt,i=t.start,l=e.length;if(e.endsWith(a))l=e.length-o.current.afterTxt.length;else if(e.startsWith(r))l=r.length;else{var s=r[i-1],c=e.indexOf(s,i-1);-1!==c&&(l=c+1)}n.setSelectionRange(l,l)}catch(e){(0,T.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),e_=(0,p.Z)(ej,2),eP=e_[0],eN=e_[1],eT=function(e){return eS&&!e.lessEquals(eS)?eS:eE&&!eE.lessEquals(e)?eE:null},eA=function(e){return!eT(e)},eM=function(e,t){var n=e,r=eA(n)||n.isEmpty();if(n.isEmpty()||t||(n=eT(n)||n,r=!0),!_&&!O&&r){var o,a=n.toString(),i=eh(a,t);return i>=0&&!eA(n=C(j(a,".",i)))&&(n=C(j(a,".",i,!0))),n.equals(ef)||(o=n,void 0===E&&ep(o),null==V||V(n.isEmpty()?null:F(q,n)),void 0===E&&ek(n,t)),n}return ef},eI=Z(),eR=function e(t){if(eP(),eg.current=t,ew(t),!es.current){var n=C(em(t));n.isNaN()||eM(n,!0)}null==X||X(t),eI(function(){var n=t;W||(n=t.replace(/。/g,".")),n!==t&&e(n)})},eD=function(e){if((!e||!eO)&&(e||!eC)){el.current=!1;var t,n=C(ec.current?D(b):b);e||(n=n.negate());var r=eM((ef||C(0)).add(n.toString()),!1);null==Y||Y(F(q,r),{offset:ec.current?D(b):b,type:e?"up":"down"}),null===(t=en.current)||void 0===t||t.focus()}},eL=function(e){var t=C(em(ex)),n=t;n=t.isNaN()?eM(ef,e):eM(t,e),void 0!==E?ek(ef,!1):n.isNaN()||ek(n,!1)};return r.useEffect(function(){var e=function(e){!1!==L&&(eD(e.deltaY<0),e.preventDefault())},t=en.current;if(t)return t.addEventListener("wheel",e),function(){return t.removeEventListener("wheel",e)}},[eD]),(0,P.o)(function(){ef.isInvalidate()||ek(ef,!1)},[K,U]),(0,P.o)(function(){var e=C(E);ep(e);var t=C(em(ex));e.equals(t)&&el.current&&!U||ek(e,el.current)},[E]),(0,P.o)(function(){U&&eN()},[ex]),r.createElement("div",{className:u()(s,c,(i={},(0,d.Z)(i,"".concat(s,"-focused"),ea),(0,d.Z)(i,"".concat(s,"-disabled"),O),(0,d.Z)(i,"".concat(s,"-readonly"),_),(0,d.Z)(i,"".concat(s,"-not-a-number"),ef.isNaN()),(0,d.Z)(i,"".concat(s,"-out-of-range"),!ef.isInvalidate()&&!eA(ef)),i)),style:m,onFocus:function(){ei(!0)},onBlur:function(){J&&eL(!1),ei(!1),el.current=!1},onKeyDown:function(e){var t=e.key,n=e.shiftKey;el.current=!0,ec.current=n,"Enter"===t&&(es.current||(el.current=!1),eL(!1),null==G||G(e)),!1!==I&&!es.current&&["Up","ArrowUp","Down","ArrowDown"].includes(t)&&(eD("Up"===t||"ArrowUp"===t),e.preventDefault())},onKeyUp:function(){el.current=!1,ec.current=!1},onCompositionStart:function(){es.current=!0},onCompositionEnd:function(){es.current=!1,eR(en.current.value)},onBeforeInput:function(){el.current=!0}},(void 0===B||B)&&r.createElement(R,{prefixCls:s,upNode:A,downNode:M,upDisabled:eO,downDisabled:eC,onStep:eD}),r.createElement("div",{className:"".concat(et,"-wrap")},r.createElement("input",(0,a.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":g,"aria-valuemax":v,"aria-valuenow":ef.isInvalidate()?null:ef.toString(),step:b},ee,{ref:(0,N.sQ)(en,t),className:et,value:ex,onChange:function(e){eR(e.target.value)},disabled:O,readOnly:_}))))}),W=r.forwardRef(function(e,t){var n=e.disabled,o=e.style,i=e.prefixCls,l=e.value,s=e.prefix,c=e.suffix,u=e.addonBefore,d=e.addonAfter,f=e.className,p=e.classNames,m=(0,h.Z)(e,B),g=r.useRef(null);return r.createElement(_.Q,{className:f,triggerFocus:function(e){g.current&&(0,L.nH)(g.current,e)},prefixCls:i,value:l,disabled:n,style:o,prefix:s,suffix:c,addonAfter:d,addonBefore:u,classNames:p,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}},r.createElement(q,(0,a.Z)({prefixCls:i,disabled:n,ref:(0,N.sQ)(g,t),className:null==p?void 0:p.input},m)))});W.displayName="InputNumber";var U=n(12757),K=n(71744),$=n(13959),V=n(86586),X=n(64024),G=n(33759),Y=n(39109),Q=n(56250),J=n(65658),ee=n(352),et=n(31282),en=n(37433),er=n(65265),eo=n(12918),ea=n(17691),ei=n(80669),el=n(3104),es=n(36360);let ec=(e,t)=>{let{componentCls:n,borderRadiusSM:r,borderRadiusLG:o}=e,a="lg"===t?o:r;return{["&-".concat(t)]:{["".concat(n,"-handler-wrap")]:{borderStartEndRadius:a,borderEndEndRadius:a},["".concat(n,"-handler-up")]:{borderStartEndRadius:a},["".concat(n,"-handler-down")]:{borderEndEndRadius:a}}}},eu=e=>{let{componentCls:t,lineWidth:n,lineType:r,borderRadius:o,fontSizeLG:a,controlHeightLG:i,controlHeightSM:l,colorError:s,paddingInlineSM:c,paddingBlockSM:u,paddingBlockLG:d,paddingInlineLG:f,colorTextDescription:p,motionDurationMid:h,handleHoverColor:m,paddingInline:g,paddingBlock:v,handleBg:y,handleActiveBg:b,colorTextDisabled:x,borderRadiusSM:w,borderRadiusLG:k,controlWidth:S,handleOpacity:E,handleBorderColor:O,filledHandleBg:C,lineHeightLG:j,calc:_}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.ik)(e)),{display:"inline-block",width:S,margin:0,padding:0,borderRadius:o}),(0,er.qG)(e,{["".concat(t,"-handler-wrap")]:{background:y,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O)}}})),(0,er.H8)(e,{["".concat(t,"-handler-wrap")]:{background:C,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O)}},"&:focus-within":{["".concat(t,"-handler-wrap")]:{background:y}}})),(0,er.Mu)(e)),{"&-rtl":{direction:"rtl",["".concat(t,"-input")]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:a,lineHeight:j,borderRadius:k,["input".concat(t,"-input")]:{height:_(i).sub(_(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(d)," ").concat((0,ee.bf)(f))}},"&-sm":{padding:0,borderRadius:w,["input".concat(t,"-input")]:{height:_(l).sub(_(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(u)," ").concat((0,ee.bf)(c))}},"&-out-of-range":{["".concat(t,"-input-wrap")]:{input:{color:s}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.s7)(e)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",["".concat(t,"-affix-wrapper")]:{width:"100%"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:k,fontSize:e.fontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:w}}},(0,er.ir)(e)),(0,er.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),["&-disabled ".concat(t,"-input")]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),{width:"100%",padding:"".concat((0,ee.bf)(v)," ").concat((0,ee.bf)(g)),textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:"all ".concat(h," linear"),appearance:"textfield",fontSize:"inherit"}),(0,et.nz)(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[t]:Object.assign(Object.assign(Object.assign({["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{opacity:1},["".concat(t,"-handler-wrap")]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:"100%",borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:E,display:"flex",flexDirection:"column",alignItems:"stretch",transition:"opacity ".concat(h," linear ").concat(h),["".concat(t,"-handler")]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},["".concat(t,"-handler")]:{height:"50%",overflow:"hidden",color:p,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O),transition:"all ".concat(h," linear"),"&:active":{background:b},"&:hover":{height:"60%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{color:m}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,eo.Ro)()),{color:p,transition:"all ".concat(h," linear"),userSelect:"none"})},["".concat(t,"-handler-up")]:{borderStartEndRadius:o},["".concat(t,"-handler-down")]:{borderEndEndRadius:o}},ec(e,"lg")),ec(e,"sm")),{"&-disabled, &-readonly":{["".concat(t,"-handler-wrap")]:{display:"none"},["".concat(t,"-input")]:{color:"inherit"}},["\n ".concat(t,"-handler-up-disabled,\n ").concat(t,"-handler-down-disabled\n ")]:{cursor:"not-allowed"},["\n ".concat(t,"-handler-up-disabled:hover &-handler-up-inner,\n ").concat(t,"-handler-down-disabled:hover &-handler-down-inner\n ")]:{color:x}})}]},ed=e=>{let{componentCls:t,paddingBlock:n,paddingInline:r,inputAffixPadding:o,controlWidth:a,borderRadiusLG:i,borderRadiusSM:l,paddingInlineLG:s,paddingInlineSM:c,paddingBlockLG:u,paddingBlockSM:d}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign({["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(n)," 0")}},(0,et.ik)(e)),{position:"relative",display:"inline-flex",width:a,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:i,paddingInlineStart:s,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(u)," 0")}},"&-sm":{borderRadius:l,paddingInlineStart:c,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(d)," 0")}},["&:not(".concat(t,"-disabled):hover")]:{zIndex:1},"&-focused, &:focus":{zIndex:1},["&-disabled > ".concat(t,"-disabled")]:{background:"transparent"},["> div".concat(t)]:{width:"100%",border:"none",outline:"none",["&".concat(t,"-focused")]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t,"-handler-wrap")]:{zIndex:2},[t]:{color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:r,marginInlineStart:o}}})}};var ef=(0,ei.I$)("InputNumber",e=>{let t=(0,el.TS)(e,(0,en.e)(e));return[eu(t),ed(t),(0,ea.c)(t)]},e=>{var t;let n=null!==(t=e.handleVisible)&&void 0!==t?t:"auto";return Object.assign(Object.assign({},(0,en.T)(e)),{controlWidth:90,handleWidth:e.controlHeightSM-2*e.lineWidth,handleFontSize:e.fontSize/2,handleVisible:n,handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,filledHandleBg:new es.C(e.colorFillSecondary).onBackground(e.colorBgContainer).toHexString(),handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder,handleOpacity:!0===n?1:0})},{unitless:{handleOpacity:!0}}),ep=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eh=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a}=r.useContext(K.E_),i=r.useRef(null);r.useImperativeHandle(t,()=>i.current);let{className:l,rootClassName:c,size:d,disabled:f,prefixCls:p,addonBefore:h,addonAfter:m,prefix:g,bordered:v,readOnly:y,status:b,controls:x,variant:w}=e,k=ep(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls","variant"]),S=n("input-number",p),E=(0,X.Z)(S),[O,C,j]=ef(S,E),{compactSize:_,compactItemClassnames:P}=(0,J.ri)(S,a),N=r.createElement(s,{className:"".concat(S,"-handler-up-inner")}),T=r.createElement(o.Z,{className:"".concat(S,"-handler-down-inner")});"object"==typeof x&&(N=void 0===x.upIcon?N:r.createElement("span",{className:"".concat(S,"-handler-up-inner")},x.upIcon),T=void 0===x.downIcon?T:r.createElement("span",{className:"".concat(S,"-handler-down-inner")},x.downIcon));let{hasFeedback:A,status:M,isFormItemInput:I,feedbackIcon:R}=r.useContext(Y.aM),D=(0,U.F)(M,b),L=(0,G.Z)(e=>{var t;return null!==(t=null!=d?d:_)&&void 0!==t?t:e}),Z=r.useContext(V.Z),[z,B]=(0,Q.Z)(w,v),F=A&&r.createElement(r.Fragment,null,R),H=u()({["".concat(S,"-lg")]:"large"===L,["".concat(S,"-sm")]:"small"===L,["".concat(S,"-rtl")]:"rtl"===a,["".concat(S,"-in-form-item")]:I},C),q="".concat(S,"-group");return O(r.createElement(W,Object.assign({ref:i,disabled:null!=f?f:Z,className:u()(j,E,l,c,P),upHandler:N,downHandler:T,prefixCls:S,readOnly:y,controls:"boolean"==typeof x?x:void 0,prefix:g,suffix:F,addonAfter:m&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},m)),addonBefore:h&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},h)),classNames:{input:H,variant:u()({["".concat(S,"-").concat(z)]:B},(0,U.Z)(S,D,A)),affixWrapper:u()({["".concat(S,"-affix-wrapper-sm")]:"small"===L,["".concat(S,"-affix-wrapper-lg")]:"large"===L,["".concat(S,"-affix-wrapper-rtl")]:"rtl"===a},C),wrapper:u()({["".concat(q,"-rtl")]:"rtl"===a},C),groupWrapper:u()({["".concat(S,"-group-wrapper-sm")]:"small"===L,["".concat(S,"-group-wrapper-lg")]:"large"===L,["".concat(S,"-group-wrapper-rtl")]:"rtl"===a,["".concat(S,"-group-wrapper-").concat(z)]:B},(0,U.Z)("".concat(S,"-group-wrapper"),D,A),C)}},k)))});eh._InternalPanelDoNotUseOrYouWillBeFired=e=>r.createElement($.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},r.createElement(eh,Object.assign({},e)));var em=eh},65863:function(e,t,n){"use strict";n.d(t,{Z:function(){return k},n:function(){return w}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2027),l=n(28791),s=n(12757),c=n(71744),u=n(86586),d=n(33759),f=n(39109),p=n(65658),h=n(39164),m=n(31282),g=n(64024),v=n(56250),y=n(39725),b=e=>{let t;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?t=e:e&&(t={clearIcon:r.createElement(y.Z,null)}),t},x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function w(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n){let t=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var k=(0,r.forwardRef)((e,t)=>{var n;let{prefixCls:o,bordered:y=!0,status:w,size:k,disabled:S,onBlur:E,onFocus:O,suffix:C,allowClear:j,addonAfter:_,addonBefore:P,className:N,style:T,styles:A,rootClassName:M,onChange:I,classNames:R,variant:D}=e,L=x(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:Z,direction:z,input:B}=r.useContext(c.E_),F=Z("input",o),H=(0,r.useRef)(null),q=(0,g.Z)(F),[W,U,K]=(0,m.ZP)(F,q),{compactSize:$,compactItemClassnames:V}=(0,p.ri)(F,z),X=(0,d.Z)(e=>{var t;return null!==(t=null!=k?k:$)&&void 0!==t?t:e}),G=r.useContext(u.Z),{status:Y,hasFeedback:Q,feedbackIcon:J}=(0,r.useContext)(f.aM),ee=(0,s.F)(Y,w),et=!!(e.prefix||e.suffix||e.allowClear||e.showCount)||!!Q;(0,r.useRef)(et);let en=(0,h.Z)(H,!0),er=(Q||C)&&r.createElement(r.Fragment,null,C,Q&&J),eo=b(j),[ea,ei]=(0,v.Z)(D,y);return W(r.createElement(i.Z,Object.assign({ref:(0,l.sQ)(t,H),prefixCls:F,autoComplete:null==B?void 0:B.autoComplete},L,{disabled:null!=S?S:G,onBlur:e=>{en(),null==E||E(e)},onFocus:e=>{en(),null==O||O(e)},style:Object.assign(Object.assign({},null==B?void 0:B.style),T),styles:Object.assign(Object.assign({},null==B?void 0:B.styles),A),suffix:er,allowClear:eo,className:a()(N,M,K,q,V,null==B?void 0:B.className),onChange:e=>{en(),null==I||I(e)},addonAfter:_&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},_)),addonBefore:P&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},P)),classNames:Object.assign(Object.assign(Object.assign({},R),null==B?void 0:B.classNames),{input:a()({["".concat(F,"-sm")]:"small"===X,["".concat(F,"-lg")]:"large"===X,["".concat(F,"-rtl")]:"rtl"===z},null==R?void 0:R.input,null===(n=null==B?void 0:B.classNames)||void 0===n?void 0:n.input,U),variant:a()({["".concat(F,"-").concat(ea)]:ei},(0,s.Z)(F,ee)),affixWrapper:a()({["".concat(F,"-affix-wrapper-sm")]:"small"===X,["".concat(F,"-affix-wrapper-lg")]:"large"===X,["".concat(F,"-affix-wrapper-rtl")]:"rtl"===z},U),wrapper:a()({["".concat(F,"-group-rtl")]:"rtl"===z},U),groupWrapper:a()({["".concat(F,"-group-wrapper-sm")]:"small"===X,["".concat(F,"-group-wrapper-lg")]:"large"===X,["".concat(F,"-group-wrapper-rtl")]:"rtl"===z,["".concat(F,"-group-wrapper-").concat(ea)]:ei},(0,s.Z)("".concat(F,"-group-wrapper"),ee,Q),U)})})))})},90464:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r,o=n(2265),a=n(39725),i=n(36760),l=n.n(i),s=n(1119),c=n(11993),u=n(31686),d=n(83145),f=n(26365),p=n(6989),h=n(2027),m=n(96032),g=n(55041),v=n(50506),y=n(41154),b=n(31474),x=n(27380),w=n(53346),k=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],S={},E=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],O=o.forwardRef(function(e,t){var n=e.prefixCls,a=(e.onPressEnter,e.defaultValue),i=e.value,d=e.autoSize,h=e.onResize,m=e.className,g=e.style,O=e.disabled,C=e.onChange,j=(e.onInternalAutoSize,(0,p.Z)(e,E)),_=(0,v.Z)(a,{value:i,postState:function(e){return null!=e?e:""}}),P=(0,f.Z)(_,2),N=P[0],T=P[1],A=o.useRef();o.useImperativeHandle(t,function(){return{textArea:A.current}});var M=o.useMemo(function(){return d&&"object"===(0,y.Z)(d)?[d.minRows,d.maxRows]:[]},[d]),I=(0,f.Z)(M,2),R=I[0],D=I[1],L=!!d,Z=function(){try{if(document.activeElement===A.current){var e=A.current,t=e.selectionStart,n=e.selectionEnd,r=e.scrollTop;A.current.setSelectionRange(t,n),A.current.scrollTop=r}}catch(e){}},z=o.useState(2),B=(0,f.Z)(z,2),F=B[0],H=B[1],q=o.useState(),W=(0,f.Z)(q,2),U=W[0],K=W[1],$=function(){H(0)};(0,x.Z)(function(){L&&$()},[i,R,D,L]),(0,x.Z)(function(){if(0===F)H(1);else if(1===F){var e=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&S[n])return S[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),i=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l={sizingStyle:k.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),paddingSize:a,borderSize:i,boxSizing:o};return t&&n&&(S[n]=l),l}(e,n),l=i.paddingSize,s=i.borderSize,c=i.boxSizing,u=i.sizingStyle;r.setAttribute("style","".concat(u,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=e.value||e.placeholder||"";var d=void 0,f=void 0,p=r.scrollHeight;if("border-box"===c?p+=s:"content-box"===c&&(p-=l),null!==o||null!==a){r.value=" ";var h=r.scrollHeight-l;null!==o&&(d=h*o,"border-box"===c&&(d=d+l+s),p=Math.max(d,p)),null!==a&&(f=h*a,"border-box"===c&&(f=f+l+s),t=p>f?"":"hidden",p=Math.min(f,p))}var m={height:p,overflowY:t,resize:"none"};return d&&(m.minHeight=d),f&&(m.maxHeight=f),m}(A.current,!1,R,D);H(2),K(e)}else Z()},[F]);var V=o.useRef(),X=function(){w.Z.cancel(V.current)};o.useEffect(function(){return X},[]);var G=(0,u.Z)((0,u.Z)({},g),L?U:null);return(0===F||1===F)&&(G.overflowY="hidden",G.overflowX="hidden"),o.createElement(b.Z,{onResize:function(e){2===F&&(null==h||h(e),d&&(X(),V.current=(0,w.Z)(function(){$()})))},disabled:!(d||h)},o.createElement("textarea",(0,s.Z)({},j,{ref:A,style:G,className:l()(n,m,(0,c.Z)({},"".concat(n,"-disabled"),O)),disabled:O,value:N,onChange:function(e){T(e.target.value),null==C||C(e)}})))}),C=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],j=o.forwardRef(function(e,t){var n,r,a,i=e.defaultValue,y=e.value,b=e.onFocus,x=e.onBlur,w=e.onChange,k=e.allowClear,S=e.maxLength,E=e.onCompositionStart,j=e.onCompositionEnd,_=e.suffix,P=e.prefixCls,N=void 0===P?"rc-textarea":P,T=e.showCount,A=e.count,M=e.className,I=e.style,R=e.disabled,D=e.hidden,L=e.classNames,Z=e.styles,z=e.onResize,B=(0,p.Z)(e,C),F=(0,v.Z)(i,{value:y,defaultValue:i}),H=(0,f.Z)(F,2),q=H[0],W=H[1],U=null==q?"":String(q),K=o.useState(!1),$=(0,f.Z)(K,2),V=$[0],X=$[1],G=o.useRef(!1),Y=o.useState(null),Q=(0,f.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,o.useRef)(null),en=function(){var e;return null===(e=et.current)||void 0===e?void 0:e.textArea},er=function(){en().focus()};(0,o.useImperativeHandle)(t,function(){return{resizableTextArea:et.current,focus:er,blur:function(){en().blur()}}}),(0,o.useEffect)(function(){X(function(e){return!R&&e})},[R]);var eo=o.useState(null),ea=(0,f.Z)(eo,2),ei=ea[0],el=ea[1];o.useEffect(function(){if(ei){var e;(e=en()).setSelectionRange.apply(e,(0,d.Z)(ei))}},[ei]);var es=(0,m.Z)(A,T),ec=null!==(n=es.max)&&void 0!==n?n:S,eu=Number(ec)>0,ed=es.strategy(U),ef=!!ec&&ed>ec,ep=function(e,t){var n=t;!G.current&&es.exceedFormatter&&es.max&&es.strategy(t)>es.max&&(n=es.exceedFormatter(t,{max:es.max}),t!==n&&el([en().selectionStart||0,en().selectionEnd||0])),W(n),(0,g.rJ)(e.currentTarget,e,w,n)},eh=_;es.show&&(a=es.showFormatter?es.showFormatter({value:U,count:ed,maxLength:ec}):"".concat(ed).concat(eu?" / ".concat(ec):""),eh=o.createElement(o.Fragment,null,eh,o.createElement("span",{className:l()("".concat(N,"-data-count"),null==L?void 0:L.count),style:null==Z?void 0:Z.count},a)));var em=!B.autoSize&&!T&&!k;return o.createElement(h.Q,{value:U,allowClear:k,handleReset:function(e){W(""),er(),(0,g.rJ)(en(),e,w)},suffix:eh,prefixCls:N,classNames:(0,u.Z)((0,u.Z)({},L),{},{affixWrapper:l()(null==L?void 0:L.affixWrapper,(r={},(0,c.Z)(r,"".concat(N,"-show-count"),T),(0,c.Z)(r,"".concat(N,"-textarea-allow-clear"),k),r))}),disabled:R,focused:V,className:l()(M,ef&&"".concat(N,"-out-of-range")),style:(0,u.Z)((0,u.Z)({},I),J&&!em?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof a?a:void 0}},hidden:D},o.createElement(O,(0,s.Z)({},B,{maxLength:S,onKeyDown:function(e){var t=B.onPressEnter,n=B.onKeyDown;"Enter"===e.key&&t&&t(e),null==n||n(e)},onChange:function(e){ep(e,e.target.value)},onFocus:function(e){X(!0),null==b||b(e)},onBlur:function(e){X(!1),null==x||x(e)},onCompositionStart:function(e){G.current=!0,null==E||E(e)},onCompositionEnd:function(e){G.current=!1,ep(e,e.currentTarget.value),null==j||j(e)},className:l()(null==L?void 0:L.textarea),style:(0,u.Z)((0,u.Z)({},null==Z?void 0:Z.textarea),{},{resize:null==I?void 0:I.resize}),disabled:R,prefixCls:N,onResize:function(e){var t;null==z||z(e),null!==(t=en())&&void 0!==t&&t.style.height&&ee(!0)},ref:et})))}),_=n(12757),P=n(71744),N=n(86586),T=n(33759),A=n(39109),M=n(65863),I=n(31282),R=n(64024),D=n(56250),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Z=(0,o.forwardRef)((e,t)=>{var n;let r;let{prefixCls:i,bordered:s=!0,size:c,disabled:u,status:d,allowClear:f,classNames:p,rootClassName:h,className:m,variant:g}=e,v=L(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:y,direction:b}=o.useContext(P.E_),x=(0,T.Z)(c),w=o.useContext(N.Z),{status:k,hasFeedback:S,feedbackIcon:E}=o.useContext(A.aM),O=(0,_.F)(k,d),C=o.useRef(null);o.useImperativeHandle(t,()=>{var e;return{resizableTextArea:null===(e=C.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;(0,M.n)(null===(n=null===(t=C.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.blur()}}});let Z=y("input",i);"object"==typeof f&&(null==f?void 0:f.clearIcon)?r=f:f&&(r={clearIcon:o.createElement(a.Z,null)});let z=(0,R.Z)(Z),[B,F,H]=(0,I.ZP)(Z,z),[q,W]=(0,D.Z)(g,s);return B(o.createElement(j,Object.assign({},v,{disabled:null!=u?u:w,allowClear:r,className:l()(H,z,m,h),classNames:Object.assign(Object.assign({},p),{textarea:l()({["".concat(Z,"-sm")]:"small"===x,["".concat(Z,"-lg")]:"large"===x},F,null==p?void 0:p.textarea),variant:l()({["".concat(Z,"-").concat(q)]:W},(0,_.Z)(Z,O)),affixWrapper:l()("".concat(Z,"-textarea-affix-wrapper"),{["".concat(Z,"-affix-wrapper-rtl")]:"rtl"===b,["".concat(Z,"-affix-wrapper-sm")]:"small"===x,["".concat(Z,"-affix-wrapper-lg")]:"large"===x,["".concat(Z,"-textarea-show-count")]:e.showCount||(null===(n=e.count)||void 0===n?void 0:n.show)},F)}),prefixCls:Z,suffix:S&&o.createElement("span",{className:"".concat(Z,"-textarea-suffix")},E),ref:C})))})},39164:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e,t){let n=(0,r.useRef)([]),o=()=>{n.current.push(setTimeout(()=>{var t,n,r,o;(null===(t=e.current)||void 0===t?void 0:t.input)&&(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))==="password"&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(o=e.current)||void 0===o||o.input.removeAttribute("value"))}))};return(0,r.useEffect)(()=>(t&&o(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),o}},64482:function(e,t,n){"use strict";n.d(t,{default:function(){return _}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),l=n(39109),s=n(31282),c=n(65863),u=n(97416),d=n(6520),f=n(18694),p=n(28791),h=n(39164),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let g=e=>e?r.createElement(d.Z,null):r.createElement(u.Z,null),v={click:"onClick",hover:"onMouseOver"},y=r.forwardRef((e,t)=>{let{visibilityToggle:n=!0}=e,o="object"==typeof n&&void 0!==n.visible,[l,s]=(0,r.useState)(()=>!!o&&n.visible),u=(0,r.useRef)(null);r.useEffect(()=>{o&&s(n.visible)},[o,n]);let d=(0,h.Z)(u),y=()=>{let{disabled:t}=e;t||(l&&d(),s(e=>{var t;let r=!e;return"object"==typeof n&&(null===(t=n.onVisibleChange)||void 0===t||t.call(n,r)),r}))},{className:b,prefixCls:x,inputPrefixCls:w,size:k}=e,S=m(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:E}=r.useContext(i.E_),O=E("input",w),C=E("input-password",x),j=n&&(t=>{let{action:n="click",iconRender:o=g}=e,a=v[n]||"",i=o(l);return r.cloneElement(r.isValidElement(i)?i:r.createElement("span",null,i),{[a]:y,className:"".concat(t,"-icon"),key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}})})(C),_=a()(C,b,{["".concat(C,"-").concat(k)]:!!k}),P=Object.assign(Object.assign({},(0,f.Z)(S,["suffix","iconRender","visibilityToggle"])),{type:l?"text":"password",className:_,prefixCls:O,suffix:j});return k&&(P.size=k),r.createElement(c.Z,Object.assign({ref:(0,p.sQ)(t,u)},P))});var b=n(29436),x=n(19722),w=n(73002),k=n(33759),S=n(65658),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O=r.forwardRef((e,t)=>{let n;let{prefixCls:o,inputPrefixCls:l,className:s,size:u,suffix:d,enterButton:f=!1,addonAfter:h,loading:m,disabled:g,onSearch:v,onChange:y,onCompositionStart:O,onCompositionEnd:C}=e,j=E(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:_,direction:P}=r.useContext(i.E_),N=r.useRef(!1),T=_("input-search",o),A=_("input",l),{compactSize:M}=(0,S.ri)(T,P),I=(0,k.Z)(e=>{var t;return null!==(t=null!=u?u:M)&&void 0!==t?t:e}),R=r.useRef(null),D=e=>{var t;document.activeElement===(null===(t=R.current)||void 0===t?void 0:t.input)&&e.preventDefault()},L=e=>{var t,n;v&&v(null===(n=null===(t=R.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},Z="boolean"==typeof f?r.createElement(b.Z,null):null,z="".concat(T,"-button"),B=f||{},F=B.type&&!0===B.type.__ANT_BUTTON;n=F||"button"===B.type?(0,x.Tm)(B,Object.assign({onMouseDown:D,onClick:e=>{var t,n;null===(n=null===(t=null==B?void 0:B.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),L(e)},key:"enterButton"},F?{className:z,size:I}:{})):r.createElement(w.ZP,{className:z,type:f?"primary":void 0,size:I,disabled:g,key:"enterButton",onMouseDown:D,onClick:L,loading:m,icon:Z},f),h&&(n=[n,(0,x.Tm)(h,{key:"addonAfter"})]);let H=a()(T,{["".concat(T,"-rtl")]:"rtl"===P,["".concat(T,"-").concat(I)]:!!I,["".concat(T,"-with-button")]:!!f},s);return r.createElement(c.Z,Object.assign({ref:(0,p.sQ)(R,t),onPressEnter:e=>{N.current||m||L(e)}},j,{size:I,onCompositionStart:e=>{N.current=!0,null==O||O(e)},onCompositionEnd:e=>{N.current=!1,null==C||C(e)},prefixCls:A,addonAfter:n,suffix:d,onChange:e=>{e&&e.target&&"click"===e.type&&v&&v(e.target.value,e,{source:"clear"}),y&&y(e)},className:H,disabled:g}))});var C=n(90464);let j=c.Z;j.Group=e=>{let{getPrefixCls:t,direction:n}=(0,r.useContext)(i.E_),{prefixCls:o,className:c}=e,u=t("input-group",o),d=t("input"),[f,p]=(0,s.ZP)(d),h=a()(u,{["".concat(u,"-lg")]:"large"===e.size,["".concat(u,"-sm")]:"small"===e.size,["".concat(u,"-compact")]:e.compact,["".concat(u,"-rtl")]:"rtl"===n},p,c),m=(0,r.useContext)(l.aM),g=(0,r.useMemo)(()=>Object.assign(Object.assign({},m),{isFormItemInput:!1}),[m]);return f(r.createElement("span",{className:h,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},r.createElement(l.aM.Provider,{value:g},e.children)))},j.Search=O,j.TextArea=C.Z,j.Password=y;var _=j},31282:function(e,t,n){"use strict";n.d(t,{ik:function(){return p},nz:function(){return u},s7:function(){return h},x0:function(){return f}});var r=n(352),o=n(12918),a=n(17691),i=n(80669),l=n(3104),s=n(37433),c=n(65265);let u=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=e=>{let{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:a}=e;return{padding:"".concat((0,r.bf)(t)," ").concat((0,r.bf)(a)),fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:o}},f=e=>({padding:"".concat((0,r.bf)(e.paddingBlockSM)," ").concat((0,r.bf)(e.paddingInlineSM)),fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),p=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:"".concat((0,r.bf)(e.paddingBlock)," ").concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationMid)},u(e.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:"all ".concat(e.motionDurationSlow,", height 0s"),resize:"vertical"},"&-lg":Object.assign({},d(e)),"&-sm":Object.assign({},f(e)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),h=e=>{let{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},["&-lg ".concat(t,", &-lg > ").concat(t,"-group-addon")]:Object.assign({},d(e)),["&-sm ".concat(t,", &-sm > ").concat(t,"-group-addon")]:Object.assign({},f(e)),["&-lg ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightLG},["&-sm ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightSM},["> ".concat(t)]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},["".concat(t,"-group")]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:"0 ".concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationSlow),lineHeight:1,["".concat(n,"-select")]:{margin:"".concat((0,r.bf)(e.calc(e.paddingBlock).add(1).mul(-1).equal())," ").concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),["&".concat(n,"-select-single:not(").concat(n,"-select-customize-input):not(").concat(n,"-pagination-size-changer)")]:{["".concat(n,"-select-selector")]:{backgroundColor:"inherit",border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),boxShadow:"none"}},"&-open, &-focused":{["".concat(n,"-select-selector")]:{color:e.colorPrimary}}},["".concat(n,"-cascader-picker")]:{margin:"-9px ".concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),backgroundColor:"transparent",["".concat(n,"-cascader-input")]:{textAlign:"start",border:0,boxShadow:"none"}}}},["".concat(t)]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,["".concat(t,"-search-with-button &")]:{zIndex:0}}},["> ".concat(t,":first-child, ").concat(t,"-group-addon:first-child")]:{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,"-affix-wrapper")]:{["&:not(:first-child) ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0},["&:not(:last-child) ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,":last-child, ").concat(t,"-group-addon:last-child")]:{borderStartStartRadius:0,borderEndStartRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["".concat(t,"-affix-wrapper")]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(t,"-search &")]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},["&:not(:first-child), ".concat(t,"-search &:not(:first-child)")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&".concat(t,"-group-compact")]:Object.assign(Object.assign({display:"block"},(0,o.dF)()),{["".concat(t,"-group-addon, ").concat(t,"-group-wrap, > ").concat(t)]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},["\n & > ".concat(t,"-affix-wrapper,\n & > ").concat(t,"-number-affix-wrapper,\n & > ").concat(n,"-picker-range\n ")]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},["".concat(t)]:{float:"none"},["& > ".concat(n,"-select > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete ").concat(t,",\n & > ").concat(n,"-cascader-picker ").concat(t,",\n & > ").concat(t,"-group-wrapper ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},["& > ".concat(n,"-select-focused")]:{zIndex:1},["& > ".concat(n,"-select > ").concat(n,"-select-arrow")]:{zIndex:1},["& > *:first-child,\n & > ".concat(n,"-select:first-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete:first-child ").concat(t,",\n & > ").concat(n,"-cascader-picker:first-child ").concat(t)]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},["& > *:last-child,\n & > ".concat(n,"-select:last-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-cascader-picker:last-child ").concat(t,",\n & > ").concat(n,"-cascader-picker-focused:last-child ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},["& > ".concat(n,"-select-auto-complete ").concat(t)]:{verticalAlign:"top"},["".concat(t,"-group-wrapper + ").concat(t,"-group-wrapper")]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),["".concat(t,"-affix-wrapper")]:{borderRadius:0}},["".concat(t,"-group-wrapper:not(:last-child)")]:{["&".concat(t,"-search > ").concat(t,"-group")]:{["& > ".concat(t,"-group-addon > ").concat(t,"-search-button")]:{borderRadius:0},["& > ".concat(t)]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},m=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:a}=e,i=a(n).sub(a(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),p(e)),(0,c.qG)(e)),(0,c.H8)(e)),(0,c.Mu)(e)),{'&[type="color"]':{height:e.controlHeight,["&".concat(t,"-lg")]:{height:e.controlHeightLG},["&".concat(t,"-sm")]:{height:n,paddingTop:i,paddingBottom:i}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},g=e=>{let{componentCls:t}=e;return{["".concat(t,"-clear-icon")]:{margin:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextTertiary},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:"0 ".concat((0,r.bf)(e.inputAffixPadding))}}}},v=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:a,colorIconHover:i,iconCls:l}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign(Object.assign(Object.assign({},p(e)),{display:"inline-flex",["&:not(".concat(t,"-disabled):hover")]:{zIndex:1,["".concat(t,"-search-with-button &")]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},["> input".concat(t)]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t)]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),g(e)),{["".concat(l).concat(t,"-password-icon")]:{color:a,cursor:"pointer",transition:"all ".concat(o),"&:hover":{color:i}}})}},y=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{["".concat(t,"-group")]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),h(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:r}}},(0,c.ir)(e)),(0,c.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},b=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-search");return{[r]:{["".concat(t)]:{"&:hover, &:focus":{borderColor:e.colorPrimaryHover,["+ ".concat(t,"-group-addon ").concat(r,"-button:not(").concat(n,"-btn-primary)")]:{borderInlineStartColor:e.colorPrimaryHover}}},["".concat(t,"-affix-wrapper")]:{borderRadius:0},["".concat(t,"-lg")]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal({unit:!1})},["> ".concat(t,"-group")]:{["> ".concat(t,"-group-addon:last-child")]:{insetInlineStart:-1,padding:0,border:0,["".concat(r,"-button")]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius,borderEndStartRadius:0,boxShadow:"none"},["".concat(r,"-button:not(").concat(n,"-btn-primary)")]:{color:e.colorTextDescription,"&:hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},["&".concat(n,"-btn-loading::before")]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},["".concat(r,"-button")]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},["&-large ".concat(r,"-button")]:{height:e.controlHeightLG},["&-small ".concat(r,"-button")]:{height:e.controlHeightSM},"&-rtl":{direction:"rtl"},["&".concat(t,"-compact-item")]:{["&:not(".concat(t,"-compact-last-item)")]:{["".concat(t,"-group-addon")]:{["".concat(t,"-search-button")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},["&:not(".concat(t,"-compact-first-item)")]:{["".concat(t,",").concat(t,"-affix-wrapper")]:{borderRadius:0}},["> ".concat(t,"-group-addon ").concat(t,"-search-button,\n > ").concat(t,",\n ").concat(t,"-affix-wrapper")]:{"&:hover,&:focus,&:active":{zIndex:2}},["> ".concat(t,"-affix-wrapper-focused")]:{zIndex:2}}}}},x=e=>{let{componentCls:t,paddingLG:n}=e,r="".concat(t,"-textarea");return{[r]:{position:"relative","&-show-count":{["> ".concat(t)]:{height:"100%"},["".concat(t,"-data-count")]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{["> ".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(r,"-has-feedback")]:{["".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(t,"-affix-wrapper")]:{padding:0,["> textarea".concat(t)]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},["".concat(t,"-suffix")]:{margin:0,"> *:not(:last-child)":{marginInline:0},["".concat(t,"-clear-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,insetBlockStart:e.paddingXS},["".concat(r,"-suffix")]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},w=e=>{let{componentCls:t}=e;return{["".concat(t,"-out-of-range")]:{["&, & input, & textarea, ".concat(t,"-show-count-suffix, ").concat(t,"-data-count")]:{color:e.colorError}}}};t.ZP=(0,i.I$)("Input",e=>{let t=(0,l.TS)(e,(0,s.e)(e));return[m(t),x(t),v(t),y(t),b(t),w(t),(0,a.c)(t)]},s.T)},37433:function(e,t,n){"use strict";n.d(t,{T:function(){return a},e:function(){return o}});var r=n(3104);function o(e){return(0,r.TS)(e,{inputAffixPadding:e.paddingXXS})}let a=e=>{let{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:a,controlHeightLG:i,fontSizeLG:l,lineHeightLG:s,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:h,controlOutlineWidth:m,controlOutline:g,colorErrorOutline:v,colorWarningOutline:y,colorBgContainer:b}=e;return{paddingBlock:Math.max(Math.round((t-n*r)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((a-n*r)/2*10)/10-o,0),paddingBlockLG:Math.ceil((i-l*s)/2*10)/10-o,paddingInline:c-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:f,activeBorderColor:h,hoverBorderColor:p,activeShadow:"0 0 0 ".concat(m,"px ").concat(g),errorActiveShadow:"0 0 0 ".concat(m,"px ").concat(v),warningActiveShadow:"0 0 0 ".concat(m,"px ").concat(y),hoverBg:b,activeBg:b,inputFontSize:n,inputFontSizeLG:l,inputFontSizeSM:n}}},65265:function(e,t,n){"use strict";n.d(t,{$U:function(){return l},H8:function(){return m},Mu:function(){return f},S5:function(){return v},Xy:function(){return i},ir:function(){return d},qG:function(){return c}});var r=n(352),o=n(3104);let a=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),i=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},a((0,o.TS)(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),l=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),s=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},l(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),c=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},l(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),s(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),s(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),u=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),d=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.addonBg,border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},u(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),u(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group-addon")]:Object.assign({},i(e))}})}),f=(e,t)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},["&".concat(e.componentCls,"-disabled, &[disabled]")]:{color:e.colorTextDisabled}},t)}),p=(e,t)=>({background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null==t?void 0:t.inputColor},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}),h=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},p(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),m=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.colorPrimary})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),h(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),h(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),g=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{background:t.addonBg,color:t.addonColor}}}),v=e=>({"&-filled":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary},["".concat(e.componentCls,"-filled:not(:focus):not(:focus-within)")]:{"&:not(:first-child)":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)},"&:not(:last-child)":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}}}},g(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),g(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:last-child":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)}}}})})},19226:function(e,t,n){"use strict";n.d(t,{default:function(){return O}});var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),l=n(18694),s=n(71744),c=n(80856),u=n(45287),d=n(92239),f=n(352),p=n(80669),h=e=>{let{componentCls:t,bodyBg:n,lightSiderBg:r,lightTriggerBg:o,lightTriggerColor:a}=e;return{["".concat(t,"-sider-light")]:{background:r,["".concat(t,"-sider-trigger")]:{color:a,background:o},["".concat(t,"-sider-zero-width-trigger")]:{color:a,background:o,border:"1px solid ".concat(n),borderInlineStart:0}}}};let m=e=>{let{antCls:t,componentCls:n,colorText:r,triggerColor:o,footerBg:a,triggerBg:i,headerHeight:l,headerPadding:s,headerColor:c,footerPadding:u,triggerHeight:d,zeroTriggerHeight:p,zeroTriggerWidth:m,motionDurationMid:g,motionDurationSlow:v,fontSize:y,borderRadius:b,bodyBg:x,headerBg:w,siderBg:k}=e;return{[n]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:x,"&, *":{boxSizing:"border-box"},["&".concat(n,"-has-sider")]:{flexDirection:"row",["> ".concat(n,", > ").concat(n,"-content")]:{width:0}},["".concat(n,"-header, &").concat(n,"-footer")]:{flex:"0 0 auto"},["".concat(n,"-sider")]:{position:"relative",minWidth:0,background:k,transition:"all ".concat(g,", background 0s"),"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,["".concat(t,"-menu").concat(t,"-menu-inline-collapsed")]:{width:"auto"}},"&-has-trigger":{paddingBottom:d},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:d,color:o,lineHeight:(0,f.bf)(d),textAlign:"center",background:i,cursor:"pointer",transition:"all ".concat(g)},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:l,insetInlineEnd:e.calc(m).mul(-1).equal(),zIndex:1,width:m,height:p,color:o,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:k,borderStartStartRadius:0,borderStartEndRadius:b,borderEndEndRadius:b,borderEndStartRadius:0,cursor:"pointer",transition:"background ".concat(v," ease"),"&::after":{position:"absolute",inset:0,background:"transparent",transition:"all ".concat(v),content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(m).mul(-1).equal(),borderStartStartRadius:b,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:b}}}}},h(e)),{"&-rtl":{direction:"rtl"}}),["".concat(n,"-header")]:{height:l,padding:s,color:c,lineHeight:(0,f.bf)(l),background:w,["".concat(t,"-menu")]:{lineHeight:"inherit"}},["".concat(n,"-footer")]:{padding:u,color:r,fontSize:y,background:a},["".concat(n,"-content")]:{flex:"auto",minHeight:0}}};var g=(0,p.I$)("Layout",e=>[m(e)],e=>{let{colorBgLayout:t,controlHeight:n,controlHeightLG:r,colorText:o,controlHeightSM:a,marginXXS:i,colorTextLightSolid:l,colorBgContainer:s}=e,c=1.25*r;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:2*n,headerPadding:"0 ".concat(c,"px"),headerColor:o,footerPadding:"".concat(a,"px ").concat(c,"px"),footerBg:t,siderBg:"#001529",triggerHeight:r+2*i,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:r,zeroTriggerHeight:r,lightSiderBg:s,lightTriggerBg:s,lightTriggerColor:o}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function y(e){let{suffixCls:t,tagName:n,displayName:r}=e;return e=>o.forwardRef((r,a)=>o.createElement(e,Object.assign({ref:a,suffixCls:t,tagName:n},r)))}let b=o.forwardRef((e,t)=>{let{prefixCls:n,suffixCls:r,className:a,tagName:l}=e,c=v(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:u}=o.useContext(s.E_),d=u("layout",n),[f,p,h]=g(d),m=r?"".concat(d,"-").concat(r):d;return f(o.createElement(l,Object.assign({className:i()(n||m,a,p,h),ref:t},c)))}),x=o.forwardRef((e,t)=>{let{direction:n}=o.useContext(s.E_),[a,f]=o.useState([]),{prefixCls:p,className:h,rootClassName:m,children:y,hasSider:b,tagName:x,style:w}=e,k=v(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),S=(0,l.Z)(k,["suffixCls"]),{getPrefixCls:E,layout:O}=o.useContext(s.E_),C=E("layout",p),j="boolean"==typeof b?b:!!a.length||(0,u.Z)(y).some(e=>e.type===d.Z),[_,P,N]=g(C),T=i()(C,{["".concat(C,"-has-sider")]:j,["".concat(C,"-rtl")]:"rtl"===n},null==O?void 0:O.className,h,m,P,N),A=o.useMemo(()=>({siderHook:{addSider:e=>{f(t=>[].concat((0,r.Z)(t),[e]))},removeSider:e=>{f(t=>t.filter(t=>t!==e))}}}),[]);return _(o.createElement(c.V.Provider,{value:A},o.createElement(x,Object.assign({ref:t,className:T,style:Object.assign(Object.assign({},null==O?void 0:O.style),w)},S),y)))}),w=y({tagName:"div",displayName:"Layout"})(x),k=y({suffixCls:"header",tagName:"header",displayName:"Header"})(b),S=y({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(b),E=y({suffixCls:"content",tagName:"main",displayName:"Content"})(b);w.Header=k,w.Footer=S,w.Content=E,w.Sider=d.Z,w._InternalSiderContext=d.D;var O=w},14301:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var r=n(2265),o=n(36760),a=n.n(o);let i=e=>e?"function"==typeof e?e():e:null;var l=n(68710),s=n(71744),c=n(89970),u=n(5769),d=n(12918),f=n(691),p=n(88260),h=n(53454),m=n(80669),g=n(3104),v=n(34442);let y=e=>{let{componentCls:t,popoverColor:n,titleMinWidth:r,fontWeightStrong:o,innerPadding:a,boxShadowSecondary:i,colorTextHeading:l,borderRadiusLG:s,zIndexPopup:c,titleMarginBottom:u,colorBgElevated:f,popoverBg:h,titleBorderBottom:m,innerContentPadding:g,titlePadding:v}=e;return[{[t]:Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":f,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},["".concat(t,"-content")]:{position:"relative"},["".concat(t,"-inner")]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:s,boxShadow:i,padding:a},["".concat(t,"-title")]:{minWidth:r,marginBottom:u,color:l,fontWeight:o,borderBottom:m,padding:v},["".concat(t,"-inner-content")]:{color:n,padding:g}})},(0,p.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(t,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",["".concat(t,"-content")]:{display:"inline-block"}}}]},b=e=>{let{componentCls:t}=e;return{[t]:h.i.map(n=>{let r=e["".concat(n,"6")];return{["&".concat(t,"-").concat(n)]:{"--antd-arrow-background-color":r,["".concat(t,"-inner")]:{backgroundColor:r},["".concat(t,"-arrow")]:{background:"transparent"}}}})}};var x=(0,m.I$)("Popover",e=>{let{colorBgElevated:t,colorText:n}=e,r=(0,g.TS)(e,{popoverBg:t,popoverColor:n});return[y(r),b(r),(0,f._y)(r,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:n,fontHeight:r,padding:o,wireframe:a,zIndexPopupBase:i,borderRadiusLG:l,marginXS:s,lineType:c,colorSplit:u,paddingSM:d}=e,f=n-r;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:i+30},(0,v.w)(e)),(0,p.wZ)({contentRadius:l,limitVerticalRadius:!0})),{innerPadding:a?0:12,titleMarginBottom:a?0:s,titlePadding:a?"".concat(f/2,"px ").concat(o,"px ").concat(f/2-t,"px"):0,titleBorderBottom:a?"".concat(t,"px ").concat(c," ").concat(u):"none",innerContentPadding:a?"".concat(d,"px ").concat(o,"px"):0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]}),w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let k=(e,t,n)=>t||n?r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(e,"-title")},i(t)),r.createElement("div",{className:"".concat(e,"-inner-content")},i(n))):null,S=e=>{let{hashId:t,prefixCls:n,className:o,style:i,placement:l="top",title:s,content:c,children:d}=e;return r.createElement("div",{className:a()(t,n,"".concat(n,"-pure"),"".concat(n,"-placement-").concat(l),o),style:i},r.createElement("div",{className:"".concat(n,"-arrow")}),r.createElement(u.G,Object.assign({},e,{className:t,prefixCls:n}),d||k(n,s,c)))};var 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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O=e=>{let{title:t,content:n,prefixCls:o}=e;return r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(o,"-title")},i(t)),r.createElement("div",{className:"".concat(o,"-inner-content")},i(n)))},C=r.forwardRef((e,t)=>{let{prefixCls:n,title:o,content:i,overlayClassName:u,placement:d="top",trigger:f="hover",mouseEnterDelay:p=.1,mouseLeaveDelay:h=.1,overlayStyle:m={}}=e,g=E(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:v}=r.useContext(s.E_),y=v("popover",n),[b,w,k]=x(y),S=v(),C=a()(u,w,k);return b(r.createElement(c.Z,Object.assign({placement:d,trigger:f,mouseEnterDelay:p,mouseLeaveDelay:h,overlayStyle:m},g,{prefixCls:y,overlayClassName:C,ref:t,overlay:o||i?r.createElement(O,{prefixCls:y,title:o,content:i}):null,transitionName:(0,l.m)(S,"zoom-big",g.transitionName),"data-popover-inject":!0})))});C._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,className:n}=e,o=w(e,["prefixCls","className"]),{getPrefixCls:i}=r.useContext(s.E_),l=i("popover",t),[c,u,d]=x(l);return c(r.createElement(S,Object.assign({},o,{prefixCls:l,hashId:u,className:a()(n,d)})))};var j=C},29967:function(e,t,n){"use strict";n.d(t,{ZP:function(){return R}});var r=n(2265),o=n(36760),a=n.n(o),i=n(50506),l=n(18242),s=n(71744),c=n(33759);let u=r.createContext(null),d=u.Provider,f=r.createContext(null),p=f.Provider;var h=n(20873),m=n(28791),g=n(6694),v=n(34709),y=n(86586),b=n(39109),x=n(352),w=n(12918),k=n(80669),S=n(3104);let E=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-group");return{[r]:Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(r,"-rtl")]:{direction:"rtl"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},O=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:r,radioSize:o,motionDurationSlow:a,motionDurationMid:i,motionEaseInOutCirc:l,colorBgContainer:s,colorBorder:c,lineWidth:u,colorBgContainerDisabled:d,colorTextDisabled:f,paddingXS:p,dotColorDisabled:h,lineType:m,radioColor:g,radioBgColor:v,calc:y}=e,b="".concat(t,"-inner"),k=y(o).sub(y(4).mul(2)),S=y(1).mul(o).equal();return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",["&".concat(t,"-wrapper-rtl")]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,x.bf)(u)," ").concat(m," ").concat(r),borderRadius:"50%",visibility:"hidden",content:'""'},[t]:Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(b)]:{borderColor:r},["".concat(t,"-input:focus-visible + ").concat(b)]:Object.assign({},(0,w.oN)(e)),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:S,height:S,marginBlockStart:y(1).mul(o).div(-2).equal(),marginInlineStart:y(1).mul(o).div(-2).equal(),backgroundColor:g,borderBlockStart:0,borderInlineStart:0,borderRadius:S,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(l),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:S,height:S,backgroundColor:s,borderColor:c,borderStyle:"solid",borderWidth:u,borderRadius:"50%",transition:"all ".concat(i)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[b]:{borderColor:r,backgroundColor:v,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(o).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(l)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[b]:{backgroundColor:d,borderColor:c,cursor:"not-allowed","&::after":{backgroundColor:h}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[b]:{"&::after":{transform:"scale(".concat(y(k).div(o).equal({unit:!1}),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},C=e=>{let{buttonColor:t,controlHeight:n,componentCls:r,lineWidth:o,lineType:a,colorBorder:i,motionDurationSlow:l,motionDurationMid:s,buttonPaddingInline:c,fontSize:u,buttonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:h,paddingXS:m,borderRadius:g,borderRadiusSM:v,borderRadiusLG:y,buttonCheckedBg:b,buttonSolidCheckedColor:k,colorTextDisabled:S,colorBgContainerDisabled:E,buttonCheckedBgDisabled:O,buttonCheckedColorDisabled:C,colorPrimary:j,colorPrimaryHover:_,colorPrimaryActive:P,buttonSolidCheckedBg:N,buttonSolidCheckedHoverBg:T,buttonSolidCheckedActiveBg:A,calc:M}=e;return{["".concat(r,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:u,lineHeight:(0,x.bf)(M(n).sub(M(o).mul(2)).equal()),background:d,border:"".concat((0,x.bf)(o)," ").concat(a," ").concat(i),borderBlockStartWidth:M(o).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:o,cursor:"pointer",transition:["color ".concat(s),"background ".concat(s),"box-shadow ".concat(s)].join(","),a:{color:t},["> ".concat(r,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:M(o).mul(-1).equal(),insetInlineStart:M(o).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:o,paddingInline:0,backgroundColor:i,transition:"background-color ".concat(l),content:'""'}},"&:first-child":{borderInlineStart:"".concat((0,x.bf)(o)," ").concat(a," ").concat(i),borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g},"&:first-child:last-child":{borderRadius:g},["".concat(r,"-group-large &")]:{height:p,fontSize:f,lineHeight:(0,x.bf)(M(p).sub(M(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:y,borderEndStartRadius:y},"&:last-child":{borderStartEndRadius:y,borderEndEndRadius:y}},["".concat(r,"-group-small &")]:{height:h,paddingInline:M(m).sub(o).equal(),paddingBlock:0,lineHeight:(0,x.bf)(M(h).sub(M(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:j},"&:has(:focus-visible)":Object.assign({},(0,w.oN)(e)),["".concat(r,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(r,"-button-wrapper-disabled)")]:{zIndex:1,color:j,background:b,borderColor:j,"&::before":{backgroundColor:j},"&:first-child":{borderColor:j},"&:hover":{color:_,borderColor:_,"&::before":{backgroundColor:_}},"&:active":{color:P,borderColor:P,"&::before":{backgroundColor:P}}},["".concat(r,"-group-solid &-checked:not(").concat(r,"-button-wrapper-disabled)")]:{color:k,background:N,borderColor:N,"&:hover":{color:k,background:T,borderColor:T},"&:active":{color:k,background:A,borderColor:A}},"&-disabled":{color:S,backgroundColor:E,borderColor:i,cursor:"not-allowed","&:first-child, &:hover":{color:S,backgroundColor:E,borderColor:i}},["&-disabled".concat(r,"-button-wrapper-checked")]:{color:C,backgroundColor:O,borderColor:i,boxShadow:"none"}}}};var j=(0,k.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,r="0 0 0 ".concat((0,x.bf)(n)," ").concat(t),o=(0,S.TS)(e,{radioFocusShadow:r,radioButtonFocusShadow:r});return[E(o),O(o),C(o)]},e=>{let{wireframe:t,padding:n,marginXS:r,lineWidth:o,fontSizeLG:a,colorText:i,colorBgContainer:l,colorTextDisabled:s,controlItemBgActiveDisabled:c,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:h}=e;return{radioSize:a,dotSize:t?a-8:a-(4+o)*2,dotColorDisabled:s,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:l,buttonCheckedBg:l,buttonColor:i,buttonCheckedBgDisabled:c,buttonCheckedColorDisabled:s,buttonPaddingInline:n-o,wrapperMarginInlineEnd:r,radioColor:t?d:h,radioBgColor:t?l:d}},{unitless:{radioSize:!0,dotSize:!0}}),_=n(64024),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=r.forwardRef((e,t)=>{var n,o;let i=r.useContext(u),l=r.useContext(f),{getPrefixCls:c,direction:d,radio:p}=r.useContext(s.E_),x=r.useRef(null),w=(0,m.sQ)(t,x),{isFormItemInput:k}=r.useContext(b.aM),{prefixCls:S,className:E,rootClassName:O,children:C,style:N,title:T}=e,A=P(e,["prefixCls","className","rootClassName","children","style","title"]),M=c("radio",S),I="button"===((null==i?void 0:i.optionType)||l),R=I?"".concat(M,"-button"):M,D=(0,_.Z)(M),[L,Z,z]=j(M,D),B=Object.assign({},A),F=r.useContext(y.Z);i&&(B.name=i.name,B.onChange=t=>{var n,r;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(r=null==i?void 0:i.onChange)||void 0===r||r.call(i,t)},B.checked=e.value===i.value,B.disabled=null!==(n=B.disabled)&&void 0!==n?n:i.disabled),B.disabled=null!==(o=B.disabled)&&void 0!==o?o:F;let H=a()("".concat(R,"-wrapper"),{["".concat(R,"-wrapper-checked")]:B.checked,["".concat(R,"-wrapper-disabled")]:B.disabled,["".concat(R,"-wrapper-rtl")]:"rtl"===d,["".concat(R,"-wrapper-in-form-item")]:k},null==p?void 0:p.className,E,O,Z,z,D);return L(r.createElement(g.Z,{component:"Radio",disabled:B.disabled},r.createElement("label",{className:H,style:Object.assign(Object.assign({},null==p?void 0:p.style),N),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:T},r.createElement(h.Z,Object.assign({},B,{className:a()(B.className,!I&&v.A),type:"radio",prefixCls:R,ref:w})),void 0!==C?r.createElement("span",null,C):null)))}),T=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:o}=r.useContext(s.E_),[u,f]=(0,i.Z)(e.defaultValue,{value:e.value}),{prefixCls:p,className:h,rootClassName:m,options:g,buttonStyle:v="outline",disabled:y,children:b,size:x,style:w,id:k,onMouseEnter:S,onMouseLeave:E,onFocus:O,onBlur:C}=e,P=n("radio",p),T="".concat(P,"-group"),A=(0,_.Z)(P),[M,I,R]=j(P,A),D=b;g&&g.length>0&&(D=g.map(e=>"string"==typeof e||"number"==typeof e?r.createElement(N,{key:e.toString(),prefixCls:P,disabled:y,value:e,checked:u===e},e):r.createElement(N,{key:"radio-group-value-options-".concat(e.value),prefixCls:P,disabled:e.disabled||y,value:e.value,checked:u===e.value,title:e.title,style:e.style,id:e.id,required:e.required},e.label)));let L=(0,c.Z)(x),Z=a()(T,"".concat(T,"-").concat(v),{["".concat(T,"-").concat(L)]:L,["".concat(T,"-rtl")]:"rtl"===o},h,m,I,R,A);return M(r.createElement("div",Object.assign({},(0,l.Z)(e,{aria:!0,data:!0}),{className:Z,style:w,onMouseEnter:S,onMouseLeave:E,onFocus:O,onBlur:C,id:k,ref:t}),r.createElement(d,{value:{onChange:t=>{let n=t.target.value;"value"in e||f(n);let{onChange:r}=e;r&&n!==u&&r(t)},value:u,disabled:e.disabled,name:e.name,optionType:e.optionType}},D)))});var A=r.memo(T),M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},I=r.forwardRef((e,t)=>{let{getPrefixCls:n}=r.useContext(s.E_),{prefixCls:o}=e,a=M(e,["prefixCls"]),i=n("radio",o);return r.createElement(p,{value:"button"},r.createElement(N,Object.assign({prefixCls:i},a,{type:"radio",ref:t})))});N.Button=I,N.Group=A,N.__ANT_RADIO=!0;var R=N},47451:function(e,t,n){"use strict";var r=n(10295);t.Z=r.Z},87908:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),l=n(19722),s=n(71744),c=n(352),u=n(12918),d=n(80669),f=n(3104);let p=new c.E4("antSpinMove",{to:{opacity:1}}),h=new c.E4("antRotate",{to:{transform:"rotate(405deg)"}}),m=e=>{let{componentCls:t,calc:n}=e;return{["".concat(t)]:Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:"transform ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOutCirc),"&-spinning":{position:"static",display:"inline-block",opacity:1},["".concat(t,"-text")]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:"all ".concat(e.motionDurationMid),"&-show":{opacity:1,visibility:"visible"},["".concat(t,"-dot ").concat(t,"-dot-item")]:{backgroundColor:e.colorWhite},["".concat(t,"-text")]:{color:e.colorTextLightSolid}},"&-nested-loading":{position:"relative",["> div > ".concat(t)]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,["".concat(t,"-dot")]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},["".concat(t,"-text")]:{position:"absolute",top:"50%",width:"100%",textShadow:"0 1px 2px ".concat(e.colorBgContainer)},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{["".concat(t,"-dot")]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},["".concat(t,"-text")]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{["".concat(t,"-dot")]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},["".concat(t,"-text")]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},["".concat(t,"-container")]:{position:"relative",transition:"opacity ".concat(e.motionDurationSlow),"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:"all ".concat(e.motionDurationSlow),content:'""',pointerEvents:"none"}},["".concat(t,"-blur")]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},["".concat(t,"-dot")]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),backgroundColor:e.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:p,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:h,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&-sm ".concat(t,"-dot")]:{fontSize:e.dotSizeSM,i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},["&-lg ".concat(t,"-dot")]:{fontSize:e.dotSizeLG,i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},["&".concat(t,"-show-text ").concat(t,"-text")]:{display:"block"}})}};var g=(0,d.I$)("Spin",e=>[m((0,f.TS)(e,{spinDotDefault:e.colorTextDescription}))],e=>{let{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}}),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let y=null,b=e=>{let{prefixCls:t,spinning:n=!0,delay:o=0,className:c,rootClassName:u,size:d="default",tip:f,wrapperClassName:p,style:h,children:m,fullscreen:b}=e,x=v(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen"]),{getPrefixCls:w}=r.useContext(s.E_),k=w("spin",t),[S,E,O]=g(k),[C,j]=r.useState(()=>n&&(!n||!o||!!isNaN(Number(o))));r.useEffect(()=>{if(n){var e;let t=function(e,t,n){var r,o=n||{},a=o.noTrailing,i=void 0!==a&&a,l=o.noLeading,s=void 0!==l&&l,c=o.debounceMode,u=void 0===c?void 0:c,d=!1,f=0;function p(){r&&clearTimeout(r)}function h(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var l=this,c=Date.now()-f;function h(){f=Date.now(),t.apply(l,o)}function m(){r=void 0}!d&&(s||!u||r||h(),p(),void 0===u&&c>e?s?(f=Date.now(),i||(r=setTimeout(u?m:h,e))):h():!0!==i&&(r=setTimeout(u?m:h,void 0===u?e-c:e)))}return h.cancel=function(e){var t=(e||{}).upcomingOnly;p(),d=!(void 0!==t&&t)},h}(o,()=>{j(!0)},{debounceMode:!1!==(void 0!==(e=({}).atBegin)&&e)});return t(),()=>{var e;null===(e=null==t?void 0:t.cancel)||void 0===e||e.call(t)}}j(!1)},[o,n]);let _=r.useMemo(()=>void 0!==m&&!b,[m,b]),{direction:P,spin:N}=r.useContext(s.E_),T=a()(k,null==N?void 0:N.className,{["".concat(k,"-sm")]:"small"===d,["".concat(k,"-lg")]:"large"===d,["".concat(k,"-spinning")]:C,["".concat(k,"-show-text")]:!!f,["".concat(k,"-fullscreen")]:b,["".concat(k,"-fullscreen-show")]:b&&C,["".concat(k,"-rtl")]:"rtl"===P},c,u,E,O),A=a()("".concat(k,"-container"),{["".concat(k,"-blur")]:C}),M=(0,i.Z)(x,["indicator"]),I=Object.assign(Object.assign({},null==N?void 0:N.style),h),R=r.createElement("div",Object.assign({},M,{style:I,className:T,"aria-live":"polite","aria-busy":C}),function(e,t){let{indicator:n}=t,o="".concat(e,"-dot");return null===n?null:(0,l.l$)(n)?(0,l.Tm)(n,{className:a()(n.props.className,o)}):(0,l.l$)(y)?(0,l.Tm)(y,{className:a()(y.props.className,o)}):r.createElement("span",{className:a()(o,"".concat(e,"-dot-spin"))},r.createElement("i",{className:"".concat(e,"-dot-item"),key:1}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:2}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:3}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:4}))}(k,e),f&&(_||b)?r.createElement("div",{className:"".concat(k,"-text")},f):null);return S(_?r.createElement("div",Object.assign({},M,{className:a()("".concat(k,"-nested-loading"),p,E,O)}),C&&r.createElement("div",{key:"loading"},R),r.createElement("div",{className:A,key:"container"},m)):R)};b.setDefaultIndicator=e=>{y=e};var x=b},76122:function(e,t,n){"use strict";n.d(t,{N:function(){return r}});let r=e=>({color:e.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}})},63709:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var r=n(2265),o=n(61935),a=n(36760),i=n.n(a),l=n(1119),s=n(11993),c=n(26365),u=n(6989),d=n(50506),f=n(95814),p=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],h=r.forwardRef(function(e,t){var n,o=e.prefixCls,a=void 0===o?"rc-switch":o,h=e.className,m=e.checked,g=e.defaultChecked,v=e.disabled,y=e.loadingIcon,b=e.checkedChildren,x=e.unCheckedChildren,w=e.onClick,k=e.onChange,S=e.onKeyDown,E=(0,u.Z)(e,p),O=(0,d.Z)(!1,{value:m,defaultValue:g}),C=(0,c.Z)(O,2),j=C[0],_=C[1];function P(e,t){var n=j;return v||(_(n=e),null==k||k(n,t)),n}var N=i()(a,h,(n={},(0,s.Z)(n,"".concat(a,"-checked"),j),(0,s.Z)(n,"".concat(a,"-disabled"),v),n));return r.createElement("button",(0,l.Z)({},E,{type:"button",role:"switch","aria-checked":j,disabled:v,className:N,ref:t,onKeyDown:function(e){e.which===f.Z.LEFT?P(!1,e):e.which===f.Z.RIGHT&&P(!0,e),null==S||S(e)},onClick:function(e){var t=P(!j,e);null==w||w(t,e)}}),y,r.createElement("span",{className:"".concat(a,"-inner")},r.createElement("span",{className:"".concat(a,"-inner-checked")},b),r.createElement("span",{className:"".concat(a,"-inner-unchecked")},x)))});h.displayName="Switch";var m=n(6694),g=n(71744),v=n(86586),y=n(33759),b=n(352),x=n(36360),w=n(12918),k=n(80669),S=n(3104);let E=e=>{let{componentCls:t,trackHeightSM:n,trackPadding:r,trackMinWidthSM:o,innerMinMarginSM:a,innerMaxMarginSM:i,handleSizeSM:l,calc:s}=e,c="".concat(t,"-inner"),u=(0,b.bf)(s(l).add(s(r).mul(2)).equal()),d=(0,b.bf)(s(i).mul(2).equal());return{[t]:{["&".concat(t,"-small")]:{minWidth:o,height:n,lineHeight:(0,b.bf)(n),["".concat(t,"-inner")]:{paddingInlineStart:i,paddingInlineEnd:a,["".concat(c,"-checked")]:{marginInlineStart:"calc(-100% + ".concat(u," - ").concat(d,")"),marginInlineEnd:"calc(100% - ".concat(u," + ").concat(d,")")},["".concat(c,"-unchecked")]:{marginTop:s(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},["".concat(t,"-handle")]:{width:l,height:l},["".concat(t,"-loading-icon")]:{top:s(s(l).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},["&".concat(t,"-checked")]:{["".concat(t,"-inner")]:{paddingInlineStart:a,paddingInlineEnd:i,["".concat(c,"-checked")]:{marginInlineStart:0,marginInlineEnd:0},["".concat(c,"-unchecked")]:{marginInlineStart:"calc(100% - ".concat(u," + ").concat(d,")"),marginInlineEnd:"calc(-100% + ".concat(u," - ").concat(d,")")}},["".concat(t,"-handle")]:{insetInlineStart:"calc(100% - ".concat((0,b.bf)(s(l).add(r).equal()),")")}},["&:not(".concat(t,"-disabled):active")]:{["&:not(".concat(t,"-checked) ").concat(c)]:{["".concat(c,"-unchecked")]:{marginInlineStart:s(e.marginXXS).div(2).equal(),marginInlineEnd:s(e.marginXXS).mul(-1).div(2).equal()}},["&".concat(t,"-checked ").concat(c)]:{["".concat(c,"-checked")]:{marginInlineStart:s(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:s(e.marginXXS).div(2).equal()}}}}}}},O=e=>{let{componentCls:t,handleSize:n,calc:r}=e;return{[t]:{["".concat(t,"-loading-icon").concat(e.iconCls)]:{position:"relative",top:r(r(n).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},["&".concat(t,"-checked ").concat(t,"-loading-icon")]:{color:e.switchColor}}}},C=e=>{let{componentCls:t,trackPadding:n,handleBg:r,handleShadow:o,handleSize:a,calc:i}=e,l="".concat(t,"-handle");return{[t]:{[l]:{position:"absolute",top:n,insetInlineStart:n,width:a,height:a,transition:"all ".concat(e.switchDuration," ease-in-out"),"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:r,borderRadius:i(a).div(2).equal(),boxShadow:o,transition:"all ".concat(e.switchDuration," ease-in-out"),content:'""'}},["&".concat(t,"-checked ").concat(l)]:{insetInlineStart:"calc(100% - ".concat((0,b.bf)(i(a).add(n).equal()),")")},["&:not(".concat(t,"-disabled):active")]:{["".concat(l,"::before")]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},["&".concat(t,"-checked ").concat(l,"::before")]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},j=e=>{let{componentCls:t,trackHeight:n,trackPadding:r,innerMinMargin:o,innerMaxMargin:a,handleSize:i,calc:l}=e,s="".concat(t,"-inner"),c=(0,b.bf)(l(i).add(l(r).mul(2)).equal()),u=(0,b.bf)(l(a).mul(2).equal());return{[t]:{[s]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:a,paddingInlineEnd:o,transition:"padding-inline-start ".concat(e.switchDuration," ease-in-out, padding-inline-end ").concat(e.switchDuration," ease-in-out"),["".concat(s,"-checked, ").concat(s,"-unchecked")]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:"margin-inline-start ".concat(e.switchDuration," ease-in-out, margin-inline-end ").concat(e.switchDuration," ease-in-out"),pointerEvents:"none"},["".concat(s,"-checked")]:{marginInlineStart:"calc(-100% + ".concat(c," - ").concat(u,")"),marginInlineEnd:"calc(100% - ".concat(c," + ").concat(u,")")},["".concat(s,"-unchecked")]:{marginTop:l(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},["&".concat(t,"-checked ").concat(s)]:{paddingInlineStart:o,paddingInlineEnd:a,["".concat(s,"-checked")]:{marginInlineStart:0,marginInlineEnd:0},["".concat(s,"-unchecked")]:{marginInlineStart:"calc(100% - ".concat(c," + ").concat(u,")"),marginInlineEnd:"calc(-100% + ".concat(c," - ").concat(u,")")}},["&:not(".concat(t,"-disabled):active")]:{["&:not(".concat(t,"-checked) ").concat(s)]:{["".concat(s,"-unchecked")]:{marginInlineStart:l(r).mul(2).equal(),marginInlineEnd:l(r).mul(-1).mul(2).equal()}},["&".concat(t,"-checked ").concat(s)]:{["".concat(s,"-checked")]:{marginInlineStart:l(r).mul(-1).mul(2).equal(),marginInlineEnd:l(r).mul(2).equal()}}}}}},_=e=>{let{componentCls:t,trackHeight:n,trackMinWidth:r}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:r,height:n,lineHeight:"".concat((0,b.bf)(n)),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),userSelect:"none",["&:hover:not(".concat(t,"-disabled)")]:{background:e.colorTextTertiary}}),(0,w.Qy)(e)),{["&".concat(t,"-checked")]:{background:e.switchColor,["&:hover:not(".concat(t,"-disabled)")]:{background:e.colorPrimaryHover}},["&".concat(t,"-loading, &").concat(t,"-disabled")]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},["&".concat(t,"-rtl")]:{direction:"rtl"}})}};var P=(0,k.I$)("Switch",e=>{let t=(0,S.TS)(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:"rgba(0, 0, 0, ".concat(e.opacityLoading,")"),switchHandleActiveInset:"-30%"});return[_(t),j(t),C(t),O(t),E(t)]},e=>{let{fontSize:t,lineHeight:n,controlHeight:r,colorWhite:o}=e,a=t*n,i=r/2,l=a-4,s=i-4;return{trackHeight:a,trackHeightSM:i,trackMinWidth:2*l+8,trackMinWidthSM:2*s+4,trackPadding:2,handleBg:o,handleSize:l,handleSizeSM:s,handleShadow:"0 2px 4px 0 ".concat(new x.C("#00230b").setAlpha(.2).toRgbString()),innerMinMargin:l/2,innerMaxMargin:l+2+4,innerMinMarginSM:s/2,innerMaxMarginSM:s+2+4}}),N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let T=r.forwardRef((e,t)=>{let{prefixCls:n,size:a,disabled:l,loading:s,className:c,rootClassName:u,style:f,checked:p,value:b,defaultChecked:x,defaultValue:w,onChange:k}=e,S=N(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[E,O]=(0,d.Z)(!1,{value:null!=p?p:b,defaultValue:null!=x?x:w}),{getPrefixCls:C,direction:j,switch:_}=r.useContext(g.E_),T=r.useContext(v.Z),A=(null!=l?l:T)||s,M=C("switch",n),I=r.createElement("div",{className:"".concat(M,"-handle")},s&&r.createElement(o.Z,{className:"".concat(M,"-loading-icon")})),[R,D,L]=P(M),Z=(0,y.Z)(a),z=i()(null==_?void 0:_.className,{["".concat(M,"-small")]:"small"===Z,["".concat(M,"-loading")]:s,["".concat(M,"-rtl")]:"rtl"===j},c,u,D,L),B=Object.assign(Object.assign({},null==_?void 0:_.style),f);return R(r.createElement(m.Z,{component:"Switch"},r.createElement(h,Object.assign({},S,{checked:E,onChange:function(){O(arguments.length<=0?void 0:arguments[0]),null==k||k.apply(void 0,arguments)},prefixCls:M,className:z,style:B,disabled:A,ref:t,loadingIcon:I}))))});T.__ANT_SWITCH=!0;var A=T},72188:function(e,t,n){"use strict";n.d(t,{Z:function(){return oe}});var r,o,a=n(2265),i={},l="rc-table-internal-hook",s=n(26365),c=n(58525),u=n(27380),d=n(16671),f=n(54887);function p(e){var t=a.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,r=e.children,o=a.useRef(n);o.current=n;var i=a.useState(function(){return{getValue:function(){return o.current},listeners:new Set}}),l=(0,s.Z)(i,1)[0];return(0,u.Z)(function(){(0,f.unstable_batchedUpdates)(function(){l.listeners.forEach(function(e){e(n)})})},[n]),a.createElement(t.Provider,{value:l},r)},defaultValue:e}}function h(e,t){var n=(0,c.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),r=a.useContext(null==e?void 0:e.Context),o=r||{},i=o.listeners,l=o.getValue,f=a.useRef();f.current=n(r?l():null==e?void 0:e.defaultValue);var p=a.useState({}),h=(0,s.Z)(p,2)[1];return(0,u.Z)(function(){if(r)return i.add(e),function(){i.delete(e)};function e(e){var t=n(e);(0,d.Z)(f.current,t,!0)||h({})}},[r]),f.current}var m=n(1119),g=n(28791);function v(){var e=a.createContext(null);function t(){return a.useContext(e)}return{makeImmutable:function(n,r){var o=(0,g.Yr)(n),i=function(i,l){var s=o?{ref:l}:{},c=a.useRef(0),u=a.useRef(i);return null!==t()?a.createElement(n,(0,m.Z)({},i,s)):((!r||r(u.current,i))&&(c.current+=1),u.current=i,a.createElement(e.Provider,{value:c.current},a.createElement(n,(0,m.Z)({},i,s))))};return o?a.forwardRef(i):i},responseImmutable:function(e,n){var r=(0,g.Yr)(e),o=function(n,o){return t(),a.createElement(e,(0,m.Z)({},n,r?{ref:o}:{}))};return r?a.memo(a.forwardRef(o),n):a.memo(o,n)},useImmutableMark:t}}var y=v();y.makeImmutable,y.responseImmutable,y.useImmutableMark;var b=v(),x=b.makeImmutable,w=b.responseImmutable,k=b.useImmutableMark,S=p();a.memo(function(){var e,t,n,r,o,i=(t=a.useRef(0),t.current+=1,n=a.useRef(void 0),r=[],Object.keys(e||{}).map(function(t){var o;(null==e?void 0:e[t])!==(null===(o=n.current)||void 0===o?void 0:o[t])&&r.push(t)}),n.current=e,o=a.useRef([]),r.length&&(o.current=r),a.useDebugValue(t.current),a.useDebugValue(o.current.join(", ")),t.current);return a.createElement("h1",null,"Render Times: ",i)}).displayName="RenderBlock";var E=n(41154),O=n(31686),C=n(11993),j=n(36760),_=n.n(j),P=n(6397),N=n(16847),T=n(32559),A=a.createContext({renderWithProps:!1});function M(e){var t=[],n={};return e.forEach(function(e){for(var r=e||{},o=r.key,a=r.dataIndex,i=o||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[i];)i="".concat(i,"_next");n[i]=!0,t.push(i)}),t}var I=n(74126),R=function(e){var t,n=e.ellipsis,r=e.rowType,o=e.children,i=!0===n?{showTitle:!0}:n;return i&&(i.showTitle||"header"===r)&&("string"==typeof o||"number"==typeof o?t=o.toString():a.isValidElement(o)&&"string"==typeof o.props.children&&(t=o.props.children)),t},D=a.memo(function(e){var t,n,r,o,i,l,c,u,f,p,g=e.component,v=e.children,y=e.ellipsis,b=e.scope,x=e.prefixCls,w=e.className,j=e.align,T=e.record,M=e.render,D=e.dataIndex,L=e.renderIndex,Z=e.shouldCellUpdate,z=e.index,B=e.rowType,F=e.colSpan,H=e.rowSpan,q=e.fixLeft,W=e.fixRight,U=e.firstFixLeft,K=e.lastFixLeft,$=e.firstFixRight,V=e.lastFixRight,X=e.appendNode,G=e.additionalProps,Y=void 0===G?{}:G,Q=e.isSticky,J="".concat(x,"-cell"),ee=h(S,["supportSticky","allColumnsFixedLeft"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,er=(t=a.useContext(A),n=k(),(0,P.Z)(function(){if(null!=v)return[v];var e=null==D||""===D?[]:Array.isArray(D)?D:[D],n=(0,N.Z)(T,e),r=n,o=void 0;if(M){var i=M(n,T,L);!i||"object"!==(0,E.Z)(i)||Array.isArray(i)||a.isValidElement(i)?r=i:(r=i.children,o=i.props,t.renderWithProps=!0)}return[r,o]},[n,T,v,D,M,L],function(e,n){if(Z){var r=(0,s.Z)(e,2)[1];return Z((0,s.Z)(n,2)[1],r)}return!!t.renderWithProps||!(0,d.Z)(e,n,!0)})),eo=(0,s.Z)(er,2),ea=eo[0],ei=eo[1],el={},es="number"==typeof q&&et,ec="number"==typeof W&&et;es&&(el.position="sticky",el.left=q),ec&&(el.position="sticky",el.right=W);var eu=null!==(r=null!==(o=null!==(i=null==ei?void 0:ei.colSpan)&&void 0!==i?i:Y.colSpan)&&void 0!==o?o:F)&&void 0!==r?r:1,ed=null!==(l=null!==(c=null!==(u=null==ei?void 0:ei.rowSpan)&&void 0!==u?u:Y.rowSpan)&&void 0!==c?c:H)&&void 0!==l?l:1,ef=h(S,function(e){var t,n;return[(t=ed||1,n=e.hoverStartRow,z<=e.hoverEndRow&&z+t-1>=n),e.onHover]}),ep=(0,s.Z)(ef,2),eh=ep[0],em=ep[1],eg=(0,I.zX)(function(e){var t;T&&em(z,z+ed-1),null==Y||null===(t=Y.onMouseEnter)||void 0===t||t.call(Y,e)}),ev=(0,I.zX)(function(e){var t;T&&em(-1,-1),null==Y||null===(t=Y.onMouseLeave)||void 0===t||t.call(Y,e)});if(0===eu||0===ed)return null;var ey=null!==(f=Y.title)&&void 0!==f?f:R({rowType:B,ellipsis:y,children:ea}),eb=_()(J,w,(p={},(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)(p,"".concat(J,"-fix-left"),es&&et),"".concat(J,"-fix-left-first"),U&&et),"".concat(J,"-fix-left-last"),K&&et),"".concat(J,"-fix-left-all"),K&&en&&et),"".concat(J,"-fix-right"),ec&&et),"".concat(J,"-fix-right-first"),$&&et),"".concat(J,"-fix-right-last"),V&&et),"".concat(J,"-ellipsis"),y),"".concat(J,"-with-append"),X),"".concat(J,"-fix-sticky"),(es||ec)&&Q&&et),(0,C.Z)(p,"".concat(J,"-row-hover"),!ei&&eh)),Y.className,null==ei?void 0:ei.className),ex={};j&&(ex.textAlign=j);var ew=(0,O.Z)((0,O.Z)((0,O.Z)((0,O.Z)({},el),Y.style),ex),null==ei?void 0:ei.style),ek=ea;return"object"!==(0,E.Z)(ek)||Array.isArray(ek)||a.isValidElement(ek)||(ek=null),y&&(K||$)&&(ek=a.createElement("span",{className:"".concat(J,"-content")},ek)),a.createElement(g,(0,m.Z)({},ei,Y,{className:eb,style:ew,title:ey,scope:b,onMouseEnter:eg,onMouseLeave:ev,colSpan:1!==eu?eu:null,rowSpan:1!==ed?ed:null}),X,ek)});function L(e,t,n,r,o,a){var i,l,s=n[e]||{},c=n[t]||{};"left"===s.fixed?i=r.left["rtl"===o?t:e]:"right"===c.fixed&&(l=r.right["rtl"===o?e:t]);var u=!1,d=!1,f=!1,p=!1,h=n[t+1],m=n[e-1],g=!(null!=a&&a.children);return"rtl"===o?void 0!==i?p=!(m&&"left"===m.fixed)&&g:void 0!==l&&(f=!(h&&"right"===h.fixed)&&g):void 0!==i?u=!(h&&"left"===h.fixed)&&g:void 0!==l&&(d=!(m&&"right"===m.fixed)&&g),{fixLeft:i,fixRight:l,lastFixLeft:u,firstFixRight:d,lastFixRight:f,firstFixLeft:p,isSticky:r.isSticky}}var Z=a.createContext({}),z=n(6989),B=["children"];function F(e){return e.children}F.Row=function(e){var t=e.children,n=(0,z.Z)(e,B);return a.createElement("tr",n,t)},F.Cell=function(e){var t=e.className,n=e.index,r=e.children,o=e.colSpan,i=void 0===o?1:o,l=e.rowSpan,s=e.align,c=h(S,["prefixCls","direction"]),u=c.prefixCls,d=c.direction,f=a.useContext(Z),p=f.scrollColumnIndex,g=f.stickyOffsets,v=f.flattenColumns,y=f.columns,b=n+i-1+1===p?i+1:i,x=L(n,n+b-1,v,g,d,null==y?void 0:y[n]);return a.createElement(D,(0,m.Z)({className:t,index:n,component:"td",prefixCls:u,record:null,dataIndex:null,align:s,colSpan:b,rowSpan:l,render:function(){return r}},x))};var H=w(function(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,o=e.columns,i=h(S,"prefixCls"),l=r.length-1,s=r[l],c=a.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:null!=s&&s.scrollbar?l:null,columns:o}},[s,r,l,n,o]);return a.createElement(Z.Provider,{value:c},a.createElement("tfoot",{className:"".concat(i,"-summary")},t))}),q=n(31474),W=n(2857),U=n(10281),K=n(3208),$=n(18242);function V(e,t,n,r){return a.useMemo(function(){if(null!=n&&n.size){for(var o=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,r,o,a,i,l){t.push({record:n,indent:r,index:l});var s=i(n),c=null==a?void 0:a.has(s);if(n&&Array.isArray(n[o])&&c)for(var u=0;u<n[o].length;u+=1)e(t,n[o][u],r+1,o,a,i,u)}(o,e[a],0,t,n,r,a);return o}return null==e?void 0:e.map(function(e,t){return{record:e,indent:0,index:t}})},[e,t,n,r])}function X(e,t,n,r){var o,a=h(S,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),i=a.flattenColumns,l=a.expandableType,s=a.expandedKeys,c=a.childrenColumnName,u=a.onTriggerExpand,d=a.rowExpandable,f=a.onRow,p=a.expandRowByClick,m=a.rowClassName,g="nest"===l,v="row"===l&&(!d||d(e)),y=v||g,b=s&&s.has(t),x=c&&e&&e[c],w=(0,I.zX)(u),k=null==f?void 0:f(e,n),E=null==k?void 0:k.onClick;"string"==typeof m?o=m:"function"==typeof m&&(o=m(e,n,r));var C=M(i);return(0,O.Z)((0,O.Z)({},a),{},{columnsKey:C,nestExpandable:g,expanded:b,hasNestChildren:x,record:e,onTriggerExpand:w,rowSupportExpand:v,expandable:y,rowProps:(0,O.Z)((0,O.Z)({},k),{},{className:_()(o,null==k?void 0:k.className),onClick:function(t){p&&y&&u(e,t);for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];null==E||E.apply(void 0,[t].concat(r))}})})}var G=function(e){var t=e.prefixCls,n=e.children,r=e.component,o=e.cellComponent,i=e.className,l=e.expanded,s=e.colSpan,c=e.isEmpty,u=h(S,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),d=u.scrollbarSize,f=u.fixHeader,p=u.fixColumn,m=u.componentWidth,g=u.horizonScroll,v=n;return(c?g&&m:p)&&(v=a.createElement("div",{style:{width:m-(f?d:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(t,"-expanded-row-fixed")},v)),a.createElement(r,{className:i,style:{display:l?null:"none"}},a.createElement(D,{component:o,prefixCls:t,colSpan:s},v))};function Y(e,t,n,r,o){var i,l,s=e.record,c=e.prefixCls,u=e.columnsKey,d=e.fixedInfoList,f=e.expandIconColumnIndex,p=e.nestExpandable,h=e.indentSize,m=e.expandIcon,g=e.expanded,v=e.hasNestChildren,y=e.onTriggerExpand,b=u[n],x=d[n];return n===(f||0)&&p&&(i=a.createElement(a.Fragment,null,a.createElement("span",{style:{paddingLeft:"".concat(h*r,"px")},className:"".concat(c,"-row-indent indent-level-").concat(r)}),m({prefixCls:c,expanded:g,expandable:v,record:s,onExpand:y}))),t.onCell&&(l=t.onCell(s,o)),{key:b,fixedInfo:x,appendCellNode:i,additionalCellProps:l||{}}}function Q(e){var t,n=e.className,r=e.style,o=e.record,i=e.index,l=e.renderIndex,s=e.rowKey,c=e.indent,u=void 0===c?0:c,d=e.rowComponent,f=e.cellComponent,p=e.scopeCellComponent,h=X(o,s,i,u),g=h.prefixCls,v=h.flattenColumns,y=h.expandedRowClassName,b=h.expandedRowRender,x=h.rowProps,w=h.expanded,k=h.rowSupportExpand,S=a.useRef(!1);S.current||(S.current=w);var E=a.createElement(d,(0,m.Z)({},x,{"data-row-key":s,className:_()(n,"".concat(g,"-row"),"".concat(g,"-row-level-").concat(u),null==x?void 0:x.className),style:(0,O.Z)((0,O.Z)({},r),null==x?void 0:x.style)}),v.map(function(e,t){var n=e.render,r=e.dataIndex,s=e.className,c=Y(h,e,t,u,i),d=c.key,v=c.fixedInfo,y=c.appendCellNode,b=c.additionalCellProps;return a.createElement(D,(0,m.Z)({className:s,ellipsis:e.ellipsis,align:e.align,scope:e.rowScope,component:e.rowScope?p:f,prefixCls:g,key:d,record:o,index:i,renderIndex:l,dataIndex:r,render:n,shouldCellUpdate:e.shouldCellUpdate},v,{appendNode:y,additionalProps:b}))}));if(k&&(S.current||w)){var C=b(o,i,u+1,w),j=y&&y(o,i,u);t=a.createElement(G,{expanded:w,className:_()("".concat(g,"-expanded-row"),"".concat(g,"-expanded-row-level-").concat(u+1),j),prefixCls:g,component:d,cellComponent:f,colSpan:v.length,isEmpty:!1},C)}return a.createElement(a.Fragment,null,E,t)}Q.displayName="BodyRow";var J=w(Q);function ee(e){var t=e.columnKey,n=e.onColumnResize,r=a.useRef();return a.useEffect(function(){r.current&&n(t,r.current.offsetWidth)},[]),a.createElement(q.Z,{data:t},a.createElement("td",{ref:r,style:{padding:0,border:0,height:0}},a.createElement("div",{style:{height:0,overflow:"hidden"}},"\xa0")))}function et(e){var t=e.prefixCls,n=e.columnsKey,r=e.onColumnResize;return a.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),style:{height:0,fontSize:0}},a.createElement(q.Z.Collection,{onBatchResize:function(e){e.forEach(function(e){r(e.data,e.size.offsetWidth)})}},n.map(function(e){return a.createElement(ee,{key:e,columnKey:e,onColumnResize:r})})))}function en(e){var t,n=e.data,r=e.measureColumnWidth,o=h(S,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),i=o.prefixCls,l=o.getComponent,s=o.onColumnResize,c=o.flattenColumns,u=o.getRowKey,d=o.expandedKeys,f=o.childrenColumnName,p=o.emptyNode,m=V(n,f,d,u),g=a.useRef({renderWithProps:!1}),v=l(["body","wrapper"],"tbody"),y=l(["body","row"],"tr"),b=l(["body","cell"],"td"),x=l(["body","cell"],"th");t=n.length?m.map(function(e,t){var n=e.record,r=e.indent,o=e.index,i=u(n,t);return a.createElement(J,{key:i,rowKey:i,record:n,index:t,renderIndex:o,rowComponent:y,cellComponent:b,scopeCellComponent:x,getRowKey:u,indent:r})}):a.createElement(G,{expanded:!0,className:"".concat(i,"-placeholder"),prefixCls:i,component:y,cellComponent:b,colSpan:c.length,isEmpty:!0},p);var w=M(c);return a.createElement(A.Provider,{value:g.current},a.createElement(v,{className:"".concat(i,"-tbody")},r&&a.createElement(et,{prefixCls:i,columnsKey:w,onColumnResize:s}),t))}en.displayName="Body";var er=w(en),eo=["expandable"],ea="RC_TABLE_INTERNAL_COL_DEFINE",ei=["columnType"],el=function(e){for(var t=e.colWidths,n=e.columns,r=e.columCount,o=[],i=r||n.length,l=!1,s=i-1;s>=0;s-=1){var c=t[s],u=n&&n[s],d=u&&u[ea];if(c||d||l){var f=d||{},p=(f.columnType,(0,z.Z)(f,ei));o.unshift(a.createElement("col",(0,m.Z)({key:s,style:{width:c}},p))),l=!0}}return a.createElement("colgroup",null,o)},es=n(83145),ec=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"],eu=a.forwardRef(function(e,t){var n=e.className,r=e.noData,o=e.columns,i=e.flattenColumns,l=e.colWidths,s=e.columCount,c=e.stickyOffsets,u=e.direction,d=e.fixHeader,f=e.stickyTopOffset,p=e.stickyBottomOffset,m=e.stickyClassName,v=e.onScroll,y=e.maxContentScroll,b=e.children,x=(0,z.Z)(e,ec),w=h(S,["prefixCls","scrollbarSize","isSticky"]),k=w.prefixCls,E=w.scrollbarSize,j=w.isSticky,P=j&&!d?0:E,N=a.useRef(null),T=a.useCallback(function(e){(0,g.mH)(t,e),(0,g.mH)(N,e)},[]);a.useEffect(function(){var e;function t(e){var t=e.currentTarget,n=e.deltaX;n&&(v({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}return null===(e=N.current)||void 0===e||e.addEventListener("wheel",t),function(){var e;null===(e=N.current)||void 0===e||e.removeEventListener("wheel",t)}},[]);var A=a.useMemo(function(){return i.every(function(e){return e.width})},[i]),M=i[i.length-1],I={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(k,"-cell-scrollbar")}}},R=(0,a.useMemo)(function(){return P?[].concat((0,es.Z)(o),[I]):o},[P,o]),D=(0,a.useMemo)(function(){return P?[].concat((0,es.Z)(i),[I]):i},[P,i]),L=(0,a.useMemo)(function(){var e=c.right,t=c.left;return(0,O.Z)((0,O.Z)({},c),{},{left:"rtl"===u?[].concat((0,es.Z)(t.map(function(e){return e+P})),[0]):t,right:"rtl"===u?e:[].concat((0,es.Z)(e.map(function(e){return e+P})),[0]),isSticky:j})},[P,c,j]),Z=(0,a.useMemo)(function(){for(var e=[],t=0;t<s;t+=1){var n=l[t];if(void 0===n)return null;e[t]=n}return e},[l.join("_"),s]);return a.createElement("div",{style:(0,O.Z)({overflow:"hidden"},j?{top:f,bottom:p}:{}),ref:T,className:_()(n,(0,C.Z)({},m,!!m))},a.createElement("table",{style:{tableLayout:"fixed",visibility:r||Z?null:"hidden"}},(!r||!y||A)&&a.createElement(el,{colWidths:Z?[].concat((0,es.Z)(Z),[P]):[],columCount:s+1,columns:D}),b((0,O.Z)((0,O.Z)({},x),{},{stickyOffsets:L,columns:R,flattenColumns:D}))))});eu.displayName="FixedHolder";var ed=a.memo(eu);function ef(e){var t,n=e.cells,r=e.stickyOffsets,o=e.flattenColumns,i=e.rowComponent,l=e.cellComponent,s=e.tdCellComponent,c=e.onHeaderRow,u=e.index,d=h(S,["prefixCls","direction"]),f=d.prefixCls,p=d.direction;c&&(t=c(n.map(function(e){return e.column}),u));var g=M(n.map(function(e){return e.column}));return a.createElement(i,t,n.map(function(e,t){var n,i=e.column,c=L(e.colStart,e.colEnd,o,r,p,i);return i&&i.onHeaderCell&&(n=e.column.onHeaderCell(i)),a.createElement(D,(0,m.Z)({},e,{scope:i.title?e.colSpan>1?"colgroup":"col":null,ellipsis:i.ellipsis,align:i.align,component:i.title?l:s,prefixCls:f,key:g[t]},c,{additionalProps:n,rowType:"header"}))}))}ef.displayName="HeaderRow";var ep=w(function(e){var t=e.stickyOffsets,n=e.columns,r=e.flattenColumns,o=e.onHeaderRow,i=h(S,["prefixCls","getComponent"]),l=i.prefixCls,s=i.getComponent,c=a.useMemo(function(){return function(e){var t=[];!function e(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[o]=t[o]||[];var a=r;return n.filter(Boolean).map(function(n){var r={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},i=1,l=n.children;return l&&l.length>0&&(i=e(l,a,o+1).reduce(function(e,t){return e+t},0),r.hasSubColumns=!0),"colSpan"in n&&(i=n.colSpan),"rowSpan"in n&&(r.rowSpan=n.rowSpan),r.colSpan=i,r.colEnd=r.colStart+i-1,t[o].push(r),a+=i,i})}(e,0);for(var n=t.length,r=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},o=0;o<n;o+=1)r(o);return t}(n)},[n]),u=s(["header","wrapper"],"thead"),d=s(["header","row"],"tr"),f=s(["header","cell"],"th"),p=s(["header","cell"],"td");return a.createElement(u,{className:"".concat(l,"-thead")},c.map(function(e,n){return a.createElement(ef,{key:n,flattenColumns:r,cells:e,stickyOffsets:t,rowComponent:d,cellComponent:f,tdCellComponent:p,onHeaderRow:o,index:n})}))}),eh=n(45287);function em(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var eg=["children"],ev=["fixed"];function ey(e){return(0,eh.Z)(e).filter(function(e){return a.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,r=n.children,o=(0,z.Z)(n,eg),a=(0,O.Z)({key:t},o);return r&&(a.children=ey(r)),a})}function eb(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,E.Z)(e)}).reduce(function(e,n,r){var o=n.fixed,a=!0===o?"left":o,i="".concat(t,"-").concat(r),l=n.children;return l&&l.length>0?[].concat((0,es.Z)(e),(0,es.Z)(eb(l,i).map(function(e){return(0,O.Z)({fixed:a},e)}))):[].concat((0,es.Z)(e),[(0,O.Z)((0,O.Z)({key:i},n),{},{fixed:a})])},[])}var ex=function(e,t){var n=e.prefixCls,r=e.columns,o=e.children,l=e.expandable,c=e.expandedKeys,u=e.columnTitle,d=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,h=e.rowExpandable,m=e.expandIconColumnIndex,g=e.direction,v=e.expandRowByClick,y=e.columnWidth,b=e.fixed,x=e.scrollWidth,w=e.clientWidth,k=a.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,E.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,O.Z)((0,O.Z)({},t),{},{children:e(n)}):t})}((r||ey(o)||[]).slice())},[r,o]),S=a.useMemo(function(){if(l){var e,t=k.slice();if(!t.includes(i)){var r=m||0;r>=0&&t.splice(r,0,i)}var o=t.indexOf(i);t=t.filter(function(e,t){return e!==i||t===o});var s=k[o];e=("left"===b||b)&&!m?"left":("right"===b||b)&&m===k.length?"right":s?s.fixed:null;var g=(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},ea,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",u),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",y),"render",function(e,t,r){var o=d(t,r),i=p({prefixCls:n,expanded:c.has(o),expandable:!h||h(t),record:t,onExpand:f});return v?a.createElement("span",{onClick:function(e){return e.stopPropagation()}},i):i});return t.map(function(e){return e===i?g:e})}return k.filter(function(e){return e!==i})},[l,k,d,c,p,g]),j=a.useMemo(function(){var e=S;return t&&(e=t(e)),e.length||(e=[{render:function(){return null}}]),e},[t,S,g]),_=a.useMemo(function(){return"rtl"===g?eb(j).map(function(e){var t=e.fixed,n=(0,z.Z)(e,ev),r=t;return"left"===t?r="right":"right"===t&&(r="left"),(0,O.Z)({fixed:r},n)}):eb(j)},[j,g,x]),P=a.useMemo(function(){if(x&&x>0){var e=0,t=0;_.forEach(function(n){var r=em(x,n.width);r?e+=r:t+=1});var n=Math.max(x,w),r=Math.max(n-e,t),o=t,a=r/t,i=0,l=_.map(function(e){var t=(0,O.Z)({},e),n=em(x,t.width);if(n)t.width=n;else{var l=Math.floor(a);t.width=1===o?r:l,r-=l,o-=1}return i+=t.width,t});if(i<n){var s=n/i;r=n,l.forEach(function(e,t){var n=Math.floor(e.width*s);e.width=t===l.length-1?r:n,r-=n})}return[l,Math.max(i,n)]}return[_,x]},[_,x,w]),N=(0,s.Z)(P,2);return[j,N[0],N[1]]};function ew(e){var t=e.prefixCls,n=e.record,r=e.onExpand,o=e.expanded,i=e.expandable,l="".concat(t,"-row-expand-icon");return i?a.createElement("span",{className:_()(l,(0,C.Z)((0,C.Z)({},"".concat(t,"-row-expanded"),o),"".concat(t,"-row-collapsed"),!o)),onClick:function(e){r(n,e),e.stopPropagation()}}):a.createElement("span",{className:_()(l,"".concat(t,"-row-spaced"))})}function ek(e){var t=(0,a.useRef)(e),n=(0,a.useState)({}),r=(0,s.Z)(n,2)[1],o=(0,a.useRef)(null),i=(0,a.useRef)([]);return(0,a.useEffect)(function(){return function(){o.current=null}},[]),[t.current,function(e){i.current.push(e);var n=Promise.resolve();o.current=n,n.then(function(){if(o.current===n){var e=i.current,a=t.current;i.current=[],e.forEach(function(e){t.current=e(t.current)}),o.current=null,a!==t.current&&r({})}})}]}var eS=(0,n(94981).Z)()?window:null,eE=function(e){var t=e.className,n=e.children;return a.createElement("div",{className:t},n)};function eO(e,t,n,r){var o=f.unstable_batchedUpdates?function(e){f.unstable_batchedUpdates(n,e)}:n;return null!=e&&e.addEventListener&&e.addEventListener(t,o,r),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,o,r)}}}function eC(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var ej=a.forwardRef(function(e,t){var n,r,o=e.scrollBodyRef,i=e.onScroll,l=e.offsetScroll,c=e.container,u=h(S,"prefixCls"),d=(null===(n=o.current)||void 0===n?void 0:n.scrollWidth)||0,f=(null===(r=o.current)||void 0===r?void 0:r.clientWidth)||0,p=d&&f/d*f,m=a.useRef(),g=ek({scrollLeft:0,isHiddenScrollBar:!1}),v=(0,s.Z)(g,2),y=v[0],b=v[1],x=a.useRef({delta:0,x:0}),w=a.useState(!1),k=(0,s.Z)(w,2),E=k[0],j=k[1],P=function(){j(!1)},N=function(e){var t,n=(e||(null===(t=window)||void 0===t?void 0:t.event)).buttons;if(!E||0===n){E&&j(!1);return}var r=x.current.x+e.pageX-x.current.x-x.current.delta;r<=0&&(r=0),r+p>=f&&(r=f-p),i({scrollLeft:r/f*(d+2)}),x.current.x=e.pageX},T=function(){if(o.current){var e=eC(o.current).top,t=e+o.current.offsetHeight,n=c===window?document.documentElement.scrollTop+window.innerHeight:eC(c).top+c.clientHeight;t-(0,K.Z)()<=n||e>=n-l?b(function(e){return(0,O.Z)((0,O.Z)({},e),{},{isHiddenScrollBar:!0})}):b(function(e){return(0,O.Z)((0,O.Z)({},e),{},{isHiddenScrollBar:!1})})}},A=function(e){b(function(t){return(0,O.Z)((0,O.Z)({},t),{},{scrollLeft:e/d*f||0})})};return(a.useImperativeHandle(t,function(){return{setScrollLeft:A}}),a.useEffect(function(){var e=eO(document.body,"mouseup",P,!1),t=eO(document.body,"mousemove",N,!1);return T(),function(){e.remove(),t.remove()}},[p,E]),a.useEffect(function(){var e=eO(c,"scroll",T,!1),t=eO(window,"resize",T,!1);return function(){e.remove(),t.remove()}},[c]),a.useEffect(function(){y.isHiddenScrollBar||b(function(e){var t=o.current;return t?(0,O.Z)((0,O.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[y.isHiddenScrollBar]),d<=f||!p||y.isHiddenScrollBar)?null:a.createElement("div",{style:{height:(0,K.Z)(),width:f,bottom:l},className:"".concat(u,"-sticky-scroll")},a.createElement("div",{onMouseDown:function(e){e.persist(),x.current.delta=e.pageX-y.scrollLeft,x.current.x=0,j(!0),e.preventDefault()},ref:m,className:_()("".concat(u,"-sticky-scroll-bar"),(0,C.Z)({},"".concat(u,"-sticky-scroll-bar-active"),E)),style:{width:"".concat(p,"px"),transform:"translate3d(".concat(y.scrollLeft,"px, 0, 0)")}}))}),e_="rc-table",eP=[],eN={};function eT(){return"No Data"}var eA=a.forwardRef(function(e,t){var n,r=(0,O.Z)({rowKey:"key",prefixCls:e_,emptyText:eT},e),o=r.prefixCls,i=r.className,u=r.rowClassName,f=r.style,p=r.data,h=r.rowKey,g=r.scroll,v=r.tableLayout,y=r.direction,b=r.title,x=r.footer,w=r.summary,k=r.caption,j=r.id,T=r.showHeader,A=r.components,I=r.emptyText,R=r.onRow,D=r.onHeaderRow,Z=r.internalHooks,B=r.transformColumns,V=r.internalRefs,X=r.tailor,G=r.getContainerWidth,Y=r.sticky,Q=p||eP,J=!!Q.length,ee=Z===l,et=a.useCallback(function(e,t){return(0,N.Z)(A,e)||t},[A]),en=a.useMemo(function(){return"function"==typeof h?h:function(e){return e&&e[h]}},[h]),ea=et(["body"]),ei=(tH=a.useState(-1),tW=(tq=(0,s.Z)(tH,2))[0],tU=tq[1],tK=a.useState(-1),tV=(t$=(0,s.Z)(tK,2))[0],tX=t$[1],[tW,tV,a.useCallback(function(e,t){tU(e),tX(t)},[])]),ec=(0,s.Z)(ei,3),eu=ec[0],ef=ec[1],eh=ec[2],em=(tJ=(tY=r.expandable,tQ=(0,z.Z)(r,eo),!1===(tG="expandable"in r?(0,O.Z)((0,O.Z)({},tQ),tY):tQ).showExpandColumn&&(tG.expandIconColumnIndex=-1),tG).expandIcon,t0=tG.expandedRowKeys,t1=tG.defaultExpandedRowKeys,t2=tG.defaultExpandAllRows,t6=tG.expandedRowRender,t4=tG.onExpand,t3=tG.onExpandedRowsChange,t5=tG.childrenColumnName||"children",t8=a.useMemo(function(){return t6?"row":!!(r.expandable&&r.internalHooks===l&&r.expandable.__PARENT_RENDER_ICON__||Q.some(function(e){return e&&"object"===(0,E.Z)(e)&&e[t5]}))&&"nest"},[!!t6,Q]),t7=a.useState(function(){if(t1)return t1;if(t2){var e;return e=[],function t(n){(n||[]).forEach(function(n,r){e.push(en(n,r)),t(n[t5])})}(Q),e}return[]}),ne=(t9=(0,s.Z)(t7,2))[0],nt=t9[1],nn=a.useMemo(function(){return new Set(t0||ne||[])},[t0,ne]),nr=a.useCallback(function(e){var t,n=en(e,Q.indexOf(e)),r=nn.has(n);r?(nn.delete(n),t=(0,es.Z)(nn)):t=[].concat((0,es.Z)(nn),[n]),nt(t),t4&&t4(!r,e),t3&&t3(t)},[en,nn,Q,t4,t3]),[tG,t8,nn,tJ||ew,t5,nr]),eg=(0,s.Z)(em,6),ev=eg[0],ey=eg[1],eb=eg[2],eO=eg[3],eC=eg[4],eA=eg[5],eM=null==g?void 0:g.x,eI=a.useState(0),eR=(0,s.Z)(eI,2),eD=eR[0],eL=eR[1],eZ=ex((0,O.Z)((0,O.Z)((0,O.Z)({},r),ev),{},{expandable:!!ev.expandedRowRender,columnTitle:ev.columnTitle,expandedKeys:eb,getRowKey:en,onTriggerExpand:eA,expandIcon:eO,expandIconColumnIndex:ev.expandIconColumnIndex,direction:y,scrollWidth:ee&&X&&"number"==typeof eM?eM:null,clientWidth:eD}),ee?B:null),ez=(0,s.Z)(eZ,3),eB=ez[0],eF=ez[1],eH=ez[2],eq=null!=eH?eH:eM,eW=a.useMemo(function(){return{columns:eB,flattenColumns:eF}},[eB,eF]),eU=a.useRef(),eK=a.useRef(),e$=a.useRef(),eV=a.useRef();a.useImperativeHandle(t,function(){return{nativeElement:eU.current,scrollTo:function(e){var t;if(e$.current instanceof HTMLElement){var n=e.index,r=e.top,o=e.key;if(r)null===(a=e$.current)||void 0===a||a.scrollTo({top:r});else{var a,i,l=null!=o?o:en(Q[n]);null===(i=e$.current.querySelector('[data-row-key="'.concat(l,'"]')))||void 0===i||i.scrollIntoView()}}else null!==(t=e$.current)&&void 0!==t&&t.scrollTo&&e$.current.scrollTo(e)}}});var eX=a.useRef(),eG=a.useState(!1),eY=(0,s.Z)(eG,2),eQ=eY[0],eJ=eY[1],e0=a.useState(!1),e1=(0,s.Z)(e0,2),e2=e1[0],e6=e1[1],e4=ek(new Map),e3=(0,s.Z)(e4,2),e5=e3[0],e8=e3[1],e7=M(eF).map(function(e){return e5.get(e)}),e9=a.useMemo(function(){return e7},[e7.join("_")]),te=(no=eF.length,(0,a.useMemo)(function(){for(var e=[],t=[],n=0,r=0,o=0;o<no;o+=1)if("rtl"===y){t[o]=r,r+=e9[o]||0;var a=no-o-1;e[a]=n,n+=e9[a]||0}else{e[o]=n,n+=e9[o]||0;var i=no-o-1;t[i]=r,r+=e9[i]||0}return{left:e,right:t}},[e9,no,y])),tt=g&&null!=g.y,tn=g&&null!=eq||!!ev.fixed,tr=tn&&eF.some(function(e){return e.fixed}),to=a.useRef(),ta=(nl=void 0===(ni=(na="object"===(0,E.Z)(Y)?Y:{}).offsetHeader)?0:ni,nc=void 0===(ns=na.offsetSummary)?0:ns,nd=void 0===(nu=na.offsetScroll)?0:nu,np=(void 0===(nf=na.getContainer)?function(){return eS}:nf)()||eS,a.useMemo(function(){var e=!!Y;return{isSticky:e,stickyClassName:e?"".concat(o,"-sticky-holder"):"",offsetHeader:nl,offsetSummary:nc,offsetScroll:nd,container:np}},[nd,nl,nc,o,np])),ti=ta.isSticky,tl=ta.offsetHeader,ts=ta.offsetSummary,tc=ta.offsetScroll,tu=ta.stickyClassName,td=ta.container,tf=a.useMemo(function(){return null==w?void 0:w(Q)},[w,Q]),tp=(tt||ti)&&a.isValidElement(tf)&&tf.type===F&&tf.props.fixed;tt&&(nm={overflowY:"scroll",maxHeight:g.y}),tn&&(nh={overflowX:"auto"},tt||(nm={overflowY:"hidden"}),ng={width:!0===eq?"auto":eq,minWidth:"100%"});var th=a.useCallback(function(e,t){(0,W.Z)(eU.current)&&e8(function(n){if(n.get(e)!==t){var r=new Map(n);return r.set(e,t),r}return n})},[]),tm=function(e){var t=(0,a.useRef)(null),n=(0,a.useRef)();function r(){window.clearTimeout(n.current)}return(0,a.useEffect)(function(){return r},[]),[function(e){t.current=e,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)},function(){return t.current}]}(0),tg=(0,s.Z)(tm,2),tv=tg[0],ty=tg[1];function tb(e,t){t&&("function"==typeof t?t(e):t.scrollLeft!==e&&(t.scrollLeft=e,t.scrollLeft!==e&&setTimeout(function(){t.scrollLeft=e},0)))}var tx=(0,c.Z)(function(e){var t,n=e.currentTarget,r=e.scrollLeft,o="rtl"===y,a="number"==typeof r?r:n.scrollLeft,i=n||eN;ty()&&ty()!==i||(tv(i),tb(a,eK.current),tb(a,e$.current),tb(a,eX.current),tb(a,null===(t=to.current)||void 0===t?void 0:t.setScrollLeft));var l=n||eK.current;if(l){var s=l.scrollWidth,c=l.clientWidth;if(s===c){eJ(!1),e6(!1);return}o?(eJ(-a<s-c),e6(-a>0)):(eJ(a>0),e6(a<s-c))}}),tw=function(){tn&&e$.current?tx({currentTarget:e$.current}):(eJ(!1),e6(!1))},tk=a.useRef(!1);a.useEffect(function(){tk.current&&tw()},[tn,p,eB.length]),a.useEffect(function(){tk.current=!0},[]);var tS=a.useState(0),tE=(0,s.Z)(tS,2),tO=tE[0],tC=tE[1],tj=a.useState(!0),t_=(0,s.Z)(tj,2),tP=t_[0],tN=t_[1];a.useEffect(function(){X&&ee||(e$.current instanceof Element?tC((0,K.o)(e$.current).width):tC((0,K.o)(eV.current).width)),tN((0,U.G)("position","sticky"))},[]),a.useEffect(function(){ee&&V&&(V.body.current=e$.current)});var tT=a.useCallback(function(e){return a.createElement(a.Fragment,null,a.createElement(ep,e),"top"===tp&&a.createElement(H,e,tf))},[tp,tf]),tA=a.useCallback(function(e){return a.createElement(H,e,tf)},[tf]),tM=et(["table"],"table"),tI=a.useMemo(function(){return v||(tr?"max-content"===eq?"auto":"fixed":tt||ti||eF.some(function(e){return e.ellipsis})?"fixed":"auto")},[tt,tr,eF,v,ti]),tR={colWidths:e9,columCount:eF.length,stickyOffsets:te,onHeaderRow:D,fixHeader:tt,scroll:g},tD=a.useMemo(function(){return J?null:"function"==typeof I?I():I},[J,I]),tL=a.createElement(er,{data:Q,measureColumnWidth:tt||tn||ti}),tZ=a.createElement(el,{colWidths:eF.map(function(e){return e.width}),columns:eF}),tz=null!=k?a.createElement("caption",{className:"".concat(o,"-caption")},k):void 0,tB=(0,$.Z)(r,{data:!0}),tF=(0,$.Z)(r,{aria:!0});if(tt||ti){"function"==typeof ea?(ny=ea(Q,{scrollbarSize:tO,ref:e$,onScroll:tx}),tR.colWidths=eF.map(function(e,t){var n=e.width,r=t===eF.length-1?n-tO:n;return"number"!=typeof r||Number.isNaN(r)?0:r})):ny=a.createElement("div",{style:(0,O.Z)((0,O.Z)({},nh),nm),onScroll:tx,ref:e$,className:_()("".concat(o,"-body"))},a.createElement(tM,(0,m.Z)({style:(0,O.Z)((0,O.Z)({},ng),{},{tableLayout:tI})},tF),tz,tZ,tL,!tp&&tf&&a.createElement(H,{stickyOffsets:te,flattenColumns:eF,columns:eB},tf)));var tH,tq,tW,tU,tK,t$,tV,tX,tG,tY,tQ,tJ,t0,t1,t2,t6,t4,t3,t5,t8,t7,t9,ne,nt,nn,nr,no,na,ni,nl,ns,nc,nu,nd,nf,np,nh,nm,ng,nv,ny,nb=(0,O.Z)((0,O.Z)((0,O.Z)({noData:!Q.length,maxContentScroll:tn&&"max-content"===eq},tR),eW),{},{direction:y,stickyClassName:tu,onScroll:tx});nv=a.createElement(a.Fragment,null,!1!==T&&a.createElement(ed,(0,m.Z)({},nb,{stickyTopOffset:tl,className:"".concat(o,"-header"),ref:eK}),tT),ny,tp&&"top"!==tp&&a.createElement(ed,(0,m.Z)({},nb,{stickyBottomOffset:ts,className:"".concat(o,"-summary"),ref:eX}),tA),ti&&e$.current&&e$.current instanceof Element&&a.createElement(ej,{ref:to,offsetScroll:tc,scrollBodyRef:e$,onScroll:tx,container:td}))}else nv=a.createElement("div",{style:(0,O.Z)((0,O.Z)({},nh),nm),className:_()("".concat(o,"-content")),onScroll:tx,ref:e$},a.createElement(tM,(0,m.Z)({style:(0,O.Z)((0,O.Z)({},ng),{},{tableLayout:tI})},tF),tz,tZ,!1!==T&&a.createElement(ep,(0,m.Z)({},tR,eW)),tL,tf&&a.createElement(H,{stickyOffsets:te,flattenColumns:eF,columns:eB},tf)));var nx=a.createElement("div",(0,m.Z)({className:_()(o,i,(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},"".concat(o,"-rtl"),"rtl"===y),"".concat(o,"-ping-left"),eQ),"".concat(o,"-ping-right"),e2),"".concat(o,"-layout-fixed"),"fixed"===v),"".concat(o,"-fixed-header"),tt),"".concat(o,"-fixed-column"),tr),"".concat(o,"-scroll-horizontal"),tn),"".concat(o,"-has-fix-left"),eF[0]&&eF[0].fixed),"".concat(o,"-has-fix-right"),eF[eF.length-1]&&"right"===eF[eF.length-1].fixed)),style:f,id:j,ref:eU},tB),b&&a.createElement(eE,{className:"".concat(o,"-title")},b(Q)),a.createElement("div",{ref:eV,className:"".concat(o,"-container")},nv),x&&a.createElement(eE,{className:"".concat(o,"-footer")},x(Q)));tn&&(nx=a.createElement(q.Z,{onResize:function(e){var t=e.width,n=eU.current?eU.current.offsetWidth:t;ee&&G&&eU.current&&(n=G(eU.current,n)||n),n!==eD&&(tw(),eL(n))}},nx));var nw=(n=eF.map(function(e,t){return L(t,t,eF,te,y,null==eB?void 0:eB[t])}),(0,P.Z)(function(){return n},[n],function(e,t){return!(0,d.Z)(e,t)})),nk=a.useMemo(function(){return{scrollX:eq,prefixCls:o,getComponent:et,scrollbarSize:tO,direction:y,fixedInfoList:nw,isSticky:ti,supportSticky:tP,componentWidth:eD,fixHeader:tt,fixColumn:tr,horizonScroll:tn,tableLayout:tI,rowClassName:u,expandedRowClassName:ev.expandedRowClassName,expandIcon:eO,expandableType:ey,expandRowByClick:ev.expandRowByClick,expandedRowRender:ev.expandedRowRender,onTriggerExpand:eA,expandIconColumnIndex:ev.expandIconColumnIndex,indentSize:ev.indentSize,allColumnsFixedLeft:eF.every(function(e){return"left"===e.fixed}),emptyNode:tD,columns:eB,flattenColumns:eF,onColumnResize:th,hoverStartRow:eu,hoverEndRow:ef,onHover:eh,rowExpandable:ev.rowExpandable,onRow:R,getRowKey:en,expandedKeys:eb,childrenColumnName:eC}},[eq,o,et,tO,y,nw,ti,tP,eD,tt,tr,tn,tI,u,ev.expandedRowClassName,eO,ey,ev.expandRowByClick,ev.expandedRowRender,eA,ev.expandIconColumnIndex,ev.indentSize,tD,eB,eF,th,eu,ef,eh,ev.rowExpandable,R,en,eb,eC]);return a.createElement(S.Provider,{value:nk},nx)}),eM=x(eA,void 0);eM.EXPAND_COLUMN=i,eM.INTERNAL_HOOKS=l,eM.Column=function(e){return null},eM.ColumnGroup=function(e){return null},eM.Summary=F;var eI=n(48625),eR=p(null),eD=p(null),eL=function(e){var t,n=e.rowInfo,r=e.column,o=e.colIndex,i=e.indent,l=e.index,s=e.renderIndex,c=e.record,u=e.style,d=e.className,f=e.inverse,p=e.getHeight,g=r.render,v=r.dataIndex,y=r.className,b=r.width,x=h(eD,["columnsOffset"]).columnsOffset,w=Y(n,r,o,i,l),k=w.key,S=w.fixedInfo,E=w.appendCellNode,C=w.additionalCellProps,j=C.style,P=C.colSpan,N=void 0===P?1:P,T=C.rowSpan,A=void 0===T?1:T,M=x[(t=o-1)+(N||1)]-(x[t]||0),I=(0,O.Z)((0,O.Z)((0,O.Z)({},j),u),{},{flex:"0 0 ".concat(M,"px"),width:"".concat(M,"px"),marginRight:N>1?b-M:0,pointerEvents:"auto"}),R=a.useMemo(function(){return f?A<=1:0===N||0===A||A>1},[A,N,f]);R?I.visibility="hidden":f&&(I.height=null==p?void 0:p(A));var L={};return(0===A||0===N)&&(L.rowSpan=1,L.colSpan=1),a.createElement(D,(0,m.Z)({className:_()(y,d),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:"div",prefixCls:n.prefixCls,key:k,record:c,index:l,renderIndex:s,dataIndex:v,render:R?function(){return null}:g,shouldCellUpdate:r.shouldCellUpdate},S,{appendNode:E,additionalProps:(0,O.Z)((0,O.Z)({},C),{},{style:I},L)}))},eZ=["data","index","className","rowKey","style","extra","getHeight"],ez=w(a.forwardRef(function(e,t){var n,r=e.data,o=e.index,i=e.className,l=e.rowKey,s=e.style,c=e.extra,u=e.getHeight,d=(0,z.Z)(e,eZ),f=r.record,p=r.indent,g=r.index,v=h(S,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),y=v.scrollX,b=v.flattenColumns,x=v.prefixCls,w=v.fixColumn,k=v.componentWidth,E=X(f,l,o,p),j=E.rowSupportExpand,P=E.expanded,N=E.rowProps,T=E.expandedRowRender,A=E.expandedRowClassName;if(j&&P){var M=T(f,o,p+1,P),I=null==A?void 0:A(f,o,p),R={};w&&(R={style:(0,C.Z)({},"--virtual-width","".concat(k,"px"))});var L="".concat(x,"-expanded-row-cell");n=a.createElement("div",{className:_()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(p+1),I)},a.createElement(D,{component:"div",prefixCls:x,className:_()(L,(0,C.Z)({},"".concat(L,"-fixed"),w)),additionalProps:R},M))}var Z=(0,O.Z)((0,O.Z)({},s),{},{width:y});c&&(Z.position="absolute",Z.pointerEvents="none");var B=a.createElement("div",(0,m.Z)({},N,d,{ref:j?null:t,className:_()(i,"".concat(x,"-row"),null==N?void 0:N.className,(0,C.Z)({},"".concat(x,"-row-extra"),c)),style:(0,O.Z)((0,O.Z)({},Z),null==N?void 0:N.style)}),b.map(function(e,t){return a.createElement(eL,{key:t,rowInfo:E,column:e,colIndex:t,indent:p,index:o,renderIndex:g,record:f,inverse:c,getHeight:u})}));return j?a.createElement("div",{ref:t},B,n):B})),eB=w(a.forwardRef(function(e,t){var n,r=e.data,o=e.onScroll,i=h(S,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","emptyNode","scrollX"]),l=i.flattenColumns,c=i.onColumnResize,u=i.getRowKey,d=i.expandedKeys,f=i.prefixCls,p=i.childrenColumnName,g=i.emptyNode,v=i.scrollX,y=h(eR),b=y.sticky,x=y.scrollY,w=y.listItemHeight,k=a.useRef(),O=V(r,p,d,u),C=a.useMemo(function(){var e=0;return l.map(function(t){var n=t.width,r=t.key;return e+=n,[r,n,e]})},[l]),j=a.useMemo(function(){return C.map(function(e){return e[2]})},[C]);a.useEffect(function(){C.forEach(function(e){var t=(0,s.Z)(e,2);c(t[0],t[1])})},[C]),a.useImperativeHandle(t,function(){var e={scrollTo:function(e){var t;null===(t=k.current)||void 0===t||t.scrollTo(e)}};return Object.defineProperty(e,"scrollLeft",{get:function(){var e;return(null===(e=k.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=k.current)||void 0===t||t.scrollTo({left:e})}}),e});var P=function(e,t){var n=null===(o=O[t])||void 0===o?void 0:o.record,r=e.onCell;if(r){var o,a,i=r(n,t);return null!==(a=null==i?void 0:i.rowSpan)&&void 0!==a?a:1}return 1},N=a.useMemo(function(){return{columnsOffset:j}},[j]),T="".concat(f,"-tbody");if(O.length){var A={};b&&(A.position="sticky",A.bottom=0,"object"===(0,E.Z)(b)&&b.offsetScroll&&(A.bottom=b.offsetScroll)),n=a.createElement(eI.Z,{fullHeight:!1,ref:k,styles:{horizontalScrollBar:A},className:_()(T,"".concat(T,"-virtual")),height:x,itemHeight:w||24,data:O,itemKey:function(e){return u(e.record)},scrollWidth:v,onVirtualScroll:function(e){o({scrollLeft:e.x})},extraRender:function(e){var t=e.start,n=e.end,r=e.getSize,o=e.offsetY;if(n<0)return null;for(var i=l.filter(function(e){return 0===P(e,t)}),s=t,c=function(e){if(!(i=i.filter(function(t){return 0===P(t,e)})).length)return s=e,1},d=t;d>=0&&!c(d);d-=1);for(var f=l.filter(function(e){return 1!==P(e,n)}),p=n,h=function(e){if(!(f=f.filter(function(t){return 1!==P(t,e)})).length)return p=Math.max(e-1,n),1},m=n;m<O.length&&!h(m);m+=1);for(var g=[],v=function(e){if(!O[e])return 1;l.some(function(t){return P(t,e)>1})&&g.push(e)},y=s;y<=p;y+=1)if(v(y))continue;return g.map(function(e){var t=O[e],n=u(t.record,e),i=r(n);return a.createElement(ez,{key:e,data:t,rowKey:n,index:e,style:{top:-o+i.top},extra:!0,getHeight:function(t){var o=e+t-1,a=r(n,u(O[o].record,o));return a.bottom-a.top}})})}},function(e,t,n){var r=u(e.record,t);return a.createElement(ez,(0,m.Z)({data:e,rowKey:r,index:t},n))})}else n=a.createElement("div",{className:_()("".concat(f,"-placeholder"))},a.createElement(D,{component:"div",prefixCls:f},g));return a.createElement(eD.Provider,{value:N},n)})),eF=function(e,t){var n=t.ref,r=t.onScroll;return a.createElement(eB,{ref:n,data:e,onScroll:r})},eH=a.forwardRef(function(e,t){var n=e.columns,r=e.scroll,o=e.sticky,i=e.prefixCls,s=void 0===i?e_:i,c=e.className,u=e.listItemHeight,d=e.components,f=r||{},p=f.x,h=f.y;"number"!=typeof p&&(p=1),"number"!=typeof h&&(h=500);var g=a.useMemo(function(){return{sticky:o,scrollY:h,listItemHeight:u}},[o,h,u]);return a.createElement(eR.Provider,{value:g},a.createElement(eM,(0,m.Z)({},e,{className:_()(c,"".concat(s,"-virtual")),scroll:(0,O.Z)((0,O.Z)({},r),{},{x:p}),components:(0,O.Z)((0,O.Z)({},d),{},{body:eF}),columns:n,internalHooks:l,tailor:!0,ref:t})))});x(eH,void 0);var eq=n(70464),eW=n(76405),eU=n(25049),eK=n(63496),e$=n(15354),eV=n(15900),eX=a.createContext(null),eG=a.memo(function(e){for(var t,n=e.prefixCls,r=e.level,o=e.isStart,i=e.isEnd,l="".concat(n,"-indent-unit"),s=[],c=0;c<r;c+=1)s.push(a.createElement("span",{key:c,className:_()(l,(t={},(0,C.Z)(t,"".concat(l,"-start"),o[c]),(0,C.Z)(t,"".concat(l,"-end"),i[c]),t))}));return a.createElement("span",{"aria-hidden":"true",className:"".concat(n,"-indent")},s)}),eY=n(18694),eQ=["children"];function eJ(e,t){return"".concat(e,"-").concat(t)}function e0(e,t){return null!=e?e:t}function e1(e){var t=e||{},n=t.title,r=t._title,o=t.key,a=t.children,i=n||"title";return{title:i,_title:r||[i],key:o||"key",children:a||"children"}}function e2(e){return function e(t){return(0,eh.Z)(t).map(function(t){if(!(t&&t.type&&t.type.isTreeNode))return(0,T.ZP)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,r=t.props,o=r.children,a=(0,z.Z)(r,eQ),i=(0,O.Z)({key:n},a),l=e(o);return l.length&&(i.children=l),i}).filter(function(e){return e})}(e)}function e6(e,t,n){var r=e1(n),o=r._title,a=r.key,i=r.children,l=new Set(!0===t?[]:t),s=[];return!function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(c,u){for(var d,f=eJ(r?r.pos:"0",u),p=e0(c[a],f),h=0;h<o.length;h+=1){var m=o[h];if(void 0!==c[m]){d=c[m];break}}var g=(0,O.Z)((0,O.Z)({},(0,eY.Z)(c,[].concat((0,es.Z)(o),[a,i]))),{},{title:d,key:p,parent:r,pos:f,children:null,data:c,isStart:[].concat((0,es.Z)(r?r.isStart:[]),[0===u]),isEnd:[].concat((0,es.Z)(r?r.isEnd:[]),[u===n.length-1])});return s.push(g),!0===t||l.has(p)?g.children=e(c[i]||[],g):g.children=[],g})}(e),s}function e4(e){var t,n,r,o,a,i,l,s,c,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=d.initWrapper,p=d.processEntity,h=d.onProcessFinished,m=d.externalGetKey,g=d.childrenPropName,v=d.fieldNames,y=arguments.length>2?arguments[2]:void 0,b={},x={},w={posEntities:b,keyEntities:x};return f&&(w=f(w)||w),t=function(e){var t=e.node,n=e.index,r=e.pos,o=e.key,a=e.parentPos,i=e.level,l={node:t,nodes:e.nodes,index:n,key:o,pos:r,level:i},s=e0(o,r);b[r]=l,x[s]=l,l.parent=b[a],l.parent&&(l.parent.children=l.parent.children||[],l.parent.children.push(l)),p&&p(l,w)},n={externalGetKey:m||y,childrenPropName:g,fieldNames:v},a=(o=("object"===(0,E.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,i=o.externalGetKey,s=(l=e1(o.fieldNames)).key,c=l.children,u=a||c,i?"string"==typeof i?r=function(e){return e[i]}:"function"==typeof i&&(r=function(e){return i(e)}):r=function(e,t){return e0(e[s],t)},function n(o,a,i,l){var s=o?o[u]:e,c=o?eJ(i.pos,a):"0",d=o?[].concat((0,es.Z)(l),[o]):[];if(o){var f=r(o,c);t({node:o,index:a,pos:c,key:f,parentPos:i.node?i.pos:null,level:i.level+1,nodes:d})}s&&s.forEach(function(e,t){n(e,t,{node:o,pos:c,level:i?i.level+1:-1},d)})}(null),h&&h(w),w}function e3(e,t){var n=t.expandedKeys,r=t.selectedKeys,o=t.loadedKeys,a=t.loadingKeys,i=t.checkedKeys,l=t.halfCheckedKeys,s=t.dragOverNodeKey,c=t.dropPosition,u=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==r.indexOf(e),loaded:-1!==o.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==i.indexOf(e),halfChecked:-1!==l.indexOf(e),pos:String(u?u.pos:""),dragOver:s===e&&0===c,dragOverGapTop:s===e&&-1===c,dragOverGapBottom:s===e&&1===c}}function e5(e){var t=e.data,n=e.expanded,r=e.selected,o=e.checked,a=e.loaded,i=e.loading,l=e.halfChecked,s=e.dragOver,c=e.dragOverGapTop,u=e.dragOverGapBottom,d=e.pos,f=e.active,p=e.eventKey,h=(0,O.Z)((0,O.Z)({},t),{},{expanded:n,selected:r,checked:o,loaded:a,loading:i,halfChecked:l,dragOver:s,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:f,key:p});return"props"in h||Object.defineProperty(h,"props",{get:function(){return(0,T.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),h}var e8=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e7="open",e9="close",te=function(e){(0,e$.Z)(n,e);var t=(0,eV.Z)(n);function n(){var e;(0,eW.Z)(this,n);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={dragNodeHighlight:!1},e.selectHandle=void 0,e.cacheIndent=void 0,e.onSelectorClick=function(t){(0,e.props.context.onNodeClick)(t,e5(e.props)),e.isSelectable()?e.onSelect(t):e.onCheck(t)},e.onSelectorDoubleClick=function(t){(0,e.props.context.onNodeDoubleClick)(t,e5(e.props))},e.onSelect=function(t){e.isDisabled()||(0,e.props.context.onNodeSelect)(t,e5(e.props))},e.onCheck=function(t){if(!e.isDisabled()){var n=e.props,r=n.disableCheckbox,o=n.checked,a=e.props.context.onNodeCheck;e.isCheckable()&&!r&&a(t,e5(e.props),!o)}},e.onMouseEnter=function(t){(0,e.props.context.onNodeMouseEnter)(t,e5(e.props))},e.onMouseLeave=function(t){(0,e.props.context.onNodeMouseLeave)(t,e5(e.props))},e.onContextMenu=function(t){(0,e.props.context.onNodeContextMenu)(t,e5(e.props))},e.onDragStart=function(t){var n=e.props.context.onNodeDragStart;t.stopPropagation(),e.setState({dragNodeHighlight:!0}),n(t,(0,eK.Z)(e));try{t.dataTransfer.setData("text/plain","")}catch(e){}},e.onDragEnter=function(t){var n=e.props.context.onNodeDragEnter;t.preventDefault(),t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragOver=function(t){var n=e.props.context.onNodeDragOver;t.preventDefault(),t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragLeave=function(t){var n=e.props.context.onNodeDragLeave;t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragEnd=function(t){var n=e.props.context.onNodeDragEnd;t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,eK.Z)(e))},e.onDrop=function(t){var n=e.props.context.onNodeDrop;t.preventDefault(),t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,eK.Z)(e))},e.onExpand=function(t){var n=e.props,r=n.loading,o=n.context.onNodeExpand;r||o(t,e5(e.props))},e.setSelectHandle=function(t){e.selectHandle=t},e.getNodeState=function(){var t=e.props.expanded;return e.isLeaf()?null:t?e7:e9},e.hasChildren=function(){var t=e.props.eventKey;return!!((e.props.context.keyEntities[t]||{}).children||[]).length},e.isLeaf=function(){var t=e.props,n=t.isLeaf,r=t.loaded,o=e.props.context.loadData,a=e.hasChildren();return!1!==n&&(n||!o&&!a||o&&r&&!a)},e.isDisabled=function(){var t=e.props.disabled;return!!(e.props.context.disabled||t)},e.isCheckable=function(){var t=e.props.checkable,n=e.props.context.checkable;return!!n&&!1!==t&&n},e.syncLoadData=function(t){var n=t.expanded,r=t.loading,o=t.loaded,a=e.props.context,i=a.loadData,l=a.onNodeLoad;!r&&(!i||!n||e.isLeaf()||e.hasChildren()||o||l(e5(e.props)))},e.isDraggable=function(){var t=e.props,n=t.data,r=t.context.draggable;return!!(r&&(!r.nodeDraggable||r.nodeDraggable(n)))},e.renderDragHandler=function(){var t=e.props.context,n=t.draggable,r=t.prefixCls;return(null==n?void 0:n.icon)?a.createElement("span",{className:"".concat(r,"-draggable-icon")},n.icon):null},e.renderSwitcherIconDom=function(t){var n=e.props.switcherIcon,r=e.props.context.switcherIcon,o=n||r;return"function"==typeof o?o((0,O.Z)((0,O.Z)({},e.props),{},{isLeaf:t})):o},e.renderSwitcher=function(){var t=e.props.expanded,n=e.props.context.prefixCls;if(e.isLeaf()){var r=e.renderSwitcherIconDom(!0);return!1!==r?a.createElement("span",{className:_()("".concat(n,"-switcher"),"".concat(n,"-switcher-noop"))},r):null}var o=_()("".concat(n,"-switcher"),"".concat(n,"-switcher_").concat(t?e7:e9)),i=e.renderSwitcherIconDom(!1);return!1!==i?a.createElement("span",{onClick:e.onExpand,className:o},i):null},e.renderCheckbox=function(){var t=e.props,n=t.checked,r=t.halfChecked,o=t.disableCheckbox,i=e.props.context.prefixCls,l=e.isDisabled(),s=e.isCheckable();return s?a.createElement("span",{className:_()("".concat(i,"-checkbox"),n&&"".concat(i,"-checkbox-checked"),!n&&r&&"".concat(i,"-checkbox-indeterminate"),(l||o)&&"".concat(i,"-checkbox-disabled")),onClick:e.onCheck},"boolean"!=typeof s?s:null):null},e.renderIcon=function(){var t=e.props.loading,n=e.props.context.prefixCls;return a.createElement("span",{className:_()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(e.getNodeState()||"docu"),t&&"".concat(n,"-icon_loading"))})},e.renderSelector=function(){var t,n,r=e.state.dragNodeHighlight,o=e.props,i=o.title,l=void 0===i?"---":i,s=o.selected,c=o.icon,u=o.loading,d=o.data,f=e.props.context,p=f.prefixCls,h=f.showIcon,m=f.icon,g=f.loadData,v=f.titleRender,y=e.isDisabled(),b="".concat(p,"-node-content-wrapper");if(h){var x=c||m;t=x?a.createElement("span",{className:_()("".concat(p,"-iconEle"),"".concat(p,"-icon__customize"))},"function"==typeof x?x(e.props):x):e.renderIcon()}else g&&u&&(t=e.renderIcon());n="function"==typeof l?l(d):v?v(d):l;var w=a.createElement("span",{className:"".concat(p,"-title")},n);return a.createElement("span",{ref:e.setSelectHandle,title:"string"==typeof l?l:"",className:_()("".concat(b),"".concat(b,"-").concat(e.getNodeState()||"normal"),!y&&(s||r)&&"".concat(p,"-node-selected")),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onContextMenu:e.onContextMenu,onClick:e.onSelectorClick,onDoubleClick:e.onSelectorDoubleClick},t,w,e.renderDropIndicator())},e.renderDropIndicator=function(){var t=e.props,n=t.disabled,r=t.eventKey,o=e.props.context,a=o.draggable,i=o.dropLevelOffset,l=o.dropPosition,s=o.prefixCls,c=o.indent,u=o.dropIndicatorRender,d=o.dragOverNodeKey,f=o.direction,p=null!=c?c:e.cacheIndent;return e.cacheIndent=c,!n&&a&&d===r?u({dropPosition:l,dropLevelOffset:i,indent:p,prefixCls:s,direction:f}):null},e}return(0,eU.Z)(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var e=this.props.selectable,t=this.props.context.selectable;return"boolean"==typeof e?e:t}},{key:"render",value:function(){var e,t=this.props,n=t.eventKey,r=t.className,o=t.style,i=t.dragOver,l=t.dragOverGapTop,s=t.dragOverGapBottom,c=t.isLeaf,u=t.isStart,d=t.isEnd,f=t.expanded,p=t.selected,h=t.checked,g=t.halfChecked,v=t.loading,y=t.domRef,b=t.active,x=(t.data,t.onMouseMove),w=t.selectable,k=(0,z.Z)(t,e8),S=this.props.context,E=S.prefixCls,O=S.filterTreeNode,j=S.keyEntities,P=S.dropContainerKey,N=S.dropTargetKey,T=S.draggingNodeKey,A=this.isDisabled(),M=(0,$.Z)(k,{aria:!0,data:!0}),I=(j[n]||{}).level,R=d[d.length-1],D=this.isDraggable(),L=!A&&D,Z=T===n;return a.createElement("div",(0,m.Z)({ref:y,className:_()(r,"".concat(E,"-treenode"),(e={},(0,C.Z)(e,"".concat(E,"-treenode-disabled"),A),(0,C.Z)(e,"".concat(E,"-treenode-switcher-").concat(f?"open":"close"),!c),(0,C.Z)(e,"".concat(E,"-treenode-checkbox-checked"),h),(0,C.Z)(e,"".concat(E,"-treenode-checkbox-indeterminate"),g),(0,C.Z)(e,"".concat(E,"-treenode-selected"),p),(0,C.Z)(e,"".concat(E,"-treenode-loading"),v),(0,C.Z)(e,"".concat(E,"-treenode-active"),b),(0,C.Z)(e,"".concat(E,"-treenode-leaf-last"),R),(0,C.Z)(e,"".concat(E,"-treenode-draggable"),D),(0,C.Z)(e,"dragging",Z),(0,C.Z)(e,"drop-target",N===n),(0,C.Z)(e,"drop-container",P===n),(0,C.Z)(e,"drag-over",!A&&i),(0,C.Z)(e,"drag-over-gap-top",!A&&l),(0,C.Z)(e,"drag-over-gap-bottom",!A&&s),(0,C.Z)(e,"filter-node",O&&O(e5(this.props))),e)),style:o,draggable:L,"aria-grabbed":Z,onDragStart:L?this.onDragStart:void 0,onDragEnter:D?this.onDragEnter:void 0,onDragOver:D?this.onDragOver:void 0,onDragLeave:D?this.onDragLeave:void 0,onDrop:D?this.onDrop:void 0,onDragEnd:D?this.onDragEnd:void 0,onMouseMove:x},void 0!==w?{"aria-selected":!!w}:void 0,M),a.createElement(eG,{prefixCls:E,level:I,isStart:u,isEnd:d}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(a.Component),tt=function(e){return a.createElement(eX.Consumer,null,function(t){return a.createElement(te,(0,m.Z)({},e,{context:t}))})};function tn(e,t){if(!e)return[];var n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function tr(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function to(e){return e.split("-")}function ta(e,t,n,r,o,a,i,l,s,c){var u,d,f=e.clientX,p=e.clientY,h=e.target.getBoundingClientRect(),m=h.top,g=h.height,v=(("rtl"===c?-1:1)*(((null==o?void 0:o.x)||0)-f)-12)/r,y=l[n.props.eventKey];if(p<m+g/2){var b=i.findIndex(function(e){return e.key===y.key});y=l[i[b<=0?0:b-1].key]}var x=y.key,w=y,k=y.key,S=0,E=0;if(!s.includes(x))for(var O=0;O<v;O+=1)if(function(e){if(e.parent){var t=to(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}(y))y=y.parent,E+=1;else break;var C=t.props.data,j=y.node,_=!0;return 0===Number((u=to(y.pos))[u.length-1])&&0===y.level&&p<m+g/2&&a({dragNode:C,dropNode:j,dropPosition:-1})&&y.key===n.props.eventKey?S=-1:(w.children||[]).length&&s.includes(k)?a({dragNode:C,dropNode:j,dropPosition:0})?S=0:_=!1:0===E?v>-1.5?a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1:a({dragNode:C,dropNode:j,dropPosition:0})?S=0:a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1:a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1,{dropPosition:S,dropLevelOffset:E,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:k,dropContainerKey:0===S?null:(null===(d=y.parent)||void 0===d?void 0:d.key)||null,dropAllowed:_}}function ti(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function tl(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,E.Z)(e))return(0,T.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function ts(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(r){if(!n.has(r)){var o=t[r];if(o){n.add(r);var a=o.parent;!o.node.disabled&&a&&e(a.key)}}}(e)}),(0,es.Z)(n)}function tc(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function tu(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,o=t.checkable;return!!(n||r)||!1===o}function td(e,t,n,r){var o,a=[];o=r||tu;var i=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),l=new Map,s=0;return Object.keys(n).forEach(function(e){var t=n[e],r=t.level,o=l.get(r);o||(o=new Set,l.set(r,o)),o.add(t),s=Math.max(s,r)}),(0,T.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,r){for(var o=new Set(e),a=new Set,i=0;i<=n;i+=1)(t.get(i)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,i=void 0===a?[]:a;o.has(t)&&!r(n)&&i.filter(function(e){return!r(e.node)}).forEach(function(e){o.add(e.key)})});for(var l=new Set,s=n;s>=0;s-=1)(t.get(s)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||l.has(e.parent.key))){if(r(e.parent.node)){l.add(t.key);return}var n=!0,i=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=o.has(t);n&&!r&&(n=!1),!i&&(r||a.has(t))&&(i=!0)}),n&&o.add(t.key),i&&a.add(t.key),l.add(t.key)}});return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(tc(a,o))}}(i,l,s,o):function(e,t,n,r,o){for(var a=new Set(e),i=new Set(t),l=0;l<=r;l+=1)(n.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,r=e.children,l=void 0===r?[]:r;a.has(t)||i.has(t)||o(n)||l.filter(function(e){return!o(e.node)}).forEach(function(e){a.delete(e.key)})});i=new Set;for(var s=new Set,c=r;c>=0;c-=1)(n.get(c)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||s.has(e.parent.key))){if(o(e.parent.node)){s.add(t.key);return}var n=!0,r=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=a.has(t);n&&!o&&(n=!1),!r&&(o||i.has(t))&&(r=!0)}),n||a.delete(t.key),r&&i.add(t.key),s.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(tc(i,a))}}(i,t.halfCheckedKeys,l,s,o)}tt.displayName="TreeNode",tt.isTreeNode=1;var tf=n(50506),tp=n(13613),th=n(61994),tm=n(80795),tg=n(29967);let tv={},ty="SELECT_ALL",tb="SELECT_INVERT",tx="SELECT_NONE",tw=[],tk=(e,t)=>{let n=[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&(n=[].concat((0,es.Z)(n),(0,es.Z)(tk(e,t[e]))))}),n};var tS=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:r,defaultSelectedRowKeys:o,getCheckboxProps:i,onChange:l,onSelect:s,onSelectAll:c,onSelectInvert:u,onSelectNone:d,onSelectMultiple:f,columnWidth:p,type:h,selections:m,fixed:g,renderCell:v,hideSelectAll:y,checkStrictly:b=!0}=t||{},{prefixCls:x,data:w,pageData:k,getRecordByKey:S,getRowKey:E,expandType:O,childrenColumnName:C,locale:j,getPopupContainer:P}=e,N=(0,tp.ln)("Table"),[T,A]=function(e){let[t,n]=(0,a.useState)(null);return[(0,a.useCallback)((r,o,a)=>{let i=null!=t?t:r,l=Math.max(i||0,r),s=o.slice(Math.min(i||0,r),l+1).map(t=>e(t)),c=s.some(e=>!a.has(e)),u=[];return s.forEach(e=>{c?(a.has(e)||u.push(e),a.add(e)):(a.delete(e),u.push(e))}),n(c?l:null),u},[t]),e=>{n(e)}]}(e=>e),[M,I]=(0,tf.Z)(r||o||tw,{value:r}),R=a.useRef(new Map),D=(0,a.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=S(e);!n&&R.current.has(e)&&(n=R.current.get(e)),t.set(e,n)}),R.current=t}},[S,n]);a.useEffect(()=>{D(M)},[M]);let{keyEntities:L}=(0,a.useMemo)(()=>{if(b)return{keyEntities:null};let e=w;if(n){let t=new Set(w.map((e,t)=>E(e,t))),n=Array.from(R.current).reduce((e,n)=>{let[r,o]=n;return t.has(r)?e:e.concat(o)},[]);e=[].concat((0,es.Z)(e),(0,es.Z)(n))}return e4(e,{externalGetKey:E,childrenPropName:C})},[w,E,b,C,n]),Z=(0,a.useMemo)(()=>tk(C,k),[C,k]),z=(0,a.useMemo)(()=>{let e=new Map;return Z.forEach((t,n)=>{let r=E(t,n),o=(i?i(t):null)||{};e.set(r,o)}),e},[Z,E,i]),B=(0,a.useCallback)(e=>{var t;return!!(null===(t=z.get(E(e)))||void 0===t?void 0:t.disabled)},[z,E]),[F,H]=(0,a.useMemo)(()=>{if(b)return[M||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=td(M,!0,L,B);return[e||[],t]},[M,b,L,B]),q=(0,a.useMemo)(()=>new Set("radio"===h?F.slice(0,1):F),[F,h]),W=(0,a.useMemo)(()=>"radio"===h?new Set:new Set(H),[H,h]);a.useEffect(()=>{t||I(tw)},[!!t]);let U=(0,a.useCallback)((e,t)=>{let r,o;D(e),n?(r=e,o=e.map(e=>R.current.get(e))):(r=[],o=[],e.forEach(e=>{let t=S(e);void 0!==t&&(r.push(e),o.push(t))})),I(r),null==l||l(r,o,{type:t})},[I,S,l,n]),K=(0,a.useCallback)((e,t,n,r)=>{if(s){let o=n.map(e=>S(e));s(S(e),t,o,r)}U(n,"single")},[s,S,U]),$=(0,a.useMemo)(()=>!m||y?null:(!0===m?[ty,tb,tx]:m).map(e=>e===ty?{key:"all",text:j.selectionAll,onSelect(){U(w.map((e,t)=>E(e,t)).filter(e=>{let t=z.get(e);return!(null==t?void 0:t.disabled)||q.has(e)}),"all")}}:e===tb?{key:"invert",text:j.selectInvert,onSelect(){let e=new Set(q);k.forEach((t,n)=>{let r=E(t,n),o=z.get(r);(null==o?void 0:o.disabled)||(e.has(r)?e.delete(r):e.add(r))});let t=Array.from(e);u&&(N.deprecated(!1,"onSelectInvert","onChange"),u(t)),U(t,"invert")}}:e===tx?{key:"none",text:j.selectNone,onSelect(){null==d||d(),U(Array.from(q).filter(e=>{let t=z.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null===(t=e.onSelect)||void 0===t||t.call.apply(t,[e].concat(r)),A(null)}})),[m,q,k,E,u,U]);return[(0,a.useCallback)(e=>{var n;let r,o,i;if(!t)return e.filter(e=>e!==tv);let l=(0,es.Z)(e),s=new Set(q),u=Z.map(E).filter(e=>!z.get(e).disabled),d=u.every(e=>s.has(e)),w=u.some(e=>s.has(e));if("radio"!==h){let e;if($){let t={getPopupContainer:P,items:$.map((e,t)=>{let{key:n,text:r,onSelect:o}=e;return{key:null!=n?n:t,onClick:()=>{null==o||o(u)},label:r}})};e=a.createElement("div",{className:"".concat(x,"-selection-extra")},a.createElement(tm.Z,{menu:t,getPopupContainer:P},a.createElement("span",null,a.createElement(eq.Z,null))))}let t=Z.map((e,t)=>{let n=E(e,t),r=z.get(n)||{};return Object.assign({checked:s.has(n)},r)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===Z.length,i=n&&t.every(e=>{let{checked:t}=e;return t}),l=n&&t.some(e=>{let{checked:t}=e;return t});o=a.createElement(th.Z,{checked:n?i:!!Z.length&&d,indeterminate:n?!i&&l:!d&&w,onChange:()=>{let e=[];d?u.forEach(t=>{s.delete(t),e.push(t)}):u.forEach(t=>{s.has(t)||(s.add(t),e.push(t))});let t=Array.from(s);null==c||c(!d,t.map(e=>S(e)),e.map(e=>S(e))),U(t,"all"),A(null)},disabled:0===Z.length||n,"aria-label":e?"Custom selection":"Select all",skipGroup:!0}),r=!y&&a.createElement("div",{className:"".concat(x,"-selection")},o,e)}if(i="radio"===h?(e,t,n)=>{let r=E(t,n),o=s.has(r);return{node:a.createElement(tg.ZP,Object.assign({},z.get(r),{checked:o,onClick:e=>e.stopPropagation(),onChange:e=>{s.has(r)||K(r,!0,[r],e.nativeEvent)}})),checked:o}}:(e,t,n)=>{var r;let o;let i=E(t,n),l=s.has(i),c=W.has(i),d=z.get(i);return o="nest"===O?c:null!==(r=null==d?void 0:d.indeterminate)&&void 0!==r?r:c,{node:a.createElement(th.Z,Object.assign({},d,{indeterminate:o,checked:l,skipGroup:!0,onClick:e=>e.stopPropagation(),onChange:e=>{let{nativeEvent:t}=e,{shiftKey:n}=t,r=u.findIndex(e=>e===i),o=F.some(e=>u.includes(e));if(n&&b&&o){let e=T(r,u,s),t=Array.from(s);null==f||f(!l,t.map(e=>S(e)),e.map(e=>S(e))),U(t,"multiple")}else if(b){let e=l?tn(F,i):tr(F,i);K(i,!l,e,t)}else{let{checkedKeys:e,halfCheckedKeys:n}=td([].concat((0,es.Z)(F),[i]),!0,L,B),r=e;if(l){let t=new Set(e);t.delete(i),r=td(Array.from(t),{checked:!1,halfCheckedKeys:n},L,B).checkedKeys}K(i,!l,r,t)}l?A(null):A(r)}})),checked:l}},!l.includes(tv)){if(0===l.findIndex(e=>{var t;return(null===(t=e[ea])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=l;l=[e,tv].concat((0,es.Z)(t))}else l=[tv].concat((0,es.Z)(l))}let k=l.indexOf(tv),C=(l=l.filter((e,t)=>e!==tv||t===k))[k-1],j=l[k+1],N=g;void 0===N&&((null==j?void 0:j.fixed)!==void 0?N=j.fixed:(null==C?void 0:C.fixed)!==void 0&&(N=C.fixed)),N&&C&&(null===(n=C[ea])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===C.fixed&&(C.fixed=N);let M=_()("".concat(x,"-selection-col"),{["".concat(x,"-selection-col-with-dropdown")]:m&&"checkbox"===h}),I={fixed:N,width:p,className:"".concat(x,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(o):t.columnTitle:r,render:(e,t,n)=>{let{node:r,checked:o}=i(e,t,n);return v?v(o,t,n,r):r},onCell:t.onCell,[ea]:{className:M}};return l.map(e=>e===tv?I:e)},[E,Z,t,F,q,W,p,$,O,z,f,K,B]),q]},tE=n(53346);function tO(e){return null!=e&&e===e.window}var tC=n(71744),tj=n(91086),t_=n(64024),tP=n(33759),tN=n(28617),tT=n(13823),tA={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},tM=n(55015),tI=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:tA}))}),tR={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},tD=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:tR}))}),tL=n(15327),tZ=n(77565),tz=n(95814),tB={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},tF=["10","20","50","100"],tH=function(e){var t=e.pageSizeOptions,n=void 0===t?tF:t,r=e.locale,o=e.changeSize,i=e.pageSize,l=e.goButton,c=e.quickGo,u=e.rootPrefixCls,d=e.selectComponentClass,f=e.selectPrefixCls,p=e.disabled,h=e.buildOptionText,m=a.useState(""),g=(0,s.Z)(m,2),v=g[0],y=g[1],b=function(){return!v||Number.isNaN(v)?void 0:Number(v)},x="function"==typeof h?h:function(e){return"".concat(e," ").concat(r.items_per_page)},w=function(e){""!==v&&(e.keyCode===tz.Z.ENTER||"click"===e.type)&&(y(""),null==c||c(b()))},k="".concat(u,"-options");if(!o&&!c)return null;var S=null,E=null,O=null;if(o&&d){var C=(n.some(function(e){return e.toString()===i.toString()})?n:n.concat([i.toString()]).sort(function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))})).map(function(e,t){return a.createElement(d.Option,{key:t,value:e.toString()},x(e))});S=a.createElement(d,{disabled:p,prefixCls:f,showSearch:!1,className:"".concat(k,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(i||n[0]).toString(),onChange:function(e){null==o||o(Number(e))},getPopupContainer:function(e){return e.parentNode},"aria-label":r.page_size,defaultOpen:!1},C)}return c&&(l&&(O="boolean"==typeof l?a.createElement("button",{type:"button",onClick:w,onKeyUp:w,disabled:p,className:"".concat(k,"-quick-jumper-button")},r.jump_to_confirm):a.createElement("span",{onClick:w,onKeyUp:w},l)),E=a.createElement("div",{className:"".concat(k,"-quick-jumper")},r.jump_to,a.createElement("input",{disabled:p,type:"text",value:v,onChange:function(e){y(e.target.value)},onKeyUp:w,onBlur:function(e){!l&&""!==v&&(y(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(u,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(u,"-item"))>=0)||null==c||c(b()))},"aria-label":r.page}),r.page,O)),a.createElement("li",{className:k},S,E)},tq=function(e){var t,n=e.rootPrefixCls,r=e.page,o=e.active,i=e.className,l=e.showTitle,s=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),f=_()(d,"".concat(d,"-").concat(r),(t={},(0,C.Z)(t,"".concat(d,"-active"),o),(0,C.Z)(t,"".concat(d,"-disabled"),!r),t),i),p=u(r,"page",a.createElement("a",{rel:"nofollow"},r));return p?a.createElement("li",{title:l?String(r):null,className:f,onClick:function(){s(r)},onKeyDown:function(e){c(e,s,r)},tabIndex:0},p):null},tW=function(e,t,n){return n};function tU(){}function tK(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function t$(e,t,n){return Math.floor((n-1)/(void 0===e?t:e))+1}var tV=function(e){var t,n,r,o,i,l=e.prefixCls,c=void 0===l?"rc-pagination":l,u=e.selectPrefixCls,d=e.className,f=e.selectComponentClass,p=e.current,h=e.defaultCurrent,g=e.total,v=void 0===g?0:g,y=e.pageSize,b=e.defaultPageSize,x=e.onChange,w=void 0===x?tU:x,k=e.hideOnSinglePage,S=e.showPrevNextJumpers,E=e.showQuickJumper,j=e.showLessItems,P=e.showTitle,N=void 0===P||P,T=e.onShowSizeChange,A=void 0===T?tU:T,M=e.locale,I=void 0===M?tB:M,R=e.style,D=e.totalBoundaryShowSizeChanger,L=e.disabled,Z=e.simple,z=e.showTotal,B=e.showSizeChanger,F=e.pageSizeOptions,H=e.itemRender,q=void 0===H?tW:H,W=e.jumpPrevIcon,U=e.jumpNextIcon,K=e.prevIcon,V=e.nextIcon,X=a.useRef(null),G=(0,tf.Z)(10,{value:y,defaultValue:void 0===b?10:b}),Y=(0,s.Z)(G,2),Q=Y[0],J=Y[1],ee=(0,tf.Z)(1,{value:p,defaultValue:void 0===h?1:h,postState:function(e){return Math.max(1,Math.min(e,t$(void 0,Q,v)))}}),et=(0,s.Z)(ee,2),en=et[0],er=et[1],eo=a.useState(en),ea=(0,s.Z)(eo,2),ei=ea[0],el=ea[1];(0,a.useEffect)(function(){el(en)},[en]);var es=Math.max(1,en-(j?3:5)),ec=Math.min(t$(void 0,Q,v),en+(j?3:5));function eu(t,n){var r=t||a.createElement("button",{type:"button","aria-label":n,className:"".concat(c,"-item-link")});return"function"==typeof t&&(r=a.createElement(t,(0,O.Z)({},e))),r}function ed(e){var t=e.target.value,n=t$(void 0,Q,v);return""===t?t:Number.isNaN(Number(t))?ei:t>=n?n:Number(t)}var ef=v>Q&&E;function ep(e){var t=ed(e);switch(t!==ei&&el(t),e.keyCode){case tz.Z.ENTER:eh(t);break;case tz.Z.UP:eh(t-1);break;case tz.Z.DOWN:eh(t+1)}}function eh(e){if(tK(e)&&e!==en&&tK(v)&&v>0&&!L){var t=t$(void 0,Q,v),n=e;return e>t?n=t:e<1&&(n=1),n!==ei&&el(n),er(n),null==w||w(n,Q),n}return en}var em=en>1,eg=en<t$(void 0,Q,v),ev=null!=B?B:v>(void 0===D?50:D);function ey(){em&&eh(en-1)}function eb(){eg&&eh(en+1)}function ex(){eh(es)}function ew(){eh(ec)}function ek(e,t){if("Enter"===e.key||e.charCode===tz.Z.ENTER||e.keyCode===tz.Z.ENTER){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];t.apply(void 0,r)}}function eS(e){("click"===e.type||e.keyCode===tz.Z.ENTER)&&eh(ei)}var eE=null,eO=(0,$.Z)(e,{aria:!0,data:!0}),eC=z&&a.createElement("li",{className:"".concat(c,"-total-text")},z(v,[0===v?0:(en-1)*Q+1,en*Q>v?v:en*Q])),ej=null,e_=t$(void 0,Q,v);if(k&&v<=Q)return null;var eP=[],eN={rootPrefixCls:c,onClick:eh,onKeyPress:ek,showTitle:N,itemRender:q,page:-1},eT=en-1>0?en-1:0,eA=en+1<e_?en+1:e_,eM=E&&E.goButton,eI=eM,eR=null;Z&&(eM&&(eI="boolean"==typeof eM?a.createElement("button",{type:"button",onClick:eS,onKeyUp:eS},I.jump_to_confirm):a.createElement("span",{onClick:eS,onKeyUp:eS},eM),eI=a.createElement("li",{title:N?"".concat(I.jump_to).concat(en,"/").concat(e_):null,className:"".concat(c,"-simple-pager")},eI)),eR=a.createElement("li",{title:N?"".concat(en,"/").concat(e_):null,className:"".concat(c,"-simple-pager")},a.createElement("input",{type:"text",value:ei,disabled:L,onKeyDown:function(e){(e.keyCode===tz.Z.UP||e.keyCode===tz.Z.DOWN)&&e.preventDefault()},onKeyUp:ep,onChange:ep,onBlur:function(e){eh(ed(e))},size:3}),a.createElement("span",{className:"".concat(c,"-slash")},"/"),e_));var eD=j?1:2;if(e_<=3+2*eD){e_||eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:"noPager",page:1,className:"".concat(c,"-item-disabled")})));for(var eL=1;eL<=e_;eL+=1)eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:eL,page:eL,active:en===eL})))}else{var eZ=j?I.prev_3:I.prev_5,ez=j?I.next_3:I.next_5,eB=q(es,"jump-prev",eu(W,"prev page")),eF=q(ec,"jump-next",eu(U,"next page"));(void 0===S||S)&&(eE=eB?a.createElement("li",{title:N?eZ:null,key:"prev",onClick:ex,tabIndex:0,onKeyDown:function(e){ek(e,ex)},className:_()("".concat(c,"-jump-prev"),(0,C.Z)({},"".concat(c,"-jump-prev-custom-icon"),!!W))},eB):null,ej=eF?a.createElement("li",{title:N?ez:null,key:"next",onClick:ew,tabIndex:0,onKeyDown:function(e){ek(e,ew)},className:_()("".concat(c,"-jump-next"),(0,C.Z)({},"".concat(c,"-jump-next-custom-icon"),!!U))},eF):null);var eH=Math.max(1,en-eD),eq=Math.min(en+eD,e_);en-1<=eD&&(eq=1+2*eD),e_-en<=eD&&(eH=e_-2*eD);for(var eW=eH;eW<=eq;eW+=1)eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:eW,page:eW,active:en===eW})));if(en-1>=2*eD&&3!==en&&(eP[0]=a.cloneElement(eP[0],{className:_()("".concat(c,"-item-after-jump-prev"),eP[0].props.className)}),eP.unshift(eE)),e_-en>=2*eD&&en!==e_-2){var eU=eP[eP.length-1];eP[eP.length-1]=a.cloneElement(eU,{className:_()("".concat(c,"-item-before-jump-next"),eU.props.className)}),eP.push(ej)}1!==eH&&eP.unshift(a.createElement(tq,(0,m.Z)({},eN,{key:1,page:1}))),eq!==e_&&eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:e_,page:e_})))}var eK=(t=q(eT,"prev",eu(K,"prev page")),a.isValidElement(t)?a.cloneElement(t,{disabled:!em}):t);if(eK){var e$=!em||!e_;eK=a.createElement("li",{title:N?I.prev_page:null,onClick:ey,tabIndex:e$?null:0,onKeyDown:function(e){ek(e,ey)},className:_()("".concat(c,"-prev"),(0,C.Z)({},"".concat(c,"-disabled"),e$)),"aria-disabled":e$},eK)}var eV=(n=q(eA,"next",eu(V,"next page")),a.isValidElement(n)?a.cloneElement(n,{disabled:!eg}):n);eV&&(Z?(o=!eg,i=em?0:null):i=(o=!eg||!e_)?null:0,eV=a.createElement("li",{title:N?I.next_page:null,onClick:eb,tabIndex:i,onKeyDown:function(e){ek(e,eb)},className:_()("".concat(c,"-next"),(0,C.Z)({},"".concat(c,"-disabled"),o)),"aria-disabled":o},eV));var eX=_()(c,d,(r={},(0,C.Z)(r,"".concat(c,"-simple"),Z),(0,C.Z)(r,"".concat(c,"-disabled"),L),r));return a.createElement("ul",(0,m.Z)({className:eX,style:R,ref:X},eO),eC,eK,Z?eR:eP,eV,a.createElement(tH,{locale:I,rootPrefixCls:c,disabled:L,selectComponentClass:f,selectPrefixCls:void 0===u?"rc-select":u,changeSize:ev?function(e){var t=t$(e,Q,v),n=en>t&&0!==t?t:en;J(e),el(n),null==A||A(en,e),er(n),null==w||w(n,e)}:null,pageSize:Q,pageSizeOptions:F,quickGo:ef?eh:null,goButton:eI}))},tX=n(96257),tG=n(55274),tY=n(52787);let tQ=e=>a.createElement(tY.default,Object.assign({},e,{showSearch:!0,size:"small"})),tJ=e=>a.createElement(tY.default,Object.assign({},e,{showSearch:!0,size:"middle"}));tQ.Option=tY.default.Option,tJ.Option=tY.default.Option;var t0=n(352),t1=n(31282),t2=n(37433),t6=n(12918),t4=n(3104),t3=n(80669),t5=n(65265);let t8=e=>{let{componentCls:t}=e;return{["".concat(t,"-disabled")]:{"&, &:hover":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},["&".concat(t,"-disabled")]:{cursor:"not-allowed",["".concat(t,"-item")]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},["".concat(t,"-simple&")]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},["".concat(t,"-simple-pager")]:{color:e.colorTextDisabled},["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{["".concat(t,"-item-link-icon")]:{opacity:0},["".concat(t,"-item-ellipsis")]:{opacity:1}}},["&".concat(t,"-simple")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&".concat(t,"-disabled ").concat(t,"-item-link")]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},t7=e=>{let{componentCls:t}=e;return{["&".concat(t,"-mini ").concat(t,"-total-text, &").concat(t,"-mini ").concat(t,"-simple-pager")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-item")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.calc(e.itemSizeSM).sub(2).equal())},["&".concat(t,"-mini:not(").concat(t,"-disabled) ").concat(t,"-item:not(").concat(t,"-item-active)")]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},["&".concat(t,"-mini ").concat(t,"-prev, &").concat(t,"-mini ").concat(t,"-next")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini:not(").concat(t,"-disabled)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover ").concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["\n &".concat(t,"-mini ").concat(t,"-prev ").concat(t,"-item-link,\n &").concat(t,"-mini ").concat(t,"-next ").concat(t,"-item-link\n ")]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}},["&".concat(t,"-mini ").concat(t,"-jump-prev, &").concat(t,"-mini ").concat(t,"-jump-next")]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-options")]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),input:Object.assign(Object.assign({},(0,t1.x0)(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},t9=e=>{let{componentCls:t}=e;return{["\n &".concat(t,"-simple ").concat(t,"-prev,\n &").concat(t,"-simple ").concat(t,"-next\n ")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),verticalAlign:"top",["".concat(t,"-item-link")]:{height:e.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}}},["&".concat(t,"-simple ").concat(t,"-simple-pager")]:{display:"inline-block",height:e.itemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:e.marginXS,padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),textAlign:"center",backgroundColor:e.itemInputBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadius,outline:"none",transition:"border-color ".concat(e.motionDurationMid),color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:"".concat((0,t0.bf)(e.inputOutlineOffset)," 0 ").concat((0,t0.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}}}},ne=e=>{let{componentCls:t}=e;return{["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{outline:0,["".concat(t,"-item-container")]:{position:"relative",["".concat(t,"-item-link-icon")]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:"all ".concat(e.motionDurationMid),"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},["".concat(t,"-item-ellipsis")]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:"all ".concat(e.motionDurationMid)}},"&:hover":{["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}}},["\n ".concat(t,"-prev,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{marginInlineEnd:e.marginXS},["\n ".concat(t,"-prev,\n ").concat(t,"-next,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:"".concat((0,t0.bf)(e.itemSize)),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:"all ".concat(e.motionDurationMid)},["".concat(t,"-prev, ").concat(t,"-next")]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},["".concat(t,"-item-link")]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:"none",transition:"all ".concat(e.motionDurationMid)},["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover")]:{["".concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["".concat(t,"-slash")]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},["".concat(t,"-options")]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:(0,t0.bf)(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},(0,t1.ik)(e)),(0,t5.$U)(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},(0,t5.Xy)(e)),width:e.calc(e.controlHeightLG).mul(1.25).equal(),height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},nt=e=>{let{componentCls:t}=e;return{["".concat(t,"-item")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),color:e.colorText,"&:hover":{textDecoration:"none"}},["&:not(".concat(t,"-item-active)")]:{"&:hover":{transition:"all ".concat(e.motionDurationMid),backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}}}},nn=e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,t6.Wf)(e)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},["".concat(t,"-total-text")]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),nt(e)),ne(e)),t9(e)),t7(e)),t8(e)),{["@media only screen and (max-width: ".concat(e.screenLG,"px)")]:{["".concat(t,"-item")]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},["@media only screen and (max-width: ".concat(e.screenSM,"px)")]:{["".concat(t,"-options")]:{display:"none"}}}),["&".concat(e.componentCls,"-rtl")]:{direction:"rtl"}}},nr=e=>{let{componentCls:t}=e;return{["".concat(t,":not(").concat(t,"-disabled)")]:{["".concat(t,"-item")]:Object.assign({},(0,t6.Qy)(e)),["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{"&:focus-visible":Object.assign({["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}},(0,t6.oN)(e))},["".concat(t,"-prev, ").concat(t,"-next")]:{["&:focus-visible ".concat(t,"-item-link")]:Object.assign({},(0,t6.oN)(e))}}}},no=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},(0,t2.T)(e)),na=e=>(0,t4.TS)(e,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,t2.e)(e));var ni=(0,t3.I$)("Pagination",e=>{let t=na(e);return[nn(t),nr(t)]},no),nl=n(29961);let ns=e=>{let{componentCls:t}=e;return{["".concat(t).concat(t,"-bordered").concat(t,"-disabled:not(").concat(t,"-mini)")]:{"&, &:hover":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},"&:focus-visible":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},["".concat(t,"-item, ").concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,["&:hover:not(".concat(t,"-item-active)")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},["&".concat(t,"-item-active")]:{backgroundColor:e.itemActiveBgDisabled}},["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},["".concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},["".concat(t).concat(t,"-bordered:not(").concat(t,"-mini)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},["".concat(t,"-item-link")]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},["&:hover ".concat(t,"-item-link")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},["&".concat(t,"-disabled")]:{["".concat(t,"-item-link")]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},["".concat(t,"-item")]:{backgroundColor:e.itemBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),["&:hover:not(".concat(t,"-item-active)")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}};var nc=(0,t3.bk)(["Pagination","bordered"],e=>[ns(na(e))],no),nu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},nd=e=>{let{prefixCls:t,selectPrefixCls:n,className:r,rootClassName:o,style:i,size:l,locale:s,selectComponentClass:c,responsive:u,showSizeChanger:d}=e,f=nu(e,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:p}=(0,tN.Z)(u),[,h]=(0,nl.ZP)(),{getPrefixCls:m,direction:g,pagination:v={}}=a.useContext(tC.E_),y=m("pagination",t),[b,x,w]=ni(y),k=null!=d?d:v.showSizeChanger,S=a.useMemo(()=>{let e=a.createElement("span",{className:"".concat(y,"-item-ellipsis")},"•••"),t=a.createElement("button",{className:"".concat(y,"-item-link"),type:"button",tabIndex:-1},"rtl"===g?a.createElement(tZ.Z,null):a.createElement(tL.Z,null));return{prevIcon:t,nextIcon:a.createElement("button",{className:"".concat(y,"-item-link"),type:"button",tabIndex:-1},"rtl"===g?a.createElement(tL.Z,null):a.createElement(tZ.Z,null)),jumpPrevIcon:a.createElement("a",{className:"".concat(y,"-item-link")},a.createElement("div",{className:"".concat(y,"-item-container")},"rtl"===g?a.createElement(tD,{className:"".concat(y,"-item-link-icon")}):a.createElement(tI,{className:"".concat(y,"-item-link-icon")}),e)),jumpNextIcon:a.createElement("a",{className:"".concat(y,"-item-link")},a.createElement("div",{className:"".concat(y,"-item-container")},"rtl"===g?a.createElement(tI,{className:"".concat(y,"-item-link-icon")}):a.createElement(tD,{className:"".concat(y,"-item-link-icon")}),e))}},[g,y]),[E]=(0,tG.Z)("Pagination",tX.Z),O=Object.assign(Object.assign({},E),s),C=(0,tP.Z)(l),j="small"===C||!!(p&&!C&&u),P=m("select",n),N=_()({["".concat(y,"-mini")]:j,["".concat(y,"-rtl")]:"rtl"===g,["".concat(y,"-bordered")]:h.wireframe},null==v?void 0:v.className,r,o,x,w),T=Object.assign(Object.assign({},null==v?void 0:v.style),i);return b(a.createElement(a.Fragment,null,h.wireframe&&a.createElement(nc,{prefixCls:y}),a.createElement(tV,Object.assign({},S,f,{style:T,prefixCls:y,selectPrefixCls:P,className:N,selectComponentClass:c||(j?tQ:tJ),locale:O,showSizeChanger:k}))))},nf=n(87908);function np(e,t){return"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t}function nh(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}function nm(e,t){return"function"==typeof e?e(t):e}var ng={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},nv=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:ng}))}),ny=n(51646),nb=n(73002),nx=n(85180),nw=n(45937),nk=n(88208);function nS(e){if(null==e)throw TypeError("Cannot destructure "+e)}var nE=n(47970),nO=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],nC=function(e,t){var n,r,o,i,l,c=e.className,d=e.style,f=e.motion,p=e.motionNodes,h=e.motionType,g=e.onMotionStart,v=e.onMotionEnd,y=e.active,b=e.treeNodeRequiredProps,x=(0,z.Z)(e,nO),w=a.useState(!0),k=(0,s.Z)(w,2),S=k[0],E=k[1],O=a.useContext(eX).prefixCls,C=p&&"hide"!==h;(0,u.Z)(function(){p&&C!==S&&E(C)},[p]);var j=a.useRef(!1),P=function(){p&&!j.current&&(j.current=!0,v())};return(n=function(){p&&g()},r=a.useState(!1),i=(o=(0,s.Z)(r,2))[0],l=o[1],(0,u.Z)(function(){if(i)return n(),function(){P()}},[i]),(0,u.Z)(function(){return l(!0),function(){l(!1)}},[]),p)?a.createElement(nE.ZP,(0,m.Z)({ref:t,visible:S},f,{motionAppear:"show"===h,onVisibleChanged:function(e){C===e&&P()}}),function(e,t){var n=e.className,r=e.style;return a.createElement("div",{ref:t,className:_()("".concat(O,"-treenode-motion"),n),style:r},p.map(function(e){var t=(0,m.Z)({},(nS(e.data),e.data)),n=e.title,r=e.key,o=e.isStart,i=e.isEnd;delete t.children;var l=e3(r,b);return a.createElement(tt,(0,m.Z)({},t,l,{title:n,active:y,data:e.data,key:r,isStart:o,isEnd:i}))}))}):a.createElement(tt,(0,m.Z)({domRef:t,className:c,style:d},x,{active:y}))};nC.displayName="MotionTreeNode";var nj=a.forwardRef(nC);function n_(e,t,n){var r=e.findIndex(function(e){return e.key===n}),o=e[r+1],a=t.findIndex(function(e){return e.key===n});if(o){var i=t.findIndex(function(e){return e.key===o.key});return t.slice(a+1,i)}return t.slice(a+1)}var nP=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],nN={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},nT=function(){},nA="RC_TREE_MOTION_".concat(Math.random()),nM={key:nA},nI={key:nA,level:0,index:0,pos:"0",node:nM,nodes:[nM]},nR={parent:null,children:[],pos:nI.pos,data:nM,title:null,key:nA,isStart:[],isEnd:[]};function nD(e,t,n,r){return!1!==t&&n?e.slice(0,Math.ceil(n/r)+1):e}function nL(e){return e0(e.key,e.pos)}var nZ=a.forwardRef(function(e,t){var n=e.prefixCls,r=e.data,o=(e.selectable,e.checkable,e.expandedKeys),i=e.selectedKeys,l=e.checkedKeys,c=e.loadedKeys,d=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,h=e.disabled,g=e.dragging,v=e.dragOverNodeKey,y=e.dropPosition,b=e.motion,x=e.height,w=e.itemHeight,k=e.virtual,S=e.focusable,E=e.activeItem,O=e.focused,C=e.tabIndex,j=e.onKeyDown,_=e.onFocus,P=e.onBlur,N=e.onActiveChange,T=e.onListChangeStart,A=e.onListChangeEnd,M=(0,z.Z)(e,nP),I=a.useRef(null),R=a.useRef(null);a.useImperativeHandle(t,function(){return{scrollTo:function(e){I.current.scrollTo(e)},getIndentWidth:function(){return R.current.offsetWidth}}});var D=a.useState(o),L=(0,s.Z)(D,2),Z=L[0],B=L[1],F=a.useState(r),H=(0,s.Z)(F,2),q=H[0],W=H[1],U=a.useState(r),K=(0,s.Z)(U,2),$=K[0],V=K[1],X=a.useState([]),G=(0,s.Z)(X,2),Y=G[0],Q=G[1],J=a.useState(null),ee=(0,s.Z)(J,2),et=ee[0],en=ee[1],er=a.useRef(r);function eo(){var e=er.current;W(e),V(e),Q([]),en(null),A()}er.current=r,(0,u.Z)(function(){B(o);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,r=t.length;if(1!==Math.abs(n-r))return{add:!1,key:null};function o(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var r=t.filter(function(e){return!n.has(e)});return 1===r.length?r[0]:null}return n<r?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}(Z,o);if(null!==e.key){if(e.add){var t=q.findIndex(function(t){return t.key===e.key}),n=nD(n_(q,r,e.key),k,x,w),a=q.slice();a.splice(t+1,0,nR),V(a),Q(n),en("show")}else{var i=r.findIndex(function(t){return t.key===e.key}),l=nD(n_(r,q,e.key),k,x,w),s=r.slice();s.splice(i+1,0,nR),V(s),Q(l),en("hide")}}else q!==r&&(W(r),V(r))},[o,r]),a.useEffect(function(){g||eo()},[g]);var ea=b?$:r,ei={expandedKeys:o,selectedKeys:i,loadedKeys:c,loadingKeys:d,checkedKeys:l,halfCheckedKeys:f,dragOverNodeKey:v,dropPosition:y,keyEntities:p};return a.createElement(a.Fragment,null,O&&E&&a.createElement("span",{style:nN,"aria-live":"assertive"},function(e){for(var t=String(e.data.key),n=e;n.parent;)n=n.parent,t="".concat(n.data.key," > ").concat(t);return t}(E)),a.createElement("div",null,a.createElement("input",{style:nN,disabled:!1===S||h,tabIndex:!1!==S?C:null,onKeyDown:j,onFocus:_,onBlur:P,value:"",onChange:nT,"aria-label":"for screen reader"})),a.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},a.createElement("div",{className:"".concat(n,"-indent")},a.createElement("div",{ref:R,className:"".concat(n,"-indent-unit")}))),a.createElement(eI.Z,(0,m.Z)({},M,{data:ea,itemKey:nL,height:x,fullHeight:!1,virtual:k,itemHeight:w,prefixCls:"".concat(n,"-list"),ref:I,onVisibleChange:function(e,t){var n=new Set(e);t.filter(function(e){return!n.has(e)}).some(function(e){return nL(e)===nA})&&eo()}}),function(e){var t=e.pos,n=(0,m.Z)({},(nS(e.data),e.data)),r=e.title,o=e.key,i=e.isStart,l=e.isEnd,s=e0(o,t);delete n.key,delete n.children;var c=e3(s,ei);return a.createElement(nj,(0,m.Z)({},n,c,{title:r,active:!!E&&o===E.key,pos:t,data:e.data,isStart:i,isEnd:l,motion:b,motionNodes:o===nA?Y:null,motionType:et,onMotionStart:T,onMotionEnd:eo,treeNodeRequiredProps:ei,onMouseMove:function(){N(null)}}))}))});nZ.displayName="NodeList";var nz=function(e){(0,e$.Z)(n,e);var t=(0,eV.Z)(n);function n(){var e;(0,eW.Z)(this,n);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).destroyed=!1,e.delayedDragEnterLogic=void 0,e.loadingRetryTimes={},e.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:e1()},e.dragStartMousePosition=null,e.dragNode=void 0,e.currentMouseOverDroppableNodeKey=null,e.listRef=a.createRef(),e.onNodeDragStart=function(t,n){var r,o=e.state,a=o.expandedKeys,i=o.keyEntities,l=e.props.onDragStart,s=n.props.eventKey;e.dragNode=n,e.dragStartMousePosition={x:t.clientX,y:t.clientY};var c=tn(a,s);e.setState({draggingNodeKey:s,dragChildrenKeys:(r=[],function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,o=t.children;r.push(n),e(o)})}(i[s].children),r),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(c),window.addEventListener("dragend",e.onWindowDragEnd),null==l||l({event:t,node:e5(n.props)})},e.onNodeDragEnter=function(t,n){var r=e.state,o=r.expandedKeys,a=r.keyEntities,i=r.dragChildrenKeys,l=r.flattenNodes,s=r.indent,c=e.props,u=c.onDragEnter,d=c.onExpand,f=c.allowDrop,p=c.direction,h=n.props,m=h.pos,g=h.eventKey,v=(0,eK.Z)(e).dragNode;if(e.currentMouseOverDroppableNodeKey!==g&&(e.currentMouseOverDroppableNodeKey=g),!v){e.resetDragState();return}var y=ta(t,v,n,s,e.dragStartMousePosition,f,l,a,o,p),b=y.dropPosition,x=y.dropLevelOffset,w=y.dropTargetKey,k=y.dropContainerKey,S=y.dropTargetPos,E=y.dropAllowed,O=y.dragOverNodeKey;if(-1!==i.indexOf(w)||!E||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),v.props.eventKey!==n.props.eventKey&&(t.persist(),e.delayedDragEnterLogic[m]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var r=(0,es.Z)(o),i=a[n.props.eventKey];i&&(i.children||[]).length&&(r=tr(o,n.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(r),null==d||d(r,{node:e5(n.props),expanded:!0,nativeEvent:t.nativeEvent})}},800)),v.props.eventKey===w&&0===x)){e.resetDragState();return}e.setState({dragOverNodeKey:O,dropPosition:b,dropLevelOffset:x,dropTargetKey:w,dropContainerKey:k,dropTargetPos:S,dropAllowed:E}),null==u||u({event:t,node:e5(n.props),expandedKeys:o})},e.onNodeDragOver=function(t,n){var r=e.state,o=r.dragChildrenKeys,a=r.flattenNodes,i=r.keyEntities,l=r.expandedKeys,s=r.indent,c=e.props,u=c.onDragOver,d=c.allowDrop,f=c.direction,p=(0,eK.Z)(e).dragNode;if(p){var h=ta(t,p,n,s,e.dragStartMousePosition,d,a,i,l,f),m=h.dropPosition,g=h.dropLevelOffset,v=h.dropTargetKey,y=h.dropContainerKey,b=h.dropAllowed,x=h.dropTargetPos,w=h.dragOverNodeKey;-1===o.indexOf(v)&&b&&(p.props.eventKey===v&&0===g?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():m===e.state.dropPosition&&g===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&y===e.state.dropContainerKey&&x===e.state.dropTargetPos&&b===e.state.dropAllowed&&w===e.state.dragOverNodeKey||e.setState({dropPosition:m,dropLevelOffset:g,dropTargetKey:v,dropContainerKey:y,dropTargetPos:x,dropAllowed:b,dragOverNodeKey:w}),null==u||u({event:t,node:e5(n.props)}))}},e.onNodeDragLeave=function(t,n){e.currentMouseOverDroppableNodeKey!==n.props.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var r=e.props.onDragLeave;null==r||r({event:t,node:e5(n.props)})},e.onWindowDragEnd=function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(t,n){var r=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==r||r({event:t,node:e5(n.props)}),e.dragNode=null,window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDrop=function(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,i=a.dragChildrenKeys,l=a.dropPosition,s=a.dropTargetKey,c=a.dropTargetPos;if(a.dropAllowed){var u=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==s){var d=(0,O.Z)((0,O.Z)({},e3(s,e.getTreeNodeRequiredProps())),{},{active:(null===(r=e.getActiveItem())||void 0===r?void 0:r.key)===s,data:e.state.keyEntities[s].node}),f=-1!==i.indexOf(s);(0,T.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=to(c),h={event:t,node:e5(d),dragNode:e.dragNode?e5(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(i),dropToGap:0!==l,dropPosition:l+Number(p[p.length-1])};o||null==u||u(h),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(t,n){var r=e.state,o=r.expandedKeys,a=r.flattenNodes,i=n.expanded,l=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var s=a.filter(function(e){return e.key===l})[0],c=e5((0,O.Z)((0,O.Z)({},e3(l,e.getTreeNodeRequiredProps())),{},{data:s.data}));e.setExpandedKeys(i?tn(o,l):tr(o,l)),e.onNodeExpand(t,c)}},e.onNodeClick=function(t,n){var r=e.props,o=r.onClick;"click"===r.expandAction&&e.triggerExpandActionExpand(t,n),null==o||o(t,n)},e.onNodeDoubleClick=function(t,n){var r=e.props,o=r.onDoubleClick;"doubleClick"===r.expandAction&&e.triggerExpandActionExpand(t,n),null==o||o(t,n)},e.onNodeSelect=function(t,n){var r=e.state.selectedKeys,o=e.state,a=o.keyEntities,i=o.fieldNames,l=e.props,s=l.onSelect,c=l.multiple,u=n.selected,d=n[i.key],f=!u,p=(r=f?c?tr(r,d):[d]:tn(r,d)).map(function(e){var t=a[e];return t?t.node:null}).filter(function(e){return e});e.setUncontrolledState({selectedKeys:r}),null==s||s(r,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,r){var o,a=e.state,i=a.keyEntities,l=a.checkedKeys,s=a.halfCheckedKeys,c=e.props,u=c.checkStrictly,d=c.onCheck,f=n.key,p={event:"check",node:n,checked:r,nativeEvent:t.nativeEvent};if(u){var h=r?tr(l,f):tn(l,f);o={checked:h,halfChecked:tn(s,f)},p.checkedNodes=h.map(function(e){return i[e]}).filter(function(e){return e}).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:h})}else{var m=td([].concat((0,es.Z)(l),[f]),!0,i),g=m.checkedKeys,v=m.halfCheckedKeys;if(!r){var y=new Set(g);y.delete(f);var b=td(Array.from(y),{checked:!1,halfCheckedKeys:v},i);g=b.checkedKeys,v=b.halfCheckedKeys}o=g,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=v,g.forEach(function(e){var t=i[e];if(t){var n=t.node,r=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:r})}}),e.setUncontrolledState({checkedKeys:g},!1,{halfCheckedKeys:v})}null==d||d(o,p)},e.onNodeLoad=function(t){var n=t.key,r=new Promise(function(r,o){e.setState(function(a){var i=a.loadedKeys,l=a.loadingKeys,s=void 0===l?[]:l,c=e.props,u=c.loadData,d=c.onLoad;return u&&-1===(void 0===i?[]:i).indexOf(n)&&-1===s.indexOf(n)?(u(t).then(function(){var o=tr(e.state.loadedKeys,n);null==d||d(o,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:o}),e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),r()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),e.loadingRetryTimes[n]=(e.loadingRetryTimes[n]||0)+1,e.loadingRetryTimes[n]>=10){var a=e.state.loadedKeys;(0,T.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:tr(a,n)}),r()}o(t)}),{loadingKeys:tr(s,n)}):null})});return r.catch(function(){}),r},e.onNodeMouseEnter=function(t,n){var r=e.props.onMouseEnter;null==r||r({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var r=e.props.onMouseLeave;null==r||r({event:t,node:n})},e.onNodeContextMenu=function(t,n){var r=e.props.onRightClick;r&&(t.preventDefault(),r({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t||t.apply(void 0,r)},e.onBlur=function(){var t=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t||t.apply(void 0,r)},e.getTreeNodeRequiredProps=function(){var t=e.state;return{expandedKeys:t.expandedKeys||[],selectedKeys:t.selectedKeys||[],loadedKeys:t.loadedKeys||[],loadingKeys:t.loadingKeys||[],checkedKeys:t.checkedKeys||[],halfCheckedKeys:t.halfCheckedKeys||[],dragOverNodeKey:t.dragOverNodeKey,dropPosition:t.dropPosition,keyEntities:t.keyEntities}},e.setExpandedKeys=function(t){var n=e.state,r=e6(n.treeData,t,n.fieldNames);e.setUncontrolledState({expandedKeys:t,flattenNodes:r},!0)},e.onNodeExpand=function(t,n){var r=e.state.expandedKeys,o=e.state,a=o.listChanging,i=o.fieldNames,l=e.props,s=l.onExpand,c=l.loadData,u=n.expanded,d=n[i.key];if(!a){var f=r.indexOf(d),p=!u;if((0,T.ZP)(u&&-1!==f||!u&&-1===f,"Expand state not sync with index check"),r=p?tr(r,d):tn(r,d),e.setExpandedKeys(r),null==s||s(r,{node:n,expanded:p,nativeEvent:t.nativeEvent}),p&&c){var h=e.onNodeLoad(n);h&&h.then(function(){var t=e6(e.state.treeData,r,i);e.setUncontrolledState({flattenNodes:t})}).catch(function(){var t=tn(e.state.expandedKeys,d);e.setExpandedKeys(t)})}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout(function(){e.setUncontrolledState({listChanging:!1})})},e.onActiveChange=function(t){var n=e.state.activeKey,r=e.props,o=r.onActiveChange,a=r.itemScrollOffset;n!==t&&(e.setState({activeKey:t}),null!==t&&e.scrollTo({key:t,offset:void 0===a?0:a}),null==o||o(t))},e.getActiveItem=function(){var t=e.state,n=t.activeKey,r=t.flattenNodes;return null===n?null:r.find(function(e){return e.key===n})||null},e.offsetActiveKey=function(t){var n=e.state,r=n.flattenNodes,o=n.activeKey,a=r.findIndex(function(e){return e.key===o});-1===a&&t<0&&(a=r.length),a=(a+t+r.length)%r.length;var i=r[a];if(i){var l=i.key;e.onActiveChange(l)}else e.onActiveChange(null)},e.onKeyDown=function(t){var n=e.state,r=n.activeKey,o=n.expandedKeys,a=n.checkedKeys,i=n.fieldNames,l=e.props,s=l.onKeyDown,c=l.checkable,u=l.selectable;switch(t.which){case tz.Z.UP:e.offsetActiveKey(-1),t.preventDefault();break;case tz.Z.DOWN:e.offsetActiveKey(1),t.preventDefault()}var d=e.getActiveItem();if(d&&d.data){var f=e.getTreeNodeRequiredProps(),p=!1===d.data.isLeaf||!!(d.data[i.children]||[]).length,h=e5((0,O.Z)((0,O.Z)({},e3(r,f)),{},{data:d.data,active:!0}));switch(t.which){case tz.Z.LEFT:p&&o.includes(r)?e.onNodeExpand({},h):d.parent&&e.onActiveChange(d.parent.key),t.preventDefault();break;case tz.Z.RIGHT:p&&!o.includes(r)?e.onNodeExpand({},h):d.children&&d.children.length&&e.onActiveChange(d.children[0].key),t.preventDefault();break;case tz.Z.ENTER:case tz.Z.SPACE:!c||h.disabled||!1===h.checkable||h.disableCheckbox?c||!u||h.disabled||!1===h.selectable||e.onNodeSelect({},h):e.onNodeCheck({},h,!a.includes(r))}}null==s||s(t)},e.setUncontrolledState=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var o=!1,a=!0,i={};Object.keys(t).forEach(function(n){if(n in e.props){a=!1;return}o=!0,i[n]=t[n]}),o&&(!n||a)&&e.setState((0,O.Z)((0,O.Z)({},i),r))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return(0,eU.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t,n=this.state,r=n.focused,o=n.flattenNodes,i=n.keyEntities,l=n.draggingNodeKey,s=n.activeKey,c=n.dropLevelOffset,u=n.dropContainerKey,d=n.dropTargetKey,f=n.dropPosition,p=n.dragOverNodeKey,h=n.indent,g=this.props,v=g.prefixCls,y=g.className,b=g.style,x=g.showLine,w=g.focusable,k=g.tabIndex,S=g.selectable,O=g.showIcon,j=g.icon,P=g.switcherIcon,N=g.draggable,T=g.checkable,A=g.checkStrictly,M=g.disabled,I=g.motion,R=g.loadData,D=g.filterTreeNode,L=g.height,Z=g.itemHeight,z=g.virtual,B=g.titleRender,F=g.dropIndicatorRender,H=g.onContextMenu,q=g.onScroll,W=g.direction,U=g.rootClassName,K=g.rootStyle,V=(0,$.Z)(this.props,{aria:!0,data:!0});return N&&(t="object"===(0,E.Z)(N)?N:"function"==typeof N?{nodeDraggable:N}:{}),a.createElement(eX.Provider,{value:{prefixCls:v,selectable:S,showIcon:O,icon:j,switcherIcon:P,draggable:t,draggingNodeKey:l,checkable:T,checkStrictly:A,disabled:M,keyEntities:i,dropLevelOffset:c,dropContainerKey:u,dropTargetKey:d,dropPosition:f,dragOverNodeKey:p,indent:h,direction:W,dropIndicatorRender:F,loadData:R,filterTreeNode:D,titleRender:B,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},a.createElement("div",{role:"tree",className:_()(v,y,U,(e={},(0,C.Z)(e,"".concat(v,"-show-line"),x),(0,C.Z)(e,"".concat(v,"-focused"),r),(0,C.Z)(e,"".concat(v,"-active-focused"),null!==s),e)),style:K},a.createElement(nZ,(0,m.Z)({ref:this.listRef,prefixCls:v,style:b,data:o,disabled:M,selectable:S,checkable:!!T,motion:I,dragging:null!==l,height:L,itemHeight:Z,virtual:z,focusable:w,focused:r,tabIndex:void 0===k?0:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:H,onScroll:q},this.getTreeNodeRequiredProps(),V))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,r,o=t.prevProps,a={prevProps:e};function i(t){return!o&&t in e||o&&o[t]!==e[t]}var l=t.fieldNames;if(i("fieldNames")&&(l=e1(e.fieldNames),a.fieldNames=l),i("treeData")?n=e.treeData:i("children")&&((0,T.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=e2(e.children)),n){a.treeData=n;var s=e4(n,{fieldNames:l});a.keyEntities=(0,O.Z)((0,C.Z)({},nA,nI),s.keyEntities)}var c=a.keyEntities||t.keyEntities;if(i("expandedKeys")||o&&i("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!o&&e.defaultExpandParent?ts(e.expandedKeys,c):e.expandedKeys;else if(!o&&e.defaultExpandAll){var u=(0,O.Z)({},c);delete u[nA],a.expandedKeys=Object.keys(u).map(function(e){return u[e].key})}else!o&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?ts(e.defaultExpandedKeys,c):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var d=e6(n||t.treeData,a.expandedKeys||t.expandedKeys,l);a.flattenNodes=d}if(e.selectable&&(i("selectedKeys")?a.selectedKeys=ti(e.selectedKeys,e):!o&&e.defaultSelectedKeys&&(a.selectedKeys=ti(e.defaultSelectedKeys,e))),e.checkable&&(i("checkedKeys")?r=tl(e.checkedKeys)||{}:!o&&e.defaultCheckedKeys?r=tl(e.defaultCheckedKeys)||{}:n&&(r=tl(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),r)){var f=r,p=f.checkedKeys,h=void 0===p?[]:p,m=f.halfCheckedKeys,g=void 0===m?[]:m;if(!e.checkStrictly){var v=td(h,!0,c);h=v.checkedKeys,g=v.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=g}return i("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(a.Component);nz.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:o.top=0,o.left=-n*r;break;case 1:o.bottom=0,o.left=-n*r;break;case 0:o.bottom=0,o.left=r}return a.createElement("div",{style:o})},allowDrop:function(){return!0},expandAction:!1},nz.TreeNode=tt;var nB={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},nF=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nB}))}),nH={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nq=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nH}))}),nW={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nU=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nW}))}),nK={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},n$=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nK}))}),nV=n(68710),nX=n(23159),nG=n(63074);let nY=new t0.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nQ=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nJ=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,t0.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),n0=(e,t)=>{let{treeCls:n,treeNodeCls:r,treeNodePadding:o,titleHeight:a,nodeSelectedBg:i,nodeHoverBg:l}=t,s=t.paddingXS;return{[n]:Object.assign(Object.assign({},(0,t6.Wf)(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),["&".concat(n,"-rtl")]:{["".concat(n,"-switcher")]:{"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(90deg)"}}}}},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:Object.assign({},(0,t6.oN)(t)),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(r,".dragging")]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:nY,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},["".concat(r)]:{display:"flex",alignItems:"flex-start",padding:"0 0 ".concat((0,t0.bf)(o)," 0"),outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{["".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(r,"-disabled).filter-node ").concat(n,"-title")]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",visibility:"visible",opacity:.2,transition:"opacity ".concat(t.motionDurationSlow),["".concat(r,":hover &")]:{opacity:.45}},["&".concat(r,"-disabled")]:{["".concat(n,"-draggable-icon")]:{visibility:"hidden"}}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:a}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nQ(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,margin:0,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),borderRadius:t.borderRadius,"&-noop":{cursor:"unset"},["&:not(".concat(n,"-switcher-noop):hover")]:{backgroundColor:t.colorBgTextHover},"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-checkbox")]:{top:"initial",marginInlineEnd:s,alignSelf:"flex-start",marginTop:t.marginXXS},["".concat(n,"-node-content-wrapper, ").concat(n,"-checkbox + span")]:{position:"relative",zIndex:"auto",minHeight:a,margin:0,padding:"0 ".concat((0,t0.bf)(t.calc(t.paddingXS).div(2).equal())),color:"inherit",lineHeight:"".concat((0,t0.bf)(a)),background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s"),"&:hover":{backgroundColor:l},["&".concat(n,"-node-selected")]:{backgroundColor:i},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(n,"-node-content-wrapper")]:Object.assign({lineHeight:"".concat((0,t0.bf)(a)),userSelect:"none"},nJ(e,t)),["".concat(r,".drop-container")]:{"> [draggable]":{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)}},"&-show-line":{["".concat(n,"-indent")]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end":{"&:before":{display:"none"}}}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(r,"-leaf-last")]:{["".concat(n,"-switcher")]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:"".concat((0,t0.bf)(t.calc(a).div(2).equal())," !important")}}}}})}},n1=e=>{let{treeCls:t,treeNodeCls:n,treeNodePadding:r,directoryNodeSelectedBg:o,directoryNodeSelectedColor:a}=e;return{["".concat(t).concat(t,"-directory")]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,transition:"background-color ".concat(e.motionDurationMid),content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},["".concat(t,"-switcher")]:{transition:"color ".concat(e.motionDurationMid)},["".concat(t,"-node-content-wrapper")]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},["&".concat(t,"-node-selected")]:{color:a,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:o},["".concat(t,"-switcher")]:{color:a},["".concat(t,"-node-content-wrapper")]:{color:a,background:"transparent"}}}}}},n2=(e,t)=>{let n=".".concat(e),r=t.calc(t.paddingXS).div(2).equal(),o=(0,t4.TS)(t,{treeCls:n,treeNodeCls:"".concat(n,"-treenode"),treeNodePadding:r});return[n0(e,o),n1(o)]},n6=e=>{let{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}};var n4=(0,t3.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nX.C2)("".concat(n,"-checkbox"),e)},n2(n,e),(0,nG.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},n6(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})});function n3(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:o,direction:i="ltr"}=e,l="ltr"===i?"left":"right",s={[l]:-n*o+4,["ltr"===i?"right":"left"]:0};switch(t){case -1:s.top=-3;break;case 1:s.bottom=-3;break;default:s.bottom=-3,s[l]=o+4}return a.createElement("div",{style:s,className:"".concat(r,"-drop-indicator")})}var n5={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},n8=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:n5}))}),n7=n(61935),n9={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},re=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:n9}))}),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},rn=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rt}))}),rr=n(19722),ro=e=>{let t;let{prefixCls:n,switcherIcon:r,treeNodeProps:o,showLine:i}=e,{isLeaf:l,expanded:s,loading:c}=o;if(c)return a.createElement(n7.Z,{className:"".concat(n,"-switcher-loading-icon")});if(i&&"object"==typeof i&&(t=i.showLeafIcon),l){if(!i)return null;if("boolean"!=typeof t&&t){let e="function"==typeof t?t(o):t;return(0,rr.l$)(e)?(0,rr.Tm)(e,{className:_()(e.props.className||"","".concat(n,"-switcher-line-custom-icon"))}):e}return t?a.createElement(nF,{className:"".concat(n,"-switcher-line-icon")}):a.createElement("span",{className:"".concat(n,"-switcher-leaf-line")})}let u="".concat(n,"-switcher-icon"),d="function"==typeof r?r(o):r;return(0,rr.l$)(d)?(0,rr.Tm)(d,{className:_()(d.props.className||"",u)}):void 0!==d?d:i?s?a.createElement(re,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(rn,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(n8,{className:u})};let ra=a.forwardRef((e,t)=>{var n;let{getPrefixCls:r,direction:o,virtual:i,tree:l}=a.useContext(tC.E_),{prefixCls:s,className:c,showIcon:u=!1,showLine:d,switcherIcon:f,blockNode:p=!1,children:h,checkable:m=!1,selectable:g=!0,draggable:v,motion:y,style:b}=e,x=r("tree",s),w=r(),k=null!=y?y:Object.assign(Object.assign({},(0,nV.Z)(w)),{motionAppear:!1}),S=Object.assign(Object.assign({},e),{checkable:m,selectable:g,showIcon:u,motion:k,blockNode:p,showLine:!!d,dropIndicatorRender:n3}),[E,O,C]=n4(x),[,j]=(0,nl.ZP)(),P=j.paddingXS/2+((null===(n=j.Tree)||void 0===n?void 0:n.titleHeight)||j.controlHeightSM),N=a.useMemo(()=>{if(!v)return!1;let e={};switch(typeof v){case"function":e.nodeDraggable=v;break;case"object":e=Object.assign({},v)}return!1!==e.icon&&(e.icon=e.icon||a.createElement(n$,null)),e},[v]);return E(a.createElement(nz,Object.assign({itemHeight:P,ref:t,virtual:i},S,{style:Object.assign(Object.assign({},null==l?void 0:l.style),b),prefixCls:x,className:_()({["".concat(x,"-icon-hide")]:!u,["".concat(x,"-block-node")]:p,["".concat(x,"-unselectable")]:!g,["".concat(x,"-rtl")]:"rtl"===o},null==l?void 0:l.className,c,O,C),direction:o,checkable:m?a.createElement("span",{className:"".concat(x,"-checkbox-inner")}):m,selectable:g,switcherIcon:e=>a.createElement(ro,{prefixCls:x,switcherIcon:f,treeNodeProps:e,showLine:d}),draggable:N}),h))});function ri(e,t,n){let{key:r,children:o}=n;e.forEach(function(e){let a=e[r],i=e[o];!1!==t(a,e)&&ri(i||[],t,n)})}(r=o||(o={}))[r.None=0]="None",r[r.Start=1]="Start",r[r.End=2]="End";var rl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function rs(e){let{isLeaf:t,expanded:n}=e;return t?a.createElement(nF,null):n?a.createElement(nq,null):a.createElement(nU,null)}function rc(e){let{treeData:t,children:n}=e;return t||e2(n)}let ru=a.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:i}=e,l=rl(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let s=a.useRef(),c=a.useRef(),u=()=>{let{keyEntities:e}=e4(rc(l));return n?Object.keys(e):r?ts(l.expandedKeys||i||[],e):l.expandedKeys||i},[d,f]=a.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[p,h]=a.useState(()=>u());a.useEffect(()=>{"selectedKeys"in l&&f(l.selectedKeys)},[l.selectedKeys]),a.useEffect(()=>{"expandedKeys"in l&&h(l.expandedKeys)},[l.expandedKeys]);let{getPrefixCls:m,direction:g}=a.useContext(tC.E_),{prefixCls:v,className:y,showIcon:b=!0,expandAction:x="click"}=l,w=rl(l,["prefixCls","className","showIcon","expandAction"]),k=m("tree",v),S=_()("".concat(k,"-directory"),{["".concat(k,"-directory-rtl")]:"rtl"===g},y);return a.createElement(ra,Object.assign({icon:rs,ref:t,blockNode:!0},w,{showIcon:b,expandAction:x,prefixCls:k,className:S,expandedKeys:p,selectedKeys:d,onSelect:(e,t)=>{var n;let r;let{multiple:a,fieldNames:i}=l,{node:u,nativeEvent:d}=t,{key:h=""}=u,m=rc(l),g=Object.assign(Object.assign({},t),{selected:!0}),v=(null==d?void 0:d.ctrlKey)||(null==d?void 0:d.metaKey),y=null==d?void 0:d.shiftKey;a&&v?(r=e,s.current=h,c.current=r):a&&y?r=Array.from(new Set([].concat((0,es.Z)(c.current||[]),(0,es.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:r,endKey:a,fieldNames:i}=e,l=[],s=o.None;return r&&r===a?[r]:r&&a?(ri(t,e=>{if(s===o.End)return!1;if(e===r||e===a){if(l.push(e),s===o.None)s=o.Start;else if(s===o.Start)return s=o.End,!1}else s===o.Start&&l.push(e);return n.includes(e)},e1(i)),l):[]}({treeData:m,expandedKeys:p,startKey:h,endKey:s.current,fieldNames:i}))))):(r=[h],s.current=h,c.current=r),g.selectedNodes=function(e,t,n){let r=(0,es.Z)(t),o=[];return ri(e,(e,t)=>{let n=r.indexOf(e);return -1!==n&&(o.push(t),r.splice(n,1)),!!r.length},e1(n)),o}(m,r,i),null===(n=l.onSelect)||void 0===n||n.call(l,r,g),"selectedKeys"in l||f(r)},onExpand:(e,t)=>{var n;return"expandedKeys"in l||h(e),null===(n=l.onExpand)||void 0===n?void 0:n.call(l,e,t)}}))});ra.DirectoryTree=ru,ra.TreeNode=tt;var rd=n(29436),rf=n(64482),rp=function(e){let{value:t,onChange:n,filterSearch:r,tablePrefixCls:o,locale:i}=e;return r?a.createElement("div",{className:"".concat(o,"-filter-dropdown-search")},a.createElement(rf.default,{prefix:a.createElement(rd.Z,null),placeholder:i.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,className:"".concat(o,"-filter-dropdown-search-input")})):null};let rh=e=>{let{keyCode:t}=e;t===tz.Z.ENTER&&e.stopPropagation()},rm=a.forwardRef((e,t)=>a.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:rh,ref:t},e.children));function rg(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:r}=e;t.push(n),r&&(t=[].concat((0,es.Z)(t),(0,es.Z)(rg(r))))}),t}function rv(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var ry=function(e){var t,n;let r,o;let{tablePrefixCls:i,prefixCls:l,column:s,dropdownPrefixCls:c,columnKey:u,filterMultiple:f,filterMode:p="menu",filterSearch:h=!1,filterState:m,triggerFilter:g,locale:v,children:y,getPopupContainer:b,rootClassName:x}=e,{filterDropdownOpen:w,onFilterDropdownOpenChange:k,filterResetToDefaultFilteredValue:S,defaultFilteredValue:E,filterDropdownVisible:O,onFilterDropdownVisibleChange:C}=s,[j,P]=a.useState(!1),N=!!(m&&((null===(t=m.filteredKeys)||void 0===t?void 0:t.length)||m.forceFiltered)),T=e=>{P(e),null==k||k(e),null==C||C(e)},A=null!==(n=null!=w?w:O)&&void 0!==n?n:j,M=null==m?void 0:m.filteredKeys,[I,R]=function(e){let t=a.useRef(e),n=(0,ny.Z)();return[()=>t.current,e=>{t.current=e,n()}]}(M||[]),D=e=>{let{selectedKeys:t}=e;R(t)};a.useEffect(()=>{j&&D({selectedKeys:M||[]})},[M]);let[L,Z]=a.useState([]),[z,B]=a.useState(""),F=e=>{let{value:t}=e.target;B(t)};a.useEffect(()=>{j||B("")},[j]);let H=e=>{let t=e&&e.length?e:null;if(null===t&&(!m||!m.filteredKeys)||(0,d.Z)(t,null==m?void 0:m.filteredKeys,!0))return null;g({column:s,key:u,filteredKeys:t})},q=()=>{T(!1),H(I())},W=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&H([]),t&&T(!1),B(""),S?R((E||[]).map(e=>String(e))):R([])},U=_()({["".concat(c,"-menu-without-submenu")]:!(s.filters||[]).some(e=>{let{children:t}=e;return t})}),K=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),r={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(r.children=K({filters:e.children})),r})},$=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>$(e)))||[]})};if("function"==typeof s.filterDropdown)r=s.filterDropdown({prefixCls:"".concat(c,"-custom"),setSelectedKeys:e=>D({selectedKeys:e}),selectedKeys:I(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&T(!1),H(I())},clearFilters:W,filters:s.filters,visible:A,close:()=>{T(!1)}});else if(s.filterDropdown)r=s.filterDropdown;else{let e=I()||[];r=a.createElement(a.Fragment,null,0===(s.filters||[]).length?a.createElement(nx.Z,{image:nx.Z.PRESENTED_IMAGE_SIMPLE,description:v.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):"tree"===p?a.createElement(a.Fragment,null,a.createElement(rp,{filterSearch:h,value:z,onChange:F,tablePrefixCls:i,locale:v}),a.createElement("div",{className:"".concat(i,"-filter-dropdown-tree")},f?a.createElement(th.Z,{checked:e.length===rg(s.filters).length,indeterminate:e.length>0&&e.length<rg(s.filters).length,className:"".concat(i,"-filter-dropdown-checkall"),onChange:e=>{e.target.checked?R(rg(null==s?void 0:s.filters).map(e=>String(e))):R([])}},v.filterCheckall):null,a.createElement(ra,{checkable:!0,selectable:!1,blockNode:!0,multiple:f,checkStrictly:!f,className:"".concat(c,"-menu"),onCheck:(e,t)=>{let{node:n,checked:r}=t;f?D({selectedKeys:e}):D({selectedKeys:r&&n.key?[n.key]:[]})},checkedKeys:e,selectedKeys:e,showIcon:!1,treeData:K({filters:s.filters}),autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:z.trim()?e=>"function"==typeof h?h(z,$(e)):rv(z,e.title):void 0}))):a.createElement(a.Fragment,null,a.createElement(rp,{filterSearch:h,value:z,onChange:F,tablePrefixCls:i,locale:v}),a.createElement(nw.Z,{selectable:!0,multiple:f,prefixCls:"".concat(c,"-menu"),className:U,onSelect:D,onDeselect:D,selectedKeys:e,getPopupContainer:b,openKeys:L,onOpenChange:e=>{Z(e)},items:function e(t){let{filters:n,prefixCls:r,filteredKeys:o,filterMultiple:i,searchValue:l,filterSearch:s}=t;return n.map((t,n)=>{let c=String(t.value);if(t.children)return{key:c||n,label:t.text,popupClassName:"".concat(r,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:r,filteredKeys:o,filterMultiple:i,searchValue:l,filterSearch:s})};let u=i?th.Z:tg.ZP,d={key:void 0!==t.value?c:n,label:a.createElement(a.Fragment,null,a.createElement(u,{checked:o.includes(c)}),a.createElement("span",null,t.text))};return l.trim()?"function"==typeof s?s(l,t)?d:null:rv(l,t.text)?d:null:d})}({filters:s.filters||[],filterSearch:h,prefixCls:l,filteredKeys:I(),filterMultiple:f,searchValue:z})})),a.createElement("div",{className:"".concat(l,"-dropdown-btns")},a.createElement(nb.ZP,{type:"link",size:"small",disabled:S?(0,d.Z)((E||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>W()},v.filterReset),a.createElement(nb.ZP,{type:"primary",size:"small",onClick:q},v.filterConfirm)))}s.filterDropdown&&(r=a.createElement(nk.J,{selectable:void 0},r)),o="function"==typeof s.filterIcon?s.filterIcon(N):s.filterIcon?s.filterIcon:a.createElement(nv,null);let{direction:V}=a.useContext(tC.E_);return a.createElement("div",{className:"".concat(l,"-column")},a.createElement("span",{className:"".concat(i,"-column-title")},y),a.createElement(tm.Z,{dropdownRender:()=>a.createElement(rm,{className:"".concat(l,"-dropdown")},r),trigger:["click"],open:A,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==M&&R(M||[]),T(e),e||s.filterDropdown||q())},getPopupContainer:b,placement:"rtl"===V?"bottomLeft":"bottomRight",rootClassName:x},a.createElement("span",{role:"button",tabIndex:-1,className:_()("".concat(l,"-trigger"),{active:N}),onClick:e=>{e.stopPropagation()}},o)))};function rb(e,t,n){let r=[];return(e||[]).forEach((e,o)=>{var a;let i=nh(o,n);if(e.filters||"filterDropdown"in e||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;"filterDropdown"in e||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),r.push({column:e,key:np(e,i),filteredKeys:t,forceFiltered:e.filtered})}else r.push({column:e,key:np(e,i),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(r=[].concat((0,es.Z)(r),(0,es.Z)(rb(e.children,t,i))))}),r}function rx(e){let t={};return e.forEach(e=>{let{key:n,filteredKeys:r,column:o}=e,{filters:a,filterDropdown:i}=o;if(i)t[n]=r||null;else if(Array.isArray(r)){let e=rg(a);t[n]=e.filter(e=>r.includes(String(e)))}else t[n]=null}),t}function rw(e,t){return t.reduce((e,t)=>{let{column:{onFilter:n,filters:r},filteredKeys:o}=t;return n&&o&&o.length?e.filter(e=>o.some(t=>{let o=rg(r),a=o.findIndex(e=>String(e)===String(t));return n(-1!==a?o[a]:t,e)})):e},e)}let rk=e=>e.flatMap(e=>"children"in e?[e].concat((0,es.Z)(rk(e.children||[]))):[e]);var rS=function(e){let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,onFilterChange:o,getPopupContainer:i,locale:l,rootClassName:s}=e;(0,tp.ln)("Table");let c=a.useMemo(()=>rk(r||[]),[r]),[u,d]=a.useState(()=>rb(c,!0)),f=a.useMemo(()=>{let e=rb(c,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(c||[]).map((e,t)=>np(e,nh(t)));return u.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=c[e.findIndex(e=>e===t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[c,u]),p=a.useMemo(()=>rx(f),[f]),h=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),d(t),o(rx(t),t)};return[e=>(function e(t,n,r,o,i,l,s,c,u){return r.map((r,d)=>{let f=nh(d,c),{filterMultiple:p=!0,filterMode:h,filterSearch:m}=r,g=r;if(g.filters||g.filterDropdown){let e=np(g,f),c=o.find(t=>{let{key:n}=t;return e===n});g=Object.assign(Object.assign({},g),{title:o=>a.createElement(ry,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:g,columnKey:e,filterState:c,filterMultiple:p,filterMode:h,filterSearch:m,triggerFilter:l,locale:i,getPopupContainer:s,rootClassName:u},nm(r.title,o))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:e(t,n,g.children,o,i,l,s,f,u)})),g})})(t,n,e,f,l,h,i,void 0,s),f,p]},rE=function(){let e=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t<arguments.length;t++){let n=t<0||arguments.length<=t?void 0:arguments[t];n&&Object.keys(n).forEach(t=>{let r=n[t];void 0!==r&&(e[t]=r)})}return e},rO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},rC=function(e,t,n){let r=n&&"object"==typeof n?n:{},{total:o=0}=r,i=rO(r,["total"]),[l,s]=(0,a.useState)(()=>({current:"defaultCurrent"in i?i.defaultCurrent:1,pageSize:"defaultPageSize"in i?i.defaultPageSize:10})),c=rE(l,i,{total:o>0?o:e}),u=Math.ceil((o||e)/c.pageSize);c.current>u&&(c.current=u||1);let d=(e,t)=>{s({current:null!=e?e:1,pageSize:t||c.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},c),{onChange:(e,r)=>{var o;n&&(null===(o=n.onChange)||void 0===o||o.call(n,e,r)),d(e,r),t(e,r||(null==c?void 0:c.pageSize))}}),d]},rj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},r_=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rj}))}),rP={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},rN=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rP}))}),rT=n(89970);let rA="ascend",rM="descend";function rI(e){return"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple}function rR(e){return"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare}function rD(e,t,n){let r=[];function o(e,t){r.push({column:e,key:np(e,t),multiplePriority:rI(e),sortOrder:e.sortOrder})}return(e||[]).forEach((e,a)=>{let i=nh(a,n);e.children?("sortOrder"in e&&o(e,i),r=[].concat((0,es.Z)(r),(0,es.Z)(rD(e.children,t,i)))):e.sorter&&("sortOrder"in e?o(e,i):t&&e.defaultSortOrder&&r.push({column:e,key:np(e,i),multiplePriority:rI(e),sortOrder:e.defaultSortOrder}))}),r}function rL(e){let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function rZ(e){let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(rL);return 0===t.length&&e.length?Object.assign(Object.assign({},rL(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function rz(e,t,n){let r=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),o=e.slice(),a=r.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return rR(t)&&n});return a.length?o.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let{column:{sorter:r},sortOrder:o}=a[n],i=rR(r);if(i&&o){let n=i(e,t,o);if(0!==n)return o===rA?n:-n}}return 0}).map(e=>{let r=e[n];return r?Object.assign(Object.assign({},e),{[n]:rz(r,t,n)}):e}):o}var rB=x(eA,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),rF=x(eH,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),rH=n(36360),rq=e=>{let{componentCls:t,lineWidth:n,lineType:r,tableBorderColor:o,tableHeaderBg:a,tablePaddingVertical:i,tablePaddingHorizontal:l,calc:s}=e,c="".concat((0,t0.bf)(n)," ").concat(r," ").concat(o),u=(e,r,o)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(s(r).mul(-1).equal()),"\n ").concat((0,t0.bf)(s(s(o).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:c,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:c,borderTop:c,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:c},"> thead":{"> tr:not(:last-child) > th":{borderBottom:c},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:c}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(s(i).mul(-1).equal())," ").concat((0,t0.bf)(s(s(l).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:c,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},u("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),u("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:c,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,t0.bf)(n)," 0 ").concat((0,t0.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:c}}}},rW=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},t6.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},rU=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},rK=n(76122),r$=e=>{let{componentCls:t,antCls:n,motionDurationSlow:r,lineWidth:o,paddingXS:a,lineType:i,tableBorderColor:l,tableExpandIconBg:s,tableExpandColumnWidth:c,borderRadius:u,tablePaddingVertical:d,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:h,expandIconMarginTop:m,expandIconSize:g,expandIconHalfInner:v,expandIconScale:y,calc:b}=e,x="".concat((0,t0.bf)(o)," ").concat(i," ").concat(l),w=b(h).sub(o).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:c},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,rK.N)(e)),{position:"relative",float:"left",boxSizing:"border-box",width:g,height:g,padding:0,color:"inherit",lineHeight:(0,t0.bf)(g),background:s,border:x,borderRadius:u,transform:"scale(".concat(y,")"),transition:"all ".concat(r),userSelect:"none","&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(r," ease-out"),content:'""'},"&::before":{top:v,insetInlineEnd:w,insetInlineStart:w,height:o},"&::after":{top:w,bottom:w,insetInlineStart:v,width:o,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:m,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"auto"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,t0.bf)(b(d).mul(-1).equal())," ").concat((0,t0.bf)(b(f).mul(-1).equal())),padding:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(f))}}}},rV=e=>{let{componentCls:t,antCls:n,iconCls:r,tableFilterDropdownWidth:o,tableFilterDropdownSearchWidth:a,paddingXXS:i,paddingXS:l,colorText:s,lineWidth:c,lineType:u,tableBorderColor:d,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:h,borderRadius:m,motionDurationSlow:g,colorTextDescription:v,colorPrimary:y,tableHeaderFilterActiveBg:b,colorTextDisabled:x,tableFilterDropdownBg:w,tableFilterDropdownHeight:k,controlItemBgHover:S,controlItemBgActive:E,boxShadowSecondary:O,filterDropdownMenuBg:C,calc:j}=e,_="".concat(n,"-dropdown"),P="".concat(t,"-filter-dropdown"),N="".concat(n,"-tree"),T="".concat((0,t0.bf)(c)," ").concat(u," ").concat(d);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:j(i).mul(-1).equal(),marginInline:"".concat((0,t0.bf)(i)," ").concat((0,t0.bf)(j(h).div(2).mul(-1).equal())),padding:"0 ".concat((0,t0.bf)(i)),color:f,fontSize:p,borderRadius:m,cursor:"pointer",transition:"all ".concat(g),"&:hover":{color:v,background:b},"&.active":{color:y}}}},{["".concat(n,"-dropdown")]:{[P]:Object.assign(Object.assign({},(0,t6.Wf)(e)),{minWidth:o,backgroundColor:w,borderRadius:m,boxShadow:O,overflow:"hidden",["".concat(_,"-menu")]:{maxHeight:k,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:C,"&:empty::after":{display:"block",padding:"".concat((0,t0.bf)(l)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(P,"-tree")]:{paddingBlock:"".concat((0,t0.bf)(l)," 0"),paddingInline:l,[N]:{padding:0},["".concat(N,"-treenode ").concat(N,"-node-content-wrapper:hover")]:{backgroundColor:S},["".concat(N,"-treenode-checkbox-checked ").concat(N,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(P,"-search")]:{padding:l,borderBottom:T,"&-input":{input:{minWidth:a},[r]:{color:x}}},["".concat(P,"-checkall")]:{width:"100%",marginBottom:i,marginInlineStart:i},["".concat(P,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,t0.bf)(j(l).sub(c).equal())," ").concat((0,t0.bf)(l)),overflow:"hidden",borderTop:T}})}},{["".concat(n,"-dropdown ").concat(P,", ").concat(P,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:l,color:s},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},rX=e=>{let{componentCls:t,lineWidth:n,colorSplit:r,motionDurationSlow:o,zIndexTableFixed:a,tableBg:i,zIndexTableSticky:l,calc:s}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:i},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:s(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:s(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:s(l).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(r)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(r)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(r)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(r)}}}}},rG=e=>{let{componentCls:t,antCls:n,margin:r}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,t0.bf)(r)," 0")},["".concat(t,"-pagination")]:{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"> *":{flex:"none"},"&-left":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-right":{justifyContent:"flex-end"}}}}},rY=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n))}}}}},rQ=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},rJ=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSizeIcon:o,padding:a,paddingXS:i,headerIconColor:l,headerIconHoverColor:s,tableSelectionColumnWidth:c,tableSelectedRowBg:u,tableSelectedRowHoverBg:d,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:h}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:c,["&".concat(t,"-selection-col-with-dropdown")]:{width:h(c).add(o).add(h(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:h(c).add(h(i).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:h(c).add(o).add(h(a).div(4)).add(h(i).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:e.zIndexTableFixed+1},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,t0.bf)(h(p).div(4).equal()),[r]:{color:l,fontSize:o,verticalAlign:"baseline","&:hover":{color:s}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:u,"&-row-hover":{background:d}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},r0=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:r}=e,o=(e,o,a,i)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:i,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,t0.bf)(r(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(r(o).mul(-1).equal())," ").concat((0,t0.bf)(r(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,t0.bf)(r(o).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(r(n).sub(a).equal())," ").concat((0,t0.bf)(r(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,t0.bf)(r(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},o("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),o("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},r1=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:r,headerIconColor:o,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:o,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:r,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},r2=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:r,tableScrollThumbBgHover:o,tableScrollThumbSize:a,tableScrollBg:i,zIndexTableSticky:l,stickyScrollBarBorderRadius:s,lineWidth:c,lineType:u,tableBorderColor:d}=e,f="".concat((0,t0.bf)(c)," ").concat(u," ").concat(d);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:l,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,t0.bf)(a)," !important"),zIndex:l,display:"flex",alignItems:"center",background:i,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:r,borderRadius:s,transition:"all ".concat(e.motionDurationSlow,", transform none"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:o}}}}}}},r6=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:r,calc:o}=e,a="".concat((0,t0.bf)(n)," ").concat(e.lineType," ").concat(r);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,t0.bf)(o(n).mul(-1).equal())," 0 ").concat(r)}}}},r4=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:r,lineType:o,tableBorderColor:a,calc:i}=e,l="".concat((0,t0.bf)(r)," ").concat(o," ").concat(a),s="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-row")]:{display:"flex",boxSizing:"border-box",width:"100%"},["".concat(t,"-cell")]:{borderBottom:l,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(s).concat(s,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,t0.bf)(r),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:l,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:l,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:i(r).mul(-1).equal(),borderInlineStart:l}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:l,borderBottom:l}}}}}};let r3=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:r,tablePaddingHorizontal:o,tableExpandColumnWidth:a,lineWidth:i,lineType:l,tableBorderColor:s,tableFontSize:c,tableBg:u,tableRadius:d,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:h,tableHeaderCellSplitColor:m,tableFooterTextColor:g,tableFooterBg:v,calc:y}=e,b="".concat((0,t0.bf)(i)," ").concat(l," ").concat(s);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%"},(0,t6.dF)()),{[t]:Object.assign(Object.assign({},(0,t6.Wf)(e)),{fontSize:c,background:u,borderRadius:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(d)," 0 0")}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(d)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:h,borderBottom:b,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:m,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:b,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,t0.bf)(y(r).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(y(a).sub(o).equal()),"\n ").concat((0,t0.bf)(y(o).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:h,borderBottom:b,transition:"background ".concat(p," ease")}}},["".concat(t,"-footer")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o)),color:g,background:v}})}};var r5=(0,t3.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:r,controlInteractiveSize:o,headerBg:a,headerColor:i,headerSortActiveBg:l,headerSortHoverBg:s,bodySortBg:c,rowHoverBg:u,rowSelectedBg:d,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:h,cellPaddingInline:m,cellPaddingBlockMD:g,cellPaddingInlineMD:v,cellPaddingBlockSM:y,cellPaddingInlineSM:b,borderColor:x,footerBg:w,footerColor:k,headerBorderRadius:S,cellFontSize:E,cellFontSizeMD:O,cellFontSizeSM:C,headerSplitColor:j,fixedHeaderSortActiveBg:_,headerFilterHoverBg:P,filterDropdownBg:N,expandIconBg:T,selectionColumnWidth:A,stickyScrollBarBg:M,calc:I}=e,R=(0,t4.TS)(e,{tableFontSize:E,tableBg:r,tableRadius:S,tablePaddingVertical:h,tablePaddingHorizontal:m,tablePaddingVerticalMiddle:g,tablePaddingHorizontalMiddle:v,tablePaddingVerticalSmall:y,tablePaddingHorizontalSmall:b,tableBorderColor:x,tableHeaderTextColor:i,tableHeaderBg:a,tableFooterTextColor:k,tableFooterBg:w,tableHeaderCellSplitColor:j,tableHeaderSortBg:l,tableHeaderSortHoverBg:s,tableBodySortBg:c,tableFixedHeaderSortActiveBg:_,tableHeaderFilterActiveBg:P,tableFilterDropdownBg:N,tableRowHoverBg:u,tableSelectedRowBg:d,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:3,tableFontSizeMiddle:O,tableFontSizeSmall:C,tableSelectionColumnWidth:A,tableExpandIconBg:T,tableExpandColumnWidth:I(o).add(I(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:M,tableScrollThumbBgHover:t,tableScrollBg:n});return[r3(R),rG(R),r6(R),r1(R),rV(R),rq(R),rY(R),r$(R),r6(R),rU(R),rJ(R),rX(R),r2(R),rW(R),r0(R),rQ(R),r4(R)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:r,colorFillSecondary:o,colorFillContent:a,controlItemBgActive:i,controlItemBgActiveHover:l,padding:s,paddingSM:c,paddingXS:u,colorBorderSecondary:d,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:h,fontSize:m,fontSizeSM:g,lineHeight:v,lineWidth:y,colorIcon:b,colorIconHover:x,opacityLoading:w,controlInteractiveSize:k}=e,S=new rH.C(o).onBackground(n).toHexShortString(),E=new rH.C(a).onBackground(n).toHexShortString(),O=new rH.C(t).onBackground(n).toHexShortString(),C=new rH.C(b),j=new rH.C(x),_=k/2-y,P=2*_+3*y;return{headerBg:O,headerColor:r,headerSortActiveBg:S,headerSortHoverBg:E,bodySortBg:O,rowHoverBg:O,rowSelectedBg:i,rowSelectedHoverBg:l,rowExpandedBg:t,cellPaddingBlock:s,cellPaddingInline:s,cellPaddingBlockMD:c,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:d,headerBorderRadius:f,footerBg:O,footerColor:r,cellFontSize:m,cellFontSizeMD:m,cellFontSizeSM:m,headerSplitColor:d,fixedHeaderSortActiveBg:S,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:h,stickyScrollBarBorderRadius:100,expandIconMarginTop:(m*v-3*y)/2-Math.ceil((1.4*g-3*y)/2),headerIconColor:C.clone().setAlpha(C.getAlpha()*w).toRgbString(),headerIconHoverColor:j.clone().setAlpha(j.getAlpha()*w).toRgbString(),expandIconHalfInner:_,expandIconSize:P,expandIconScale:k/P}},{unitless:{expandIconScale:!0}});let r8=[];var r7=a.forwardRef((e,t)=>{var n,r;let o,i,s;let{prefixCls:c,className:u,rootClassName:d,style:f,size:p,bordered:h,dropdownPrefixCls:m,dataSource:g,pagination:v,rowSelection:y,rowKey:b="key",rowClassName:x,columns:w,children:k,childrenColumnName:S,onChange:E,getPopupContainer:O,loading:C,expandIcon:j,expandable:P,expandedRowRender:N,expandIconColumnIndex:T,indentSize:A,scroll:M,sortDirections:I,locale:R,showSorterTooltip:D=!0,virtual:L}=e;(0,tp.ln)("Table");let Z=a.useMemo(()=>w||ey(k),[w,k]),z=a.useMemo(()=>Z.some(e=>e.responsive),[Z]),B=(0,tN.Z)(z),F=a.useMemo(()=>{let e=new Set(Object.keys(B).filter(e=>B[e]));return Z.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[Z,B]),H=(0,eY.Z)(e,["className","style","columns"]),{locale:q=tT.Z,direction:W,table:U,renderEmpty:K,getPrefixCls:$,getPopupContainer:V}=a.useContext(tC.E_),X=(0,tP.Z)(p),G=Object.assign(Object.assign({},q.Table),R),Y=g||r8,Q=$("table",c),J=$("dropdown",m),[,ee]=(0,nl.ZP)(),et=(0,t_.Z)(Q),[en,er,eo]=r5(Q,et),ea=Object.assign({childrenColumnName:S,expandIconColumnIndex:T},P),{childrenColumnName:ei="children"}=ea,el=a.useMemo(()=>Y.some(e=>null==e?void 0:e[ei])?"nest":N||P&&P.expandedRowRender?"row":null,[Y]),ec={body:a.useRef()},eu=a.useRef(null),ed=a.useRef(null);n=()=>Object.assign(Object.assign({},ed.current),{nativeElement:eu.current}),(0,a.useImperativeHandle)(t,()=>{let e=n(),{nativeElement:t}=e;return"undefined"!=typeof Proxy?new Proxy(t,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(t._antProxy=t._antProxy||{},Object.keys(e).forEach(n=>{if(!(n in t._antProxy)){let r=t[n];t._antProxy[n]=r,t[n]=e[n]}}),t)});let ef=a.useMemo(()=>"function"==typeof b?b:e=>null==e?void 0:e[b],[b]),[ep]=function(e,t,n){let r=a.useRef({});return[function(o){if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){let o=new Map;!function e(r){r.forEach((r,a)=>{let i=n(r,a);o.set(i,r),r&&"object"==typeof r&&t in r&&e(r[t]||[])})}(e),r.current={data:e,childrenColumnName:t,kvMap:o,getRowKey:n}}return r.current.kvMap.get(o)}]}(Y,ei,ef),eh={},em=function(e,t){var n,r,o;let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Object.assign(Object.assign({},eh),e);a&&(null===(n=eh.resetPagination)||void 0===n||n.call(eh),(null===(r=i.pagination)||void 0===r?void 0:r.current)&&(i.pagination.current=1),v&&v.onChange&&v.onChange(1,null===(o=i.pagination)||void 0===o?void 0:o.pageSize)),M&&!1!==M.scrollToFirstRowOnChange&&ec.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:r,duration:o=450}=t,a=n(),i=function(e,t){var n,r;if("undefined"==typeof window)return 0;let o=t?"scrollTop":"scrollLeft",a=0;return tO(e)?a=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?a=e.documentElement[o]:e instanceof HTMLElement?a=e[o]:e&&(a=e[o]),e&&!tO(e)&&"number"!=typeof a&&(a=null===(r=(null!==(n=e.ownerDocument)&&void 0!==n?n:e).documentElement)||void 0===r?void 0:r[o]),a}(a,!0),l=Date.now(),s=()=>{let t=Date.now()-l,n=function(e,t,n,r){let o=n-t;return(e/=r/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t}(t>o?o:t,i,e,o);tO(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,t<o?(0,tE.Z)(s):"function"==typeof r&&r()};(0,tE.Z)(s)}(0,{getContainer:()=>ec.body.current}),null==E||E(i.pagination,i.filters,i.sorter,{currentDataSource:rw(rz(Y,i.sorterStates,ei),i.filterStates),action:t})},[eg,ev,eb,ex]=function(e){let{prefixCls:t,mergedColumns:n,onSorterChange:r,sortDirections:o,tableLocale:i,showSorterTooltip:l}=e,[s,c]=a.useState(rD(n,!0)),u=a.useMemo(()=>{let e=!0,t=rD(n,!1);if(!t.length)return s;let r=[];function o(t){e?r.push(t):r.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(o(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),o(t))}),r},[n,s]),d=a.useMemo(()=>{let e=u.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}},[u]);function f(e){let t;c(t=!1!==e.multiplePriority&&u.length&&!1!==u[0].multiplePriority?[].concat((0,es.Z)(u.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),r(rZ(t),t)}return[e=>(function e(t,n,r,o,i,l,s,c){return(n||[]).map((n,u)=>{let d=nh(u,c),f=n;if(f.sorter){let e;let c=f.sortDirections||i,u=void 0===f.showSorterTooltip?s:f.showSorterTooltip,p=np(f,d),h=r.find(e=>{let{key:t}=e;return t===p}),m=h?h.sortOrder:null,g=m?c[c.indexOf(m)+1]:c[0];if(n.sortIcon)e=n.sortIcon({sortOrder:m});else{let n=c.includes(rA)&&a.createElement(rN,{className:_()("".concat(t,"-column-sorter-up"),{active:m===rA})}),r=c.includes(rM)&&a.createElement(r_,{className:_()("".concat(t,"-column-sorter-down"),{active:m===rM})});e=a.createElement("span",{className:_()("".concat(t,"-column-sorter"),{["".concat(t,"-column-sorter-full")]:!!(n&&r)})},a.createElement("span",{className:"".concat(t,"-column-sorter-inner"),"aria-hidden":"true"},n,r))}let{cancelSort:v,triggerAsc:y,triggerDesc:b}=l||{},x=v;g===rM?x=b:g===rA&&(x=y);let w="object"==typeof u?Object.assign({title:x},u):{title:x};f=Object.assign(Object.assign({},f),{className:_()(f.className,{["".concat(t,"-column-sort")]:m}),title:r=>{let o=a.createElement("div",{className:"".concat(t,"-column-sorters")},a.createElement("span",{className:"".concat(t,"-column-title")},nm(n.title,r)),e);return u?a.createElement(rT.Z,Object.assign({},w),o):o},onHeaderCell:e=>{let r=n.onHeaderCell&&n.onHeaderCell(e)||{},a=r.onClick,i=r.onKeyDown;r.onClick=e=>{o({column:n,key:p,sortOrder:g,multiplePriority:rI(n)}),null==a||a(e)},r.onKeyDown=e=>{e.keyCode===tz.Z.ENTER&&(o({column:n,key:p,sortOrder:g,multiplePriority:rI(n)}),null==i||i(e))};let l=function(e,t){let n=nm(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n}(n.title,{}),s=null==l?void 0:l.toString();return m?r["aria-sort"]="ascend"===m?"ascending":"descending":r["aria-label"]=s||"",r.className=_()(r.className,"".concat(t,"-column-has-sorters")),r.tabIndex=0,n.ellipsis&&(r.title=(null!=l?l:"").toString()),r}})}return"children"in f&&(f=Object.assign(Object.assign({},f),{children:e(t,f.children,r,o,i,l,s,d)})),f})})(t,e,u,f,o,i,l),u,d,()=>rZ(u)]}({prefixCls:Q,mergedColumns:F,onSorterChange:(e,t)=>{em({sorter:e,sorterStates:t},"sort",!1)},sortDirections:I||["ascend","descend"],tableLocale:G,showSorterTooltip:D}),ew=a.useMemo(()=>rz(Y,ev,ei),[Y,ev]);eh.sorter=ex(),eh.sorterStates=ev;let[ek,eS,eE]=rS({prefixCls:Q,locale:G,dropdownPrefixCls:J,mergedColumns:F,onFilterChange:(e,t)=>{em({filters:e,filterStates:t},"filter",!0)},getPopupContainer:O||V,rootClassName:_()(d,et)}),eO=rw(ew,eS);eh.filters=eE,eh.filterStates=eS;let[eC]=(r=a.useMemo(()=>{let e={};return Object.keys(eE).forEach(t=>{null!==eE[t]&&(e[t]=eE[t])}),Object.assign(Object.assign({},eb),{filters:e})},[eb,eE]),[a.useCallback(e=>(function e(t,n){return t.map(t=>{let r=Object.assign({},t);return r.title=nm(t.title,n),"children"in r&&(r.children=e(r.children,n)),r})})(e,r),[r])]),[ej,e_]=rC(eO.length,(e,t)=>{em({pagination:Object.assign(Object.assign({},eh.pagination),{current:e,pageSize:t})},"paginate")},v);eh.pagination=!1===v?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let r=e[t];"function"!=typeof r&&(n[t]=r)}),n}(ej,v),eh.resetPagination=e_;let eP=a.useMemo(()=>{if(!1===v||!ej.pageSize)return eO;let{current:e=1,total:t,pageSize:n=10}=ej;return eO.length<t?eO.length>n?eO.slice((e-1)*n,e*n):eO:eO.slice((e-1)*n,e*n)},[!!v,eO,ej&&ej.current,ej&&ej.pageSize,ej&&ej.total]),[eN,eT]=tS({prefixCls:Q,data:eO,pageData:eP,getRowKey:ef,getRecordByKey:ep,expandType:el,childrenColumnName:ei,locale:G,getPopupContainer:O||V},y);ea.__PARENT_RENDER_ICON__=ea.expandIcon,ea.expandIcon=ea.expandIcon||j||function(e){let{prefixCls:t,onExpand:n,record:r,expanded:o,expandable:i}=e,l="".concat(t,"-row-expand-icon");return a.createElement("button",{type:"button",onClick:e=>{n(r,e),e.stopPropagation()},className:_()(l,{["".concat(l,"-spaced")]:!i,["".concat(l,"-expanded")]:i&&o,["".concat(l,"-collapsed")]:i&&!o}),"aria-label":o?G.collapse:G.expand,"aria-expanded":o})},"nest"===el&&void 0===ea.expandIconColumnIndex?ea.expandIconColumnIndex=y?1:0:ea.expandIconColumnIndex>0&&y&&(ea.expandIconColumnIndex-=1),"number"!=typeof ea.indentSize&&(ea.indentSize="number"==typeof A?A:15);let eA=a.useCallback(e=>eC(eN(ek(eg(e)))),[eg,ek,eN]);if(!1!==v&&(null==ej?void 0:ej.total)){let e;e=ej.size?ej.size:"small"===X||"middle"===X?"small":void 0;let t=t=>a.createElement(nd,Object.assign({},ej,{className:_()("".concat(Q,"-pagination ").concat(Q,"-pagination-").concat(t),ej.className),size:e})),n="rtl"===W?"left":"right",{position:r}=ej;if(null!==r&&Array.isArray(r)){let e=r.find(e=>e.includes("top")),a=r.find(e=>e.includes("bottom")),l=r.every(e=>"none"==="".concat(e));e||a||l||(i=t(n)),e&&(o=t(e.toLowerCase().replace("top",""))),a&&(i=t(a.toLowerCase().replace("bottom","")))}else i=t(n)}"boolean"==typeof C?s={spinning:C}:"object"==typeof C&&(s=Object.assign({spinning:!0},C));let eM=_()(eo,et,"".concat(Q,"-wrapper"),null==U?void 0:U.className,{["".concat(Q,"-wrapper-rtl")]:"rtl"===W},u,d,er),eI=Object.assign(Object.assign({},null==U?void 0:U.style),f),eR=R&&R.emptyText||(null==K?void 0:K("Table"))||a.createElement(tj.Z,{componentName:"Table"}),eD={},eL=a.useMemo(()=>{let{fontSize:e,lineHeight:t,padding:n,paddingXS:r,paddingSM:o}=ee,a=Math.floor(e*t);switch(X){case"large":return 2*n+a;case"small":return 2*r+a;default:return 2*o+a}},[ee,X]);return L&&(eD.listItemHeight=eL),en(a.createElement("div",{ref:eu,className:eM,style:eI},a.createElement(nf.Z,Object.assign({spinning:!1},s),o,a.createElement(L?rF:rB,Object.assign({},eD,H,{ref:ed,columns:F,direction:W,expandable:ea,prefixCls:Q,className:_()({["".concat(Q,"-middle")]:"middle"===X,["".concat(Q,"-small")]:"small"===X,["".concat(Q,"-bordered")]:h,["".concat(Q,"-empty")]:0===Y.length},eo,et,er),data:eP,rowKey:ef,rowClassName:(e,t,n)=>{let r;return r="function"==typeof x?_()(x(e,t,n)):_()(x),_()({["".concat(Q,"-row-selected")]:eT.has(ef(e,t))},r)},emptyText:eR,internalHooks:l,internalRefs:ec,transformColumns:eA,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(Q,"-container")),r=t;if(n){let e=getComputedStyle(n);r=t-parseInt(e.borderLeftWidth,10)-parseInt(e.borderRightWidth,10)}return r}})),i)))});let r9=a.forwardRef((e,t)=>{let n=a.useRef(0);return n.current+=1,a.createElement(r7,Object.assign({},e,{ref:t,_renderTimes:n.current}))});r9.SELECTION_COLUMN=tv,r9.EXPAND_COLUMN=i,r9.SELECTION_ALL=ty,r9.SELECTION_INVERT=tb,r9.SELECTION_NONE=tx,r9.Column=function(e){return null},r9.ColumnGroup=function(e){return null},r9.Summary=F;var oe=r9},93192:function(e,t,n){"use strict";n.d(t,{default:function(){return ef}});var r=n(2265),o=n(9738),a=n(23639),i=n(1119),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},s=n(55015),c=r.forwardRef(function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:l}))}),u=n(36760),d=n.n(u),f=n(49211),p=n.n(f),h=n(31474),m=n(45287),g=n(27380),v=n(50506),y=n(18694),b=n(28791),x=n(10281),w=n(95814),k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let S={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},E=r.forwardRef((e,t)=>{let{style:n,noStyle:o,disabled:a}=e,i=k(e,["style","noStyle","disabled"]),l={};return o||(l=Object.assign({},S)),a&&(l.pointerEvents="none"),l=Object.assign(Object.assign({},l),n),r.createElement("div",Object.assign({role:"button",tabIndex:0,ref:t},i,{onKeyDown:e=>{let{keyCode:t}=e;t===w.Z.ENTER&&e.preventDefault()},onKeyUp:t=>{let{keyCode:n}=t,{onClick:r}=e;n===w.Z.ENTER&&r&&r()},style:l}))});var O=n(71744),C=n(55274),j=n(89970),_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},P=r.forwardRef(function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:_}))}),N=n(19722),T=n(90464),A=n(76122),M=n(80669),I=n(31373),R=n(352);let D=(e,t,n,r)=>{let{titleMarginBottom:o,fontWeightStrong:a}=r;return{marginBottom:o,color:n,fontWeight:a,fontSize:e,lineHeight:t}},L=e=>{let t={};return[1,2,3,4,5].forEach(n=>{t["\n h".concat(n,"&,\n div&-h").concat(n,",\n div&-h").concat(n," > textarea,\n h").concat(n,"\n ")]=D(e["fontSizeHeading".concat(n)],e["lineHeightHeading".concat(n)],e.colorTextHeading,e)}),t},Z=e=>{let{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},(0,A.N)(e)),{textDecoration:e.linkDecoration,"&:active, &:hover":{textDecoration:e.linkHoverDecoration},["&[disabled], &".concat(t,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},z=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:I.EV[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),B=e=>{let{componentCls:t,paddingSM:n}=e;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),marginTop:e.calc(n).mul(-1).equal(),marginBottom:"calc(1em - ".concat((0,R.bf)(n),")")},["".concat(t,"-edit-content-confirm")]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorTextDescription,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},F=e=>({["".concat(e.componentCls,"-copy-success")]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},["".concat(e.componentCls,"-copy-icon-only")]:{marginInlineStart:0}}),H=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-single-line":{whiteSpace:"nowrap"},"&-ellipsis-single-line":{overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),q=e=>{let{componentCls:t,titleMarginTop:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,["&".concat(t,"-secondary")]:{color:e.colorTextDescription},["&".concat(t,"-success")]:{color:e.colorSuccess},["&".concat(t,"-warning")]:{color:e.colorWarning},["&".concat(t,"-danger")]:{color:e.colorError,"a&:active, a&:focus":{color:e.colorErrorActive},"a&:hover":{color:e.colorErrorHover}},["&".concat(t,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},L(e)),{["\n & + h1".concat(t,",\n & + h2").concat(t,",\n & + h3").concat(t,",\n & + h4").concat(t,",\n & + h5").concat(t,"\n ")]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),z(e)),Z(e)),{["\n ".concat(t,"-expand,\n ").concat(t,"-edit,\n ").concat(t,"-copy\n ")]:Object.assign(Object.assign({},(0,A.N)(e)),{marginInlineStart:e.marginXXS})}),B(e)),F(e)),H()),{"&-rtl":{direction:"rtl"}})}};var W=(0,M.I$)("Typography",e=>[q(e)],()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"})),U=e=>{let{prefixCls:t,"aria-label":n,className:o,style:a,direction:i,maxLength:l,autoSize:s=!0,value:c,onSave:u,onCancel:f,onEnd:p,component:h,enterIcon:m=r.createElement(P,null)}=e,g=r.useRef(null),v=r.useRef(!1),y=r.useRef(),[b,x]=r.useState(c);r.useEffect(()=>{x(c)},[c]),r.useEffect(()=>{if(g.current&&g.current.resizableTextArea){let{textArea:e}=g.current.resizableTextArea;e.focus();let{length:t}=e.value;e.setSelectionRange(t,t)}},[]);let k=()=>{u(b.trim())},S=h?"".concat(t,"-").concat(h):"",[E,O,C]=W(t),j=d()(t,"".concat(t,"-edit-content"),{["".concat(t,"-rtl")]:"rtl"===i},o,S,O,C);return E(r.createElement("div",{className:j,style:a},r.createElement(T.Z,{ref:g,maxLength:l,value:b,onChange:e=>{let{target:t}=e;x(t.value.replace(/[\n\r]/g,""))},onKeyDown:e=>{let{keyCode:t}=e;v.current||(y.current=t)},onKeyUp:e=>{let{keyCode:t,ctrlKey:n,altKey:r,metaKey:o,shiftKey:a}=e;y.current!==t||v.current||n||r||o||a||(t===w.Z.ENTER?(k(),null==p||p()):t===w.Z.ESC&&f())},onCompositionStart:()=>{v.current=!0},onCompositionEnd:()=>{v.current=!1},onBlur:()=>{k()},"aria-label":n,rows:1,autoSize:s}),null!==m?(0,N.Tm)(m,{className:"".concat(t,"-edit-content-confirm")}):null))};function K(e,t){return r.useMemo(()=>{let n=!!e;return[n,Object.assign(Object.assign({},t),n&&"object"==typeof e?e:null)]},[e])}var $=(e,t)=>{let n=r.useRef(!1);r.useEffect(()=>{n.current?e():n.current=!0},t)},V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let X=r.forwardRef((e,t)=>{let{prefixCls:n,component:o="article",className:a,rootClassName:i,setContentRef:l,children:s,direction:c,style:u}=e,f=V(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:p,direction:h,typography:m}=r.useContext(O.E_),g=t;l&&(g=(0,b.sQ)(t,l));let v=p("typography",n),[y,x,w]=W(v),k=d()(v,null==m?void 0:m.className,{["".concat(v,"-rtl")]:"rtl"===(null!=c?c:h)},a,i,x,w),S=Object.assign(Object.assign({},null==m?void 0:m.style),u);return y(r.createElement(o,Object.assign({className:k,style:S,ref:g},f),s))});function G(e){let t=typeof e;return"string"===t||"number"===t}function Y(e,t){let n=0,r=[];for(let o=0;o<e.length;o+=1){if(n===t)return r;let a=e[o],i=n+(G(a)?String(a).length:1);if(i>t){let e=t-n;return r.push(String(a).slice(0,e)),r}r.push(a),n=i}return e}var Q=e=>{let{enabledMeasure:t,children:n,text:o,width:a,fontSize:i,rows:l,onEllipsis:s}=e,[[c,u,d],f]=r.useState([0,0,0]),[p,h]=r.useState(0),[v,y]=r.useState(0),[b,x]=r.useState(0),w=r.useRef(null),k=r.useRef(null),S=r.useMemo(()=>(0,m.Z)(o),[o]),E=r.useMemo(()=>{let e;return e=0,S.forEach(t=>{G(t)?e+=String(t).length:e+=1}),e},[S]),O=r.useMemo(()=>t&&3===v?n(Y(S,u),u<E):p&&4!==v&&t?n(Y(S,p),p<E):n(S,!1),[t,v,n,S,u,E]);(0,g.Z)(()=>{t&&a&&i&&E&&(y(1),f([0,Math.ceil(E/2),E]))},[t,a,i,o,E,l]),(0,g.Z)(()=>{var e;1===v&&x((null===(e=w.current)||void 0===e?void 0:e.offsetHeight)||0)},[v]),(0,g.Z)(()=>{var e,t;if(b){if(1===v)((null===(e=k.current)||void 0===e?void 0:e.offsetHeight)||0)<=l*b?(y(4),s(!1)):y(2);else if(2===v){if(c!==d){let e=(null===(t=k.current)||void 0===t?void 0:t.offsetHeight)||0,n=l*b,r=c,o=d;c===d-1?o=c:e<=n?r=u:o=u;let a=Math.ceil((r+o)/2);f([r,a,o])}else y(3),h(u),s(!0)}}},[v,c,d,l,b]);let C=(e,t,n)=>r.createElement("span",{"aria-hidden":!0,ref:t,style:Object.assign({position:"fixed",display:"block",left:0,top:0,zIndex:-9999,visibility:"hidden",pointerEvents:"none",fontSize:2*Math.ceil(i/2)},n)},e);return r.createElement(r.Fragment,null,O,t&&3!==v&&4!==v&&r.createElement(r.Fragment,null,C("lg",w,{wordBreak:"keep-all",whiteSpace:"nowrap"}),C(1===v?n(S,!1):n(Y(S,u),!0),k,{width:a,whiteSpace:"normal",margin:0,padding:0})))},J=e=>{let{enabledEllipsis:t,isEllipsis:n,children:o,tooltipProps:a}=e;return(null==a?void 0:a.title)&&t?r.createElement(j.Z,Object.assign({open:!!n&&void 0},a),o):o},ee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function et(e,t,n){return!0===e||void 0===e?t:e||n&&t}function en(e){return!1===e?[!1,!1]:Array.isArray(e)?e:[e]}let er=r.forwardRef((e,t)=>{var n,i,l;let{prefixCls:s,className:u,style:f,type:w,disabled:k,children:S,ellipsis:_,editable:P,copyable:N,component:T,title:A}=e,M=ee(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:I,direction:R}=r.useContext(O.E_),[D]=(0,C.Z)("Text"),L=r.useRef(null),Z=r.useRef(null),z=I("typography",s),B=(0,y.Z)(M,["mark","code","delete","underline","strong","keyboard","italic"]),[F,H]=K(P),[q,W]=(0,v.Z)(!1,{value:H.editing}),{triggerType:V=["icon"]}=H,G=e=>{var t;e&&(null===(t=H.onStart)||void 0===t||t.call(H)),W(e)};$(()=>{var e;q||null===(e=Z.current)||void 0===e||e.focus()},[q]);let Y=e=>{null==e||e.preventDefault(),G(!0)},[er,eo]=K(N),[ea,ei]=r.useState(!1),el=r.useRef(null),es={};eo.format&&(es.format=eo.format);let ec=()=>{el.current&&clearTimeout(el.current)},eu=e=>{var t;null==e||e.preventDefault(),null==e||e.stopPropagation(),p()(eo.text||String(S)||"",es),ei(!0),ec(),el.current=setTimeout(()=>{ei(!1)},3e3),null===(t=eo.onCopy)||void 0===t||t.call(eo,e)};r.useEffect(()=>ec,[]);let[ed,ef]=r.useState(!1),[ep,eh]=r.useState(!1),[em,eg]=r.useState(!1),[ev,ey]=r.useState(!1),[eb,ex]=r.useState(!1),[ew,ek]=r.useState(!0),[eS,eE]=K(_,{expandable:!1}),eO=eS&&!em,{rows:eC=1}=eE,ej=r.useMemo(()=>!eO||void 0!==eE.suffix||eE.onEllipsis||eE.expandable||F||er,[eO,eE,F,er]);(0,g.Z)(()=>{eS&&!ej&&(ef((0,x.G)("webkitLineClamp")),eh((0,x.G)("textOverflow")))},[ej,eS]);let e_=r.useMemo(()=>!ej&&(1===eC?ep:ed),[ej,ep,ed]),eP=eO&&(e_?eb:ev),eN=eO&&1===eC&&e_,eT=eO&&eC>1&&e_,eA=e=>{var t;eg(!0),null===(t=eE.onExpand)||void 0===t||t.call(eE,e)},[eM,eI]=r.useState(0),[eR,eD]=r.useState(0),eL=e=>{var t;ey(e),ev!==e&&(null===(t=eE.onEllipsis)||void 0===t||t.call(eE,e))};r.useEffect(()=>{let e=L.current;if(eS&&e_&&e){let t=eT?e.offsetHeight<e.scrollHeight:e.offsetWidth<e.scrollWidth;eb!==t&&ex(t)}},[eS,e_,S,eT,ew,eM]),r.useEffect(()=>{let e=L.current;if("undefined"==typeof IntersectionObserver||!e||!e_||!eO)return;let t=new IntersectionObserver(()=>{ek(!!e.offsetParent)});return t.observe(e),()=>{t.disconnect()}},[e_,eO]);let eZ={};eZ=!0===eE.tooltip?{title:null!==(n=H.text)&&void 0!==n?n:S}:r.isValidElement(eE.tooltip)?{title:eE.tooltip}:"object"==typeof eE.tooltip?Object.assign({title:null!==(i=H.text)&&void 0!==i?i:S},eE.tooltip):{title:eE.tooltip};let ez=r.useMemo(()=>{let e=e=>["string","number"].includes(typeof e);return!eS||e_?void 0:e(H.text)?H.text:e(S)?S:e(A)?A:e(eZ.title)?eZ.title:void 0},[eS,e_,A,eZ.title,eP]);if(q)return r.createElement(U,{value:null!==(l=H.text)&&void 0!==l?l:"string"==typeof S?S:"",onSave:e=>{var t;null===(t=H.onChange)||void 0===t||t.call(H,e),G(!1)},onCancel:()=>{var e;null===(e=H.onCancel)||void 0===e||e.call(H),G(!1)},onEnd:H.onEnd,prefixCls:z,className:u,style:f,direction:R,component:T,maxLength:H.maxLength,autoSize:H.autoSize,enterIcon:H.enterIcon});let eB=()=>{let e;let{expandable:t,symbol:n}=eE;return t?(e=n||(null==D?void 0:D.expand),r.createElement("a",{key:"expand",className:"".concat(z,"-expand"),onClick:eA,"aria-label":null==D?void 0:D.expand},e)):null},eF=()=>{if(!F)return;let{icon:e,tooltip:t}=H,n=(0,m.Z)(t)[0]||(null==D?void 0:D.edit),o="string"==typeof n?n:"";return V.includes("icon")?r.createElement(j.Z,{key:"edit",title:!1===t?"":n},r.createElement(E,{ref:Z,className:"".concat(z,"-edit"),onClick:Y,"aria-label":o},e||r.createElement(c,{role:"button"}))):null},eH=()=>{if(!er)return null;let{tooltips:e,icon:t}=eo,n=en(e),i=en(t),l=ea?et(n[1],null==D?void 0:D.copied):et(n[0],null==D?void 0:D.copy),s=ea?null==D?void 0:D.copied:null==D?void 0:D.copy,c="string"==typeof l?l:s;return r.createElement(j.Z,{key:"copy",title:l},r.createElement(E,{className:d()("".concat(z,"-copy"),{["".concat(z,"-copy-success")]:ea,["".concat(z,"-copy-icon-only")]:null==S}),onClick:eu,"aria-label":c},ea?et(i[1],r.createElement(o.Z,null),!0):et(i[0],r.createElement(a.Z,null),!0)))},eq=e=>[e&&eB(),eF(),eH()],eW=e=>[e&&r.createElement("span",{"aria-hidden":!0,key:"ellipsis"},"..."),eE.suffix,eq(e)];return r.createElement(h.Z,{onResize:(e,t)=>{var n;let{offsetWidth:r}=e;eI(r),eD(parseInt(null===(n=window.getComputedStyle)||void 0===n?void 0:n.call(window,t).fontSize,10)||0)},disabled:!eO},n=>r.createElement(J,{tooltipProps:eZ,enabledEllipsis:eO,isEllipsis:eP},r.createElement(X,Object.assign({className:d()({["".concat(z,"-").concat(w)]:w,["".concat(z,"-disabled")]:k,["".concat(z,"-ellipsis")]:eS,["".concat(z,"-single-line")]:eO&&1===eC,["".concat(z,"-ellipsis-single-line")]:eN,["".concat(z,"-ellipsis-multiple-line")]:eT},u),prefixCls:s,style:Object.assign(Object.assign({},f),{WebkitLineClamp:eT?eC:void 0}),component:T,ref:(0,b.sQ)(n,L,t),direction:R,onClick:V.includes("text")?Y:void 0,"aria-label":null==ez?void 0:ez.toString(),title:A},B),r.createElement(Q,{enabledMeasure:eO&&!e_,text:S,rows:eC,width:eM,fontSize:eR,onEllipsis:eL},(t,n)=>{let o=t;return t.length&&n&&ez&&(o=r.createElement("span",{key:"show-content","aria-hidden":!0},o)),function(e,t){let{mark:n,code:o,underline:a,delete:i,strong:l,keyboard:s,italic:c}=e,u=t;function d(e,t){t&&(u=r.createElement(e,{},u))}return d("strong",l),d("u",a),d("del",i),d("code",o),d("mark",n),d("kbd",s),d("i",c),u}(e,r.createElement(r.Fragment,null,o,eW(n)))}))))});var eo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let ea=r.forwardRef((e,t)=>{var{ellipsis:n,rel:o}=e,a=eo(e,["ellipsis","rel"]);let i=Object.assign(Object.assign({},a),{rel:void 0===o&&"_blank"===a.target?"noopener noreferrer":o});return delete i.navigate,r.createElement(er,Object.assign({},i,{ref:t,ellipsis:!!n,component:"a"}))}),ei=r.forwardRef((e,t)=>r.createElement(er,Object.assign({ref:t},e,{component:"div"})));var el=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},es=r.forwardRef((e,t)=>{var{ellipsis:n}=e,o=el(e,["ellipsis"]);let a=r.useMemo(()=>n&&"object"==typeof n?(0,y.Z)(n,["expandable","rows"]):n,[n]);return r.createElement(er,Object.assign({ref:t},o,{ellipsis:a,component:"span"}))}),ec=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eu=[1,2,3,4,5],ed=r.forwardRef((e,t)=>{let n;let{level:o=1}=e,a=ec(e,["level"]);return n=eu.includes(o)?"h".concat(o):"h1",r.createElement(er,Object.assign({ref:t},a,{component:n}))});X.Text=es,X.Link=ea,X.Title=ed,X.Paragraph=ei;var ef=X},85010:function(e,t,n){"use strict";n.d(t,{default:function(){return eT}});var r=n(2265),o=n(83145),a=n(54887),i=n(36760),l=n.n(i),s=n(1119),c=n(76405),u=n(25049),d=n(63496),f=n(15354),p=n(15900),h=n(11993),m=n(31686),g=n(6989),v=n(73129),y=n(41154),b=n(54580),x=n(18242),w=n(32559),k=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){var n=r.toLowerCase(),i=t.toLowerCase(),l=[i];return(".jpg"===i||".jpeg"===i)&&(l=[".jpg",".jpeg"]),l.some(function(e){return n.endsWith(e)})}return/\/\*$/.test(t)?a===t.replace(/\/.*$/,""):o===t||!!/^\w+$/.test(t)&&((0,w.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(t,"'.Skip for check.")),!0)})}return!0};function S(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}var E=function(e,t,n){var r=function e(r,o){if(r){if(r.path=o||"",r.isFile)r.file(function(e){n(e)&&(r.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))});else if(r.isDirectory){var a,i,l;a=function(t){t.forEach(function(t){e(t,"".concat(o).concat(r.name,"/"))})},i=r.createReader(),l=[],function e(){i.readEntries(function(t){var n=Array.prototype.slice.apply(t);l=l.concat(n),n.length?e():a(l)})}()}}};e.forEach(function(e){r(e.webkitGetAsEntry())})},O=+new Date,C=0;function j(){return"rc-upload-".concat(O,"-").concat(++C)}var _=["component","prefixCls","className","classNames","disabled","id","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],P=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){(0,c.Z)(this,n);for(var e,r,a=arguments.length,i=Array(a),l=0;l<a;l++)i[l]=arguments[l];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,d.Z)(e),"state",{uid:j()}),(0,h.Z)((0,d.Z)(e),"reqs",{}),(0,h.Z)((0,d.Z)(e),"fileInput",void 0),(0,h.Z)((0,d.Z)(e),"_isMounted",void 0),(0,h.Z)((0,d.Z)(e),"onChange",function(t){var n=e.props,r=n.accept,a=n.directory,i=t.target.files,l=(0,o.Z)(i).filter(function(e){return!a||k(e,r)});e.uploadFiles(l),e.reset()}),(0,h.Z)((0,d.Z)(e),"onClick",function(t){var n=e.fileInput;if(n){var r=t.target,o=e.props.onClick;r&&"BUTTON"===r.tagName&&(n.parentNode.focus(),r.blur()),n.click(),o&&o(t)}}),(0,h.Z)((0,d.Z)(e),"onKeyDown",function(t){"Enter"===t.key&&e.onClick(t)}),(0,h.Z)((0,d.Z)(e),"onFileDrop",function(t){var n=e.props.multiple;if(t.preventDefault(),"dragover"!==t.type){if(e.props.directory)E(Array.prototype.slice.call(t.dataTransfer.items),e.uploadFiles,function(t){return k(t,e.props.accept)});else{var r=(0,o.Z)(t.dataTransfer.files).filter(function(t){return k(t,e.props.accept)});!1===n&&(r=r.slice(0,1)),e.uploadFiles(r)}}}),(0,h.Z)((0,d.Z)(e),"uploadFiles",function(t){var n=(0,o.Z)(t);Promise.all(n.map(function(t){return t.uid=j(),e.processFile(t,n)})).then(function(t){var n=e.props.onBatchStart;null==n||n(t.map(function(e){return{file:e.origin,parsedFile:e.parsedFile}})),t.filter(function(e){return null!==e.parsedFile}).forEach(function(t){e.post(t)})})}),(0,h.Z)((0,d.Z)(e),"processFile",(r=(0,b.Z)((0,v.Z)().mark(function t(n,r){var o,a,i,l,s,c,u,d,f;return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.props.beforeUpload,a=n,!o){t.next=14;break}return t.prev=3,t.next=6,o(n,r);case 6:a=t.sent,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),a=!1;case 12:if(!1!==a){t.next=14;break}return t.abrupt("return",{origin:n,parsedFile:null,action:null,data:null});case 14:if("function"!=typeof(i=e.props.action)){t.next=21;break}return t.next=18,i(n);case 18:l=t.sent,t.next=22;break;case 21:l=i;case 22:if("function"!=typeof(s=e.props.data)){t.next=29;break}return t.next=26,s(n);case 26:c=t.sent,t.next=30;break;case 29:c=s;case 30:return(u=("object"===(0,y.Z)(a)||"string"==typeof a)&&a?a:n)instanceof File?d=u:d=new File([u],n.name,{type:n.type}),(f=d).uid=n.uid,t.abrupt("return",{origin:n,data:c,parsedFile:f,action:l});case 35:case"end":return t.stop()}},t,null,[[3,9]])})),function(e,t){return r.apply(this,arguments)})),(0,h.Z)((0,d.Z)(e),"saveFileInput",function(t){e.fileInput=t}),e}return(0,u.Z)(n,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(e){var t=this,n=e.data,r=e.origin,o=e.action,a=e.parsedFile;if(this._isMounted){var i=this.props,l=i.onStart,s=i.customRequest,c=i.name,u=i.headers,d=i.withCredentials,f=i.method,p=r.uid;l(r),this.reqs[p]=(s||function(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(t){var r=e.data[t];if(Array.isArray(r)){r.forEach(function(e){n.append("".concat(t,"[]"),e)});return}n.append(t,r)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300){var n;return e.onError(((n=Error("cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"))).status=t.status,n.method=e.method,n.url=e.action,n),S(t))}return e.onSuccess(S(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return null!==r["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(e){null!==r[e]&&t.setRequestHeader(e,r[e])}),t.send(n),{abort:function(){t.abort()}}})({action:o,filename:c,data:n,file:a,headers:u,withCredentials:d,method:f||"post",onProgress:function(e){var n=t.props.onProgress;null==n||n(e,a)},onSuccess:function(e,n){var r=t.props.onSuccess;null==r||r(e,a,n),delete t.reqs[p]},onError:function(e,n){var r=t.props.onError;null==r||r(e,n,a),delete t.reqs[p]}})}}},{key:"reset",value:function(){this.setState({uid:j()})}},{key:"abort",value:function(e){var t=this.reqs;if(e){var n=e.uid?e.uid:e;t[n]&&t[n].abort&&t[n].abort(),delete t[n]}else Object.keys(t).forEach(function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]})}},{key:"render",value:function(){var e,t=this.props,n=t.component,o=t.prefixCls,a=t.className,i=t.classNames,c=t.disabled,u=t.id,d=t.style,f=t.styles,p=t.multiple,v=t.accept,y=t.capture,b=t.children,w=t.directory,k=t.openFileDialogOnClick,S=t.onMouseEnter,E=t.onMouseLeave,O=t.hasControlInside,C=(0,g.Z)(t,_),j=l()((e={},(0,h.Z)(e,o,!0),(0,h.Z)(e,"".concat(o,"-disabled"),c),(0,h.Z)(e,a,a),e)),P=c?{}:{onClick:k?this.onClick:function(){},onKeyDown:k?this.onKeyDown:function(){},onMouseEnter:S,onMouseLeave:E,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:O?void 0:"0"};return r.createElement(n,(0,s.Z)({},P,{className:j,role:O?void 0:"button",style:d}),r.createElement("input",(0,s.Z)({},(0,x.Z)(C,{aria:!0,data:!0}),{id:u,disabled:c,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:(0,m.Z)({display:"none"},(void 0===f?{}:f).input),className:(void 0===i?{}:i).input,accept:v},w?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},{multiple:p,onChange:this.onChange},null!=y?{capture:y}:{})),b)}}]),n}(r.Component);function N(){}var T=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;(0,c.Z)(this,n);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),(0,h.Z)((0,d.Z)(e),"uploader",void 0),(0,h.Z)((0,d.Z)(e),"saveUploader",function(t){e.uploader=t}),e}return(0,u.Z)(n,[{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){return r.createElement(P,(0,s.Z)({},this.props,{ref:this.saveUploader}))}}]),n}(r.Component);(0,h.Z)(T,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:N,onError:N,onSuccess:N,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});var A=n(50506),M=n(71744),I=n(86586),R=n(55274),D=n(13823),L=n(12918),Z=n(63074),z=n(80669),B=n(3104),F=n(352),H=e=>{let{componentCls:t,iconCls:n}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-drag")]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:"".concat((0,F.bf)(e.lineWidth)," dashed ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),[t]:{padding:e.padding},["".concat(t,"-btn")]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:"".concat((0,F.bf)(e.lineWidthFocus)," solid ").concat(e.colorPrimaryBorder)}},["".concat(t,"-drag-container")]:{display:"table-cell",verticalAlign:"middle"},["\n &:not(".concat(t,"-disabled):hover,\n &-hover:not(").concat(t,"-disabled)\n ")]:{borderColor:e.colorPrimaryHover},["p".concat(t,"-drag-icon")]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},["p".concat(t,"-text")]:{margin:"0 0 ".concat((0,F.bf)(e.marginXXS)),color:e.colorTextHeading,fontSize:e.fontSizeLG},["p".concat(t,"-hint")]:{color:e.colorTextDescription,fontSize:e.fontSize},["&".concat(t,"-disabled")]:{["p".concat(t,"-drag-icon ").concat(n,",\n p").concat(t,"-text,\n p").concat(t,"-hint\n ")]:{color:e.colorTextDisabled}}}}}},q=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSize:o,lineHeight:a,calc:i}=e,l="".concat(t,"-list-item"),s="".concat(l,"-actions"),c="".concat(l,"-action"),u=e.fontHeightSM;return{["".concat(t,"-wrapper")]:{["".concat(t,"-list")]:Object.assign(Object.assign({},(0,L.dF)()),{lineHeight:e.lineHeight,[l]:{position:"relative",height:i(e.lineHeight).mul(o).equal(),marginTop:e.marginXS,fontSize:o,display:"flex",alignItems:"center",transition:"background-color ".concat(e.motionDurationSlow),"&:hover":{backgroundColor:e.controlItemBgHover},["".concat(l,"-name")]:Object.assign(Object.assign({},L.vS),{padding:"0 ".concat((0,F.bf)(e.paddingXS)),lineHeight:a,flex:"auto",transition:"all ".concat(e.motionDurationSlow)}),[s]:{[c]:{opacity:0},[r]:{color:e.actionsColor,transition:"all ".concat(e.motionDurationSlow)},["\n ".concat(c,":focus-visible,\n &.picture ").concat(c,"\n ")]:{opacity:1},["".concat(c).concat(n,"-btn")]:{height:u,border:0,lineHeight:1}},["".concat(t,"-icon ").concat(r)]:{color:e.colorTextDescription,fontSize:o},["".concat(l,"-progress")]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:i(o).add(e.paddingXS).equal(),fontSize:o,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},["".concat(l,":hover ").concat(c)]:{opacity:1},["".concat(l,"-error")]:{color:e.colorError,["".concat(l,"-name, ").concat(t,"-icon ").concat(r)]:{color:e.colorError},[s]:{["".concat(r,", ").concat(r,":hover")]:{color:e.colorError},[c]:{opacity:1}}},["".concat(t,"-list-item-container")]:{transition:"opacity ".concat(e.motionDurationSlow,", height ").concat(e.motionDurationSlow),"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},W=n(11699);let U=new F.E4("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),K=new F.E4("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var $=e=>{let{componentCls:t}=e,n="".concat(t,"-animate-inline");return[{["".concat(t,"-wrapper")]:{["".concat(n,"-appear, ").concat(n,"-enter, ").concat(n,"-leave")]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},["".concat(n,"-appear, ").concat(n,"-enter")]:{animationName:U},["".concat(n,"-leave")]:{animationName:K}}},{["".concat(t,"-wrapper")]:(0,W.J$)(e)},U,K]},V=n(31373);let X=e=>{let{componentCls:t,iconCls:n,uploadThumbnailSize:r,uploadProgressOffset:o,calc:a}=e,i="".concat(t,"-list"),l="".concat(i,"-item");return{["".concat(t,"-wrapper")]:{["\n ".concat(i).concat(i,"-picture,\n ").concat(i).concat(i,"-picture-card,\n ").concat(i).concat(i,"-picture-circle\n ")]:{[l]:{position:"relative",height:a(r).add(a(e.lineWidth).mul(2)).add(a(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:"".concat((0,F.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},["".concat(l,"-thumbnail")]:Object.assign(Object.assign({},L.vS),{width:r,height:r,lineHeight:(0,F.bf)(a(r).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),["".concat(l,"-progress")]:{bottom:o,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingSM).mul(2).equal()),")"),marginTop:0,paddingInlineStart:a(r).add(e.paddingXS).equal()}},["".concat(l,"-error")]:{borderColor:e.colorError,["".concat(l,"-thumbnail ").concat(n)]:{["svg path[fill='".concat(V.iN[0],"']")]:{fill:e.colorErrorBg},["svg path[fill='".concat(V.iN.primary,"']")]:{fill:e.colorError}}},["".concat(l,"-uploading")]:{borderStyle:"dashed",["".concat(l,"-name")]:{marginBottom:o}}},["".concat(i).concat(i,"-picture-circle ").concat(l)]:{["&, &::before, ".concat(l,"-thumbnail")]:{borderRadius:"50%"}}}}},G=e=>{let{componentCls:t,iconCls:n,fontSizeLG:r,colorTextLightSolid:o,calc:a}=e,i="".concat(t,"-list"),l="".concat(i,"-item"),s=e.uploadPicCardSize;return{["\n ".concat(t,"-wrapper").concat(t,"-picture-card-wrapper,\n ").concat(t,"-wrapper").concat(t,"-picture-circle-wrapper\n ")]:Object.assign(Object.assign({},(0,L.dF)()),{display:"inline-block",width:"100%",["".concat(t).concat(t,"-select")]:{width:s,height:s,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:"".concat((0,F.bf)(e.lineWidth)," dashed ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),["> ".concat(t)]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},["&:not(".concat(t,"-disabled):hover")]:{borderColor:e.colorPrimary}},["".concat(i).concat(i,"-picture-card, ").concat(i).concat(i,"-picture-circle")]:{["".concat(i,"-item-container")]:{display:"inline-block",width:s,height:s,marginBlock:"0 ".concat((0,F.bf)(e.marginXS)),marginInline:"0 ".concat((0,F.bf)(e.marginXS)),verticalAlign:"top"},"&::after":{display:"none"},[l]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),height:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),backgroundColor:e.colorBgMask,opacity:0,transition:"all ".concat(e.motionDurationSlow),content:'" "'}},["".concat(l,":hover")]:{["&::before, ".concat(l,"-actions")]:{opacity:1}},["".concat(l,"-actions")]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:"all ".concat(e.motionDurationSlow),["\n ".concat(n,"-eye,\n ").concat(n,"-download,\n ").concat(n,"-delete\n ")]:{zIndex:10,width:r,margin:"0 ".concat((0,F.bf)(e.marginXXS)),fontSize:r,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},["".concat(l,"-thumbnail, ").concat(l,"-thumbnail img")]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},["".concat(l,"-name")]:{display:"none",textAlign:"center"},["".concat(l,"-file + ").concat(l,"-name")]:{position:"absolute",bottom:e.margin,display:"block",width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")")},["".concat(l,"-uploading")]:{["&".concat(l)]:{backgroundColor:e.colorFillAlter},["&::before, ".concat(n,"-eye, ").concat(n,"-download, ").concat(n,"-delete")]:{display:"none"}},["".concat(l,"-progress")]:{bottom:e.marginXL,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),paddingInlineStart:0}}}),["".concat(t,"-wrapper").concat(t,"-picture-circle-wrapper")]:{["".concat(t).concat(t,"-select")]:{borderRadius:"50%"}}}};var Y=e=>{let{componentCls:t}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"}}};let Q=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,L.Wf)(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},["".concat(t,"-select")]:{display:"inline-block"},["".concat(t,"-disabled")]:{color:n,cursor:"not-allowed"}})}};var J=(0,z.I$)("Upload",e=>{let{fontSizeHeading3:t,fontHeight:n,lineWidth:r,controlHeightLG:o,calc:a}=e,i=(0,B.TS)(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(n).div(2)).add(r).equal(),uploadPicCardSize:a(o).mul(2.55).equal()});return[Q(i),H(i),X(i),G(i),q(i),$(i),Y(i),(0,Z.Z)(i)]},e=>({actionsColor:e.colorTextDescription})),ee={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:e}}]}},name:"file",theme:"twotone"},et=n(55015),en=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:ee}))}),er=n(61935),eo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},ea=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:eo}))}),ei={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:e}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:e}}]}},name:"picture",theme:"twotone"},el=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:ei}))}),es=n(47970),ec=n(51646),eu=n(68710),ed=n(19722),ef=n(73002);function ep(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function eh(e,t){let n=(0,o.Z)(t),r=n.findIndex(t=>{let{uid:n}=t;return n===e.uid});return -1===r?n.push(e):n[r]=e,n}function em(e,t){let n=void 0!==e.uid?"uid":"name";return t.filter(t=>t[n]===e[n])[0]}let eg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},ev=e=>0===e.indexOf("image/"),ey=e=>{if(e.type&&!e.thumbUrl)return ev(e.type);let t=e.thumbUrl||e.url||"",n=eg(t);return!!(/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n))||!/^data:/.test(t)&&!n};function eb(e){return new Promise(t=>{if(!e.type||!ev(e.type)){t("");return}let n=document.createElement("canvas");n.width=200,n.height=200,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(200,"px; height: ").concat(200,"px; z-index: 9999; display: none;"),document.body.appendChild(n);let r=n.getContext("2d"),o=new Image;if(o.onload=()=>{let{width:e,height:a}=o,i=200,l=200,s=0,c=0;e>a?c=-((l=200/e*a)-i)/2:s=-((i=200/a*e)-l)/2,r.drawImage(o,s,c,i,l);let u=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(o.src),t(u)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){let t=new FileReader;t.onload=()=>{t.result&&(o.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){let n=new FileReader;n.onload=()=>{n.result&&t(n.result)},n.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var ex=n(26349),ew=n(73879),ek=n(6520),eS=n(68565),eE=n(89970);let eO=r.forwardRef((e,t)=>{var n,o;let{prefixCls:a,className:i,style:s,locale:c,listType:u,file:d,items:f,progress:p,iconRender:h,actionIconRender:m,itemRender:g,isImgUrl:v,showPreviewIcon:y,showRemoveIcon:b,showDownloadIcon:x,previewIcon:w,removeIcon:k,downloadIcon:S,onPreview:E,onDownload:O,onClose:C}=e,{status:j}=d,[_,P]=r.useState(j);r.useEffect(()=>{"removed"!==j&&P(j)},[j]);let[N,T]=r.useState(!1);r.useEffect(()=>{let e=setTimeout(()=>{T(!0)},300);return()=>{clearTimeout(e)}},[]);let A=h(d),I=r.createElement("div",{className:"".concat(a,"-icon")},A);if("picture"===u||"picture-card"===u||"picture-circle"===u){if("uploading"!==_&&(d.thumbUrl||d.url)){let e=(null==v?void 0:v(d))?r.createElement("img",{src:d.thumbUrl||d.url,alt:d.name,className:"".concat(a,"-list-item-image"),crossOrigin:d.crossOrigin}):A,t=l()("".concat(a,"-list-item-thumbnail"),{["".concat(a,"-list-item-file")]:v&&!v(d)});I=r.createElement("a",{className:t,onClick:e=>E(d,e),href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer"},e)}else{let e=l()("".concat(a,"-list-item-thumbnail"),{["".concat(a,"-list-item-file")]:"uploading"!==_});I=r.createElement("div",{className:e},A)}}let R=l()("".concat(a,"-list-item"),"".concat(a,"-list-item-").concat(_)),D="string"==typeof d.linkProps?JSON.parse(d.linkProps):d.linkProps,L=b?m(("function"==typeof k?k(d):k)||r.createElement(ex.Z,null),()=>C(d),a,c.removeFile,!0):null,Z=x&&"done"===_?m(("function"==typeof S?S(d):S)||r.createElement(ew.Z,null),()=>O(d),a,c.downloadFile):null,z="picture-card"!==u&&"picture-circle"!==u&&r.createElement("span",{key:"download-delete",className:l()("".concat(a,"-list-item-actions"),{picture:"picture"===u})},Z,L),B=l()("".concat(a,"-list-item-name")),F=d.url?[r.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:B,title:d.name},D,{href:d.url,onClick:e=>E(d,e)}),d.name),z]:[r.createElement("span",{key:"view",className:B,onClick:e=>E(d,e),title:d.name},d.name),z],H=y&&(d.url||d.thumbUrl)?r.createElement("a",{href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>E(d,e),title:c.previewFile},"function"==typeof w?w(d):w||r.createElement(ek.Z,null)):null,q=("picture-card"===u||"picture-circle"===u)&&"uploading"!==_&&r.createElement("span",{className:"".concat(a,"-list-item-actions")},H,"done"===_&&Z,L),{getPrefixCls:W}=r.useContext(M.E_),U=W(),K=r.createElement("div",{className:R},I,F,q,N&&r.createElement(es.ZP,{motionName:"".concat(U,"-fade"),visible:"uploading"===_,motionDeadline:2e3},e=>{let{className:t}=e,n="percent"in d?r.createElement(eS.Z,Object.assign({},p,{type:"line",percent:d.percent,"aria-label":d["aria-label"],"aria-labelledby":d["aria-labelledby"]})):null;return r.createElement("div",{className:l()("".concat(a,"-list-item-progress"),t)},n)})),$=d.response&&"string"==typeof d.response?d.response:(null===(n=d.error)||void 0===n?void 0:n.statusText)||(null===(o=d.error)||void 0===o?void 0:o.message)||c.uploadError,V="error"===_?r.createElement(eE.Z,{title:$,getPopupContainer:e=>e.parentNode},K):K;return r.createElement("div",{className:l()("".concat(a,"-list-item-container"),i),style:s,ref:t},g?g(V,d,f,{download:O.bind(null,d),preview:E.bind(null,d),remove:C.bind(null,d)}):V)}),eC=r.forwardRef((e,t)=>{let{listType:n="text",previewFile:a=eb,onPreview:i,onDownload:s,onRemove:c,locale:u,iconRender:d,isImageUrl:f=ey,prefixCls:p,items:h=[],showPreviewIcon:m=!0,showRemoveIcon:g=!0,showDownloadIcon:v=!1,removeIcon:y,previewIcon:b,downloadIcon:x,progress:w={size:[-1,2],showInfo:!1},appendAction:k,appendActionVisible:S=!0,itemRender:E,disabled:O}=e,C=(0,ec.Z)(),[j,_]=r.useState(!1);r.useEffect(()=>{("picture"===n||"picture-card"===n||"picture-circle"===n)&&(h||[]).forEach(e=>{"undefined"!=typeof document&&"undefined"!=typeof window&&window.FileReader&&window.File&&(e.originFileObj instanceof File||e.originFileObj instanceof Blob)&&void 0===e.thumbUrl&&(e.thumbUrl="",a&&a(e.originFileObj).then(t=>{e.thumbUrl=t||"",C()}))})},[n,h,a]),r.useEffect(()=>{_(!0)},[]);let P=(e,t)=>{if(i)return null==t||t.preventDefault(),i(e)},N=e=>{"function"==typeof s?s(e):e.url&&window.open(e.url)},T=e=>{null==c||c(e)},A=e=>{if(d)return d(e,n);let t="uploading"===e.status,o=f&&f(e)?r.createElement(el,null):r.createElement(en,null),a=t?r.createElement(er.Z,null):r.createElement(ea,null);return"picture"===n?a=t?r.createElement(er.Z,null):o:("picture-card"===n||"picture-circle"===n)&&(a=t?u.uploading:o),a},I=(e,t,n,o,a)=>{let i={type:"text",size:"small",title:o,onClick:n=>{t(),(0,ed.l$)(e)&&e.props.onClick&&e.props.onClick(n)},className:"".concat(n,"-list-item-action")};if(a&&(i.disabled=O),(0,ed.l$)(e)){let t=(0,ed.Tm)(e,Object.assign(Object.assign({},e.props),{onClick:()=>{}}));return r.createElement(ef.ZP,Object.assign({},i,{icon:t}))}return r.createElement(ef.ZP,Object.assign({},i),r.createElement("span",null,e))};r.useImperativeHandle(t,()=>({handlePreview:P,handleDownload:N}));let{getPrefixCls:R}=r.useContext(M.E_),D=R("upload",p),L=R(),Z=l()("".concat(D,"-list"),"".concat(D,"-list-").concat(n)),z=(0,o.Z)(h.map(e=>({key:e.uid,file:e}))),B={motionDeadline:2e3,motionName:"".concat(D,"-").concat("picture-card"===n||"picture-circle"===n?"animate-inline":"animate"),keys:z,motionAppear:j},F=r.useMemo(()=>{let e=Object.assign({},(0,eu.Z)(L));return delete e.onAppearEnd,delete e.onEnterEnd,delete e.onLeaveEnd,e},[L]);return"picture-card"!==n&&"picture-circle"!==n&&(B=Object.assign(Object.assign({},F),B)),r.createElement("div",{className:Z},r.createElement(es.V4,Object.assign({},B,{component:!1}),e=>{let{key:t,file:o,className:a,style:i}=e;return r.createElement(eO,{key:t,locale:u,prefixCls:D,className:a,style:i,file:o,items:h,progress:w,listType:n,isImgUrl:f,showPreviewIcon:m,showRemoveIcon:g,showDownloadIcon:v,removeIcon:y,previewIcon:b,downloadIcon:x,iconRender:A,actionIconRender:I,itemRender:E,onPreview:P,onDownload:N,onClose:T})}),k&&r.createElement(es.ZP,Object.assign({},B,{visible:S,forceRender:!0}),e=>{let{className:t,style:n}=e;return(0,ed.Tm)(k,e=>({className:l()(e.className,t),style:Object.assign(Object.assign(Object.assign({},n),{pointerEvents:t?"none":void 0}),e.style)}))}))}),ej="__LIST_IGNORE_".concat(Date.now(),"__"),e_=r.forwardRef((e,t)=>{let n;let{fileList:i,defaultFileList:s,onRemove:c,showUploadList:u=!0,listType:d="text",onPreview:f,onDownload:p,onChange:h,onDrop:m,previewFile:g,disabled:v,locale:y,iconRender:b,isImageUrl:x,progress:w,prefixCls:k,className:S,type:E="select",children:O,style:C,itemRender:j,maxCount:_,data:P={},multiple:N=!1,hasControlInside:L=!0,action:Z="",accept:z="",supportServerRender:B=!0,rootClassName:F}=e,H=r.useContext(I.Z),q=null!=v?v:H,[W,U]=(0,A.Z)(s||[],{value:i,postState:e=>null!=e?e:[]}),[K,$]=r.useState("drop"),V=r.useRef(null);r.useMemo(()=>{let e=Date.now();(i||[]).forEach((t,n)=>{t.uid||Object.isFrozen(t)||(t.uid="__AUTO__".concat(e,"_").concat(n,"__"))})},[i]);let X=(e,t,n)=>{let r=(0,o.Z)(t),i=!1;1===_?r=r.slice(-1):_&&(i=r.length>_,r=r.slice(0,_)),(0,a.flushSync)(()=>{U(r)});let l={file:e,fileList:r};n&&(l.event=n),(!i||r.some(t=>t.uid===e.uid))&&(0,a.flushSync)(()=>{null==h||h(l)})},G=e=>{let t=e.filter(e=>!e.file[ej]);if(!t.length)return;let n=t.map(e=>ep(e.file)),r=(0,o.Z)(W);n.forEach(e=>{r=eh(e,r)}),n.forEach((e,n)=>{let o=e;if(t[n].parsedFile)e.status="uploading";else{let t;let{originFileObj:n}=e;try{t=new File([n],n.name,{type:n.type})}catch(e){(t=new Blob([n],{type:n.type})).name=n.name,t.lastModifiedDate=new Date,t.lastModified=new Date().getTime()}t.uid=e.uid,o=t}X(o,r)})},Y=(e,t,n)=>{try{"string"==typeof e&&(e=JSON.parse(e))}catch(e){}if(!em(t,W))return;let r=ep(t);r.status="done",r.percent=100,r.response=e,r.xhr=n;let o=eh(r,W);X(r,o)},Q=(e,t)=>{if(!em(t,W))return;let n=ep(t);n.status="uploading",n.percent=e.percent;let r=eh(n,W);X(n,r,e)},ee=(e,t,n)=>{if(!em(n,W))return;let r=ep(n);r.error=e,r.response=t,r.status="error";let o=eh(r,W);X(r,o)},et=e=>{let t;Promise.resolve("function"==typeof c?c(e):c).then(n=>{var r;if(!1===n)return;let o=function(e,t){let n=void 0!==e.uid?"uid":"name",r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}(e,W);o&&(t=Object.assign(Object.assign({},e),{status:"removed"}),null==W||W.forEach(e=>{let n=void 0!==t.uid?"uid":"name";e[n]!==t[n]||Object.isFrozen(e)||(e.status="removed")}),null===(r=V.current)||void 0===r||r.abort(t),X(t,o))})},en=e=>{$(e.type),"drop"===e.type&&(null==m||m(e))};r.useImperativeHandle(t,()=>({onBatchStart:G,onSuccess:Y,onProgress:Q,onError:ee,fileList:W,upload:V.current}));let{getPrefixCls:er,direction:eo,upload:ea}=r.useContext(M.E_),ei=er("upload",k),el=Object.assign(Object.assign({onBatchStart:G,onError:ee,onProgress:Q,onSuccess:Y},e),{data:P,multiple:N,action:Z,accept:z,supportServerRender:B,prefixCls:ei,disabled:q,beforeUpload:(t,n)=>{var r,o,a,i;return r=void 0,o=void 0,a=void 0,i=function*(){let{beforeUpload:r,transformFile:o}=e,a=t;if(r){let e=yield r(t,n);if(!1===e)return!1;if(delete t[ej],e===ej)return Object.defineProperty(t,ej,{value:!0,configurable:!0}),!1;"object"==typeof e&&e&&(a=e)}return o&&(a=yield o(a)),a},new(a||(a=Promise))(function(e,t){function n(e){try{s(i.next(e))}catch(e){t(e)}}function l(e){try{s(i.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof a?r:new a(function(e){e(r)})).then(n,l)}s((i=i.apply(r,o||[])).next())})},onChange:void 0,hasControlInside:L});delete el.className,delete el.style,(!O||q)&&delete el.id;let es="".concat(ei,"-wrapper"),[ec,eu,ed]=J(ei,es),[ef]=(0,R.Z)("Upload",D.Z.Upload),{showRemoveIcon:eg,showPreviewIcon:ev,showDownloadIcon:ey,removeIcon:eb,previewIcon:ex,downloadIcon:ew}="boolean"==typeof u?{}:u,ek=void 0===eg?!q:!!eg,eS=(e,t)=>u?r.createElement(eC,{prefixCls:ei,listType:d,items:W,previewFile:g,onPreview:f,onDownload:p,onRemove:et,showRemoveIcon:ek,showPreviewIcon:ev,showDownloadIcon:ey,removeIcon:eb,previewIcon:ex,downloadIcon:ew,iconRender:b,locale:Object.assign(Object.assign({},ef),y),isImageUrl:x,progress:w,appendAction:e,appendActionVisible:t,itemRender:j,disabled:q}):e,eE=l()(es,S,F,eu,ed,null==ea?void 0:ea.className,{["".concat(ei,"-rtl")]:"rtl"===eo,["".concat(ei,"-picture-card-wrapper")]:"picture-card"===d,["".concat(ei,"-picture-circle-wrapper")]:"picture-circle"===d}),eO=Object.assign(Object.assign({},null==ea?void 0:ea.style),C);if("drag"===E){let e=l()(eu,ei,"".concat(ei,"-drag"),{["".concat(ei,"-drag-uploading")]:W.some(e=>"uploading"===e.status),["".concat(ei,"-drag-hover")]:"dragover"===K,["".concat(ei,"-disabled")]:q,["".concat(ei,"-rtl")]:"rtl"===eo});return ec(r.createElement("span",{className:eE},r.createElement("div",{className:e,style:eO,onDrop:en,onDragOver:en,onDragLeave:en},r.createElement(T,Object.assign({},el,{ref:V,className:"".concat(ei,"-btn")}),r.createElement("div",{className:"".concat(ei,"-drag-container")},O))),eS()))}let e_=l()(ei,"".concat(ei,"-select"),{["".concat(ei,"-disabled")]:q}),eP=(n=O?void 0:{display:"none"},r.createElement("div",{className:e_,style:n},r.createElement(T,Object.assign({},el,{ref:V}))));return ec("picture-card"===d||"picture-circle"===d?r.createElement("span",{className:eE},eS(eP,!!O)):r.createElement("span",{className:eE},eP,eS()))});var eP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eN=r.forwardRef((e,t)=>{var{style:n,height:o,hasControlInside:a=!1}=e,i=eP(e,["style","height","hasControlInside"]);return r.createElement(e_,Object.assign({ref:t,hasControlInside:a},i,{type:"drag",style:Object.assign(Object.assign({},n),{height:o})}))});e_.Dragger=eN,e_.LIST_IGNORE=ej;var eT=e_},49211:function(e,t,n){"use strict";var r=n(99623),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,i,l,s,c,u,d,f=!1;t||(t={}),i=t.debug||!1;try{if(s=r(),c=document.createRange(),u=document.getSelection(),(d=document.createElement("span")).textContent=e,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),void 0===n.clipboardData){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=o[t.format]||o.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),c.selectNodeContents(d),u.addRange(c),!document.execCommand("copy"))throw Error("copy command was unsuccessful");f=!0}catch(r){i&&console.error("unable to copy using execCommand: ",r),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(r){i&&console.error("unable to copy using clipboardData: ",r),i&&console.error("falling back to prompt"),n="message"in t?t.message:"Copy to clipboard: #{key}, Enter",a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",l=n.replace(/#{\s*key\s*}/g,a),window.prompt(l,e)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(c):u.removeAllRanges()),d&&document.body.removeChild(d),s()}return f}},7656:function(e,t,n){"use strict";function r(e,t){if(t.length<e)throw TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}n.d(t,{Z:function(){return r}})},47869:function(e,t,n){"use strict";function r(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n.d(t,{Z:function(){return r}})},7366:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(41154),o=n(25721),a=n(55463),i=n(99735),l=n(7656),s=n(47869);function c(e,t){if((0,l.Z)(2,arguments),!t||"object"!==(0,r.Z)(t))return new Date(NaN);var n=t.years?(0,s.Z)(t.years):0,c=t.months?(0,s.Z)(t.months):0,u=t.weeks?(0,s.Z)(t.weeks):0,d=t.days?(0,s.Z)(t.days):0,f=t.hours?(0,s.Z)(t.hours):0,p=t.minutes?(0,s.Z)(t.minutes):0,h=t.seconds?(0,s.Z)(t.seconds):0,m=(0,i.Z)(e),g=c||n?(0,a.Z)(m,c+12*n):m;return new Date((d||u?(0,o.Z)(g,d+7*u):g).getTime()+1e3*(h+60*(p+60*f)))}},25721:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47869),o=n(99735),a=n(7656);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e),i=(0,r.Z)(t);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}},55463:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47869),o=n(99735),a=n(7656);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e),i=(0,r.Z)(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),s=new Date(n.getTime());return(s.setMonth(n.getMonth()+i+1,0),l>=s.getDate())?s:(n.setFullYear(s.getFullYear(),s.getMonth(),l),n)}},99735:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(41154),o=n(7656);function a(e){(0,o.Z)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,r.Z)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):(("string"==typeof e||"[object String]"===t)&&"undefined"!=typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}},61134:function(e,t,n){var r;!function(o){"use strict";var a,i={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},l=!0,s="[DecimalError] ",c=s+"Invalid argument: ",u=s+"Exponent out of range: ",d=Math.floor,f=Math.pow,p=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=d(1286742750677284.5),m={};function g(e,t){var n,r,o,a,i,s,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),l?C(t,f):t;if(c=e.d,u=t.d,i=e.e,o=t.e,c=c.slice(),a=i-o){for(a<0?(r=c,a=-a,s=u.length):(r=u,o=i,s=c.length),a>(s=(i=Math.ceil(f/7))>s?i+1:s+1)&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for((s=c.length)-(a=u.length)<0&&(a=s,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/1e7|0,c[a]%=1e7;for(n&&(c.unshift(n),++o),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=o,l?C(t,f):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(c+e)}function y(e){var t,n,r,o=e.length-1,a="",i=e[0];if(o>0){for(a+=i,t=1;t<o;t++)(n=7-(r=e[t]+"").length)&&(a+=S(n)),a+=r;(n=7-(r=(i=e[t])+"").length)&&(a+=S(n))}else if(0===i)return"0";for(;i%10==0;)i/=10;return a+i}m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},m.comparedTo=m.cmp=function(e){var t,n,r,o;if(e=new this.constructor(e),this.s!==e.s)return this.s||-e.s;if(this.e!==e.e)return this.e>e.e^this.s<0?1:-1;for(t=0,n=(r=this.d.length)<(o=e.d.length)?r:o;t<n;++t)if(this.d[t]!==e.d[t])return this.d[t]>e.d[t]^this.s<0?1:-1;return r===o?0:r>o^this.s<0?1:-1},m.decimalPlaces=m.dp=function(){var e=this.d.length-1,t=(e-this.e)*7;if(e=this.d[e])for(;e%10==0;e/=10)t--;return t<0?0:t},m.dividedBy=m.div=function(e){return b(this,new this.constructor(e))},m.dividedToIntegerBy=m.idiv=function(e){var t=this.constructor;return C(b(this,new t(e),0,1),t.precision)},m.equals=m.eq=function(e){return!this.cmp(e)},m.exponent=function(){return w(this)},m.greaterThan=m.gt=function(e){return this.cmp(e)>0},m.greaterThanOrEqualTo=m.gte=function(e){return this.cmp(e)>=0},m.isInteger=m.isint=function(){return this.e>this.d.length-2},m.isNegative=m.isneg=function(){return this.s<0},m.isPositive=m.ispos=function(){return this.s>0},m.isZero=function(){return 0===this.s},m.lessThan=m.lt=function(e){return 0>this.cmp(e)},m.lessThanOrEqualTo=m.lte=function(e){return 1>this.cmp(e)},m.logarithm=m.log=function(e){var t,n=this.constructor,r=n.precision,o=r+5;if(void 0===e)e=new n(10);else if((e=new n(e)).s<1||e.eq(a))throw Error(s+"NaN");if(this.s<1)throw Error(s+(this.s?"NaN":"-Infinity"));return this.eq(a)?new n(0):(l=!1,t=b(E(this,o),E(e,o),o),l=!0,C(t,r))},m.minus=m.sub=function(e){return e=new this.constructor(e),this.s==e.s?j(this,e):g(this,(e.s=-e.s,e))},m.modulo=m.mod=function(e){var t,n=this.constructor,r=n.precision;if(!(e=new n(e)).s)throw Error(s+"NaN");return this.s?(l=!1,t=b(this,e,0,1).times(e),l=!0,this.minus(t)):C(new n(this),r)},m.naturalExponential=m.exp=function(){return x(this)},m.naturalLogarithm=m.ln=function(){return E(this)},m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},m.plus=m.add=function(e){return e=new this.constructor(e),this.s==e.s?g(this,e):j(this,(e.s=-e.s,e))},m.precision=m.sd=function(e){var t,n,r;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(c+e);if(t=w(this)+1,n=7*(r=this.d.length-1)+1,r=this.d[r]){for(;r%10==0;r/=10)n--;for(r=this.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},m.squareRoot=m.sqrt=function(){var e,t,n,r,o,a,i,c=this.constructor;if(this.s<1){if(!this.s)return new c(0);throw Error(s+"NaN")}for(e=w(this),l=!1,0==(o=Math.sqrt(+this))||o==1/0?(((t=y(this.d)).length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=d((e+1)/2)-(e<0||e%2),r=new c(t=o==1/0?"5e"+e:(t=o.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new c(o.toString()),o=i=(n=c.precision)+3;;)if(r=(a=r).plus(b(this,a,i+2)).times(.5),y(a.d).slice(0,i)===(t=y(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),o==i&&"4999"==t){if(C(a,n+1,0),a.times(a).eq(this)){r=a;break}}else if("9999"!=t)break;i+=4}return l=!0,C(r,n)},m.times=m.mul=function(e){var t,n,r,o,a,i,s,c,u,d=this.constructor,f=this.d,p=(e=new d(e)).d;if(!this.s||!e.s)return new d(0);for(e.s*=this.s,n=this.e+e.e,(c=f.length)<(u=p.length)&&(a=f,f=p,p=a,i=c,c=u,u=i),a=[],r=i=c+u;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,o=c+r;o>r;)s=a[o]+p[r]*f[o-r-1]+t,a[o--]=s%1e7|0,t=s/1e7|0;a[o]=(a[o]+t)%1e7|0}for(;!a[--i];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,l?C(e,d.precision):e},m.toDecimalPlaces=m.todp=function(e,t){var n=this,r=n.constructor;return(n=new r(n),void 0===e)?n:(v(e,0,1e9),void 0===t?t=r.rounding:v(t,0,8),C(n,e+w(n)+1,t))},m.toExponential=function(e,t){var n,r=this,o=r.constructor;return void 0===e?n=_(r,!0):(v(e,0,1e9),void 0===t?t=o.rounding:v(t,0,8),n=_(r=C(new o(r),e+1,t),!0,e+1)),n},m.toFixed=function(e,t){var n,r,o=this.constructor;return void 0===e?_(this):(v(e,0,1e9),void 0===t?t=o.rounding:v(t,0,8),n=_((r=C(new o(this),e+w(this)+1,t)).abs(),!1,e+w(r)+1),this.isneg()&&!this.isZero()?"-"+n:n)},m.toInteger=m.toint=function(){var e=this.constructor;return C(new e(this),w(this)+1,e.rounding)},m.toNumber=function(){return+this},m.toPower=m.pow=function(e){var t,n,r,o,i,c,u=this,f=u.constructor,p=+(e=new f(e));if(!e.s)return new f(a);if(!(u=new f(u)).s){if(e.s<1)throw Error(s+"Infinity");return u}if(u.eq(a))return u;if(r=f.precision,e.eq(a))return C(u,r);if(c=(t=e.e)>=(n=e.d.length-1),i=u.s,c){if((n=p<0?-p:p)<=9007199254740991){for(o=new f(a),t=Math.ceil(r/7+4),l=!1;n%2&&P((o=o.times(u)).d,t),0!==(n=d(n/2));)P((u=u.times(u)).d,t);return l=!0,e.s<0?new f(a).div(o):C(o,r)}}else if(i<0)throw Error(s+"NaN");return i=i<0&&1&e.d[Math.max(t,n)]?-1:1,u.s=1,l=!1,o=e.times(E(u,r+12)),l=!0,(o=x(o)).s=i,o},m.toPrecision=function(e,t){var n,r,o=this,a=o.constructor;return void 0===e?(n=w(o),r=_(o,n<=a.toExpNeg||n>=a.toExpPos)):(v(e,1,1e9),void 0===t?t=a.rounding:v(t,0,8),n=w(o=C(new a(o),e,t)),r=_(o,e<=n||n<=a.toExpNeg,e)),r},m.toSignificantDigits=m.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(v(e,1,1e9),void 0===t?t=n.rounding:v(t,0,8)),C(new n(this),e,t)},m.toString=m.valueOf=m.val=m.toJSON=function(){var e=w(this),t=this.constructor;return _(this,e<=t.toExpNeg||e>=t.toExpPos)};var b=function(){function e(e,t){var n,r=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+r,e[o]=n%1e7|0,r=n/1e7|0;return r&&e.unshift(r),e}function t(e,t,n,r){var o,a;if(n!=r)a=n>r?1:-1;else for(o=a=0;o<n;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=1e7*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,o,a,i){var l,c,u,d,f,p,h,m,g,v,y,b,x,k,S,E,O,j,_=r.constructor,P=r.s==o.s?1:-1,N=r.d,T=o.d;if(!r.s)return new _(r);if(!o.s)throw Error(s+"Division by zero");for(u=0,c=r.e-o.e,O=T.length,S=N.length,m=(h=new _(P)).d=[];T[u]==(N[u]||0);)++u;if(T[u]>(N[u]||0)&&--c,(b=null==a?a=_.precision:i?a+(w(r)-w(o))+1:a)<0)return new _(0);if(b=b/7+2|0,u=0,1==O)for(d=0,T=T[0],b++;(u<S||d)&&b--;u++)x=1e7*d+(N[u]||0),m[u]=x/T|0,d=x%T|0;else{for((d=1e7/(T[0]+1)|0)>1&&(T=e(T,d),N=e(N,d),O=T.length,S=N.length),k=O,v=(g=N.slice(0,O)).length;v<O;)g[v++]=0;(j=T.slice()).unshift(0),E=T[0],T[1]>=1e7/2&&++E;do d=0,(l=t(T,g,O,v))<0?(y=g[0],O!=v&&(y=1e7*y+(g[1]||0)),(d=y/E|0)>1?(d>=1e7&&(d=1e7-1),p=(f=e(T,d)).length,v=g.length,1==(l=t(f,g,p,v))&&(d--,n(f,O<p?j:T,p))):(0==d&&(l=d=1),f=T.slice()),(p=f.length)<v&&f.unshift(0),n(g,f,v),-1==l&&(v=g.length,(l=t(T,g,O,v))<1&&(d++,n(g,O<v?j:T,v))),v=g.length):0===l&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[v++]=N[k]||0:(g=[N[k]],v=1);while((k++<S||void 0!==g[0])&&b--)}return m[0]||m.shift(),h.e=c,C(h,i?a+w(h)+1:a)}}();function x(e,t){var n,r,o,i,s,c=0,d=0,p=e.constructor,h=p.precision;if(w(e)>16)throw Error(u+w(e));if(!e.s)return new p(a);for(null==t?(l=!1,s=h):s=t,i=new p(.03125);e.abs().gte(.1);)e=e.times(i),d+=5;for(s+=Math.log(f(2,d))/Math.LN10*2+5|0,n=r=o=new p(a),p.precision=s;;){if(r=C(r.times(e),s),n=n.times(++c),y((i=o.plus(b(r,n,s))).d).slice(0,s)===y(o.d).slice(0,s)){for(;d--;)o=C(o.times(o),s);return p.precision=h,null==t?(l=!0,C(o,h)):o}o=i}}function w(e){for(var t=7*e.e,n=e.d[0];n>=10;n/=10)t++;return t}function k(e,t,n){if(t>e.LN10.sd())throw l=!0,n&&(e.precision=n),Error(s+"LN10 precision limit exceeded");return C(new e(e.LN10),t)}function S(e){for(var t="";e--;)t+="0";return t}function E(e,t){var n,r,o,i,c,u,d,f,p,h=1,m=e,g=m.d,v=m.constructor,x=v.precision;if(m.s<1)throw Error(s+(m.s?"NaN":"-Infinity"));if(m.eq(a))return new v(0);if(null==t?(l=!1,f=x):f=t,m.eq(10))return null==t&&(l=!0),k(v,f);if(f+=10,v.precision=f,r=(n=y(g)).charAt(0),!(15e14>Math.abs(i=w(m))))return d=k(v,f+2,x).times(i+""),m=E(new v(r+"."+n.slice(1)),f-10).plus(d),v.precision=x,null==t?(l=!0,C(m,x)):m;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=y((m=m.times(e)).d)).charAt(0),h++;for(i=w(m),r>1?(m=new v("0."+n),i++):m=new v(r+"."+n.slice(1)),u=c=m=b(m.minus(a),m.plus(a),f),p=C(m.times(m),f),o=3;;){if(c=C(c.times(p),f),y((d=u.plus(b(c,new v(o),f))).d).slice(0,f)===y(u.d).slice(0,f))return u=u.times(2),0!==i&&(u=u.plus(k(v,f+2,x).times(i+""))),u=b(u,new v(h),f),v.precision=x,null==t?(l=!0,C(u,x)):u;u=d,o+=2}}function O(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(o=t.length;48===t.charCodeAt(o-1);)--o;if(t=t.slice(r,o)){if(o-=r,n=n-r-1,e.e=d(n/7),e.d=[],r=(n+1)%7,n<0&&(r+=7),r<o){for(r&&e.d.push(+t.slice(0,r)),o-=7;r<o;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=o;for(;r--;)t+="0";if(e.d.push(+t),l&&(e.e>h||e.e<-h))throw Error(u+n)}else e.s=0,e.e=0,e.d=[0];return e}function C(e,t,n){var r,o,a,i,s,c,p,m,g=e.d;for(i=1,a=g[0];a>=10;a/=10)i++;if((r=t-i)<0)r+=7,o=t,p=g[m=0];else{if((m=Math.ceil((r+1)/7))>=(a=g.length))return e;for(i=1,p=a=g[m];a>=10;a/=10)i++;r%=7,o=r-7+i}if(void 0!==n&&(s=p/(a=f(10,i-o-1))%10|0,c=t<0||void 0!==g[m+1]||p%a,c=n<4?(s||c)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||c||6==n&&(r>0?o>0?p/f(10,i-o):0:g[m-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return c?(a=w(e),g.length=1,t=t-a-1,g[0]=f(10,(7-t%7)%7),e.e=d(-t/7)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(0==r?(g.length=m,a=1,m--):(g.length=m+1,a=f(10,7-r),g[m]=o>0?(p/f(10,i-o)%f(10,o)|0)*a:0),c)for(;;){if(0==m){1e7==(g[0]+=a)&&(g[0]=1,++e.e);break}if(g[m]+=a,1e7!=g[m])break;g[m--]=0,a=1}for(r=g.length;0===g[--r];)g.pop();if(l&&(e.e>h||e.e<-h))throw Error(u+w(e));return e}function j(e,t){var n,r,o,a,i,s,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),l?C(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),i=u-r){for((d=i<0)?(n=c,i=-i,s=f.length):(n=f,r=u,s=c.length),i>(o=Math.max(Math.ceil(h/7),s)+2)&&(i=o,n.length=1),n.reverse(),o=i;o--;)n.push(0);n.reverse()}else{for((d=(o=c.length)<(s=f.length))&&(s=o),o=0;o<s;o++)if(c[o]!=f[o]){d=c[o]<f[o];break}i=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),s=c.length,o=f.length-s;o>0;--o)c[s++]=0;for(o=f.length;o>i;){if(c[--o]<f[o]){for(a=o;a&&0===c[--a];)c[a]=1e7-1;--c[a],c[o]+=1e7}c[o]-=f[o]}for(;0===c[--s];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(t.d=c,t.e=r,l?C(t,h):t):new p(0)}function _(e,t,n){var r,o=w(e),a=y(e.d),i=a.length;return t?(n&&(r=n-i)>0?a=a.charAt(0)+"."+a.slice(1)+S(r):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(o<0?"e":"e+")+o):o<0?(a="0."+S(-o-1)+a,n&&(r=n-i)>0&&(a+=S(r))):o>=i?(a+=S(o+1-i),n&&(r=n-o-1)>0&&(a=a+"."+S(r))):((r=o+1)<i&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-i)>0&&(o+1===i&&(a+="."),a+=S(r))),e.s<0?"-"+a:a}function P(e,t){if(e.length>t)return e.length=t,!0}function N(e){if(!e||"object"!=typeof e)throw Error(s+"Object expected");var t,n,r,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<o.length;t+=3)if(void 0!==(r=e[n=o[t]])){if(d(r)===r&&r>=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(c+n+": "+r)}if(void 0!==(r=e[n="LN10"])){if(r==Math.LN10)this[n]=new this(r);else throw Error(c+n+": "+r)}return this}(i=function e(t){var n,r,o;function a(e){if(!(this instanceof a))return new a(e);if(this.constructor=a,e instanceof a){this.s=e.s,this.e=e.e,this.d=(e=e.d)?e.slice():e;return}if("number"==typeof e){if(0*e!=0)throw Error(c+e);if(e>0)this.s=1;else if(e<0)e=-e,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(e===~~e&&e<1e7){this.e=0,this.d=[e];return}return O(this,e.toString())}if("string"!=typeof e)throw Error(c+e);if(45===e.charCodeAt(0)?(e=e.slice(1),this.s=-1):this.s=1,p.test(e))O(this,e);else throw Error(c+e)}if(a.prototype=m,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=e,a.config=a.set=N,void 0===t&&(t={}),t)for(n=0,o=["precision","rounding","toExpNeg","toExpPos","LN10"];n<o.length;)t.hasOwnProperty(r=o[n++])||(t[r]=this[r]);return a.config(t),a}(i)).default=i.Decimal=i,a=new i(1),void 0!==(r=(function(){return i}).call(t,n,t,e))&&(e.exports=r)}(0)},84617:function(e,t,n){"use strict";var r=n(9973);t.__esModule=!0,t.default=function(e,t){e.classList?e.classList.add(t):(0,o.default)(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))};var o=r(n(98598));e.exports=t.default},98598:function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")},e.exports=t.default},67973:function(e){"use strict";function t(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}e.exports=function(e,n){e.classList?e.classList.remove(n):"string"==typeof e.className?e.className=t(e.className,n):e.setAttribute("class",t(e.className&&e.className.baseVal||"",n))}},77625:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,i){if("function"!=typeof r)throw TypeError("The listener must be a function");var l=new o(r,a||e,i),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],l]:e._events[s].push(l):(e._events[s]=l,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),l.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,a=r.length,i=Array(a);o<a;o++)i[o]=r[o].fn;return i},l.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,o,a,i){var l=n?n+e:e;if(!this._events[l])return!1;var s,c,u=this._events[l],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,a),!0;case 6:return u.fn.call(u.context,t,r,o,a,i),!0}for(c=1,s=Array(d-1);c<d;c++)s[c-1]=arguments[c];u.fn.apply(u.context,s)}else{var f,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,o);break;default:if(!s)for(f=1,s=Array(d-1);f<d;f++)s[f-1]=arguments[f];u[c].fn.apply(u[c].context,s)}}return!0},l.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},l.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},l.prototype.removeListener=function(e,t,r,o){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return i(this,a),this;var l=this._events[a];if(l.fn)l.fn!==t||o&&!l.once||r&&l.context!==r||i(this,a);else{for(var s=0,c=[],u=l.length;s<u;s++)(l[s].fn!==t||o&&!l[s].once||r&&l[s].context!==r)&&c.push(l[s]);c.length?this._events[a]=1===c.length?c[0]:c:i(this,a)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l},6500:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},i=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!a)return!1;for(r in e);return void 0===r||t.call(e,r)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(t=arguments[f],null!=t)for(n in t)r=s(d,n),d!==(o=s(t,n))&&(h&&o&&(i(o)||(c=a(o)))?(c?(c=!1,u=r&&a(r)?r:[]):u=r&&i(r)?r:{},l(d,{name:n,newValue:e(h,u,o)})):void 0!==o&&l(d,{name:n,newValue:o}));return d}},80662:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g;function c(e){return e?e.replace(s,""):""}e.exports=function(e,s){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];s=s||{};var u=1,d=1;function f(e){var t=e.match(n);t&&(u+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(r),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=s.source}h.prototype.content=e;var m=[];function g(t){var n=Error(s.source+":"+u+":"+d+": "+t);if(n.reason=t,n.filename=s.source,n.line=u,n.column=d,n.source=e,s.silent)m.push(n);else throw n}function v(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function y(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return d+=2,f(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}return v(r),function(){var e,n=[];for(y(n);e=function(){var e=p(),n=v(o);if(n){if(b(),!v(a))return g("property missing ':'");var r=v(i),s=e({type:"declaration",property:c(n[0].replace(t,"")),value:r?c(r[0].replace(t,"")):""});return v(l),s}}();)!1!==e&&(n.push(e),y(n));return n}()}},94975:function(e,t,n){var r=n(39866)(n(74288),"DataView");e.exports=r},9855:function(e,t,n){var r=n(43596),o=n(35907),a=n(35355),i=n(39870),l=n(73372);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},99078:function(e,t,n){var r=n(62285),o=n(28706),a=n(63717),i=n(78410),l=n(13368);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},88675:function(e,t,n){var r=n(39866)(n(74288),"Map");e.exports=r},76219:function(e,t,n){var r=n(38764),o=n(78615),a=n(83391),i=n(53483),l=n(74724);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},69308:function(e,t,n){var r=n(39866)(n(74288),"Promise");e.exports=r},41497:function(e,t,n){var r=n(39866)(n(74288),"Set");e.exports=r},11549:function(e,t,n){var r=n(76219),o=n(54351),a=n(16096);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},85885:function(e,t,n){var r=n(99078),o=n(84092),a=n(31663),i=n(69135),l=n(39552),s=n(63960);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=l,c.prototype.set=s,e.exports=c},23910:function(e,t,n){var r=n(74288).Symbol;e.exports=r},80098:function(e,t,n){var r=n(74288).Uint8Array;e.exports=r},10880:function(e,t,n){var r=n(39866)(n(74288),"WeakMap");e.exports=r},60493:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},78897:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}},42774:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},26685:function(e,t,n){var r=n(47909);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},56883:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},28579:function(e,t,n){var r=n(89772),o=n(56569),a=n(25614),i=n(98051),l=n(84257),s=n(9792),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),u=!n&&o(e),d=!n&&!u&&i(e),f=!n&&!u&&!d&&s(e),p=n||u||d||f,h=p?r(e.length,String):[],m=h.length;for(var g in e)(t||c.call(e,g))&&!(p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||l(g,m)))&&h.push(g);return h}},73819:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},73817:function(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},25253:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},53417:function(e){e.exports=function(e){return e.split("")}},24457:function(e,t,n){var r=n(37560);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},83023:function(e,t,n){var r=n(4521);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},67676:function(e,t,n){var r=n(98060),o=n(97930)(r);e.exports=o},28935:function(e,t,n){var r=n(67676);e.exports=function(e,t){var n=!0;return r(e,function(e,r,o){return n=!!t(e,r,o)}),n}},67646:function(e,t,n){var r=n(78371);e.exports=function(e,t,n){for(var o=-1,a=e.length;++o<a;){var i=e[o],l=t(i);if(null!=l&&(void 0===s?l==l&&!r(l):n(l,s)))var s=l,c=i}return c}},8235:function(e){e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return -1}},72569:function(e,t,n){var r=n(73817),o=n(37134);e.exports=function e(t,n,a,i,l){var s=-1,c=t.length;for(a||(a=o),l||(l=[]);++s<c;){var u=t[s];n>0&&a(u)?n>1?e(u,n-1,a,i,l):r(l,u):i||(l[l.length]=u)}return l}},63321:function(e,t,n){var r=n(33023)();e.exports=r},98060:function(e,t,n){var r=n(63321),o=n(43228);e.exports=function(e,t){return e&&r(e,t,o)}},92167:function(e,t,n){var r=n(67906),o=n(70235);e.exports=function(e,t){t=r(t,e);for(var n=0,a=t.length;null!=e&&n<a;)e=e[o(t[n++])];return n&&n==a?e:void 0}},36452:function(e,t,n){var r=n(73817),o=n(25614);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},54506:function(e,t,n){var r=n(23910),o=n(4479),a=n(80910),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},58905:function(e){e.exports=function(e,t){return e>t}},93012:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},47909:function(e,t,n){var r=n(8235),o=n(31953),a=n(35281);e.exports=function(e,t,n){return t==t?a(e,t,n):r(e,o,n)}},90370:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},56318:function(e,t,n){var r=n(6791),o=n(10303);e.exports=function e(t,n,a,i,l){return t===n||(null!=t&&null!=n&&(o(t)||o(n))?r(t,n,a,i,e,l):t!=t&&n!=n)}},6791:function(e,t,n){var r=n(85885),o=n(97638),a=n(88030),i=n(64974),l=n(81690),s=n(25614),c=n(98051),u=n(9792),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,m,g,v){var y=s(e),b=s(t),x=y?f:l(e),w=b?f:l(t);x=x==d?p:x,w=w==d?p:w;var k=x==p,S=w==p,E=x==w;if(E&&c(e)){if(!c(t))return!1;y=!0,k=!1}if(E&&!k)return v||(v=new r),y||u(e)?o(e,t,n,m,g,v):a(e,t,x,n,m,g,v);if(!(1&n)){var O=k&&h.call(e,"__wrapped__"),C=S&&h.call(t,"__wrapped__");if(O||C){var j=O?e.value():e,_=C?t.value():t;return v||(v=new r),g(j,_,n,m,v)}}return!!E&&(v||(v=new r),i(e,t,n,m,g,v))}},62538:function(e,t,n){var r=n(85885),o=n(56318);e.exports=function(e,t,n,a){var i=n.length,l=i,s=!a;if(null==e)return!l;for(e=Object(e);i--;){var c=n[i];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<l;){var u=(c=n[i])[0],d=e[u],f=c[1];if(s&&c[2]){if(void 0===d&&!(u in e))return!1}else{var p=new r;if(a)var h=a(d,f,u,e,t,p);if(!(void 0===h?o(f,d,3,a,p):h))return!1}}return!0}},31953:function(e){e.exports=function(e){return e!=e}},57595:function(e,t,n){var r=n(86757),o=n(79551),a=n(28302),i=n(1292),l=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,u=s.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?d:l).test(i(e))}},59332:function(e,t,n){var r=n(54506),o=n(13973),a=n(10303),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},88157:function(e,t,n){var r=n(25569),o=n(51501),a=n(79586),i=n(25614),l=n(22350);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):l(e)}},4578:function(e,t,n){var r=n(35365),o=n(77184),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},20121:function(e){e.exports=function(e,t){return e<t}},24240:function(e,t,n){var r=n(67676),o=n(5629);e.exports=function(e,t){var n=-1,a=o(e)?Array(e.length):[];return r(e,function(e,r,o){a[++n]=t(e,r,o)}),a}},25569:function(e,t,n){var r=n(62538),o=n(58424),a=n(47073);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},51501:function(e,t,n){var r=n(56318),o=n(13735),a=n(17764),i=n(67352),l=n(45669),s=n(47073),c=n(70235);e.exports=function(e,t){return i(e)&&l(t)?s(c(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},84046:function(e,t,n){var r=n(73819),o=n(92167),a=n(88157),i=n(24240),l=n(89200),s=n(23305),c=n(80701),u=n(79586),d=n(25614);e.exports=function(e,t,n){t=t.length?r(t,function(e){return d(e)?function(t){return o(t,1===e.length?e[0]:e)}:e}):[u];var f=-1;return t=r(t,s(a)),l(i(e,function(e,n,o){return{criteria:r(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,n)})}},18155:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},73584:function(e,t,n){var r=n(92167);e.exports=function(e){return function(t){return r(t,e)}}},19608:function(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,o,a){for(var i=-1,l=n(t((r-e)/(o||1)),0),s=Array(l);l--;)s[a?l:++i]=e,e+=o;return s}},44843:function(e,t,n){var r=n(79586),o=n(49478),a=n(98796);e.exports=function(e,t){return a(o(e,t,r),e+"")}},9810:function(e,t,n){var r=n(92353),o=n(4521),a=n(79586),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=i},99558:function(e){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+t];return a}},12327:function(e,t,n){var r=n(67676);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},89200:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},89772:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},65020:function(e,t,n){var r=n(23910),o=n(73819),a=n(25614),i=n(78371),l=1/0,s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-l?"-0":n}},41087:function(e,t,n){var r=n(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},23305:function(e){e.exports=function(e){return function(t){return e(t)}}},13826:function(e,t,n){var r=n(11549),o=n(26685),a=n(56883),i=n(65734),l=n(57600),s=n(27794);e.exports=function(e,t,n){var c=-1,u=o,d=e.length,f=!0,p=[],h=p;if(n)f=!1,u=a;else if(d>=200){var m=t?null:l(e);if(m)return s(m);f=!1,u=i,h=new r}else h=t?[]:p;e:for(;++c<d;){var g=e[c],v=t?t(g):g;if(g=n||0!==g?g:0,f&&v==v){for(var y=h.length;y--;)if(h[y]===v)continue e;t&&h.push(v),p.push(g)}else u(h,v,n)||(h!==p&&h.push(v),p.push(g))}return p}},65734:function(e){e.exports=function(e,t){return e.has(t)}},67906:function(e,t,n){var r=n(25614),o=n(67352),a=n(39365),i=n(3641);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},91684:function(e,t,n){var r=n(99558);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},1536:function(e,t,n){var r=n(78371);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,a=e==e,i=r(e),l=void 0!==t,s=null===t,c=t==t,u=r(t);if(!s&&!u&&!i&&e>t||i&&l&&c&&!s&&!u||o&&l&&c||!n&&c||!a)return 1;if(!o&&!i&&!u&&e<t||u&&n&&a&&!o&&!i||s&&n&&a||!l&&a||!c)return -1}return 0}},80701:function(e,t,n){var r=n(1536);e.exports=function(e,t,n){for(var o=-1,a=e.criteria,i=t.criteria,l=a.length,s=n.length;++o<l;){var c=r(a[o],i[o]);if(c){if(o>=s)return c;return c*("desc"==n[o]?-1:1)}}return e.index-t.index}},92077:function(e,t,n){var r=n(74288)["__core-js_shared__"];e.exports=r},97930:function(e,t,n){var r=n(5629);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,l=Object(n);(t?i--:++i<a)&&!1!==o(l[i],i,l););return n}}},33023:function(e){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),l=i.length;l--;){var s=i[e?l:++o];if(!1===n(a[s],s,a))break}return t}}},80675:function(e,t,n){var r=n(91684),o=n(14503),a=n(88551),i=n(3641);e.exports=function(e){return function(t){var n=o(t=i(t))?a(t):void 0,l=n?n[0]:t.charAt(0),s=n?r(n,1).join(""):t.slice(1);return l[e]()+s}}},82602:function(e,t,n){var r=n(88157),o=n(5629),a=n(43228);e.exports=function(e){return function(t,n,i){var l=Object(t);if(!o(t)){var s=r(n,3);t=a(t),n=function(e){return s(l[e],e,l)}}var c=e(t,n,i);return c>-1?l[s?t[c]:c]:void 0}}},35464:function(e,t,n){var r=n(19608),o=n(49639),a=n(175);e.exports=function(e){return function(t,n,i){return i&&"number"!=typeof i&&o(t,n,i)&&(n=i=void 0),t=a(t),void 0===n?(n=t,t=0):n=a(n),i=void 0===i?t<n?1:-1:a(i),r(t,n,i,e)}}},57600:function(e,t,n){var r=n(41497),o=n(93810),a=n(27794),i=r&&1/a(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=i},4521:function(e,t,n){var r=n(39866),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},97638:function(e,t,n){var r=n(11549),o=n(25253),a=n(65734);e.exports=function(e,t,n,i,l,s){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],y=t[h];if(i)var b=c?i(y,v,h,t,e,s):i(v,y,h,e,t,s);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!o(t,function(e,t){if(!a(g,t)&&(v===e||l(v,e,n,i,s)))return g.push(t)})){m=!1;break}}else if(!(v===y||l(v,y,n,i,s))){m=!1;break}}return s.delete(e),s.delete(t),m}},88030:function(e,t,n){var r=n(23910),o=n(80098),a=n(37560),i=n(97638),l=n(22523),s=n(27794),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new o(e),new o(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=l;case"[object Set]":var h=1&r;if(p||(p=s),e.size!=t.size&&!h)break;var m=f.get(e);if(m)return m==t;r|=2,f.set(e,t);var g=i(p(e),p(t),r,c,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},64974:function(e,t,n){var r=n(28529),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,l){var s=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!s)return!1;for(var d=u;d--;){var f=c[d];if(!(s?f in t:o.call(t,f)))return!1}var p=l.get(e),h=l.get(t);if(p&&h)return p==t&&h==e;var m=!0;l.set(e,t),l.set(t,e);for(var g=s;++d<u;){var v=e[f=c[d]],y=t[f];if(a)var b=s?a(y,v,f,t,e,l):a(v,y,f,e,t,l);if(!(void 0===b?v===y||i(v,y,n,a,l):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(m=!1)}return l.delete(e),l.delete(t),m}},17071:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},28529:function(e,t,n){var r=n(36452),o=n(80466),a=n(43228);e.exports=function(e){return r(e,a,o)}},1507:function(e,t,n){var r=n(7545);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},58424:function(e,t,n){var r=n(45669),o=n(43228);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},39866:function(e,t,n){var r=n(57595),o=n(3138);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},62602:function(e,t,n){var r=n(45070)(Object.getPrototypeOf,Object);e.exports=r},4479:function(e,t,n){var r=n(23910),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[l]=n:delete e[l]),o}},80466:function(e,t,n){var r=n(42774),o=n(55716),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,l=i?function(e){return null==e?[]:r(i(e=Object(e)),function(t){return a.call(e,t)})}:o;e.exports=l},81690:function(e,t,n){var r=n(94975),o=n(88675),a=n(69308),i=n(41497),l=n(10880),s=n(54506),c=n(1292),u="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=c(r),g=c(o),v=c(a),y=c(i),b=c(l),x=s;(r&&x(new r(new ArrayBuffer(1)))!=h||o&&x(new o)!=u||a&&x(a.resolve())!=d||i&&x(new i)!=f||l&&x(new l)!=p)&&(x=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case m:return h;case g:return u;case v:return d;case y:return f;case b:return p}return t}),e.exports=x},3138:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},59592:function(e,t,n){var r=n(67906),o=n(56569),a=n(25614),i=n(84257),l=n(13973),s=n(70235);e.exports=function(e,t,n){t=r(t,e);for(var c=-1,u=t.length,d=!1;++c<u;){var f=s(t[c]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&l(u)&&i(f,u)&&(a(e)||o(e))}},14503:function(e){var t=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},43596:function(e,t,n){var r=n(20453);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},35907:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},35355:function(e,t,n){var r=n(20453),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},39870:function(e,t,n){var r=n(20453),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},73372:function(e,t,n){var r=n(20453);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},37134:function(e,t,n){var r=n(23910),o=n(56569),a=n(25614),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},84257:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},49639:function(e,t,n){var r=n(37560),o=n(5629),a=n(84257),i=n(28302);e.exports=function(e,t,n){if(!i(n))return!1;var l=typeof t;return("number"==l?!!(o(n)&&a(t,n.length)):"string"==l&&t in n)&&r(n[t],e)}},67352:function(e,t,n){var r=n(25614),o=n(78371),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},7545:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},79551:function(e,t,n){var r,o=n(92077),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},35365:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},45669:function(e,t,n){var r=n(28302);e.exports=function(e){return e==e&&!r(e)}},62285:function(e){e.exports=function(){this.__data__=[],this.size=0}},28706:function(e,t,n){var r=n(24457),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},63717:function(e,t,n){var r=n(24457);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},78410:function(e,t,n){var r=n(24457);e.exports=function(e){return r(this.__data__,e)>-1}},13368:function(e,t,n){var r=n(24457);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},38764:function(e,t,n){var r=n(9855),o=n(99078),a=n(88675);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},78615:function(e,t,n){var r=n(1507);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},83391:function(e,t,n){var r=n(1507);e.exports=function(e){return r(this,e).get(e)}},53483:function(e,t,n){var r=n(1507);e.exports=function(e){return r(this,e).has(e)}},74724:function(e,t,n){var r=n(1507);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},22523:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},47073:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},23787:function(e,t,n){var r=n(50967);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},20453:function(e,t,n){var r=n(39866)(Object,"create");e.exports=r},77184:function(e,t,n){var r=n(45070)(Object.keys,Object);e.exports=r},39931:function(e,t,n){e=n.nmd(e);var r=n(17071),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,l=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},45070:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},49478:function(e,t,n){var r=n(60493),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,i=-1,l=o(a.length-t,0),s=Array(l);++i<l;)s[i]=a[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=a[i];return c[t]=n(s),r(e,this,c)}}},74288:function(e,t,n){var r=n(17071),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},54351:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},16096:function(e){e.exports=function(e){return this.__data__.has(e)}},27794:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},98796:function(e,t,n){var r=n(9810),o=n(31610)(r);e.exports=o},31610:function(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),a=16-(o-r);if(r=o,a>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},84092:function(e,t,n){var r=n(99078);e.exports=function(){this.__data__=new r,this.size=0}},31663:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},69135:function(e){e.exports=function(e){return this.__data__.get(e)}},39552:function(e){e.exports=function(e){return this.__data__.has(e)}},63960:function(e,t,n){var r=n(99078),o=n(88675),a=n(76219);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},35281:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return -1}},88551:function(e,t,n){var r=n(53417),o=n(14503),a=n(26364);e.exports=function(e){return o(e)?a(e):r(e)}},39365:function(e,t,n){var r=n(23787),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)}),t});e.exports=i},70235:function(e,t,n){var r=n(78371),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},1292:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5035:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},26364:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",o="[^"+t+"]",a="(?:\ud83c[\udde6-\uddff]){2}",i="[\ud800-\udbff][\udc00-\udfff]",l="(?:"+n+"|"+r+")?",s="[\\ufe0e\\ufe0f]?",c="(?:\\u200d(?:"+[o,a,i].join("|")+")"+s+l+")*",u=RegExp(r+"(?="+r+")|(?:"+[o+n+"?",n,a,i,"["+t+"]"].join("|")+")"+(s+l+c),"g");e.exports=function(e){return e.match(u)||[]}},92353:function(e){e.exports=function(e){return function(){return e}}},7310:function(e,t,n){var r=n(28302),o=n(11121),a=n(6660),i=Math.max,l=Math.min;e.exports=function(e,t,n){var s,c,u,d,f,p,h=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,d=e.apply(r,n)}function b(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,a=o();if(b(a))return w(a);f=setTimeout(x,(e=a-p,n=a-h,r=t-e,g?l(r,u-n):r))}function w(e){return(f=void 0,v&&s)?y(e):(s=c=void 0,d)}function k(){var e,n=o(),r=b(n);if(s=arguments,c=this,p=n,r){if(void 0===f)return h=e=p,f=setTimeout(x,t),m?y(e):d;if(g)return clearTimeout(f),f=setTimeout(x,t),y(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?i(a(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),k.cancel=function(){void 0!==f&&clearTimeout(f),h=0,s=p=c=f=void 0},k.flush=function(){return void 0===f?d:w(o())},k}},37560:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},32242:function(e,t,n){var r=n(78897),o=n(28935),a=n(88157),i=n(25614),l=n(49639);e.exports=function(e,t,n){var s=i(e)?r:o;return n&&l(e,t,n)&&(t=void 0),s(e,a(t,3))}},84173:function(e,t,n){var r=n(82602)(n(12152));e.exports=r},12152:function(e,t,n){var r=n(8235),o=n(88157),a=n(85759),i=Math.max;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return -1;var s=null==n?0:a(n);return s<0&&(s=i(l+s,0)),r(e,o(t,3),s)}},11314:function(e,t,n){var r=n(72569),o=n(89238);e.exports=function(e,t){return r(o(e,t),1)}},13735:function(e,t,n){var r=n(92167);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},17764:function(e,t,n){var r=n(93012),o=n(59592);e.exports=function(e,t){return null!=e&&o(e,t,r)}},79586:function(e){e.exports=function(e){return e}},56569:function(e,t,n){var r=n(90370),o=n(10303),a=Object.prototype,i=a.hasOwnProperty,l=a.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!l.call(e,"callee")};e.exports=s},25614:function(e){var t=Array.isArray;e.exports=t},5629:function(e,t,n){var r=n(86757),o=n(13973);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},24342:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return!0===e||!1===e||o(e)&&"[object Boolean]"==r(e)}},98051:function(e,t,n){e=n.nmd(e);var r=n(74288),o=n(7406),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,l=i&&i.exports===a?r.Buffer:void 0,s=l?l.isBuffer:void 0;e.exports=s||o},21652:function(e,t,n){var r=n(56318);e.exports=function(e,t){return r(e,t)}},86757:function(e,t,n){var r=n(54506),o=n(28302);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},13973:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},82559:function(e,t,n){var r=n(22345);e.exports=function(e){return r(e)&&e!=+e}},77571:function(e){e.exports=function(e){return null==e}},22345:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"number"==typeof e||o(e)&&"[object Number]"==r(e)}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},90231:function(e,t,n){var r=n(54506),o=n(62602),a=n(10303),i=Object.prototype,l=Function.prototype.toString,s=i.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},42715:function(e,t,n){var r=n(54506),o=n(25614),a=n(10303);e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&"[object String]"==r(e)}},78371:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},9792:function(e,t,n){var r=n(59332),o=n(23305),a=n(39931),i=a&&a.isTypedArray,l=i?o(i):r;e.exports=l},43228:function(e,t,n){var r=n(28579),o=n(4578),a=n(5629);e.exports=function(e){return a(e)?r(e):o(e)}},86185:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},89238:function(e,t,n){var r=n(73819),o=n(88157),a=n(24240),i=n(25614);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},41443:function(e,t,n){var r=n(83023),o=n(98060),a=n(88157);e.exports=function(e,t){var n={};return t=a(t,3),o(e,function(e,o,a){r(n,o,t(e,o,a))}),n}},95645:function(e,t,n){var r=n(67646),o=n(58905),a=n(79586);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},35802:function(e,t,n){var r=n(67646),o=n(58905),a=n(88157);e.exports=function(e,t){return e&&e.length?r(e,a(t,2),o):void 0}},50967:function(e,t,n){var r=n(76219);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},99008:function(e,t,n){var r=n(67646),o=n(20121),a=n(79586);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),a=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),a):void 0}},93810:function(e){e.exports=function(){}},11121:function(e,t,n){var r=n(74288);e.exports=function(){return r.Date.now()}},22350:function(e,t,n){var r=n(18155),o=n(73584),a=n(67352),i=n(70235);e.exports=function(e){return a(e)?r(i(e)):o(e)}},99676:function(e,t,n){var r=n(35464)();e.exports=r},33645:function(e,t,n){var r=n(25253),o=n(88157),a=n(12327),i=n(25614),l=n(49639);e.exports=function(e,t,n){var s=i(e)?r:a;return n&&l(e,t,n)&&(t=void 0),s(e,o(t,3))}},34935:function(e,t,n){var r=n(72569),o=n(84046),a=n(44843),i=n(49639),l=a(function(e,t){if(null==e)return[];var n=t.length;return n>1&&i(e,t[0],t[1])?t=[]:n>2&&i(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])});e.exports=l},55716:function(e){e.exports=function(){return[]}},7406:function(e){e.exports=function(){return!1}},37065:function(e,t,n){var r=n(7310),o=n(28302);e.exports=function(e,t,n){var a=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(n)&&(a="leading"in n?!!n.leading:a,i="trailing"in n?!!n.trailing:i),r(e,t,{leading:a,maxWait:t,trailing:i})}},175:function(e,t,n){var r=n(6660),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},85759:function(e,t,n){var r=n(175);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},6660:function(e,t,n){var r=n(41087),o=n(28302),a=n(78371),i=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return i;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):l.test(e)?i:+e}},3641:function(e,t,n){var r=n(65020);e.exports=function(e){return null==e?"":r(e)}},47230:function(e,t,n){var r=n(88157),o=n(13826);e.exports=function(e,t){return e&&e.length?o(e,r(t,2)):[]}},75551:function(e,t,n){var r=n(80675)("toUpperCase");e.exports=r},30401:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},40875:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22135:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},64935:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},96362:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},87769:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},42208:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},29202:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},54001:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},21047:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},96137:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},80221:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},70525:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},76865:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},49663:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},95805:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},11239:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},96434:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,a=s(e),i=a[0],l=a[1],c=new o((i+l)*3/4-l),u=0,d=l>0?i-4:i;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,a=[],i=0,l=r-o;i<l;i+=16383)a.push(function(e,t,r){for(var o,a=[],i=t;i<r;i+=3)a.push(n[(o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}(e,i,i+16383>l?l:i+16383));return 1===o?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===o&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,l=a.length;i<l;++i)n[i]=a[i],r[a.charCodeAt(i)]=i;function s(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},72:function(e,t,n){"use strict";var r=n(675),o=n(783),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!l.isEncoding(t))throw TypeError("Unknown encoding: "+t);var n=0|p(e,t),r=i(n),o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(P(e,SharedArrayBuffer)||e&&P(e.buffer,SharedArrayBuffer)))return function(e,t,n){var r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),l.prototype),r}(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);var o=function(e){if(l.isBuffer(e)){var t,n=0|f(e.length),r=i(n);return 0===r.length||e.copy(r,0,0,n),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?i(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),i(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),n=i(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function f(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return O(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(o)return r?-1:O(e).length;t=(""+t).toLowerCase(),o=!0}}function h(e,t,n){var o,a,i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",a=t;a<n;++a)o+=N[e[a]];return o}(this,t,n);case"utf8":case"utf-8":return y(this,t,n);case"ascii":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}(this,t,n);case"base64":return o=t,a=n,0===o&&a===this.length?r.fromByteArray(this):r.fromByteArray(this.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),o="",a=0;a<r.length;a+=2)o+=String.fromCharCode(r[a]+256*r[a+1]);return o}(this,t,n);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){var a;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),(a=n=+n)!=a&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return -1;n=e.length-1}else if(n<0){if(!o)return -1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var a,i=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;i=2,l/=2,s/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var u=-1;for(a=n;a<l;a++)if(c(e,a)===c(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===s)return u*i}else -1!==u&&(a-=a-u),u=-1}else for(n+s>l&&(n=l-s),a=n;a>=0;a--){for(var d=!0,f=0;f<s;f++)if(c(e,a+f)!==c(t,f)){d=!1;break}if(d)return a}return -1}function y(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var a,i,l,s,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:(192&(a=e[o+1]))==128&&(s=(31&c)<<6|63&a)>127&&(u=s);break;case 3:a=e[o+1],i=e[o+2],(192&a)==128&&(192&i)==128&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:a=e[o+1],i=e[o+2],l=e[o+3],(192&a)==128&&(192&i)==128&&(192&l)==128&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&l)>65535&&s<1114112&&(u=s)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}function b(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function x(e,t,n,r,o,a){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function w(e,t,n,r,o,a){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function k(e,t,n,r,a){return t=+t,n>>>=0,a||w(e,t,n,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,n,r,23,4),n+4}function S(e,t,n,r,a){return t=+t,n>>>=0,a||w(e,t,n,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,n,r,52,8),n+8}t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=2147483647,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return s(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return(c(e),e<=0)?i(e):void 0!==t?"string"==typeof n?i(e).fill(t,n):i(e).fill(t):i(e)},l.allocUnsafe=function(e){return u(e)},l.allocUnsafeSlow=function(e){return u(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(P(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),P(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;var n,r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(P(a,Uint8Array)&&(a=l.from(a)),!l.isBuffer(a))throw TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?y(this,0,e):h.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,o){if(P(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var a=o-r,i=n-t,s=Math.min(a,i),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){a=c[d],i=u[d];break}return a<i?-1:i<a?1:0},l.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,a,i,l,s,c,u,d,f,p,h,m,g=this.length-t;if((void 0===n||n>g)&&(n=g),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var v=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var a=t.length;r>a/2&&(r=a/2);for(var i=0;i<r;++i){var l=parseInt(t.substr(2*i,2),16);if(l!=l)break;e[n+i]=l}return i}(this,e,t,n);case"utf8":case"utf-8":return s=t,c=n,_(O(e,this.length-s),this,s,c);case"ascii":return u=t,d=n,_(C(e),this,u,d);case"latin1":case"binary":return o=this,a=e,i=t,l=n,_(C(a),o,i,l);case"base64":return f=t,p=n,_(j(e),this,f,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h=t,m=n,_(function(e,t){for(var n,r,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o.push(n%256),o.push(r);return o}(e,this.length-h),this,h,m);default:if(v)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),v=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||b(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r},l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||b(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||b(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||b(e,t,this.length);for(var r=t,o=1,a=this[e+--r];r>0&&(o*=256);)a+=this[e+--r]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var o=Math.pow(2,8*n)-1;x(this,e,t,n,o,0)}var a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var o=Math.pow(2,8*n)-1;x(this,e,t,n,o,0)}var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);x(this,e,t,n,o-1,-o)}var a=0,i=1,l=0;for(this[t]=255&e;++a<n&&(i*=256);)e<0&&0===l&&0!==this[t+a-1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);x(this,e,t,n,o-1,-o)}var a=n-1,i=1,l=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return S(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return S(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var a=o-1;a>=0;--a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return o},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var o,a=e.charCodeAt(0);("utf8"===r&&a<128||"latin1"===r)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var i=l.isBuffer(e)?e:l.from(e,r),s=i.length;if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=i[o%s]}return this};var E=/[^+/0-9A-Za-z-_]/g;function O(e,t){t=t||1/0;for(var n,r=e.length,o=null,a=[],i=0;i<r;++i){if((n=e.charCodeAt(i))>55295&&n<57344){if(!o){if(n>56319||i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return a}function C(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function j(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function _(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length)&&!(o>=e.length);++o)t[o+n]=e[o];return o}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var N=function(){for(var e="0123456789abcdef",t=Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)t[r+o]=e[n]+e[o];return t}()},783:function(e,t){t.read=function(e,t,n,r,o){var a,i,l=8*o-r-1,s=(1<<l)-1,c=s>>1,u=-7,d=n?o-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=l;u>0;a=256*a+e[t+d],d+=f,u-=8);for(i=a&(1<<-u)-1,a>>=-u,u+=r;u>0;i=256*i+e[t+d],d+=f,u-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,r),a-=c}return(p?-1:1)*i*Math.pow(2,a-r)},t.write=function(e,t,n,r,o,a){var i,l,s,c=8*a-o-1,u=(1<<c)-1,d=u>>1,f=23===o?5960464477539062e-23:0,p=r?0:a-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(l=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),i+d>=1?t+=f/s:t+=f*Math.pow(2,1-d),t*s>=2&&(i++,s/=2),i+d>=u?(l=0,i=u):i+d>=1?(l=(t*s-1)*Math.pow(2,o),i+=d):(l=t*Math.pow(2,d-1)*Math.pow(2,o),i=0));o>=8;e[n+p]=255&l,p+=h,l/=256,o-=8);for(i=i<<o|l,c+=o;c>0;e[n+p]=255&i,p+=h,i/=256,c-=8);e[n+p-h]|=128*m}}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}},i=!0;try{t[e](a,a.exports,r),i=!1}finally{i&&delete n[e]}return a.exports}r.ab="//";var o=r(72);e.exports=o}()},24601:function(){},15452:function(e,t){var n,r,o;r=[],void 0!==(o="function"==typeof(n=function e(){var t,n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},r=!n.document&&!!n.postMessage,o=n.IS_PAPA_WORKER||!1,a={},i=0,l={};function s(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new p(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<r){let t=this._config.newline;t||(a=this._config.quoteChar||'"',t=this._handle.guessLineEndings(e,a)),e=[...e.split(t).slice(r)].join(t)}this.isFirstChunk&&w(this._config.beforeFirstChunk)&&void 0!==(a=this._config.beforeFirstChunk(e))&&(e=a),this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e,a=(this._partialLine="",this._handle.parse(r,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,this._finished||(this._partialLine=r.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),r=this._finished||this._config.preview&&this._rowCount>=this._config.preview,o)n.postMessage({results:a,workerId:l.WORKER_ID,finished:r});else if(w(this._config.chunk)&&!t){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!r||!w(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),r||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){w(this._config.error)?this._config.error(e):o&&this._config.error&&n.postMessage({workerId:l.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=l.RemoteChunkSize),s.call(this,e),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),r||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var e,n,o=this._config.downloadRequestHeaders;for(n in o)t.setRequestHeader(n,o[n])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}r&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function u(e){(e=e||{}).chunkSize||(e.chunkSize=l.LocalChunkSize),s.call(this,e);var t,n,r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,o=(this._config.chunkSize&&(o=Math.min(this._start+this._config.chunkSize,this._input.size),e=n.call(e,this._start,o)),t.readAsText(e,this._config.encoding));r||this._chunkLoaded({target:{result:o}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function d(e){var t;s.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,n;if(!this._finished)return t=(e=this._config.chunkSize)?(n=t.substring(0,e),t.substring(e)):(n=t,""),this._finished=!t,this.parseChunk(n)}}function f(e){s.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){s.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){s.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=x(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=x(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=x(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=x(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function p(e){var t,n,r,o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,s=this,c=0,u=0,d=!1,f=!1,p=[],g={data:[],errors:[],meta:{}};function v(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function y(){if(g&&r&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!v(e)})),x()){if(g){if(Array.isArray(g.data[0])){for(var t,n=0;x()&&n<g.data.length;n++)g.data[n].forEach(o);g.data.splice(0,1)}else g.data.forEach(o)}function o(t,n){w(e.transformHeader)&&(t=e.transformHeader(t,n)),p.push(t)}}function s(t,n){for(var r=e.header?{}:[],o=0;o<t.length;o++){let n,c;var l=o,s=t[o],s=(n=l=e.header?o>=p.length?"__parsed_extra":p[o]:l,c=s=e.transform?e.transform(s,l):s,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[n]&&(e.dynamicTyping[n]=e.dynamicTypingFunction(n)),!0===(e.dynamicTyping[n]||e.dynamicTyping))?"true"===c||"TRUE"===c||"false"!==c&&"FALSE"!==c&&((e=>{if(a.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(c)?parseFloat(c):i.test(c)?new Date(c):""===c?null:c):c);"__parsed_extra"===l?(r[l]=r[l]||[],r[l].push(s)):r[l]=s}return e.header&&(o>p.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+p.length+" fields but parsed "+o,u+n):o<p.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+p.length+" fields but parsed "+o,u+n)),r}g&&(e.header||e.dynamicTyping||e.transform)&&(t=1,!g.data.length||Array.isArray(g.data[0])?(g.data=g.data.map(s),t=g.data.length):g.data=s(g.data,0),e.header&&g.meta&&(g.meta.fields=p),u+=t)}function x(){return e.header&&0===p.length}function k(e,t,n,r){e={type:e,code:t,message:n},void 0!==r&&(e.row=r),g.errors.push(e)}w(e.step)&&(o=e.step,e.step=function(t){g=t,x()?y():(y(),0!==g.data.length&&(c+=t.data.length,e.preview&&c>e.preview?n.abort():(g.data=g.data[0],o(g,s))))}),this.parse=function(o,a,i){var s=e.quoteChar||'"',s=(e.newline||(e.newline=this.guessLineEndings(o,s)),r=!1,e.delimiter?w(e.delimiter)&&(e.delimiter=e.delimiter(o),g.meta.delimiter=e.delimiter):((s=((t,n,r,o,a)=>{var i,s,c,u;a=a||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var d=0;d<a.length;d++){for(var f,p=a[d],h=0,g=0,y=0,b=(c=void 0,new m({comments:o,delimiter:p,newline:n,preview:10}).parse(t)),x=0;x<b.data.length;x++)r&&v(b.data[x])?y++:(g+=f=b.data[x].length,void 0===c?c=f:0<f&&(h+=Math.abs(f-c),c=f));0<b.data.length&&(g/=b.data.length-y),(void 0===s||h<=s)&&(void 0===u||u<g)&&1.99<g&&(s=h,i=p,u=g)}return{successful:!!(e.delimiter=i),bestDelimiter:i}})(o,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=s.bestDelimiter:(r=!0,e.delimiter=l.DefaultDelimiter),g.meta.delimiter=e.delimiter),b(e));return e.preview&&e.header&&s.preview++,t=o,g=(n=new m(s)).parse(t,a,i),y(),d?{meta:{paused:!0}}:g||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,n.abort(),t=w(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){s.streamer._halted?(d=!1,s.streamer.parseChunk(t,!0)):setTimeout(s.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,n.abort(),g.meta.aborted=!0,w(e.complete)&&e.complete(g),t=""},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=RegExp(h(t)+"([^]*?)"+h(t),"gm"),n=(e=e.replace(t,"")).split("\r"),t=e.split("\n"),e=1<t.length&&t[0].length<n[0].length;if(1===n.length||e)return"\n";for(var r=0,o=0;o<n.length;o++)"\n"===n[o][0]&&r++;return r>=n.length/2?"\r\n":"\r"}}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,n=e.newline,r=e.comments,o=e.step,a=e.preview,i=e.fastMode,s=null,c=!1,u=null==e.quoteChar?'"':e.quoteChar,d=u;if(void 0!==e.escapeChar&&(d=e.escapeChar),("string"!=typeof t||-1<l.BAD_DELIMITERS.indexOf(t))&&(t=","),r===t)throw Error("Comment character same as delimiter");!0===r?r="#":("string"!=typeof r||-1<l.BAD_DELIMITERS.indexOf(r))&&(r=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var f=0,p=!1;this.parse=function(l,m,g){if("string"!=typeof l)throw Error("Input must be a string");var v=l.length,y=t.length,b=n.length,x=r.length,k=w(o),S=[],E=[],O=[],C=f=0;if(!l)return Z();if(i||!1!==i&&-1===l.indexOf(u)){for(var j=l.split(n),_=0;_<j.length;_++){if(O=j[_],f+=O.length,_!==j.length-1)f+=n.length;else if(g)break;if(!r||O.substring(0,x)!==r){if(k){if(S=[],I(O.split(t)),z(),p)return Z()}else I(O.split(t));if(a&&a<=_)return S=S.slice(0,a),Z(!0)}}return Z()}for(var P=l.indexOf(t,f),N=l.indexOf(n,f),T=RegExp(h(d)+h(u),"g"),A=l.indexOf(u,f);;)if(l[f]===u)for(A=f,f++;;){if(-1===(A=l.indexOf(u,A+1)))return g||E.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:S.length,index:f}),D();if(A===v-1)return D(l.substring(f,A).replace(T,u));if(u===d&&l[A+1]===d)A++;else if(u===d||0===A||l[A-1]!==d){-1!==P&&P<A+1&&(P=l.indexOf(t,A+1));var M=R(-1===(N=-1!==N&&N<A+1?l.indexOf(n,A+1):N)?P:Math.min(P,N));if(l.substr(A+1+M,y)===t){O.push(l.substring(f,A).replace(T,u)),l[f=A+1+M+y]!==u&&(A=l.indexOf(u,f)),P=l.indexOf(t,f),N=l.indexOf(n,f);break}if(M=R(N),l.substring(A+1+M,A+1+M+b)===n){if(O.push(l.substring(f,A).replace(T,u)),L(A+1+M+b),P=l.indexOf(t,f),A=l.indexOf(u,f),k&&(z(),p))return Z();if(a&&S.length>=a)return Z(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:S.length,index:f}),A++}}else if(r&&0===O.length&&l.substring(f,f+x)===r){if(-1===N)return Z();f=N+b,N=l.indexOf(n,f),P=l.indexOf(t,f)}else if(-1!==P&&(P<N||-1===N))O.push(l.substring(f,P)),f=P+y,P=l.indexOf(t,f);else{if(-1===N)break;if(O.push(l.substring(f,N)),L(N+b),k&&(z(),p))return Z();if(a&&S.length>=a)return Z(!0)}return D();function I(e){S.push(e),C=f}function R(e){return -1!==e&&(e=l.substring(A+1,e))&&""===e.trim()?e.length:0}function D(e){return g||(void 0===e&&(e=l.substring(f)),O.push(e),f=v,I(O),k&&z()),Z()}function L(e){f=e,I(O),O=[],N=l.indexOf(n,f)}function Z(r){if(e.header&&!m&&S.length&&!c){var o=S[0],a={},i=new Set(o);let t=!1;for(let n=0;n<o.length;n++){let r=o[n];if(a[r=w(e.transformHeader)?e.transformHeader(r,n):r]){let e,l=a[r];for(;e=r+"_"+l,l++,i.has(e););i.add(e),o[n]=e,a[r]++,t=!0,(s=null===s?{}:s)[e]=r}else a[r]=1,o[n]=r;i.add(r)}t&&console.warn("Duplicate headers found and renamed."),c=!0}return{data:S,errors:E,meta:{delimiter:t,linebreak:n,aborted:p,truncated:!!r,cursor:C+(m||0),renamedHeaders:s}}}function z(){o(Z()),S=[],E=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return f}}function g(e){var t=e.data,n=a[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var o={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(w(n.userStep)){for(var i=0;i<t.results.data.length&&(n.userStep({data:t.results.data[i],errors:t.results.errors,meta:t.results.meta},o),!r);i++);delete t.results}else w(n.userChunk)&&(n.userChunk(t.results,o,t.file),delete t.results)}t.finished&&!r&&v(t.workerId,t.results)}function v(e,t){var n=a[e];w(n.userComplete)&&n.userComplete(t),n.terminate(),delete a[e]}function y(){throw Error("Not implemented.")}function b(e){if("object"!=typeof e||null===e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=b(e[t]);return n}function x(e,t){return function(){e.apply(t,arguments)}}function w(e){return"function"==typeof e}return l.parse=function(t,r){var o,s,p,h=(r=r||{}).dynamicTyping||!1;if(w(h)&&(r.dynamicTypingFunction=h,h={}),r.dynamicTyping=h,r.transform=!!w(r.transform)&&r.transform,!r.worker||!l.WORKERS_SUPPORTED){let e;return h=null,l.NODE_STREAM_INPUT,"string"==typeof t?(t=65279!==(e=t).charCodeAt(0)?e:e.slice(1),h=new(r.download?c:d)(r)):!0===t.readable&&w(t.read)&&w(t.on)?h=new f(r):(n.File&&t instanceof File||t instanceof Object)&&(h=new u(r)),h.stream(t)}(h=!!l.WORKERS_SUPPORTED&&(s=n.URL||n.webkitURL||null,p=e.toString(),o=l.BLOB_URL||(l.BLOB_URL=s.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",p,")();"],{type:"text/javascript"}))),(o=new n.Worker(o)).onmessage=g,o.id=i++,a[o.id]=o)).userStep=r.step,h.userChunk=r.chunk,h.userComplete=r.complete,h.userError=r.error,r.step=w(r.step),r.chunk=w(r.chunk),r.complete=w(r.complete),r.error=w(r.error),delete r.worker,h.postMessage({input:t,config:r,workerId:h.id})},l.unparse=function(e,t){var n=!1,r=!0,o=",",a="\r\n",i='"',s=i+i,c=!1,u=null,d=!1,f=((()=>{if("object"==typeof t){if("string"!=typeof t.delimiter||l.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(o=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(a=t.newline),"string"==typeof t.quoteChar&&(i=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(s=t.escapeChar+i),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),RegExp(h(i),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,c);if("object"==typeof e[0])return p(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),p(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function p(e,t,n){var i="",l=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),s=!Array.isArray(t[0]);if(l&&r){for(var c=0;c<e.length;c++)0<c&&(i+=o),i+=m(e[c],c);0<t.length&&(i+=a)}for(var u=0;u<t.length;u++){var d=(l?e:t[u]).length,f=!1,p=l?0===Object.keys(t[u]).length:0===t[u].length;if(n&&!l&&(f="greedy"===n?""===t[u].join("").trim():1===t[u].length&&0===t[u][0].length),"greedy"===n&&l){for(var h=[],g=0;g<d;g++){var v=s?e[g]:g;h.push(t[u][v])}f=""===h.join("").trim()}if(!f){for(var y=0;y<d;y++){0<y&&!p&&(i+=o);var b=l&&s?e[y]:y;i+=m(t[u][b],y)}u<t.length-1&&(!n||0<d&&!p)&&(i+=a)}}return i}function m(e,t){var r,a;return null==e?"":e.constructor===Date?JSON.stringify(e).slice(1,25):(a=!1,d&&"string"==typeof e&&d.test(e)&&(e="'"+e,a=!0),r=e.toString().replace(f,s),(a=a||!0===n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1})(r,l.BAD_DELIMITERS)||-1<r.indexOf(o)||" "===r.charAt(0)||" "===r.charAt(r.length-1))?i+r+i:r)}},l.RECORD_SEP="\x1e",l.UNIT_SEP="\x1f",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r","\n",'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!r&&!!n.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=m,l.ParserHandle=p,l.NetworkStreamer=c,l.FileStreamer=u,l.StringStreamer=d,l.ReadableStreamStreamer=f,n.jQuery&&((t=n.jQuery).fn.parse=function(e){var r=e.config||{},o=[];return this.each(function(e){if(!("INPUT"===t(this).prop("tagName").toUpperCase()&&"file"===t(this).attr("type").toLowerCase()&&n.FileReader)||!this.files||0===this.files.length)return!0;for(var a=0;a<this.files.length;a++)o.push({file:this.files[a],inputElem:this,instanceConfig:t.extend({},r)})}),a(),this;function a(){if(0===o.length)w(e.complete)&&e.complete();else{var n,r,a,s,c=o[0];if(w(e.before)){var u=e.before(c.file,c.inputElem);if("object"==typeof u){if("abort"===u.action)return n="AbortError",r=c.file,a=c.inputElem,s=u.reason,void(w(e.error)&&e.error({name:n},r,a,s));if("skip"===u.action)return void i();"object"==typeof u.config&&(c.instanceConfig=t.extend(c.instanceConfig,u.config))}else if("skip"===u)return void i()}var d=c.instanceConfig.complete;c.instanceConfig.complete=function(e){w(d)&&d(e,c.file,c.inputElem),i()},l.parse(c.file,c.instanceConfig)}}function i(){o.splice(0,1),a()}}),o&&(n.onmessage=function(e){e=e.data,void 0===l.WORKER_ID&&e&&(l.WORKER_ID=e.workerId),"string"==typeof e.input?n.postMessage({workerId:l.WORKER_ID,results:l.parse(e.input,e.config),finished:!0}):(n.File&&e.input instanceof File||e.input instanceof Object)&&(e=l.parse(e.input,e.config))&&n.postMessage({workerId:l.WORKER_ID,results:e,finished:!0})}),(c.prototype=Object.create(s.prototype)).constructor=c,(u.prototype=Object.create(s.prototype)).constructor=u,(d.prototype=Object.create(d.prototype)).constructor=d,(f.prototype=Object.create(s.prototype)).constructor=f,l})?n.apply(t,r):n)&&(e.exports=o)},48049:function(e,t,n){"use strict";var r=n(14397);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},40718:function(e,t,n){e.exports=n(48049)()},14397:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},96032:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6989),o=n(31686),a=n(41154),i=n(2265),l=["show"];function s(e,t){return i.useMemo(function(){var n={};t&&(n.show="object"===(0,a.Z)(t)&&t.formatter?t.formatter:!!t);var i=n=(0,o.Z)((0,o.Z)({},n),e),s=i.show,c=(0,r.Z)(i,l);return(0,o.Z)((0,o.Z)({},c),{},{show:!!s,showFormatter:"function"==typeof s?s:void 0,strategy:c.strategy||function(e){return e.length}})},[e,t])}},2027:function(e,t,n){"use strict";n.d(t,{Q:function(){return d},Z:function(){return b}});var r=n(31686),o=n(1119),a=n(11993),i=n(41154),l=n(36760),s=n.n(l),c=n(2265),u=n(55041),d=function(e){var t=e.inputElement,n=e.children,l=e.prefixCls,d=e.prefix,f=e.suffix,p=e.addonBefore,h=e.addonAfter,m=e.className,g=e.style,v=e.disabled,y=e.readOnly,b=e.focused,x=e.triggerFocus,w=e.allowClear,k=e.value,S=e.handleReset,E=e.hidden,O=e.classes,C=e.classNames,j=e.dataAttrs,_=e.styles,P=e.components,N=null!=n?n:t,T=(null==P?void 0:P.affixWrapper)||"span",A=(null==P?void 0:P.groupWrapper)||"span",M=(null==P?void 0:P.wrapper)||"span",I=(null==P?void 0:P.groupAddon)||"span",R=(0,c.useRef)(null),D=(0,u.X3)(e),L=(0,c.cloneElement)(N,{value:k,className:s()(N.props.className,!D&&(null==C?void 0:C.variant))||null});if(D){var Z=null;if(w){var z,B,F,H,q=!v&&!y&&k,W="".concat(l,"-clear-icon"),U="object"===(0,i.Z)(w)&&null!=w&&w.clearIcon?w.clearIcon:"✖";Z=c.createElement("span",{onClick:S,onMouseDown:function(e){return e.preventDefault()},className:s()(W,(H={},(0,a.Z)(H,"".concat(W,"-hidden"),!q),(0,a.Z)(H,"".concat(W,"-has-suffix"),!!f),H)),role:"button",tabIndex:-1},U)}var K="".concat(l,"-affix-wrapper"),$=s()(K,(F={},(0,a.Z)(F,"".concat(l,"-disabled"),v),(0,a.Z)(F,"".concat(K,"-disabled"),v),(0,a.Z)(F,"".concat(K,"-focused"),b),(0,a.Z)(F,"".concat(K,"-readonly"),y),(0,a.Z)(F,"".concat(K,"-input-with-clear-btn"),f&&w&&k),F),null==O?void 0:O.affixWrapper,null==C?void 0:C.affixWrapper,null==C?void 0:C.variant),V=(f||w)&&c.createElement("span",{className:s()("".concat(l,"-suffix"),null==C?void 0:C.suffix),style:null==_?void 0:_.suffix},Z,f);L=c.createElement(T,(0,o.Z)({className:$,style:null==_?void 0:_.affixWrapper,onClick:function(e){var t;null!==(t=R.current)&&void 0!==t&&t.contains(e.target)&&(null==x||x())}},null==j?void 0:j.affixWrapper,{ref:R}),d&&c.createElement("span",{className:s()("".concat(l,"-prefix"),null==C?void 0:C.prefix),style:null==_?void 0:_.prefix},d),L,V)}if((0,u.He)(e)){var X="".concat(l,"-group"),G="".concat(X,"-addon"),Y="".concat(X,"-wrapper"),Q=s()("".concat(l,"-wrapper"),X,null==O?void 0:O.wrapper,null==C?void 0:C.wrapper),J=s()(Y,(0,a.Z)({},"".concat(Y,"-disabled"),v),null==O?void 0:O.group,null==C?void 0:C.groupWrapper);L=c.createElement(A,{className:J},c.createElement(M,{className:Q},p&&c.createElement(I,{className:G},p),L,h&&c.createElement(I,{className:G},h)))}return c.cloneElement(L,{className:s()(null===(z=L.props)||void 0===z?void 0:z.className,m)||null,style:(0,r.Z)((0,r.Z)({},null===(B=L.props)||void 0===B?void 0:B.style),g),hidden:E})},f=n(83145),p=n(26365),h=n(6989),m=n(50506),g=n(18694),v=n(96032),y=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],b=(0,c.forwardRef)(function(e,t){var n,i=e.autoComplete,l=e.onChange,b=e.onFocus,x=e.onBlur,w=e.onPressEnter,k=e.onKeyDown,S=e.prefixCls,E=void 0===S?"rc-input":S,O=e.disabled,C=e.htmlSize,j=e.className,_=e.maxLength,P=e.suffix,N=e.showCount,T=e.count,A=e.type,M=e.classes,I=e.classNames,R=e.styles,D=e.onCompositionStart,L=e.onCompositionEnd,Z=(0,h.Z)(e,y),z=(0,c.useState)(!1),B=(0,p.Z)(z,2),F=B[0],H=B[1],q=(0,c.useRef)(!1),W=(0,c.useRef)(null),U=function(e){W.current&&(0,u.nH)(W.current,e)},K=(0,m.Z)(e.defaultValue,{value:e.value}),$=(0,p.Z)(K,2),V=$[0],X=$[1],G=null==V?"":String(V),Y=(0,c.useState)(null),Q=(0,p.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,v.Z)(T,N),en=et.max||_,er=et.strategy(G),eo=!!en&&er>en;(0,c.useImperativeHandle)(t,function(){return{focus:U,blur:function(){var e;null===(e=W.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=W.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=W.current)||void 0===e||e.select()},input:W.current}}),(0,c.useEffect)(function(){H(function(e){return(!e||!O)&&e})},[O]);var ea=function(e,t,n){var r,o,a=t;if(!q.current&&et.exceedFormatter&&et.max&&et.strategy(t)>et.max)a=et.exceedFormatter(t,{max:et.max}),t!==a&&ee([(null===(r=W.current)||void 0===r?void 0:r.selectionStart)||0,(null===(o=W.current)||void 0===o?void 0:o.selectionEnd)||0]);else if("compositionEnd"===n.source)return;X(a),W.current&&(0,u.rJ)(W.current,e,l,a)};(0,c.useEffect)(function(){if(J){var e;null===(e=W.current)||void 0===e||e.setSelectionRange.apply(e,(0,f.Z)(J))}},[J]);var ei=eo&&"".concat(E,"-out-of-range");return c.createElement(d,(0,o.Z)({},Z,{prefixCls:E,className:s()(j,ei),handleReset:function(e){X(""),U(),W.current&&(0,u.rJ)(W.current,e,l)},value:G,focused:F,triggerFocus:U,suffix:function(){var e=Number(en)>0;if(P||et.show){var t=et.showFormatter?et.showFormatter({value:G,count:er,maxLength:en}):"".concat(er).concat(e?" / ".concat(en):"");return c.createElement(c.Fragment,null,et.show&&c.createElement("span",{className:s()("".concat(E,"-show-count-suffix"),(0,a.Z)({},"".concat(E,"-show-count-has-suffix"),!!P),null==I?void 0:I.count),style:(0,r.Z)({},null==R?void 0:R.count)},t),P)}return null}(),disabled:O,classes:M,classNames:I,styles:R}),(n=(0,g.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]),c.createElement("input",(0,o.Z)({autoComplete:i},n,{onChange:function(e){ea(e,e.target.value,{source:"change"})},onFocus:function(e){H(!0),null==b||b(e)},onBlur:function(e){H(!1),null==x||x(e)},onKeyDown:function(e){w&&"Enter"===e.key&&w(e),null==k||k(e)},className:s()(E,(0,a.Z)({},"".concat(E,"-disabled"),O),null==I?void 0:I.input),style:null==R?void 0:R.input,ref:W,size:C,type:void 0===A?"text":A,onCompositionStart:function(e){q.current=!0,null==D||D(e)},onCompositionEnd:function(e){q.current=!1,ea(e,e.currentTarget.value,{source:"compositionEnd"}),null==L||L(e)}}))))})},55041:function(e,t,n){"use strict";function r(e){return!!(e.addonBefore||e.addonAfter)}function o(e){return!!(e.prefix||e.suffix||e.allowClear)}function a(e,t,n,r){if(n){var o=t;if("click"===t.type){var a=e.cloneNode(!0);o=Object.create(t,{target:{value:a},currentTarget:{value:a}}),a.value="",n(o);return}if("file"!==e.type&&void 0!==r){var i=e.cloneNode(!0);o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value=r,n(o);return}n(o)}}function i(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}n.d(t,{He:function(){return r},X3:function(){return o},nH:function(){return i},rJ:function(){return a}})},10281:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(94981),o=function(e){if((0,r.Z)()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(e){return e in n.style})}return!1},a=function(e,t){if(!o(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function i(e,t){return Array.isArray(e)||void 0===t?o(e):a(e,t)}},6337:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=l(n(2265)),a=l(n(49211)),i=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(s,e);var t,n,l=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=f(s);return e=t?Reflect.construct(n,arguments,f(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return d(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return p(d(e=l.call.apply(l,[this].concat(n))),"onClick",function(t){var n=e.props,r=n.text,i=n.onCopy,l=n.children,s=n.options,c=o.default.Children.only(l),u=(0,a.default)(r,s);i&&i(r,u),c&&c.props&&"function"==typeof c.props.onClick&&c.props.onClick(t)}),e}return n=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),r=o.default.Children.only(t);return o.default.cloneElement(r,c(c({},n),{},{onClick:this.onClick}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,n),Object.defineProperty(s,"prototype",{writable:!1}),s}(o.default.PureComponent);t.CopyToClipboard=h,p(h,"defaultProps",{onCopy:void 0,options:void 0})},29233:function(e,t,n){"use strict";var r=n(6337).CopyToClipboard;r.CopyToClipboard=r,e.exports=r},13126:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),m=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope"),t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isFragment=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case l:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case m:case h:case s:return e;default:return t}}case o:return t}}}(e)===a}},82558:function(e,t,n){"use strict";e.exports=n(13126)},52181:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState((function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}).bind(this))}function a(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function i(e){var t=e.prototype;if(!t||!t.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,i=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?i="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(i="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==i||null!==l)throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(e.displayName||e.name)+" uses "+("function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==i?"\n "+i:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks");if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=a;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return i}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},59221:function(e,t,n){"use strict";n.d(t,{ZP:function(){return eB},bO:function(){return U}});var r=n(2265),o=n(40718),a=n.n(o),i=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty;function c(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function u(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);var o=r.cache,a=o.get(t),i=o.get(n);if(a&&i)return a===n&&i===t;o.set(t,n),o.set(n,t);var l=e(t,n,r);return o.delete(t),o.delete(n),l}}function d(e){return i(e).concat(l(e))}var f=Object.hasOwn||function(e,t){return s.call(e,t)};function p(e,t){return e||t?e===t:e===t||e!=e&&t!=t}var h="_owner",m=Object.getOwnPropertyDescriptor,g=Object.keys;function v(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function y(e,t){return p(e.getTime(),t.getTime())}function b(e,t,n){if(e.size!==t.size)return!1;for(var r,o,a={},i=e.entries(),l=0;(r=i.next())&&!r.done;){for(var s=t.entries(),c=!1,u=0;(o=s.next())&&!o.done;){var d=r.value,f=d[0],p=d[1],h=o.value,m=h[0],g=h[1];!c&&!a[u]&&(c=n.equals(f,m,l,u,e,t,n)&&n.equals(p,g,f,m,e,t,n))&&(a[u]=!0),u++}if(!c)return!1;l++}return!0}function x(e,t,n){var r,o=g(e),a=o.length;if(g(t).length!==a)return!1;for(;a-- >0;)if((r=o[a])===h&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!f(t,r)||!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function w(e,t,n){var r,o,a,i=d(e),l=i.length;if(d(t).length!==l)return!1;for(;l-- >0;)if((r=i[l])===h&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!f(t,r)||!n.equals(e[r],t[r],r,r,e,t,n)||(o=m(e,r),a=m(t,r),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function k(e,t){return p(e.valueOf(),t.valueOf())}function S(e,t){return e.source===t.source&&e.flags===t.flags}function E(e,t,n){if(e.size!==t.size)return!1;for(var r,o,a={},i=e.values();(r=i.next())&&!r.done;){for(var l=t.values(),s=!1,c=0;(o=l.next())&&!o.done;)!s&&!a[c]&&(s=n.equals(r.value,o.value,r.value,o.value,e,t,n))&&(a[c]=!0),c++;if(!s)return!1}return!0}function O(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var C=Array.isArray,j="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,_=Object.assign,P=Object.prototype.toString.call.bind(Object.prototype.toString),N=T();function T(e){void 0===e&&(e={});var t,n,r,o,a,i,l,s,d,f=e.circular,p=e.createInternalComparator,h=e.createState,m=e.strict,g=(n=(t=function(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,o={areArraysEqual:r?w:v,areDatesEqual:y,areMapsEqual:r?c(b,w):b,areObjectsEqual:r?w:x,arePrimitiveWrappersEqual:k,areRegExpsEqual:S,areSetsEqual:r?c(E,w):E,areTypedArraysEqual:r?w:O};if(n&&(o=_({},o,n(o))),t){var a=u(o.areArraysEqual),i=u(o.areMapsEqual),l=u(o.areObjectsEqual),s=u(o.areSetsEqual);o=_({},o,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:l,areSetsEqual:s})}return o}(e)).areArraysEqual,r=t.areDatesEqual,o=t.areMapsEqual,a=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,l=t.areRegExpsEqual,s=t.areSetsEqual,d=t.areTypedArraysEqual,function(e,t,c){if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return e!=e&&t!=t;var u=e.constructor;if(u!==t.constructor)return!1;if(u===Object)return a(e,t,c);if(C(e))return n(e,t,c);if(null!=j&&j(e))return d(e,t,c);if(u===Date)return r(e,t,c);if(u===RegExp)return l(e,t,c);if(u===Map)return o(e,t,c);if(u===Set)return s(e,t,c);var f=P(e);return"[object Date]"===f?r(e,t,c):"[object RegExp]"===f?l(e,t,c):"[object Map]"===f?o(e,t,c):"[object Set]"===f?s(e,t,c):"[object Object]"===f?"function"!=typeof e.then&&"function"!=typeof t.then&&a(e,t,c):"[object Arguments]"===f?a(e,t,c):("[object Boolean]"===f||"[object Number]"===f||"[object String]"===f)&&i(e,t,c)}),N=p?p(g):function(e,t,n,r,o,a,i){return g(e,t,i)};return function(e){var t=e.circular,n=e.comparator,r=e.createState,o=e.equals,a=e.strict;if(r)return function(e,i){var l=r(),s=l.cache;return n(e,i,{cache:void 0===s?t?new WeakMap:void 0:s,equals:o,meta:l.meta,strict:a})};if(t)return function(e,t){return n(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:a})};var i={cache:void 0,equals:o,meta:void 0,strict:a};return function(e,t){return n(e,t,i)}}({circular:void 0!==f&&f,comparator:g,createState:h,equals:N,strict:void 0!==m&&m})}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;requestAnimationFrame(function r(o){if(n<0&&(n=o),o-n>t)e(o),n=-1;else{var a;a=r,"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(a)}})}function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(e,t,n){var r;return(r=function(e,t){if("object"!==R(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==R(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===R(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}T({strict:!0}),T({circular:!0}),T({circular:!0,strict:!0}),T({createInternalComparator:function(){return p}}),T({strict:!0,createInternalComparator:function(){return p}}),T({circular:!0,createInternalComparator:function(){return p}}),T({circular:!0,createInternalComparator:function(){return p},strict:!0});var z=["Webkit","Moz","O","ms"],B=["-webkit-","-moz-","-o-","-ms-"],F=["transform","transformOrigin","transition"],H=function(e){return e},q=function(e,t){if(-1===F.indexOf(e))return Z({},e,Number.isNaN(t)?0:t);var n="transition"===e,r=e.replace(/(\w)/,function(e){return e.toUpperCase()}),o=t;return z.reduce(function(e,a,i){return n&&(o=t.replace(/(transform|transform-origin)/gim,"".concat(B[i],"$1"))),L(L({},e),{},Z({},a+r,o))},{})},W=function(e,t){return Object.keys(t).reduce(function(n,r){return L(L({},n),{},Z({},r,e(r,t[r])))},{})},U=function(e){return Object.keys(e).reduce(function(e,t){return L(L({},e),q(t,e[t]))},e)},K=function(e,t,n){return e.map(function(e){return"".concat(e.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())})," ").concat(t,"ms ").concat(n)}).join(",")},$=function(e,t,n,r,o,a,i,l){};function V(e,t){if(e){if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var G=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},Y=function(e,t){return e.map(function(e,n){return e*Math.pow(t,n)}).reduce(function(e,t){return e+t})},Q=function(e,t){return function(n){return Y(G(e,t),n)}},J=function(){for(var e,t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=r[0],i=r[1],l=r[2],s=r[3];if(1===r.length)switch(r[0]){case"linear":a=0,i=0,l=1,s=1;break;case"ease":a=.25,i=.1,l=.25,s=1;break;case"ease-in":a=.42,i=0,l=1,s=1;break;case"ease-out":a=.42,i=0,l=.58,s=1;break;case"ease-in-out":a=0,i=0,l=.58,s=1;break;default:var c=r[0].split("(");if("cubic-bezier"===c[0]&&4===c[1].split(")")[0].split(",").length){var u,d=function(e){if(Array.isArray(e))return e}(u=c[1].split(")")[0].split(",").map(function(e){return parseFloat(e)}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),4!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(u,4)||V(u,4)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a=d[0],i=d[1],l=d[2],s=d[3]}else $(!1,"[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s",r)}$([a,l,i,s].every(function(e){return"number"==typeof e&&e>=0&&e<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",r);var f=Q(a,l),p=Q(i,s),h=(e=a,t=l,function(n){var r;return Y([].concat(function(e){if(Array.isArray(e))return X(e)}(r=G(e,t).map(function(e,t){return e*t}).slice(1))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||V(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),n)}),m=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var o,a=f(n)-t,i=h(n);if(1e-4>Math.abs(a-t)||i<1e-4)break;n=(o=n-a/i)>1?1:o<0?0:o}return p(n)};return m.isStepper=!1,m},ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,n=void 0===t?100:t,r=e.damping,o=void 0===r?8:r,a=e.dt,i=void 0===a?17:a,l=function(e,t,r){var a=r+(-(e-t)*n-r*o)*i/1e3,l=r*i/1e3+e;return 1e-4>Math.abs(l-t)&&1e-4>Math.abs(a)?[t,0]:[l,a]};return l.isStepper=!0,l.dt=i,l},et=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0];if("string"==typeof r)switch(r){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return J(r);case"spring":return ee();default:if("cubic-bezier"===r.split("(")[0])return J(r);$(!1,"[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s",t)}return"function"==typeof r?r:($(!1,"[configEasing]: first argument type should be function or string, instead received %s",t),null)};function en(e){return(en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function er(e){return function(e){if(Array.isArray(e))return es(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||el(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach(function(t){ei(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ei(e,t,n){var r;return(r=function(e,t){if("object"!==en(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==en(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===en(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function el(e,t){if(e){if("string"==typeof e)return es(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return es(e,t)}}function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ec=function(e,t,n){return e+(t-e)*n},eu=function(e){return e.from!==e.to},ed=function e(t,n,r){var o=W(function(e,n){if(eu(n)){var r,o=function(e){if(Array.isArray(e))return e}(r=t(n.from,n.to,n.velocity))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(r,2)||el(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o[1];return ea(ea({},n),{},{from:a,velocity:i})}return n},n);return r<1?W(function(e,t){return eu(t)?ea(ea({},t),{},{velocity:ec(t.velocity,o[e].velocity,r),from:ec(t.from,o[e].from,r)}):t},n):e(t,o,r-1)},ef=function(e,t,n,r,o){var a,i,l=[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})}),s=l.reduce(function(n,r){return ea(ea({},n),{},ei({},r,[e[r],t[r]]))},{}),c=l.reduce(function(n,r){return ea(ea({},n),{},ei({},r,{from:e[r],velocity:0,to:t[r]}))},{}),u=-1,d=function(){return null};return d=n.isStepper?function(r){a||(a=r);var i=(r-a)/n.dt;c=ed(n,c,i),o(ea(ea(ea({},e),t),W(function(e,t){return t.from},c))),a=r,Object.values(c).filter(eu).length&&(u=requestAnimationFrame(d))}:function(a){i||(i=a);var l=(a-i)/r,c=W(function(e,t){return ec.apply(void 0,er(t).concat([n(l)]))},s);if(o(ea(ea(ea({},e),t),c)),l<1)u=requestAnimationFrame(d);else{var f=W(function(e,t){return ec.apply(void 0,er(t).concat([n(1)]))},s);o(ea(ea(ea({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(u)}}};function ep(e){return(ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eh=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function em(e){return function(e){if(Array.isArray(e))return eg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return eg(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ev(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ey(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ev(Object(n),!0).forEach(function(t){eb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ev(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eb(e,t,n){return(t=ex(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ex(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ep(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ep(t)?t:String(t)}function ew(e,t){return(ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ek(e,t){if(t&&("object"===ep(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eS(e)}function eS(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eE(e){return(eE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ew(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eE(a);return e=t?Reflect.construct(n,arguments,eE(this).constructor):n.apply(this,arguments),ek(this,e)});function a(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a);var n,r=(n=o.call(this,e,t)).props,i=r.isActive,l=r.attributeName,s=r.from,c=r.to,u=r.steps,d=r.children,f=r.duration;if(n.handleStyleChange=n.handleStyleChange.bind(eS(n)),n.changeStyle=n.changeStyle.bind(eS(n)),!i||f<=0)return n.state={style:{}},"function"==typeof d&&(n.state={style:c}),ek(n);if(u&&u.length)n.state={style:u[0].style};else if(s){if("function"==typeof d)return n.state={style:s},ek(n);n.state={style:l?eb({},l,s):s}}else n.state={style:{}};return n}return n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,o=t.attributeName,a=t.shouldReAnimate,i=t.to,l=t.from,s=this.state.style;if(r){if(!n){var c={style:o?eb({},o,i):i};this.state&&s&&(o&&s[o]!==i||!o&&s!==i)&&this.setState(c);return}if(!N(e.to,i)||!e.canBegin||!e.isActive){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?l:e.to;if(this.state&&s){var f={style:o?eb({},o,d):d};(o&&[o]!==d||!o&&s!==d)&&this.setState(f)}this.runAnimation(ey(ey({},this.props),{},{from:d,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"runJSAnimation",value:function(e){var t=this,n=e.from,r=e.to,o=e.duration,a=e.easing,i=e.begin,l=e.onAnimationEnd,s=e.onAnimationStart,c=ef(n,r,et(a),o,this.changeStyle);this.manager.start([s,i,function(){t.stopJSAnimation=c()},o,l])}},{key:"runStepAnimation",value:function(e){var t=this,n=e.steps,r=e.begin,o=e.onAnimationStart,a=n[0],i=a.style,l=a.duration;return this.manager.start([o].concat(em(n.reduce(function(e,r,o){if(0===o)return e;var a=r.duration,i=r.easing,l=void 0===i?"ease":i,s=r.style,c=r.properties,u=r.onAnimationEnd,d=o>0?n[o-1]:r,f=c||Object.keys(s);if("function"==typeof l||"spring"===l)return[].concat(em(e),[t.runJSAnimation.bind(t,{from:d.style,to:s,duration:a,easing:l}),a]);var p=K(f,a,l),h=ey(ey(ey({},d.style),s),{},{transition:p});return[].concat(em(e),[h,a,u]).filter(H)},[i,Math.max(void 0===l?0:l,r)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){if(!this.manager){var t,n,r;this.manager=(t=function(){return null},n=!1,r=function e(r){if(!n){if(Array.isArray(r)){if(!r.length)return;var o=function(e){if(Array.isArray(e))return e}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return I(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,void 0)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o.slice(1);if("number"==typeof a){A(e.bind(null,i),a);return}e(a),A(e.bind(null,i));return}"object"===M(r)&&t(r),"function"==typeof r&&r()}},{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}})}var o=e.begin,a=e.duration,i=e.attributeName,l=e.to,s=e.easing,c=e.onAnimationStart,u=e.onAnimationEnd,d=e.steps,f=e.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),"function"==typeof s||"function"==typeof f||"spring"===s){this.runJSAnimation(e);return}if(d.length>1){this.runStepAnimation(e);return}var h=i?eb({},i,l):l,m=K(Object.keys(h),a,s);p.start([c,o,ey(ey({},h),{},{transition:m}),a,u])}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration),o=(e.attributeName,e.easing,e.isActive),a=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eh)),i=r.Children.count(t),l=U(this.state.style);if("function"==typeof t)return t(l);if(!o||0===i||n<=0)return t;var s=function(e){var t=e.props,n=t.style,o=t.className;return(0,r.cloneElement)(e,ey(ey({},a),{},{style:ey(ey({},void 0===n?{}:n),l),className:o}))};return 1===i?s(r.Children.only(t)):r.createElement("div",null,r.Children.map(t,function(e){return s(e)}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ex(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);eO.displayName="Animate",eO.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},eO.propTypes={from:a().oneOfType([a().object,a().string]),to:a().oneOfType([a().object,a().string]),attributeName:a().string,duration:a().number,begin:a().number,easing:a().oneOfType([a().string,a().func]),steps:a().arrayOf(a().shape({duration:a().number.isRequired,style:a().object.isRequired,easing:a().oneOfType([a().oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),a().func]),properties:a().arrayOf("string"),onAnimationEnd:a().func})),children:a().oneOfType([a().node,a().func]),isActive:a().bool,canBegin:a().bool,onAnimationEnd:a().func,shouldReAnimate:a().bool,onAnimationStart:a().func,onAnimationReStart:a().func};var eC=n(30719),ej=["children","appearOptions","enterOptions","leaveOptions"];function e_(e){return(e_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eP(){return(eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eN(Object(n),!0).forEach(function(t){eR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eA(e,t){return(eA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eM(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eI(e){return(eI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eR(e,t,n){return(t=eD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eD(e){var t=function(e,t){if("object"!==e_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==e_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===e_(t)?t:String(t)}void 0===Number.isFinite&&(Number.isFinite=function(e){return"number"==typeof e&&isFinite(e)});var eL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.steps,n=e.duration;return t&&t.length?t.reduce(function(e,t){return e+(Number.isFinite(t.duration)&&t.duration>0?t.duration:0)},0):Number.isFinite(n)?n:0},eZ=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eA(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eI(a);return e=t?Reflect.construct(n,arguments,eI(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===e_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eM(e)}(this,e)});function a(){var e;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),eR(eM(e=o.call(this)),"handleEnter",function(t,n){var r=e.props,o=r.appearOptions,a=r.enterOptions;e.handleStyleActive(n?o:a)}),eR(eM(e),"handleExit",function(){var t=e.props.leaveOptions;e.handleStyleActive(t)}),e.state={isActive:!1},e}return n=[{key:"handleStyleActive",value:function(e){if(e){var t=e.onAnimationEnd?function(){e.onAnimationEnd()}:null;this.setState(eT(eT({},e),{},{onAnimationEnd:t,isActive:!0}))}}},{key:"parseTimeout",value:function(){var e=this.props,t=e.appearOptions,n=e.enterOptions,r=e.leaveOptions;return eL(t)+eL(n)+eL(r)}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,o=(t.appearOptions,t.enterOptions,t.leaveOptions,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,ej));return r.createElement(eC.Transition,eP({},o,{onEnter:this.handleEnter,onExit:this.handleExit,timeout:this.parseTimeout()}),function(){return r.createElement(eO,e.state,r.Children.only(n))})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eD(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.Component);function ez(e){var t=e.component,n=e.children,o=e.appear,a=e.enter,i=e.leave;return r.createElement(eC.TransitionGroup,{component:t},r.Children.map(n,function(e,t){return r.createElement(eZ,{appearOptions:o,enterOptions:a,leaveOptions:i,key:"child-".concat(t)},e)}))}eZ.propTypes={appearOptions:a().object,enterOptions:a().object,leaveOptions:a().object,children:a().element},ez.propTypes={appear:a().object,enter:a().object,leave:a().object,children:a().oneOfType([a().array,a().element]),component:a().any},ez.defaultProps={component:"span"};var eB=eO},94263:function(e,t){"use strict";t.Z={'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}},33664:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,function(e){if(!e||!e.__esModule){var t={};if(null!=e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}t.default=e}}(n(40718));var r=l(n(84617)),o=l(n(67973)),a=l(n(2265)),i=l(n(20536));function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n(32601);var c=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return(0,r.default)(e,t)})},u=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return(0,o.default)(e,t)})},d=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).onEnter=function(e,n){var r=t.getClassNames(n?"appear":"enter").className;t.removeClasses(e,"exit"),c(e,r),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.getClassNames(n?"appear":"enter").activeClassName;t.reflowAndAddClass(e,r),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.getClassNames("appear").doneClassName,o=t.getClassNames("enter").doneClassName;t.removeClasses(e,n?"appear":"enter"),c(e,n?r+" "+o:o),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.getClassNames("exit").className;t.removeClasses(e,"appear"),t.removeClasses(e,"enter"),c(e,n),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.getClassNames("exit").activeClassName;t.reflowAndAddClass(e,n),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.getClassNames("exit").doneClassName;t.removeClasses(e,"exit"),c(e,n),t.props.onExited&&t.props.onExited(e)},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?(r&&n?n+"-":"")+e:n[e],a=r?o+"-active":n[e+"Active"],i=r?o+"-done":n[e+"Done"];return{className:o,activeClassName:a,doneClassName:i}},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.removeClasses=function(e,t){var n=this.getClassNames(t),r=n.className,o=n.activeClassName,a=n.doneClassName;r&&u(e,r),o&&u(e,o),a&&u(e,a)},n.reflowAndAddClass=function(e,t){t&&(e&&e.scrollTop,c(e,t))},n.render=function(){var e=s({},this.props);return delete e.classNames,a.default.createElement(i.default,s({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(a.default.Component);d.defaultProps={classNames:""},d.propTypes={},t.default=d,e.exports=t.default},31601:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,i(n(40718));var r=i(n(2265)),o=n(54887),a=i(n(38244));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).handleEnter=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEnter",0,n)},t.handleEntering=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntering",0,n)},t.handleEntered=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntered",0,n)},t.handleExit=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExit",1,n)},t.handleExiting=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExiting",1,n)},t.handleExited=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExited",1,n)},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.handleLifecycle=function(e,t,n){var a,i=this.props.children,l=r.default.Children.toArray(i)[t];l.props[e]&&(a=l.props)[e].apply(a,n),this.props[e]&&this.props[e]((0,o.findDOMNode)(this))},n.render=function(){var e=this.props,t=e.children,n=e.in,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["children","in"]),i=r.default.Children.toArray(t),l=i[0],s=i[1];return delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,r.default.createElement(a.default,o,n?r.default.cloneElement(l,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(s,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},t}(r.default.Component);l.propTypes={},t.default=l,e.exports=t.default},20536:function(e,t,n){"use strict";t.__esModule=!0,t.default=t.EXITING=t.ENTERED=t.ENTERING=t.EXITED=t.UNMOUNTED=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}return t.default=e,t}(n(40718)),o=l(n(2265)),a=l(n(54887)),i=n(52181);function l(e){return e&&e.__esModule?e:{default:e}}n(32601);var s="unmounted";t.UNMOUNTED=s;var c="exited";t.EXITED=c;var u="entering";t.ENTERING=u;var d="entered";t.ENTERED=d;var f="exiting";t.EXITING=f;var p=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,o,a=n.transitionGroup,i=a&&!a.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=c,r.appearStatus=u):o=d:o=t.unmountOnExit||t.mountOnEnter?s:c,r.state={status:o},r.nextCallback=null,r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===s?{status:c}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==u&&n!==d&&(t=u):(n===u||n===d)&&(t=f)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=a.default.findDOMNode(this);t===u?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===c&&this.setState({status:s})},n.performEnter=function(e,t){var n=this,r=this.props.enter,o=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,a=this.getTimeouts(),i=o?a.appear:a.enter;if(!t&&!r){this.safeSetState({status:d},function(){n.props.onEntered(e)});return}this.props.onEnter(e,o),this.safeSetState({status:u},function(){n.props.onEntering(e,o),n.onTransitionEnd(e,i,function(){n.safeSetState({status:d},function(){n.props.onEntered(e,o)})})})},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();if(!n){this.safeSetState({status:c},function(){t.props.onExited(e)});return}this.props.onExit(e),this.safeSetState({status:f},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:c},function(){t.props.onExited(e)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;if(!e||r){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)},n.render=function(){var e=this.state.status;if(e===s)return null;var t=this.props,n=t.children,r=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var a=o.default.Children.only(n);return o.default.cloneElement(a,r)},t}(o.default.Component);function h(){}p.contextTypes={transitionGroup:r.object},p.childContextTypes={transitionGroup:function(){}},p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},p.UNMOUNTED=0,p.EXITED=1,p.ENTERING=2,p.ENTERED=3,p.EXITING=4;var m=(0,i.polyfill)(p);t.default=m},38244:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=l(n(40718)),o=l(n(2265)),a=n(52181),i=n(28710);function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var u=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},d=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(c(c(r)));return r.state={handleExited:o,firstRender:!0},r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},n.componentDidMount=function(){this.appeared=!0,this.mounted=!0},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?(0,i.getInitialChildMapping)(e,r):(0,i.getNextChildMapping)(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=(0,i.getChildMapping)(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=s({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["component","childFactory"]),a=u(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===t)?a:o.default.createElement(t,r,a)},t}(o.default.Component);d.childContextTypes={transitionGroup:r.default.object.isRequired},d.propTypes={},d.defaultProps={component:"div",childFactory:function(e){return e}};var f=(0,a.polyfill)(d);t.default=f,e.exports=t.default},30719:function(e,t,n){"use strict";var r=l(n(33664)),o=l(n(31601)),a=l(n(38244)),i=l(n(20536));function l(e){return e&&e.__esModule?e:{default:e}}e.exports={Transition:i.default,TransitionGroup:a.default,ReplaceTransition:o.default,CSSTransition:r.default}},28710:function(e,t,n){"use strict";t.__esModule=!0,t.getChildMapping=o,t.mergeChildMappings=a,t.getInitialChildMapping=function(e,t){return o(e.children,function(n){return(0,r.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:i(n,"appear",e),enter:i(n,"enter",e),exit:i(n,"exit",e)})})},t.getNextChildMapping=function(e,t,n){var l=o(e.children),s=a(t,l);return Object.keys(s).forEach(function(o){var a=s[o];if((0,r.isValidElement)(a)){var c=o in t,u=o in l,d=t[o],f=(0,r.isValidElement)(d)&&!d.props.in;u&&(!c||f)?s[o]=(0,r.cloneElement)(a,{onExited:n.bind(null,a),in:!0,exit:i(a,"exit",e),enter:i(a,"enter",e)}):u||!c||f?u&&c&&(0,r.isValidElement)(d)&&(s[o]=(0,r.cloneElement)(a,{onExited:n.bind(null,a),in:d.props.in,exit:i(a,"exit",e),enter:i(a,"enter",e)})):s[o]=(0,r.cloneElement)(a,{in:!1})}}),s};var r=n(2265);function o(e,t){var n=Object.create(null);return e&&r.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,r.isValidElement)(e)?t(e):e}),n}function a(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),a=[];for(var i in e)i in t?a.length&&(o[i]=a,a=[]):a.push(i);var l={};for(var s in t){if(o[s])for(r=0;r<o[s].length;r++){var c=o[s][r];l[o[s][r]]=n(c)}l[s]=n(s)}for(r=0;r<a.length;r++)l[a[r]]=n(a[r]);return l}function i(e,t,n){return null!=n[t]?n[t]:e.props[t]}},32601:function(e,t,n){"use strict";var r;t.__esModule=!0,t.classNamesShape=t.timeoutsShape=void 0,(r=n(40718))&&r.__esModule,t.timeoutsShape=null,t.classNamesShape=null},31699:function(e,t,n){"use strict";n.d(t,{$:function(){return Z}});var r=n(2265),o=n(87602),a=n(59221),i=n(21652),l=n.n(i),s=n(77571),c=n.n(s),u=n(9841),d=n(13137),f=n(20407),p=n(58772),h=n(16630),m=n(82944),g=n(34067),v=n(85355),y=n(41637),b=n(11638);function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var w=["x","y"];function k(){return(k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){var n=e.x,r=e.y,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,w),a=parseInt("".concat(n),10),i=parseInt("".concat(r),10),l=parseInt("".concat(t.height||o.height),10),s=parseInt("".concat(t.width||o.width),10);return E(E(E(E(E({},t),o),a?{x:a}:{}),i?{y:i}:{}),{},{height:l,width:s,name:t.name,radius:t.radius})}function C(e){return r.createElement(b.bn,k({shapeType:"rectangle",propTransformer:O,activeClassName:"recharts-active-bar"},e))}var j=["value","background"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(f,e);var t,n,i,s=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=R(f);return e=t?Reflect.construct(n,arguments,R(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return I(e)}(this,e)});function f(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,f);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return D(I(e=s.call.apply(s,[this].concat(n))),"state",{isAnimationFinished:!1}),D(I(e),"id",(0,h.EL)("recharts-bar-")),D(I(e),"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),D(I(e),"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return n=[{key:"renderRectanglesStatically",value:function(e){var t=this,n=this.props,o=n.shape,a=n.dataKey,i=n.activeIndex,l=n.activeBar,s=(0,m.L6)(this.props,!1);return e&&e.map(function(e,n){var c=n===i,d=T(T(T({},s),e),{},{isActive:c,option:c?l:o,index:n,dataKey:a,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return r.createElement(u.m,P({className:"recharts-bar-rectangle"},(0,y.bw)(t.props,e,n),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),r.createElement(C,d))})}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,n=t.data,o=t.layout,i=t.isAnimationActive,l=t.animationBegin,s=t.animationDuration,c=t.animationEasing,d=t.animationId,f=this.state.prevData;return r.createElement(a.ZP,{begin:l,duration:s,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var a=t.t,i=n.map(function(e,t){var n=f&&f[t];if(n){var r=(0,h.k4)(n.x,e.x),i=(0,h.k4)(n.y,e.y),l=(0,h.k4)(n.width,e.width),s=(0,h.k4)(n.height,e.height);return T(T({},e),{},{x:r(a),y:i(a),width:l(a),height:s(a)})}if("horizontal"===o){var c=(0,h.k4)(0,e.height)(a);return T(T({},e),{},{y:e.y+e.height-c,height:c})}var u=(0,h.k4)(0,e.width)(a);return T(T({},e),{},{width:u})});return r.createElement(u.m,null,e.renderRectanglesStatically(i))})}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!l()(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:"renderBackground",value:function(){var e=this,t=this.props,n=t.data,o=t.dataKey,a=t.activeIndex,i=(0,m.L6)(this.props.background,!1);return n.map(function(t,n){t.value;var l=t.background,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,j);if(!l)return null;var c=T(T(T(T(T({},s),{},{fill:"#eee"},l),i),(0,y.bw)(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:o,index:n,key:"background-bar-".concat(n),className:"recharts-bar-background-rectangle"});return r.createElement(C,P({option:e.props.background,isActive:n===a},c))})}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.data,a=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,m.NN)(s,d.W);if(!c)return null;var f="vertical"===l?o[0].height/2:o[0].width/2,p=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:(0,v.F$)(e,t)}};return r.createElement(u.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:o,xAxis:a,yAxis:i,layout:l,offset:f,dataPointFormatter:p})}))}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.data,a=e.className,i=e.xAxis,l=e.yAxis,s=e.left,d=e.top,f=e.width,h=e.height,m=e.isAnimationActive,g=e.background,v=e.id;if(t||!n||!n.length)return null;var y=this.state.isAnimationFinished,b=(0,o.Z)("recharts-bar",a),x=i&&i.allowDataOverflow,w=l&&l.allowDataOverflow,k=x||w,S=c()(v)?this.id:v;return r.createElement(u.m,{className:b},x||w?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(S)},r.createElement("rect",{x:x?s:s-f/2,y:w?d:d-h/2,width:x?f:2*f,height:w?h:2*h}))):null,r.createElement(u.m,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,S),(!m||y)&&p.e.renderCallByParent(this.props,n))}}],i=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],n&&A(f.prototype,n),i&&A(f,i),Object.defineProperty(f,"prototype",{writable:!1}),f}(r.PureComponent);D(Z,"displayName","Bar"),D(Z,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!g.x.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),D(Z,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,o=e.bandSize,a=e.xAxis,i=e.yAxis,l=e.xAxisTicks,s=e.yAxisTicks,c=e.stackedData,u=e.dataStartIndex,d=e.displayedData,p=e.offset,g=(0,v.Bu)(r,n);if(!g)return null;var y=t.layout,b=n.props,x=b.dataKey,w=b.children,k=b.minPointSize,S="horizontal"===y?i:a,E=c?S.scale.domain():null,O=(0,v.Yj)({numericAxis:S}),C=(0,m.NN)(w,f.b),j=d.map(function(e,t){var r,d,f,p,m,b;if(c?r=(0,v.Vv)(c[u+t],E):Array.isArray(r=(0,v.F$)(e,x))||(r=[O,r]),"horizontal"===y){var w,S=[i.scale(r[0]),i.scale(r[1])],j=S[0],_=S[1];d=(0,v.Fy)({axis:a,ticks:l,bandSize:o,offset:g.offset,entry:e,index:t}),f=null!==(w=null!=_?_:j)&&void 0!==w?w:void 0,p=g.size;var P=j-_;if(m=Number.isNaN(P)?0:P,b={x:d,y:i.y,width:p,height:i.height},Math.abs(k)>0&&Math.abs(m)<Math.abs(k)){var N=(0,h.uY)(m||k)*(Math.abs(k)-Math.abs(m));f-=N,m+=N}}else{var A=[a.scale(r[0]),a.scale(r[1])],M=A[0],I=A[1];if(d=M,f=(0,v.Fy)({axis:i,ticks:s,bandSize:o,offset:g.offset,entry:e,index:t}),p=I-M,m=g.size,b={x:a.x,y:f,width:a.width,height:m},Math.abs(k)>0&&Math.abs(p)<Math.abs(k)){var R=(0,h.uY)(p||k)*(Math.abs(k)-Math.abs(p));p+=R}}return T(T(T({},e),{},{x:d,y:f,width:p,height:m,value:c?r:r[1],payload:e,background:b},C&&C[t]&&C[t].props),{},{tooltipPayload:[(0,v.Qo)(n,e)],tooltipPosition:{x:d+p/2,y:f+m/2}})});return T({data:j,layout:y},p)})},80285:function(e,t,n){"use strict";n.d(t,{O:function(){return N}});var r=n(2265),o=n(86757),a=n.n(o),i=n(13735),l=n.n(i),s=n(87602),c=n(46485),u=n(9841),d=n(58811),f=n(26680),p=n(16630),h=n(41637),m=n(82944),g=n(78242),v=["viewBox"],y=["viewBox"],b=["ticks"];function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(){return(w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function E(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(k,e);var t,n,o,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=j(k);return e=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function k(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,k),(t=i.call(this,e)).state={fontSize:"",letterSpacing:""},t}return n=[{key:"shouldComponentUpdate",value:function(e,t){var n=e.viewBox,r=E(e,v),o=this.props,a=o.viewBox,i=E(o,y);return!(0,c.w)(n,a)||!(0,c.w)(r,i)||!(0,c.w)(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,n,r,o,a,i,l=this.props,s=l.x,c=l.y,u=l.width,d=l.height,f=l.orientation,h=l.tickSize,m=l.mirror,g=l.tickMargin,v=m?-1:1,y=e.tickSize||h,b=(0,p.hj)(e.tickCoord)?e.tickCoord:e.coordinate;switch(f){case"top":t=n=e.coordinate,i=(r=(o=c+ +!m*d)-v*y)-v*g,a=b;break;case"left":r=o=e.coordinate,a=(t=(n=s+ +!m*u)-v*y)-v*g,i=b;break;case"right":r=o=e.coordinate,a=(t=(n=s+ +m*u)+v*y)+v*g,i=b;break;default:t=n=e.coordinate,i=(r=(o=c+ +m*d)+v*y)+v*g,a=b}return{line:{x1:t,y1:r,x2:n,y2:o},tick:{x:a,y:i}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,n=t.orientation,r=t.mirror;switch(n){case"left":e=r?"start":"end";break;case"right":e=r?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,n=e.mirror,r="end";switch(t){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.orientation,c=e.mirror,u=e.axisLine,d=S(S(S({},(0,m.L6)(this.props,!1)),(0,m.L6)(u,!1)),{},{fill:"none"});if("top"===i||"bottom"===i){var f=+("top"===i&&!c||"bottom"===i&&c);d=S(S({},d),{},{x1:t,y1:n+f*a,x2:t+o,y2:n+f*a})}else{var p=+("left"===i&&!c||"right"===i&&c);d=S(S({},d),{},{x1:t+p*o,y1:n,x2:t+p*o,y2:n+a})}return r.createElement("line",w({},d,{className:(0,s.Z)("recharts-cartesian-axis-line",l()(u,"className"))}))}},{key:"renderTicks",value:function(e,t,n){var o=this,i=this.props,c=i.tickLine,d=i.stroke,f=i.tick,p=i.tickFormatter,v=i.unit,y=(0,g.f)(S(S({},this.props),{},{ticks:e}),t,n),b=this.getTickTextAnchor(),x=this.getTickVerticalAnchor(),E=(0,m.L6)(this.props,!1),O=(0,m.L6)(f,!1),C=S(S({},E),{},{fill:"none"},(0,m.L6)(c,!1)),j=y.map(function(e,t){var n=o.getTickLineCoord(e),i=n.line,m=n.tick,g=S(S(S(S({textAnchor:b,verticalAnchor:x},E),{},{stroke:"none",fill:d},O),m),{},{index:t,payload:e,visibleTicksCount:y.length,tickFormatter:p});return r.createElement(u.m,w({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},(0,h.bw)(o.props,e,t)),c&&r.createElement("line",w({},C,i,{className:(0,s.Z)("recharts-cartesian-axis-tick-line",l()(c,"className"))})),f&&k.renderTickItem(f,g,"".concat(a()(p)?p(e.value,t):e.value).concat(v||"")))});return r.createElement("g",{className:"recharts-cartesian-axis-ticks"},j)}},{key:"render",value:function(){var e=this,t=this.props,n=t.axisLine,o=t.width,i=t.height,l=t.ticksGenerator,c=t.className;if(t.hide)return null;var d=this.props,p=d.ticks,h=E(d,b),m=p;return(a()(l)&&(m=l(p&&p.length>0?this.props:h)),o<=0||i<=0||!m||!m.length)?null:r.createElement(u.m,{className:(0,s.Z)("recharts-cartesian-axis",c),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),f._.renderCallByParent(this.props))}}],o=[{key:"renderTickItem",value:function(e,t,n){return r.isValidElement(e)?r.cloneElement(e,t):a()(e)?e(t):r.createElement(d.x,w({},t,{className:"recharts-cartesian-axis-tick-value"}),n)}}],n&&O(k.prototype,n),o&&O(k,o),Object.defineProperty(k,"prototype",{writable:!1}),k}(r.Component);_(N,"displayName","CartesianAxis"),_(N,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"})},56940:function(e,t,n){"use strict";n.d(t,{q:function(){return P}});var r=n(2265),o=n(86757),a=n.n(o),i=n(1175),l=n(16630),s=n(82944),c=n(85355),u=n(78242),d=n(80285),f=n(25739),p=["x1","y1","x2","y2","key"],h=["offset"];function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var x=function(e){var t=e.fill;if(!t||"none"===t)return null;var n=e.fillOpacity,o=e.x,a=e.y,i=e.width,l=e.height;return r.createElement("rect",{x:o,y:a,width:i,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function w(e,t){var n;if(r.isValidElement(e))n=r.cloneElement(e,t);else if(a()(e))n=e(t);else{var o=t.x1,i=t.y1,l=t.x2,c=t.y2,u=t.key,d=b(t,p),f=(0,s.L6)(d,!1),m=(f.offset,b(f,h));n=r.createElement("line",y({},m,{x1:o,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function k(e){var t=e.x,n=e.width,o=e.horizontal,a=void 0===o||o,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(r,o){return w(a,v(v({},e),{},{x1:t,y1:r,x2:t+n,y2:r,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function S(e){var t=e.y,n=e.height,o=e.vertical,a=void 0===o||o,i=e.verticalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(r,o){return w(a,v(v({},e),{},{x1:r,y1:t,x2:r,y2:t+n,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function E(e){var t=e.horizontalFill,n=e.fillOpacity,o=e.x,a=e.y,i=e.width,l=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(void 0===c||c)||!t||!t.length)return null;var u=s.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,s){var c=u[s+1]?u[s+1]-e:a+l-e;if(c<=0)return null;var d=s%t.length;return r.createElement("rect",{key:"react-".concat(s),y:e,x:o,height:c,width:i,stroke:"none",fill:t[d],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function O(e){var t=e.vertical,n=e.verticalFill,o=e.fillOpacity,a=e.x,i=e.y,l=e.width,s=e.height,c=e.verticalPoints;if(!(void 0===t||t)||!n||!n.length)return null;var u=c.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,t){var c=u[t+1]?u[t+1]-e:a+l-e;if(c<=0)return null;var d=t%n.length;return r.createElement("rect",{key:"react-".concat(t),x:e,y:i,width:c,height:s,stroke:"none",fill:n[d],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var C=function(e,t){var n=e.xAxis,r=e.width,o=e.height,a=e.offset;return(0,c.Rf)((0,u.f)(v(v(v({},d.O.defaultProps),n),{},{ticks:(0,c.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),a.left,a.left+a.width,t)},j=function(e,t){var n=e.yAxis,r=e.width,o=e.height,a=e.offset;return(0,c.Rf)((0,u.f)(v(v(v({},d.O.defaultProps),n),{},{ticks:(0,c.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),a.top,a.top+a.height,t)},_={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function P(e){var t,n,o,s,c,u,d=(0,f.zn)(),p=(0,f.Mw)(),h=(0,f.qD)(),g=v(v({},e),{},{stroke:null!==(t=e.stroke)&&void 0!==t?t:_.stroke,fill:null!==(n=e.fill)&&void 0!==n?n:_.fill,horizontal:null!==(o=e.horizontal)&&void 0!==o?o:_.horizontal,horizontalFill:null!==(s=e.horizontalFill)&&void 0!==s?s:_.horizontalFill,vertical:null!==(c=e.vertical)&&void 0!==c?c:_.vertical,verticalFill:null!==(u=e.verticalFill)&&void 0!==u?u:_.verticalFill}),b=g.x,w=g.y,P=g.width,N=g.height,T=g.xAxis,A=g.yAxis,M=g.syncWithTicks,I=g.horizontalValues,R=g.verticalValues;if(!(0,l.hj)(P)||P<=0||!(0,l.hj)(N)||N<=0||!(0,l.hj)(b)||b!==+b||!(0,l.hj)(w)||w!==+w)return null;var D=g.verticalCoordinatesGenerator||C,L=g.horizontalCoordinatesGenerator||j,Z=g.horizontalPoints,z=g.verticalPoints;if((!Z||!Z.length)&&a()(L)){var B=I&&I.length,F=L({yAxis:A?v(v({},A),{},{ticks:B?I:A.ticks}):void 0,width:d,height:p,offset:h},!!B||M);(0,i.Z)(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(m(F),"]")),Array.isArray(F)&&(Z=F)}if((!z||!z.length)&&a()(D)){var H=R&&R.length,q=D({xAxis:T?v(v({},T),{},{ticks:H?R:T.ticks}):void 0,width:d,height:p,offset:h},!!H||M);(0,i.Z)(Array.isArray(q),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(m(q),"]")),Array.isArray(q)&&(z=q)}return r.createElement("g",{className:"recharts-cartesian-grid"},r.createElement(x,{fill:g.fill,fillOpacity:g.fillOpacity,x:g.x,y:g.y,width:g.width,height:g.height}),r.createElement(k,y({},g,{offset:h,horizontalPoints:Z})),r.createElement(S,y({},g,{offset:h,verticalPoints:z})),r.createElement(E,y({},g,{horizontalPoints:Z})),r.createElement(O,y({},g,{verticalPoints:z})))}P.displayName="CartesianGrid"},13137:function(e,t,n){"use strict";n.d(t,{W:function(){return u}});var r=n(2265),o=n(69398),a=n(9841),i=n(82944),l=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e){var t=e.offset,n=e.layout,u=e.width,d=e.dataKey,f=e.data,p=e.dataPointFormatter,h=e.xAxis,m=e.yAxis,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,l),v=(0,i.L6)(g,!1);"x"===e.direction&&"number"!==h.type&&(0,o.Z)(!1);var y=f.map(function(e){var o,i,l=p(e,d),f=l.x,g=l.y,y=l.value,b=l.errorVal;if(!b)return null;var x=[];if(Array.isArray(b)){var w=function(e){if(Array.isArray(e))return e}(b)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(b,2)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,2)}}(b,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=w[0],i=w[1]}else o=i=b;if("vertical"===n){var k=h.scale,S=g+t,E=S+u,O=S-u,C=k(y-o),j=k(y+i);x.push({x1:j,y1:E,x2:j,y2:O}),x.push({x1:C,y1:S,x2:j,y2:S}),x.push({x1:C,y1:E,x2:C,y2:O})}else if("horizontal"===n){var _=m.scale,P=f+t,N=P-u,T=P+u,A=_(y-o),M=_(y+i);x.push({x1:N,y1:M,x2:T,y2:M}),x.push({x1:P,y1:A,x2:P,y2:M}),x.push({x1:N,y1:A,x2:T,y2:A})}return r.createElement(a.m,s({className:"recharts-errorBar",key:"bar-".concat(x.map(function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))},v),x.map(function(e){return r.createElement("line",s({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))}))});return r.createElement(a.m,{className:"recharts-errorBars"},y)}u.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},u.displayName="ErrorBar"},54061:function(e,t,n){"use strict";n.d(t,{x:function(){return I}});var r=n(2265),o=n(59221),a=n(86757),i=n.n(a),l=n(77571),s=n.n(l),c=n(21652),u=n.n(c),d=n(87602),f=n(57165),p=n(81889),h=n(9841),m=n(58772),g=n(13137),v=n(16630),y=n(82944),b=n(34067),x=n(85355),w=["type","layout","connectNulls","ref"];function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(){return(S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return j(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,M(r.key),r)}}function P(e,t){return(P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function N(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t,n){return(t=M(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}var I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}(c,e);var t,n,a,l=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=T(c);return e=t?Reflect.construct(n,arguments,T(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return N(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return A(N(e=l.call.apply(l,[this].concat(n))),"state",{isAnimationFinished:!0,totalLength:0}),A(N(e),"generateSimpleStrokeDasharray",function(e,t){return"".concat(t,"px ").concat(e-t,"px")}),A(N(e),"getStrokeDasharray",function(t,n,r){var o=r.reduce(function(e,t){return e+t});if(!o)return e.generateSimpleStrokeDasharray(n,t);for(var a=t%o,i=n-t,l=[],s=0,u=0;s<r.length;u+=r[s],++s)if(u+r[s]>a){l=[].concat(C(r.slice(0,s)),[a-u]);break}var d=l.length%2==0?[0,i]:[i];return[].concat(C(c.repeat(r,Math.floor(t/o))),C(l),d).map(function(e){return"".concat(e,"px")}).join(", ")}),A(N(e),"id",(0,v.EL)("recharts-line-")),A(N(e),"pathRef",function(t){e.mainCurve=t}),A(N(e),"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),A(N(e),"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return n=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.points,a=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,y.NN)(s,g.W);if(!c)return null;var u=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:(0,x.F$)(e.payload,t)}};return r.createElement(h.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:o,xAxis:a,yAxis:i,layout:l,dataPointFormatter:u})}))}},{key:"renderDots",value:function(e,t,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.dot,i=o.points,l=o.dataKey,s=(0,y.L6)(this.props,!1),u=(0,y.L6)(a,!0),d=i.map(function(e,t){var n=O(O(O({key:"dot-".concat(t),r:3},s),u),{},{value:e.value,dataKey:l,cx:e.x,cy:e.y,index:t,payload:e.payload});return c.renderDotItem(a,n)}),f={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return r.createElement(h.m,S({className:"recharts-line-dots",key:"dots"},f),d)}},{key:"renderCurveStatically",value:function(e,t,n,o){var a=this.props,i=a.type,l=a.layout,s=a.connectNulls,c=(a.ref,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,w)),u=O(O(O({},(0,y.L6)(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},o),{},{type:i,layout:l,connectNulls:s});return r.createElement(f.H,S({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,a=this.props,i=a.points,l=a.strokeDasharray,s=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,p=a.animateNewValues,h=a.width,m=a.height,g=this.state,y=g.prevPoints,b=g.totalLength;return r.createElement(o.ZP,{begin:c,duration:u,isActive:s,easing:d,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o,a=r.t;if(y){var s=y.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(y[n]){var r=y[n],o=(0,v.k4)(r.x,e.x),i=(0,v.k4)(r.y,e.y);return O(O({},e),{},{x:o(a),y:i(a)})}if(p){var l=(0,v.k4)(2*h,e.x),c=(0,v.k4)(m/2,e.y);return O(O({},e),{},{x:l(a),y:c(a)})}return O(O({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var u=(0,v.k4)(0,b)(a);if(l){var d="".concat(l).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});o=n.getStrokeDasharray(u,b,d)}else o=n.generateSimpleStrokeDasharray(b,u);return n.renderCurveStatically(i,e,t,{strokeDasharray:o})})}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,o=n.isAnimationActive,a=this.state,i=a.prevPoints,l=a.totalLength;return o&&r&&r.length&&(!i&&l>0||!u()(i,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,o=t.dot,a=t.points,i=t.className,l=t.xAxis,c=t.yAxis,u=t.top,f=t.left,p=t.width,g=t.height,v=t.isAnimationActive,b=t.id;if(n||!a||!a.length)return null;var x=this.state.isAnimationFinished,w=1===a.length,k=(0,d.Z)("recharts-line",i),S=l&&l.allowDataOverflow,E=c&&c.allowDataOverflow,O=S||E,C=s()(b)?this.id:b,j=null!==(e=(0,y.L6)(o,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,y.$k)(o)?o:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return r.createElement(h.m,{className:k},S||E?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(C)},r.createElement("rect",{x:S?f:f-p/2,y:E?u:u-g/2,width:S?p:2*p,height:E?g:2*g})),!T&&r.createElement("clipPath",{id:"clipPath-dots-".concat(C)},r.createElement("rect",{x:f-A/2,y:u-A/2,width:p+A,height:g+A}))):null,!w&&this.renderCurve(O,C),this.renderErrorBar(O,C),(w||o)&&this.renderDots(O,T,C),(!v||x)&&m.e.renderCallByParent(this.props,a))}}],a=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!=0?[].concat(C(e),[0]):e,r=[],o=0;o<t;++o)r=[].concat(C(r),C(n));return r}},{key:"renderDotItem",value:function(e,t){var n;if(r.isValidElement(e))n=r.cloneElement(e,t);else if(i()(e))n=e(t);else{var o=(0,d.Z)("recharts-line-dot",e?e.className:"");n=r.createElement(p.o,S({},t,{className:o}))}return n}}],n&&_(c.prototype,n),a&&_(c,a),Object.defineProperty(c,"prototype",{writable:!1}),c}(r.PureComponent);A(I,"displayName","Line"),A(I,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!b.x.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),A(I,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,i=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout;return O({points:c.map(function(e,t){var c=(0,x.F$)(e,i);return"horizontal"===d?{x:(0,x.Hv)({axis:n,ticks:o,bandSize:l,entry:e,index:t}),y:s()(c)?null:r.scale(c),value:c,payload:e}:{x:s()(c)?null:n.scale(c),y:(0,x.Hv)({axis:r,ticks:a,bandSize:l,entry:e,index:t}),value:c,payload:e}}),layout:d},u)})},97059:function(e,t,n){"use strict";n.d(t,{K:function(){return c}});var r=n(2265),o=n(87602),a=n(25739),i=n(80285),l=n(85355);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=function(e){var t=e.xAxisId,n=(0,a.zn)(),c=(0,a.Mw)(),u=(0,a.bH)(t);return null==u?null:r.createElement(i.O,s({},u,{className:(0,o.Z)("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:n,height:c},ticksGenerator:function(e){return(0,l.uY)(e,!0)}}))};c.displayName="XAxis",c.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0}},62994:function(e,t,n){"use strict";n.d(t,{B:function(){return c}});var r=n(2265),o=n(87602),a=n(25739),i=n(80285),l=n(85355);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=function(e){var t=e.yAxisId,n=(0,a.zn)(),c=(0,a.Mw)(),u=(0,a.Ud)(t);return null==u?null:r.createElement(i.O,s({},u,{className:(0,o.Z)("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:n,height:c},ticksGenerator:function(e){return(0,l.uY)(e,!0)}}))};c.displayName="YAxis",c.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1}},78242:function(e,t,n){"use strict";n.d(t,{f:function(){return h}});var r=n(86757),o=n.n(r),a=n(16630),i=n(4094),l=n(34067),s=n(25311);function c(e,t,n){if(t<1)return[];if(1===t&&void 0===n)return e;for(var r=[],o=0;o<e.length;o+=t){if(void 0!==n&&!0!==n(e[o]))return;r.push(e[o])}return r}function u(e,t,n,r,o){if(e*t<e*r||e*t>e*o)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-o)<=0}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){var r,d,f,h,m,g=e.tick,v=e.ticks,y=e.viewBox,b=e.minTickGap,x=e.orientation,w=e.interval,k=e.tickFormatter,S=e.unit,E=e.angle;if(!v||!v.length||!g)return[];if((0,a.hj)(w)||l.x.isSsr)return c(v,("number"==typeof w&&(0,a.hj)(w)?w:0)+1);var O="top"===x||"bottom"===x?"width":"height",C=S&&"width"===O?(0,i.xE)(S,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=function(e,r){var a,l,c=o()(k)?k(e.value,r):e.value;return"width"===O?(l={width:(a=(0,i.xE)(c,{fontSize:t,letterSpacing:n})).width+C.width,height:a.height+C.height},(0,s.xE)(l,E)):(0,i.xE)(c,{fontSize:t,letterSpacing:n})[O]},_=v.length>=2?(0,a.uY)(v[1].coordinate-v[0].coordinate):1,P=(r="width"===O,d=y.x,f=y.y,h=y.width,m=y.height,1===_?{start:r?d:f,end:r?d+h:f+m}:{start:r?d+h:f+m,end:r?d:f});return"equidistantPreserveStart"===w?function(e,t,n,r,o){for(var a,i=(r||[]).slice(),l=t.start,s=t.end,d=0,f=1,p=l;f<=i.length;)if(a=function(){var t,a=null==r?void 0:r[d];if(void 0===a)return{v:c(r,f)};var i=d,h=function(){return void 0===t&&(t=n(a,i)),t},m=a.coordinate,g=0===d||u(e,m,h,p,s);g||(d=0,p=l,f+=1),g&&(p=m+e*(h()/2+o),d+=f)}())return a.v;return[]}(_,P,j,v,b):("preserveStart"===w||"preserveStartEnd"===w?function(e,t,n,r,o,a){var i=(r||[]).slice(),l=i.length,s=t.start,c=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-c);i[l-1]=d=p(p({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),u(e,d.tickCoord,function(){return f},s,c)&&(c=d.tickCoord-e*(f/2+o),i[l-1]=p(p({},d),{},{isShow:!0}))}for(var m=a?l-1:l,g=function(t){var r,a=i[t],l=function(){return void 0===r&&(r=n(a,t)),r};if(0===t){var d=e*(a.coordinate-e*l()/2-s);i[t]=a=p(p({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else i[t]=a=p(p({},a),{},{tickCoord:a.coordinate});u(e,a.tickCoord,l,s,c)&&(s=a.tickCoord+e*(l()/2+o),i[t]=p(p({},a),{},{isShow:!0}))},v=0;v<m;v++)g(v);return i}(_,P,j,v,b,"preserveStartEnd"===w):function(e,t,n,r,o){for(var a=(r||[]).slice(),i=a.length,l=t.start,s=t.end,c=function(t){var r,c=a[t],d=function(){return void 0===r&&(r=n(c,t)),r};if(t===i-1){var f=e*(c.coordinate+e*d()/2-s);a[t]=c=p(p({},c),{},{tickCoord:f>0?c.coordinate-f*e:c.coordinate})}else a[t]=c=p(p({},c),{},{tickCoord:c.coordinate});u(e,c.tickCoord,d,l,s)&&(s=c.tickCoord-e*(d()/2+o),a[t]=p(p({},c),{},{isShow:!0}))},d=i-1;d>=0;d--)c(d);return a}(_,P,j,v,b)).filter(function(e){return e.isShow})}},93765:function(e,t,n){"use strict";n.d(t,{z:function(){return tx}});var r=n(2265),o=n(77571),a=n.n(o),i=n(86757),l=n.n(i),s=n(99676),c=n.n(s),u=n(13735),d=n.n(u),f=n(34935),p=n.n(f),h=n(37065),m=n.n(h),g=n(84173),v=n.n(g),y=n(32242),b=n.n(y),x=n(87602),w=n(69398),k=n(48777),S=n(9841),E=n(8147),O=n(22190),C=n(81889),j=n(73649),_=n(82944),P=n(55284),N=n(58811),T=n(85355),A=n(16630);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t,n){var r;return(r=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===M(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var L=["Webkit","Moz","O","ms"],Z=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=L.reduce(function(e,r){return R(R({},e),{},D({},r+n,t))},{});return r[e]=t,r};function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(){return(B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach(function(t){$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V(r.key),r)}}function W(e,t){return(W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function U(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t,n){return(t=V(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e){var t=function(e,t){if("object"!==z(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==z(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===z(t)?t:String(t)}var X=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,o=e.x,a=e.width,i=e.travellerWidth;if(!t||!t.length)return{};var l=t.length,s=(0,P.x)().domain(c()(0,l)).range([o,o+a-i]),u=s.domain().map(function(e){return s(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:s(n),endX:s(r),scale:s,scaleValues:u}},G=function(e){return e.changedTouches&&!!e.changedTouches.length},Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(i,e);var t,n,o,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=K(i);return e=t?Reflect.construct(n,arguments,K(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===z(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return U(e)}(this,e)});function i(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),$(U(t=a.call(this,e)),"handleDrag",function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)}),$(U(t),"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])}),$(U(t),"handleDragEnd",function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=t.props,n=e.endIndex,r=e.onDragEnd,o=e.startIndex;null==r||r({endIndex:n,startIndex:o})}),t.detachDragEndListener()}),$(U(t),"handleLeaveWrapper",function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))}),$(U(t),"handleEnterSlideOrTraveller",function(){t.setState({isTextActive:!0})}),$(U(t),"handleLeaveSlideOrTraveller",function(){t.setState({isTextActive:!1})}),$(U(t),"handleSlideDragStart",function(e){var n=G(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:n.pageX}),t.attachDragEndListener()}),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(U(t),"startX"),endX:t.handleTravellerDragStart.bind(U(t),"endX")},t.state={},t}return n=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,n=e.endX,r=this.state.scaleValues,o=this.props,a=o.gap,l=o.data.length-1,s=i.getIndexInRange(r,Math.min(t,n)),c=i.getIndexInRange(r,Math.max(t,n));return{startIndex:s-s%a,endIndex:c===l?l:c-c%a}}},{key:"getTextOfTick",value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,o=t.dataKey,a=(0,T.F$)(n[e],o,e);return l()(r)?r(a,e):a}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,o=t.endX,a=this.props,i=a.x,l=a.width,s=a.travellerWidth,c=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,i+l-s-o,i+l-s-r):f<0&&(f=Math.max(f,i-r,i-o));var p=this.getIndex({startX:r+f,endX:o+f});(p.startIndex!==c||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:o+f,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var n=G(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,n=this.state,r=n.brushMoveStartX,o=n.movingTravellerId,a=n.endX,i=n.startX,l=this.state[o],s=this.props,c=s.x,u=s.width,d=s.travellerWidth,f=s.onChange,p=s.gap,h=s.data,m={startX:this.state.startX,endX:this.state.endX},g=e.pageX-r;g>0?g=Math.min(g,c+u-d-l):g<0&&(g=Math.max(g,c-l)),m[o]=l+g;var v=this.getIndex(m),y=v.startIndex,b=v.endIndex,x=function(){var e=h.length-1;return"startX"===o&&(a>i?y%p==0:b%p==0)||a<i&&b===e||"endX"===o&&(a>i?b%p==0:y%p==0)||a>i&&b===e};this.setState(($(t={},o,l+g),$(t,"brushMoveStartX",e.pageX),t),function(){f&&x()&&f(v)})}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var n=this,r=this.state,o=r.scaleValues,a=r.startX,i=r.endX,l=this.state[t],s=o.indexOf(l);if(-1!==s){var c=s+e;if(-1!==c&&!(c>=o.length)){var u=o[c];"startX"===t&&u>=i||"endX"===t&&u<=a||this.setState($({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.fill,l=e.stroke;return r.createElement("rect",{stroke:l,fill:i,x:t,y:n,width:o,height:a})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.data,l=e.children,s=e.padding,c=r.Children.only(l);return c?r.cloneElement(c,{x:t,y:n,width:o,height:a,margin:s,compact:!0,data:i}):null}},{key:"renderTravellerLayer",value:function(e,t){var n=this,o=this.props,a=o.y,l=o.travellerWidth,s=o.height,c=o.traveller,u=o.ariaLabel,d=o.data,f=o.startIndex,p=o.endIndex,h=Math.max(e,this.props.x),m=H(H({},(0,_.L6)(this.props,!1)),{},{x:h,y:a,width:l,height:s}),g=u||"Min value: ".concat(d[f].name,", Max value: ").concat(d[p].name);return r.createElement(S.m,{tabIndex:0,role:"slider","aria-label":g,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),n.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){n.setState({isTravellerFocused:!0})},onBlur:function(){n.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},i.renderTraveller(c,m))}},{key:"renderSlide",value:function(e,t){var n=this.props,o=n.y,a=n.height,i=n.stroke,l=n.travellerWidth;return r.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:i,fillOpacity:.2,x:Math.min(e,t)+l,y:o,width:Math.max(Math.abs(t-e)-l,0),height:a})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,o=e.y,a=e.height,i=e.travellerWidth,l=e.stroke,s=this.state,c=s.startX,u=s.endX,d={pointerEvents:"none",fill:l};return r.createElement(S.m,{className:"recharts-brush-texts"},r.createElement(N.x,B({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,u)-5,y:o+a/2},d),this.getTextOfTick(t)),r.createElement(N.x,B({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,u)+i+5,y:o+a/2},d),this.getTextOfTick(n)))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.className,o=e.children,a=e.x,i=e.y,l=e.width,s=e.height,c=e.alwaysShowText,u=this.state,d=u.startX,f=u.endX,p=u.isTextActive,h=u.isSlideMoving,m=u.isTravellerMoving,g=u.isTravellerFocused;if(!t||!t.length||!(0,A.hj)(a)||!(0,A.hj)(i)||!(0,A.hj)(l)||!(0,A.hj)(s)||l<=0||s<=0)return null;var v=(0,x.Z)("recharts-brush",n),y=1===r.Children.count(o),b=Z("userSelect","none");return r.createElement(S.m,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),y&&this.renderPanorama(),this.renderSlide(d,f),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(f,"endX"),(p||h||m||g||c)&&this.renderText())}}],o=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,n=e.y,o=e.width,a=e.height,i=e.stroke,l=Math.floor(n+a/2)-1;return r.createElement(r.Fragment,null,r.createElement("rect",{x:t,y:n,width:o,height:a,fill:i,stroke:"none"}),r.createElement("line",{x1:t+1,y1:l,x2:t+o-1,y2:l,fill:"none",stroke:"#fff"}),r.createElement("line",{x1:t+1,y1:l+2,x2:t+o-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):i.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var n=e.data,r=e.width,o=e.x,a=e.travellerWidth,i=e.updateId,l=e.startIndex,s=e.endIndex;if(n!==t.prevData||i!==t.prevUpdateId)return H({prevData:n,prevTravellerWidth:a,prevUpdateId:i,prevX:o,prevWidth:r},n&&n.length?X({data:n,width:r,x:o,travellerWidth:a,startIndex:l,endIndex:s}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||o!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([o,o+r-a]);var c=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:i,prevX:o,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:c}}return null}},{key:"getIndexInRange",value:function(e,t){for(var n=e.length,r=0,o=n-1;o-r>1;){var a=Math.floor((r+o)/2);e[a]>t?o=a:r=a}return t>=e[o]?o:r}}],n&&q(i.prototype,n),o&&q(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}(r.PureComponent);$(Y,"displayName","Brush"),$(Y,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Q=n(4094),J=n(38569),ee=n(26680),et=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r="extendDomain"),r===t},en=n(25311),er=n(1175);function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ea(){return(ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eo(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eo(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var es=function(e){var t=e.x,n=e.y,r=e.xAxis,o=e.yAxis,a=(0,en.Ky)({x:r.scale,y:o.scale}),i=a.apply({x:t,y:n},{bandAware:!0});return et(e,"discard")&&!a.isInRange(i)?null:i};function ec(e){var t=e.x,n=e.y,o=e.r,a=e.alwaysShow,i=e.clipPathId,l=(0,A.P2)(t),s=(0,A.P2)(n);if((0,er.Z)(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!l||!s)return null;var c=es(e);if(!c)return null;var u=c.x,d=c.y,f=e.shape,p=e.className,h=el(el({clipPath:et(e,"hidden")?"url(#".concat(i,")"):void 0},(0,_.L6)(e,!0)),{},{cx:u,cy:d});return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-dot",p)},ec.renderDot(f,h),ee._.renderCallByParent(e,{x:u-o,y:d-o,width:2*o,height:2*o}))}ec.displayName="ReferenceDot",ec.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1},ec.renderDot=function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):r.createElement(C.o,ea({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))};var eu=n(33645),ed=n.n(eu),ef=n(25739);function ep(e){return(ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function em(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eh(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ep(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ep(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ev(){return(ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ey=function(e,t,n,r,o,a,i,l,s){var c=o.x,u=o.y,d=o.width,f=o.height;if(n){var p=s.y,h=e.y.apply(p,{position:a});if(et(s,"discard")&&!e.y.isInRange(h))return null;var m=[{x:c+d,y:h},{x:c,y:h}];return"left"===l?m.reverse():m}if(t){var g=s.x,v=e.x.apply(g,{position:a});if(et(s,"discard")&&!e.x.isInRange(v))return null;var y=[{x:v,y:u+f},{x:v,y:u}];return"top"===i?y.reverse():y}if(r){var b=s.segment.map(function(t){return e.apply(t,{position:a})});return et(s,"discard")&&ed()(b,function(t){return!e.isInRange(t)})?null:b}return null};function eb(e){var t,n,o=e.x,a=e.y,i=e.segment,s=e.xAxisId,c=e.yAxisId,u=e.shape,d=e.className,f=e.alwaysShow,p=(0,ef.sp)(),h=(0,ef.bH)(s),m=(0,ef.Ud)(c),g=(0,ef.d2)();if(!p||!g)return null;(0,er.Z)(void 0===f,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=ey((0,en.Ky)({x:h.scale,y:m.scale}),(0,A.P2)(o),(0,A.P2)(a),i&&2===i.length,g,e.position,h.orientation,m.orientation,e);if(!v)return null;var y=function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(v,2)||function(e,t){if(e){if("string"==typeof e)return eg(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,2)}}(v,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],w=b.x,k=b.y,E=y[1],O=E.x,C=E.y,j=em(em({clipPath:et(e,"hidden")?"url(#".concat(p,")"):void 0},(0,_.L6)(e,!0)),{},{x1:w,y1:k,x2:O,y2:C});return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-line",d)},(t=u,n=j,r.isValidElement(t)?r.cloneElement(t,n):l()(t)?t(n):r.createElement("line",ev({},n,{className:"recharts-reference-line-line"}))),ee._.renderCallByParent(e,(0,en._b)({x1:w,y1:k,x2:O,y2:C})))}function ex(e){return(ex="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(){return(ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==ex(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ex(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ex(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}eb.displayName="ReferenceLine",eb.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"};var eE=function(e,t,n,r,o){var a=o.x1,i=o.x2,l=o.y1,s=o.y2,c=o.xAxis,u=o.yAxis;if(!c||!u)return null;var d=(0,en.Ky)({x:c.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(l,{position:"start"}):d.y.rangeMin},p={x:t?d.x.apply(i,{position:"end"}):d.x.rangeMax,y:r?d.y.apply(s,{position:"end"}):d.y.rangeMax};return!et(o,"discard")||d.isInRange(f)&&d.isInRange(p)?(0,en.O1)(f,p):null};function eO(e){var t=e.x1,n=e.x2,o=e.y1,a=e.y2,i=e.className,l=e.alwaysShow,s=e.clipPathId;(0,er.Z)(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var c=(0,A.P2)(t),u=(0,A.P2)(n),d=(0,A.P2)(o),f=(0,A.P2)(a),p=e.shape;if(!c&&!u&&!d&&!f&&!p)return null;var h=eE(c,u,d,f,e);if(!h&&!p)return null;var m=et(e,"hidden")?"url(#".concat(s,")"):void 0;return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-area",i)},eO.renderRect(p,eS(eS({clipPath:m},(0,_.L6)(e,!0)),h)),ee._.renderCallByParent(e,h))}function eC(e){return function(e){if(Array.isArray(e))return ej(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ej(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ej(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}eO.displayName="ReferenceArea",eO.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1},eO.renderRect=function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):r.createElement(j.A,ew({},t,{className:"recharts-reference-area-rect"}))};var e_=function(e,t,n,r,o){var a=(0,_.NN)(e,eb),i=(0,_.NN)(e,ec),l=[].concat(eC(a),eC(i)),s=(0,_.NN)(e,eO),c="".concat(r,"Id"),u=r[0],d=t;if(l.length&&(d=l.reduce(function(e,t){if(t.props[c]===n&&et(t.props,"extendDomain")&&(0,A.hj)(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),s.length){var f="".concat(u,"1"),p="".concat(u,"2");d=s.reduce(function(e,t){if(t.props[c]===n&&et(t.props,"extendDomain")&&(0,A.hj)(t.props[f])&&(0,A.hj)(t.props[p])){var r=t.props[f],o=t.props[p];return[Math.min(e[0],r,o),Math.max(e[1],r,o)]}return e},d)}return o&&o.length&&(d=o.reduce(function(e,t){return(0,A.hj)(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},eP=n(39206),eN=n(46485),eT=n(77625),eA=new(n.n(eT)()),eM="recharts.syncMouseEvents",eI=n(41637);function eR(e){return(eR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eD(e,t,n){return(t=eL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eL(e){var t=function(e,t){if("object"!==eR(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eR(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eR(t)?t:String(t)}var eZ=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),eD(this,"activeIndex",0),eD(this,"coordinateList",[]),eD(this,"layout","horizontal")}return e=[{key:"setDetails",value:function(e){var t,n=e.coordinateList,r=void 0===n?null:n,o=e.container,a=void 0===o?null:o,i=e.layout,l=void 0===i?null:i,s=e.offset,c=void 0===s?null:s,u=e.mouseHandlerCallback,d=void 0===u?null:u;this.coordinateList=null!==(t=null!=r?r:this.coordinateList)&&void 0!==t?t:[],this.container=null!=a?a:this.container,this.layout=null!=l?l:this.layout,this.offset=null!=c?c:this.offset,this.mouseHandlerCallback=null!=d?d:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"setIndex",value:function(e){this.activeIndex=e}},{key:"spoofMouse",value:function(){if("horizontal"===this.layout&&0!==this.coordinateList.length){var e,t,n=this.container.getBoundingClientRect(),r=n.x,o=n.y,a=n.height,i=this.coordinateList[this.activeIndex].coordinate,l=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,s=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,c=o+this.offset.top+a/2+s;this.mouseHandlerCallback({pageX:r+i+l,pageY:c})}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eL(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),ez=n(11638),eB=n(57165);function eF(e){return(eF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eH=["x","y","top","left","width","height","className"];function eq(){return(eq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var eU=function(e){var t=e.x,n=void 0===t?0:t,o=e.y,a=void 0===o?0:o,i=e.top,l=void 0===i?0:i,s=e.left,c=void 0===s?0:s,u=e.width,d=void 0===u?0:u,f=e.height,p=void 0===f?0:f,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eW(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eF(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eF(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eF(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({x:n,y:a,top:l,left:c,width:d,height:p},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eH));return(0,A.hj)(n)&&(0,A.hj)(a)&&(0,A.hj)(d)&&(0,A.hj)(p)&&(0,A.hj)(l)&&(0,A.hj)(c)?r.createElement("path",eq({},(0,_.L6)(m,!0),{className:(0,x.Z)("recharts-cross",h),d:"M".concat(n,",").concat(l,"v").concat(p,"M").concat(c,",").concat(a,"h").concat(d)})):null};function eK(e){var t=e.cx,n=e.cy,r=e.radius,o=e.startAngle,a=e.endAngle;return{points:[(0,eP.op)(t,n,r,o),(0,eP.op)(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:o,endAngle:a}}var e$=n(60474);function eV(e){return(eV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eX(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eV(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eV(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eV(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eY(e){var t,n,o=e.element,a=e.tooltipEventType,i=e.isActive,l=e.activeCoordinate,s=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,p=e.chartName;if(!o||!o.props.cursor||!i||!l||"ScatterChart"!==p&&"axis"!==a)return null;var h=eB.H;if("ScatterChart"===p)n=l,h=eU;else if("BarChart"===p)t=d/2,n={stroke:"none",fill:"#ccc",x:"horizontal"===f?l.x-t:c.left+.5,y:"horizontal"===f?c.top+.5:l.y-t,width:"horizontal"===f?d:c.width-1,height:"horizontal"===f?c.height-1:d},h=j.A;else if("radial"===f){var m=eK(l),g=m.cx,v=m.cy,y=m.radius;n={cx:g,cy:v,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:y,outerRadius:y},h=e$.L}else n={points:function(e,t,n){var r,o,a,i;if("horizontal"===e)a=r=t.x,o=n.top,i=n.top+n.height;else if("vertical"===e)i=o=t.y,r=n.left,a=n.left+n.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return eK(t);var l=t.cx,s=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.angle,f=(0,eP.op)(l,s,c,d),p=(0,eP.op)(l,s,u,d);r=f.x,o=f.y,a=p.x,i=p.y}return[{x:r,y:o},{x:a,y:i}]}(f,l,c)},h=eB.H;var b=eG(eG(eG(eG({stroke:"#ccc",pointerEvents:"none"},c),n),(0,_.L6)(o.props.cursor,!1)),{},{payload:s,payloadIndex:u,className:"recharts-tooltip-cursor"});return(0,r.isValidElement)(o.props.cursor)?(0,r.cloneElement)(o.props.cursor,b):(0,r.createElement)(h,b)}var eQ=["item"],eJ=["children","className","width","height","style","compact","title","desc"];function e0(e){return(e0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e1(){return(e1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function e2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||e7(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e6(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function e4(e,t){return(e4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function e3(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e5(e){return(e5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e8(e){return function(e){if(Array.isArray(e))return e9(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||e7(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e7(e,t){if(e){if("string"==typeof e)return e9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e9(e,t)}}function e9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){tn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tn(e,t,n){return(t=tr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(e){var t=function(e,t){if("object"!==e0(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==e0(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===e0(t)?t:String(t)}var to={xAxis:["bottom","top"],yAxis:["left","right"]},ta={width:"100%",height:"100%"},ti={x:0,y:0};function tl(e){return e}var ts=function(e,t,n,r){var o=t.find(function(e){return e&&e.index===n});if(o){if("horizontal"===e)return{x:o.coordinate,y:r.y};if("vertical"===e)return{x:r.x,y:o.coordinate};if("centric"===e){var a=o.coordinate,i=r.radius;return tt(tt(tt({},r),(0,eP.op)(r.cx,r.cy,i,a)),{},{angle:a,radius:i})}var l=o.coordinate,s=r.angle;return tt(tt(tt({},r),(0,eP.op)(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}return ti},tc=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,o=t.dataEndIndex,a=(null!=n?n:[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(e8(e),e8(n)):e},[]);return a.length>0?a:e&&e.length&&(0,A.hj)(r)&&(0,A.hj)(o)?e.slice(r,o+1):[]};function tu(e){return"number"===e?[0,"auto"]:void 0}var td=function(e,t,n,r){var o=e.graphicalItems,a=e.tooltipAxis,i=tc(t,e);return n<0||!o||!o.length||n>=i.length?null:o.reduce(function(o,l){var s,c,u=null!==(s=l.props.data)&&void 0!==s?s:t;if(u&&e.dataStartIndex+e.dataEndIndex!==0&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),a.dataKey&&!a.allowDuplicatedCategory){var d=void 0===u?i:u;c=(0,A.Ap)(d,a.dataKey,r)}else c=u&&u[n]||i[n];return c?[].concat(e8(o),[(0,T.Qo)(l,c)]):o},[])},tf=function(e,t,n,r){var o=r||{x:e.chartX,y:e.chartY},a="horizontal"===n?o.x:"vertical"===n?o.y:"centric"===n?o.angle:o.radius,i=e.orderedTooltipTicks,l=e.tooltipAxis,s=e.tooltipTicks,c=(0,T.VO)(a,i,s,l);if(c>=0&&s){var u=s[c]&&s[c].value,d=td(e,t,c,u),f=ts(n,i,c,o);return{activeTooltipIndex:c,activeLabel:u,activePayload:d,activeCoordinate:f}}return null},tp=function(e,t){var n=t.axes,r=t.graphicalItems,o=t.axisType,i=t.axisIdKey,l=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,d=e.layout,f=e.children,p=e.stackOffset,h=(0,T.NA)(d,o);return n.reduce(function(t,n){var m=n.props,g=m.type,v=m.dataKey,y=m.allowDataOverflow,b=m.allowDuplicatedCategory,x=m.scale,w=m.ticks,k=m.includeHidden,S=n.props[i];if(t[S])return t;var E=tc(e.data,{graphicalItems:r.filter(function(e){return e.props[i]===S}),dataStartIndex:s,dataEndIndex:u}),O=E.length;(function(e,t,n){if("number"===n&&!0===t&&Array.isArray(e)){var r=null==e?void 0:e[0],o=null==e?void 0:e[1];if(r&&o&&(0,A.hj)(r)&&(0,A.hj)(o))return!0}return!1})(n.props.domain,y,g)&&(_=(0,T.LG)(n.props.domain,null,y),h&&("number"===g||"auto"!==x)&&(N=(0,T.gF)(E,v,"category")));var C=tu(g);if(!_||0===_.length){var j,_,P,N,M,I=null!==(M=n.props.domain)&&void 0!==M?M:C;if(v){if(_=(0,T.gF)(E,v,g),"category"===g&&h){var R=(0,A.bv)(_);b&&R?(P=_,_=c()(0,O)):b||(_=(0,T.ko)(I,_,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(e8(e),[t])},[]))}else if("category"===g)_=b?_.filter(function(e){return""!==e&&!a()(e)}):(0,T.ko)(I,_,n).reduce(function(e,t){return e.indexOf(t)>=0||""===t||a()(t)?e:[].concat(e8(e),[t])},[]);else if("number"===g){var D=(0,T.ZI)(E,r.filter(function(e){return e.props[i]===S&&(k||!e.props.hide)}),v,o,d);D&&(_=D)}h&&("number"===g||"auto"!==x)&&(N=(0,T.gF)(E,v,"category"))}else _=h?c()(0,O):l&&l[S]&&l[S].hasStack&&"number"===g?"expand"===p?[0,1]:(0,T.EB)(l[S].stackGroups,s,u):(0,T.s6)(E,r.filter(function(e){return e.props[i]===S&&(k||!e.props.hide)}),g,d,!0);"number"===g?(_=e_(f,_,S,o,w),I&&(_=(0,T.LG)(I,_,y))):"category"===g&&I&&_.every(function(e){return I.indexOf(e)>=0})&&(_=I)}return tt(tt({},t),{},tn({},S,tt(tt({},n.props),{},{axisType:o,domain:_,categoricalDomain:N,duplicateDomain:P,originalDomain:null!==(j=n.props.domain)&&void 0!==j?j:C,isCategorical:h,layout:d})))},{})},th=function(e,t){var n=t.graphicalItems,r=t.Axis,o=t.axisType,a=t.axisIdKey,i=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,u=e.layout,f=e.children,p=tc(e.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:s}),h=p.length,m=(0,T.NA)(u,o),g=-1;return n.reduce(function(e,t){var v,y=t.props[a],b=tu("number");return e[y]?e:(g++,v=m?c()(0,h):i&&i[y]&&i[y].hasStack?e_(f,v=(0,T.EB)(i[y].stackGroups,l,s),y,o):e_(f,v=(0,T.LG)(b,(0,T.s6)(p,n.filter(function(e){return e.props[a]===y&&!e.props.hide}),"number",u),r.defaultProps.allowDataOverflow),y,o),tt(tt({},e),{},tn({},y,tt(tt({axisType:o},r.defaultProps),{},{hide:!0,orientation:d()(to,"".concat(o,".").concat(g%2),null),domain:v,originalDomain:b,isCategorical:m,layout:u}))))},{})},tm=function(e,t){var n=t.axisType,r=void 0===n?"xAxis":n,o=t.AxisComp,a=t.graphicalItems,i=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,c=e.children,u="".concat(r,"Id"),d=(0,_.NN)(c,o),f={};return d&&d.length?f=tp(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:l,dataEndIndex:s}):a&&a.length&&(f=th(e,{Axis:o,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:l,dataEndIndex:s})),f},tg=function(e){var t=(0,A.Kt)(e),n=(0,T.uY)(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:p()(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:(0,T.zT)(t,n)}},tv=function(e){var t=e.children,n=e.defaultShowTooltip,r=(0,_.sP)(t,Y),o=0,a=0;return e.data&&0!==e.data.length&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(o=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},ty=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},tb=function(e,t){var n=e.props,r=e.graphicalItems,o=e.xAxisMap,a=void 0===o?{}:o,i=e.yAxisMap,l=void 0===i?{}:i,s=n.width,c=n.height,u=n.children,f=n.margin||{},p=(0,_.sP)(u,Y),h=(0,_.sP)(u,O.D),m=Object.keys(l).reduce(function(e,t){var n=l[t],r=n.orientation;return n.mirror||n.hide?e:tt(tt({},e),{},tn({},r,e[r]+n.width))},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return n.mirror||n.hide?e:tt(tt({},e),{},tn({},r,d()(e,"".concat(r))+n.height))},{top:f.top||0,bottom:f.bottom||0}),v=tt(tt({},g),m),y=v.bottom;p&&(v.bottom+=p.props.height||Y.defaultProps.height),h&&t&&(v=(0,T.By)(v,r,n,t));var b=s-v.left-v.right,x=c-v.top-v.bottom;return tt(tt({brushBottom:y},v),{},{width:Math.max(b,0),height:Math.max(x,0)})},tx=function(e){var t,n=e.chartName,o=e.GraphicalChild,i=e.defaultTooltipEventType,s=void 0===i?"axis":i,c=e.validateTooltipEventTypes,u=void 0===c?["axis"]:c,f=e.axisComponents,p=e.legendContent,h=e.formatAxisMap,g=e.defaultProps,y=function(e,t){var n=t.graphicalItems,r=t.stackGroups,o=t.offset,i=t.updateId,l=t.dataStartIndex,s=t.dataEndIndex,c=e.barSize,u=e.layout,d=e.barGap,p=e.barCategoryGap,h=e.maxBarSize,m=ty(u),g=m.numericAxisName,v=m.cateAxisName,y=!!n&&!!n.length&&n.some(function(e){var t=(0,_.Gf)(e&&e.type);return t&&t.indexOf("Bar")>=0})&&(0,T.pt)({barSize:c,stackGroups:r}),b=[];return n.forEach(function(n,c){var m,x=tc(e.data,{graphicalItems:[n],dataStartIndex:l,dataEndIndex:s}),k=n.props,S=k.dataKey,E=k.maxBarSize,O=n.props["".concat(g,"Id")],C=n.props["".concat(v,"Id")],j=f.reduce(function(e,r){var o,a=t["".concat(r.axisType,"Map")],i=n.props["".concat(r.axisType,"Id")];a&&a[i]||"zAxis"===r.axisType||(0,w.Z)(!1);var l=a[i];return tt(tt({},e),{},(tn(o={},r.axisType,l),tn(o,"".concat(r.axisType,"Ticks"),(0,T.uY)(l)),o))},{}),P=j[v],N=j["".concat(v,"Ticks")],A=r&&r[O]&&r[O].hasStack&&(0,T.O3)(n,r[O].stackGroups),M=(0,_.Gf)(n.type).indexOf("Bar")>=0,I=(0,T.zT)(P,N),R=[];if(M){var D,L,Z=a()(E)?h:E,z=null!==(D=null!==(L=(0,T.zT)(P,N,!0))&&void 0!==L?L:Z)&&void 0!==D?D:0;R=(0,T.qz)({barGap:d,barCategoryGap:p,bandSize:z!==I?z:I,sizeList:y[C],maxBarSize:Z}),z!==I&&(R=R.map(function(e){return tt(tt({},e),{},{position:tt(tt({},e.position),{},{offset:e.position.offset-z/2})})}))}var B=n&&n.type&&n.type.getComposedData;B&&b.push({props:tt(tt({},B(tt(tt({},j),{},{displayedData:x,props:e,dataKey:S,item:n,bandSize:I,barPosition:R,offset:o,stackedData:A,layout:u,dataStartIndex:l,dataEndIndex:s}))),{},(tn(m={key:n.key||"item-".concat(c)},g,j[g]),tn(m,v,j[v]),tn(m,"animationId",i),m)),childIndex:(0,_.$R)(n,e.children),item:n})}),b},O=function(e,t){var r=e.props,a=e.dataStartIndex,i=e.dataEndIndex,l=e.updateId;if(!(0,_.TT)({props:r}))return null;var s=r.children,c=r.layout,u=r.stackOffset,d=r.data,p=r.reverseStackOrder,m=ty(c),g=m.numericAxisName,v=m.cateAxisName,b=(0,_.NN)(s,o),x=(0,T.wh)(d,b,"".concat(g,"Id"),"".concat(v,"Id"),u,p),w=f.reduce(function(e,t){var n="".concat(t.axisType,"Map");return tt(tt({},e),{},tn({},n,tm(r,tt(tt({},t),{},{graphicalItems:b,stackGroups:t.axisType===g&&x,dataStartIndex:a,dataEndIndex:i}))))},{}),k=tb(tt(tt({},w),{},{props:r,graphicalItems:b}),null==t?void 0:t.legendBBox);Object.keys(w).forEach(function(e){w[e]=h(r,w[e],k,e.replace("Map",""),n)});var S=tg(w["".concat(v,"Map")]),E=y(r,tt(tt({},w),{},{dataStartIndex:a,dataEndIndex:i,updateId:l,graphicalItems:b,stackGroups:x,offset:k}));return tt(tt({formattedGraphicalItems:E,graphicalItems:b,offset:k,stackGroups:x},S),w)};return t=function(e){(function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&e4(e,t)})(c,e);var t,o,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=e5(c);return e=t?Reflect.construct(n,arguments,e5(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===e0(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return e3(e)}(this,e)});function c(e){var t,o,s;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,c),tn(e3(s=i.call(this,e)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),tn(e3(s),"accessibilityManager",new eZ),tn(e3(s),"handleLegendBBoxUpdate",function(e){if(e){var t=s.state,n=t.dataStartIndex,r=t.dataEndIndex,o=t.updateId;s.setState(tt({legendBBox:e},O({props:s.props,dataStartIndex:n,dataEndIndex:r,updateId:o},tt(tt({},s.state),{},{legendBBox:e}))))}}),tn(e3(s),"handleReceiveSyncEvent",function(e,t,n){s.props.syncId===e&&(n!==s.eventEmitterSymbol||"function"==typeof s.props.syncMethod)&&s.applySyncEvent(t)}),tn(e3(s),"handleBrushChange",function(e){var t=e.startIndex,n=e.endIndex;if(t!==s.state.dataStartIndex||n!==s.state.dataEndIndex){var r=s.state.updateId;s.setState(function(){return tt({dataStartIndex:t,dataEndIndex:n},O({props:s.props,dataStartIndex:t,dataEndIndex:n,updateId:r},s.state))}),s.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),tn(e3(s),"handleMouseEnter",function(e){var t=s.getMouseInfo(e);if(t){var n=tt(tt({},t),{},{isTooltipActive:!0});s.setState(n),s.triggerSyncEvent(n);var r=s.props.onMouseEnter;l()(r)&&r(n,e)}}),tn(e3(s),"triggeredAfterMouseMove",function(e){var t=s.getMouseInfo(e),n=t?tt(tt({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};s.setState(n),s.triggerSyncEvent(n);var r=s.props.onMouseMove;l()(r)&&r(n,e)}),tn(e3(s),"handleItemMouseEnter",function(e){s.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),tn(e3(s),"handleItemMouseLeave",function(){s.setState(function(){return{isTooltipActive:!1}})}),tn(e3(s),"handleMouseMove",function(e){e.persist(),s.throttleTriggeredAfterMouseMove(e)}),tn(e3(s),"handleMouseLeave",function(e){var t={isTooltipActive:!1};s.setState(t),s.triggerSyncEvent(t);var n=s.props.onMouseLeave;l()(n)&&n(t,e)}),tn(e3(s),"handleOuterEvent",function(e){var t,n=(0,_.Bh)(e),r=d()(s.props,"".concat(n));n&&l()(r)&&r(null!==(t=/.*touch.*/i.test(n)?s.getMouseInfo(e.changedTouches[0]):s.getMouseInfo(e))&&void 0!==t?t:{},e)}),tn(e3(s),"handleClick",function(e){var t=s.getMouseInfo(e);if(t){var n=tt(tt({},t),{},{isTooltipActive:!0});s.setState(n),s.triggerSyncEvent(n);var r=s.props.onClick;l()(r)&&r(n,e)}}),tn(e3(s),"handleMouseDown",function(e){var t=s.props.onMouseDown;l()(t)&&t(s.getMouseInfo(e),e)}),tn(e3(s),"handleMouseUp",function(e){var t=s.props.onMouseUp;l()(t)&&t(s.getMouseInfo(e),e)}),tn(e3(s),"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),tn(e3(s),"handleTouchStart",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseDown(e.changedTouches[0])}),tn(e3(s),"handleTouchEnd",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseUp(e.changedTouches[0])}),tn(e3(s),"triggerSyncEvent",function(e){void 0!==s.props.syncId&&eA.emit(eM,s.props.syncId,e,s.eventEmitterSymbol)}),tn(e3(s),"applySyncEvent",function(e){var t=s.props,n=t.layout,r=t.syncMethod,o=s.state.updateId,a=e.dataStartIndex,i=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)s.setState(tt({dataStartIndex:a,dataEndIndex:i},O({props:s.props,dataStartIndex:a,dataEndIndex:i,updateId:o},s.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,c=e.chartY,u=e.activeTooltipIndex,d=s.state,f=d.offset,p=d.tooltipTicks;if(!f)return;if("function"==typeof r)u=r(p,e);else if("value"===r){u=-1;for(var h=0;h<p.length;h++)if(p[h].value===e.activeLabel){u=h;break}}var m=tt(tt({},f),{},{x:f.left,y:f.top}),g=Math.min(l,m.x+m.width),v=Math.min(c,m.y+m.height),y=p[u]&&p[u].value,b=td(s.state,s.props.data,u),x=p[u]?{x:"horizontal"===n?p[u].coordinate:g,y:"horizontal"===n?v:p[u].coordinate}:ti;s.setState(tt(tt({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else s.setState(e)}),tn(e3(s),"renderCursor",function(e){var t,o=s.state,a=o.isTooltipActive,i=o.activeCoordinate,l=o.activePayload,c=o.offset,u=o.activeTooltipIndex,d=o.tooltipAxisBandSize,f=s.getTooltipEventType(),p=null!==(t=e.props.active)&&void 0!==t?t:a,h=s.props.layout,m=e.key||"_recharts-cursor";return r.createElement(eY,{key:m,activeCoordinate:i,activePayload:l,activeTooltipIndex:u,chartName:n,element:e,isActive:p,layout:h,offset:c,tooltipAxisBandSize:d,tooltipEventType:f})}),tn(e3(s),"renderPolarAxis",function(e,t,n){var o=d()(e,"type.axisType"),a=d()(s.state,"".concat(o,"Map")),i=a&&a[e.props["".concat(o,"Id")]];return(0,r.cloneElement)(e,tt(tt({},i),{},{className:o,key:e.key||"".concat(t,"-").concat(n),ticks:(0,T.uY)(i,!0)}))}),tn(e3(s),"renderGrid",function(e){var t=s.state,n=t.xAxisMap,o=t.yAxisMap,a=t.offset,i=(0,A.Kt)(n),l=v()(o,function(e){return b()(e.domain,Number.isFinite)})||(0,A.Kt)(o),c=e.props||{};return(0,r.cloneElement)(e,{key:e.key||"grid",x:(0,A.hj)(c.x)?c.x:a.left,y:(0,A.hj)(c.y)?c.y:a.top,width:(0,A.hj)(c.width)?c.width:a.width,height:(0,A.hj)(c.height)?c.height:a.height,xAxis:i,yAxis:l,verticalCoordinatesGenerator:c.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:c.horizontalCoordinatesGenerator})}),tn(e3(s),"renderPolarGrid",function(e){var t=e.props,n=t.radialLines,o=t.polarAngles,a=t.polarRadius,i=s.state,l=i.radiusAxisMap,c=i.angleAxisMap,u=(0,A.Kt)(l),d=(0,A.Kt)(c),f=d.cx,p=d.cy,h=d.innerRadius,m=d.outerRadius;return(0,r.cloneElement)(e,{polarAngles:Array.isArray(o)?o:(0,T.uY)(d,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:(0,T.uY)(u,!0).map(function(e){return e.coordinate}),cx:f,cy:p,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:n})}),tn(e3(s),"renderLegend",function(){var e=s.state.formattedGraphicalItems,t=s.props,n=t.children,o=t.width,a=t.height,i=s.props.margin||{},l=o-(i.left||0)-(i.right||0),c=(0,J.z)({children:n,formattedGraphicalItems:e,legendWidth:l,legendContent:p});if(!c)return null;var u=c.item,d=e6(c,eQ);return(0,r.cloneElement)(u,tt(tt({},d),{},{chartWidth:o,chartHeight:a,margin:i,onBBoxUpdate:s.handleLegendBBoxUpdate}))}),tn(e3(s),"renderTooltip",function(){var e,t=s.props.children,n=(0,_.sP)(t,E.u);if(!n)return null;var o=s.state,a=o.isTooltipActive,i=o.activeCoordinate,l=o.activePayload,c=o.activeLabel,u=o.offset,d=null!==(e=n.props.active)&&void 0!==e?e:a;return(0,r.cloneElement)(n,{viewBox:tt(tt({},u),{},{x:u.left,y:u.top}),active:d,label:c,payload:d?l:[],coordinate:i})}),tn(e3(s),"renderBrush",function(e){var t=s.props,n=t.margin,o=t.data,a=s.state,i=a.offset,l=a.dataStartIndex,c=a.dataEndIndex,u=a.updateId;return(0,r.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:(0,T.DO)(s.handleBrushChange,e.props.onChange),data:o,x:(0,A.hj)(e.props.x)?e.props.x:i.left,y:(0,A.hj)(e.props.y)?e.props.y:i.top+i.height+i.brushBottom-(n.bottom||0),width:(0,A.hj)(e.props.width)?e.props.width:i.width,startIndex:l,endIndex:c,updateId:"brush-".concat(u)})}),tn(e3(s),"renderReferenceElement",function(e,t,n){if(!e)return null;var o=e3(s).clipPathId,a=s.state,i=a.xAxisMap,l=a.yAxisMap,c=a.offset,u=e.props,d=u.xAxisId,f=u.yAxisId;return(0,r.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(n),xAxis:i[d],yAxis:l[f],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:o})}),tn(e3(s),"renderActivePoints",function(e){var t=e.item,n=e.activePoint,r=e.basePoint,o=e.childIndex,a=e.isRange,i=[],l=t.props.key,s=t.item.props,u=s.activeDot,d=tt(tt({index:o,dataKey:s.dataKey,cx:n.x,cy:n.y,r:4,fill:(0,T.fk)(t.item),strokeWidth:2,stroke:"#fff",payload:n.payload,value:n.value,key:"".concat(l,"-activePoint-").concat(o)},(0,_.L6)(u,!1)),(0,eI.Ym)(u));return i.push(c.renderActiveDot(u,d)),r?i.push(c.renderActiveDot(u,tt(tt({},d),{},{cx:r.x,cy:r.y,key:"".concat(l,"-basePoint-").concat(o)}))):a&&i.push(null),i}),tn(e3(s),"renderGraphicChild",function(e,t,n){var o=s.filterFormatItem(e,t,n);if(!o)return null;var i=s.getTooltipEventType(),l=s.state,c=l.isTooltipActive,u=l.tooltipAxis,d=l.activeTooltipIndex,f=l.activeLabel,p=s.props.children,h=(0,_.sP)(p,E.u),m=o.props,g=m.points,v=m.isRange,y=m.baseLine,b=o.item.props,x=b.activeDot,w=b.hide,k=b.activeBar,S=b.activeShape,O={};"axis"!==i&&h&&"click"===h.props.trigger?O={onClick:(0,T.DO)(s.handleItemMouseEnter,e.props.onClick)}:"axis"!==i&&(O={onMouseLeave:(0,T.DO)(s.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:(0,T.DO)(s.handleItemMouseEnter,e.props.onMouseEnter)});var C=(0,r.cloneElement)(e,tt(tt({},o.props),O));if(!w&&c&&h&&(x||k||S)){if(d>=0){if(u.dataKey&&!u.allowDuplicatedCategory){var j="function"==typeof u.dataKey?function(e){return"function"==typeof u.dataKey?u.dataKey(e.payload):null}:"payload.".concat(u.dataKey.toString());N=(0,A.Ap)(g,j,f),M=v&&y&&(0,A.Ap)(y,j,f)}else N=null==g?void 0:g[d],M=v&&y&&y[d];if(S||k){var P=void 0!==e.props.activeIndex?e.props.activeIndex:d;return[(0,r.cloneElement)(e,tt(tt(tt({},o.props),O),{},{activeIndex:P})),null,null]}if(!a()(N))return[C].concat(e8(s.renderActivePoints({item:o,activePoint:N,basePoint:M,childIndex:d,isRange:v})))}else{var N,M,I,R=(null!==(I=s.getItemByXY(s.state.activeCoordinate))&&void 0!==I?I:{graphicalItem:C}).graphicalItem,D=R.item,L=void 0===D?e:D,Z=R.childIndex,z=tt(tt(tt({},o.props),O),{},{activeIndex:Z});return[(0,r.cloneElement)(L,z),null,null]}}return v?[C,null,null]:[C,null]}),tn(e3(s),"renderCustomized",function(e,t,n){return(0,r.cloneElement)(e,tt(tt({key:"recharts-customized-".concat(n)},s.props),s.state))}),tn(e3(s),"renderMap",{CartesianGrid:{handler:s.renderGrid,once:!0},ReferenceArea:{handler:s.renderReferenceElement},ReferenceLine:{handler:tl},ReferenceDot:{handler:s.renderReferenceElement},XAxis:{handler:tl},YAxis:{handler:tl},Brush:{handler:s.renderBrush,once:!0},Bar:{handler:s.renderGraphicChild},Line:{handler:s.renderGraphicChild},Area:{handler:s.renderGraphicChild},Radar:{handler:s.renderGraphicChild},RadialBar:{handler:s.renderGraphicChild},Scatter:{handler:s.renderGraphicChild},Pie:{handler:s.renderGraphicChild},Funnel:{handler:s.renderGraphicChild},Tooltip:{handler:s.renderCursor,once:!0},PolarGrid:{handler:s.renderPolarGrid,once:!0},PolarAngleAxis:{handler:s.renderPolarAxis},PolarRadiusAxis:{handler:s.renderPolarAxis},Customized:{handler:s.renderCustomized}}),s.clipPathId="".concat(null!==(t=e.id)&&void 0!==t?t:(0,A.EL)("recharts"),"-clip"),s.throttleTriggeredAfterMouseMove=m()(s.triggeredAfterMouseMove,null!==(o=e.throttleDelay)&&void 0!==o?o:1e3/60),s.state={},s}return o=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,o=e.layout,a=(0,_.sP)(t,E.u);if(a){var i=a.props.defaultIndex;if("number"==typeof i&&!(i<0)&&!(i>this.state.tooltipTicks.length)){var l=this.state.tooltipTicks[i]&&this.state.tooltipTicks[i].value,s=td(this.state,n,i,l),c=this.state.tooltipTicks[i].coordinate,u=(this.state.offset.top+r)/2,d="horizontal"===o?{x:c,y:u}:{y:c,x:u},f=this.state.formattedGraphicalItems.find(function(e){return"Scatter"===e.item.type.name});f&&(d=tt(tt({},d),f.props.points[i].tooltipPosition),s=f.props.points[i].tooltipPayload);var p={activeTooltipIndex:i,isTooltipActive:!0,activeLabel:l,activePayload:s,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(i)}}}},{key:"getSnapshotBeforeUpdate",value:function(e,t){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin){var n,r;this.accessibilityManager.setDetails({offset:{left:null!==(n=this.props.margin.left)&&void 0!==n?n:0,top:null!==(r=this.props.margin.top)&&void 0!==r?r:0}})}return null}},{key:"componentDidUpdate",value:function(e){(0,_.rL)([(0,_.sP)(e.children,E.u)],[(0,_.sP)(this.props.children,E.u)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=(0,_.sP)(this.props.children,E.u);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return u.indexOf(t)>=0?t:s}return s}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=(0,Q.os)(n),o={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,i=this.inRange(o.chartX,o.chartY,a);if(!i)return null;var l=this.state,s=l.xAxisMap,c=l.yAxisMap;if("axis"!==this.getTooltipEventType()&&s&&c){var u=(0,A.Kt)(s).scale,d=(0,A.Kt)(c).scale,f=u&&u.invert?u.invert(o.chartX):null,p=d&&d.invert?d.invert(o.chartY):null;return tt(tt({},o),{},{xValue:f,yValue:p})}var h=tf(this.state,this.props.data,this.props.layout,i);return h?tt(tt({},o),h):null}},{key:"inRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.props.layout,o=e/n,a=t/n;if("horizontal"===r||"vertical"===r){var i=this.state.offset;return o>=i.left&&o<=i.left+i.width&&a>=i.top&&a<=i.top+i.height?{x:o,y:a}:null}var l=this.state,s=l.angleAxisMap,c=l.radiusAxisMap;if(s&&c){var u=(0,A.Kt)(s);return(0,eP.z3)({x:o,y:a},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=(0,_.sP)(e,E.u),r={};return n&&"axis"===t&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),tt(tt({},(0,eI.Ym)(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){eA.on(eM,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eA.removeListener(eM,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,o=0,a=r.length;o<a;o++){var i=r[o];if(i.item===e||i.props.key===e.key||t===(0,_.Gf)(i.item.type)&&n===i.childIndex)return i}return null}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,o=t.top,a=t.height,i=t.width;return r.createElement("defs",null,r.createElement("clipPath",{id:e},r.createElement("rect",{x:n,y:o,height:a,width:i})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e2(t,2),r=n[0],o=n[1];return tt(tt({},e),{},tn({},r,o.scale))},{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e2(t,2),r=n[0],o=n[1];return tt(tt({},e),{},tn({},r,o.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var o=0,a=n.length;o<a;o++){var i=n[o],l=i.props,s=i.item,c=(0,_.Gf)(s.type);if("Bar"===c){var u=(l.data||[]).find(function(t){return(0,j.X)(e,t)});if(u)return{graphicalItem:i,payload:u}}else if("RadialBar"===c){var d=(l.data||[]).find(function(t){return(0,eP.z3)(e,t)});if(d)return{graphicalItem:i,payload:d}}else if((0,ez.lT)(i,r)||(0,ez.V$)(i,r)||(0,ez.w7)(i,r)){var f=(0,ez.a3)({graphicalItem:i,activeTooltipItem:r,itemData:s.props.data}),p=void 0===s.props.activeIndex?f:s.props.activeIndex;return{graphicalItem:tt(tt({},i),{},{childIndex:p}),payload:(0,ez.w7)(i,r)?s.props.data[f]:i.props.data[f]}}}return null}},{key:"render",value:function(){var e,t,n=this;if(!(0,_.TT)(this))return null;var o=this.props,a=o.children,i=o.className,l=o.width,s=o.height,c=o.style,u=o.compact,d=o.title,f=o.desc,p=e6(o,eJ),h=(0,_.L6)(p,!1);if(u)return r.createElement(k.T,e1({},h,{width:l,height:s,title:d,desc:f}),this.renderClipPath(),(0,_.eu)(a,this.renderMap));this.props.accessibilityLayer&&(h.tabIndex=null!==(e=this.props.tabIndex)&&void 0!==e?e:0,h.role=null!==(t=this.props.role)&&void 0!==t?t:"img",h.onKeyDown=function(e){n.accessibilityManager.keyboardEvent(e)},h.onFocus=function(){n.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return r.createElement(ef.br,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},r.createElement("div",e1({className:(0,x.Z)("recharts-wrapper",i),style:tt({position:"relative",cursor:"default",width:l,height:s},c)},m,{ref:function(e){n.container=e},role:"region"}),r.createElement(k.T,e1({},h,{width:l,height:s,title:d,desc:f,style:ta}),this.renderClipPath(),(0,_.eu)(a,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tr(r.key),r)}}(c.prototype,o),Object.defineProperty(c,"prototype",{writable:!1}),c}(r.Component),tn(t,"displayName",n),tn(t,"defaultProps",tt({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},g)),tn(t,"getDerivedStateFromProps",function(e,t){var n=e.dataKey,r=e.data,o=e.children,i=e.width,l=e.height,s=e.layout,c=e.stackOffset,u=e.margin,d=t.dataStartIndex,f=t.dataEndIndex;if(void 0===t.updateId){var p=tv(e);return tt(tt(tt({},p),{},{updateId:0},O(tt(tt({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:i,prevHeight:l,prevLayout:s,prevStackOffset:c,prevMargin:u,prevChildren:o})}if(n!==t.prevDataKey||r!==t.prevData||i!==t.prevWidth||l!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!(0,eN.w)(u,t.prevMargin)){var h=tv(e),m={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=tt(tt({},tf(t,r,s)),{},{updateId:t.updateId+1}),v=tt(tt(tt({},h),m),g);return tt(tt(tt({},v),O(tt({props:e},v),t)),{},{prevDataKey:n,prevData:r,prevWidth:i,prevHeight:l,prevLayout:s,prevStackOffset:c,prevMargin:u,prevChildren:o})}if(!(0,_.rL)(o,t.prevChildren)){var y,b,x,w,k=(0,_.sP)(o,Y),S=k&&null!==(y=null===(b=k.props)||void 0===b?void 0:b.startIndex)&&void 0!==y?y:d,E=k&&null!==(x=null===(w=k.props)||void 0===w?void 0:w.endIndex)&&void 0!==x?x:f,C=a()(r)||S!==d||E!==f?t.updateId+1:t.updateId;return tt(tt({updateId:C},O(tt(tt({props:e},t),{},{updateId:C,dataStartIndex:S,dataEndIndex:E}),t)),{},{prevChildren:o,dataStartIndex:S,dataEndIndex:E})}return null}),tn(t,"renderActiveDot",function(e,t){var n;return n=(0,r.isValidElement)(e)?(0,r.cloneElement)(e,t):l()(e)?e(t):r.createElement(C.o,t),r.createElement(S.m,{className:"recharts-active-dot",key:t.key},n)}),t}},20407:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});var r=function(e){return null};r.displayName="Cell"},26680:function(e,t,n){"use strict";n.d(t,{_:function(){return O}});var r=n(2265),o=n(77571),a=n.n(o),i=n(86757),l=n.n(i),s=n(28302),c=n.n(s),u=n(87602),d=n(58811),f=n(82944),p=n(16630),h=n(39206);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var g=["offset"];function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var w=function(e){var t=e.value,n=e.formatter,r=a()(e.children)?t:e.children;return l()(n)?n(r):r},k=function(e,t,n){var o,i,l=e.position,s=e.viewBox,c=e.offset,d=e.className,f=s.cx,m=s.cy,g=s.innerRadius,v=s.outerRadius,y=s.startAngle,b=s.endAngle,w=s.clockWise,k=(g+v)/2,S=(0,p.uY)(b-y)*Math.min(Math.abs(b-y),360),E=S>=0?1:-1;"insideStart"===l?(o=y+E*c,i=w):"insideEnd"===l?(o=b-E*c,i=!w):"end"===l&&(o=b+E*c,i=w),i=S<=0?i:!i;var O=(0,h.op)(f,m,k,o),C=(0,h.op)(f,m,k,o+(i?1:-1)*359),j="M".concat(O.x,",").concat(O.y,"\n A").concat(k,",").concat(k,",0,1,").concat(i?0:1,",\n ").concat(C.x,",").concat(C.y),_=a()(e.id)?(0,p.EL)("recharts-radial-line-"):e.id;return r.createElement("text",x({},n,{dominantBaseline:"central",className:(0,u.Z)("recharts-radial-bar-label",d)}),r.createElement("defs",null,r.createElement("path",{id:_,d:j})),r.createElement("textPath",{xlinkHref:"#".concat(_)},t))},S=function(e){var t=e.viewBox,n=e.offset,r=e.position,o=t.cx,a=t.cy,i=t.innerRadius,l=t.outerRadius,s=(t.startAngle+t.endAngle)/2;if("outside"===r){var c=(0,h.op)(o,a,l+n,s),u=c.x;return{x:u,y:c.y,textAnchor:u>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var d=(0,h.op)(o,a,(i+l)/2,s);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}},E=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,o=e.position,a=t.x,i=t.y,l=t.width,s=t.height,u=s>=0?1:-1,d=u*r,f=u>0?"end":"start",h=u>0?"start":"end",m=l>=0?1:-1,g=m*r,v=m>0?"end":"start",y=m>0?"start":"end";if("top"===o)return b(b({},{x:a+l/2,y:i-u*r,textAnchor:"middle",verticalAnchor:f}),n?{height:Math.max(i-n.y,0),width:l}:{});if("bottom"===o)return b(b({},{x:a+l/2,y:i+s+d,textAnchor:"middle",verticalAnchor:h}),n?{height:Math.max(n.y+n.height-(i+s),0),width:l}:{});if("left"===o){var x={x:a-g,y:i+s/2,textAnchor:v,verticalAnchor:"middle"};return b(b({},x),n?{width:Math.max(x.x-n.x,0),height:s}:{})}if("right"===o){var w={x:a+l+g,y:i+s/2,textAnchor:y,verticalAnchor:"middle"};return b(b({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:s}:{})}var k=n?{width:l,height:s}:{};return"insideLeft"===o?b({x:a+g,y:i+s/2,textAnchor:y,verticalAnchor:"middle"},k):"insideRight"===o?b({x:a+l-g,y:i+s/2,textAnchor:v,verticalAnchor:"middle"},k):"insideTop"===o?b({x:a+l/2,y:i+d,textAnchor:"middle",verticalAnchor:h},k):"insideBottom"===o?b({x:a+l/2,y:i+s-d,textAnchor:"middle",verticalAnchor:f},k):"insideTopLeft"===o?b({x:a+g,y:i+d,textAnchor:y,verticalAnchor:h},k):"insideTopRight"===o?b({x:a+l-g,y:i+d,textAnchor:v,verticalAnchor:h},k):"insideBottomLeft"===o?b({x:a+g,y:i+s-d,textAnchor:y,verticalAnchor:f},k):"insideBottomRight"===o?b({x:a+l-g,y:i+s-d,textAnchor:v,verticalAnchor:f},k):c()(o)&&((0,p.hj)(o.x)||(0,p.hU)(o.x))&&((0,p.hj)(o.y)||(0,p.hU)(o.y))?b({x:a+(0,p.h1)(o.x,l),y:i+(0,p.h1)(o.y,s),textAnchor:"end",verticalAnchor:"end"},k):b({x:a+l/2,y:i+s/2,textAnchor:"middle",verticalAnchor:"middle"},k)};function O(e){var t,n=e.offset,o=b({offset:void 0===n?5:n},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,g)),i=o.viewBox,s=o.position,c=o.value,h=o.children,m=o.content,v=o.className,y=o.textBreakAll;if(!i||a()(c)&&a()(h)&&!(0,r.isValidElement)(m)&&!l()(m))return null;if((0,r.isValidElement)(m))return(0,r.cloneElement)(m,o);if(l()(m)){if(t=(0,r.createElement)(m,o),(0,r.isValidElement)(t))return t}else t=w(o);var O="cx"in i&&(0,p.hj)(i.cx),C=(0,f.L6)(o,!0);if(O&&("insideStart"===s||"insideEnd"===s||"end"===s))return k(o,t,C);var j=O?S(o):E(o);return r.createElement(d.x,x({className:(0,u.Z)("recharts-label",void 0===v?"":v)},C,j,{breakAll:y}),t)}O.displayName="Label";var C=function(e){var t=e.cx,n=e.cy,r=e.angle,o=e.startAngle,a=e.endAngle,i=e.r,l=e.radius,s=e.innerRadius,c=e.outerRadius,u=e.x,d=e.y,f=e.top,h=e.left,m=e.width,g=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if((0,p.hj)(m)&&(0,p.hj)(g)){if((0,p.hj)(u)&&(0,p.hj)(d))return{x:u,y:d,width:m,height:g};if((0,p.hj)(f)&&(0,p.hj)(h))return{x:f,y:h,width:m,height:g}}return(0,p.hj)(u)&&(0,p.hj)(d)?{x:u,y:d,width:0,height:0}:(0,p.hj)(t)&&(0,p.hj)(n)?{cx:t,cy:n,startAngle:o||r||0,endAngle:a||r||0,innerRadius:s||0,outerRadius:c||l||i||0,clockWise:v}:e.viewBox?e.viewBox:{}};O.parseViewBox=C,O.renderCallByParent=function(e,t){var n,o,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&a&&!e.label)return null;var i=e.children,s=C(e),u=(0,f.NN)(i,O).map(function(e,n){return(0,r.cloneElement)(e,{viewBox:t||s,key:"label-".concat(n)})});return a?[(n=e.label,o=t||s,n?!0===n?r.createElement(O,{key:"label-implicit",viewBox:o}):(0,p.P2)(n)?r.createElement(O,{key:"label-implicit",viewBox:o,value:n}):(0,r.isValidElement)(n)?n.type===O?(0,r.cloneElement)(n,{key:"label-implicit",viewBox:o}):r.createElement(O,{key:"label-implicit",content:n,viewBox:o}):l()(n)?r.createElement(O,{key:"label-implicit",content:n,viewBox:o}):c()(n)?r.createElement(O,x({viewBox:o},n,{key:"label-implicit"})):null:null)].concat(function(e){if(Array.isArray(e))return v(e)}(u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,void 0)}}(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):u}},58772:function(e,t,n){"use strict";n.d(t,{e:function(){return O}});var r=n(2265),o=n(77571),a=n.n(o),i=n(28302),l=n.n(i),s=n(86757),c=n.n(s),u=n(86185),d=n.n(u),f=n(26680),p=n(9841),h=n(82944),m=n(85355);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var v=["valueAccessor"],y=["data","dataKey","clockWise","id","textBreakAll"];function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var E=function(e){return Array.isArray(e.value)?d()(e.value):e.value};function O(e){var t=e.valueAccessor,n=void 0===t?E:t,o=S(e,v),i=o.data,l=o.dataKey,s=o.clockWise,c=o.id,u=o.textBreakAll,d=S(o,y);return i&&i.length?r.createElement(p.m,{className:"recharts-label-list"},i.map(function(e,t){var o=a()(l)?n(e,t):(0,m.F$)(e&&e.payload,l),i=a()(c)?{}:{id:"".concat(c,"-").concat(t)};return r.createElement(f._,x({},(0,h.L6)(e,!0),d,i,{parentViewBox:e.parentViewBox,value:o,textBreakAll:u,viewBox:f._.parseViewBox(a()(s)?e:k(k({},e),{},{clockWise:s})),key:"label-".concat(t),index:t}))})):null}O.displayName="LabelList",O.renderCallByParent=function(e,t){var n,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&o&&!e.label)return null;var a=e.children,i=(0,h.NN)(a,O).map(function(e,n){return(0,r.cloneElement)(e,{data:t,key:"labelList-".concat(n)})});return o?[(n=e.label)?!0===n?r.createElement(O,{key:"labelList-implicit",data:t}):r.isValidElement(n)||c()(n)?r.createElement(O,{key:"labelList-implicit",data:t,content:n}):l()(n)?r.createElement(O,x({data:t},n,{key:"labelList-implicit"})):null:null].concat(function(e){if(Array.isArray(e))return b(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return b(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,void 0)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i}},22190:function(e,t,n){"use strict";n.d(t,{D:function(){return A}});var r=n(2265),o=n(86757),a=n.n(o),i=n(87602),l=n(1175),s=n(48777),c=n(14870),u=n(41637);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(){return(f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(y,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=m(y);return e=t?Reflect.construct(n,arguments,m(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function y(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,y),o.apply(this,arguments)}return n=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,n=32/6,o=32/3,a=e.inactive?t:e.color;if("plainline"===e.type)return r.createElement("line",{strokeWidth:4,fill:"none",stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:16,x2:32,y2:16,className:"recharts-legend-icon"});if("line"===e.type)return r.createElement("path",{strokeWidth:4,fill:"none",stroke:a,d:"M0,".concat(16,"h").concat(o,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*o,",").concat(16,"\n H").concat(32,"M").concat(2*o,",").concat(16,"\n A").concat(n,",").concat(n,",0,1,1,").concat(o,",").concat(16),className:"recharts-legend-icon"});if("rect"===e.type)return r.createElement("path",{stroke:"none",fill:a,d:"M0,".concat(4,"h").concat(32,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(r.isValidElement(e.legendIcon)){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);return delete i.legendIcon,r.cloneElement(e.legendIcon,i)}return r.createElement(c.v,{fill:a,cx:16,cy:16,size:32,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,n=t.payload,o=t.iconSize,c=t.layout,d=t.formatter,p=t.inactiveColor,h={x:0,y:0,width:32,height:32},m={display:"horizontal"===c?"inline-block":"block",marginRight:10},v={display:"inline-block",verticalAlign:"middle",marginRight:4};return n.map(function(t,n){var c,y=t.formatter||d,b=(0,i.Z)((g(c={"recharts-legend-item":!0},"legend-item-".concat(n),!0),g(c,"inactive",t.inactive),c));if("none"===t.type)return null;var x=a()(t.value)?null:t.value;(0,l.Z)(!a()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var w=t.inactive?p:t.color;return r.createElement("li",f({className:b,style:m,key:"legend-item-".concat(n)},(0,u.bw)(e.props,t,n)),r.createElement(s.T,{width:o,height:o,viewBox:h,style:v},e.renderIcon(t)),r.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},y?y(x,t,n):x))})}},{key:"render",value:function(){var e=this.props,t=e.payload,n=e.layout,o=e.align;return t&&t.length?r.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===n?o:"left"}},this.renderItems()):null}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}(y.prototype,n),Object.defineProperty(y,"prototype",{writable:!1}),y}(r.PureComponent);g(y,"displayName","Legend"),g(y,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var b=n(16630),x=n(93528);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k=["ref"];function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N(r.key),r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){var t=function(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===w(t)?t:String(t)}function T(e){return e.value}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(i,e);var t,n,o,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=_(i);return e=t?Reflect.construct(n,arguments,_(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return j(e)}(this,e)});function i(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return P(j(e=a.call.apply(a,[this].concat(n))),"lastBoundingBox",{width:-1,height:-1}),e}return n=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){return this.wrapperNode&&this.wrapperNode.getBoundingClientRect?this.wrapperNode.getBoundingClientRect():null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var t=this.wrapperNode.getBoundingClientRect();(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t))}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?E({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,n,r=this.props,o=r.layout,a=r.align,i=r.verticalAlign,l=r.margin,s=r.chartWidth,c=r.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===a&&"vertical"===o?{left:((s||0)-this.getBBoxSnapshot().width)/2}:"right"===a?{right:l&&l.right||0}:{left:l&&l.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(n="middle"===i?{top:((c||0)-this.getBBoxSnapshot().height)/2}:"bottom"===i?{bottom:l&&l.bottom||0}:{top:l&&l.top||0}),E(E({},t),n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.content,o=t.width,a=t.height,i=t.wrapperStyle,l=t.payloadUniqBy,s=t.payload,c=E(E({position:"absolute",width:o||"auto",height:a||"auto"},this.getDefaultPosition(i)),i);return r.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(t){e.wrapperNode=t}},function(e,t){if(r.isValidElement(e))return r.cloneElement(e,t);if("function"==typeof e)return r.createElement(e,t);t.ref;var n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,k);return r.createElement(y,n)}(n,E(E({},this.props),{},{payload:(0,x.z)(s,l,T)})))}}],o=[{key:"getWithHeight",value:function(e,t){var n=e.props.layout;return"vertical"===n&&(0,b.hj)(e.props.height)?{height:e.props.height}:"horizontal"===n?{width:e.props.width||t}:null}}],n&&O(i.prototype,n),o&&O(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}(r.PureComponent);P(A,"displayName","Legend"),P(A,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"})},47625:function(e,t,n){"use strict";n.d(t,{h:function(){return m}});var r=n(87602),o=n(2265),a=n(37065),i=n.n(a),l=n(82558),s=n(16630),c=n(1175),u=n(82944);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m=(0,o.forwardRef)(function(e,t){var n,a=e.aspect,d=e.initialDimension,f=void 0===d?{width:-1,height:-1}:d,m=e.width,g=void 0===m?"100%":m,v=e.height,y=void 0===v?"100%":v,b=e.minWidth,x=void 0===b?0:b,w=e.minHeight,k=e.maxHeight,S=e.children,E=e.debounce,O=void 0===E?0:E,C=e.id,j=e.className,_=e.onResize,P=e.style,N=(0,o.useRef)(null),T=(0,o.useRef)();T.current=_,(0,o.useImperativeHandle)(t,function(){return Object.assign(N.current,{get current(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current}})});var A=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)({containerWidth:f.width,containerHeight:f.height}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(n,2)||function(e,t){if(e){if("string"==typeof e)return h(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),M=A[0],I=A[1],R=(0,o.useCallback)(function(e,t){I(function(n){var r=Math.round(e),o=Math.round(t);return n.containerWidth===r&&n.containerHeight===o?n:{containerWidth:r,containerHeight:o}})},[]);(0,o.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,o=n.height;R(r,o),null===(t=T.current)||void 0===t||t.call(T,r,o)};O>0&&(e=i()(e,O,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=N.current.getBoundingClientRect();return R(n.width,n.height),t.observe(N.current),function(){t.disconnect()}},[R,O]);var D=(0,o.useMemo)(function(){var e=M.containerWidth,t=M.containerHeight;if(e<0||t<0)return null;(0,c.Z)((0,s.hU)(g)||(0,s.hU)(y),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",g,y),(0,c.Z)(!a||a>0,"The aspect(%s) must be greater than zero.",a);var n=(0,s.hU)(g)?e:g,r=(0,s.hU)(y)?t:y;a&&a>0&&(n?r=n/a:r&&(n=r*a),k&&r>k&&(r=k)),(0,c.Z)(n>0||r>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,r,g,y,x,w,a);var i=!Array.isArray(S)&&(0,l.isElement)(S)&&(0,u.Gf)(S.type).endsWith("Chart");return o.Children.map(S,function(e){return(0,l.isElement)(e)?(0,o.cloneElement)(e,p({width:n,height:r},i?{style:p({height:"100%",width:"100%",maxHeight:r,maxWidth:n},e.props.style)}:{})):e})},[a,S,y,k,w,x,M,g]);return o.createElement("div",{id:C?"".concat(C):void 0,className:(0,r.Z)("recharts-responsive-container",j),style:p(p({},void 0===P?{}:P),{},{width:g,height:y,minWidth:x,minHeight:w,maxHeight:k}),ref:N},D)})},58811:function(e,t,n){"use strict";n.d(t,{x:function(){return L}});var r=n(2265),o=n(77571),a=n.n(o),i=n(87602),l=n(16630),s=n(34067),c=n(82944),u=n(4094);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r.key),r)}}var m=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,g=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,v=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,y=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,b={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},x=Object.keys(b),w=function(){var e,t;function n(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this.num=e,this.unit=t,this.num=e,this.unit=t,Number.isNaN(e)&&(this.unit=""),""===t||v.test(t)||(this.num=NaN,this.unit=""),x.includes(t)&&(this.num=e*b[t],this.unit="px")}return e=[{key:"add",value:function(e){return this.unit!==e.unit?new n(NaN,""):new n(this.num+e.num,this.unit)}},{key:"subtract",value:function(e){return this.unit!==e.unit?new n(NaN,""):new n(this.num-e.num,this.unit)}},{key:"multiply",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(NaN,""):new n(this.num*e.num,this.unit||e.unit)}},{key:"divide",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(NaN,""):new n(this.num/e.num,this.unit||e.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],t=[{key:"parse",value:function(e){var t,r=f(null!==(t=y.exec(e))&&void 0!==t?t:[],3),o=r[1],a=r[2];return new n(parseFloat(o),null!=a?a:"")}}],e&&h(n.prototype,e),t&&h(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();function k(e){if(e.includes("NaN"))return"NaN";for(var t=e;t.includes("*")||t.includes("/");){var n,r=f(null!==(n=m.exec(t))&&void 0!==n?n:[],4),o=r[1],a=r[2],i=r[3],l=w.parse(null!=o?o:""),s=w.parse(null!=i?i:""),c="*"===a?l.multiply(s):l.divide(s);if(c.isNaN())return"NaN";t=t.replace(m,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,d=f(null!==(u=g.exec(t))&&void 0!==u?u:[],4),p=d[1],h=d[2],v=d[3],y=w.parse(null!=p?p:""),b=w.parse(null!=v?v:""),x="+"===h?y.add(b):y.subtract(b);if(x.isNaN())return"NaN";t=t.replace(g,x.toString())}return t}var S=/\(([^()]*)\)/;function E(e){var t=function(e){try{var t;return t=e.replace(/\s+/g,""),t=function(e){for(var t=e;t.includes("(");){var n=f(S.exec(t),2)[1];t=t.replace(S,k(n))}return t}(t),t=k(t)}catch(e){return"NaN"}}(e.slice(5,-1));return"NaN"===t?"":t}var O=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],C=["dx","dy","angle","className","breakAll"];function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var T=/[ \f\n\r\t\v\u2028\u2029]+/,A=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var o=[];a()(t)||(o=n?t.toString().split(""):t.toString().split(T));var i=o.map(function(e){return{word:e,width:(0,u.xE)(e,r).width}}),l=n?0:(0,u.xE)("\xa0",r).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch(e){return null}},M=function(e,t,n,r,o){var a,i=e.maxLines,s=e.children,c=e.style,u=e.breakAll,d=(0,l.hj)(i),f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(function(e,t){var a=t.word,i=t.width,l=e[e.length-1];return l&&(null==r||o||l.width+i+n<Number(r))?(l.words.push(a),l.width+=i+n):e.push({words:[a],width:i}),e},[])},p=f(t);if(!d)return p;for(var h=function(e){var t=f(A({breakAll:u,style:c,children:s.slice(0,e)+"…"}).wordsWithComputedWidth);return[t.length>i||t.reduce(function(e,t){return e.width>t.width?e:t}).width>Number(r),t]},m=0,g=s.length-1,v=0;m<=g&&v<=s.length-1;){var y=Math.floor((m+g)/2),b=P(h(y-1),2),x=b[0],w=b[1],k=P(h(y),1)[0];if(x||k||(m=y+1),x&&k&&(g=y-1),!x&&k){a=w;break}v++}return a||p},I=function(e){return[{words:a()(e)?[]:e.toString().split(T)}]},R=function(e){var t=e.width,n=e.scaleToFit,r=e.children,o=e.style,a=e.breakAll,i=e.maxLines;if((t||n)&&!s.x.isSsr){var l=A({breakAll:a,children:r,style:o});return l?M({breakAll:a,children:r,maxLines:i,style:o},l.wordsWithComputedWidth,l.spaceWidth,t,n):I(r)}return I(r)},D="#808080",L=function(e){var t,n=e.x,o=void 0===n?0:n,a=e.y,s=void 0===a?0:a,u=e.lineHeight,d=void 0===u?"1em":u,f=e.capHeight,p=void 0===f?"0.71em":f,h=e.scaleToFit,m=void 0!==h&&h,g=e.textAnchor,v=e.verticalAnchor,y=e.fill,b=void 0===y?D:y,x=_(e,O),w=(0,r.useMemo)(function(){return R({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:m,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,m,x.style,x.width]),k=x.dx,S=x.dy,P=x.angle,N=x.className,T=x.breakAll,A=_(x,C);if(!(0,l.P2)(o)||!(0,l.P2)(s))return null;var M=o+((0,l.hj)(k)?k:0),I=s+((0,l.hj)(S)?S:0);switch(void 0===v?"end":v){case"start":t=E("calc(".concat(p,")"));break;case"middle":t=E("calc(".concat((w.length-1)/2," * -").concat(d," + (").concat(p," / 2))"));break;default:t=E("calc(".concat(w.length-1," * -").concat(d,")"))}var L=[];if(m){var Z=w[0].width,z=x.width;L.push("scale(".concat(((0,l.hj)(z)?z/Z:1)/Z,")"))}return P&&L.push("rotate(".concat(P,", ").concat(M,", ").concat(I,")")),L.length&&(A.transform=L.join(" ")),r.createElement("text",j({},(0,c.L6)(A,!0),{x:M,y:I,className:(0,i.Z)("recharts-text",N),textAnchor:void 0===g?"start":g,fill:b.includes("url")?D:b}),w.map(function(e,n){var o=e.words.join(T?"":" ");return r.createElement("tspan",{x:M,dy:0===n?t:d,key:o},o)}))}},8147:function(e,t,n){"use strict";n.d(t,{u:function(){return F}});var r=n(2265),o=n(34935),a=n.n(o),i=n(77571),l=n.n(i),s=n(87602),c=n(16630);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==u(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===u(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e){return Array.isArray(e)&&(0,c.P2)(e[0])&&(0,c.P2)(e[1])?e.join(" ~ "):e}var m=function(e){var t=e.separator,n=void 0===t?" : ":t,o=e.contentStyle,i=e.itemStyle,u=void 0===i?{}:i,f=e.labelStyle,m=e.payload,g=e.formatter,v=e.itemSorter,y=e.wrapperClassName,b=e.labelClassName,x=e.label,w=e.labelFormatter,k=p({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},void 0===o?{}:o),S=p({margin:0},void 0===f?{}:f),E=!l()(x),O=E?x:"",C=(0,s.Z)("recharts-default-tooltip",y),j=(0,s.Z)("recharts-tooltip-label",b);return E&&w&&null!=m&&(O=w(x,m)),r.createElement("div",{className:C,style:k},r.createElement("p",{className:j,style:S},r.isValidElement(O)?O:"".concat(O)),function(){if(m&&m.length){var e=(v?a()(m,v):m).map(function(e,t){if("none"===e.type)return null;var o=p({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},u),a=e.formatter||g||h,i=e.value,l=e.name,s=i,f=l;if(a&&null!=s&&null!=f){var v=a(i,l,e,t,m);if(Array.isArray(v)){var y=function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(v,2)||function(e,t){if(e){if("string"==typeof e)return d(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,2)}}(v,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s=y[0],f=y[1]}else s=v}return r.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:o},(0,c.P2)(f)?r.createElement("span",{className:"recharts-tooltip-item-name"},f):null,(0,c.P2)(f)?r.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,r.createElement("span",{className:"recharts-tooltip-item-value"},s),r.createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))});return r.createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())},g=n(59221);function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t,n){var r;return(r=function(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==v(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===v(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b="recharts-tooltip-wrapper",x={visibility:"hidden"};function w(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,o=e.offsetTopLeft,a=e.position,i=e.reverseDirection,l=e.tooltipDimension,s=e.viewBox,u=e.viewBoxDimension;if(a&&(0,c.hj)(a[r]))return a[r];var d=n[r]-l-o,f=n[r]+o;return t[r]?i[r]?d:f:i[r]?d<s[r]?Math.max(f,s[r]):Math.max(d,s[r]):f+l>s[r]+u?Math.max(d,s[r]):Math.max(f,s[r])}function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){return(O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function C(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=j(a);return e=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return C(e)}(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return _(C(e=o.call.apply(o,[this].concat(n))),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),_(C(e),"lastBoundingBox",{width:-1,height:-1}),_(C(e),"handleKeyDown",function(t){if("Escape"===t.key){var n,r,o,a;e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(n=null===(r=e.props.coordinate)||void 0===r?void 0:r.x)&&void 0!==n?n:0,y:null!==(o=null===(a=e.props.coordinate)||void 0===a?void 0:a.y)&&void 0!==o?o:0}})}}),e}return n=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.lastBoundingBox.width)>1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height)}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)!==this.state.dismissedAtCoordinate.x||(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var e,t,n,o,a,i,l,u,d,f,p,h,m,v,k,S,O,C,j,_,P,N=this,T=this.props,A=T.active,M=T.allowEscapeViewBox,I=T.animationDuration,R=T.animationEasing,D=T.children,L=T.coordinate,Z=T.hasPayload,z=T.isAnimationActive,B=T.offset,F=T.position,H=T.reverseDirection,q=T.useTranslate3d,W=T.viewBox,U=T.wrapperStyle,K=(v=(e={allowEscapeViewBox:M,coordinate:L,offsetTopLeft:B,position:F,reverseDirection:H,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:q,viewBox:W}).allowEscapeViewBox,k=e.coordinate,S=e.offsetTopLeft,O=e.position,C=e.reverseDirection,j=e.tooltipBox,_=e.useTranslate3d,P=e.viewBox,j.height>0&&j.width>0&&k?(n=(t={translateX:h=w({allowEscapeViewBox:v,coordinate:k,key:"x",offsetTopLeft:S,position:O,reverseDirection:C,tooltipDimension:j.width,viewBox:P,viewBoxDimension:P.width}),translateY:m=w({allowEscapeViewBox:v,coordinate:k,key:"y",offsetTopLeft:S,position:O,reverseDirection:C,tooltipDimension:j.height,viewBox:P,viewBoxDimension:P.height}),useTranslate3d:_}).translateX,o=t.translateY,a=t.useTranslate3d,p=(0,g.bO)({transform:a?"translate3d(".concat(n,"px, ").concat(o,"px, 0)"):"translate(".concat(n,"px, ").concat(o,"px)")})):p=x,{cssProperties:p,cssClasses:(u=(i={translateX:h,translateY:m,coordinate:k}).coordinate,d=i.translateX,f=i.translateY,(0,s.Z)(b,(y(l={},"".concat(b,"-right"),(0,c.hj)(d)&&u&&(0,c.hj)(u.x)&&d>=u.x),y(l,"".concat(b,"-left"),(0,c.hj)(d)&&u&&(0,c.hj)(u.x)&&d<u.x),y(l,"".concat(b,"-bottom"),(0,c.hj)(f)&&u&&(0,c.hj)(u.y)&&f>=u.y),y(l,"".concat(b,"-top"),(0,c.hj)(f)&&u&&(0,c.hj)(u.y)&&f<u.y),l)))}),$=K.cssClasses,V=K.cssProperties,X=E(E(E({},z&&A&&(0,g.bO)({transition:"transform ".concat(I,"ms ").concat(R)})),V),{},{pointerEvents:"none",visibility:!this.state.dismissed&&A&&Z?"visible":"hidden",position:"absolute",top:0,left:0},U);return r.createElement("div",{tabIndex:-1,role:"dialog",className:$,style:X,ref:function(e){N.wrapperNode=e}},D)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent),T=n(34067),A=n(93528);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t){return(D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Z(e,t,n){return(t=z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e){var t=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===M(t)?t:String(t)}function B(e){return e.dataKey}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=L(a);return e=t?Reflect.construct(n,arguments,L(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"render",value:function(){var e,t=this,n=this.props,o=n.active,a=n.allowEscapeViewBox,i=n.animationDuration,l=n.animationEasing,s=n.content,c=n.coordinate,u=n.filterNull,d=n.isAnimationActive,f=n.offset,p=n.payload,h=n.payloadUniqBy,g=n.position,v=n.reverseDirection,y=n.useTranslate3d,b=n.viewBox,x=n.wrapperStyle,w=null!=p?p:[];u&&w.length&&(w=(0,A.z)(p.filter(function(e){return null!=e.value&&(!0!==e.hide||t.props.includeHidden)}),h,B));var k=w.length>0;return r.createElement(N,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:o,coordinate:c,hasPayload:k,offset:f,position:g,reverseDirection:v,useTranslate3d:y,viewBox:b,wrapperStyle:x},(e=R(R({},this.props),{},{payload:w}),r.isValidElement(s)?r.cloneElement(s,e):"function"==typeof s?r.createElement(s,e):r.createElement(m,e)))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,z(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);Z(F,"displayName","Tooltip"),Z(F,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!T.x.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}})},9841:function(e,t,n){"use strict";n.d(t,{m:function(){return s}});var r=n(2265),o=n(87602),a=n(82944),i=["children","className"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=r.forwardRef(function(e,t){var n=e.children,s=e.className,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),u=(0,o.Z)("recharts-layer",s);return r.createElement("g",l({className:u},(0,a.L6)(c,!0),{ref:t}),n)})},48777:function(e,t,n){"use strict";n.d(t,{T:function(){return s}});var r=n(2265),o=n(87602),a=n(82944),i=["children","width","height","viewBox","className","style","title","desc"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e){var t=e.children,n=e.width,s=e.height,c=e.viewBox,u=e.className,d=e.style,f=e.title,p=e.desc,h=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),m=c||{width:n,height:s,x:0,y:0},g=(0,o.Z)("recharts-surface",u);return r.createElement("svg",l({},(0,a.L6)(h,!0,"svg"),{className:g,width:n,height:s,style:d,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),r.createElement("title",null,f),r.createElement("desc",null,p),t)}},25739:function(e,t,n){"use strict";n.d(t,{br:function(){return h},Mw:function(){return w},zn:function(){return x},sp:function(){return m},qD:function(){return b},d2:function(){return y},bH:function(){return g},Ud:function(){return v}});var r=n(2265),o=n(69398),a=n(50967),i=n.n(a)()(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),l=(0,r.createContext)(void 0),s=(0,r.createContext)(void 0),c=(0,r.createContext)(void 0),u=(0,r.createContext)({}),d=(0,r.createContext)(void 0),f=(0,r.createContext)(0),p=(0,r.createContext)(0),h=function(e){var t=e.state,n=t.xAxisMap,o=t.yAxisMap,a=t.offset,h=e.clipPathId,m=e.children,g=e.width,v=e.height,y=i(a);return r.createElement(l.Provider,{value:n},r.createElement(s.Provider,{value:o},r.createElement(u.Provider,{value:a},r.createElement(c.Provider,{value:y},r.createElement(d.Provider,{value:h},r.createElement(f.Provider,{value:v},r.createElement(p.Provider,{value:g},m)))))))},m=function(){return(0,r.useContext)(d)},g=function(e){var t=(0,r.useContext)(l);null!=t||(0,o.Z)(!1);var n=t[e];return null!=n||(0,o.Z)(!1),n},v=function(e){var t=(0,r.useContext)(s);null!=t||(0,o.Z)(!1);var n=t[e];return null!=n||(0,o.Z)(!1),n},y=function(){return(0,r.useContext)(c)},b=function(){return(0,r.useContext)(u)},x=function(){return(0,r.useContext)(p)},w=function(){return(0,r.useContext)(f)}},57165:function(e,t,n){"use strict";n.d(t,{H:function(){return $}});var r=n(2265);function o(){}function a(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function i(e){this._context=e}function l(e){this._context=e}function s(e){this._context=e}i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:a(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},l.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},s.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class c{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function u(e){this._context=e}function d(e){this._context=e}function f(e){return new d(e)}function p(e,t,n){var r=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(r||o<0&&-0),i=(n-e._y1)/(o||r<0&&-0);return((a<0?-1:1)+(i<0?-1:1))*Math.min(Math.abs(a),Math.abs(i),.5*Math.abs((a*o+i*r)/(r+o)))||0}function h(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function m(e,t,n){var r=e._x0,o=e._y0,a=e._x1,i=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,o+l*t,a-l,i-l*n,a,i)}function g(e){this._context=e}function v(e){this._context=new y(e)}function y(e){this._context=e}function b(e){this._context=e}function x(e){var t,n,r=e.length-1,o=Array(r),a=Array(r),i=Array(r);for(o[0]=0,a[0]=2,i[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,i[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,i[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=o[t]/a[t-1],a[t]-=n,i[t]-=n*i[t-1];for(o[r-1]=i[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(i[t]-o[t+1])/a[t];for(t=0,a[r-1]=(e[r]+o[r-1])/2;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function w(e,t){this._context=e,this._t=t}u.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:m(this,this._t0,h(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,m(this,h(this,n=p(this,e,t)),n);break;default:m(this,this._t0,n=p(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(v.prototype=Object.create(g.prototype)).point=function(e,t){g.prototype.point.call(this,t,e)},y.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,a){this._context.bezierCurveTo(t,e,r,n,a,o)}},b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=x(e),o=x(t),a=0,i=1;i<n;++a,++i)this._context.bezierCurveTo(r[0][a],o[0][a],r[1][a],o[1][a],e[i],t[i])}(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var k=n(22516),S=n(76115),E=n(67790);function O(e){return e[0]}function C(e){return e[1]}function j(e,t){var n=(0,S.Z)(!0),r=null,o=f,a=null,i=(0,E.d)(l);function l(l){var s,c,u,d=(l=(0,k.Z)(l)).length,f=!1;for(null==r&&(a=o(u=i())),s=0;s<=d;++s)!(s<d&&n(c=l[s],s,l))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(c,s,l),+t(c,s,l));if(u)return a=null,u+""||null}return e="function"==typeof e?e:void 0===e?O:(0,S.Z)(e),t="function"==typeof t?t:void 0===t?C:(0,S.Z)(t),l.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),l):e},l.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),l):t},l.defined=function(e){return arguments.length?(n="function"==typeof e?e:(0,S.Z)(!!e),l):n},l.curve=function(e){return arguments.length?(o=e,null!=r&&(a=o(r)),l):o},l.context=function(e){return arguments.length?(null==e?r=a=null:a=o(r=e),l):r},l}function _(e,t,n){var r=null,o=(0,S.Z)(!0),a=null,i=f,l=null,s=(0,E.d)(c);function c(c){var u,d,f,p,h,m=(c=(0,k.Z)(c)).length,g=!1,v=Array(m),y=Array(m);for(null==a&&(l=i(h=s())),u=0;u<=m;++u){if(!(u<m&&o(p=c[u],u,c))===g){if(g=!g)d=u,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),f=u-1;f>=d;--f)l.point(v[f],y[f]);l.lineEnd(),l.areaEnd()}}g&&(v[u]=+e(p,u,c),y[u]=+t(p,u,c),l.point(r?+r(p,u,c):v[u],n?+n(p,u,c):y[u]))}if(h)return l=null,h+""||null}function u(){return j().defined(o).curve(i).context(a)}return e="function"==typeof e?e:void 0===e?O:(0,S.Z)(+e),t="function"==typeof t?t:void 0===t?(0,S.Z)(0):(0,S.Z)(+t),n="function"==typeof n?n:void 0===n?C:(0,S.Z)(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:(0,S.Z)(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:(0,S.Z)(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(o="function"==typeof e?e:(0,S.Z)(!!e),c):o},c.curve=function(e){return arguments.length?(i=e,null!=a&&(l=i(a)),c):i},c.context=function(e){return arguments.length?(null==e?a=l=null:l=i(a=e),c):a},c}var P=n(75551),N=n.n(P),T=n(86757),A=n.n(T),M=n(87602),I=n(41637),R=n(82944),D=n(16630);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(){return(Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==L(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==L(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===L(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var F={curveBasisClosed:function(e){return new l(e)},curveBasisOpen:function(e){return new s(e)},curveBasis:function(e){return new i(e)},curveBumpX:function(e){return new c(e,!0)},curveBumpY:function(e){return new c(e,!1)},curveLinearClosed:function(e){return new u(e)},curveLinear:f,curveMonotoneX:function(e){return new g(e)},curveMonotoneY:function(e){return new v(e)},curveNatural:function(e){return new b(e)},curveStep:function(e){return new w(e,.5)},curveStepAfter:function(e){return new w(e,1)},curveStepBefore:function(e){return new w(e,0)}},H=function(e){return e.x===+e.x&&e.y===+e.y},q=function(e){return e.x},W=function(e){return e.y},U=function(e,t){if(A()(e))return e;var n="curve".concat(N()(e));return("curveMonotone"===n||"curveBump"===n)&&t?F["".concat(n).concat("vertical"===t?"Y":"X")]:F[n]||f},K=function(e){var t,n=e.type,r=e.points,o=void 0===r?[]:r,a=e.baseLine,i=e.layout,l=e.connectNulls,s=void 0!==l&&l,c=U(void 0===n?"linear":n,i),u=s?o.filter(function(e){return H(e)}):o;if(Array.isArray(a)){var d=s?a.filter(function(e){return H(e)}):a,f=u.map(function(e,t){return B(B({},e),{},{base:d[t]})});return(t="vertical"===i?_().y(W).x1(q).x0(function(e){return e.base.x}):_().x(q).y1(W).y0(function(e){return e.base.y})).defined(H).curve(c),t(f)}return(t="vertical"===i&&(0,D.hj)(a)?_().y(W).x1(q).x0(a):(0,D.hj)(a)?_().x(q).y1(W).y0(a):j().x(q).y(W)).defined(H).curve(c),t(u)},$=function(e){var t=e.className,n=e.points,o=e.path,a=e.pathRef;if((!n||!n.length)&&!o)return null;var i=n&&n.length?K(e):o;return r.createElement("path",Z({},(0,R.L6)(e,!1),(0,I.Ym)(e),{className:(0,M.Z)("recharts-curve",t),d:i,ref:a}))}},81889:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(2265),o=n(87602),a=n(41637),i=n(82944);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=function(e){var t=e.cx,n=e.cy,s=e.r,c=e.className,u=(0,o.Z)("recharts-dot",c);return t===+t&&n===+n&&s===+s?r.createElement("circle",l({},(0,i.L6)(e,!1),(0,a.Ym)(e),{className:u,cx:t,cy:n,r:s})):null}},73649:function(e,t,n){"use strict";n.d(t,{A:function(){return m},X:function(){return p}});var r=n(2265),o=n(87602),a=n(59221),i=n(82944);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e,t,n,r,o){var a,i=Math.min(Math.abs(n)/2,Math.abs(r)/2),l=r>=0?1:-1,s=n>=0?1:-1,c=r>=0&&n>=0||r<0&&n<0?1:0;if(i>0&&o instanceof Array){for(var u=[0,0,0,0],d=0;d<4;d++)u[d]=o[d]>i?i:o[d];a="M".concat(e,",").concat(t+l*u[0]),u[0]>0&&(a+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+s*u[0],",").concat(t)),a+="L ".concat(e+n-s*u[1],",").concat(t),u[1]>0&&(a+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,",\n ").concat(e+n,",").concat(t+l*u[1])),a+="L ".concat(e+n,",").concat(t+r-l*u[2]),u[2]>0&&(a+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,",\n ").concat(e+n-s*u[2],",").concat(t+r)),a+="L ".concat(e+s*u[3],",").concat(t+r),u[3]>0&&(a+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,",\n ").concat(e,",").concat(t+r-l*u[3])),a+="Z"}else if(i>0&&o===+o&&o>0){var f=Math.min(i,o);a="M ".concat(e,",").concat(t+l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+s*f,",").concat(t,"\n L ").concat(e+n-s*f,",").concat(t,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n,",").concat(t+l*f,"\n L ").concat(e+n,",").concat(t+r-l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n-s*f,",").concat(t+r,"\n L ").concat(e+s*f,",").concat(t+r,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e,",").concat(t+r-l*f," Z")}else a="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return a},p=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,o=t.x,a=t.y,i=t.width,l=t.height;return!!(Math.abs(i)>0&&Math.abs(l)>0)&&n>=Math.min(o,o+i)&&n<=Math.max(o,o+i)&&r>=Math.min(a,a+l)&&r<=Math.max(a,a+l)},h={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},m=function(e){var t,n=d(d({},h),e),l=(0,r.useRef)(),u=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(-1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,2)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=u[0],m=u[1];(0,r.useEffect)(function(){if(l.current&&l.current.getTotalLength)try{var e=l.current.getTotalLength();e&&m(e)}catch(e){}},[]);var g=n.x,v=n.y,y=n.width,b=n.height,x=n.radius,w=n.className,k=n.animationEasing,S=n.animationDuration,E=n.animationBegin,O=n.isAnimationActive,C=n.isUpdateAnimationActive;if(g!==+g||v!==+v||y!==+y||b!==+b||0===y||0===b)return null;var j=(0,o.Z)("recharts-rectangle",w);return C?r.createElement(a.ZP,{canBegin:p>0,from:{width:y,height:b,x:g,y:v},to:{width:y,height:b,x:g,y:v},duration:S,animationEasing:k,isActive:C},function(e){var t=e.width,o=e.height,c=e.x,u=e.y;return r.createElement(a.ZP,{canBegin:p>0,from:"0px ".concat(-1===p?1:p,"px"),to:"".concat(p,"px 0px"),attributeName:"strokeDasharray",begin:E,duration:S,isActive:O,easing:k},r.createElement("path",s({},(0,i.L6)(n,!0),{className:j,d:f(c,u,t,o,x),ref:l})))}):r.createElement("path",s({},(0,i.L6)(n,!0),{className:j,d:f(g,v,y,b,x)}))}},60474:function(e,t,n){"use strict";n.d(t,{L:function(){return g}});var r=n(2265),o=n(87602),a=n(82944),i=n(39206),l=n(16630);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e){var t=e.cx,n=e.cy,r=e.radius,o=e.angle,a=e.sign,l=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,u=s*(l?1:-1)+r,d=Math.asin(s/u)/i.Wk,f=c?o:o+a*d;return{center:(0,i.op)(t,n,u,f),circleTangency:(0,i.op)(t,n,r,f),lineTangency:(0,i.op)(t,n,u*Math.cos(d*i.Wk),c?o-a*d:o),theta:d}},p=function(e){var t,n=e.cx,r=e.cy,o=e.innerRadius,a=e.outerRadius,s=e.startAngle,c=(t=e.endAngle,(0,l.uY)(t-s)*Math.min(Math.abs(t-s),359.999)),u=s+c,d=(0,i.op)(n,r,a,s),f=(0,i.op)(n,r,a,u),p="M ".concat(d.x,",").concat(d.y,"\n A ").concat(a,",").concat(a,",0,\n ").concat(+(Math.abs(c)>180),",").concat(+(s>u),",\n ").concat(f.x,",").concat(f.y,"\n ");if(o>0){var h=(0,i.op)(n,r,o,s),m=(0,i.op)(n,r,o,u);p+="L ".concat(m.x,",").concat(m.y,"\n A ").concat(o,",").concat(o,",0,\n ").concat(+(Math.abs(c)>180),",").concat(+(s<=u),",\n ").concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(n,",").concat(r," Z");return p},h=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,i=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=(0,l.uY)(u-c),h=f({cx:t,cy:n,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),m=h.circleTangency,g=h.lineTangency,v=h.theta,y=f({cx:t,cy:n,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:s}),b=y.circleTangency,x=y.lineTangency,w=y.theta,k=s?Math.abs(c-u):Math.abs(c-u)-v-w;if(k<0)return i?"M ".concat(g.x,",").concat(g.y,"\n a").concat(a,",").concat(a,",0,0,1,").concat(2*a,",0\n a").concat(a,",").concat(a,",0,0,1,").concat(-(2*a),",0\n "):p({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:c,endAngle:u});var S="M ".concat(g.x,",").concat(g.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,"\n A").concat(o,",").concat(o,",0,").concat(+(k>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,"\n ");if(r>0){var E=f({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),O=E.circleTangency,C=E.lineTangency,j=E.theta,_=f({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),P=_.circleTangency,N=_.lineTangency,T=_.theta,A=s?Math.abs(c-u):Math.abs(c-u)-j-T;if(A<0&&0===a)return"".concat(S,"L").concat(t,",").concat(n,"Z");S+="L".concat(N.x,",").concat(N.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,"\n A").concat(r,",").concat(r,",0,").concat(+(A>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(C.x,",").concat(C.y,"Z")}else S+="L".concat(t,",").concat(n,"Z");return S},m={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},g=function(e){var t,n=d(d({},m),e),i=n.cx,s=n.cy,u=n.innerRadius,f=n.outerRadius,g=n.cornerRadius,v=n.forceCornerRadius,y=n.cornerIsExternal,b=n.startAngle,x=n.endAngle,w=n.className;if(f<u||b===x)return null;var k=(0,o.Z)("recharts-sector",w),S=f-u,E=(0,l.h1)(g,S,0,!0);return t=E>0&&360>Math.abs(b-x)?h({cx:i,cy:s,innerRadius:u,outerRadius:f,cornerRadius:Math.min(E,S/2),forceCornerRadius:v,cornerIsExternal:y,startAngle:b,endAngle:x}):p({cx:i,cy:s,innerRadius:u,outerRadius:f,startAngle:b,endAngle:x}),r.createElement("path",c({},(0,a.L6)(n,!0),{className:k,d:t,role:"img"}))}},14870:function(e,t,n){"use strict";n.d(t,{v:function(){return M}});var r=n(2265),o=n(75551),a=n.n(o);let i=Math.cos,l=Math.sin,s=Math.sqrt,c=Math.PI,u=2*c;var d={draw(e,t){let n=s(t/c);e.moveTo(n,0),e.arc(0,0,n,0,u)}};let f=s(1/3),p=2*f,h=l(c/10)/l(7*c/10),m=l(u/10)*h,g=-i(u/10)*h,v=s(3),y=s(3)/2,b=1/s(12),x=(b/2+1)*3;var w=n(76115),k=n(67790);s(3),s(3);var S=n(87602),E=n(82944);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var C=["type","size","sizeType"];function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==O(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==O(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===O(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var N={symbolCircle:d,symbolCross:{draw(e,t){let n=s(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},symbolDiamond:{draw(e,t){let n=s(t/p),r=n*f;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},symbolSquare:{draw(e,t){let n=s(t),r=-n/2;e.rect(r,r,n,n)}},symbolStar:{draw(e,t){let n=s(.8908130915292852*t),r=m*n,o=g*n;e.moveTo(0,-n),e.lineTo(r,o);for(let t=1;t<5;++t){let a=u*t/5,s=i(a),c=l(a);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*o,c*r+s*o)}e.closePath()}},symbolTriangle:{draw(e,t){let n=-s(t/(3*v));e.moveTo(0,2*n),e.lineTo(-v*n,-n),e.lineTo(v*n,-n),e.closePath()}},symbolWye:{draw(e,t){let n=s(t/x),r=n/2,o=n*b,a=n*b+n,i=-r;e.moveTo(r,o),e.lineTo(r,a),e.lineTo(i,a),e.lineTo(-.5*r-y*o,y*r+-.5*o),e.lineTo(-.5*r-y*a,y*r+-.5*a),e.lineTo(-.5*i-y*a,y*i+-.5*a),e.lineTo(-.5*r+y*o,-.5*o-y*r),e.lineTo(-.5*r+y*a,-.5*a-y*r),e.lineTo(-.5*i+y*a,-.5*a-y*i),e.closePath()}}},T=Math.PI/180,A=function(e,t,n){if("area"===t)return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var r=18*T;return 1.25*e*e*(Math.tan(r)-Math.tan(2*r)*Math.pow(Math.tan(r),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},M=function(e){var t,n=e.type,o=void 0===n?"circle":n,i=e.size,l=void 0===i?64:i,s=e.sizeType,c=void 0===s?"area":s,u=P(P({},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,C)),{},{type:o,size:l,sizeType:c}),f=u.className,p=u.cx,h=u.cy,m=(0,E.L6)(u,!0);return p===+p&&h===+h&&l===+l?r.createElement("path",j({},m,{className:(0,S.Z)("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(h,")"),d:(t=N["symbol".concat(a()(o))]||d,(function(e,t){let n=null,r=(0,k.d)(o);function o(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return e="function"==typeof e?e:(0,w.Z)(e||d),t="function"==typeof t?t:(0,w.Z)(void 0===t?64:+t),o.type=function(t){return arguments.length?(e="function"==typeof t?t:(0,w.Z)(t),o):e},o.size=function(e){return arguments.length?(t="function"==typeof e?e:(0,w.Z)(+e),o):t},o.context=function(e){return arguments.length?(n=null==e?null:e,o):n},o})().type(t).size(A(l,c,o))())})):null};M.registerSymbol=function(e,t){N["symbol".concat(a()(e))]=t}},11638:function(e,t,n){"use strict";n.d(t,{bn:function(){return A},a3:function(){return z},lT:function(){return M},V$:function(){return I},w7:function(){return R}});var r=n(2265),o=n(86757),a=n.n(o),i=n(90231),l=n.n(i),s=n(24342),c=n.n(s),u=n(21652),d=n.n(u),f=n(73649),p=n(87602),h=n(59221),m=n(82944);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(){return(v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var w=function(e,t,n,r,o){var a=n-r;return"M ".concat(e,",").concat(t)+"L ".concat(e+n,",").concat(t)+"L ".concat(e+n-a/2,",").concat(t+o)+"L ".concat(e+n-a/2-r,",").concat(t+o)+"L ".concat(e,",").concat(t," Z")},k={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},S=function(e){var t,n=x(x({},k),e),o=(0,r.useRef)(),a=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(-1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,2)||function(e,t){if(e){if("string"==typeof e)return y(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],l=a[1];(0,r.useEffect)(function(){if(o.current&&o.current.getTotalLength)try{var e=o.current.getTotalLength();e&&l(e)}catch(e){}},[]);var s=n.x,c=n.y,u=n.upperWidth,d=n.lowerWidth,f=n.height,g=n.className,b=n.animationEasing,S=n.animationDuration,E=n.animationBegin,O=n.isUpdateAnimationActive;if(s!==+s||c!==+c||u!==+u||d!==+d||f!==+f||0===u&&0===d||0===f)return null;var C=(0,p.Z)("recharts-trapezoid",g);return O?r.createElement(h.ZP,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:f,x:s,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:s,y:c},duration:S,animationEasing:b,isActive:O},function(e){var t=e.upperWidth,a=e.lowerWidth,l=e.height,s=e.x,c=e.y;return r.createElement(h.ZP,{canBegin:i>0,from:"0px ".concat(-1===i?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:E,duration:S,easing:b},r.createElement("path",v({},(0,m.L6)(n,!0),{className:C,d:w(s,c,t,a,l),ref:o})))}):r.createElement("g",null,r.createElement("path",v({},(0,m.L6)(n,!0),{className:C,d:w(s,c,u,d,f)})))},E=n(60474),O=n(9841),C=n(14870),j=["option","shapeType","propTransformer","activeClassName","isActive"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return r.createElement(f.A,n);case"trapezoid":return r.createElement(S,n);case"sector":return r.createElement(E.L,n);case"symbols":if("symbols"===t)return r.createElement(C.v,n);break;default:return null}}function A(e){var t,n=e.option,o=e.shapeType,i=e.propTransformer,s=e.activeClassName,u=e.isActive,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,j);if((0,r.isValidElement)(n))t=(0,r.cloneElement)(n,N(N({},d),(0,r.isValidElement)(n)?n.props:n));else if(a()(n))t=n(d);else if(l()(n)&&!c()(n)){var f=(void 0===i?function(e,t){return N(N({},t),e)}:i)(n,d);t=r.createElement(T,{shapeType:o,elementProps:f})}else t=r.createElement(T,{shapeType:o,elementProps:d});return u?r.createElement(O.m,{className:void 0===s?"recharts-active-shape":s},t):t}function M(e,t){return null!=t&&"trapezoids"in e.props}function I(e,t){return null!=t&&"sectors"in e.props}function R(e,t){return null!=t&&"points"in e.props}function D(e,t){var n,r,o=e.x===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.x)||e.x===t.x,a=e.y===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.y)||e.y===t.y;return o&&a}function L(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Z(e,t){var n=e.x===t.x,r=e.y===t.y,o=e.z===t.z;return n&&r&&o}function z(e){var t,n,r,o=e.activeTooltipItem,a=e.graphicalItem,i=e.itemData,l=(M(a,o)?t="trapezoids":I(a,o)?t="sectors":R(a,o)&&(t="points"),t),s=M(a,o)?null===(n=o.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:I(a,o)?null===(r=o.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:R(a,o)?o.payload:{},c=i.filter(function(e,t){var n=d()(s,e),r=a.props[l].filter(function(e){var t;return(M(a,o)?t=D:I(a,o)?t=L:R(a,o)&&(t=Z),t)(e,o)}),i=a.props[l].indexOf(r[r.length-1]);return n&&t===i});return i.indexOf(c[c.length-1])}},25311:function(e,t,n){"use strict";n.d(t,{Ky:function(){return w},O1:function(){return y},_b:function(){return b},t9:function(){return v},xE:function(){return k}});var r=n(41443),o=n.n(r),a=n(32242),i=n.n(a),l=n(85355),s=n(82944),c=n(16630),u=n(31699);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var v=function(e,t,n,r,o){var a=e.width,i=e.height,d=e.layout,f=e.children,p=Object.keys(t),g={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:i-n.bottom,bottomMirror:i-n.bottom},v=!!(0,s.sP)(f,u.$);return p.reduce(function(a,i){var s,u,f,p,y,b=t[i],x=b.orientation,w=b.domain,k=b.padding,S=void 0===k?{}:k,E=b.mirror,O=b.reversed,C="".concat(x).concat(E?"Mirror":"");if("number"===b.type&&("gap"===b.padding||"no-gap"===b.padding)){var j=w[1]-w[0],_=1/0,P=b.categoricalDomain.sort();P.forEach(function(e,t){t>0&&(_=Math.min((e||0)-(P[t-1]||0),_))});var N=_/j,T="vertical"===b.layout?n.height:n.width;if("gap"===b.padding&&(s=N*T/2),"no-gap"===b.padding){var A=(0,c.h1)(e.barCategoryGap,N*T),M=N*T/2;s=M-A-(M-A)/T*A}}u="xAxis"===r?[n.left+(S.left||0)+(s||0),n.left+n.width-(S.right||0)-(s||0)]:"yAxis"===r?"horizontal"===d?[n.top+n.height-(S.bottom||0),n.top+(S.top||0)]:[n.top+(S.top||0)+(s||0),n.top+n.height-(S.bottom||0)-(s||0)]:b.range,O&&(u=[u[1],u[0]]);var I=(0,l.Hq)(b,o,v),R=I.scale,D=I.realScaleType;R.domain(w).range(u),(0,l.zF)(R);var L=(0,l.g$)(R,h(h({},b),{},{realScaleType:D}));"xAxis"===r?(y="top"===x&&!E||"bottom"===x&&E,f=n.left,p=g[C]-y*b.height):"yAxis"===r&&(y="left"===x&&!E||"right"===x&&E,f=g[C]-y*b.width,p=n.top);var Z=h(h(h({},b),L),{},{realScaleType:D,x:f,y:p,scale:R,width:"xAxis"===r?n.width:b.width,height:"yAxis"===r?n.height:b.height});return Z.bandSize=(0,l.zT)(Z,L),b.hide||"xAxis"!==r?b.hide||(g[C]+=(y?-1:1)*Z.width):g[C]+=(y?-1:1)*Z.height,h(h({},a),{},m({},i,Z))},{})},y=function(e,t){var n=e.x,r=e.y,o=t.x,a=t.y;return{x:Math.min(n,o),y:Math.min(r,a),width:Math.abs(o-n),height:Math.abs(a-r)}},b=function(e){return y({x:e.x1,y:e.y1},{x:e.x2,y:e.y2})},x=function(){var e,t;function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this.scale=e}return e=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=t.position;if(void 0!==e){if(r)switch(r){case"start":default:return this.scale(e);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o;case"end":var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a}if(n){var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],t=[{key:"create",value:function(e){return new n(e)}}],e&&f(n.prototype,e),t&&f(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();m(x,"EPS",1e-4);var w=function(e){var t=Object.keys(e).reduce(function(t,n){return h(h({},t),{},m({},n,x.create(e[n])))},{});return h(h({},t),{},{apply:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware,a=n.position;return o()(e,function(e,n){return t[n].apply(e,{bandAware:r,position:a})})},isInRange:function(e){return i()(e,function(e,n){return t[n].isInRange(e)})}})},k=function(e){var t=e.width,n=e.height,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(r%180+180)%180*Math.PI/180,a=Math.atan(n/t);return Math.abs(o>a&&o<Math.PI-a?n/Math.sin(o):t/Math.cos(o))}},85355:function(e,t,n){"use strict";n.d(t,{By:function(){return r4},VO:function(){return r0},zF:function(){return oo},DO:function(){return on},Bu:function(){return oa},zT:function(){return ob},qz:function(){return r6},pt:function(){return r2},Yj:function(){return op},Fy:function(){return of},Hv:function(){return od},Rf:function(){return r9},gF:function(){return rJ},s6:function(){return r8},EB:function(){return om},fk:function(){return r1},wh:function(){return oc},O3:function(){return oh},uY:function(){return oe},g$:function(){return ou},Qo:function(){return ow},F$:function(){return rQ},NA:function(){return r7},ko:function(){return ox},ZI:function(){return r5},Hq:function(){return or},LG:function(){return oy},Vv:function(){return oi}});var r,o,a,i,l,s,c,u={};n.r(u),n.d(u,{scaleBand:function(){return d.Z},scaleDiverging:function(){return function e(){var t=eR(nQ()(eg));return t.copy=function(){return nX(t,e())},eS.O.apply(t,arguments)}},scaleDivergingLog:function(){return function e(){var t=eW(nQ()).domain([.1,1,10]);return t.copy=function(){return nX(t,e()).base(t.base())},eS.O.apply(t,arguments)}},scaleDivergingPow:function(){return nJ},scaleDivergingSqrt:function(){return n0},scaleDivergingSymlog:function(){return function e(){var t=e$(nQ());return t.copy=function(){return nX(t,e()).constant(t.constant())},eS.O.apply(t,arguments)}},scaleIdentity:function(){return function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,eh),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,eh):[0,1],eR(r)}},scaleImplicit:function(){return eV.O},scaleLinear:function(){return eD},scaleLog:function(){return function e(){let t=eW(ew()).domain([1,10]);return t.copy=()=>ex(t,e()).base(t.base()),eS.o.apply(t,arguments),t}},scaleOrdinal:function(){return eV.Z},scalePoint:function(){return d.x},scalePow:function(){return eJ},scaleQuantile:function(){return function e(){var t,n=[],r=[],o=[];function a(){var e=0,t=Math.max(1,r.length);for(o=Array(t-1);++e<t;)o[e-1]=function(e,t,n=S){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,a=Math.floor(o),i=+n(e[a],a,e);return i+(+n(e[a+1],a+1,e)-i)*(o-a)}}(n,e/t);return i}function i(e){return null==e||isNaN(e=+e)?t:r[O(o,e)]}return i.invertExtent=function(e){var t=r.indexOf(e);return t<0?[NaN,NaN]:[t>0?o[t-1]:n[0],t<o.length?o[t]:n[n.length-1]]},i.domain=function(e){if(!arguments.length)return n.slice();for(let t of(n=[],e))null==t||isNaN(t=+t)||n.push(t);return n.sort(b),a()},i.range=function(e){return arguments.length?(r=Array.from(e),a()):r.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return o.slice()},i.copy=function(){return e().domain(n).range(r).unknown(t)},eS.o.apply(i,arguments)}},scaleQuantize:function(){return function e(){var t,n=0,r=1,o=1,a=[.5],i=[0,1];function l(e){return null!=e&&e<=e?i[O(a,e,0,o)]:t}function s(){var e=-1;for(a=Array(o);++e<o;)a[e]=((e+1)*r-(e-o)*n)/(o+1);return l}return l.domain=function(e){return arguments.length?([n,r]=e,n=+n,r=+r,s()):[n,r]},l.range=function(e){return arguments.length?(o=(i=Array.from(e)).length-1,s()):i.slice()},l.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,a[0]]:t>=o?[a[o-1],r]:[a[t-1],a[t]]},l.unknown=function(e){return arguments.length&&(t=e),l},l.thresholds=function(){return a.slice()},l.copy=function(){return e().domain([n,r]).range(i).unknown(t)},eS.o.apply(eR(l),arguments)}},scaleRadial:function(){return function e(){var t,n=ek(),r=[0,1],o=!1;function a(e){var r,a=Math.sign(r=n(e))*Math.sqrt(Math.abs(r));return isNaN(a)?t:o?Math.round(a):a}return a.invert=function(e){return n.invert(e1(e))},a.domain=function(e){return arguments.length?(n.domain(e),a):n.domain()},a.range=function(e){return arguments.length?(n.range((r=Array.from(e,eh)).map(e1)),a):r.slice()},a.rangeRound=function(e){return a.range(e).round(!0)},a.round=function(e){return arguments.length?(o=!!e,a):o},a.clamp=function(e){return arguments.length?(n.clamp(e),a):n.clamp()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e(n.domain(),r).round(o).clamp(n.clamp()).unknown(t)},eS.o.apply(a,arguments),eR(a)}},scaleSequential:function(){return function e(){var t=eR(nV()(eg));return t.copy=function(){return nX(t,e())},eS.O.apply(t,arguments)}},scaleSequentialLog:function(){return function e(){var t=eW(nV()).domain([1,10]);return t.copy=function(){return nX(t,e()).base(t.base())},eS.O.apply(t,arguments)}},scaleSequentialPow:function(){return nG},scaleSequentialQuantile:function(){return function e(){var t=[],n=eg;function r(e){if(null!=e&&!isNaN(e=+e))return n((O(t,e,1)-1)/(t.length-1))}return r.domain=function(e){if(!arguments.length)return t.slice();for(let n of(t=[],e))null==n||isNaN(n=+n)||t.push(n);return t.sort(b),r},r.interpolator=function(e){return arguments.length?(n=e,r):n},r.range=function(){return t.map((e,r)=>n(r/(t.length-1)))},r.quantiles=function(e){return Array.from({length:e+1},(n,r)=>(function(e,t,n){if(!(!(r=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,void 0))).length)||isNaN(t=+t))){if(t<=0||r<2)return e6(e);if(t>=1)return e2(e);var r,o=(r-1)*t,a=Math.floor(o),i=e2((function e(t,n,r=0,o=1/0,a){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),o=Math.floor(Math.min(t.length-1,o)),!(r<=n&&n<=o))return t;for(a=void 0===a?e4:function(e=b){if(e===b)return e4;if("function"!=typeof e)throw TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(a);o>r;){if(o-r>600){let i=o-r+1,l=n-r+1,s=Math.log(i),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(i-c)/i)*(l-i/2<0?-1:1),d=Math.max(r,Math.floor(n-l*c/i+u)),f=Math.min(o,Math.floor(n+(i-l)*c/i+u));e(t,n,d,f,a)}let i=t[n],l=r,s=o;for(e3(t,r,n),a(t[o],i)>0&&e3(t,r,o);l<s;){for(e3(t,l,s),++l,--s;0>a(t[l],i);)++l;for(;a(t[s],i)>0;)--s}0===a(t[r],i)?e3(t,r,s):e3(t,++s,o),s<=n&&(r=s+1),n<=s&&(o=s-1)}return t})(e,a).subarray(0,a+1));return i+(e6(e.subarray(a+1))-i)*(o-a)}})(t,r/e))},r.copy=function(){return e(n).domain(t)},eS.O.apply(r,arguments)}},scaleSequentialSqrt:function(){return nY},scaleSequentialSymlog:function(){return function e(){var t=e$(nV());return t.copy=function(){return nX(t,e()).constant(t.constant())},eS.O.apply(t,arguments)}},scaleSqrt:function(){return e0},scaleSymlog:function(){return function e(){var t=e$(ew());return t.copy=function(){return ex(t,e()).constant(t.constant())},eS.o.apply(t,arguments)}},scaleThreshold:function(){return function e(){var t,n=[.5],r=[0,1],o=1;function a(e){return null!=e&&e<=e?r[O(n,e,0,o)]:t}return a.domain=function(e){return arguments.length?(o=Math.min((n=Array.from(e)).length,r.length-1),a):n.slice()},a.range=function(e){return arguments.length?(r=Array.from(e),o=Math.min(n.length,r.length-1),a):r.slice()},a.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e().domain(n).range(r).unknown(t)},eS.o.apply(a,arguments)}},scaleTime:function(){return nK},scaleUtc:function(){return n$},tickFormat:function(){return eI}});var d=n(55284);let f=Math.sqrt(50),p=Math.sqrt(10),h=Math.sqrt(2);function m(e,t,n){let r,o,a;let i=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(i)),s=i/Math.pow(10,l),c=s>=f?10:s>=p?5:s>=h?2:1;return(l<0?(r=Math.round(e*(a=Math.pow(10,-l)/c)),o=Math.round(t*a),r/a<e&&++r,o/a>t&&--o,a=-a):(r=Math.round(e/(a=Math.pow(10,l)*c)),o=Math.round(t/a),r*a<e&&++r,o*a>t&&--o),o<r&&.5<=n&&n<2)?m(e,t,2*n):[r,o,a]}function g(e,t,n){if(t=+t,e=+e,!((n=+n)>0))return[];if(e===t)return[e];let r=t<e,[o,a,i]=r?m(t,e,n):m(e,t,n);if(!(a>=o))return[];let l=a-o+1,s=Array(l);if(r){if(i<0)for(let e=0;e<l;++e)s[e]=-((a-e)/i);else for(let e=0;e<l;++e)s[e]=(a-e)*i}else if(i<0)for(let e=0;e<l;++e)s[e]=-((o+e)/i);else for(let e=0;e<l;++e)s[e]=(o+e)*i;return s}function v(e,t,n){return m(e=+e,t=+t,n=+n)[2]}function y(e,t,n){t=+t,e=+e,n=+n;let r=t<e,o=r?v(t,e,n):v(e,t,n);return(r?-1:1)*(o<0?-(1/o):o)}function b(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function x(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function w(e){let t,n,r;function o(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>n(e[t],r)?o=t+1:a=t}while(o<a)}return o}return 2!==e.length?(t=b,n=(t,n)=>b(e(t),n),r=(t,n)=>e(t)-n):(t=e===b||e===x?e:k,n=e,r=e),{left:o,center:function(e,t,n=0,a=e.length){let i=o(e,t,n,a-1);return i>n&&r(e[i-1],t)>-r(e[i],t)?i-1:i},right:function(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>=n(e[t],r)?o=t+1:a=t}while(o<a)}return o}}}function k(){return 0}function S(e){return null===e?NaN:+e}let E=w(b),O=E.right;function C(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function j(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _(){}E.left,w(S).center;var P="\\s*([+-]?\\d+)\\s*",N="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",T="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A=/^#([0-9a-f]{3,8})$/,M=RegExp(`^rgb\\(${P},${P},${P}\\)$`),I=RegExp(`^rgb\\(${T},${T},${T}\\)$`),R=RegExp(`^rgba\\(${P},${P},${P},${N}\\)$`),D=RegExp(`^rgba\\(${T},${T},${T},${N}\\)$`),L=RegExp(`^hsl\\(${N},${T},${T}\\)$`),Z=RegExp(`^hsla\\(${N},${T},${T},${N}\\)$`),z={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function B(){return this.rgb().formatHex()}function F(){return this.rgb().formatRgb()}function H(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=A.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?q(t):3===n?new K(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?W(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?W(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=M.exec(e))?new K(t[1],t[2],t[3],1):(t=I.exec(e))?new K(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=R.exec(e))?W(t[1],t[2],t[3],t[4]):(t=D.exec(e))?W(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=L.exec(e))?Q(t[1],t[2]/100,t[3]/100,1):(t=Z.exec(e))?Q(t[1],t[2]/100,t[3]/100,t[4]):z.hasOwnProperty(e)?q(z[e]):"transparent"===e?new K(NaN,NaN,NaN,0):null}function q(e){return new K(e>>16&255,e>>8&255,255&e,1)}function W(e,t,n,r){return r<=0&&(e=t=n=NaN),new K(e,t,n,r)}function U(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof _||(o=H(o)),o)?new K((o=o.rgb()).r,o.g,o.b,o.opacity):new K:new K(e,t,n,null==r?1:r)}function K(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function $(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}`}function V(){let e=X(this.opacity);return`${1===e?"rgb(":"rgba("}${G(this.r)}, ${G(this.g)}, ${G(this.b)}${1===e?")":`, ${e})`}`}function X(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function G(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Y(e){return((e=G(e))<16?"0":"")+e.toString(16)}function Q(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ee(e,t,n,r)}function J(e){if(e instanceof ee)return new ee(e.h,e.s,e.l,e.opacity);if(e instanceof _||(e=H(e)),!e)return new ee;if(e instanceof ee)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,l=a-o,s=(a+o)/2;return l?(i=t===a?(n-r)/l+(n<r)*6:n===a?(r-t)/l+2:(t-n)/l+4,l/=s<.5?a+o:2-a-o,i*=60):l=s>0&&s<1?0:i,new ee(i,l,s,e.opacity)}function ee(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function et(e){return(e=(e||0)%360)<0?e+360:e}function en(e){return Math.max(0,Math.min(1,e||0))}function er(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function eo(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}C(_,H,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:B,formatHex:B,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return J(this).formatHsl()},formatRgb:F,toString:F}),C(K,U,j(_,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new K(G(this.r),G(this.g),G(this.b),X(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$,formatHex:$,formatHex8:function(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}${Y((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:V,toString:V})),C(ee,function(e,t,n,r){return 1==arguments.length?J(e):new ee(e,t,n,null==r?1:r)},j(_,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ee(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new K(er(e>=240?e-240:e+120,o,r),er(e,o,r),er(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ee(et(this.h),en(this.s),en(this.l),X(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=X(this.opacity);return`${1===e?"hsl(":"hsla("}${et(this.h)}, ${100*en(this.s)}%, ${100*en(this.l)}%${1===e?")":`, ${e})`}`}}));var ea=e=>()=>e;function ei(e,t){var n=t-e;return n?function(t){return e+t*n}:ea(isNaN(e)?t:e)}var el=function e(t){var n,r=1==(n=+(n=t))?ei:function(e,t){var r,o,a;return t-e?(r=e,o=t,r=Math.pow(r,a=n),o=Math.pow(o,a)-r,a=1/a,function(e){return Math.pow(r+e*o,a)}):ea(isNaN(e)?t:e)};function o(e,t){var n=r((e=U(e)).r,(t=U(t)).r),o=r(e.g,t.g),a=r(e.b,t.b),i=ei(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function es(e){return function(t){var n,r,o=t.length,a=Array(o),i=Array(o),l=Array(o);for(n=0;n<o;++n)r=U(t[n]),a[n]=r.r||0,i[n]=r.g||0,l[n]=r.b||0;return a=e(a),i=e(i),l=e(l),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=l(e),r+""}}}function ec(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}es(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,l=r<t-1?e[r+2]:2*a-o;return eo((n-r/t)*t,i,o,a,l)}}),es(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],l=e[(r+2)%t];return eo((n-r/t)*t,o,a,i,l)}});var eu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ed=RegExp(eu.source,"g");function ef(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?ea(t):("number"===o?ec:"string"===o?(r=H(t))?(t=r,el):function(e,t){var n,r,o,a,i,l=eu.lastIndex=ed.lastIndex=0,s=-1,c=[],u=[];for(e+="",t+="";(o=eu.exec(e))&&(a=ed.exec(t));)(i=a.index)>l&&(i=t.slice(l,i),c[s]?c[s]+=i:c[++s]=i),(o=o[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,u.push({i:s,x:ec(o,a)})),l=ed.lastIndex;return l<t.length&&(i=t.slice(l),c[s]?c[s]+=i:c[++s]=i),c.length<2?u[0]?(n=u[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=u.length,function(e){for(var n,r=0;r<t;++r)c[(n=u[r]).i]=n.x(e);return c.join("")})}:t instanceof H?el:t instanceof Date?function(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=Array(o),i=Array(r);for(n=0;n<o;++n)a[n]=ef(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=ef(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:ec:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}})(e,t)}function ep(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function eh(e){return+e}var em=[0,1];function eg(e){return e}function ev(e,t){var n;return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n})}function ey(e,t,n){var r=e[0],o=e[1],a=t[0],i=t[1];return o<r?(r=ev(o,r),a=n(i,a)):(r=ev(r,o),a=n(a,i)),function(e){return a(r(e))}}function eb(e,t,n){var r=Math.min(e.length,t.length)-1,o=Array(r),a=Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)o[i]=ev(e[i],e[i+1]),a[i]=n(t[i],t[i+1]);return function(t){var n=O(e,t,1,r)-1;return a[n](o[n](t))}}function ex(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ew(){var e,t,n,r,o,a,i=em,l=em,s=ef,c=eg;function u(){var e,t,n,s=Math.min(i.length,l.length);return c!==eg&&(e=i[0],t=i[s-1],e>t&&(n=e,e=t,t=n),c=function(n){return Math.max(e,Math.min(t,n))}),r=s>2?eb:ey,o=a=null,d}function d(t){return null==t||isNaN(t=+t)?n:(o||(o=r(i.map(e),l,s)))(e(c(t)))}return d.invert=function(n){return c(t((a||(a=r(l,i.map(e),ec)))(n)))},d.domain=function(e){return arguments.length?(i=Array.from(e,eh),u()):i.slice()},d.range=function(e){return arguments.length?(l=Array.from(e),u()):l.slice()},d.rangeRound=function(e){return l=Array.from(e),s=ep,u()},d.clamp=function(e){return arguments.length?(c=!!e||eg,u()):c!==eg},d.interpolate=function(e){return arguments.length?(s=e,u()):s},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function ek(){return ew()(eg,eg)}var eS=n(89999),eE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eO(e){var t;if(!(t=eE.exec(e)))throw Error("invalid format: "+e);return new eC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function eC(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ej(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function e_(e){return(e=ej(Math.abs(e)))?e[1]:NaN}function eP(e,t){var n=ej(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+Array(o-r.length+2).join("0")}eO.prototype=eC.prototype,eC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var eN={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eP(100*e,t),r:eP,s:function(e,t){var n=ej(e,t);if(!n)return e+"";var o=n[0],a=n[1],i=a-(r=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,l=o.length;return i===l?o:i>l?o+Array(i-l+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+Array(1-i).join("0")+ej(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function eT(e){return e}var eA=Array.prototype.map,eM=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function eI(e,t,n,r){var o,l,s=y(e,t,n);switch((r=eO(null==r?",f":r)).type){case"s":var c=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(l=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(e_(c)/3)))-e_(Math.abs(s))))||(r.precision=l),i(r,c);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(l=Math.max(0,e_(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(o=Math.abs(o=s)))-e_(o))+1)||(r.precision=l-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(l=Math.max(0,-e_(Math.abs(s))))||(r.precision=l-("%"===r.type)*2)}return a(r)}function eR(e){var t=e.domain;return e.ticks=function(e){var n=t();return g(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return eI(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,a=t(),i=0,l=a.length-1,s=a[i],c=a[l],u=10;for(c<s&&(o=s,s=c,c=o,o=i,i=l,l=o);u-- >0;){if((o=v(s,c,n))===r)return a[i]=s,a[l]=c,t(a);if(o>0)s=Math.floor(s/o)*o,c=Math.ceil(c/o)*o;else if(o<0)s=Math.ceil(s*o)/o,c=Math.floor(c*o)/o;else break;r=o}return e},e}function eD(){var e=ek();return e.copy=function(){return ex(e,eD())},eS.o.apply(e,arguments),eR(e)}function eL(e,t){e=e.slice();var n,r=0,o=e.length-1,a=e[r],i=e[o];return i<a&&(n=r,r=o,o=n,n=a,a=i,i=n),e[r]=t.floor(a),e[o]=t.ceil(i),e}function eZ(e){return Math.log(e)}function ez(e){return Math.exp(e)}function eB(e){return-Math.log(-e)}function eF(e){return-Math.exp(-e)}function eH(e){return isFinite(e)?+("1e"+e):e<0?0:e}function eq(e){return(t,n)=>-e(-t,n)}function eW(e){let t,n;let r=e(eZ,ez),o=r.domain,i=10;function l(){var a,l;return t=(a=i)===Math.E?Math.log:10===a&&Math.log10||2===a&&Math.log2||(a=Math.log(a),e=>Math.log(e)/a),n=10===(l=i)?eH:l===Math.E?Math.exp:e=>Math.pow(l,e),o()[0]<0?(t=eq(t),n=eq(n),e(eB,eF)):e(eZ,ez),r}return r.base=function(e){return arguments.length?(i=+e,l()):i},r.domain=function(e){return arguments.length?(o(e),l()):o()},r.ticks=e=>{let r,a;let l=o(),s=l[0],c=l[l.length-1],u=c<s;u&&([s,c]=[c,s]);let d=t(s),f=t(c),p=null==e?10:+e,h=[];if(!(i%1)&&f-d<p){if(d=Math.floor(d),f=Math.ceil(f),s>0){for(;d<=f;++d)for(r=1;r<i;++r)if(!((a=d<0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}}else for(;d<=f;++d)for(r=i-1;r>=1;--r)if(!((a=d>0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}2*h.length<p&&(h=g(s,c,p))}else h=g(d,f,Math.min(f-d,p)).map(n);return u?h.reverse():h},r.tickFormat=(e,o)=>{if(null==e&&(e=10),null==o&&(o=10===i?"s":","),"function"!=typeof o&&(i%1||null!=(o=eO(o)).precision||(o.trim=!0),o=a(o)),e===1/0)return o;let l=Math.max(1,i*e/r.ticks().length);return e=>{let r=e/n(Math.round(t(e)));return r*i<i-.5&&(r*=i),r<=l?o(e):""}},r.nice=()=>o(eL(o(),{floor:e=>n(Math.floor(t(e))),ceil:e=>n(Math.ceil(t(e)))})),r}function eU(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function eK(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function e$(e){var t=1,n=e(eU(1),eK(t));return n.constant=function(n){return arguments.length?e(eU(t=+n),eK(t)):t},eR(n)}a=(o=function(e){var t,n,o,a=void 0===e.grouping||void 0===e.thousands?eT:(t=eA.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,a=[],i=0,l=t[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),a.push(e.substring(o-=l,o+l)),!((s+=l+1)>r));)l=t[i=(i+1)%t.length];return a.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",l=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",c=void 0===e.numerals?eT:(o=eA.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return o[+e]})}),u=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"−":e.minus+"",f=void 0===e.nan?"NaN":e.nan+"";function p(e){var t=(e=eO(e)).fill,n=e.align,o=e.sign,p=e.symbol,h=e.zero,m=e.width,g=e.comma,v=e.precision,y=e.trim,b=e.type;"n"===b?(g=!0,b="g"):eN[b]||(void 0===v&&(v=12),y=!0,b="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var x="$"===p?i:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===p?l:/[%p]/.test(b)?u:"",k=eN[b],S=/[defgprs%]/.test(b);function E(e){var i,l,u,p=x,E=w;if("c"===b)E=k(e)+E,e="";else{var O=(e=+e)<0||1/e<0;if(e=isNaN(e)?f:k(Math.abs(e),v),y&&(e=function(e){t:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break t;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),O&&0==+e&&"+"!==o&&(O=!1),p=(O?"("===o?o:d:"-"===o||"("===o?"":o)+p,E=("s"===b?eM[8+r/3]:"")+E+(O&&"("===o?")":""),S){for(i=-1,l=e.length;++i<l;)if(48>(u=e.charCodeAt(i))||u>57){E=(46===u?s+e.slice(i+1):e.slice(i))+E,e=e.slice(0,i);break}}}g&&!h&&(e=a(e,1/0));var C=p.length+e.length+E.length,j=C<m?Array(m-C+1).join(t):"";switch(g&&h&&(e=a(j+e,j.length?m-E.length:1/0),j=""),n){case"<":e=p+e+E+j;break;case"=":e=p+j+e+E;break;case"^":e=j.slice(0,C=j.length>>1)+p+e+E+j.slice(C);break;default:e=j+p+e+E}return c(e)}return v=void 0===v?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),E.toString=function(){return e+""},E}return{format:p,formatPrefix:function(e,t){var n=p(((e=eO(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(e_(t)/3))),o=Math.pow(10,-r),a=eM[8+r/3];return function(e){return n(o*e)+a}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,i=o.formatPrefix;var eV=n(36967);function eX(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function eG(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function eY(e){return e<0?-e*e:e*e}function eQ(e){var t=e(eg,eg),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(eg,eg):.5===n?e(eG,eY):e(eX(n),eX(1/n)):n},eR(t)}function eJ(){var e=eQ(ew());return e.copy=function(){return ex(e,eJ()).exponent(e.exponent())},eS.o.apply(e,arguments),e}function e0(){return eJ.apply(null,arguments).exponent(.5)}function e1(e){return Math.sign(e)*e*e}function e2(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function e6(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function e4(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function e3(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}let e5=new Date,e8=new Date;function e7(e,t,n,r){function o(t){return e(t=0==arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{let t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,r,a)=>{let i;let l=[];if(n=o.ceil(n),a=null==a?1:Math.floor(a),!(n<r)||!(a>0))return l;do l.push(i=new Date(+n)),t(n,a),e(n);while(i<n&&n<r);return l},o.filter=n=>e7(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(o.count=(t,r)=>(e5.setTime(+t),e8.setTime(+r),e(e5),e(e8),Math.floor(n(e5,e8))),o.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?o.filter(r?t=>r(t)%e==0:t=>o.count(0,t)%e==0):o:null),o}let e9=e7(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);e9.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?e7(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):e9:null,e9.range;let te=e7(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());te.range;let tt=e7(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());tt.range;let tn=e7(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());tn.range;let tr=e7(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getHours());tr.range;let to=e7(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());to.range;let ta=e7(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);ta.range;let ti=e7(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);ti.range;let tl=e7(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));function ts(e){return e7(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}tl.range;let tc=ts(0),tu=ts(1),td=ts(2),tf=ts(3),tp=ts(4),th=ts(5),tm=ts(6);function tg(e){return e7(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/6048e5)}tc.range,tu.range,td.range,tf.range,tp.range,th.range,tm.range;let tv=tg(0),ty=tg(1),tb=tg(2),tx=tg(3),tw=tg(4),tk=tg(5),tS=tg(6);tv.range,ty.range,tb.range,tx.range,tw.range,tk.range,tS.range;let tE=e7(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());tE.range;let tO=e7(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());tO.range;let tC=e7(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());tC.every=e=>isFinite(e=Math.floor(e))&&e>0?e7(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,tC.range;let tj=e7(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function t_(e,t,n,r,o,a){let i=[[te,1,1e3],[te,5,5e3],[te,15,15e3],[te,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function l(t,n,r){let o=Math.abs(n-t)/r,a=w(([,,e])=>e).right(i,o);if(a===i.length)return e.every(y(t/31536e6,n/31536e6,r));if(0===a)return e9.every(Math.max(y(t,n,r),1));let[l,s]=i[o/i[a-1][2]<i[a][2]/o?a-1:a];return l.every(s)}return[function(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let o=n&&"function"==typeof n.range?n:l(e,t,n),a=o?o.range(e,+t+1):[];return r?a.reverse():a},l]}tj.every=e=>isFinite(e=Math.floor(e))&&e>0?e7(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,tj.range;let[tP,tN]=t_(tj,tO,tv,tl,to,tn),[tT,tA]=t_(tC,tE,tc,ta,tr,tt);function tM(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function tI(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tR(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var tD={"-":"",_:" ",0:"0"},tL=/^\s*\d+/,tZ=/^%/,tz=/[\\^$*+?|[\]().{}]/g;function tB(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",a=o.length;return r+(a<n?Array(n-a+1).join(t)+o:o)}function tF(e){return e.replace(tz,"\\$&")}function tH(e){return RegExp("^(?:"+e.map(tF).join("|")+")","i")}function tq(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function tW(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function tU(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function tK(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function t$(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function tV(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function tX(e,t,n){var r=tL.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function tG(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function tY(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function tQ(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function tJ(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function t0(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function t1(e,t,n){var r=tL.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function t2(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function t6(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function t4(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function t3(e,t,n){var r=tL.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function t5(e,t,n){var r=tL.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function t8(e,t,n){var r=tZ.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function t7(e,t,n){var r=tL.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function t9(e,t,n){var r=tL.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ne(e,t){return tB(e.getDate(),t,2)}function nt(e,t){return tB(e.getHours(),t,2)}function nn(e,t){return tB(e.getHours()%12||12,t,2)}function nr(e,t){return tB(1+ta.count(tC(e),e),t,3)}function no(e,t){return tB(e.getMilliseconds(),t,3)}function na(e,t){return no(e,t)+"000"}function ni(e,t){return tB(e.getMonth()+1,t,2)}function nl(e,t){return tB(e.getMinutes(),t,2)}function ns(e,t){return tB(e.getSeconds(),t,2)}function nc(e){var t=e.getDay();return 0===t?7:t}function nu(e,t){return tB(tc.count(tC(e)-1,e),t,2)}function nd(e){var t=e.getDay();return t>=4||0===t?tp(e):tp.ceil(e)}function nf(e,t){return e=nd(e),tB(tp.count(tC(e),e)+(4===tC(e).getDay()),t,2)}function np(e){return e.getDay()}function nh(e,t){return tB(tu.count(tC(e)-1,e),t,2)}function nm(e,t){return tB(e.getFullYear()%100,t,2)}function ng(e,t){return tB((e=nd(e)).getFullYear()%100,t,2)}function nv(e,t){return tB(e.getFullYear()%1e4,t,4)}function ny(e,t){var n=e.getDay();return tB((e=n>=4||0===n?tp(e):tp.ceil(e)).getFullYear()%1e4,t,4)}function nb(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tB(t/60|0,"0",2)+tB(t%60,"0",2)}function nx(e,t){return tB(e.getUTCDate(),t,2)}function nw(e,t){return tB(e.getUTCHours(),t,2)}function nk(e,t){return tB(e.getUTCHours()%12||12,t,2)}function nS(e,t){return tB(1+ti.count(tj(e),e),t,3)}function nE(e,t){return tB(e.getUTCMilliseconds(),t,3)}function nO(e,t){return nE(e,t)+"000"}function nC(e,t){return tB(e.getUTCMonth()+1,t,2)}function nj(e,t){return tB(e.getUTCMinutes(),t,2)}function n_(e,t){return tB(e.getUTCSeconds(),t,2)}function nP(e){var t=e.getUTCDay();return 0===t?7:t}function nN(e,t){return tB(tv.count(tj(e)-1,e),t,2)}function nT(e){var t=e.getUTCDay();return t>=4||0===t?tw(e):tw.ceil(e)}function nA(e,t){return e=nT(e),tB(tw.count(tj(e),e)+(4===tj(e).getUTCDay()),t,2)}function nM(e){return e.getUTCDay()}function nI(e,t){return tB(ty.count(tj(e)-1,e),t,2)}function nR(e,t){return tB(e.getUTCFullYear()%100,t,2)}function nD(e,t){return tB((e=nT(e)).getUTCFullYear()%100,t,2)}function nL(e,t){return tB(e.getUTCFullYear()%1e4,t,4)}function nZ(e,t){var n=e.getUTCDay();return tB((e=n>=4||0===n?tw(e):tw.ceil(e)).getUTCFullYear()%1e4,t,4)}function nz(){return"+0000"}function nB(){return"%"}function nF(e){return+e}function nH(e){return Math.floor(+e/1e3)}function nq(e){return new Date(e)}function nW(e){return e instanceof Date?+e:+new Date(+e)}function nU(e,t,n,r,o,a,i,l,s,c){var u=ek(),d=u.invert,f=u.domain,p=c(".%L"),h=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),x=c("%Y");function w(e){return(s(e)<e?p:l(e)<e?h:i(e)<e?m:a(e)<e?g:r(e)<e?o(e)<e?v:y:n(e)<e?b:x)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,nW)):f().map(nq)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?w:c(t)},u.nice=function(e){var n=f();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?f(eL(n,e)):u},u.copy=function(){return ex(u,nU(e,t,n,r,o,a,i,l,s,c))},u}function nK(){return eS.o.apply(nU(tT,tA,tC,tE,tc,ta,tr,tt,te,s).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function n$(){return eS.o.apply(nU(tP,tN,tj,tO,tv,ti,to,tn,te,c).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function nV(){var e,t,n,r,o,a=0,i=1,l=eg,s=!1;function c(t){return null==t||isNaN(t=+t)?o:l(0===n?.5:(t=(r(t)-e)*n,s?Math.max(0,Math.min(1,t)):t))}function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,l=e(n,r),c):[l(0),l(1)]}}return c.domain=function(o){return arguments.length?([a,i]=o,e=r(a=+a),t=r(i=+i),n=e===t?0:1/(t-e),c):[a,i]},c.clamp=function(e){return arguments.length?(s=!!e,c):s},c.interpolator=function(e){return arguments.length?(l=e,c):l},c.range=u(ef),c.rangeRound=u(ep),c.unknown=function(e){return arguments.length?(o=e,c):o},function(o){return r=o,e=o(a),t=o(i),n=e===t?0:1/(t-e),c}}function nX(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function nG(){var e=eQ(nV());return e.copy=function(){return nX(e,nG()).exponent(e.exponent())},eS.O.apply(e,arguments)}function nY(){return nG.apply(null,arguments).exponent(.5)}function nQ(){var e,t,n,r,o,a,i,l=0,s=.5,c=1,u=1,d=eg,f=!1;function p(e){return isNaN(e=+e)?i:(e=.5+((e=+a(e))-t)*(u*e<u*t?r:o),d(f?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var n,r,o;return arguments.length?([n,r,o]=t,d=function(e,t){void 0===t&&(t=e,e=ef);for(var n=0,r=t.length-1,o=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(o,o=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}(e,[n,r,o]),p):[d(0),d(.5),d(1)]}}return p.domain=function(i){return arguments.length?([l,s,c]=i,e=a(l=+l),t=a(s=+s),n=a(c=+c),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),u=t<e?-1:1,p):[l,s,c]},p.clamp=function(e){return arguments.length?(f=!!e,p):f},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=h(ef),p.rangeRound=h(ep),p.unknown=function(e){return arguments.length?(i=e,p):i},function(i){return a=i,e=i(l),t=i(s),n=i(c),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),u=t<e?-1:1,p}}function nJ(){var e=eQ(nQ());return e.copy=function(){return nX(e,nJ()).exponent(e.exponent())},eS.O.apply(e,arguments)}function n0(){return nJ.apply(null,arguments).exponent(.5)}function n1(e,t){if((o=e.length)>1)for(var n,r,o,a=1,i=e[t[0]],l=i.length;a<o;++a)for(r=i,i=e[t[a]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}s=(l=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,a=e.days,i=e.shortDays,l=e.months,s=e.shortMonths,c=tH(o),u=tq(o),d=tH(a),f=tq(a),p=tH(i),h=tq(i),m=tH(l),g=tq(l),v=tH(s),y=tq(s),b={a:function(e){return i[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:ne,e:ne,f:na,g:ng,G:ny,H:nt,I:nn,j:nr,L:no,m:ni,M:nl,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:nF,s:nH,S:ns,u:nc,U:nu,V:nf,w:np,W:nh,x:null,X:null,y:nm,Y:nv,Z:nb,"%":nB},x={a:function(e){return i[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:nx,e:nx,f:nO,g:nD,G:nZ,H:nw,I:nk,j:nS,L:nE,m:nC,M:nj,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:nF,s:nH,S:n_,u:nP,U:nN,V:nA,w:nM,W:nI,x:null,X:null,y:nR,Y:nL,Z:nz,"%":nB},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:t0,e:t0,f:t5,g:tG,G:tX,H:t2,I:t2,j:t1,L:t3,m:tJ,M:t6,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:tQ,Q:t7,s:t9,S:t4,u:tU,U:tK,V:t$,w:tW,W:tV,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:tG,Y:tX,Z:tY,"%":t8};function k(e,t){return function(n){var r,o,a,i=[],l=-1,s=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++l<c;)37===e.charCodeAt(l)&&(i.push(e.slice(s,l)),null!=(o=tD[r=e.charAt(++l)])?r=e.charAt(++l):o="e"===r?" ":"0",(a=t[r])&&(r=a(n,o)),i.push(r),s=l+1);return i.push(e.slice(s,l)),i.join("")}}function S(e,t){return function(n){var r,o,a=tR(1900,void 0,1);if(E(a,e,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!t||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(r=(o=(r=tI(tR(a.y,0,1))).getUTCDay())>4||0===o?ty.ceil(r):ty(r),r=ti.offset(r,(a.V-1)*7),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(r=(o=(r=tM(tR(a.y,0,1))).getDay())>4||0===o?tu.ceil(r):tu(r),r=ta.offset(r,(a.V-1)*7),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?tI(tR(a.y,0,1)).getUTCDay():tM(tR(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,tI(a)):tM(a)}}function E(e,t,n,r){for(var o,a,i=0,l=t.length,s=n.length;i<l;){if(r>=s)return -1;if(37===(o=t.charCodeAt(i++))){if(!(a=w[(o=t.charAt(i++))in tD?t.charAt(i++):o])||(r=a(e,n,r))<0)return -1}else if(o!=n.charCodeAt(r++))return -1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,l.parse,c=l.utcFormat,l.utcParse;var n2=n(22516),n6=n(76115);function n4(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function n3(e,t){return e[t]}function n5(e){let t=[];return t.key=e,t}var n8=n(95645),n7=n.n(n8),n9=n(99008),re=n.n(n9),rt=n(77571),rn=n.n(rt),rr=n(86757),ro=n.n(rr),ra=n(42715),ri=n.n(ra),rl=n(13735),rs=n.n(rl),rc=n(11314),ru=n.n(rc),rd=n(82559),rf=n.n(rd),rp=n(75551),rh=n.n(rp),rm=n(21652),rg=n.n(rm),rv=n(34935),ry=n.n(rv),rb=n(61134),rx=n.n(rb);function rw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var rk=function(e){return e},rS={},rE=function(e){return e===rS},rO=function(e){return function t(){return 0==arguments.length||1==arguments.length&&rE(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},rC=function(e){return function e(t,n){return 1===t?n:rO(function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var i=o.filter(function(e){return e!==rS}).length;return i>=t?n.apply(void 0,o):e(t-i,rO(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=o.map(function(e){return rE(e)?t.shift():e});return n.apply(void 0,((function(e){if(Array.isArray(e))return rw(e)})(a)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return rw(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rw(e,void 0)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(t))}))})}(e.length,e)},rj=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},r_=rC(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),rP=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t.length)return rk;var r=t.reverse(),o=r[0],a=r.slice(1);return function(){return a.reduce(function(e,t){return t(e)},o.apply(void 0,arguments))}},rN=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},rT=function(e){var t=null,n=null;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return t&&o.every(function(e,n){return e===t[n]})?n:(t=o,n=e.apply(void 0,o))}},rA=(rC(function(e,t,n){var r=+e;return r+n*(+t-r)}),rC(function(e,t,n){var r=t-+e;return(n-e)/(r=r||1/0)}),rC(function(e,t,n){var r=t-+e;return Math.max(0,Math.min(1,(n-e)/(r=r||1/0)))}),{rangeStep:function(e,t,n){for(var r=new(rx())(e),o=0,a=[];r.lt(t)&&o<1e5;)a.push(r.toNumber()),r=r.add(n),o++;return a},getDigitCount:function(e){return 0===e?1:Math.floor(new(rx())(e).abs().log(10).toNumber())+1}});function rM(e){return function(e){if(Array.isArray(e))return rD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||rR(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}}(e,t)||rR(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rR(e,t){if(e){if("string"==typeof e)return rD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rD(e,t)}}function rD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rL(e){var t=rI(e,2),n=t[0],r=t[1],o=n,a=r;return n>r&&(o=r,a=n),[o,a]}function rZ(e,t,n){if(e.lte(0))return new(rx())(0);var r=rA.getDigitCount(e.toNumber()),o=new(rx())(10).pow(r),a=e.div(o),i=1!==r?.05:.1,l=new(rx())(Math.ceil(a.div(i).toNumber())).add(n).mul(i).mul(o);return t?l:new(rx())(Math.ceil(l))}function rz(e,t,n){var r=1,o=new(rx())(e);if(!o.isint()&&n){var a=Math.abs(e);a<1?(r=new(rx())(10).pow(rA.getDigitCount(e)-1),o=new(rx())(Math.floor(o.div(r).toNumber())).mul(r)):a>1&&(o=new(rx())(Math.floor(e)))}else 0===e?o=new(rx())(Math.floor((t-1)/2)):n||(o=new(rx())(Math.floor(e)));var i=Math.floor((t-1)/2);return rP(r_(function(e){return o.add(new(rx())(e-i).mul(r)).toNumber()}),rj)(0,t)}var rB=rT(function(e){var t=rI(e,2),n=t[0],r=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=Math.max(o,2),l=rI(rL([n,r]),2),s=l[0],c=l[1];if(s===-1/0||c===1/0){var u=c===1/0?[s].concat(rM(rj(0,o-1).map(function(){return 1/0}))):[].concat(rM(rj(0,o-1).map(function(){return-1/0})),[c]);return n>r?rN(u):u}if(s===c)return rz(s,o,a);var d=function e(t,n,r,o){var a,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new(rx())(0),tickMin:new(rx())(0),tickMax:new(rx())(0)};var l=rZ(new(rx())(n).sub(t).div(r-1),o,i),s=Math.ceil((a=t<=0&&n>=0?new(rx())(0):(a=new(rx())(t).add(n).div(2)).sub(new(rx())(a).mod(l))).sub(t).div(l).toNumber()),c=Math.ceil(new(rx())(n).sub(a).div(l).toNumber()),u=s+c+1;return u>r?e(t,n,r,o,i+1):(u<r&&(c=n>0?c+(r-u):c,s=n>0?s:s+(r-u)),{step:l,tickMin:a.sub(new(rx())(s).mul(l)),tickMax:a.add(new(rx())(c).mul(l))})}(s,c,i,a),f=d.step,p=d.tickMin,h=d.tickMax,m=rA.rangeStep(p,h.add(new(rx())(.1).mul(f)),f);return n>r?rN(m):m});rT(function(e){var t=rI(e,2),n=t[0],r=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=Math.max(o,2),l=rI(rL([n,r]),2),s=l[0],c=l[1];if(s===-1/0||c===1/0)return[n,r];if(s===c)return rz(s,o,a);var u=rZ(new(rx())(c).sub(s).div(i-1),a,0),d=rP(r_(function(e){return new(rx())(s).add(new(rx())(e).mul(u)).toNumber()}),rj)(0,i).filter(function(e){return e>=s&&e<=c});return n>r?rN(d):d});var rF=rT(function(e,t){var n=rI(e,2),r=n[0],o=n[1],a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=rI(rL([r,o]),2),l=i[0],s=i[1];if(l===-1/0||s===1/0)return[r,o];if(l===s)return[l];var c=rZ(new(rx())(s).sub(l).div(Math.max(t,2)-1),a,0),u=[].concat(rM(rA.rangeStep(new(rx())(l),new(rx())(s).sub(new(rx())(.99).mul(c)),c)),[s]);return r>o?rN(u):u}),rH=n(13137),rq=n(16630),rW=n(82944),rU=n(38569);function rK(e){return(rK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r$(Object(n),!0).forEach(function(t){rX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rX(e,t,n){var r;return(r=function(e,t){if("object"!==rK(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==rK(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===rK(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rG(e){return function(e){if(Array.isArray(e))return rY(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rY(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rY(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rQ(e,t,n){return rn()(e)||rn()(t)?n:(0,rq.P2)(t)?rs()(e,t,n):ro()(t)?t(e):n}function rJ(e,t,n,r){var o=ru()(e,function(e){return rQ(e,t)});if("number"===n){var a=o.filter(function(e){return(0,rq.hj)(e)||parseFloat(e)});return a.length?[re()(a),n7()(a)]:[1/0,-1/0]}return(r?o.filter(function(e){return!rn()(e)}):o).map(function(e){return(0,rq.P2)(e)||e instanceof Date?e:""})}var r0=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,i=null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0;if(i<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var l=o.range,s=0;s<i;s++){var c=s>0?r[s-1].coordinate:r[i-1].coordinate,u=r[s].coordinate,d=s>=i-1?r[0].coordinate:r[s+1].coordinate,f=void 0;if((0,rq.uY)(u-c)!==(0,rq.uY)(d-u)){var p=[];if((0,rq.uY)(d-u)===(0,rq.uY)(l[1]-l[0])){f=d;var h=u+l[1]-l[0];p[0]=Math.min(h,(h+c)/2),p[1]=Math.max(h,(h+c)/2)}else{f=c;var m=d+l[1]-l[0];p[0]=Math.min(u,(m+u)/2),p[1]=Math.max(u,(m+u)/2)}var g=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>g[0]&&e<=g[1]||e>=p[0]&&e<=p[1]){a=r[s].index;break}}else{var v=Math.min(c,d),y=Math.max(c,d);if(e>(v+u)/2&&e<=(y+u)/2){a=r[s].index;break}}}else for(var b=0;b<i;b++)if(0===b&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b>0&&b<i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b===i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2){a=n[b].index;break}return a},r1=function(e){var t,n=e.type.displayName,r=e.props,o=r.stroke,a=r.fill;switch(n){case"Line":t=o;break;case"Area":case"Radar":t=o&&"none"!==o?o:a;break;default:t=a}return t},r2=function(e){var t=e.barSize,n=e.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var o={},a=Object.keys(r),i=0,l=a.length;i<l;i++)for(var s=r[a[i]].stackGroups,c=Object.keys(s),u=0,d=c.length;u<d;u++){var f=s[c[u]],p=f.items,h=f.cateAxisId,m=p.filter(function(e){return(0,rW.Gf)(e.type).indexOf("Bar")>=0});if(m&&m.length){var g=m[0].props.barSize,v=m[0].props[h];o[v]||(o[v]=[]),o[v].push({item:m[0],stackList:m.slice(1),barSize:rn()(g)?t:g})}}return o},r6=function(e){var t,n=e.barGap,r=e.barCategoryGap,o=e.bandSize,a=e.sizeList,i=void 0===a?[]:a,l=e.maxBarSize,s=i.length;if(s<1)return null;var c=(0,rq.h1)(n,o,0,!0),u=[];if(i[0].barSize===+i[0].barSize){var d=!1,f=o/s,p=i.reduce(function(e,t){return e+t.barSize||0},0);(p+=(s-1)*c)>=o&&(p-=(s-1)*c,c=0),p>=o&&f>0&&(d=!0,f*=.9,p=s*f);var h={offset:((o-p)/2>>0)-c,size:0};t=i.reduce(function(e,t){var n={item:t.item,position:{offset:h.offset+h.size+c,size:d?f:t.barSize}},r=[].concat(rG(e),[n]);return h=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:h})}),r},u)}else{var m=(0,rq.h1)(r,o,0,!0);o-2*m-(s-1)*c<=0&&(c=0);var g=(o-2*m-(s-1)*c)/s;g>1&&(g>>=0);var v=l===+l?Math.min(g,l):g;t=i.reduce(function(e,t,n){var r=[].concat(rG(e),[{item:t.item,position:{offset:m+(g+c)*n+(g-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return t},r4=function(e,t,n,r){var o=n.children,a=n.width,i=n.margin,l=a-(i.left||0)-(i.right||0),s=(0,rU.z)({children:o,legendWidth:l});if(s){var c=r||{},u=c.width,d=c.height,f=s.align,p=s.verticalAlign,h=s.layout;if(("vertical"===h||"horizontal"===h&&"middle"===p)&&"center"!==f&&(0,rq.hj)(e[f]))return rV(rV({},e),{},rX({},f,e[f]+(u||0)));if(("horizontal"===h||"vertical"===h&&"center"===f)&&"middle"!==p&&(0,rq.hj)(e[p]))return rV(rV({},e),{},rX({},p,e[p]+(d||0)))}return e},r3=function(e,t,n,r,o){var a=t.props.children,i=(0,rW.NN)(a,rH.W).filter(function(e){var t;return t=e.props.direction,!!rn()(o)||("horizontal"===r?"yAxis"===o:"vertical"===r||"x"===t?"xAxis"===o:"y"!==t||"yAxis"===o)});if(i&&i.length){var l=i.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=rQ(t,n,0),o=Array.isArray(r)?[re()(r),n7()(r)]:[r,r],a=l.reduce(function(e,n){var r=rQ(t,n,0),a=o[0]-Math.abs(Array.isArray(r)?r[0]:r),i=o[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(i,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},r5=function(e,t,n,r,o){var a=t.map(function(t){return r3(e,t,n,o,r)}).filter(function(e){return!rn()(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},r8=function(e,t,n,r,o){var a=t.map(function(t){var a=t.props.dataKey;return"number"===n&&a&&r3(e,t,a,r)||rJ(e,a,n,o)});if("number"===n)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var i={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)i[t[n]]||(i[t[n]]=!0,e.push(t[n]));return e},[])},r7=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},r9=function(e,t,n,r){if(r)return e.map(function(e){return e.coordinate});var o,a,i=e.map(function(e){return e.coordinate===t&&(o=!0),e.coordinate===n&&(a=!0),e.coordinate});return o||i.push(t),a||i.push(n),i},oe=function(e,t,n){if(!e)return null;var r=e.scale,o=e.duplicateDomain,a=e.type,i=e.range,l="scaleBand"===e.realScaleType?r.bandwidth()/2:2,s=(t||n)&&"category"===a&&r.bandwidth?r.bandwidth()/l:0;return(s="angleAxis"===e.axisType&&(null==i?void 0:i.length)>=2?2*(0,rq.uY)(i[0]-i[1])*s:s,t&&(e.ticks||e.niceTicks))?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(o?o.indexOf(e):e)+s,value:e,offset:s}}).filter(function(e){return!rf()(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+s,value:e,index:t,offset:s}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+s,value:e,offset:s}}):r.domain().map(function(e,t){return{coordinate:r(e)+s,value:o?o[e]:e,index:t,offset:s}})},ot=new WeakMap,on=function(e,t){if("function"!=typeof t)return e;ot.has(e)||ot.set(e,new WeakMap);var n=ot.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},or=function(e,t,n){var r=e.scale,o=e.type,a=e.layout,i=e.axisType;if("auto"===r)return"radial"===a&&"radiusAxis"===i?{scale:d.Z(),realScaleType:"band"}:"radial"===a&&"angleAxis"===i?{scale:eD(),realScaleType:"linear"}:"category"===o&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!n)?{scale:d.x(),realScaleType:"point"}:"category"===o?{scale:d.Z(),realScaleType:"band"}:{scale:eD(),realScaleType:"linear"};if(ri()(r)){var l="scale".concat(rh()(r));return{scale:(u[l]||d.x)(),realScaleType:u[l]?l:"point"}}return ro()(r)?{scale:r}:{scale:d.x(),realScaleType:"point"}},oo=function(e){var t=e.domain();if(t&&!(t.length<=2)){var n=t.length,r=e.range(),o=Math.min(r[0],r[1])-1e-4,a=Math.max(r[0],r[1])+1e-4,i=e(t[0]),l=e(t[n-1]);(i<o||i>a||l<o||l>a)&&e.domain([t[0],t[n-1]])}},oa=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},oi=function(e,t){if(!t||2!==t.length||!(0,rq.hj)(t[0])||!(0,rq.hj)(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),o=[e[0],e[1]];return(!(0,rq.hj)(e[0])||e[0]<n)&&(o[0]=n),(!(0,rq.hj)(e[1])||e[1]>r)&&(o[1]=r),o[0]>r&&(o[0]=r),o[1]<n&&(o[1]=n),o},ol={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var o=0,a=0,i=0;i<t;++i){var l=rf()(e[i][n][1])?e[i][n][0]:e[i][n][1];l>=0?(e[i][n][0]=o,e[i][n][1]=o+l,o=e[i][n][1]):(e[i][n][0]=a,e[i][n][1]=a+l,a=e[i][n][1])}},expand:function(e,t){if((r=e.length)>0){for(var n,r,o,a=0,i=e[0].length;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}n1(e,t)}},none:n1,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,o=e[t[0]],a=o.length;r<a;++r){for(var i=0,l=0;i<n;++i)l+=e[i][r][1]||0;o[r][1]+=o[r][0]=-l/2}n1(e,t)}},wiggle:function(e,t){if((o=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,o,a=0,i=1;i<r;++i){for(var l=0,s=0,c=0;l<o;++l){for(var u=e[t[l]],d=u[i][1]||0,f=(d-(u[i-1][1]||0))/2,p=0;p<l;++p){var h=e[t[p]];f+=(h[i][1]||0)-(h[i-1][1]||0)}s+=d,c+=f*d}n[i-1][1]+=n[i-1][0]=a,s&&(a-=c/s)}n[i-1][1]+=n[i-1][0]=a,n1(e,t)}},positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var o=0,a=0;a<t;++a){var i=rf()(e[a][n][1])?e[a][n][0]:e[a][n][1];i>=0?(e[a][n][0]=o,e[a][n][1]=o+i,o=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},os=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),o=ol[n];return(function(){var e=(0,n6.Z)([]),t=n4,n=n1,r=n3;function o(o){var a,i,l=Array.from(e.apply(this,arguments),n5),s=l.length,c=-1;for(let e of o)for(a=0,++c;a<s;++a)(l[a][c]=[0,+r(e,l[a].key,c,o)]).data=e;for(a=0,i=(0,n2.Z)(t(l));a<s;++a)l[i[a]].index=a;return n(l,i),l}return o.keys=function(t){return arguments.length?(e="function"==typeof t?t:(0,n6.Z)(Array.from(t)),o):e},o.value=function(e){return arguments.length?(r="function"==typeof e?e:(0,n6.Z)(+e),o):r},o.order=function(e){return arguments.length?(t=null==e?n4:"function"==typeof e?e:(0,n6.Z)(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(n=null==e?n1:e,o):n},o})().keys(r).value(function(e,t){return+rQ(e,t,0)}).order(n4).offset(o)(e)},oc=function(e,t,n,r,o,a){if(!e)return null;var i=(a?t.reverse():t).reduce(function(e,t){var o=t.props,a=o.stackId;if(o.hide)return e;var i=t.props[n],l=e[i]||{hasStack:!1,stackGroups:{}};if((0,rq.P2)(a)){var s=l.stackGroups[a]||{numericAxisId:n,cateAxisId:r,items:[]};s.items.push(t),l.hasStack=!0,l.stackGroups[a]=s}else l.stackGroups[(0,rq.EL)("_stackId_")]={numericAxisId:n,cateAxisId:r,items:[t]};return rV(rV({},e),{},rX({},i,l))},{});return Object.keys(i).reduce(function(t,a){var l=i[a];return l.hasStack&&(l.stackGroups=Object.keys(l.stackGroups).reduce(function(t,a){var i=l.stackGroups[a];return rV(rV({},t),{},rX({},a,{numericAxisId:n,cateAxisId:r,items:i.items,stackedData:os(e,i.items,o)}))},{})),rV(rV({},t),{},rX({},a,l))},{})},ou=function(e,t){var n=t.realScaleType,r=t.type,o=t.tickCount,a=t.originalDomain,i=t.allowDecimals,l=n||t.scale;if("auto"!==l&&"linear"!==l)return null;if(o&&"number"===r&&a&&("auto"===a[0]||"auto"===a[1])){var s=e.domain();if(!s.length)return null;var c=rB(s,o,i);return e.domain([re()(c),n7()(c)]),{niceTicks:c}}return o&&"number"===r?{niceTicks:rF(e.domain(),o,i)}:null},od=function(e){var t=e.axis,n=e.ticks,r=e.bandSize,o=e.entry,a=e.index,i=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!rn()(o[t.dataKey])){var l=(0,rq.Ap)(n,"value",o[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var s=rQ(o,rn()(i)?t.dataKey:i);return rn()(s)?null:t.scale(s)},of=function(e){var t=e.axis,n=e.ticks,r=e.offset,o=e.bandSize,a=e.entry,i=e.index;if("category"===t.type)return n[i]?n[i].coordinate+r:null;var l=rQ(a,t.dataKey,t.domain[i]);return rn()(l)?null:t.scale(l)-o/2+r},op=function(e){var t=e.numericAxis,n=t.scale.domain();if("number"===t.type){var r=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return r<=0&&o>=0?0:o<0?o:r}return n[0]},oh=function(e,t){var n=e.props.stackId;if((0,rq.P2)(n)){var r=t[n];if(r){var o=r.items.indexOf(e);return o>=0?r.stackedData[o]:null}}return null},om=function(e,t,n){return Object.keys(e).reduce(function(r,o){var a=e[o].stackedData.reduce(function(e,r){var o=r.slice(t,n+1).reduce(function(e,t){return[re()(t.concat([e[0]]).filter(rq.hj)),n7()(t.concat([e[1]]).filter(rq.hj))]},[1/0,-1/0]);return[Math.min(e[0],o[0]),Math.max(e[1],o[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},og=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ov=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oy=function(e,t,n){if(ro()(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if((0,rq.hj)(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(og.test(e[0])){var o=+og.exec(e[0])[1];r[0]=t[0]-o}else ro()(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if((0,rq.hj)(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(ov.test(e[1])){var a=+ov.exec(e[1])[1];r[1]=t[1]+a}else ro()(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},ob=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var o=ry()(t,function(e){return e.coordinate}),a=1/0,i=1,l=o.length;i<l;i++){var s=o[i],c=o[i-1];a=Math.min((s.coordinate||0)-(c.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},ox=function(e,t,n){return!e||!e.length||rg()(e,rs()(n,"type.defaultProps.domain"))?t:e},ow=function(e,t){var n=e.props,r=n.dataKey,o=n.name,a=n.unit,i=n.formatter,l=n.tooltipType,s=n.chartType,c=n.hide;return rV(rV({},(0,rW.L6)(e,!1)),{},{dataKey:r,unit:a,formatter:i,name:o||r,color:r1(e),value:rQ(t,r),type:l,payload:t,chartType:s,hide:c})}},4094:function(e,t,n){"use strict";n.d(t,{os:function(){return d},xE:function(){return u}});var r=n(34067);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){var r,a;r=t,a=n[t],(r=function(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var l={widthCache:{},cacheCount:0},s={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},c="recharts_measurement_span",u=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||r.x.isSsr)return{width:0,height:0};var o=(Object.keys(t=i({},n)).forEach(function(e){t[e]||delete t[e]}),t),a=JSON.stringify({text:e,copyStyle:o});if(l.widthCache[a])return l.widthCache[a];try{var u=document.getElementById(c);u||((u=document.createElement("span")).setAttribute("id",c),u.setAttribute("aria-hidden","true"),document.body.appendChild(u));var d=i(i({},s),o);Object.assign(u.style,d),u.textContent="".concat(e);var f=u.getBoundingClientRect(),p={width:f.width,height:f.height};return l.widthCache[a]=p,++l.cacheCount>2e3&&(l.cacheCount=0,l.widthCache={}),p}catch(e){return{width:0,height:0}}},d=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}}},16630:function(e,t,n){"use strict";n.d(t,{Ap:function(){return w},EL:function(){return g},Kt:function(){return y},P2:function(){return h},bv:function(){return b},h1:function(){return v},hU:function(){return f},hj:function(){return p},k4:function(){return x},uY:function(){return d}});var r=n(42715),o=n.n(r),a=n(82559),i=n.n(a),l=n(13735),s=n.n(l),c=n(22345),u=n.n(c),d=function(e){return 0===e?0:e>0?1:-1},f=function(e){return o()(e)&&e.indexOf("%")===e.length-1},p=function(e){return u()(e)&&!i()(e)},h=function(e){return p(e)||o()(e)},m=0,g=function(e){var t=++m;return"".concat(e||"").concat(t)},v=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!p(e)&&!o()(e))return r;if(f(e)){var l=e.indexOf("%");n=t*parseFloat(e.slice(0,l))/100}else n=+e;return i()(n)&&(n=r),a&&n>t&&(n=t),n},y=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},b=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++){if(n[e[r]])return!0;n[e[r]]=!0}return!1},x=function(e,t){return p(e)&&p(t)?function(n){return e+n*(t-e)}:function(){return t}};function w(e,t,n){return e&&e.length?e.find(function(e){return e&&("function"==typeof t?t(e):s()(e,t))===n}):null}},34067:function(e,t,n){"use strict";n.d(t,{x:function(){return r}});var r={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return r[e]},set:function(e,t){if("string"==typeof e)r[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){r[t]=e[t]})}}}},1175:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var r=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o]}},39206:function(e,t,n){"use strict";n.d(t,{$4:function(){return h},Wk:function(){return f},op:function(){return p},t9:function(){return m},z3:function(){return b}});var r=n(77571),o=n.n(r),a=n(16630),i=n(85355);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){var r;return(r=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===l(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f=Math.PI/180,p=function(e,t,n,r){return{x:e+Math.cos(-f*r)*n,y:t+Math.sin(-f*r)*n}},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},m=function(e,t,n,r,l){var s=e.width,f=e.height,p=e.startAngle,m=e.endAngle,g=(0,a.h1)(e.cx,s,s/2),v=(0,a.h1)(e.cy,f,f/2),y=h(s,f,n),b=(0,a.h1)(e.innerRadius,y,0),x=(0,a.h1)(e.outerRadius,y,.8*y);return Object.keys(t).reduce(function(e,n){var a,s=t[n],f=s.domain,h=s.reversed;if(o()(s.range))"angleAxis"===r?a=[p,m]:"radiusAxis"===r&&(a=[b,x]),h&&(a=[a[1],a[0]]);else{var y,w=function(e){if(Array.isArray(e))return e}(y=a=s.range)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(y,2)||function(e,t){if(e){if("string"==typeof e)return d(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,2)}}(y,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();p=w[0],m=w[1]}var k=(0,i.Hq)(s,l),S=k.realScaleType,E=k.scale;E.domain(f).range(a),(0,i.zF)(E);var O=(0,i.g$)(E,c(c({},s),{},{realScaleType:S})),C=c(c(c({},s),O),{},{range:a,radius:x,realScaleType:S,scale:E,cx:g,cy:v,innerRadius:b,outerRadius:x,startAngle:p,endAngle:m});return c(c({},e),{},u({},n,C))},{})},g=function(e,t){var n=e.x,r=e.y;return Math.sqrt(Math.pow(n-t.x,2)+Math.pow(r-t.y,2))},v=function(e,t){var n=e.x,r=e.y,o=t.cx,a=t.cy,i=g({x:n,y:r},{x:o,y:a});if(i<=0)return{radius:i};var l=Math.acos((n-o)/i);return r>a&&(l=2*Math.PI-l),{radius:i,angle:180*l/Math.PI,angleInRadian:l}},y=function(e){var t=e.startAngle,n=e.endAngle,r=Math.min(Math.floor(t/360),Math.floor(n/360));return{startAngle:t-360*r,endAngle:n-360*r}},b=function(e,t){var n,r=v({x:e.x,y:e.y},t),o=r.radius,a=r.angle,i=t.innerRadius,l=t.outerRadius;if(o<i||o>l)return!1;if(0===o)return!0;var s=y(t),u=s.startAngle,d=s.endAngle,f=a;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;n=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;n=f>=d&&f<=u}return n?c(c({},t),{},{radius:o,angle:f+360*Math.min(Math.floor(t.startAngle/360),Math.floor(t.endAngle/360))}):null}},82944:function(e,t,n){"use strict";n.d(t,{$R:function(){return Z},$k:function(){return T},Bh:function(){return L},Gf:function(){return S},L6:function(){return M},NN:function(){return j},TT:function(){return P},eu:function(){return D},rL:function(){return I},sP:function(){return _}});var r=n(13735),o=n.n(r),a=n(77571),i=n.n(a),l=n(42715),s=n.n(l),c=n(86757),u=n.n(c),d=n(28302),f=n.n(d),p=n(2265),h=n(82558),m=n(16630),g=n(46485),v=n(41637),y=["children"],b=["children"];function x(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},S=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},E=null,O=null,C=function e(t){if(t===E&&Array.isArray(O))return O;var n=[];return p.Children.forEach(t,function(t){i()(t)||((0,h.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),O=n,E=t,n};function j(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return S(e)}):[S(t)],C(e).forEach(function(e){var t=o()(e,"type.displayName")||o()(e,"type.name");-1!==r.indexOf(t)&&n.push(e)}),n}function _(e,t){var n=j(e,t);return n&&n[0]}var P=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!!(0,m.hj)(n)&&!(n<=0)&&!!(0,m.hj)(r)&&!(r<=0)},N=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],T=function(e){return e&&"object"===w(e)&&"cx"in e&&"cy"in e&&"r"in e},A=function(e,t,n,r){var o,a=null!==(o=null===v.ry||void 0===v.ry?void 0:v.ry[r])&&void 0!==o?o:[];return!u()(e)&&(r&&a.includes(t)||v.Yh.includes(t))||n&&v.nv.includes(t)},M=function(e,t,n){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,p.isValidElement)(e)&&(r=e.props),!f()(r))return null;var o={};return Object.keys(r).forEach(function(e){var a;A(null===(a=r)||void 0===a?void 0:a[e],e,t,n)&&(o[e]=r[e])}),o},I=function e(t,n){if(t===n)return!0;var r=p.Children.count(t);if(r!==p.Children.count(n))return!1;if(0===r)return!0;if(1===r)return R(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var o=0;o<r;o++){var a=t[o],i=n[o];if(Array.isArray(a)||Array.isArray(i)){if(!e(a,i))return!1}else if(!R(a,i))return!1}return!0},R=function(e,t){if(i()(e)&&i()(t))return!0;if(!i()(e)&&!i()(t)){var n=e.props||{},r=n.children,o=x(n,y),a=t.props||{},l=a.children,s=x(a,b);if(r&&l)return(0,g.w)(o,s)&&I(r,l);if(!r&&!l)return(0,g.w)(o,s)}return!1},D=function(e,t){var n=[],r={};return C(e).forEach(function(e,o){if(e&&e.type&&s()(e.type)&&N.indexOf(e.type)>=0)n.push(e);else if(e){var a=S(e.type),i=t[a]||{},l=i.handler,c=i.once;if(l&&(!c||!r[a])){var u=l(e,a,o);n.push(u),r[a]=!0}}}),n},L=function(e){var t=e&&e.type;return t&&k[t]?k[t]:null},Z=function(e,t){return C(t).indexOf(e)}},46485:function(e,t,n){"use strict";function r(e,t){for(var n in e)if(({}).hasOwnProperty.call(e,n)&&(!({}).hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if(({}).hasOwnProperty.call(t,r)&&!({}).hasOwnProperty.call(e,r))return!1;return!0}n.d(t,{w:function(){return r}})},38569:function(e,t,n){"use strict";n.d(t,{z:function(){return c}});var r=n(22190),o=n(85355),a=n(82944);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c=function(e){var t,n=e.children,i=e.formattedGraphicalItems,l=e.legendWidth,c=e.legendContent,u=(0,a.sP)(n,r.D);return u?(t=u.props&&u.props.payload?u.props&&u.props.payload:"children"===c?(i||[]).reduce(function(e,t){var n=t.item,r=t.props,o=r.sectors||r.data||[];return e.concat(o.map(function(e){return{type:u.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(i||[]).map(function(e){var t=e.item,n=t.props,r=n.dataKey,a=n.name,i=n.legendType;return{inactive:n.hide,dataKey:r,type:u.props.iconType||i||"square",color:(0,o.fk)(t),value:a||r,payload:t.props}}),s(s(s({},u.props),r.D.getWithHeight(u,l)),{},{payload:t,item:u})):null}},93528:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(47230),o=n.n(r),a=n(86757),i=n.n(a);function l(e,t,n){return!0===t?o()(e,n):i()(t)?o()(e,t):e}},41637:function(e,t,n){"use strict";n.d(t,{Yh:function(){return l},Ym:function(){return d},bw:function(){return f},nv:function(){return u},ry:function(){return c}});var r=n(2265),o=n(28302),a=n.n(o);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var l=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],s=["points","pathLength"],c={svg:["viewBox","children"],polygon:s,polyline:s},u=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],d=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,r.isValidElement)(e)&&(n=e.props),!a()(n))return null;var o={};return Object.keys(n).forEach(function(e){u.includes(e)&&(o[e]=t||function(t){return n[e](n,t)})}),o},f=function(e,t,n){if(!a()(e)||"object"!==i(e))return null;var r=null;return Object.keys(e).forEach(function(o){var a=e[o];u.includes(o)&&"function"==typeof a&&(r||(r={}),r[o]=function(e){return a(t,n,e),null})}),r}},52744:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(80662));t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,o.default)(e),a="function"==typeof t;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,o=e.value;a?t(r,o,e):o&&((n=n||{})[r]=o)}}),n}},18975:function(e,t,n){"use strict";var r=n(40257);n(24601);var o=n(2265),a=o&&"object"==typeof o&&"default"in o?o:{default:o},i=void 0!==r&&r.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},s=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,o=t.optimizeForSpeed,a=void 0===o?i:o;c(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var s="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=s?s.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},t.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var n="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){i||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},t.deleteRule=function(e){if("undefined"==typeof window){this._serverSheet.deleteRule(e);return}if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},t.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},t.makeStyleTag=function(e,t,n){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var o=document.head||document.getElementsByTagName("head")[0];return n?o.insertBefore(r,n):o.appendChild(r),r},function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,[{key:"length",get:function(){return this._rulesCount}}]),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var u=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},d={};function f(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return d[r]||(d[r]="jsx-"+u(e+"-"+n)),d[r]}function p(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return d[n]||(d[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[n]}var h=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,o=t.optimizeForSpeed,a=void 0!==o&&o;this._sheet=r||new s({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),r&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,o=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var a=o.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=a,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var o=f(r,n);return{styleId:o,rules:Array.isArray(t)?t.map(function(e){return p(o,e)}):[p(o,t)]}}return{styleId:f(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=o.createContext(null);m.displayName="StyleSheetContext";var g=a.default.useInsertionEffect||a.default.useLayoutEffect,v="undefined"!=typeof window?new h:void 0;function y(e){var t=v||o.useContext(m);return t&&("undefined"==typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}y.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},t.style=y},29:function(e,t,n){"use strict";e.exports=n(18975).style},99623:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}},9973:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},85498:function(e,t,n){"use strict";var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U,K,$,V,X,G,Y;let Q,J,ee;function et(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function en(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}n.d(t,{ZP:function(){return tF}});let er=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return er=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>255*Math.random()&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^n()&15>>+e/4).toString(16))};function eo(e){return"object"==typeof e&&null!==e&&("name"in e&&"AbortError"===e.name||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}let ea=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e){try{if("[object Error]"===Object.prototype.toString.call(e)){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class ei extends Error{}class el extends ei{constructor(e,t,n,r){super(`${el.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=t}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){return e&&r?400===e?new ed(e,t,n,r):401===e?new ef(e,t,n,r):403===e?new ep(e,t,n,r):404===e?new eh(e,t,n,r):409===e?new em(e,t,n,r):422===e?new eg(e,t,n,r):429===e?new ev(e,t,n,r):e>=500?new ey(e,t,n,r):new el(e,t,n,r):new ec({message:n,cause:ea(t)})}}class es extends el{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class ec extends el{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class eu extends ec{constructor({message:e}={}){super({message:e??"Request timed out."})}}class ed extends el{}class ef extends el{}class ep extends el{}class eh extends el{}class em extends el{}class eg extends el{}class ev extends el{}class ey extends el{}let eb=/^[a-z][a-z0-9+.-]*:/i,ex=e=>eb.test(e);function ew(e){return"object"!=typeof e?{}:e??{}}let ek=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new ei(`${e} must be an integer`);if(t<0)throw new ei(`${e} must be a positive integer`);return t},eS=e=>{try{return JSON.parse(e)}catch(e){return}},eE=e=>new Promise(t=>setTimeout(t,e)),eO={off:0,error:200,warn:300,info:400,debug:500},eC=(e,t,n)=>{if(e){if(Object.prototype.hasOwnProperty.call(eO,e))return e;eT(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(eO))}`)}};function ej(){}function e_(e,t,n){return!t||eO[e]>eO[n]?ej:t[e].bind(t)}let eP={error:ej,warn:ej,info:ej,debug:ej},eN=new WeakMap;function eT(e){let t=e.logger,n=e.logLevel??"off";if(!t)return eP;let r=eN.get(t);if(r&&r[0]===n)return r[1];let o={error:e_("error",t,n),warn:e_("warn",t,n),info:e_("info",t,n),debug:e_("debug",t,n)};return eN.set(t,[n,o]),o}let eA=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,"x-api-key"===e.toLowerCase()||"authorization"===e.toLowerCase()||"cookie"===e.toLowerCase()||"set-cookie"===e.toLowerCase()?"***":t]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),eM="0.54.0",eI=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,eR=()=>{let e="undefined"!=typeof Deno&&null!=Deno.build?"deno":"undefined"!=typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":eL(Deno.build.os),"X-Stainless-Arch":eD(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":eL(globalThis.process.platform??"unknown"),"X-Stainless-Arch":eD(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,o=n[3]||0;return{browser:e,version:`${t}.${r}.${o}`}}}return null}();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},eD=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",eL=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",eZ=()=>Q??(Q=eR());function ez(...e){let t=globalThis.ReadableStream;if(void 0===t)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function eB(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ez({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function eF(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function eH(e){if(null===e||"object"!=typeof e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}let eq=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function eW(e){let t;return(J??(J=(t=new globalThis.TextEncoder).encode.bind(t)))(e)}function eU(e){let t;return(ee??(ee=(t=new globalThis.TextDecoder).decode.bind(t)))(e)}class eK{constructor(){r.set(this,void 0),o.set(this,void 0),et(this,r,new Uint8Array,"f"),et(this,o,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?eW(e):e;et(this,r,function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}([en(this,r,"f"),n]),"f");let a=[];for(;null!=(t=function(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}(en(this,r,"f"),en(this,o,"f")));){if(t.carriage&&null==en(this,o,"f")){et(this,o,t.index,"f");continue}if(null!=en(this,o,"f")&&(t.index!==en(this,o,"f")+1||t.carriage)){a.push(eU(en(this,r,"f").subarray(0,en(this,o,"f")-1))),et(this,r,en(this,r,"f").subarray(en(this,o,"f")),"f"),et(this,o,null,"f");continue}let e=null!==en(this,o,"f")?t.preceding-1:t.preceding,n=eU(en(this,r,"f").subarray(0,e));a.push(n),et(this,r,en(this,r,"f").subarray(t.index),"f"),et(this,o,null,"f")}return a}flush(){return en(this,r,"f").length?this.decode("\n"):[]}}r=new WeakMap,o=new WeakMap,eK.NEWLINE_CHARS=new Set(["\n","\r"]),eK.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class e${constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new e$(async function*(){if(n)throw new ei("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of eV(e,t)){if("completion"===n.event)try{yield JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("message_start"===n.event||"message_delta"===n.event||"message_stop"===n.event||"content_block_start"===n.event||"content_block_delta"===n.event||"content_block_stop"===n.event)try{yield JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("ping"!==n.event&&"error"===n.event)throw new el(void 0,eS(n.data)??n.data,void 0,e.headers)}r=!0}catch(e){if(eo(e))return;throw e}finally{r||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;async function*r(){let t=new eK;for await(let n of eF(e))for(let e of t.decode(n))yield e;for(let e of t.flush())yield e}return new e$(async function*(){if(n)throw new ei("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let e=!1;try{for await(let t of r())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(eo(e))return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=r=>({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new e$(()=>r(e),this.controller),new e$(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this;return ez({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let o=eW(JSON.stringify(n)+"\n");t.enqueue(o)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*eV(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}let n=new eG,r=new eK;for await(let t of eX(eF(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*eX(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?eW(n):n,o=new Uint8Array(t.length+r.length);for(o.set(t),o.set(r,t.length),t=o;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class eG{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}async function eY(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:o,startTime:a}=t,i=await (async()=>{if(t.options.stream)return(eT(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass)?t.options.__streamClass.fromSSEResponse(n,t.controller):e$.fromSSEResponse(n,t.controller);if(204===n.status)return null;if(t.options.__binaryResponse)return n;let r=n.headers.get("content-type"),o=r?.split(";")[0]?.trim();return o?.includes("application/json")||o?.endsWith("+json")?eQ(await n.json(),n):await n.text()})();return eT(e).debug(`[${r}] response parsed`,eA({retryOfRequestLogID:o,url:n.url,status:n.status,body:i,durationMs:Date.now()-a})),i}function eQ(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}class eJ extends Promise{constructor(e,t,n=eY){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,a.set(this,void 0),et(this,a,e,"f")}_thenUnwrap(e){return new eJ(en(this,a,"f"),this.responsePromise,async(t,n)=>eQ(e(await this.parseResponse(t,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(en(this,a,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}a=new WeakMap;class e0{constructor(e,t,n,r){i.set(this,void 0),et(this,i,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageRequestOptions()}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new ei("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await en(this,i,"f").requestAPIList(this.constructor,e)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(i=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class e1 extends eJ{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await eY(e,t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}class e2 extends e0{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let e=this.first_id;return e?{...this.options,query:{...ew(this.options.query),before_id:e}}:null}let e=this.last_id;return e?{...this.options,query:{...ew(this.options.query),after_id:e}}:null}}let e6=()=>{if("undefined"==typeof File){let{process:e}=globalThis;throw Error("`File` is not defined as a global, which is required for file uploads."+("string"==typeof e?.versions?.node&&20>parseInt(e.versions.node.split("."))?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function e4(e,t,n){return e6(),new File(e,t??"unknown_file",n)}function e3(e){return("object"==typeof e&&null!==e&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}let e5=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],e8=async(e,t)=>({...e,body:await e9(e.body,t)}),e7=new WeakMap,e9=async(e,t)=>{if(!await function(e){let t="function"==typeof e?e:e.fetch,n=e7.get(t);if(n)return n;let r=(async()=>{try{let e="Response"in t?t.Response:(await t("data:,")).constructor,n=new FormData;if(n.toString()===await new e(n).text())return!1;return!0}catch{return!0}})();return e7.set(t,r),r}(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>tr(n,e,t))),n},te=e=>e instanceof Blob&&"name"in e,tt=e=>"object"==typeof e&&null!==e&&(e instanceof Response||e5(e)||te(e)),tn=e=>{if(tt(e))return!0;if(Array.isArray(e))return e.some(tn);if(e&&"object"==typeof e){for(let t in e)if(tn(e[t]))return!0}return!1},tr=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(n instanceof Response){let r={},o=n.headers.get("Content-Type");o&&(r={type:o}),e.append(t,e4([await n.blob()],e3(n),r))}else if(e5(n))e.append(t,e4([await new Response(eB(n)).blob()],e3(n)));else if(te(n))e.append(t,e4([n],e3(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(n=>tr(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>tr(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},to=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ta=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&to(e),ti=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob;async function tl(e,t,n){if(e6(),e=await e,t||(t=e3(e)),ta(e))return e instanceof File&&null==t&&null==n?e:e4([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(ti(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),e4(await ts(r),t,n)}let r=await ts(e);if(!n?.type){let e=r.find(e=>"object"==typeof e&&"type"in e&&e.type);"string"==typeof e&&(n={...n,type:e})}return e4(r,t,n)}async function ts(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(to(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(e5(e))for await(let n of e)t.push(...await ts(n));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:""}${function(e){if("object"!=typeof e||null===e)return"";let t=Object.getOwnPropertyNames(e);return`; props: [${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`)}return t}class tc{constructor(e){this._client=e}}let tu=Symbol.for("brand.privateNullableHeaders"),td=Array.isArray,tf=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[o,a]of function*(e){let t;if(!e)return;if(tu in e){let{values:t,nulls:n}=e;for(let e of(yield*t.entries(),n))yield[e,null];return}let n=!1;for(let r of(e instanceof Headers?t=e.entries():td(e)?t=e:(n=!0,t=Object.entries(e??{})),t)){let e=r[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=td(r[1])?r[1]:[r[1]],o=!1;for(let r of t)void 0!==r&&(n&&!o&&(o=!0,yield[e,null]),yield[e,r])}}(r)){let r=o.toLowerCase();e.has(r)||(t.delete(o),e.add(r)),null===a?(t.delete(o),n.add(r)):(t.append(o,a),n.delete(r))}}return{[tu]:!0,values:t,nulls:n}};function tp(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}let th=((e=tp)=>function(t,...n){let r;if(1===t.length)return t[0];let o=!1,a=t.reduce((t,r,a)=>(/[?#]/.test(r)&&(o=!0),t+r+(a===n.length?"":(o?encodeURIComponent:e)(String(n[a])))),""),i=a.split(/[?#]/,1)[0],l=[],s=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;for(;null!==(r=s.exec(i));)l.push({start:r.index,length:r[0].length});if(l.length>0){let e=0,t=l.reduce((t,n)=>{let r=" ".repeat(n.start-e),o="^".repeat(n.length);return e=n.start+n.length,t+r+o},"");throw new ei(`Path parameters result in path with invalid segments:${a}${t}`)}return a})(tp);class tm extends tc{list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/files",e2,{query:r,...t,headers:tf([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(th`/v1/files/${e}`,{...n,headers:tf([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/files/${e}/content`,{...n,headers:tf([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/files/${e}`,{...n,headers:tf([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,t){let{betas:n,...r}=e;return this._client.post("/v1/files",e8({body:r,...t,headers:tf([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])},this._client))}}class tg extends tc{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/models/${e}?beta=true`,{...n,headers:tf([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models?beta=true",e2,{query:r,...t,headers:tf([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}class tv{constructor(e,t){this.iterator=e,this.controller=t}async *decoder(){let e=new eK;for await(let t of this.iterator)for(let n of e.decode(t))yield JSON.parse(n);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}return new tv(eF(e.body),t)}}class ty extends tc{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/messages/batches?beta=true",{body:r,...t,headers:tf([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/messages/batches/${e}?beta=true`,{...n,headers:tf([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",e2,{query:r,...t,headers:tf([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(th`/v1/messages/batches/${e}?beta=true`,{...n,headers:tf([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(th`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:tf([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,t={},n){let r=await this.retrieve(e);if(!r.results_url)throw new ei(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:o}=t??{};return this._client.get(r.results_url,{...n,headers:tf([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tv.fromResponse(t.response,t.controller))}}let tb=e=>{let t=0,n=[];for(;t<e.length;){let r=e[t];if("\\"===r){t++;continue}if("{"===r){n.push({type:"brace",value:"{"}),t++;continue}if("}"===r){n.push({type:"brace",value:"}"}),t++;continue}if("["===r){n.push({type:"paren",value:"["}),t++;continue}if("]"===r){n.push({type:"paren",value:"]"}),t++;continue}if(":"===r){n.push({type:"separator",value:":"}),t++;continue}if(","===r){n.push({type:"delimiter",value:","}),t++;continue}if('"'===r){let o="",a=!1;for(r=e[++t];'"'!==r;){if(t===e.length){a=!0;break}if("\\"===r){if(++t===e.length){a=!0;break}o+=r+e[t],r=e[++t]}else o+=r,r=e[++t]}r=e[++t],a||n.push({type:"string",value:o});continue}let o=/\s/;if(r&&o.test(r)){t++;continue}let a=/[0-9]/;if(r&&a.test(r)||"-"===r||"."===r){let o="";for("-"===r&&(o+=r,r=e[++t]);r&&a.test(r)||"."===r;)o+=r,r=e[++t];n.push({type:"number",value:o});continue}let i=/[a-z]/i;if(r&&i.test(r)){let o="";for(;r&&i.test(r)&&t!==e.length;)o+=r,r=e[++t];"true"==o||"false"==o||"null"===o?n.push({type:"name",value:o}):t++;continue}t++}return n},tx=e=>{if(0===e.length)return e;let t=e[e.length-1];switch(t.type){case"separator":return tx(e=e.slice(0,e.length-1));case"number":let n=t.value[t.value.length-1];if("."===n||"-"===n)return tx(e=e.slice(0,e.length-1));case"string":let r=e[e.length-2];if(r?.type==="delimiter"||r?.type==="brace"&&"{"===r.value)return tx(e=e.slice(0,e.length-1));break;case"delimiter":return tx(e=e.slice(0,e.length-1))}return e},tw=e=>{let t=[];return e.map(e=>{"brace"===e.type&&("{"===e.value?t.push("}"):t.splice(t.lastIndexOf("}"),1)),"paren"===e.type&&("["===e.value?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(t=>{"}"===t?e.push({type:"brace",value:"}"}):"]"===t&&e.push({type:"paren",value:"]"})}),e},tk=e=>{let t="";return e.map(e=>{"string"===e.type?t+='"'+e.value+'"':t+=e.value}),t},tS=e=>JSON.parse(tk(tw(tx(tb(e))))),tE="__json_buf";function tO(e){return"tool_use"===e.type||"server_tool_use"===e.type||"mcp_tool_use"===e.type}class tC{constructor(){l.add(this),this.messages=[],this.receivedMessages=[],s.set(this,void 0),this.controller=new AbortController,c.set(this,void 0),u.set(this,()=>{}),d.set(this,()=>{}),f.set(this,void 0),p.set(this,()=>{}),h.set(this,()=>{}),m.set(this,{}),g.set(this,!1),v.set(this,!1),y.set(this,!1),b.set(this,!1),x.set(this,void 0),w.set(this,void 0),E.set(this,e=>{if(et(this,v,!0,"f"),eo(e)&&(e=new es),e instanceof es)return et(this,y,!0,"f"),this._emit("abort",e);if(e instanceof ei)return this._emit("error",e);if(e instanceof Error){let t=new ei(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new ei(String(e)))}),et(this,c,new Promise((e,t)=>{et(this,u,e,"f"),et(this,d,t,"f")}),"f"),et(this,f,new Promise((e,t)=>{et(this,p,e,"f"),et(this,h,t,"f")}),"f"),en(this,c,"f").catch(()=>{}),en(this,f,"f").catch(()=>{})}get response(){return en(this,x,"f")}get request_id(){return en(this,w,"f")}async withResponse(){let e=await en(this,c,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new tC;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n){let r=new tC;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},en(this,E,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),en(this,l,"m",O).call(this);let{response:o,data:a}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(o),a))en(this,l,"m",C).call(this,e);if(a.controller.signal?.aborted)throw new es;en(this,l,"m",j).call(this)}_connected(e){this.ended||(et(this,x,e,"f"),et(this,w,e?.headers.get("request-id"),"f"),en(this,u,"f").call(this,e),this._emit("connect"))}get ended(){return en(this,g,"f")}get errored(){return en(this,v,"f")}get aborted(){return en(this,y,"f")}abort(){this.controller.abort()}on(e,t){return(en(this,m,"f")[e]||(en(this,m,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=en(this,m,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(en(this,m,"f")[e]||(en(this,m,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{et(this,b,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){et(this,b,!0,"f"),await en(this,f,"f")}get currentMessage(){return en(this,s,"f")}async finalMessage(){return await this.done(),en(this,l,"m",k).call(this)}async finalText(){return await this.done(),en(this,l,"m",S).call(this)}_emit(e,...t){if(en(this,g,"f"))return;"end"===e&&(et(this,g,!0,"f"),en(this,p,"f").call(this));let n=en(this,m,"f")[e];if(n&&(en(this,m,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];en(this,b,"f")||n?.length||Promise.reject(e),en(this,d,"f").call(this,e),en(this,h,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];en(this,b,"f")||n?.length||Promise.reject(e),en(this,d,"f").call(this,e),en(this,h,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",en(this,l,"m",k).call(this))}async _fromReadableStream(e,t){let n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),en(this,l,"m",O).call(this),this._connected(null);let r=e$.fromReadableStream(e,this.controller);for await(let e of r)en(this,l,"m",C).call(this,e);if(r.controller.signal?.aborted)throw new es;en(this,l,"m",j).call(this)}[(s=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,E=new WeakMap,l=new WeakSet,k=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},S=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(e=>"text"===e.type).map(e=>e.text);if(0===e.length)throw new ei("stream ended without producing a content block with type=text");return e.join(" ")},O=function(){this.ended||et(this,s,void 0,"f")},C=function(e){if(this.ended)return;let t=en(this,l,"m",_).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let n=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===n.type&&this._emit("text",e.delta.text,n.text||"");break;case"citations_delta":"text"===n.type&&this._emit("citation",e.delta.citation,n.citations??[]);break;case"input_json_delta":tO(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break;case"thinking_delta":"thinking"===n.type&&this._emit("thinking",e.delta.thinking,n.thinking);break;case"signature_delta":"thinking"===n.type&&this._emit("signature",n.signature);break;default:e.delta}break}case"message_stop":this._addMessageParam(t),this._addMessage(t,!0);break;case"content_block_stop":this._emit("contentBlock",t.content.at(-1));break;case"message_start":et(this,s,t,"f")}},j=function(){if(this.ended)throw new ei("stream has ended, this shouldn't happen");let e=en(this,s,"f");if(!e)throw new ei("request ended without sending any chunks");return et(this,s,void 0,"f"),e},_=function(e){let t=en(this,s,"f");if("message_start"===e.type){if(t)throw new ei(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new ei(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":case"content_block_stop":return t;case"message_delta":return t.container=e.delta.container,t.stop_reason=e.delta.stop_reason,t.stop_sequence=e.delta.stop_sequence,t.usage.output_tokens=e.usage.output_tokens,null!=e.usage.input_tokens&&(t.usage.input_tokens=e.usage.input_tokens),null!=e.usage.cache_creation_input_tokens&&(t.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),null!=e.usage.cache_read_input_tokens&&(t.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),null!=e.usage.server_tool_use&&(t.usage.server_tool_use=e.usage.server_tool_use),t;case"content_block_start":return t.content.push(e.content_block),t;case"content_block_delta":{let n=t.content.at(e.index);switch(e.delta.type){case"text_delta":n?.type==="text"&&(n.text+=e.delta.text);break;case"citations_delta":n?.type==="text"&&(n.citations??(n.citations=[]),n.citations.push(e.delta.citation));break;case"input_json_delta":if(n&&tO(n)){let t=n[tE]||"";if(Object.defineProperty(n,tE,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t)try{n.input=tS(t)}catch(n){let e=new ei(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${n}. JSON: ${t}`);en(this,E,"f").call(this,e)}}break;case"thinking_delta":n?.type==="thinking"&&(n.thinking+=e.delta.thinking);break;case"signature_delta":n?.type==="thinking"&&(n.signature=e.delta.signature);break;default:e.delta}return t}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on("end",()=>{for(let e of(n=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new e$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}let tj={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192},t_={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};class tP extends tc{constructor(){super(...arguments),this.batches=new ty(this._client)}create(e,t){let{betas:n,...r}=e;r.model in t_&&console.warn(`The model '${r.model}' is deprecated and will reach end-of-life on ${t_[r.model]}Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let o=this._client._options.timeout;if(!r.stream&&null==o){let e=tj[r.model]??void 0;o=this._client.calculateNonstreamingTimeout(r.max_tokens,e)}return this._client.post("/v1/messages?beta=true",{body:r,timeout:o??6e5,...t,headers:tf([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}stream(e,t){return tC.createMessage(this,e,t)}countTokens(e,t){let{betas:n,...r}=e;return this._client.post("/v1/messages/count_tokens?beta=true",{body:r,...t,headers:tf([{"anthropic-beta":[...n??[],"token-counting-2024-11-01"].toString()},t?.headers])})}}tP.Batches=ty;class tN extends tc{constructor(){super(...arguments),this.models=new tg(this._client),this.messages=new tP(this._client),this.files=new tm(this._client)}}tN.Models=tg,tN.Messages=tP,tN.Files=tm;class tT extends tc{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??6e5,...t,headers:tf([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}let tA="__json_buf";function tM(e){return"tool_use"===e.type||"server_tool_use"===e.type}class tI{constructor(){P.add(this),this.messages=[],this.receivedMessages=[],N.set(this,void 0),this.controller=new AbortController,T.set(this,void 0),A.set(this,()=>{}),M.set(this,()=>{}),I.set(this,void 0),R.set(this,()=>{}),D.set(this,()=>{}),L.set(this,{}),Z.set(this,!1),z.set(this,!1),B.set(this,!1),F.set(this,!1),H.set(this,void 0),q.set(this,void 0),K.set(this,e=>{if(et(this,z,!0,"f"),eo(e)&&(e=new es),e instanceof es)return et(this,B,!0,"f"),this._emit("abort",e);if(e instanceof ei)return this._emit("error",e);if(e instanceof Error){let t=new ei(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new ei(String(e)))}),et(this,T,new Promise((e,t)=>{et(this,A,e,"f"),et(this,M,t,"f")}),"f"),et(this,I,new Promise((e,t)=>{et(this,R,e,"f"),et(this,D,t,"f")}),"f"),en(this,T,"f").catch(()=>{}),en(this,I,"f").catch(()=>{})}get response(){return en(this,H,"f")}get request_id(){return en(this,q,"f")}async withResponse(){let e=await en(this,T,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new tI;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n){let r=new tI;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},en(this,K,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),en(this,P,"m",$).call(this);let{response:o,data:a}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(o),a))en(this,P,"m",V).call(this,e);if(a.controller.signal?.aborted)throw new es;en(this,P,"m",X).call(this)}_connected(e){this.ended||(et(this,H,e,"f"),et(this,q,e?.headers.get("request-id"),"f"),en(this,A,"f").call(this,e),this._emit("connect"))}get ended(){return en(this,Z,"f")}get errored(){return en(this,z,"f")}get aborted(){return en(this,B,"f")}abort(){this.controller.abort()}on(e,t){return(en(this,L,"f")[e]||(en(this,L,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=en(this,L,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(en(this,L,"f")[e]||(en(this,L,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{et(this,F,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){et(this,F,!0,"f"),await en(this,I,"f")}get currentMessage(){return en(this,N,"f")}async finalMessage(){return await this.done(),en(this,P,"m",W).call(this)}async finalText(){return await this.done(),en(this,P,"m",U).call(this)}_emit(e,...t){if(en(this,Z,"f"))return;"end"===e&&(et(this,Z,!0,"f"),en(this,R,"f").call(this));let n=en(this,L,"f")[e];if(n&&(en(this,L,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];en(this,F,"f")||n?.length||Promise.reject(e),en(this,M,"f").call(this,e),en(this,D,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];en(this,F,"f")||n?.length||Promise.reject(e),en(this,M,"f").call(this,e),en(this,D,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",en(this,P,"m",W).call(this))}async _fromReadableStream(e,t){let n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),en(this,P,"m",$).call(this),this._connected(null);let r=e$.fromReadableStream(e,this.controller);for await(let e of r)en(this,P,"m",V).call(this,e);if(r.controller.signal?.aborted)throw new es;en(this,P,"m",X).call(this)}[(N=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakMap,I=new WeakMap,R=new WeakMap,D=new WeakMap,L=new WeakMap,Z=new WeakMap,z=new WeakMap,B=new WeakMap,F=new WeakMap,H=new WeakMap,q=new WeakMap,K=new WeakMap,P=new WeakSet,W=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},U=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(e=>"text"===e.type).map(e=>e.text);if(0===e.length)throw new ei("stream ended without producing a content block with type=text");return e.join(" ")},$=function(){this.ended||et(this,N,void 0,"f")},V=function(e){if(this.ended)return;let t=en(this,P,"m",G).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let n=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===n.type&&this._emit("text",e.delta.text,n.text||"");break;case"citations_delta":"text"===n.type&&this._emit("citation",e.delta.citation,n.citations??[]);break;case"input_json_delta":tM(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break;case"thinking_delta":"thinking"===n.type&&this._emit("thinking",e.delta.thinking,n.thinking);break;case"signature_delta":"thinking"===n.type&&this._emit("signature",n.signature);break;default:e.delta}break}case"message_stop":this._addMessageParam(t),this._addMessage(t,!0);break;case"content_block_stop":this._emit("contentBlock",t.content.at(-1));break;case"message_start":et(this,N,t,"f")}},X=function(){if(this.ended)throw new ei("stream has ended, this shouldn't happen");let e=en(this,N,"f");if(!e)throw new ei("request ended without sending any chunks");return et(this,N,void 0,"f"),e},G=function(e){let t=en(this,N,"f");if("message_start"===e.type){if(t)throw new ei(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new ei(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":case"content_block_stop":return t;case"message_delta":return t.stop_reason=e.delta.stop_reason,t.stop_sequence=e.delta.stop_sequence,t.usage.output_tokens=e.usage.output_tokens,null!=e.usage.input_tokens&&(t.usage.input_tokens=e.usage.input_tokens),null!=e.usage.cache_creation_input_tokens&&(t.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),null!=e.usage.cache_read_input_tokens&&(t.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),null!=e.usage.server_tool_use&&(t.usage.server_tool_use=e.usage.server_tool_use),t;case"content_block_start":return t.content.push(e.content_block),t;case"content_block_delta":{let n=t.content.at(e.index);switch(e.delta.type){case"text_delta":n?.type==="text"&&(n.text+=e.delta.text);break;case"citations_delta":n?.type==="text"&&(n.citations??(n.citations=[]),n.citations.push(e.delta.citation));break;case"input_json_delta":if(n&&tM(n)){let t=n[tA]||"";Object.defineProperty(n,tA,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t&&(n.input=tS(t))}break;case"thinking_delta":n?.type==="thinking"&&(n.thinking+=e.delta.thinking);break;case"signature_delta":n?.type==="thinking"&&(n.signature=e.delta.signature);break;default:e.delta}return t}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on("end",()=>{for(let e of(n=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new e$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class tR extends tc{create(e,t){return this._client.post("/v1/messages/batches",{body:e,...t})}retrieve(e,t){return this._client.get(th`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",e2,{query:e,...t})}delete(e,t){return this._client.delete(th`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(th`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let n=await this.retrieve(e);if(!n.results_url)throw new ei(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...t,headers:tf([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tv.fromResponse(t.response,t.controller))}}class tD extends tc{constructor(){super(...arguments),this.batches=new tR(this._client)}create(e,t){e.model in tL&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${tL[e.model]}Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let n=this._client._options.timeout;if(!e.stream&&null==n){let t=tj[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,t)}return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...t,stream:e.stream??!1})}stream(e,t){return tI.createMessage(this,e,t)}countTokens(e,t){return this._client.post("/v1/messages/count_tokens",{body:e,...t})}}let tL={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};tD.Batches=tR;class tZ extends tc{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/models/${e}`,{...n,headers:tf([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models",e2,{query:r,...t,headers:tf([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}let tz=e=>void 0!==globalThis.process?globalThis.process.env?.[e]?.trim()??void 0:void 0!==globalThis.Deno?globalThis.Deno.env?.get?.(e)?.trim():void 0;class tB{constructor({baseURL:e=tz("ANTHROPIC_BASE_URL"),apiKey:t=tz("ANTHROPIC_API_KEY")??null,authToken:n=tz("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){Y.set(this,void 0);let o={apiKey:t,authToken:n,...r,baseURL:e||"https://api.anthropic.com"};if(!o.dangerouslyAllowBrowser&&eI())throw new ei("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n");this.baseURL=o.baseURL,this.timeout=o.timeout??tF.DEFAULT_TIMEOUT,this.logger=o.logger??console;let a="warn";this.logLevel=a,this.logLevel=eC(o.logLevel,"ClientOptions.logLevel",this)??eC(tz("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??a,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??function(){if("undefined"!=typeof fetch)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}(),et(this,Y,eq,"f"),this._options=o,this.apiKey=t,this.authToken=n}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(!(this.apiKey&&e.get("x-api-key")||t.has("x-api-key")||this.authToken&&e.get("authorization")||t.has("authorization")))throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}authHeaders(e){return tf([this.apiKeyAuth(e),this.bearerAuth(e)])}apiKeyAuth(e){if(null!=this.apiKey)return tf([{"X-Api-Key":this.apiKey}])}bearerAuth(e){if(null!=this.authToken)return tf([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new ei(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${eM}`}defaultIdempotencyKey(){return`stainless-node-retry-${er()}`}makeStatusError(e,t,n,r){return el.generate(e,t,n,r)}buildURL(e,t){let n=new URL(ex(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return!function(e){if(!e)return!0;for(let t in e)return!1;return!0}(r)&&(t={...r,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(n.search=this.stringifyQuery(t)),n.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new ei("Streaming is strongly recommended for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(n=>({method:e,path:t,...n})))}request(e,t=null){return new eJ(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,o=r.maxRetries??this.maxRetries;null==t&&(t=o),await this.prepareOptions(r);let{req:a,url:i,timeout:l}=this.buildRequest(r,{retryCount:o-t});await this.prepareRequest(a,{url:i,options:r});let s="log_"+(16777216*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===n?"":`, retryOf: ${n}`,u=Date.now();if(eT(this).debug(`[${s}] sending request`,eA({retryOfRequestLogID:n,method:r.method,url:i,options:r,headers:a.headers})),r.signal?.aborted)throw new es;let d=new AbortController,f=await this.fetchWithTimeout(i,a,l,d).catch(ea),p=Date.now();if(f instanceof Error){let e=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new es;let o=eo(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):""));if(t)return eT(this).info(`[${s}] connection ${o?"timed out":"failed"} - ${e}`),eT(this).debug(`[${s}] connection ${o?"timed out":"failed"} (${e})`,eA({retryOfRequestLogID:n,url:i,durationMs:p-u,message:f.message})),this.retryRequest(r,t,n??s);if(eT(this).info(`[${s}] connection ${o?"timed out":"failed"} - error; no more retries left`),eT(this).debug(`[${s}] connection ${o?"timed out":"failed"} (error; no more retries left)`,eA({retryOfRequestLogID:n,url:i,durationMs:p-u,message:f.message})),o)throw new eu;throw new ec({cause:f})}let h=[...f.headers.entries()].filter(([e])=>"request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),m=`[${s}${c}${h}] ${a.method} ${i} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${p-u}ms`;if(!f.ok){let e=this.shouldRetry(f);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await eH(f.body),eT(this).info(`${m} - ${e}`),eT(this).debug(`[${s}] response error (${e})`,eA({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:p-u})),this.retryRequest(r,t,n??s,f.headers)}let o=e?"error; no more retries left":"error; not retryable";eT(this).info(`${m} - ${o}`);let a=await f.text().catch(e=>ea(e).message),i=eS(a),l=i?void 0:a;throw eT(this).debug(`[${s}] response error (${o})`,eA({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,message:l,durationMs:Date.now()-u})),this.makeStatusError(f.status,i,l,f.headers)}return eT(this).info(m),eT(this).debug(`[${s}] response start`,eA({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:p-u})),{response:f,options:r,controller:d,requestLogID:s,retryOfRequestLogID:n,startTime:u}}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}requestAPIList(e,t){return new e1(this,this.makeRequest(t,null,void 0),e)}async fetchWithTimeout(e,t,n,r){let{signal:o,method:a,...i}=t||{};o&&o.addEventListener("abort",()=>r.abort());let l=setTimeout(()=>r.abort(),n),s=globalThis.ReadableStream&&i.body instanceof globalThis.ReadableStream||"object"==typeof i.body&&null!==i.body&&Symbol.asyncIterator in i.body,c={signal:r.signal,...s?{duplex:"half"}:{},method:"GET",...i};a&&(c.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,c)}finally{clearTimeout(l)}}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||e.status>=500)}async retryRequest(e,t,n,r){let o;let a=r?.get("retry-after-ms");if(a){let e=parseFloat(a);Number.isNaN(e)||(o=e)}let i=r?.get("retry-after");if(i&&!o){let e=parseFloat(i);o=Number.isNaN(e)?Date.parse(i)-Date.now():1e3*e}if(!(o&&0<=o&&o<6e4)){let n=e.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(t,n)}return await eE(o),this.makeRequest(e,t-1,n)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}calculateNonstreamingTimeout(e,t){if(36e5*e/128e3>6e5||null!=t&&e>t)throw new ei("Streaming is strongly recommended for operations that may token longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}buildRequest(e,{retryCount:t=0}={}){let n={...e},{method:r,path:o,query:a}=n,i=this.buildURL(o,a);"timeout"in n&&ek("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:l,body:s}=this.buildBody({options:n}),c=this.buildHeaders({options:e,method:r,bodyHeaders:l,retryCount:t});return{req:{method:r,headers:c,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&s instanceof globalThis.ReadableStream&&{duplex:"half"},...s&&{body:s},...this.fetchOptions??{},...n.fetchOptions??{}},url:i,timeout:n.timeout}}buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let o={};this.idempotencyHeader&&"get"!==t&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=e.idempotencyKey);let a=tf([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...eZ(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(a),a.values}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=tf([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||"string"==typeof e&&n.values.has("content-type")||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:"object"==typeof e&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&"function"==typeof e.next)?{bodyHeaders:void 0,body:eB(e)}:en(this,Y,"f").call(this,{body:e,headers:n})}}Y=new WeakMap,tB.Anthropic=tB,tB.HUMAN_PROMPT="\n\nHuman:",tB.AI_PROMPT="\n\nAssistant:",tB.DEFAULT_TIMEOUT=6e5,tB.AnthropicError=ei,tB.APIError=el,tB.APIConnectionError=ec,tB.APIConnectionTimeoutError=eu,tB.APIUserAbortError=es,tB.NotFoundError=eh,tB.ConflictError=em,tB.RateLimitError=ev,tB.BadRequestError=ed,tB.AuthenticationError=ef,tB.InternalServerError=ey,tB.PermissionDeniedError=ep,tB.UnprocessableEntityError=eg,tB.toFile=tl;class tF extends tB{constructor(){super(...arguments),this.completions=new tT(this),this.messages=new tD(this),this.models=new tZ(this),this.beta=new tN(this)}}tF.Completions=tT,tF.Messages=tD,tF.Models=tZ,tF.Beta=tN;let{HUMAN_PROMPT:tH,AI_PROMPT:tq}=tF},21886:function(e,t,n){"use strict";let r,o;n.d(t,{p:function(){return _}});var a,i=n(2265),l=n(13323),s=n(17684),c=n(80004),u=n(93689),d=n(37863),f=n(47634),p=n(24536),h=n(40293),m=n(27847);let g=null!=(a=i.startTransition)?a:function(e){e()};var v=n(37388),y=((r=y||{})[r.Open=0]="Open",r[r.Closed=1]="Closed",r),b=((o=b||{})[o.ToggleDisclosure=0]="ToggleDisclosure",o[o.CloseDisclosure=1]="CloseDisclosure",o[o.SetButtonId=2]="SetButtonId",o[o.SetPanelId=3]="SetPanelId",o[o.LinkPanel=4]="LinkPanel",o[o.UnlinkPanel=5]="UnlinkPanel",o);let x={0:e=>({...e,disclosureState:(0,p.E)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},4:e=>!0===e.linkedPanel?e:{...e,linkedPanel:!0},5:e=>!1===e.linkedPanel?e:{...e,linkedPanel:!1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},w=(0,i.createContext)(null);function k(e){let t=(0,i.useContext)(w);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Disclosure /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,k),t}return t}w.displayName="DisclosureContext";let S=(0,i.createContext)(null);S.displayName="DisclosureAPIContext";let E=(0,i.createContext)(null);function O(e,t){return(0,p.E)(t.type,x,e,t)}E.displayName="DisclosurePanelContext";let C=i.Fragment,j=m.AN.RenderStrategy|m.AN.Static,_=Object.assign((0,m.yV)(function(e,t){let{defaultOpen:n=!1,...r}=e,o=(0,i.useRef)(null),a=(0,u.T)(t,(0,u.h)(e=>{o.current=e},void 0===e.as||e.as===i.Fragment)),s=(0,i.useRef)(null),c=(0,i.useRef)(null),f=(0,i.useReducer)(O,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:c,panelRef:s,buttonId:null,panelId:null}),[{disclosureState:g,buttonId:v},y]=f,b=(0,l.z)(e=>{y({type:1});let t=(0,h.r)(o);if(!t||!v)return;let n=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(v):t.getElementById(v);null==n||n.focus()}),x=(0,i.useMemo)(()=>({close:b}),[b]),k=(0,i.useMemo)(()=>({open:0===g,close:b}),[g,b]);return i.createElement(w.Provider,{value:f},i.createElement(S.Provider,{value:x},i.createElement(d.up,{value:(0,p.E)(g,{0:d.ZM.Open,1:d.ZM.Closed})},(0,m.sY)({ourProps:{ref:a},theirProps:r,slot:k,defaultTag:C,name:"Disclosure"}))))}),{Button:(0,m.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-disclosure-button-".concat(n),...o}=e,[a,d]=k("Disclosure.Button"),p=(0,i.useContext)(E),h=null!==p&&p===a.panelId,g=(0,i.useRef)(null),y=(0,u.T)(g,t,h?null:a.buttonRef),b=(0,m.Y2)();(0,i.useEffect)(()=>{if(!h)return d({type:2,buttonId:r}),()=>{d({type:2,buttonId:null})}},[r,d,h]);let x=(0,l.z)(e=>{var t;if(h){if(1===a.disclosureState)return;switch(e.key){case v.R.Space:case v.R.Enter:e.preventDefault(),e.stopPropagation(),d({type:0}),null==(t=a.buttonRef.current)||t.focus()}}else switch(e.key){case v.R.Space:case v.R.Enter:e.preventDefault(),e.stopPropagation(),d({type:0})}}),w=(0,l.z)(e=>{e.key===v.R.Space&&e.preventDefault()}),S=(0,l.z)(t=>{var n;(0,f.P)(t.currentTarget)||e.disabled||(h?(d({type:0}),null==(n=a.buttonRef.current)||n.focus()):d({type:0}))}),O=(0,i.useMemo)(()=>({open:0===a.disclosureState}),[a]),C=(0,c.f)(e,g),j=h?{ref:y,type:C,onKeyDown:x,onClick:S}:{ref:y,id:r,type:C,"aria-expanded":0===a.disclosureState,"aria-controls":a.linkedPanel?a.panelId:void 0,onKeyDown:x,onKeyUp:w,onClick:S};return(0,m.sY)({mergeRefs:b,ourProps:j,theirProps:o,slot:O,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,m.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-disclosure-panel-".concat(n),...o}=e,[a,l]=k("Disclosure.Panel"),{close:c}=function e(t){let n=(0,i.useContext)(S);if(null===n){let n=Error("<".concat(t," /> is missing a parent <Disclosure /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(n,e),n}return n}("Disclosure.Panel"),f=(0,m.Y2)(),p=(0,u.T)(t,a.panelRef,e=>{g(()=>l({type:e?4:5}))});(0,i.useEffect)(()=>(l({type:3,panelId:r}),()=>{l({type:3,panelId:null})}),[r,l]);let h=(0,d.oJ)(),v=null!==h?(h&d.ZM.Open)===d.ZM.Open:0===a.disclosureState,y=(0,i.useMemo)(()=>({open:0===a.disclosureState,close:c}),[a,c]);return i.createElement(E.Provider,{value:a.panelId},(0,m.sY)({mergeRefs:f,ourProps:{ref:p,id:r},theirProps:o,slot:y,defaultTag:"div",features:j,visible:v,name:"Disclosure.Panel"}))})})},37388:function(e,t,n){"use strict";let r;n.d(t,{R:function(){return o}});var o=((r=o||{}).Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r)},28517:function(e,t,n){"use strict";let r,o,a,i,l;n.d(t,{R:function(){return K}});var s=n(2265),c=n(64518),u=n(31948);function d(e,t){let[n,r]=(0,s.useState)(e),o=(0,u.E)(e);return(0,c.e)(()=>r(o.current),[o,r,...t]),n}var f=n(62963),p=n(90945),h=n(13323),m=n(17684),g=n(98505),v=n(80004),y=n(93689);let b=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function x(e){var t,n;let r=null!=(t=e.innerText)?t:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let a=!1;for(let e of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),a=!0;let i=a?null!=(n=o.innerText)?n:"":r;return b.test(i)&&(i=i.replace(b,"")),i}function w(e){return[e.screenX,e.screenY]}var k=n(38198),S=n(37863),E=n(47634),O=((r=O||{})[r.First=0]="First",r[r.Previous=1]="Previous",r[r.Next=2]="Next",r[r.Last=3]="Last",r[r.Specific=4]="Specific",r[r.Nothing=5]="Nothing",r),C=n(16015),j=n(37105),_=n(56314),P=n(24536),N=n(40293),T=n(27847),A=n(37388),M=((o=M||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),I=((a=I||{})[a.Single=0]="Single",a[a.Multi=1]="Multi",a),R=((i=R||{})[i.Pointer=0]="Pointer",i[i.Other=1]="Other",i),D=((l=D||{})[l.OpenListbox=0]="OpenListbox",l[l.CloseListbox=1]="CloseListbox",l[l.GoToOption=2]="GoToOption",l[l.Search=3]="Search",l[l.ClearSearch=4]="ClearSearch",l[l.RegisterOption=5]="RegisterOption",l[l.UnregisterOption=6]="UnregisterOption",l[l.RegisterLabel=7]="RegisterLabel",l);function L(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e,n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=(0,j.z2)(t(e.options.slice()),e=>e.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return -1===o&&(o=null),{options:r,activeOptionIndex:o}}let Z={1:e=>e.dataRef.current.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.dataRef.current.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(e=>n(e.dataRef.current.value));return -1!==r&&(t=r),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||1===e.listboxState)return e;let r=L(e),o=function(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1;switch(e.focus){case 0:for(let e=0;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 1:for(let e=o-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 2:for(let e=o+1;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 3:for(let e=n.length-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 4:for(let r=0;r<n.length;++r)if(t.resolveId(n[r],r,n)===e.id)return r;return r;case 5:return null;default:!function(e){throw Error("Unexpected object: "+e)}(e)}}(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))}),a=o?e.options.indexOf(o):-1;return -1===a||a===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:a,activationTrigger:1}},4:e=>e.dataRef.current.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=L(e,e=>[...e,n]);return null===e.activeOptionIndex&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=L(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},z=(0,s.createContext)(null);function B(e){let t=(0,s.useContext)(z);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Listbox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,B),t}return t}z.displayName="ListboxActionsContext";let F=(0,s.createContext)(null);function H(e){let t=(0,s.useContext)(F);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Listbox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,H),t}return t}function q(e,t){return(0,P.E)(t.type,Z,e,t)}F.displayName="ListboxDataContext";let W=s.Fragment,U=T.AN.RenderStrategy|T.AN.Static,K=Object.assign((0,T.yV)(function(e,t){let{value:n,defaultValue:r,form:o,name:a,onChange:i,by:l=(e,t)=>e===t,disabled:u=!1,horizontal:d=!1,multiple:m=!1,...v}=e,b=d?"horizontal":"vertical",x=(0,y.T)(t),[w=m?[]:void 0,E]=(0,f.q)(n,i,r),[C,N]=(0,s.useReducer)(q,{dataRef:(0,s.createRef)(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),A=(0,s.useRef)({static:!1,hold:!1}),M=(0,s.useRef)(null),I=(0,s.useRef)(null),R=(0,s.useRef)(null),D=(0,h.z)("string"==typeof l?(e,t)=>(null==e?void 0:e[l])===(null==t?void 0:t[l]):l),L=(0,s.useCallback)(e=>(0,P.E)(Z.mode,{1:()=>w.some(t=>D(t,e)),0:()=>D(w,e)}),[w]),Z=(0,s.useMemo)(()=>({...C,value:w,disabled:u,mode:m?1:0,orientation:b,compare:D,isSelected:L,optionsPropsRef:A,labelRef:M,buttonRef:I,optionsRef:R}),[w,u,m,C]);(0,c.e)(()=>{C.dataRef.current=Z},[Z]),(0,g.O)([Z.buttonRef,Z.optionsRef],(e,t)=>{var n;N({type:1}),(0,j.sP)(t,j.tJ.Loose)||(e.preventDefault(),null==(n=Z.buttonRef.current)||n.focus())},0===Z.listboxState);let B=(0,s.useMemo)(()=>({open:0===Z.listboxState,disabled:u,value:w}),[Z,u,w]),H=(0,h.z)(e=>{let t=Z.options.find(t=>t.id===e);t&&Y(t.dataRef.current.value)}),U=(0,h.z)(()=>{if(null!==Z.activeOptionIndex){let{dataRef:e,id:t}=Z.options[Z.activeOptionIndex];Y(e.current.value),N({type:2,focus:O.Specific,id:t})}}),K=(0,h.z)(()=>N({type:0})),$=(0,h.z)(()=>N({type:1})),V=(0,h.z)((e,t,n)=>e===O.Specific?N({type:2,focus:O.Specific,id:t,trigger:n}):N({type:2,focus:e,trigger:n})),X=(0,h.z)((e,t)=>(N({type:5,id:e,dataRef:t}),()=>N({type:6,id:e}))),G=(0,h.z)(e=>(N({type:7,id:e}),()=>N({type:7,id:null}))),Y=(0,h.z)(e=>(0,P.E)(Z.mode,{0:()=>null==E?void 0:E(e),1(){let t=Z.value.slice(),n=t.findIndex(t=>D(t,e));return -1===n?t.push(e):t.splice(n,1),null==E?void 0:E(t)}})),Q=(0,h.z)(e=>N({type:3,value:e})),J=(0,h.z)(()=>N({type:4})),ee=(0,s.useMemo)(()=>({onChange:Y,registerOption:X,registerLabel:G,goToOption:V,closeListbox:$,openListbox:K,selectActiveOption:U,selectOption:H,search:Q,clearSearch:J}),[]),et=(0,s.useRef)(null),en=(0,p.G)();return(0,s.useEffect)(()=>{et.current&&void 0!==r&&en.addEventListener(et.current,"reset",()=>{null==E||E(r)})},[et,E]),s.createElement(z.Provider,{value:ee},s.createElement(F.Provider,{value:Z},s.createElement(S.up,{value:(0,P.E)(Z.listboxState,{0:S.ZM.Open,1:S.ZM.Closed})},null!=a&&null!=w&&(0,_.t)({[a]:w}).map((e,t)=>{let[n,r]=e;return s.createElement(k._,{features:k.A.Hidden,ref:0===t?e=>{var t;et.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...(0,T.oA)({key:n,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:n,value:r})})}),(0,T.sY)({ourProps:{ref:x},theirProps:v,slot:B,defaultTag:W,name:"Listbox"}))))}),{Button:(0,T.yV)(function(e,t){var n;let r=(0,m.M)(),{id:o="headlessui-listbox-button-".concat(r),...a}=e,i=H("Listbox.Button"),l=B("Listbox.Button"),c=(0,y.T)(i.buttonRef,t),u=(0,p.G)(),f=(0,h.z)(e=>{switch(e.key){case A.R.Space:case A.R.Enter:case A.R.ArrowDown:e.preventDefault(),l.openListbox(),u.nextFrame(()=>{i.value||l.goToOption(O.First)});break;case A.R.ArrowUp:e.preventDefault(),l.openListbox(),u.nextFrame(()=>{i.value||l.goToOption(O.Last)})}}),g=(0,h.z)(e=>{e.key===A.R.Space&&e.preventDefault()}),b=(0,h.z)(e=>{if((0,E.P)(e.currentTarget))return e.preventDefault();0===i.listboxState?(l.closeListbox(),u.nextFrame(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})})):(e.preventDefault(),l.openListbox())}),x=d(()=>{if(i.labelId)return[i.labelId,o].join(" ")},[i.labelId,o]),w=(0,s.useMemo)(()=>({open:0===i.listboxState,disabled:i.disabled,value:i.value}),[i]),k={ref:c,id:o,type:(0,v.f)(e,i.buttonRef),"aria-haspopup":"listbox","aria-controls":null==(n=i.optionsRef.current)?void 0:n.id,"aria-expanded":0===i.listboxState,"aria-labelledby":x,disabled:i.disabled,onKeyDown:f,onKeyUp:g,onClick:b};return(0,T.sY)({ourProps:k,theirProps:a,slot:w,defaultTag:"button",name:"Listbox.Button"})}),Label:(0,T.yV)(function(e,t){let n=(0,m.M)(),{id:r="headlessui-listbox-label-".concat(n),...o}=e,a=H("Listbox.Label"),i=B("Listbox.Label"),l=(0,y.T)(a.labelRef,t);(0,c.e)(()=>i.registerLabel(r),[r]);let u=(0,h.z)(()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),d=(0,s.useMemo)(()=>({open:0===a.listboxState,disabled:a.disabled}),[a]);return(0,T.sY)({ourProps:{ref:l,id:r,onClick:u},theirProps:o,slot:d,defaultTag:"label",name:"Listbox.Label"})}),Options:(0,T.yV)(function(e,t){var n;let r=(0,m.M)(),{id:o="headlessui-listbox-options-".concat(r),...a}=e,i=H("Listbox.Options"),l=B("Listbox.Options"),c=(0,y.T)(i.optionsRef,t),u=(0,p.G)(),f=(0,p.G)(),g=(0,S.oJ)(),v=null!==g?(g&S.ZM.Open)===S.ZM.Open:0===i.listboxState;(0,s.useEffect)(()=>{var e;let t=i.optionsRef.current;t&&0===i.listboxState&&t!==(null==(e=(0,N.r)(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})},[i.listboxState,i.optionsRef]);let b=(0,h.z)(e=>{switch(f.dispose(),e.key){case A.R.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),l.search(e.key);case A.R.Enter:if(e.preventDefault(),e.stopPropagation(),null!==i.activeOptionIndex){let{dataRef:e}=i.options[i.activeOptionIndex];l.onChange(e.current.value)}0===i.mode&&(l.closeListbox(),(0,C.k)().nextFrame(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case(0,P.E)(i.orientation,{vertical:A.R.ArrowDown,horizontal:A.R.ArrowRight}):return e.preventDefault(),e.stopPropagation(),l.goToOption(O.Next);case(0,P.E)(i.orientation,{vertical:A.R.ArrowUp,horizontal:A.R.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),l.goToOption(O.Previous);case A.R.Home:case A.R.PageUp:return e.preventDefault(),e.stopPropagation(),l.goToOption(O.First);case A.R.End:case A.R.PageDown:return e.preventDefault(),e.stopPropagation(),l.goToOption(O.Last);case A.R.Escape:return e.preventDefault(),e.stopPropagation(),l.closeListbox(),u.nextFrame(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})});case A.R.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(l.search(e.key),f.setTimeout(()=>l.clearSearch(),350))}}),x=d(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.id},[i.buttonRef.current]),w=(0,s.useMemo)(()=>({open:0===i.listboxState}),[i]),k={"aria-activedescendant":null===i.activeOptionIndex||null==(n=i.options[i.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===i.mode||void 0,"aria-labelledby":x,"aria-orientation":i.orientation,id:o,onKeyDown:b,role:"listbox",tabIndex:0,ref:c};return(0,T.sY)({ourProps:k,theirProps:a,slot:w,defaultTag:"ul",features:U,visible:v,name:"Listbox.Options"})}),Option:(0,T.yV)(function(e,t){let n,r,o;let a=(0,m.M)(),{id:i="headlessui-listbox-option-".concat(a),disabled:l=!1,value:d,...f}=e,p=H("Listbox.Option"),g=B("Listbox.Option"),v=null!==p.activeOptionIndex&&p.options[p.activeOptionIndex].id===i,b=p.isSelected(d),k=(0,s.useRef)(null),S=(n=(0,s.useRef)(""),r=(0,s.useRef)(""),(0,h.z)(()=>{let e=k.current;if(!e)return"";let t=e.innerText;if(n.current===t)return r.current;let o=(function(e){let t=e.getAttribute("aria-label");if("string"==typeof t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return"string"==typeof e?e.trim():x(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return x(e).trim()})(e).trim().toLowerCase();return n.current=t,r.current=o,o})),E=(0,u.E)({disabled:l,value:d,domRef:k,get textValue(){return S()}}),j=(0,y.T)(t,k);(0,c.e)(()=>{if(0!==p.listboxState||!v||0===p.activationTrigger)return;let e=(0,C.k)();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=k.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[k,v,p.listboxState,p.activationTrigger,p.activeOptionIndex]),(0,c.e)(()=>g.registerOption(i,E),[E,i]);let _=(0,h.z)(e=>{if(l)return e.preventDefault();g.onChange(d),0===p.mode&&(g.closeListbox(),(0,C.k)().nextFrame(()=>{var e;return null==(e=p.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),P=(0,h.z)(()=>{if(l)return g.goToOption(O.Nothing);g.goToOption(O.Specific,i)}),N=(o=(0,s.useRef)([-1,-1]),{wasMoved(e){let t=w(e);return(o.current[0]!==t[0]||o.current[1]!==t[1])&&(o.current=t,!0)},update(e){o.current=w(e)}}),A=(0,h.z)(e=>N.update(e)),M=(0,h.z)(e=>{N.wasMoved(e)&&(l||v||g.goToOption(O.Specific,i,0))}),I=(0,h.z)(e=>{N.wasMoved(e)&&(l||v&&g.goToOption(O.Nothing))}),R=(0,s.useMemo)(()=>({active:v,selected:b,disabled:l}),[v,b,l]);return(0,T.sY)({ourProps:{id:i,ref:j,role:"option",tabIndex:!0===l?void 0:-1,"aria-disabled":!0===l||void 0,"aria-selected":b,disabled:void 0,onClick:_,onFocus:P,onPointerEnter:A,onMouseEnter:A,onPointerMove:M,onMouseMove:M,onPointerLeave:I,onMouseLeave:I},theirProps:f,slot:R,defaultTag:"li",name:"Listbox.Option"})})})},31492:function(e,t,n){"use strict";let r,o,a;n.d(t,{O:function(){return D}});var i=n(2265),l=n(37388),s=n(13323),c=n(17684),u=n(64518),d=n(31948),f=n(80004),p=n(93689),h=n(93394),m=n(38198);function g(e){let{onFocus:t}=e,[n,r]=(0,i.useState)(!0),o=(0,h.t)();return n?i.createElement(m._,{as:"button",type:"button",features:m.A.Focusable,onFocus:e=>{e.preventDefault();let n,a=50;n=requestAnimationFrame(function e(){if(a--<=0){n&&cancelAnimationFrame(n);return}if(t()){if(cancelAnimationFrame(n),!o.current)return;r(!1);return}n=requestAnimationFrame(e)})}}):null}var v=n(37105),y=n(24536),b=n(96822),x=n(40293),w=n(27847);let k=i.createContext(null);function S(e){let{children:t}=e,n=i.useRef({groups:new Map,get(e,t){var n;let r=this.groups.get(e);r||(r=new Map,this.groups.set(e,r));let o=null!=(n=r.get(t))?n:0;return r.set(t,o+1),[Array.from(r.keys()).indexOf(t),function(){let e=r.get(t);e>1?r.set(t,e-1):r.delete(t)}]}});return i.createElement(k.Provider,{value:n},t)}function E(e){let t=i.useContext(k);if(!t)throw Error("You must wrap your component in a <StableCollection>");let n=function(){var e,t,n;let r=null!=(n=null==(t=null==(e=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)?void 0:e.ReactCurrentOwner)?void 0:t.current)?n:null;if(!r)return Symbol();let o=[],a=r;for(;a;)o.push(a.index),a=a.return;return"$."+o.join(".")}(),[r,o]=t.current.get(e,n);return i.useEffect(()=>o,[]),r}var O=((r=O||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r),C=((o=C||{})[o.Less=-1]="Less",o[o.Equal=0]="Equal",o[o.Greater=1]="Greater",o),j=((a=j||{})[a.SetSelectedIndex=0]="SetSelectedIndex",a[a.RegisterTab=1]="RegisterTab",a[a.UnregisterTab=2]="UnregisterTab",a[a.RegisterPanel=3]="RegisterPanel",a[a.UnregisterPanel=4]="UnregisterPanel",a);let _={0(e,t){var n;let r=(0,v.z2)(e.tabs,e=>e.current),o=(0,v.z2)(e.panels,e=>e.current),a=r.filter(e=>{var t;return!(null!=(t=e.current)&&t.hasAttribute("disabled"))}),i={...e,tabs:r,panels:o};if(t.index<0||t.index>r.length-1){let n=(0,y.E)(Math.sign(t.index-e.selectedIndex),{[-1]:()=>1,0:()=>(0,y.E)(Math.sign(t.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(0===a.length)return i;let o=(0,y.E)(n,{0:()=>r.indexOf(a[0]),1:()=>r.indexOf(a[a.length-1])});return{...i,selectedIndex:-1===o?e.selectedIndex:o}}let l=r.slice(0,t.index),s=[...r.slice(t.index),...l].find(e=>a.includes(e));if(!s)return i;let c=null!=(n=r.indexOf(s))?n:e.selectedIndex;return -1===c&&(c=e.selectedIndex),{...i,selectedIndex:c}},1(e,t){var n;if(e.tabs.includes(t.tab))return e;let r=e.tabs[e.selectedIndex],o=(0,v.z2)([...e.tabs,t.tab],e=>e.current),a=null!=(n=o.indexOf(r))?n:e.selectedIndex;return -1===a&&(a=e.selectedIndex),{...e,tabs:o,selectedIndex:a}},2:(e,t)=>({...e,tabs:e.tabs.filter(e=>e!==t.tab)}),3:(e,t)=>e.panels.includes(t.panel)?e:{...e,panels:(0,v.z2)([...e.panels,t.panel],e=>e.current)},4:(e,t)=>({...e,panels:e.panels.filter(e=>e!==t.panel)})},P=(0,i.createContext)(null);function N(e){let t=(0,i.useContext)(P);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Tab.Group /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,N),t}return t}P.displayName="TabsDataContext";let T=(0,i.createContext)(null);function A(e){let t=(0,i.useContext)(T);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Tab.Group /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,A),t}return t}function M(e,t){return(0,y.E)(t.type,_,e,t)}T.displayName="TabsActionsContext";let I=i.Fragment,R=w.AN.RenderStrategy|w.AN.Static,D=Object.assign((0,w.yV)(function(e,t){var n,r;let o=(0,c.M)(),{id:a="headlessui-tabs-tab-".concat(o),...d}=e,{orientation:h,activation:m,selectedIndex:g,tabs:k,panels:S}=N("Tab"),O=A("Tab"),C=N("Tab"),j=(0,i.useRef)(null),_=(0,p.T)(j,t);(0,u.e)(()=>O.registerTab(j),[O,j]);let P=E("tabs"),T=k.indexOf(j);-1===T&&(T=P);let M=T===g,I=(0,s.z)(e=>{var t;let n=e();if(n===v.fE.Success&&"auto"===m){let e=null==(t=(0,x.r)(j))?void 0:t.activeElement,n=C.tabs.findIndex(t=>t.current===e);-1!==n&&O.change(n)}return n}),R=(0,s.z)(e=>{let t=k.map(e=>e.current).filter(Boolean);if(e.key===l.R.Space||e.key===l.R.Enter){e.preventDefault(),e.stopPropagation(),O.change(T);return}switch(e.key){case l.R.Home:case l.R.PageUp:return e.preventDefault(),e.stopPropagation(),I(()=>(0,v.jA)(t,v.TO.First));case l.R.End:case l.R.PageDown:return e.preventDefault(),e.stopPropagation(),I(()=>(0,v.jA)(t,v.TO.Last))}if(I(()=>(0,y.E)(h,{vertical:()=>e.key===l.R.ArrowUp?(0,v.jA)(t,v.TO.Previous|v.TO.WrapAround):e.key===l.R.ArrowDown?(0,v.jA)(t,v.TO.Next|v.TO.WrapAround):v.fE.Error,horizontal:()=>e.key===l.R.ArrowLeft?(0,v.jA)(t,v.TO.Previous|v.TO.WrapAround):e.key===l.R.ArrowRight?(0,v.jA)(t,v.TO.Next|v.TO.WrapAround):v.fE.Error}))===v.fE.Success)return e.preventDefault()}),D=(0,i.useRef)(!1),L=(0,s.z)(()=>{var e;D.current||(D.current=!0,null==(e=j.current)||e.focus({preventScroll:!0}),O.change(T),(0,b.Y)(()=>{D.current=!1}))}),Z=(0,s.z)(e=>{e.preventDefault()}),z=(0,i.useMemo)(()=>({selected:M}),[M]),B={ref:_,onKeyDown:R,onMouseDown:Z,onClick:L,id:a,role:"tab",type:(0,f.f)(e,j),"aria-controls":null==(r=null==(n=S[T])?void 0:n.current)?void 0:r.id,"aria-selected":M,tabIndex:M?0:-1};return(0,w.sY)({ourProps:B,theirProps:d,slot:z,defaultTag:"button",name:"Tabs.Tab"})}),{Group:(0,w.yV)(function(e,t){let{defaultIndex:n=0,vertical:r=!1,manual:o=!1,onChange:a,selectedIndex:l=null,...c}=e,f=r?"vertical":"horizontal",h=o?"manual":"auto",m=null!==l,y=(0,p.T)(t),[b,x]=(0,i.useReducer)(M,{selectedIndex:null!=l?l:n,tabs:[],panels:[]}),k=(0,i.useMemo)(()=>({selectedIndex:b.selectedIndex}),[b.selectedIndex]),E=(0,d.E)(a||(()=>{})),O=(0,d.E)(b.tabs),C=(0,i.useMemo)(()=>({orientation:f,activation:h,...b}),[f,h,b]),j=(0,s.z)(e=>(x({type:1,tab:e}),()=>x({type:2,tab:e}))),_=(0,s.z)(e=>(x({type:3,panel:e}),()=>x({type:4,panel:e}))),N=(0,s.z)(e=>{A.current!==e&&E.current(e),m||x({type:0,index:e})}),A=(0,d.E)(m?e.selectedIndex:b.selectedIndex),R=(0,i.useMemo)(()=>({registerTab:j,registerPanel:_,change:N}),[]);return(0,u.e)(()=>{x({type:0,index:null!=l?l:n})},[l]),(0,u.e)(()=>{if(void 0===A.current||b.tabs.length<=0)return;let e=(0,v.z2)(b.tabs,e=>e.current);e.some((e,t)=>b.tabs[t]!==e)&&N(e.indexOf(b.tabs[A.current]))}),i.createElement(S,null,i.createElement(T.Provider,{value:R},i.createElement(P.Provider,{value:C},C.tabs.length<=0&&i.createElement(g,{onFocus:()=>{var e,t;for(let n of O.current)if((null==(e=n.current)?void 0:e.tabIndex)===0)return null==(t=n.current)||t.focus(),!0;return!1}}),(0,w.sY)({ourProps:{ref:y},theirProps:c,slot:k,defaultTag:I,name:"Tabs"}))))}),List:(0,w.yV)(function(e,t){let{orientation:n,selectedIndex:r}=N("Tab.List"),o=(0,p.T)(t);return(0,w.sY)({ourProps:{ref:o,role:"tablist","aria-orientation":n},theirProps:e,slot:{selectedIndex:r},defaultTag:"div",name:"Tabs.List"})}),Panels:(0,w.yV)(function(e,t){let{selectedIndex:n}=N("Tab.Panels"),r=(0,p.T)(t),o=(0,i.useMemo)(()=>({selectedIndex:n}),[n]);return(0,w.sY)({ourProps:{ref:r},theirProps:e,slot:o,defaultTag:"div",name:"Tabs.Panels"})}),Panel:(0,w.yV)(function(e,t){var n,r,o,a;let l=(0,c.M)(),{id:s="headlessui-tabs-panel-".concat(l),tabIndex:d=0,...f}=e,{selectedIndex:h,tabs:g,panels:v}=N("Tab.Panel"),y=A("Tab.Panel"),b=(0,i.useRef)(null),x=(0,p.T)(b,t);(0,u.e)(()=>y.registerPanel(b),[y,b]);let k=E("panels"),S=v.indexOf(b);-1===S&&(S=k);let O=S===h,C=(0,i.useMemo)(()=>({selected:O}),[O]),j={ref:x,id:s,role:"tabpanel","aria-labelledby":null==(r=null==(n=g[S])?void 0:n.current)?void 0:r.id,tabIndex:O?d:-1};return O||null!=(o=f.unmount)&&!o||null!=(a=f.static)&&a?(0,w.sY)({ourProps:j,theirProps:f,slot:C,defaultTag:"div",features:R,visible:O,name:"Tabs.Panel"}):i.createElement(m._,{as:"span","aria-hidden":"true",...j})})})},33044:function(e,t,n){"use strict";let r;n.d(t,{u:function(){return A}});var o=n(2265),a=n(90945),i=n(13323),l=n(93394),s=n(64518),c=n(31948),u=n(72238),d=n(93689),f=n(16015),p=n(24536);function h(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e&&n.length>0&&e.classList.add(...n)}function m(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e&&n.length>0&&e.classList.remove(...n)}var g=n(37863),v=n(42120),y=n(27847);function b(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(/\s+/).filter(e=>e.length>1)}let x=(0,o.createContext)(null);x.displayName="TransitionContext";var w=((r=w||{}).Visible="visible",r.Hidden="hidden",r);let k=(0,o.createContext)(null);function S(e){return"children"in e?S(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function E(e,t){let n=(0,c.E)(e),r=(0,o.useRef)([]),s=(0,l.t)(),u=(0,a.G)(),d=(0,i.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.l4.Hidden,o=r.current.findIndex(t=>{let{el:n}=t;return n===e});-1!==o&&((0,p.E)(t,{[y.l4.Unmount](){r.current.splice(o,1)},[y.l4.Hidden](){r.current[o].state="hidden"}}),u.microTask(()=>{var e;!S(r)&&s.current&&(null==(e=n.current)||e.call(n))}))}),f=(0,i.z)(e=>{let t=r.current.find(t=>{let{el:n}=t;return n===e});return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>d(e,y.l4.Unmount)}),h=(0,o.useRef)([]),m=(0,o.useRef)(Promise.resolve()),g=(0,o.useRef)({enter:[],leave:[],idle:[]}),v=(0,i.z)((e,n,r)=>{h.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(t=>{let[n]=t;return n!==e})),null==t||t.chains.current[n].push([e,new Promise(e=>{h.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(g.current[n].map(e=>{let[t,n]=e;return n})).then(()=>e())})]),"enter"===n?m.current=m.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),b=(0,i.z)((e,t,n)=>{Promise.all(g.current[t].splice(0).map(e=>{let[t,n]=e;return n})).then(()=>{var e;null==(e=h.current.shift())||e()}).then(()=>n(t))});return(0,o.useMemo)(()=>({children:r,register:f,unregister:d,onStart:v,onStop:b,wait:m,chains:g}),[f,d,r,v,b,g,m])}function O(){}k.displayName="NestingContext";let C=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function j(e){var t;let n={};for(let r of C)n[r]=null!=(t=e[r])?t:O;return n}let _=y.AN.RenderStrategy,P=(0,y.yV)(function(e,t){let{show:n,appear:r=!1,unmount:a=!0,...l}=e,c=(0,o.useRef)(null),f=(0,d.T)(c,t);(0,u.H)();let p=(0,g.oJ)();if(void 0===n&&null!==p&&(n=(p&g.ZM.Open)===g.ZM.Open),![!0,!1].includes(n))throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[h,m]=(0,o.useState)(n?"visible":"hidden"),v=E(()=>{m("hidden")}),[b,w]=(0,o.useState)(!0),O=(0,o.useRef)([n]);(0,s.e)(()=>{!1!==b&&O.current[O.current.length-1]!==n&&(O.current.push(n),w(!1))},[O,n]);let C=(0,o.useMemo)(()=>({show:n,appear:r,initial:b}),[n,r,b]);(0,o.useEffect)(()=>{if(n)m("visible");else if(S(v)){let e=c.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&m("hidden")}else m("hidden")},[n,v]);let j={unmount:a},P=(0,i.z)(()=>{var t;b&&w(!1),null==(t=e.beforeEnter)||t.call(e)}),T=(0,i.z)(()=>{var t;b&&w(!1),null==(t=e.beforeLeave)||t.call(e)});return o.createElement(k.Provider,{value:v},o.createElement(x.Provider,{value:C},(0,y.sY)({ourProps:{...j,as:o.Fragment,children:o.createElement(N,{ref:f,...j,...l,beforeEnter:P,beforeLeave:T})},theirProps:{},defaultTag:o.Fragment,features:_,visible:"visible"===h,name:"Transition"})))}),N=(0,y.yV)(function(e,t){var n,r,w;let O;let{beforeEnter:C,afterEnter:P,beforeLeave:N,afterLeave:T,enter:A,enterFrom:M,enterTo:I,entered:R,leave:D,leaveFrom:L,leaveTo:Z,...z}=e,B=(0,o.useRef)(null),F=(0,d.T)(B,t),H=null==(n=z.unmount)||n?y.l4.Unmount:y.l4.Hidden,{show:q,appear:W,initial:U}=function(){let e=(0,o.useContext)(x);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[K,$]=(0,o.useState)(q?"visible":"hidden"),V=function(){let e=(0,o.useContext)(k);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:X,unregister:G}=V;(0,o.useEffect)(()=>X(B),[X,B]),(0,o.useEffect)(()=>{if(H===y.l4.Hidden&&B.current){if(q&&"visible"!==K){$("visible");return}return(0,p.E)(K,{hidden:()=>G(B),visible:()=>X(B)})}},[K,B,X,G,q,H]);let Y=(0,c.E)({base:b(z.className),enter:b(A),enterFrom:b(M),enterTo:b(I),entered:b(R),leave:b(D),leaveFrom:b(L),leaveTo:b(Z)}),Q=(w={beforeEnter:C,afterEnter:P,beforeLeave:N,afterLeave:T},O=(0,o.useRef)(j(w)),(0,o.useEffect)(()=>{O.current=j(w)},[w]),O),J=(0,u.H)();(0,o.useEffect)(()=>{if(J&&"visible"===K&&null===B.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[B,K,J]);let ee=W&&q&&U,et=J&&(!U||W)?q?"enter":"leave":"idle",en=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[t,n]=(0,o.useState)(e),r=(0,l.t)(),a=(0,o.useCallback)(e=>{r.current&&n(t=>t|e)},[t,r]),i=(0,o.useCallback)(e=>!!(t&e),[t]);return{flags:t,addFlag:a,hasFlag:i,removeFlag:(0,o.useCallback)(e=>{r.current&&n(t=>t&~e)},[n,r]),toggleFlag:(0,o.useCallback)(e=>{r.current&&n(t=>t^e)},[n])}}(0),er=(0,i.z)(e=>(0,p.E)(e,{enter:()=>{en.addFlag(g.ZM.Opening),Q.current.beforeEnter()},leave:()=>{en.addFlag(g.ZM.Closing),Q.current.beforeLeave()},idle:()=>{}})),eo=(0,i.z)(e=>(0,p.E)(e,{enter:()=>{en.removeFlag(g.ZM.Opening),Q.current.afterEnter()},leave:()=>{en.removeFlag(g.ZM.Closing),Q.current.afterLeave()},idle:()=>{}})),ea=E(()=>{$("hidden"),G(B)},V),ei=(0,o.useRef)(!1);!function(e){let{immediate:t,container:n,direction:r,classes:o,onStart:i,onStop:u}=e,d=(0,l.t)(),g=(0,a.G)(),v=(0,c.E)(r);(0,s.e)(()=>{t&&(v.current="enter")},[t]),(0,s.e)(()=>{let e=(0,f.k)();g.add(e.dispose);let t=n.current;if(t&&"idle"!==v.current&&d.current){var r,a,l;let n,s,c,d,g,y,b;return e.dispose(),i.current(v.current),e.add((r=o.current,a="enter"===v.current,l=()=>{e.dispose(),u.current(v.current)},s=a?"enter":"leave",c=(0,f.k)(),d=void 0!==l?(n={called:!1},function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!n.called)return n.called=!0,l(...t)}):()=>{},"enter"===s&&(t.removeAttribute("hidden"),t.style.display=""),g=(0,p.E)(s,{enter:()=>r.enter,leave:()=>r.leave}),y=(0,p.E)(s,{enter:()=>r.enterTo,leave:()=>r.leaveTo}),b=(0,p.E)(s,{enter:()=>r.enterFrom,leave:()=>r.leaveFrom}),m(t,...r.base,...r.enter,...r.enterTo,...r.enterFrom,...r.leave,...r.leaveFrom,...r.leaveTo,...r.entered),h(t,...r.base,...g,...b),c.nextFrame(()=>{m(t,...r.base,...g,...b),h(t,...r.base,...g,...y),function(e,t){let n=(0,f.k)();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[a,i]=[r,o].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t}),l=a+i;if(0!==l){n.group(n=>{n.setTimeout(()=>{t(),n.dispose()},l),n.addEventListener(e,"transitionrun",e=>{e.target===e.currentTarget&&n.dispose()})});let r=n.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();n.add(()=>t()),n.dispose}(t,()=>(m(t,...r.base,...g),h(t,...r.base,...r.entered),d()))}),c.dispose)),e.dispose}},[r])}({immediate:ee,container:B,classes:Y,direction:et,onStart:(0,c.E)(e=>{ei.current=!0,ea.onStart(B,e,er)}),onStop:(0,c.E)(e=>{ei.current=!1,ea.onStop(B,e,eo),"leave"!==e||S(ea)||($("hidden"),G(B))})});let el=z;return ee?el={...el,className:(0,v.A)(z.className,...Y.current.enter,...Y.current.enterFrom)}:ei.current&&(el.className=(0,v.A)(z.className,null==(r=B.current)?void 0:r.className),""===el.className&&delete el.className),o.createElement(k.Provider,{value:ea},o.createElement(g.up,{value:(0,p.E)(K,{visible:g.ZM.Open,hidden:g.ZM.Closed})|en.flags},(0,y.sY)({ourProps:{ref:F},theirProps:el,defaultTag:"div",features:_,visible:"visible"===K,name:"Transition.Child"})))}),T=(0,y.yV)(function(e,t){let n=null!==(0,o.useContext)(x),r=null!==(0,g.oJ)();return o.createElement(o.Fragment,null,!n&&r?o.createElement(P,{ref:t,...e}):o.createElement(N,{ref:t,...e}))}),A=Object.assign(P,{Child:T,Root:P})},62963:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var r=n(2265),o=n(13323);function a(e,t,n){let[a,i]=(0,r.useState)(n),l=void 0!==e,s=(0,r.useRef)(l),c=(0,r.useRef)(!1),u=(0,r.useRef)(!1);return!l||s.current||c.current?l||!s.current||u.current||(u.current=!0,s.current=l,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(c.current=!0,s.current=l,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[l?e:a,(0,o.z)(e=>(l||i(e),null==t?void 0:t(e)))]}},90945:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var r=n(2265),o=n(16015);function a(){let[e]=(0,r.useState)(o.k);return(0,r.useEffect)(()=>()=>e.dispose(),[e]),e}},13323:function(e,t,n){"use strict";n.d(t,{z:function(){return a}});var r=n(2265),o=n(31948);let a=function(e){let t=(0,o.E)(e);return r.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current(...n)},[t])}},17684:function(e,t,n){"use strict";n.d(t,{M:function(){return s}});var r,o=n(2265),a=n(61424),i=n(64518),l=n(72238);let s=null!=(r=o.useId)?r:function(){let e=(0,l.H)(),[t,n]=o.useState(e?()=>a.O.nextId():null);return(0,i.e)(()=>{null===t&&n(a.O.nextId())},[t]),null!=t?""+t:void 0}},93394:function(e,t,n){"use strict";n.d(t,{t:function(){return a}});var r=n(2265),o=n(64518);function a(){let e=(0,r.useRef)(!1);return(0,o.e)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}},64518:function(e,t,n){"use strict";n.d(t,{e:function(){return a}});var r=n(2265),o=n(61424);let a=(e,t)=>{o.O.isServer?(0,r.useEffect)(e,t):(0,r.useLayoutEffect)(e,t)}},31948:function(e,t,n){"use strict";n.d(t,{E:function(){return a}});var r=n(2265),o=n(64518);function a(e){let t=(0,r.useRef)(e);return(0,o.e)(()=>{t.current=e},[e]),t}},98505:function(e,t,n){"use strict";n.d(t,{O:function(){return s}});var r=n(2265),o=n(37105),a=n(31948);function i(e,t,n){let o=(0,a.E)(t);(0,r.useEffect)(()=>{function t(e){o.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)},[e,n])}var l=n(3141);function s(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=(0,r.useRef)(!1);function s(n,r){if(!a.current||n.defaultPrevented)return;let i=r(n);if(null!==i&&i.getRootNode().contains(i)&&i.isConnected){for(let t of function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e)){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(i)||n.composed&&n.composedPath().includes(e))return}return(0,o.sP)(i,o.tJ.Loose)||-1===i.tabIndex||n.preventDefault(),t(n,i)}}(0,r.useEffect)(()=>{requestAnimationFrame(()=>{a.current=n})},[n]);let c=(0,r.useRef)(null);i("pointerdown",e=>{var t,n;a.current&&(c.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),i("mousedown",e=>{var t,n;a.current&&(c.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),i("click",e=>{/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0||/Android/gi.test(window.navigator.userAgent)||c.current&&(s(e,()=>c.current),c.current=null)},!0),i("touchend",e=>s(e,()=>e.target instanceof HTMLElement?e.target:null),!0),(0,l.s)("blur",e=>s(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}},80004:function(e,t,n){"use strict";n.d(t,{f:function(){return i}});var r=n(2265),o=n(64518);function a(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";if("string"==typeof n&&"button"===n.toLowerCase())return"button"}function i(e,t){let[n,i]=(0,r.useState)(()=>a(e));return(0,o.e)(()=>{i(a(e))},[e.type,e.as]),(0,o.e)(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&i("button")},[n,t]),n}},72238:function(e,t,n){"use strict";n.d(t,{H:function(){return i}});var r,o=n(2265),a=n(61424);function i(){let e;let t=(e="undefined"==typeof document,(0,(r||(r=n.t(o,2))).useSyncExternalStore)(()=>()=>{},()=>!1,()=>!e)),[i,l]=o.useState(a.O.isHandoffComplete);return i&&!1===a.O.isHandoffComplete&&l(!1),o.useEffect(()=>{!0!==i&&l(!0)},[i]),o.useEffect(()=>a.O.handoff(),[]),!t&&i}},93689:function(e,t,n){"use strict";n.d(t,{T:function(){return l},h:function(){return i}});var r=n(2265),o=n(13323);let a=Symbol();function i(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return Object.assign(e,{[a]:t})}function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=(0,r.useRef)(t);(0,r.useEffect)(()=>{i.current=t},[t]);let l=(0,o.z)(e=>{for(let t of i.current)null!=t&&("function"==typeof t?t(e):t.current=e)});return t.every(e=>null==e||(null==e?void 0:e[a]))?void 0:l}},3141:function(e,t,n){"use strict";n.d(t,{s:function(){return a}});var r=n(2265),o=n(31948);function a(e,t,n){let a=(0,o.E)(t);(0,r.useEffect)(()=>{function t(e){a.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)},[e,n])}},38198:function(e,t,n){"use strict";let r;n.d(t,{A:function(){return a},_:function(){return i}});var o=n(27847),a=((r=a||{})[r.None=1]="None",r[r.Focusable=2]="Focusable",r[r.Hidden=4]="Hidden",r);let i=(0,o.yV)(function(e,t){var n;let{features:r=1,...a}=e,i={ref:t,"aria-hidden":(2&r)==2||(null!=(n=a["aria-hidden"])?n:void 0),style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(4&r)==4&&(2&r)!=2&&{display:"none"}}};return(0,o.sY)({ourProps:i,theirProps:a,slot:{},defaultTag:"div",name:"Hidden"})})},37863:function(e,t,n){"use strict";let r;n.d(t,{ZM:function(){return i},oJ:function(){return l},up:function(){return s}});var o=n(2265);let a=(0,o.createContext)(null);a.displayName="OpenClosedContext";var i=((r=i||{})[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r);function l(){return(0,o.useContext)(a)}function s(e){let{value:t,children:n}=e;return o.createElement(a.Provider,{value:t},n)}},47634:function(e,t,n){"use strict";function r(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(null==t?void 0:t.getAttribute("disabled"))==="";return!(r&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}n.d(t,{P:function(){return r}})},42120:function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.from(new Set(t.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}n.d(t,{A:function(){return r}})},16015:function(e,t,n){"use strict";n.d(t,{k:function(){return function e(){let t=[],n={addEventListener:(e,t,r,o)=>(e.addEventListener(t,r,o),n.add(()=>e.removeEventListener(t,r,o))),requestAnimationFrame(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=requestAnimationFrame(...t);return n.add(()=>cancelAnimationFrame(o))},nextFrame(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.requestAnimationFrame(()=>n.requestAnimationFrame(...t))},setTimeout(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=setTimeout(...t);return n.add(()=>clearTimeout(o))},microTask(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];let a={current:!0};return(0,r.Y)(()=>{a.current&&t[0]()}),n.add(()=>{a.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(t){let n=e();return t(n),this.add(()=>n.dispose())},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return n}}});var r=n(96822)},61424:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var r=Object.defineProperty,o=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t,n)=>(o(e,"symbol"!=typeof t?t+"":t,n),n);class i{set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}constructor(){a(this,"current",this.detect()),a(this,"handoffState","pending"),a(this,"currentId",0)}}let l=new i},37105:function(e,t,n){"use strict";let r,o,a,i,l;n.d(t,{GO:function(){return h},TO:function(){return d},fE:function(){return f},jA:function(){return b},sP:function(){return g},tJ:function(){return m},z2:function(){return y}});var s=n(24536),c=n(40293);let u=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(",");var d=((r=d||{})[r.First=1]="First",r[r.Previous=2]="Previous",r[r.Next=4]="Next",r[r.Last=8]="Last",r[r.WrapAround=16]="WrapAround",r[r.NoScroll=32]="NoScroll",r),f=((o=f||{})[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o),p=((a=p||{})[a.Previous=-1]="Previous",a[a.Next=1]="Next",a);function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(u)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var m=((i=m||{})[i.Strict=0]="Strict",i[i.Loose=1]="Loose",i);function g(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e!==(null==(t=(0,c.r)(e))?void 0:t.body)&&(0,s.E)(n,{0:()=>e.matches(u),1(){let t=e;for(;null!==t;){if(t.matches(u))return!0;t=t.parentElement}return!1}})}var v=((l=v||{})[l.Keyboard=0]="Keyboard",l[l.Mouse=1]="Mouse",l);function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let a=r.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function b(e,t){var n,r,o;let{sorted:a=!0,relativeTo:i=null,skipElements:l=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,c=Array.isArray(e)?a?y(e):e:h(e);l.length>0&&c.length>1&&(c=c.filter(e=>!l.includes(e))),i=null!=i?i:s.activeElement;let u=(()=>{if(5&t)return 1;if(10&t)return -1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,c.indexOf(i))-1;if(4&t)return Math.max(0,c.indexOf(i))+1;if(8&t)return c.length-1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=32&t?{preventScroll:!0}:{},p=0,m=c.length,g;do{if(p>=m||p+m<=0)return 0;let e=d+p;if(16&t)e=(e+m)%m;else{if(e<0)return 3;if(e>=m)return 1}null==(g=c[e])||g.focus(f),p+=u}while(g!==s.activeElement);return 6&t&&null!=(o=null==(r=null==(n=g)?void 0:n.matches)?void 0:r.call(n,"textarea,input"))&&o&&g.select(),2}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0))},56314:function(e,t,n){"use strict";function r(e,t){return e?e+"["+t+"]":t}function o(e){var t,n;let r=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(r){for(let t of r.elements)if(t!==e&&("INPUT"===t.tagName&&"submit"===t.type||"BUTTON"===t.tagName&&"submit"===t.type||"INPUT"===t.nodeName&&"image"===t.type)){t.click();return}null==(n=r.requestSubmit)||n.call(r)}}n.d(t,{g:function(){return o},t:function(){return function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let[a,i]of Object.entries(t))!function t(n,o,a){if(Array.isArray(a))for(let[e,i]of a.entries())t(n,r(o,e.toString()),i);else a instanceof Date?n.push([o,a.toISOString()]):"boolean"==typeof a?n.push([o,a?"1":"0"]):"string"==typeof a?n.push([o,a]):"number"==typeof a?n.push([o,"".concat(a)]):null==a?n.push([o,""]):e(a,o,n)}(o,r(n,a),i);return o}}})},24536:function(e,t,n){"use strict";function r(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(e in t){let n=t[e];return"function"==typeof n?n(...o):n}let i=Error('Tried to handle "'.concat(e,'" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(t).map(e=>'"'.concat(e,'"')).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(i,r),i}n.d(t,{E:function(){return r}})},96822:function(e,t,n){"use strict";function r(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}n.d(t,{Y:function(){return r}})},40293:function(e,t,n){"use strict";n.d(t,{r:function(){return o}});var r=n(61424);function o(e){return r.O.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}},27847:function(e,t,n){"use strict";let r,o;n.d(t,{AN:function(){return s},Y2:function(){return f},l4:function(){return c},oA:function(){return g},sY:function(){return u},yV:function(){return m}});var a=n(2265),i=n(42120),l=n(24536),s=((r=s||{})[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r),c=((o=c||{})[o.Unmount=0]="Unmount",o[o.Hidden=1]="Hidden",o);function u(e){let{ourProps:t,theirProps:n,slot:r,defaultTag:o,features:a,visible:i=!0,name:s,mergeRefs:c}=e;c=null!=c?c:p;let u=h(n,t);if(i)return d(u,r,o,s,c);let f=null!=a?a:0;if(2&f){let{static:e=!1,...t}=u;if(e)return d(t,r,o,s,c)}if(1&f){let{unmount:e=!0,...t}=u;return(0,l.E)(e?0:1,{0:()=>null,1:()=>d({...t,hidden:!0,style:{display:"none"}},r,o,s,c)})}return d(u,r,o,s,c)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,{as:l=n,children:s,refName:c="ref",...u}=v(e,["unmount","static"]),d=void 0!==e.ref?{[c]:e.ref}:{},f="function"==typeof s?s(t):s;"className"in u&&u.className&&"function"==typeof u.className&&(u.className=u.className(t));let p={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(p["data-headlessui-state"]=n.join(" "))}if(l===a.Fragment&&Object.keys(g(u)).length>0){if(!(0,a.isValidElement)(f)||Array.isArray(f)&&f.length>1)throw Error(['Passing props on "Fragment"!',"","The current component <".concat(r,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(u).map(e=>" - ".concat(e)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>" - ".concat(e)).join("\n")].join("\n"));let e=f.props,t="function"==typeof(null==e?void 0:e.className)?function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return(0,i.A)(null==e?void 0:e.className(...n),u.className)}:(0,i.A)(null==e?void 0:e.className,u.className);return(0,a.cloneElement)(f,Object.assign({},h(f.props,g(v(u,["ref"]))),p,d,{ref:o(f.ref,d.ref)},t?{className:t}:{}))}return(0,a.createElement)(l,Object.assign({},v(u,["ref"]),l!==a.Fragment&&d,l!==a.Fragment&&p),f)}function f(){let e=(0,a.useRef)([]),t=(0,a.useCallback)(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];if(!r.every(e=>null==e))return e.current=r,t}}function p(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(e=>null==e)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function h(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return{};if(1===t.length)return t[0];let r={},o={};for(let e of t)for(let t in e)t.startsWith("on")&&"function"==typeof e[t]?(null!=o[t]||(o[t]=[]),o[t].push(e[t])):r[t]=e[t];if(r.disabled||r["aria-disabled"])return Object.assign(r,Object.fromEntries(Object.keys(o).map(e=>[e,void 0])));for(let e in o)Object.assign(r,{[e](t){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];for(let n of o[e]){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;n(t,...r)}}});return r}function m(e){var t;return Object.assign((0,a.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function g(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}},10900:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=o},91777:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});t.Z=o},44643:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},51853:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"}))});t.Z=o},82182:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});t.Z=o},79814:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});t.Z=o},88532:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});t.Z=o},71437:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}))});t.Z=o},82376:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))});t.Z=o},2356:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"}))});t.Z=o},15731:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},45589:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}))});t.Z=o},53410:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});t.Z=o},91126:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},22452:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});t.Z=o},23628:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))});t.Z=o},25327:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});t.Z=o},71157:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},87045:function(e,t,n){"use strict";n.d(t,{j:function(){return a}});var r=n(24112),o=n(45345),a=new class extends r.l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!o.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}}},2894:function(e,t,n){"use strict";n.d(t,{R:function(){return l},m:function(){return i}});var r=n(18238),o=n(7989),a=n(11255),i=class extends o.F{#r;#o;#a;constructor(e){super(),this.mutationId=e.mutationId,this.#o=e.mutationCache,this.#r=[],this.state=e.state||l(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#o.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#o.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){this.#a=(0,a.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#o.canRun(this)});let t="pending"===this.state.status,n=!this.#a.canStart();try{if(!t){this.#i({type:"pending",variables:e,isPaused:n}),await this.#o.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:n})}let r=await this.#a.start();return await this.#o.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#o.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#i({type:"success",data:r}),r}catch(t){try{throw await this.#o.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#o.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#i({type:"error",error:t})}}finally{this.#o.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),r.V.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#o.notify({mutation:this,type:"updated",action:e})})}};function l(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},18238:function(e,t,n){"use strict";n.d(t,{V:function(){return r}});var r=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},o=e=>setTimeout(e,0),a=r=>{t?e.push(r):o(()=>{n(r)})},i=()=>{let t=e;e=[],t.length&&o(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{--t||i()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{o=e}}}()},57853:function(e,t,n){"use strict";n.d(t,{N:function(){return a}});var r=n(24112),o=n(45345),a=new class extends r.l{#l=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!o.sk&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#l!==e&&(this.#l=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#l}}},21733:function(e,t,n){"use strict";n.d(t,{A:function(){return l},z:function(){return s}});var r=n(45345),o=n(18238),a=n(11255),i=n(7989),l=class extends i.F{#s;#c;#u;#a;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#s=function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#s,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){let n=(0,r.oE)(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(r.ZT).catch(r.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#s)}isActive(){return this.observers.some(e=>!1!==(0,r.Nc)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===r.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,r.Kp)(this.state.dataUpdatedAt,e)}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#f?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,o=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,n.signal)})},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{let e=(0,r.cG)(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return(o(n),this.#f=!1,this.options.persister)?this.options.persister(e,n,this):e(n)}};o(i),this.options.behavior?.onFetch(i,this),this.#c=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta});let l=e=>{(0,a.DV)(e)&&e.silent||this.#i({type:"error",error:e}),(0,a.DV)(e)||(this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#a=(0,a.Mz)({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(void 0===e){l(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){l(e);return}this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:l,onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#a.start()}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...s(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=e.error;if((0,a.DV)(n)&&n.revert&&this.#c)return{...this.#c,fetchStatus:"idle"};return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),o.V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function s(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,a.Kw)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}},21623:function(e,t,n){"use strict";n.d(t,{S:function(){return m}});var r=n(45345),o=n(21733),a=n(18238),i=n(24112),l=class extends i.l{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,n){let a=t.queryKey,i=t.queryHash??(0,r.Rm)(a,t),l=this.get(i);return l||(l=new o.A({cache:this,queryKey:a,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(l)),l}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){a.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,r._x)(e,t)):t}notify(e){a.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){a.V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){a.V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},s=n(2894),c=class extends i.l{constructor(e={}){super(),this.config=e,this.#h=new Set,this.#m=new Map,this.#g=0}#h;#m;#g;build(e,t,n){let r=new s.m({mutationCache:this,mutationId:++this.#g,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#h.add(e);let t=u(e);if("string"==typeof t){let n=this.#m.get(t);n?n.push(e):this.#m.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#h.delete(e)){let t=u(e);if("string"==typeof t){let n=this.#m.get(t);if(n){if(n.length>1){let t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#m.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=u(e);if("string"!=typeof t)return!0;{let n=this.#m.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=u(e);if("string"!=typeof t)return Promise.resolve();{let n=this.#m.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}}clear(){a.V.batch(()=>{this.#h.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#h.clear(),this.#m.clear()})}getAll(){return Array.from(this.#h)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,r.X7)(e,t))}notify(e){a.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return a.V.batch(()=>Promise.all(e.map(e=>e.continue().catch(r.ZT))))}};function u(e){return e.options.scope?.id}var d=n(87045),f=n(57853);function p(e){return{onFetch:(t,n)=>{let o=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],l=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,u=async()=>{let n=!1,u=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",()=>{n=!0}),t.signal)})},d=(0,r.cG)(t.options,t.fetchOptions),f=async(e,o,a)=>{if(n)return Promise.reject();if(null==o&&e.pages.length)return Promise.resolve(e);let i={queryKey:t.queryKey,pageParam:o,direction:a?"backward":"forward",meta:t.options.meta};u(i);let l=await d(i),{maxPages:s}=t.options,c=a?r.Ht:r.VX;return{pages:c(e.pages,l,s),pageParams:c(e.pageParams,o,s)}};if(a&&i.length){let e="backward"===a,t={pages:i,pageParams:l},n=(e?function(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}:h)(o,t);s=await f(t,n,e)}else{let t=e??i.length;do{let e=0===c?l[0]??o.initialPageParam:h(o,s);if(c>0&&null==e)break;s=await f(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function h(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}var m=class{#v;#o;#d;#y;#b;#x;#w;#k;constructor(e={}){this.#v=e.queryCache||new l,this.#o=e.mutationCache||new c,this.#d=e.defaultOptions||{},this.#y=new Map,this.#b=new Map,this.#x=0}mount(){this.#x++,1===this.#x&&(this.#w=d.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#v.onFocus())}),this.#k=f.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#v.onOnline())}))}unmount(){this.#x--,0===this.#x&&(this.#w?.(),this.#w=void 0,this.#k?.(),this.#k=void 0)}isFetching(e){return this.#v.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#o.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#v.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#v.build(this,t),o=n.state.data;return void 0===o?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,r.KC)(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return this.#v.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let o=this.defaultQueryOptions({queryKey:e}),a=this.#v.get(o.queryHash),i=a?.state.data,l=(0,r.SE)(t,i);if(void 0!==l)return this.#v.build(this,o).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return a.V.batch(()=>this.#v.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#v.get(t.queryHash)?.state}removeQueries(e){let t=this.#v;a.V.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#v,r={type:"active",...e};return a.V.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){let n={revert:!0,...t};return Promise.all(a.V.batch(()=>this.#v.findAll(e).map(e=>e.cancel(n)))).then(r.ZT).catch(r.ZT)}invalidateQueries(e,t={}){return a.V.batch(()=>{if(this.#v.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")return Promise.resolve();let n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(a.V.batch(()=>this.#v.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(r.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(r.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let n=this.#v.build(this,t);return n.isStaleByTime((0,r.KC)(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(r.ZT).catch(r.ZT)}fetchInfiniteQuery(e){return e.behavior=p(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(r.ZT).catch(r.ZT)}ensureInfiniteQueryData(e){return e.behavior=p(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.N.isOnline()?this.#o.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#v}getMutationCache(){return this.#o}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#y.set((0,r.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#y.values()],n={};return t.forEach(t=>{(0,r.to)(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#b.set((0,r.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#b.values()],n={};return t.forEach(t=>{(0,r.to)(e,t.mutationKey)&&(n={...n,...t.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,r.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===r.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#v.clear(),this.#o.clear()}}},7989:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(45345),o=class{#S;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.PN)(this.gcTime)&&(this.#S=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r.sk?1/0:3e5))}clearGcTimeout(){this.#S&&(clearTimeout(this.#S),this.#S=void 0)}}},11255:function(e,t,n){"use strict";n.d(t,{DV:function(){return u},Kw:function(){return s},Mz:function(){return d}});var r=n(87045),o=n(57853),a=n(16803),i=n(45345);function l(e){return Math.min(1e3*2**e,3e4)}function s(e){return(e??"online")!=="online"||o.N.isOnline()}var c=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function u(e){return e instanceof c}function d(e){let t,n=!1,u=0,d=!1,f=(0,a.O)(),p=()=>r.j.isFocused()&&("always"===e.networkMode||o.N.isOnline())&&e.canRun(),h=()=>s(e.networkMode)&&e.canRun(),m=n=>{d||(d=!0,e.onSuccess?.(n),t?.(),f.resolve(n))},g=n=>{d||(d=!0,e.onError?.(n),t?.(),f.reject(n))},v=()=>new Promise(n=>{t=e=>{(d||p())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,d||e.onContinue?.()}),y=()=>{let t;if(d)return;let r=0===u?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(m).catch(t=>{if(d)return;let r=e.retry??(i.sk?0:3),o=e.retryDelay??l,a="function"==typeof o?o(u,t):o,s=!0===r||"number"==typeof r&&u<r||"function"==typeof r&&r(u,t);if(n||!s){g(t);return}u++,e.onFail?.(u,t),(0,i._v)(a).then(()=>p()?void 0:v()).then(()=>{n?g(t):y()})})};return{promise:f,cancel:t=>{d||(g(new c(t)),e.abort?.())},continue:()=>(t?.(),f),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:h,start:()=>(h()?y():v().then(y),f)}}},24112:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},16803:function(e,t,n){"use strict";function r(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}n.d(t,{O:function(){return r}})},45345:function(e,t,n){"use strict";n.d(t,{CN:function(){return S},Ht:function(){return k},KC:function(){return s},Kp:function(){return l},Nc:function(){return c},PN:function(){return i},Rm:function(){return f},SE:function(){return a},VS:function(){return m},VX:function(){return w},X7:function(){return d},Ym:function(){return p},ZT:function(){return o},_v:function(){return b},_x:function(){return u},cG:function(){return E},oE:function(){return x},sk:function(){return r},to:function(){return h}});var r="undefined"==typeof window||"Deno"in globalThis;function o(){}function a(e,t){return"function"==typeof e?e(t):e}function i(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function s(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function u(e,t){let{type:n="all",exact:r,fetchStatus:o,predicate:a,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==f(i,t.options))return!1}else if(!h(t.queryKey,i))return!1}if("all"!==n){let e=t.isActive();if("active"===n&&!e||"inactive"===n&&e)return!1}return("boolean"!=typeof l||t.isStale()===l)&&(!o||o===t.state.fetchStatus)&&(!a||!!a(t))}function d(e,t){let{exact:n,status:r,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(p(t.options.mutationKey)!==p(a))return!1}else if(!h(t.options.mutationKey,a))return!1}return(!r||t.state.status===r)&&(!o||!!o(t))}function f(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function h(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(n=>!h(e[n],t[n]))}function m(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function g(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(void 0===t)return!0;let n=t.prototype;return!!(y(n)&&n.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return new Promise(t=>{setTimeout(t,e)})}function x(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?function e(t,n){if(t===n)return t;let r=g(t)&&g(n);if(r||v(t)&&v(n)){let o=r?t:Object.keys(t),a=o.length,i=r?n:Object.keys(n),l=i.length,s=r?[]:{},c=0;for(let a=0;a<l;a++){let l=r?a:i[a];(!r&&o.includes(l)||r)&&void 0===t[l]&&void 0===n[l]?(s[l]=void 0,c++):(s[l]=e(t[l],n[l]),s[l]===t[l]&&void 0!==t[l]&&c++)}return a===l&&c===a?t:s}return n}(e,t):t}function w(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function k(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var S=Symbol();function E(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==S?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}},19616:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(2265);let o={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class a{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...o,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function i(e,t){let[n,o]=(0,r.useState)(e),i=function(e,t){let[n]=(0,r.useState)(()=>{var n;return Object.getOwnPropertyNames(Object.getPrototypeOf(n=new a(e,t))).filter(e=>"function"==typeof n[e]).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(e[t]=r.bind(n)),e},{})});return n.setOptions(t),n}(o,t);return[n,i.maybeExecute,i]}},29827:function(e,t,n){"use strict";n.d(t,{NL:function(){return i},aH:function(){return l}});var r=n(2265),o=n(57437),a=r.createContext(void 0),i=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},l=e=>{let{client:t,children:n}=e;return r.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,o.jsx)(a.Provider,{value:t,children:n})}},21770:function(e,t,n){"use strict";n.d(t,{D:function(){return d}});var r=n(2265),o=n(2894),a=n(18238),i=n(24112),l=n(45345),s=class extends i.l{#E;#O=void 0;#C;#j;constructor(e,t){super(),this.#E=e,this.setOptions(t),this.bindMethods(),this.#_()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#E.defaultMutationOptions(e),(0,l.VS)(this.options,t)||this.#E.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#C,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.Ym)(t.mutationKey)!==(0,l.Ym)(this.options.mutationKey)?this.reset():this.#C?.state.status==="pending"&&this.#C.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#C?.removeObserver(this)}onMutationUpdate(e){this.#_(),this.#P(e)}getCurrentResult(){return this.#O}reset(){this.#C?.removeObserver(this),this.#C=void 0,this.#_(),this.#P()}mutate(e,t){return this.#j=t,this.#C?.removeObserver(this),this.#C=this.#E.getMutationCache().build(this.#E,this.options),this.#C.addObserver(this),this.#C.execute(e)}#_(){let e=this.#C?.state??(0,o.R)();this.#O={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#P(e){a.V.batch(()=>{if(this.#j&&this.hasListeners()){let t=this.#O.variables,n=this.#O.context;e?.type==="success"?(this.#j.onSuccess?.(e.data,t,n),this.#j.onSettled?.(e.data,null,t,n)):e?.type==="error"&&(this.#j.onError?.(e.error,t,n),this.#j.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach(e=>{e(this.#O)})})}},c=n(29827),u=n(51172);function d(e,t){let n=(0,c.NL)(t),[o]=r.useState(()=>new s(n,e));r.useEffect(()=>{o.setOptions(e)},[o,e]);let i=r.useSyncExternalStore(r.useCallback(e=>o.subscribe(a.V.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),l=r.useCallback((e,t)=>{o.mutate(e,t).catch(u.Z)},[o]);if(i.error&&(0,u.L)(o.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:l,mutateAsync:i.mutate}}},16593:function(e,t,n){"use strict";let r;n.d(t,{a:function(){return P}});var o=n(87045),a=n(18238),i=n(21733),l=n(24112),s=n(16803),c=n(45345),u=class extends l.l{constructor(e,t){super(),this.options=t,this.#E=e,this.#N=null,this.#T=(0,s.O)(),this.options.experimental_prefetchInRender||this.#T.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#E;#A=void 0;#M=void 0;#O=void 0;#I;#R;#T;#N;#D;#L;#Z;#z;#B;#F;#H=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#A.addObserver(this),d(this.#A,this.options)?this.#q():this.updateResult(),this.#W())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return f(this.#A,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return f(this.#A,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#U(),this.#K(),this.#A.removeObserver(this)}setOptions(e,t){let n=this.options,r=this.#A;if(this.options=this.#E.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,c.Nc)(this.options.enabled,this.#A))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#$(),this.#A.setOptions(this.options),n._defaulted&&!(0,c.VS)(this.options,n)&&this.#E.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#A,observer:this});let o=this.hasListeners();o&&p(this.#A,r,this.options,n)&&this.#q(),this.updateResult(t),o&&(this.#A!==r||(0,c.Nc)(this.options.enabled,this.#A)!==(0,c.Nc)(n.enabled,this.#A)||(0,c.KC)(this.options.staleTime,this.#A)!==(0,c.KC)(n.staleTime,this.#A))&&this.#V();let a=this.#X();o&&(this.#A!==r||(0,c.Nc)(this.options.enabled,this.#A)!==(0,c.Nc)(n.enabled,this.#A)||a!==this.#F)&&this.#G(a)}getOptimisticResult(e){let t=this.#E.getQueryCache().build(this.#E,e),n=this.createResult(t,e);return(0,c.VS)(this.getCurrentResult(),n)||(this.#O=n,this.#R=this.options,this.#I=this.#A.state),n}getCurrentResult(){return this.#O}trackResult(e,t){let n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#H.add(e)}getCurrentQuery(){return this.#A}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#E.defaultQueryOptions(e),n=this.#E.getQueryCache().build(this.#E,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#q({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#O))}#q(e){this.#$();let t=this.#A.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c.ZT)),t}#V(){this.#U();let e=(0,c.KC)(this.options.staleTime,this.#A);if(c.sk||this.#O.isStale||!(0,c.PN)(e))return;let t=(0,c.Kp)(this.#O.dataUpdatedAt,e);this.#z=setTimeout(()=>{this.#O.isStale||this.updateResult()},t+1)}#X(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#A):this.options.refetchInterval)??!1}#G(e){this.#K(),this.#F=e,!c.sk&&!1!==(0,c.Nc)(this.options.enabled,this.#A)&&(0,c.PN)(this.#F)&&0!==this.#F&&(this.#B=setInterval(()=>{(this.options.refetchIntervalInBackground||o.j.isFocused())&&this.#q()},this.#F))}#W(){this.#V(),this.#G(this.#X())}#U(){this.#z&&(clearTimeout(this.#z),this.#z=void 0)}#K(){this.#B&&(clearInterval(this.#B),this.#B=void 0)}createResult(e,t){let n;let r=this.#A,o=this.options,a=this.#O,l=this.#I,u=this.#R,f=e!==r?e.state:this.#M,{state:m}=e,g={...m},v=!1;if(t._optimisticResults){let n=this.hasListeners(),a=!n&&d(e,t),l=n&&p(e,r,t,o);(a||l)&&(g={...g,...(0,i.z)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(g.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:x}=g;if(t.select&&void 0!==g.data){if(a&&g.data===l?.data&&t.select===this.#D)n=this.#L;else try{this.#D=t.select,n=t.select(g.data),n=(0,c.oE)(a?.data,n,t),this.#L=n,this.#N=null}catch(e){this.#N=e}}else n=g.data;if(void 0!==t.placeholderData&&void 0===n&&"pending"===x){let e;if(a?.isPlaceholderData&&t.placeholderData===u?.placeholderData)e=a.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#Z?.state.data,this.#Z):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#N=null}catch(e){this.#N=e}void 0!==e&&(x="success",n=(0,c.oE)(a?.data,e,t),v=!0)}this.#N&&(y=this.#N,n=this.#L,b=Date.now(),x="error");let w="fetching"===g.fetchStatus,k="pending"===x,S="error"===x,E=k&&w,O=void 0!==n,C={status:x,fetchStatus:g.fetchStatus,isPending:k,isSuccess:"success"===x,isError:S,isInitialLoading:E,isLoading:E,data:n,dataUpdatedAt:g.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:w,isRefetching:w&&!k,isLoadingError:S&&!O,isPaused:"paused"===g.fetchStatus,isPlaceholderData:v,isRefetchError:S&&O,isStale:h(e,t),refetch:this.refetch,promise:this.#T};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===C.status?e.reject(C.error):void 0!==C.data&&e.resolve(C.data)},n=()=>{t(this.#T=C.promise=(0,s.O)())},o=this.#T;switch(o.status){case"pending":e.queryHash===r.queryHash&&t(o);break;case"fulfilled":("error"===C.status||C.data!==o.value)&&n();break;case"rejected":("error"!==C.status||C.error!==o.reason)&&n()}}return C}updateResult(e){let t=this.#O,n=this.createResult(this.#A,this.options);if(this.#I=this.#A.state,this.#R=this.options,void 0!==this.#I.data&&(this.#Z=this.#A),(0,c.VS)(n,t))return;this.#O=n;let r={};e?.listeners!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,n="function"==typeof e?e():e;if("all"===n||!n&&!this.#H.size)return!0;let r=new Set(n??this.#H);return this.options.throwOnError&&r.add("error"),Object.keys(this.#O).some(e=>this.#O[e]!==t[e]&&r.has(e))})()&&(r.listeners=!0),this.#P({...r,...e})}#$(){let e=this.#E.getQueryCache().build(this.#E,this.options);if(e===this.#A)return;let t=this.#A;this.#A=e,this.#M=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#W()}#P(e){a.V.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#O)}),this.#E.getQueryCache().notify({query:this.#A,type:"observerResultsUpdated"})})}};function d(e,t){return!1!==(0,c.Nc)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)||void 0!==e.state.data&&f(e,t,t.refetchOnMount)}function f(e,t,n){if(!1!==(0,c.Nc)(t.enabled,e)){let r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&h(e,t)}return!1}function p(e,t,n,r){return(e!==t||!1===(0,c.Nc)(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&h(e,n)}function h(e,t){return!1!==(0,c.Nc)(t.enabled,e)&&e.isStaleByTime((0,c.KC)(t.staleTime,e))}var m=n(2265),g=n(29827);n(57437);var v=m.createContext((r=!1,{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r})),y=()=>m.useContext(v),b=n(51172),x=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&!t.isReset()&&(e.retryOnMount=!1)},w=e=>{m.useEffect(()=>{e.clearReset()},[e])},k=e=>{let{result:t,errorResetBoundary:n,throwOnError:r,query:o}=e;return t.isError&&!n.isReset()&&!t.isFetching&&o&&(0,b.L)(r,[t.error,o])},S=m.createContext(!1),E=()=>m.useContext(S);S.Provider;var O=e=>{let t=e.staleTime;e.suspense&&(e.staleTime="function"==typeof t?(...e)=>Math.max(t(...e),1e3):Math.max(t??1e3,1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))},C=(e,t)=>e.isLoading&&e.isFetching&&!t,j=(e,t)=>e?.suspense&&t.isPending,_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function P(e,t){return function(e,t,n){var r,o,i,l,s;let u=(0,g.NL)(n),d=E(),f=y(),p=u.defaultQueryOptions(e);null===(o=u.getDefaultOptions().queries)||void 0===o||null===(r=o._experimental_beforeQuery)||void 0===r||r.call(o,p),p._optimisticResults=d?"isRestoring":"optimistic",O(p),x(p,f),w(f);let h=!u.getQueryCache().get(p.queryHash),[v]=m.useState(()=>new t(u,p)),S=v.getOptimisticResult(p),P=!d&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=P?v.subscribe(a.V.batchCalls(e)):b.Z;return v.updateResult(),t},[v,P]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),m.useEffect(()=>{v.setOptions(p,{listeners:!1})},[p,v]),j(p,S))throw _(p,v,f);if(k({result:S,errorResetBoundary:f,throwOnError:p.throwOnError,query:u.getQueryCache().get(p.queryHash)}))throw S.error;if(null===(l=u.getDefaultOptions().queries)||void 0===l||null===(i=l._experimental_afterQuery)||void 0===i||i.call(l,p,S),p.experimental_prefetchInRender&&!c.sk&&C(S,d)){let e=h?_(p,v,f):null===(s=u.getQueryCache().get(p.queryHash))||void 0===s?void 0:s.promise;null==e||e.catch(b.Z).finally(()=>{v.updateResult()})}return p.notifyOnChangeProps?S:v.trackResult(S)}(e,u,t)}},51172:function(e,t,n){"use strict";function r(e,t){return"function"==typeof e?e(...t):!!e}function o(){}n.d(t,{L:function(){return r},Z:function(){return o}})},87602:function(e,t,n){"use strict";function r(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t){if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r)}return o}(e))&&(r&&(r+=" "),r+=t);return r}n.d(t,{W:function(){return r}}),t.Z=r},49096:function(e,t,n){"use strict";n.d(t,{ZD:function(){return a}});var r=n(87602);let o=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=e=>{let t=function(){for(var t,n,o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return void 0!==(null==e?void 0:null===(t=e.hooks)||void 0===t?void 0:t["cx:done"])?null==e?void 0:e.hooks["cx:done"]((0,r.W)(a)):void 0!==(null==e?void 0:null===(n=e.hooks)||void 0===n?void 0:n.onComplete)?null==e?void 0:e.hooks.onComplete((0,r.W)(a)):(0,r.W)(a)};return{compose:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return e=>{let r=Object.fromEntries(Object.entries(e||{}).filter(e=>{let[t]=e;return!["class","className"].includes(t)}));return t(n.map(e=>e(r)),null==e?void 0:e.class,null==e?void 0:e.className)}},cva:e=>n=>{var r;if((null==e?void 0:e.variants)==null)return t(null==e?void 0:e.base,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:a,defaultVariants:i}=e,l=Object.keys(a).map(e=>{let t=null==n?void 0:n[e],r=null==i?void 0:i[e],l=o(t)||o(r);return a[e][l]}),s={...i,...n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r?e:{...e,[n]:r}},{})},c=null==e?void 0:null===(r=e.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e,r=s[t];return Array.isArray(n)?n.includes(r):r===n})?[...e,n,r]:e},[]);return t(null==e?void 0:e.base,l,c,null==n?void 0:n.class,null==n?void 0:n.className)},cx:t}},{compose:i,cva:l,cx:s}=a()},55284:function(e,t,n){"use strict";n.d(t,{Z:function(){return a},x:function(){return i}});var r=n(89999),o=n(36967);function a(){var e,t,n=(0,o.Z)().unknown(void 0),i=n.domain,l=n.range,s=0,c=1,u=!1,d=0,f=0,p=.5;function h(){var n=i().length,r=c<s,o=r?c:s,a=r?s:c;e=(a-o)/Math.max(1,n-d+2*f),u&&(e=Math.floor(e)),o+=(a-o-e*(n-d))*p,t=e*(1-d),u&&(o=Math.round(o),t=Math.round(t));var h=(function(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n)),a=Array(o);++r<o;)a[r]=e+r*n;return a})(n).map(function(t){return o+e*t});return l(r?h.reverse():h)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([s,c]=e,s=+s,c=+c,h()):[s,c]},n.rangeRound=function(e){return[s,c]=e,s=+s,c=+c,u=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(u=!!e,h()):u},n.padding=function(e){return arguments.length?(d=Math.min(1,f=+e),h()):d},n.paddingInner=function(e){return arguments.length?(d=Math.min(1,e),h()):d},n.paddingOuter=function(e){return arguments.length?(f=+e,h()):f},n.align=function(e){return arguments.length?(p=Math.max(0,Math.min(1,e)),h()):p},n.copy=function(){return a(i(),[s,c]).round(u).paddingInner(d).paddingOuter(f).align(p)},r.o.apply(h(),arguments)}function i(){return function e(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return e(n())},t}(a.apply(null,arguments).paddingInner(1))}},89999:function(e,t,n){"use strict";function r(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function o(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}n.d(t,{O:function(){return o},o:function(){return r}})},36967:function(e,t,n){"use strict";n.d(t,{Z:function(){return function e(){var t=new r,n=[],o=[],a=l;function s(e){let r=t.get(e);if(void 0===r){if(a!==l)return a;t.set(e,r=n.push(e)-1)}return o[r%o.length]}return s.domain=function(e){if(!arguments.length)return n.slice();for(let o of(n=[],t=new r,e))t.has(o)||t.set(o,n.push(o)-1);return s},s.range=function(e){return arguments.length?(o=Array.from(e),s):o.slice()},s.unknown=function(e){return arguments.length?(a=e,s):a},s.copy=function(){return e(n,o).unknown(a)},i.o.apply(s,arguments),s}},O:function(){return l}});class r extends Map{constructor(e,t=a){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(o(this,e))}has(e){return super.has(o(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}(this,e))}}function o({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function a(e){return null!==e&&"object"==typeof e?e.valueOf():e}var i=n(89999);let l=Symbol("implicit")},22516:function(e,t,n){"use strict";function r(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}n.d(t,{Z:function(){return r}}),Array.prototype.slice},76115:function(e,t,n){"use strict";function r(e){return function(){return e}}n.d(t,{Z:function(){return r}})},67790:function(e,t,n){"use strict";n.d(t,{d:function(){return s}});let r=Math.PI,o=2*r,a=o-1e-6;function i(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class l{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?i:function(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return i;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,o,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+o},${this._y1=+a}`}arcTo(e,t,n,o,a){if(e=+e,t=+t,n=+n,o=+o,(a=+a)<0)throw Error(`negative radius: ${a}`);let i=this._x1,l=this._y1,s=n-e,c=o-t,u=i-e,d=l-t,f=u*u+d*d;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>1e-6){if(Math.abs(d*s-c*u)>1e-6&&a){let p=n-i,h=o-l,m=s*s+c*c,g=Math.sqrt(m),v=Math.sqrt(f),y=a*Math.tan((r-Math.acos((m+f-(p*p+h*h))/(2*g*v)))/2),b=y/v,x=y/g;Math.abs(b-1)>1e-6&&this._append`L${e+b*u},${t+b*d}`,this._append`A${a},${a},0,0,${+(d*p>u*h)},${this._x1=e+x*s},${this._y1=t+x*c}`}else this._append`L${this._x1=e},${this._y1=t}`}}arc(e,t,n,i,l,s){if(e=+e,t=+t,s=!!s,(n=+n)<0)throw Error(`negative radius: ${n}`);let c=n*Math.cos(i),u=n*Math.sin(i),d=e+c,f=t+u,p=1^s,h=s?i-l:l-i;null===this._x1?this._append`M${d},${f}`:(Math.abs(this._x1-d)>1e-6||Math.abs(this._y1-f)>1e-6)&&this._append`L${d},${f}`,n&&(h<0&&(h=h%o+o),h>a?this._append`A${n},${n},0,1,${p},${e-c},${t-u}A${n},${n},0,1,${p},${this._x1=d},${this._y1=f}`:h>1e-6&&this._append`A${n},${n},0,${+(h>=r)},${p},${this._x1=e+n*Math.cos(l)},${this._y1=t+n*Math.sin(l)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function s(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new l(t)}l.prototype},14474:function(e,t,n){"use strict";n.d(t,{o:function(){return o}});class r extends Error{}function o(e,t){let n;if("string"!=typeof e)throw new r("Invalid token specified: must be a string");t||(t={});let o=!0===t.header?0:1,a=e.split(".")[o];if("string"!=typeof a)throw new r(`Invalid token specified: missing part #${o+1}`);try{n=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(a)}catch(e){throw new r(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new r(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}r.prototype.name="InvalidTokenError"},26433:function(e,t,n){"use strict";let r,o,a,i,l,s,c,u,d,f;n.d(t,{ZP:function(){return rx}});let p="RFC3986",h={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:e=>String(e)};Object.prototype.hasOwnProperty;let m=Array.isArray,g=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})();function v(e,t){if(m(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)}let y=Object.prototype.hasOwnProperty,b={brackets:e=>String(e)+"[]",comma:"comma",indices:(e,t)=>String(e)+"["+t+"]",repeat:e=>String(e)},x=Array.isArray,w=Array.prototype.push,k=function(e,t){w.apply(e,x(t)?t:[t])},S=Date.prototype.toISOString,E={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:(e,t,n,r,o)=>{if(0===e.length)return e;let a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});let i="";for(let e=0;e<a.length;e+=1024){let t=a.length>=1024?a.slice(e,e+1024):a,n=[];for(let e=0;e<t.length;++e){let r=t.charCodeAt(e);if(45===r||46===r||95===r||126===r||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||"RFC1738"===o&&(40===r||41===r)){n[n.length]=t.charAt(e);continue}if(r<128){n[n.length]=g[r];continue}if(r<2048){n[n.length]=g[192|r>>6]+g[128|63&r];continue}if(r<55296||r>=57344){n[n.length]=g[224|r>>12]+g[128|r>>6&63]+g[128|63&r];continue}e+=1,r=65536+((1023&r)<<10|1023&t.charCodeAt(e)),n[n.length]=g[240|r>>18]+g[128|r>>12&63]+g[128|r>>6&63]+g[128|63&r]}i+=n.join("")}return i},encodeValuesOnly:!1,format:p,formatter:h[p],indices:!1,serializeDate:e=>S.call(e),skipNulls:!1,strictNullHandling:!1},O={},C="4.93.0",j=!1;class _{constructor(e){this.body=e}get[Symbol.toStringTag](){return"MultipartBody"}}let P=()=>{o||function(e,t={auto:!1}){if(j)throw Error(`you must \`import 'openai/shims/${e.kind}'\` before importing anything else from openai`);if(o)throw Error(`can't \`import 'openai/shims/${e.kind}'\` after \`import 'openai/shims/${o}'\``);j=t.auto,o=e.kind,a=e.fetch,e.Request,e.Response,e.Headers,i=e.FormData,e.Blob,l=e.File,s=e.ReadableStream,c=e.getMultipartRequestOptions,u=e.getDefaultAgent,d=e.fileFromPath,f=e.isFsReadStream}(function({manuallyImported:e}={}){let t,n,r,o;let a=e?"You may need to use polyfills":`Add one of these imports before your first \`import … from 'openai'\`:- \`import 'openai/shims/node'\` (if you're running on Node)- \`import 'openai/shims/web'\` (otherwise)-`;try{t=fetch,n=Request,r=Response,o=Headers}catch(e){throw Error(`this environment is missing the following Web Fetch API type: ${e.message}. ${a}`)}return{kind:"web",fetch:t,Request:n,Response:r,Headers:o,FormData:"undefined"!=typeof FormData?FormData:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${a}`)}},Blob:"undefined"!=typeof Blob?Blob:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${a}`)}},File:"undefined"!=typeof File?File:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${a}`)}},ReadableStream:"undefined"!=typeof ReadableStream?ReadableStream:class{constructor(){throw Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${a}`)}},getMultipartRequestOptions:async(e,t)=>({...t,body:new _(e)}),getDefaultAgent:e=>void 0,fileFromPath:()=>{throw Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:e=>!1}}(),{auto:!0})};P();class N extends Error{}class T extends N{constructor(e,t,n,r){super(`${T.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.request_id=r?.["x-request-id"],this.error=t,this.code=t?.code,this.param=t?.param,this.type=t?.type}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){if(!e||!r)return new M({message:n,cause:tL(t)});let o=t?.error;return 400===e?new R(e,o,n,r):401===e?new D(e,o,n,r):403===e?new L(e,o,n,r):404===e?new Z(e,o,n,r):409===e?new z(e,o,n,r):422===e?new B(e,o,n,r):429===e?new F(e,o,n,r):e>=500?new H(e,o,n,r):new T(e,o,n,r)}}class A extends T{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class M extends T{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class I extends M{constructor({message:e}={}){super({message:e??"Request timed out."})}}class R extends T{}class D extends T{}class L extends T{}class Z extends T{}class z extends T{}class B extends T{}class F extends T{}class H extends T{}class q extends N{constructor(){super("Could not parse response content as the length limit was reached")}}class W extends N{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}var U,K,$,V,X,G,Y,Q,J,ee,et,en,er,eo,ea,ei,el,es,ec,eu,ed,ef,ep,eh,em,eg,ev,ey,eb,ex,ew,ek,eS,eE,eO,eC,ej,e_,eP,eN,eT,eA,eM,eI,eR,eD,eL,eZ,ez,eB,eF,eH,eq,eW,eU,eK,e$,eV,eX,eG,eY,eQ,eJ,e0,e1,e2=n(10536).lW,e6=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},e4=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class e3{constructor(){U.set(this,void 0),this.buffer=new Uint8Array,e6(this,U,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?new TextEncoder().encode(e):e,r=new Uint8Array(this.buffer.length+n.length);r.set(this.buffer),r.set(n,this.buffer.length),this.buffer=r;let o=[];for(;null!=(t=function(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}(this.buffer,e4(this,U,"f")));){if(t.carriage&&null==e4(this,U,"f")){e6(this,U,t.index,"f");continue}if(null!=e4(this,U,"f")&&(t.index!==e4(this,U,"f")+1||t.carriage)){o.push(this.decodeText(this.buffer.slice(0,e4(this,U,"f")-1))),this.buffer=this.buffer.slice(e4(this,U,"f")),e6(this,U,null,"f");continue}let e=null!==e4(this,U,"f")?t.preceding-1:t.preceding,n=this.decodeText(this.buffer.slice(0,e));o.push(n),this.buffer=this.buffer.slice(t.index),e6(this,U,null,"f")}return o}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==e2){if(e instanceof e2)return e.toString();if(e instanceof Uint8Array)return e2.from(e).toString();throw new N(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if("undefined"!=typeof TextDecoder){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new N(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new N("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode("\n"):[]}}function e5(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}U=new WeakMap,e3.NEWLINE_CHARS=new Set(["\n","\r"]),e3.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class e8{constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new e8(async function*(){if(n)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of e7(e,t))if(!r){if(n.data.startsWith("[DONE]")){r=!0;continue}if(null===n.event||n.event.startsWith("response.")||n.event.startsWith("transcript.")){let t;try{t=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if(t&&t.error)throw new T(void 0,t.error,void 0,tO(e.headers));yield t}else{let e;try{e=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("error"==n.event)throw new T(void 0,e.error,e.message,void 0);yield{event:n.event,data:e}}}r=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{r||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;async function*r(){let t=new e3;for await(let n of e5(e))for(let e of t.decode(n))yield e;for(let e of t.flush())yield e}return new e8(async function*(){if(n)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let e=!1;try{for await(let t of r())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=r=>({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new e8(()=>r(e),this.controller),new e8(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this,n=new TextEncoder;return new s({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:r,done:o}=await e.next();if(o)return t.close();let a=n.encode(JSON.stringify(r)+"\n");t.enqueue(a)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*e7(e,t){if(!e.body)throw t.abort(),new N("Attempted to iterate over a response with no body");let n=new te,r=new e3;for await(let t of e9(e5(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*e9(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?new TextEncoder().encode(n):n,o=new Uint8Array(t.length+r.length);for(o.set(t),o.set(r,t.length),t=o;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class te{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}var tt=n(10536).lW;let tn=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob,tr=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&to(e),to=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ta=e=>tr(e)||tn(e)||f(e);async function ti(e,t,n){var r;if(tr(e=await e))return e;if(tn(e)){let r=await e.blob();t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()??"unknown_file");let o=to(r)?[await r.arrayBuffer()]:[r];return new l(o,t,n)}let o=await tl(e);if(t||(t=(ts((r=e).name)||ts(r.filename)||ts(r.path)?.split(/[\\/]/).pop())??"unknown_file"),!n?.type){let e=o[0]?.type;"string"==typeof e&&(n={...n,type:e})}return new l(o,t,n)}async function tl(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(to(e))t.push(await e.arrayBuffer());else if(tc(e))for await(let n of e)t.push(n);else throw Error(`Unexpected data type: ${typeof e}; constructor: ${e?.constructor?.name}; props: ${function(e){let t=Object.getOwnPropertyNames(e);return`[${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`);return t}let ts=e=>"string"==typeof e?e:void 0!==tt&&e instanceof tt?String(e):void 0,tc=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],tu=e=>e&&"object"==typeof e&&e.body&&"MultipartBody"===e[Symbol.toStringTag],td=async e=>{let t=await tf(e.body);return c(t,e)},tf=async e=>{let t=new i;return await Promise.all(Object.entries(e||{}).map(([e,n])=>th(t,e,n))),t},tp=e=>{if(ta(e))return!0;if(Array.isArray(e))return e.some(tp);if(e&&"object"==typeof e){for(let t in e)if(tp(e[t]))return!0}return!1},th=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(ta(n)){let r=await ti(n);e.append(t,r)}else if(Array.isArray(n))await Promise.all(n.map(n=>th(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>th(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}};var tm=n(10536).lW,tg=n(40257),tv=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},ty=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};async function tb(e){let{response:t}=e;if(e.options.stream)return(tq("response",t.status,t.url,t.headers,t.body),e.options.__streamClass)?e.options.__streamClass.fromSSEResponse(t,e.controller):e8.fromSSEResponse(t,e.controller);if(204===t.status)return null;if(e.options.__binaryResponse)return t;let n=t.headers.get("content-type"),r=n?.split(";")[0]?.trim();if(r?.includes("application/json")||r?.endsWith("+json")){let e=await t.json();return tq("response",t.status,t.url,t.headers,e),tx(e,t)}let o=await t.text();return tq("response",t.status,t.url,t.headers,o),o}function tx(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}P();class tw extends Promise{constructor(e,t=tb){super(e=>{e(null)}),this.responsePromise=e,this.parseResponse=t}_thenUnwrap(e){return new tw(this.responsePromise,async t=>tx(e(await this.parseResponse(t),t),t.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}class tk{constructor({baseURL:e,maxRetries:t=2,timeout:n=6e5,httpAgent:r,fetch:o}){this.baseURL=e,this.maxRetries=tD("maxRetries",t),this.timeout=tD("timeout",n),this.httpAgent=r,this.fetch=o??a}authHeaders(e){return{}}defaultHeaders(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...tT(),...this.authHeaders(e)}}validateHeaders(e,t){}defaultIdempotencyKey(){return`stainless-node-retry-${tW()}`}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(async n=>{let r=n&&to(n?.body)?new DataView(await n.body.arrayBuffer()):n?.body instanceof DataView?n.body:n?.body instanceof ArrayBuffer?new DataView(n.body):n&&ArrayBuffer.isView(n?.body)?new DataView(n.body.buffer):n?.body;return{method:e,path:t,...n,body:r}}))}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}calculateContentLength(e){if("string"==typeof e){if(void 0!==tm)return tm.byteLength(e,"utf8").toString();if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e).length.toString()}else if(ArrayBuffer.isView(e))return e.byteLength.toString();return null}buildRequest(e,{retryCount:t=0}={}){let{method:n,path:r,query:o,headers:a={}}=e={...e},i=ArrayBuffer.isView(e.body)||e.__binaryRequest&&"string"==typeof e.body?e.body:tu(e.body)?e.body.body:e.body?JSON.stringify(e.body,null,2):null,l=this.calculateContentLength(i),s=this.buildURL(r,o);"timeout"in e&&tD("timeout",e.timeout),e.timeout=e.timeout??this.timeout;let c=e.httpAgent??this.httpAgent??u(s),d=e.timeout+1e3;"number"==typeof c?.options?.timeout&&d>(c.options.timeout??0)&&(c.options.timeout=d),this.idempotencyHeader&&"get"!==n&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=e.idempotencyKey);let f=this.buildHeaders({options:e,headers:a,contentLength:l,retryCount:t});return{req:{method:n,...i&&{body:i},headers:f,...c&&{agent:c},signal:e.signal??null},url:s,timeout:e.timeout}}buildHeaders({options:e,headers:t,contentLength:n,retryCount:r}){let a={};n&&(a["content-length"]=n);let i=this.defaultHeaders(e);return tF(a,i),tF(a,t),tu(e.body)&&"node"!==o&&delete a["content-type"],void 0===t$(i,"x-stainless-retry-count")&&void 0===t$(t,"x-stainless-retry-count")&&(a["x-stainless-retry-count"]=String(r)),void 0===t$(i,"x-stainless-timeout")&&void 0===t$(t,"x-stainless-timeout")&&e.timeout&&(a["x-stainless-timeout"]=String(Math.trunc(e.timeout/1e3))),this.validateHeaders(a,t),a}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}parseHeaders(e){return e?Symbol.iterator in e?Object.fromEntries(Array.from(e).map(e=>[...e])):{...e}:{}}makeStatusError(e,t,n,r){return T.generate(e,t,n,r)}request(e,t=null){return new tw(this.makeRequest(e,t))}async makeRequest(e,t){let n=await e,r=n.maxRetries??this.maxRetries;null==t&&(t=r),await this.prepareOptions(n);let{req:o,url:a,timeout:i}=this.buildRequest(n,{retryCount:r-t});if(await this.prepareRequest(o,{url:a,options:n}),tq("request",a,n,o.headers),n.signal?.aborted)throw new A;let l=new AbortController,s=await this.fetchWithTimeout(a,o,i,l).catch(tL);if(s instanceof Error){if(n.signal?.aborted)throw new A;if(t)return this.retryRequest(n,t);if("AbortError"===s.name)throw new I;throw new M({cause:s})}let c=tO(s.headers);if(!s.ok){if(t&&this.shouldRetry(s)){let e=`retrying, ${t} attempts remaining`;return tq(`response (error; ${e})`,s.status,a,c),this.retryRequest(n,t,c)}let e=await s.text().catch(e=>tL(e).message),r=tA(e),o=r?void 0:e,i=t?"(error; no more retries left)":"(error; not retryable)";throw tq(`response (error; ${i})`,s.status,a,c,o),this.makeStatusError(s.status,r,o,c)}return{response:s,options:n,controller:l}}requestAPIList(e,t){return new tE(this,this.makeRequest(t,null),e)}buildURL(e,t){let n=new URL(tI(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return tz(r)||(t={...r,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(n.search=this.stringifyQuery(t)),n.toString()}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new N(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(e,t,n,r){let{signal:o,...a}=t||{};o&&o.addEventListener("abort",()=>r.abort());let i=setTimeout(()=>r.abort(),n),l={signal:r.signal,...a};return l.method&&(l.method=l.method.toUpperCase()),this.fetch.call(void 0,e,l).finally(()=>{clearTimeout(i)})}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||e.status>=500)}async retryRequest(e,t,n){let r;let o=n?.["retry-after-ms"];if(o){let e=parseFloat(o);Number.isNaN(e)||(r=e)}let a=n?.["retry-after"];if(a&&!r){let e=parseFloat(a);r=Number.isNaN(e)?Date.parse(a)-Date.now():1e3*e}if(!(r&&0<=r&&r<6e4)){let n=e.maxRetries??this.maxRetries;r=this.calculateDefaultRetryTimeoutMillis(t,n)}return await tR(r),this.makeRequest(e,t-1)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}getUserAgent(){return`${this.constructor.name}/JS ${C}`}}class tS{constructor(e,t,n,r){K.set(this,void 0),tv(this,K,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageInfo()}async getNextPage(){let e=this.nextPageInfo();if(!e)throw new N("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");let t={...this.options};if("params"in e&&"object"==typeof t.query)t.query={...t.query,...e.params};else if("url"in e){for(let[n,r]of[...Object.entries(t.query||{}),...e.url.searchParams.entries()])e.url.searchParams.set(n,r);t.query=void 0,t.path=e.url.toString()}return await ty(this,K,"f").requestAPIList(this.constructor,t)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(K=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class tE extends tw{constructor(e,t,n){super(t,async t=>new n(e,t.response,await tb(t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}let tO=e=>new Proxy(Object.fromEntries(e.entries()),{get(e,t){let n=t.toString();return e[n.toLowerCase()]||e[n]}}),tC={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__metadata:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},tj=e=>"object"==typeof e&&null!==e&&!tz(e)&&Object.keys(e).every(e=>tB(tC,e)),t_=()=>{if("undefined"!=typeof Deno&&null!=Deno.build)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":tN(Deno.build.os),"X-Stainless-Arch":tP(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":tg.version};if("[object process]"===Object.prototype.toString.call(void 0!==tg?tg:0))return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":tN(tg.platform),"X-Stainless-Arch":tP(tg.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":tg.version};let e=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,o=n[3]||0;return{browser:e,version:`${t}.${r}.${o}`}}}return null}();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},tP=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",tN=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",tT=()=>r??(r=t_()),tA=e=>{try{return JSON.parse(e)}catch(e){return}},tM=/^[a-z][a-z0-9+.-]*:/i,tI=e=>tM.test(e),tR=e=>new Promise(t=>setTimeout(t,e)),tD=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new N(`${e} must be an integer`);if(t<0)throw new N(`${e} must be a positive integer`);return t},tL=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e)try{return Error(JSON.stringify(e))}catch{}return Error(e)},tZ=e=>void 0!==tg?tg.env?.[e]?.trim()??void 0:"undefined"!=typeof Deno?Deno.env?.get?.(e)?.trim():void 0;function tz(e){if(!e)return!0;for(let t in e)return!1;return!0}function tB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tF(e,t){for(let n in t){if(!tB(t,n))continue;let r=n.toLowerCase();if(!r)continue;let o=t[n];null===o?delete e[r]:void 0!==o&&(e[r]=o)}}let tH=new Set(["authorization","api-key"]);function tq(e,...t){void 0!==tg&&tg?.env?.DEBUG==="true"&&console.log(`OpenAI:DEBUG:${e}`,...t.map(e=>{if(!e)return e;if(e.headers){let t={...e,headers:{...e.headers}};for(let n in e.headers)tH.has(n.toLowerCase())&&(t.headers[n]="REDACTED");return t}let t=null;for(let n in e)tH.has(n.toLowerCase())&&(t??(t={...e}),t[n]="REDACTED");return t??e}))}let tW=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),tU=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,tK=e=>"function"==typeof e?.get,t$=(e,t)=>{let n=t.toLowerCase();if(tK(e)){let r=t[0]?.toUpperCase()+t.substring(1).replace(/([^\w])(\w)/g,(e,t,n)=>t+n.toUpperCase());for(let o of[t,n,t.toUpperCase(),r]){let t=e.get(o);if(t)return t}}for(let[r,o]of Object.entries(e))if(r.toLowerCase()===n){if(Array.isArray(o)){if(o.length<=1)return o[0];return console.warn(`Received ${o.length} entries for the ${t} header, using the first entry.`),o[0]}return o}},tV=e=>{if(void 0!==tm){let t=tm.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return Array.from(new Float32Array(r.buffer))}};function tX(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}class tG{constructor(e){this._client=e}}class tY extends tG{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class tQ extends tG{list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/chat/completions/${e}/messages`,t6,{query:t,...n})}}class tJ extends tS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.object=n.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class t0 extends tS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageParams(){let e=this.nextPageInfo();if(!e)return null;if("params"in e)return e.params;let t=Object.fromEntries(e.url.searchParams);return Object.keys(t).length?t:null}nextPageInfo(){let e=this.getPaginatedItems();if(!e.length)return null;let t=e[e.length-1]?.id;return t?{params:{after:t}}:null}}class t1 extends tG{constructor(){super(...arguments),this.messages=new tQ(this._client)}create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}retrieve(e,t){return this._client.get(`/chat/completions/${e}`,t)}update(e,t,n){return this._client.post(`/chat/completions/${e}`,{body:t,...n})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/chat/completions",t2,{query:e,...t})}del(e,t){return this._client.delete(`/chat/completions/${e}`,t)}}class t2 extends t0{}class t6 extends t0{}t1.ChatCompletionsPage=t2,t1.Messages=tQ;class t4 extends tG{constructor(){super(...arguments),this.completions=new t1(this._client)}}t4.Completions=t1,t4.ChatCompletionsPage=t2;class t3 extends tG{create(e,t){let n=!!e.encoding_format,r=n?e.encoding_format:"base64";n&&tq("Request","User defined encoding_format:",e.encoding_format);let o=this._client.post("/embeddings",{body:{...e,encoding_format:r},...t});return n?o:(tq("response","Decoding base64 embeddings to float32 array"),o._thenUnwrap(e=>(e&&e.data&&e.data.forEach(e=>{let t=e.embedding;e.embedding=tV(t)}),e)))}}class t5 extends tG{create(e,t){return this._client.post("/files",td({body:e,...t}))}retrieve(e,t){return this._client.get(`/files/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/files",t8,{query:e,...t})}del(e,t){return this._client.delete(`/files/${e}`,t)}content(e,t){return this._client.get(`/files/${e}/content`,{...t,headers:{Accept:"application/binary",...t?.headers},__binaryResponse:!0})}retrieveContent(e,t){return this._client.get(`/files/${e}/content`,t)}async waitForProcessing(e,{pollInterval:t=5e3,maxWait:n=18e5}={}){let r=new Set(["processed","error","deleted"]),o=Date.now(),a=await this.retrieve(e);for(;!a.status||!r.has(a.status);)if(await tR(t),a=await this.retrieve(e),Date.now()-o>n)throw new I({message:`Giving up on waiting for file ${e} to finish processing after ${n} milliseconds.`});return a}}class t8 extends t0{}t5.FileObjectsPage=t8;class t7 extends tG{createVariation(e,t){return this._client.post("/images/variations",td({body:e,...t}))}edit(e,t){return this._client.post("/images/edits",td({body:e,...t}))}generate(e,t){return this._client.post("/images/generations",{body:e,...t})}}class t9 extends tG{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:{Accept:"application/octet-stream",...t?.headers},__binaryResponse:!0})}}class ne extends tG{create(e,t){return this._client.post("/audio/transcriptions",td({body:e,...t,stream:e.stream??!1,__metadata:{model:e.model}}))}}class nt extends tG{create(e,t){return this._client.post("/audio/translations",td({body:e,...t,__metadata:{model:e.model}}))}}class nn extends tG{constructor(){super(...arguments),this.transcriptions=new ne(this._client),this.translations=new nt(this._client),this.speech=new t9(this._client)}}nn.Transcriptions=ne,nn.Translations=nt,nn.Speech=t9;class nr extends tG{create(e,t){return this._client.post("/moderations",{body:e,...t})}}class no extends tG{retrieve(e,t){return this._client.get(`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",na,e)}del(e,t){return this._client.delete(`/models/${e}`,t)}}class na extends tJ{}no.ModelsPage=na;class ni extends tG{create(e,t,n){return this._client.getAPIList(`/fine_tuning/checkpoints/${e}/permissions`,nl,{body:t,method:"post",...n})}retrieve(e,t={},n){return tj(t)?this.retrieve(e,{},t):this._client.get(`/fine_tuning/checkpoints/${e}/permissions`,{query:t,...n})}del(e,t){return this._client.delete(`/fine_tuning/checkpoints/${e}/permissions`,t)}}class nl extends tJ{}ni.PermissionCreateResponsesPage=nl;class ns extends tG{constructor(){super(...arguments),this.permissions=new ni(this._client)}}ns.Permissions=ni,ns.PermissionCreateResponsesPage=nl;class nc extends tG{list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/checkpoints`,nu,{query:t,...n})}}class nu extends t0{}nc.FineTuningJobCheckpointsPage=nu;class nd extends tG{constructor(){super(...arguments),this.checkpoints=new nc(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(`/fine_tuning/jobs/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/fine_tuning/jobs",nf,{query:e,...t})}cancel(e,t){return this._client.post(`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},n){return tj(t)?this.listEvents(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/events`,np,{query:t,...n})}}class nf extends t0{}class np extends t0{}nd.FineTuningJobsPage=nf,nd.FineTuningJobEventsPage=np,nd.Checkpoints=nc,nd.FineTuningJobCheckpointsPage=nu;class nh extends tG{constructor(){super(...arguments),this.jobs=new nd(this._client),this.checkpoints=new ns(this._client)}}nh.Jobs=nd,nh.FineTuningJobsPage=nf,nh.FineTuningJobEventsPage=np,nh.Checkpoints=ns;let nm=async e=>{let t=await Promise.allSettled(e),n=t.filter(e=>"rejected"===e.status);if(n.length){for(let e of n)console.error(e.reason);throw Error(`${n.length} promise(s) failed - see the above errors`)}let r=[];for(let e of t)"fulfilled"===e.status&&r.push(e.value);return r};class ng extends tG{create(e,t,n){return this._client.post(`/vector_stores/${e}/files`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,t,n,r){return this._client.post(`/vector_stores/${e}/files/${t}`,{body:n,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/vector_stores/${e}/files`,nv,{query:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,t,n){return this._client.delete(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){let r=await this.create(e,t,n);return await this.poll(e,r.id,n)}async poll(e,t,n){let r={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(r["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){let o=await this.retrieve(e,t,{...n,headers:r}).withResponse(),a=o.data;switch(a.status){case"in_progress":let i=5e3;if(n?.pollIntervalMs)i=n.pollIntervalMs;else{let e=o.response.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(i=t)}}await tR(i);break;case"failed":case"completed":return a}}}async upload(e,t,n){let r=await this._client.files.create({file:t,purpose:"assistants"},n);return this.create(e,{file_id:r.id},n)}async uploadAndPoll(e,t,n){let r=await this.upload(e,t,n);return await this.poll(e,r.id,n)}content(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/files/${t}/content`,ny,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class nv extends t0{}class ny extends tJ{}ng.VectorStoreFilesPage=nv,ng.FileContentResponsesPage=ny;class nb extends tG{create(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/file_batches/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}cancel(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches/${t}/cancel`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){let r=await this.create(e,t);return await this.poll(e,r.id,n)}listFiles(e,t,n={},r){return tj(n)?this.listFiles(e,t,{},n):this._client.getAPIList(`/vector_stores/${e}/file_batches/${t}/files`,nv,{query:n,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}async poll(e,t,n){let r={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(r["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){let{data:o,response:a}=await this.retrieve(e,t,{...n,headers:r}).withResponse();switch(o.status){case"in_progress":let i=5e3;if(n?.pollIntervalMs)i=n.pollIntervalMs;else{let e=a.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(i=t)}}await tR(i);break;case"failed":case"cancelled":case"completed":return o}}}async uploadAndPoll(e,{files:t,fileIds:n=[]},r){if(null==t||0==t.length)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let o=Math.min(r?.maxConcurrency??5,t.length),a=this._client,i=t.values(),l=[...n];async function s(e){for(let t of e){let e=await a.files.create({file:t,purpose:"assistants"},r);l.push(e.id)}}let c=Array(o).fill(i).map(s);return await nm(c),await this.createAndPoll(e,{file_ids:l})}}class nx extends tG{constructor(){super(...arguments),this.files=new ng(this._client),this.fileBatches=new nb(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/vector_stores/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/vector_stores",nw,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}search(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/search`,nk,{body:t,method:"post",...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class nw extends t0{}class nk extends tJ{}nx.VectorStoresPage=nw,nx.VectorStoreSearchResponsesPage=nk,nx.Files=ng,nx.VectorStoreFilesPage=nv,nx.FileContentResponsesPage=ny,nx.FileBatches=nb;class nS extends tG{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/assistants/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/assistants",nE,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class nE extends t0{}function nO(e){return"function"==typeof e.parse}nS.AssistantsPage=nE;let nC=e=>e?.role==="assistant",nj=e=>e?.role==="function",n_=e=>e?.role==="tool";var nP=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},nN=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nT{constructor(){$.add(this),this.controller=new AbortController,V.set(this,void 0),X.set(this,()=>{}),G.set(this,()=>{}),Y.set(this,void 0),Q.set(this,()=>{}),J.set(this,()=>{}),ee.set(this,{}),et.set(this,!1),en.set(this,!1),er.set(this,!1),eo.set(this,!1),nP(this,V,new Promise((e,t)=>{nP(this,X,e,"f"),nP(this,G,t,"f")}),"f"),nP(this,Y,new Promise((e,t)=>{nP(this,Q,e,"f"),nP(this,J,t,"f")}),"f"),nN(this,V,"f").catch(()=>{}),nN(this,Y,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},nN(this,$,"m",ea).bind(this))},0)}_connected(){this.ended||(nN(this,X,"f").call(this),this._emit("connect"))}get ended(){return nN(this,et,"f")}get errored(){return nN(this,en,"f")}get aborted(){return nN(this,er,"f")}abort(){this.controller.abort()}on(e,t){return(nN(this,ee,"f")[e]||(nN(this,ee,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=nN(this,ee,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(nN(this,ee,"f")[e]||(nN(this,ee,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{nP(this,eo,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){nP(this,eo,!0,"f"),await nN(this,Y,"f")}_emit(e,...t){if(nN(this,et,"f"))return;"end"===e&&(nP(this,et,!0,"f"),nN(this,Q,"f").call(this));let n=nN(this,ee,"f")[e];if(n&&(nN(this,ee,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];nN(this,eo,"f")||n?.length||Promise.reject(e),nN(this,G,"f").call(this,e),nN(this,J,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];nN(this,eo,"f")||n?.length||Promise.reject(e),nN(this,G,"f").call(this,e),nN(this,J,"f").call(this,e),this._emit("end")}}_emitFinal(){}}function nA(e){return e?.$brand==="auto-parseable-response-format"}function nM(e){return e?.$brand==="auto-parseable-tool"}function nI(e,t){let n=e.choices.map(e=>{var n;if("length"===e.finish_reason)throw new q;if("content_filter"===e.finish_reason)throw new W;return{...e,message:{...e.message,...e.message.tool_calls?{tool_calls:e.message.tool_calls?.map(e=>(function(e,t){let n=e.tools?.find(e=>e.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:nM(n)?n.$parseRaw(t.function.arguments):n?.function.strict?JSON.parse(t.function.arguments):null}}})(t,e))??void 0}:void 0,parsed:e.message.content&&!e.message.refusal?(n=e.message.content,t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(n):JSON.parse(n):null):null}}});return{...e,choices:n}}function nR(e){return!!nA(e.response_format)||(e.tools?.some(e=>nM(e)||"function"===e.type&&!0===e.function.strict)??!1)}V=new WeakMap,X=new WeakMap,G=new WeakMap,Y=new WeakMap,Q=new WeakMap,J=new WeakMap,ee=new WeakMap,et=new WeakMap,en=new WeakMap,er=new WeakMap,eo=new WeakMap,$=new WeakSet,ea=function(e){if(nP(this,en,!0,"f"),e instanceof Error&&"AbortError"===e.name&&(e=new A),e instanceof A)return nP(this,er,!0,"f"),this._emit("abort",e);if(e instanceof N)return this._emit("error",e);if(e instanceof Error){let t=new N(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new N(String(e)))};var nD=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nL extends nT{constructor(){super(...arguments),ei.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let t=e.choices[0]?.message;return t&&this._addMessage(t),e}_addMessage(e,t=!0){if("content"in e||(e.content=null),this.messages.push(e),t){if(this._emit("message",e),(nj(e)||n_(e))&&e.content)this._emit("functionCallResult",e.content);else if(nC(e)&&e.function_call)this._emit("functionCall",e.function_call);else if(nC(e)&&e.tool_calls)for(let t of e.tool_calls)"function"===t.type&&this._emit("functionCall",t.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new N("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),nD(this,ei,"m",el).call(this)}async finalMessage(){return await this.done(),nD(this,ei,"m",es).call(this)}async finalFunctionCall(){return await this.done(),nD(this,ei,"m",ec).call(this)}async finalFunctionCallResult(){return await this.done(),nD(this,ei,"m",eu).call(this)}async totalUsage(){return await this.done(),nD(this,ei,"m",ed).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let t=nD(this,ei,"m",es).call(this);t&&this._emit("finalMessage",t);let n=nD(this,ei,"m",el).call(this);n&&this._emit("finalContent",n);let r=nD(this,ei,"m",ec).call(this);r&&this._emit("finalFunctionCall",r);let o=nD(this,ei,"m",eu).call(this);null!=o&&this._emit("finalFunctionCallResult",o),this._chatCompletions.some(e=>e.usage)&&this._emit("totalUsage",nD(this,ei,"m",ed).call(this))}async _createChatCompletion(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nD(this,ei,"m",ef).call(this,t);let o=await e.chat.completions.create({...t,stream:!1},{...n,signal:this.controller.signal});return this._connected(),this._addChatCompletion(nI(o,t))}async _runChatCompletion(e,t,n){for(let e of t.messages)this._addMessage(e,!1);return await this._createChatCompletion(e,t,n)}async _runFunctions(e,t,n){let r="function",{function_call:o="auto",stream:a,...i}=t,l="string"!=typeof o&&o?.name,{maxChatCompletions:s=10}=n||{},c={};for(let e of t.functions)c[e.name||e.function.name]=e;let u=t.functions.map(e=>({name:e.name||e.function.name,parameters:e.parameters,description:e.description}));for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<s;++t){let t;let a=await this._createChatCompletion(e,{...i,function_call:o,functions:u,messages:[...this.messages]},n),s=a.choices[0]?.message;if(!s)throw new N("missing message in ChatCompletion response");if(!s.function_call)return;let{name:d,arguments:f}=s.function_call,p=c[d];if(p){if(l&&l!==d){let e=`Invalid function_call: ${JSON.stringify(d)}. ${JSON.stringify(l)} requested. Please try again`;this._addMessage({role:r,name:d,content:e});continue}}else{let e=`Invalid function_call: ${JSON.stringify(d)}. Available options are: ${u.map(e=>JSON.stringify(e.name)).join(", ")}. Please try again`;this._addMessage({role:r,name:d,content:e});continue}try{t=nO(p)?await p.parse(f):f}catch(e){this._addMessage({role:r,name:d,content:e instanceof Error?e.message:String(e)});continue}let h=await p.function(t,this),m=nD(this,ei,"m",ep).call(this,h);if(this._addMessage({role:r,name:d,content:m}),l)return}}async _runTools(e,t,n){let r="tool",{tool_choice:o="auto",stream:a,...i}=t,l="string"!=typeof o&&o?.function?.name,{maxChatCompletions:s=10}=n||{},c=t.tools.map(e=>{if(nM(e)){if(!e.$callback)throw new N("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:e.$callback,name:e.function.name,description:e.function.description||"",parameters:e.function.parameters,parse:e.$parseRaw,strict:!0}}}return e}),u={};for(let e of c)"function"===e.type&&(u[e.function.name||e.function.function.name]=e.function);let d="tools"in t?c.map(e=>"function"===e.type?{type:"function",function:{name:e.function.name||e.function.function.name,parameters:e.function.parameters,description:e.function.description,strict:e.function.strict}}:e):void 0;for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<s;++t){let t=await this._createChatCompletion(e,{...i,tool_choice:o,tools:d,messages:[...this.messages]},n),a=t.choices[0]?.message;if(!a)throw new N("missing message in ChatCompletion response");if(!a.tool_calls?.length)break;for(let e of a.tool_calls){let t;if("function"!==e.type)continue;let n=e.id,{name:o,arguments:a}=e.function,i=u[o];if(i){if(l&&l!==o){let e=`Invalid tool_call: ${JSON.stringify(o)}. ${JSON.stringify(l)} requested. Please try again`;this._addMessage({role:r,tool_call_id:n,content:e});continue}}else{let e=`Invalid tool_call: ${JSON.stringify(o)}. Available options are: ${Object.keys(u).map(e=>JSON.stringify(e)).join(", ")}. Please try again`;this._addMessage({role:r,tool_call_id:n,content:e});continue}try{t=nO(i)?await i.parse(a):a}catch(t){let e=t instanceof Error?t.message:String(t);this._addMessage({role:r,tool_call_id:n,content:e});continue}let s=await i.function(t,this),c=nD(this,ei,"m",ep).call(this,s);if(this._addMessage({role:r,tool_call_id:n,content:c}),l)return}}}}ei=new WeakSet,el=function(){return nD(this,ei,"m",es).call(this).content??null},es=function(){let e=this.messages.length;for(;e-- >0;){let t=this.messages[e];if(nC(t)){let{function_call:e,...n}=t,r={...n,content:t.content??null,refusal:t.refusal??null};return e&&(r.function_call=e),r}}throw new N("stream ended without producing a ChatCompletionMessage with role=assistant")},ec=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(nC(t)&&t?.function_call)return t.function_call;if(nC(t)&&t?.tool_calls?.length)return t.tool_calls.at(-1)?.function}},eu=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(nj(t)&&null!=t.content||n_(t)&&null!=t.content&&"string"==typeof t.content&&this.messages.some(e=>"assistant"===e.role&&e.tool_calls?.some(e=>"function"===e.type&&e.id===t.tool_call_id)))return t.content}},ed=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:t}of this._chatCompletions)t&&(e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens);return e},ef=function(e){if(null!=e.n&&e.n>1)throw new N("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},ep=function(e){return"string"==typeof e?e:void 0===e?"undefined":JSON.stringify(e)};class nZ extends nL{static runFunctions(e,t,n){let r=new nZ,o={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return r._run(()=>r._runFunctions(e,t,o)),r}static runTools(e,t,n){let r=new nZ,o={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(e,t,o)),r}_addMessage(e,t=!0){super._addMessage(e,t),nC(e)&&e.content&&this._emit("content",e.content)}}let nz={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,ALL:511};class nB extends Error{}class nF extends Error{}let nH=(e,t)=>{let n=e.length,r=0,o=e=>{throw new nB(`${e} at position ${r}`)},a=e=>{throw new nF(`${e} at position ${r}`)},i=()=>(d(),r>=n&&o("Unexpected end of input"),'"'===e[r])?l():"{"===e[r]?s():"["===e[r]?c():"null"===e.substring(r,r+4)||nz.NULL&t&&n-r<4&&"null".startsWith(e.substring(r))?(r+=4,null):"true"===e.substring(r,r+4)||nz.BOOL&t&&n-r<4&&"true".startsWith(e.substring(r))?(r+=4,!0):"false"===e.substring(r,r+5)||nz.BOOL&t&&n-r<5&&"false".startsWith(e.substring(r))?(r+=5,!1):"Infinity"===e.substring(r,r+8)||nz.INFINITY&t&&n-r<8&&"Infinity".startsWith(e.substring(r))?(r+=8,1/0):"-Infinity"===e.substring(r,r+9)||nz.MINUS_INFINITY&t&&1<n-r&&n-r<9&&"-Infinity".startsWith(e.substring(r))?(r+=9,-1/0):"NaN"===e.substring(r,r+3)||nz.NAN&t&&n-r<3&&"NaN".startsWith(e.substring(r))?(r+=3,NaN):u(),l=()=>{let i=r,l=!1;for(r++;r<n&&('"'!==e[r]||l&&"\\"===e[r-1]);)l="\\"===e[r]&&!l,r++;if('"'==e.charAt(r))try{return JSON.parse(e.substring(i,++r-Number(l)))}catch(e){a(String(e))}else if(nz.STR&t)try{return JSON.parse(e.substring(i,r-Number(l))+'"')}catch(t){return JSON.parse(e.substring(i,e.lastIndexOf("\\"))+'"')}o("Unterminated string literal")},s=()=>{r++,d();let a={};try{for(;"}"!==e[r];){if(d(),r>=n&&nz.OBJ&t)return a;let o=l();d(),r++;try{let e=i();Object.defineProperty(a,o,{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){if(nz.OBJ&t)return a;throw e}d(),","===e[r]&&r++}}catch(e){if(nz.OBJ&t)return a;o("Expected '}' at end of object")}return r++,a},c=()=>{r++;let n=[];try{for(;"]"!==e[r];)n.push(i()),d(),","===e[r]&&r++}catch(e){if(nz.ARR&t)return n;o("Expected ']' at end of array")}return r++,n},u=()=>{if(0===r){"-"===e&&nz.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e)}catch(n){if(nz.NUM&t)try{if("."===e[e.length-1])return JSON.parse(e.substring(0,e.lastIndexOf(".")));return JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch(e){}a(String(n))}}let i=r;for("-"===e[r]&&r++;e[r]&&!",]}".includes(e[r]);)r++;r!=n||nz.NUM&t||o("Unterminated number literal");try{return JSON.parse(e.substring(i,r))}catch(n){"-"===e.substring(i,r)&&nz.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e.substring(i,e.lastIndexOf("e")))}catch(e){a(String(e))}}},d=()=>{for(;r<n&&" \n\r ".includes(e[r]);)r++};return i()},nq=e=>(function(e,t=nz.ALL){if("string"!=typeof e)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return nH(e.trim(),t)})(e,nz.ALL^nz.NUM);var nW=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},nU=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nK extends nL{constructor(e){super(),eh.add(this),em.set(this,void 0),eg.set(this,void 0),ev.set(this,void 0),nW(this,em,e,"f"),nW(this,eg,[],"f")}get currentChatCompletionSnapshot(){return nU(this,ev,"f")}static fromReadableStream(e){let t=new nK(null);return t._run(()=>t._fromReadableStream(e)),t}static createChatCompletion(e,t,n){let r=new nK(t);return r._run(()=>r._runChatCompletion(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createChatCompletion(e,t,n){super._createChatCompletion;let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nU(this,eh,"m",ey).call(this);let o=await e.chat.completions.create({...t,stream:!0},{...n,signal:this.controller.signal});for await(let e of(this._connected(),o))nU(this,eh,"m",ex).call(this,e);if(o.controller.signal?.aborted)throw new A;return this._addChatCompletion(nU(this,eh,"m",eS).call(this))}async _fromReadableStream(e,t){let n;let r=t?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nU(this,eh,"m",ey).call(this),this._connected();let o=e8.fromReadableStream(e,this.controller);for await(let e of o)n&&n!==e.id&&this._addChatCompletion(nU(this,eh,"m",eS).call(this)),nU(this,eh,"m",ex).call(this,e),n=e.id;if(o.controller.signal?.aborted)throw new A;return this._addChatCompletion(nU(this,eh,"m",eS).call(this))}[(em=new WeakMap,eg=new WeakMap,ev=new WeakMap,eh=new WeakSet,ey=function(){this.ended||nW(this,ev,void 0,"f")},eb=function(e){let t=nU(this,eg,"f")[e.index];return t||(t={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},nU(this,eg,"f")[e.index]=t),t},ex=function(e){if(this.ended)return;let t=nU(this,eh,"m",eO).call(this,e);for(let n of(this._emit("chunk",e,t),e.choices)){let e=t.choices[n.index];null!=n.delta.content&&e.message?.role==="assistant"&&e.message?.content&&(this._emit("content",n.delta.content,e.message.content),this._emit("content.delta",{delta:n.delta.content,snapshot:e.message.content,parsed:e.message.parsed})),null!=n.delta.refusal&&e.message?.role==="assistant"&&e.message?.refusal&&this._emit("refusal.delta",{delta:n.delta.refusal,snapshot:e.message.refusal}),n.logprobs?.content!=null&&e.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:n.logprobs?.content,snapshot:e.logprobs?.content??[]}),n.logprobs?.refusal!=null&&e.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:n.logprobs?.refusal,snapshot:e.logprobs?.refusal??[]});let r=nU(this,eh,"m",eb).call(this,e);for(let t of(e.finish_reason&&(nU(this,eh,"m",ek).call(this,e),null!=r.current_tool_call_index&&nU(this,eh,"m",ew).call(this,e,r.current_tool_call_index)),n.delta.tool_calls??[]))r.current_tool_call_index!==t.index&&(nU(this,eh,"m",ek).call(this,e),null!=r.current_tool_call_index&&nU(this,eh,"m",ew).call(this,e,r.current_tool_call_index)),r.current_tool_call_index=t.index;for(let t of n.delta.tool_calls??[]){let n=e.message.tool_calls?.[t.index];n?.type&&(n?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:n.function?.name,index:t.index,arguments:n.function.arguments,parsed_arguments:n.function.parsed_arguments,arguments_delta:t.function?.arguments??""}):n?.type)}}},ew=function(e,t){if(nU(this,eh,"m",eb).call(this,e).done_tool_calls.has(t))return;let n=e.message.tool_calls?.[t];if(!n)throw Error("no tool call snapshot");if(!n.type)throw Error("tool call snapshot missing `type`");if("function"===n.type){let e=nU(this,em,"f")?.tools?.find(e=>"function"===e.type&&e.function.name===n.function.name);this._emit("tool_calls.function.arguments.done",{name:n.function.name,index:t,arguments:n.function.arguments,parsed_arguments:nM(e)?e.$parseRaw(n.function.arguments):e?.function.strict?JSON.parse(n.function.arguments):null})}else n.type},ek=function(e){let t=nU(this,eh,"m",eb).call(this,e);if(e.message.content&&!t.content_done){t.content_done=!0;let n=nU(this,eh,"m",eE).call(this);this._emit("content.done",{content:e.message.content,parsed:n?n.$parseRaw(e.message.content):null})}e.message.refusal&&!t.refusal_done&&(t.refusal_done=!0,this._emit("refusal.done",{refusal:e.message.refusal})),e.logprobs?.content&&!t.logprobs_content_done&&(t.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:e.logprobs.content})),e.logprobs?.refusal&&!t.logprobs_refusal_done&&(t.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:e.logprobs.refusal}))},eS=function(){if(this.ended)throw new N("stream has ended, this shouldn't happen");let e=nU(this,ev,"f");if(!e)throw new N("request ended without sending any chunks");return nW(this,ev,void 0,"f"),nW(this,eg,[],"f"),function(e,t){var n;let{id:r,choices:o,created:a,model:i,system_fingerprint:l,...s}=e;return n={...s,id:r,choices:o.map(({message:t,finish_reason:n,index:r,logprobs:o,...a})=>{if(!n)throw new N(`missing finish_reason for choice ${r}`);let{content:i=null,function_call:l,tool_calls:s,...c}=t,u=t.role;if(!u)throw new N(`missing role for choice ${r}`);if(l){let{arguments:e,name:s}=l;if(null==e)throw new N(`missing function_call.arguments for choice ${r}`);if(!s)throw new N(`missing function_call.name for choice ${r}`);return{...a,message:{content:i,function_call:{arguments:e,name:s},role:u,refusal:t.refusal??null},finish_reason:n,index:r,logprobs:o}}return s?{...a,index:r,finish_reason:n,logprobs:o,message:{...c,role:u,content:i,refusal:t.refusal??null,tool_calls:s.map((t,n)=>{let{function:o,type:a,id:i,...l}=t,{arguments:s,name:c,...u}=o||{};if(null==i)throw new N(`missing choices[${r}].tool_calls[${n}].id+`;try{t=fetch,n=Request,r=Response,o=Headers}catch(e){throw Error(`this environment is missing the following Web Fetch API type: ${e.message}. ${a}`)}return{kind:"web",fetch:t,Request:n,Response:r,Headers:o,FormData:"undefined"!=typeof FormData?FormData:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${a}`)}},Blob:"undefined"!=typeof Blob?Blob:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${a}`)}},File:"undefined"!=typeof File?File:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${a}`)}},ReadableStream:"undefined"!=typeof ReadableStream?ReadableStream:class{constructor(){throw Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${a}`)}},getMultipartRequestOptions:async(e,t)=>({...t,body:new _(e)}),getDefaultAgent:e=>void 0,fileFromPath:()=>{throw Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:e=>!1}}(),{auto:!0})};P();class N extends Error{}class T extends N{constructor(e,t,n,r){super(`${T.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.request_id=r?.["x-request-id"],this.error=t,this.code=t?.code,this.param=t?.param,this.type=t?.type}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){if(!e||!r)return new M({message:n,cause:tL(t)});let o=t?.error;return 400===e?new R(e,o,n,r):401===e?new D(e,o,n,r):403===e?new L(e,o,n,r):404===e?new Z(e,o,n,r):409===e?new z(e,o,n,r):422===e?new B(e,o,n,r):429===e?new F(e,o,n,r):e>=500?new H(e,o,n,r):new T(e,o,n,r)}}class A extends T{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class M extends T{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class I extends M{constructor({message:e}={}){super({message:e??"Request timed out."})}}class R extends T{}class D extends T{}class L extends T{}class Z extends T{}class z extends T{}class B extends T{}class F extends T{}class H extends T{}class q extends N{constructor(){super("Could not parse response content as the length limit was reached")}}class W extends N{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}var U,K,$,V,X,G,Y,Q,J,ee,et,en,er,eo,ea,ei,el,es,ec,eu,ed,ef,ep,eh,em,eg,ev,ey,eb,ex,ew,ek,eS,eE,eO,eC,ej,e_,eP,eN,eT,eA,eM,eI,eR,eD,eL,eZ,ez,eB,eF,eH,eq,eW,eU,eK,e$,eV,eX,eG,eY,eQ,eJ,e0,e1,e2=n(96434).Buffer,e6=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},e4=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class e3{constructor(){U.set(this,void 0),this.buffer=new Uint8Array,e6(this,U,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?new TextEncoder().encode(e):e,r=new Uint8Array(this.buffer.length+n.length);r.set(this.buffer),r.set(n,this.buffer.length),this.buffer=r;let o=[];for(;null!=(t=function(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}(this.buffer,e4(this,U,"f")));){if(t.carriage&&null==e4(this,U,"f")){e6(this,U,t.index,"f");continue}if(null!=e4(this,U,"f")&&(t.index!==e4(this,U,"f")+1||t.carriage)){o.push(this.decodeText(this.buffer.slice(0,e4(this,U,"f")-1))),this.buffer=this.buffer.slice(e4(this,U,"f")),e6(this,U,null,"f");continue}let e=null!==e4(this,U,"f")?t.preceding-1:t.preceding,n=this.decodeText(this.buffer.slice(0,e));o.push(n),this.buffer=this.buffer.slice(t.index),e6(this,U,null,"f")}return o}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==e2){if(e instanceof e2)return e.toString();if(e instanceof Uint8Array)return e2.from(e).toString();throw new N(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if("undefined"!=typeof TextDecoder){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new N(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new N("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode("\n"):[]}}function e5(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}U=new WeakMap,e3.NEWLINE_CHARS=new Set(["\n","\r"]),e3.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class e8{constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new e8(async function*(){if(n)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of e7(e,t))if(!r){if(n.data.startsWith("[DONE]")){r=!0;continue}if(null===n.event||n.event.startsWith("response.")||n.event.startsWith("transcript.")){let t;try{t=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if(t&&t.error)throw new T(void 0,t.error,void 0,tO(e.headers));yield t}else{let e;try{e=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("error"==n.event)throw new T(void 0,e.error,e.message,void 0);yield{event:n.event,data:e}}}r=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{r||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;async function*r(){let t=new e3;for await(let n of e5(e))for(let e of t.decode(n))yield e;for(let e of t.flush())yield e}return new e8(async function*(){if(n)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let e=!1;try{for await(let t of r())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=r=>({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new e8(()=>r(e),this.controller),new e8(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this,n=new TextEncoder;return new s({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:r,done:o}=await e.next();if(o)return t.close();let a=n.encode(JSON.stringify(r)+"\n");t.enqueue(a)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*e7(e,t){if(!e.body)throw t.abort(),new N("Attempted to iterate over a response with no body");let n=new te,r=new e3;for await(let t of e9(e5(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*e9(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?new TextEncoder().encode(n):n,o=new Uint8Array(t.length+r.length);for(o.set(t),o.set(r,t.length),t=o;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class te{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}var tt=n(96434).Buffer;let tn=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob,tr=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&to(e),to=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ta=e=>tr(e)||tn(e)||f(e);async function ti(e,t,n){var r;if(tr(e=await e))return e;if(tn(e)){let r=await e.blob();t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()??"unknown_file");let o=to(r)?[await r.arrayBuffer()]:[r];return new l(o,t,n)}let o=await tl(e);if(t||(t=(ts((r=e).name)||ts(r.filename)||ts(r.path)?.split(/[\\/]/).pop())??"unknown_file"),!n?.type){let e=o[0]?.type;"string"==typeof e&&(n={...n,type:e})}return new l(o,t,n)}async function tl(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(to(e))t.push(await e.arrayBuffer());else if(tc(e))for await(let n of e)t.push(n);else throw Error(`Unexpected data type: ${typeof e}; constructor: ${e?.constructor?.name}; props: ${function(e){let t=Object.getOwnPropertyNames(e);return`[${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`);return t}let ts=e=>"string"==typeof e?e:void 0!==tt&&e instanceof tt?String(e):void 0,tc=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],tu=e=>e&&"object"==typeof e&&e.body&&"MultipartBody"===e[Symbol.toStringTag],td=async e=>{let t=await tf(e.body);return c(t,e)},tf=async e=>{let t=new i;return await Promise.all(Object.entries(e||{}).map(([e,n])=>th(t,e,n))),t},tp=e=>{if(ta(e))return!0;if(Array.isArray(e))return e.some(tp);if(e&&"object"==typeof e){for(let t in e)if(tp(e[t]))return!0}return!1},th=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(ta(n)){let r=await ti(n);e.append(t,r)}else if(Array.isArray(n))await Promise.all(n.map(n=>th(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>th(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}};var tm=n(96434).Buffer,tg=n(40257),tv=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},ty=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};async function tb(e){let{response:t}=e;if(e.options.stream)return(tq("response",t.status,t.url,t.headers,t.body),e.options.__streamClass)?e.options.__streamClass.fromSSEResponse(t,e.controller):e8.fromSSEResponse(t,e.controller);if(204===t.status)return null;if(e.options.__binaryResponse)return t;let n=t.headers.get("content-type"),r=n?.split(";")[0]?.trim();if(r?.includes("application/json")||r?.endsWith("+json")){let e=await t.json();return tq("response",t.status,t.url,t.headers,e),tx(e,t)}let o=await t.text();return tq("response",t.status,t.url,t.headers,o),o}function tx(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}P();class tw extends Promise{constructor(e,t=tb){super(e=>{e(null)}),this.responsePromise=e,this.parseResponse=t}_thenUnwrap(e){return new tw(this.responsePromise,async t=>tx(e(await this.parseResponse(t),t),t.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}class tk{constructor({baseURL:e,maxRetries:t=2,timeout:n=6e5,httpAgent:r,fetch:o}){this.baseURL=e,this.maxRetries=tD("maxRetries",t),this.timeout=tD("timeout",n),this.httpAgent=r,this.fetch=o??a}authHeaders(e){return{}}defaultHeaders(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...tT(),...this.authHeaders(e)}}validateHeaders(e,t){}defaultIdempotencyKey(){return`stainless-node-retry-${tW()}`}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(async n=>{let r=n&&to(n?.body)?new DataView(await n.body.arrayBuffer()):n?.body instanceof DataView?n.body:n?.body instanceof ArrayBuffer?new DataView(n.body):n&&ArrayBuffer.isView(n?.body)?new DataView(n.body.buffer):n?.body;return{method:e,path:t,...n,body:r}}))}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}calculateContentLength(e){if("string"==typeof e){if(void 0!==tm)return tm.byteLength(e,"utf8").toString();if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e).length.toString()}else if(ArrayBuffer.isView(e))return e.byteLength.toString();return null}buildRequest(e,{retryCount:t=0}={}){let{method:n,path:r,query:o,headers:a={}}=e={...e},i=ArrayBuffer.isView(e.body)||e.__binaryRequest&&"string"==typeof e.body?e.body:tu(e.body)?e.body.body:e.body?JSON.stringify(e.body,null,2):null,l=this.calculateContentLength(i),s=this.buildURL(r,o);"timeout"in e&&tD("timeout",e.timeout),e.timeout=e.timeout??this.timeout;let c=e.httpAgent??this.httpAgent??u(s),d=e.timeout+1e3;"number"==typeof c?.options?.timeout&&d>(c.options.timeout??0)&&(c.options.timeout=d),this.idempotencyHeader&&"get"!==n&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=e.idempotencyKey);let f=this.buildHeaders({options:e,headers:a,contentLength:l,retryCount:t});return{req:{method:n,...i&&{body:i},headers:f,...c&&{agent:c},signal:e.signal??null},url:s,timeout:e.timeout}}buildHeaders({options:e,headers:t,contentLength:n,retryCount:r}){let a={};n&&(a["content-length"]=n);let i=this.defaultHeaders(e);return tF(a,i),tF(a,t),tu(e.body)&&"node"!==o&&delete a["content-type"],void 0===t$(i,"x-stainless-retry-count")&&void 0===t$(t,"x-stainless-retry-count")&&(a["x-stainless-retry-count"]=String(r)),void 0===t$(i,"x-stainless-timeout")&&void 0===t$(t,"x-stainless-timeout")&&e.timeout&&(a["x-stainless-timeout"]=String(Math.trunc(e.timeout/1e3))),this.validateHeaders(a,t),a}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}parseHeaders(e){return e?Symbol.iterator in e?Object.fromEntries(Array.from(e).map(e=>[...e])):{...e}:{}}makeStatusError(e,t,n,r){return T.generate(e,t,n,r)}request(e,t=null){return new tw(this.makeRequest(e,t))}async makeRequest(e,t){let n=await e,r=n.maxRetries??this.maxRetries;null==t&&(t=r),await this.prepareOptions(n);let{req:o,url:a,timeout:i}=this.buildRequest(n,{retryCount:r-t});if(await this.prepareRequest(o,{url:a,options:n}),tq("request",a,n,o.headers),n.signal?.aborted)throw new A;let l=new AbortController,s=await this.fetchWithTimeout(a,o,i,l).catch(tL);if(s instanceof Error){if(n.signal?.aborted)throw new A;if(t)return this.retryRequest(n,t);if("AbortError"===s.name)throw new I;throw new M({cause:s})}let c=tO(s.headers);if(!s.ok){if(t&&this.shouldRetry(s)){let e=`retrying, ${t} attempts remaining`;return tq(`response (error; ${e})`,s.status,a,c),this.retryRequest(n,t,c)}let e=await s.text().catch(e=>tL(e).message),r=tA(e),o=r?void 0:e,i=t?"(error; no more retries left)":"(error; not retryable)";throw tq(`response (error; ${i})`,s.status,a,c,o),this.makeStatusError(s.status,r,o,c)}return{response:s,options:n,controller:l}}requestAPIList(e,t){return new tE(this,this.makeRequest(t,null),e)}buildURL(e,t){let n=new URL(tI(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return tz(r)||(t={...r,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(n.search=this.stringifyQuery(t)),n.toString()}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new N(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(e,t,n,r){let{signal:o,...a}=t||{};o&&o.addEventListener("abort",()=>r.abort());let i=setTimeout(()=>r.abort(),n),l={signal:r.signal,...a};return l.method&&(l.method=l.method.toUpperCase()),this.fetch.call(void 0,e,l).finally(()=>{clearTimeout(i)})}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||e.status>=500)}async retryRequest(e,t,n){let r;let o=n?.["retry-after-ms"];if(o){let e=parseFloat(o);Number.isNaN(e)||(r=e)}let a=n?.["retry-after"];if(a&&!r){let e=parseFloat(a);r=Number.isNaN(e)?Date.parse(a)-Date.now():1e3*e}if(!(r&&0<=r&&r<6e4)){let n=e.maxRetries??this.maxRetries;r=this.calculateDefaultRetryTimeoutMillis(t,n)}return await tR(r),this.makeRequest(e,t-1)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}getUserAgent(){return`${this.constructor.name}/JS ${C}`}}class tS{constructor(e,t,n,r){K.set(this,void 0),tv(this,K,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageInfo()}async getNextPage(){let e=this.nextPageInfo();if(!e)throw new N("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");let t={...this.options};if("params"in e&&"object"==typeof t.query)t.query={...t.query,...e.params};else if("url"in e){for(let[n,r]of[...Object.entries(t.query||{}),...e.url.searchParams.entries()])e.url.searchParams.set(n,r);t.query=void 0,t.path=e.url.toString()}return await ty(this,K,"f").requestAPIList(this.constructor,t)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(K=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class tE extends tw{constructor(e,t,n){super(t,async t=>new n(e,t.response,await tb(t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}let tO=e=>new Proxy(Object.fromEntries(e.entries()),{get(e,t){let n=t.toString();return e[n.toLowerCase()]||e[n]}}),tC={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__metadata:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},tj=e=>"object"==typeof e&&null!==e&&!tz(e)&&Object.keys(e).every(e=>tB(tC,e)),t_=()=>{if("undefined"!=typeof Deno&&null!=Deno.build)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":tN(Deno.build.os),"X-Stainless-Arch":tP(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":tg.version};if("[object process]"===Object.prototype.toString.call(void 0!==tg?tg:0))return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":tN(tg.platform),"X-Stainless-Arch":tP(tg.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":tg.version};let e=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,o=n[3]||0;return{browser:e,version:`${t}.${r}.${o}`}}}return null}();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},tP=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",tN=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",tT=()=>r??(r=t_()),tA=e=>{try{return JSON.parse(e)}catch(e){return}},tM=/^[a-z][a-z0-9+.-]*:/i,tI=e=>tM.test(e),tR=e=>new Promise(t=>setTimeout(t,e)),tD=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new N(`${e} must be an integer`);if(t<0)throw new N(`${e} must be a positive integer`);return t},tL=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e)try{return Error(JSON.stringify(e))}catch{}return Error(e)},tZ=e=>void 0!==tg?tg.env?.[e]?.trim()??void 0:"undefined"!=typeof Deno?Deno.env?.get?.(e)?.trim():void 0;function tz(e){if(!e)return!0;for(let t in e)return!1;return!0}function tB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tF(e,t){for(let n in t){if(!tB(t,n))continue;let r=n.toLowerCase();if(!r)continue;let o=t[n];null===o?delete e[r]:void 0!==o&&(e[r]=o)}}let tH=new Set(["authorization","api-key"]);function tq(e,...t){void 0!==tg&&tg?.env?.DEBUG==="true"&&console.log(`OpenAI:DEBUG:${e}`,...t.map(e=>{if(!e)return e;if(e.headers){let t={...e,headers:{...e.headers}};for(let n in e.headers)tH.has(n.toLowerCase())&&(t.headers[n]="REDACTED");return t}let t=null;for(let n in e)tH.has(n.toLowerCase())&&(t??(t={...e}),t[n]="REDACTED");return t??e}))}let tW=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),tU=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,tK=e=>"function"==typeof e?.get,t$=(e,t)=>{let n=t.toLowerCase();if(tK(e)){let r=t[0]?.toUpperCase()+t.substring(1).replace(/([^\w])(\w)/g,(e,t,n)=>t+n.toUpperCase());for(let o of[t,n,t.toUpperCase(),r]){let t=e.get(o);if(t)return t}}for(let[r,o]of Object.entries(e))if(r.toLowerCase()===n){if(Array.isArray(o)){if(o.length<=1)return o[0];return console.warn(`Received ${o.length} entries for the ${t} header, using the first entry.`),o[0]}return o}},tV=e=>{if(void 0!==tm){let t=tm.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return Array.from(new Float32Array(r.buffer))}};function tX(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}class tG{constructor(e){this._client=e}}class tY extends tG{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class tQ extends tG{list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/chat/completions/${e}/messages`,t6,{query:t,...n})}}class tJ extends tS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.object=n.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class t0 extends tS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageParams(){let e=this.nextPageInfo();if(!e)return null;if("params"in e)return e.params;let t=Object.fromEntries(e.url.searchParams);return Object.keys(t).length?t:null}nextPageInfo(){let e=this.getPaginatedItems();if(!e.length)return null;let t=e[e.length-1]?.id;return t?{params:{after:t}}:null}}class t1 extends tG{constructor(){super(...arguments),this.messages=new tQ(this._client)}create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}retrieve(e,t){return this._client.get(`/chat/completions/${e}`,t)}update(e,t,n){return this._client.post(`/chat/completions/${e}`,{body:t,...n})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/chat/completions",t2,{query:e,...t})}del(e,t){return this._client.delete(`/chat/completions/${e}`,t)}}class t2 extends t0{}class t6 extends t0{}t1.ChatCompletionsPage=t2,t1.Messages=tQ;class t4 extends tG{constructor(){super(...arguments),this.completions=new t1(this._client)}}t4.Completions=t1,t4.ChatCompletionsPage=t2;class t3 extends tG{create(e,t){let n=!!e.encoding_format,r=n?e.encoding_format:"base64";n&&tq("Request","User defined encoding_format:",e.encoding_format);let o=this._client.post("/embeddings",{body:{...e,encoding_format:r},...t});return n?o:(tq("response","Decoding base64 embeddings to float32 array"),o._thenUnwrap(e=>(e&&e.data&&e.data.forEach(e=>{let t=e.embedding;e.embedding=tV(t)}),e)))}}class t5 extends tG{create(e,t){return this._client.post("/files",td({body:e,...t}))}retrieve(e,t){return this._client.get(`/files/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/files",t8,{query:e,...t})}del(e,t){return this._client.delete(`/files/${e}`,t)}content(e,t){return this._client.get(`/files/${e}/content`,{...t,headers:{Accept:"application/binary",...t?.headers},__binaryResponse:!0})}retrieveContent(e,t){return this._client.get(`/files/${e}/content`,t)}async waitForProcessing(e,{pollInterval:t=5e3,maxWait:n=18e5}={}){let r=new Set(["processed","error","deleted"]),o=Date.now(),a=await this.retrieve(e);for(;!a.status||!r.has(a.status);)if(await tR(t),a=await this.retrieve(e),Date.now()-o>n)throw new I({message:`Giving up on waiting for file ${e} to finish processing after ${n} milliseconds.`});return a}}class t8 extends t0{}t5.FileObjectsPage=t8;class t7 extends tG{createVariation(e,t){return this._client.post("/images/variations",td({body:e,...t}))}edit(e,t){return this._client.post("/images/edits",td({body:e,...t}))}generate(e,t){return this._client.post("/images/generations",{body:e,...t})}}class t9 extends tG{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:{Accept:"application/octet-stream",...t?.headers},__binaryResponse:!0})}}class ne extends tG{create(e,t){return this._client.post("/audio/transcriptions",td({body:e,...t,stream:e.stream??!1,__metadata:{model:e.model}}))}}class nt extends tG{create(e,t){return this._client.post("/audio/translations",td({body:e,...t,__metadata:{model:e.model}}))}}class nn extends tG{constructor(){super(...arguments),this.transcriptions=new ne(this._client),this.translations=new nt(this._client),this.speech=new t9(this._client)}}nn.Transcriptions=ne,nn.Translations=nt,nn.Speech=t9;class nr extends tG{create(e,t){return this._client.post("/moderations",{body:e,...t})}}class no extends tG{retrieve(e,t){return this._client.get(`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",na,e)}del(e,t){return this._client.delete(`/models/${e}`,t)}}class na extends tJ{}no.ModelsPage=na;class ni extends tG{create(e,t,n){return this._client.getAPIList(`/fine_tuning/checkpoints/${e}/permissions`,nl,{body:t,method:"post",...n})}retrieve(e,t={},n){return tj(t)?this.retrieve(e,{},t):this._client.get(`/fine_tuning/checkpoints/${e}/permissions`,{query:t,...n})}del(e,t){return this._client.delete(`/fine_tuning/checkpoints/${e}/permissions`,t)}}class nl extends tJ{}ni.PermissionCreateResponsesPage=nl;class ns extends tG{constructor(){super(...arguments),this.permissions=new ni(this._client)}}ns.Permissions=ni,ns.PermissionCreateResponsesPage=nl;class nc extends tG{list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/checkpoints`,nu,{query:t,...n})}}class nu extends t0{}nc.FineTuningJobCheckpointsPage=nu;class nd extends tG{constructor(){super(...arguments),this.checkpoints=new nc(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(`/fine_tuning/jobs/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/fine_tuning/jobs",nf,{query:e,...t})}cancel(e,t){return this._client.post(`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},n){return tj(t)?this.listEvents(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/events`,np,{query:t,...n})}}class nf extends t0{}class np extends t0{}nd.FineTuningJobsPage=nf,nd.FineTuningJobEventsPage=np,nd.Checkpoints=nc,nd.FineTuningJobCheckpointsPage=nu;class nh extends tG{constructor(){super(...arguments),this.jobs=new nd(this._client),this.checkpoints=new ns(this._client)}}nh.Jobs=nd,nh.FineTuningJobsPage=nf,nh.FineTuningJobEventsPage=np,nh.Checkpoints=ns;let nm=async e=>{let t=await Promise.allSettled(e),n=t.filter(e=>"rejected"===e.status);if(n.length){for(let e of n)console.error(e.reason);throw Error(`${n.length} promise(s) failed - see the above errors`)}let r=[];for(let e of t)"fulfilled"===e.status&&r.push(e.value);return r};class ng extends tG{create(e,t,n){return this._client.post(`/vector_stores/${e}/files`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,t,n,r){return this._client.post(`/vector_stores/${e}/files/${t}`,{body:n,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/vector_stores/${e}/files`,nv,{query:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,t,n){return this._client.delete(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){let r=await this.create(e,t,n);return await this.poll(e,r.id,n)}async poll(e,t,n){let r={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(r["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){let o=await this.retrieve(e,t,{...n,headers:r}).withResponse(),a=o.data;switch(a.status){case"in_progress":let i=5e3;if(n?.pollIntervalMs)i=n.pollIntervalMs;else{let e=o.response.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(i=t)}}await tR(i);break;case"failed":case"completed":return a}}}async upload(e,t,n){let r=await this._client.files.create({file:t,purpose:"assistants"},n);return this.create(e,{file_id:r.id},n)}async uploadAndPoll(e,t,n){let r=await this.upload(e,t,n);return await this.poll(e,r.id,n)}content(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/files/${t}/content`,ny,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class nv extends t0{}class ny extends tJ{}ng.VectorStoreFilesPage=nv,ng.FileContentResponsesPage=ny;class nb extends tG{create(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/file_batches/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}cancel(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches/${t}/cancel`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){let r=await this.create(e,t);return await this.poll(e,r.id,n)}listFiles(e,t,n={},r){return tj(n)?this.listFiles(e,t,{},n):this._client.getAPIList(`/vector_stores/${e}/file_batches/${t}/files`,nv,{query:n,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}async poll(e,t,n){let r={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(r["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){let{data:o,response:a}=await this.retrieve(e,t,{...n,headers:r}).withResponse();switch(o.status){case"in_progress":let i=5e3;if(n?.pollIntervalMs)i=n.pollIntervalMs;else{let e=a.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(i=t)}}await tR(i);break;case"failed":case"cancelled":case"completed":return o}}}async uploadAndPoll(e,{files:t,fileIds:n=[]},r){if(null==t||0==t.length)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let o=Math.min(r?.maxConcurrency??5,t.length),a=this._client,i=t.values(),l=[...n];async function s(e){for(let t of e){let e=await a.files.create({file:t,purpose:"assistants"},r);l.push(e.id)}}let c=Array(o).fill(i).map(s);return await nm(c),await this.createAndPoll(e,{file_ids:l})}}class nx extends tG{constructor(){super(...arguments),this.files=new ng(this._client),this.fileBatches=new nb(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/vector_stores/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/vector_stores",nw,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}search(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/search`,nk,{body:t,method:"post",...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class nw extends t0{}class nk extends tJ{}nx.VectorStoresPage=nw,nx.VectorStoreSearchResponsesPage=nk,nx.Files=ng,nx.VectorStoreFilesPage=nv,nx.FileContentResponsesPage=ny,nx.FileBatches=nb;class nS extends tG{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/assistants/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/assistants",nE,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class nE extends t0{}function nO(e){return"function"==typeof e.parse}nS.AssistantsPage=nE;let nC=e=>e?.role==="assistant",nj=e=>e?.role==="function",n_=e=>e?.role==="tool";var nP=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},nN=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nT{constructor(){$.add(this),this.controller=new AbortController,V.set(this,void 0),X.set(this,()=>{}),G.set(this,()=>{}),Y.set(this,void 0),Q.set(this,()=>{}),J.set(this,()=>{}),ee.set(this,{}),et.set(this,!1),en.set(this,!1),er.set(this,!1),eo.set(this,!1),nP(this,V,new Promise((e,t)=>{nP(this,X,e,"f"),nP(this,G,t,"f")}),"f"),nP(this,Y,new Promise((e,t)=>{nP(this,Q,e,"f"),nP(this,J,t,"f")}),"f"),nN(this,V,"f").catch(()=>{}),nN(this,Y,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},nN(this,$,"m",ea).bind(this))},0)}_connected(){this.ended||(nN(this,X,"f").call(this),this._emit("connect"))}get ended(){return nN(this,et,"f")}get errored(){return nN(this,en,"f")}get aborted(){return nN(this,er,"f")}abort(){this.controller.abort()}on(e,t){return(nN(this,ee,"f")[e]||(nN(this,ee,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=nN(this,ee,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(nN(this,ee,"f")[e]||(nN(this,ee,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{nP(this,eo,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){nP(this,eo,!0,"f"),await nN(this,Y,"f")}_emit(e,...t){if(nN(this,et,"f"))return;"end"===e&&(nP(this,et,!0,"f"),nN(this,Q,"f").call(this));let n=nN(this,ee,"f")[e];if(n&&(nN(this,ee,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];nN(this,eo,"f")||n?.length||Promise.reject(e),nN(this,G,"f").call(this,e),nN(this,J,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];nN(this,eo,"f")||n?.length||Promise.reject(e),nN(this,G,"f").call(this,e),nN(this,J,"f").call(this,e),this._emit("end")}}_emitFinal(){}}function nA(e){return e?.$brand==="auto-parseable-response-format"}function nM(e){return e?.$brand==="auto-parseable-tool"}function nI(e,t){let n=e.choices.map(e=>{var n;if("length"===e.finish_reason)throw new q;if("content_filter"===e.finish_reason)throw new W;return{...e,message:{...e.message,...e.message.tool_calls?{tool_calls:e.message.tool_calls?.map(e=>(function(e,t){let n=e.tools?.find(e=>e.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:nM(n)?n.$parseRaw(t.function.arguments):n?.function.strict?JSON.parse(t.function.arguments):null}}})(t,e))??void 0}:void 0,parsed:e.message.content&&!e.message.refusal?(n=e.message.content,t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(n):JSON.parse(n):null):null}}});return{...e,choices:n}}function nR(e){return!!nA(e.response_format)||(e.tools?.some(e=>nM(e)||"function"===e.type&&!0===e.function.strict)??!1)}V=new WeakMap,X=new WeakMap,G=new WeakMap,Y=new WeakMap,Q=new WeakMap,J=new WeakMap,ee=new WeakMap,et=new WeakMap,en=new WeakMap,er=new WeakMap,eo=new WeakMap,$=new WeakSet,ea=function(e){if(nP(this,en,!0,"f"),e instanceof Error&&"AbortError"===e.name&&(e=new A),e instanceof A)return nP(this,er,!0,"f"),this._emit("abort",e);if(e instanceof N)return this._emit("error",e);if(e instanceof Error){let t=new N(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new N(String(e)))};var nD=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nL extends nT{constructor(){super(...arguments),ei.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let t=e.choices[0]?.message;return t&&this._addMessage(t),e}_addMessage(e,t=!0){if("content"in e||(e.content=null),this.messages.push(e),t){if(this._emit("message",e),(nj(e)||n_(e))&&e.content)this._emit("functionCallResult",e.content);else if(nC(e)&&e.function_call)this._emit("functionCall",e.function_call);else if(nC(e)&&e.tool_calls)for(let t of e.tool_calls)"function"===t.type&&this._emit("functionCall",t.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new N("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),nD(this,ei,"m",el).call(this)}async finalMessage(){return await this.done(),nD(this,ei,"m",es).call(this)}async finalFunctionCall(){return await this.done(),nD(this,ei,"m",ec).call(this)}async finalFunctionCallResult(){return await this.done(),nD(this,ei,"m",eu).call(this)}async totalUsage(){return await this.done(),nD(this,ei,"m",ed).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let t=nD(this,ei,"m",es).call(this);t&&this._emit("finalMessage",t);let n=nD(this,ei,"m",el).call(this);n&&this._emit("finalContent",n);let r=nD(this,ei,"m",ec).call(this);r&&this._emit("finalFunctionCall",r);let o=nD(this,ei,"m",eu).call(this);null!=o&&this._emit("finalFunctionCallResult",o),this._chatCompletions.some(e=>e.usage)&&this._emit("totalUsage",nD(this,ei,"m",ed).call(this))}async _createChatCompletion(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nD(this,ei,"m",ef).call(this,t);let o=await e.chat.completions.create({...t,stream:!1},{...n,signal:this.controller.signal});return this._connected(),this._addChatCompletion(nI(o,t))}async _runChatCompletion(e,t,n){for(let e of t.messages)this._addMessage(e,!1);return await this._createChatCompletion(e,t,n)}async _runFunctions(e,t,n){let r="function",{function_call:o="auto",stream:a,...i}=t,l="string"!=typeof o&&o?.name,{maxChatCompletions:s=10}=n||{},c={};for(let e of t.functions)c[e.name||e.function.name]=e;let u=t.functions.map(e=>({name:e.name||e.function.name,parameters:e.parameters,description:e.description}));for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<s;++t){let t;let a=await this._createChatCompletion(e,{...i,function_call:o,functions:u,messages:[...this.messages]},n),s=a.choices[0]?.message;if(!s)throw new N("missing message in ChatCompletion response");if(!s.function_call)return;let{name:d,arguments:f}=s.function_call,p=c[d];if(p){if(l&&l!==d){let e=`Invalid function_call: ${JSON.stringify(d)}. ${JSON.stringify(l)} requested. Please try again`;this._addMessage({role:r,name:d,content:e});continue}}else{let e=`Invalid function_call: ${JSON.stringify(d)}. Available options are: ${u.map(e=>JSON.stringify(e.name)).join(", ")}. Please try again`;this._addMessage({role:r,name:d,content:e});continue}try{t=nO(p)?await p.parse(f):f}catch(e){this._addMessage({role:r,name:d,content:e instanceof Error?e.message:String(e)});continue}let h=await p.function(t,this),m=nD(this,ei,"m",ep).call(this,h);if(this._addMessage({role:r,name:d,content:m}),l)return}}async _runTools(e,t,n){let r="tool",{tool_choice:o="auto",stream:a,...i}=t,l="string"!=typeof o&&o?.function?.name,{maxChatCompletions:s=10}=n||{},c=t.tools.map(e=>{if(nM(e)){if(!e.$callback)throw new N("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:e.$callback,name:e.function.name,description:e.function.description||"",parameters:e.function.parameters,parse:e.$parseRaw,strict:!0}}}return e}),u={};for(let e of c)"function"===e.type&&(u[e.function.name||e.function.function.name]=e.function);let d="tools"in t?c.map(e=>"function"===e.type?{type:"function",function:{name:e.function.name||e.function.function.name,parameters:e.function.parameters,description:e.function.description,strict:e.function.strict}}:e):void 0;for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<s;++t){let t=await this._createChatCompletion(e,{...i,tool_choice:o,tools:d,messages:[...this.messages]},n),a=t.choices[0]?.message;if(!a)throw new N("missing message in ChatCompletion response");if(!a.tool_calls?.length)break;for(let e of a.tool_calls){let t;if("function"!==e.type)continue;let n=e.id,{name:o,arguments:a}=e.function,i=u[o];if(i){if(l&&l!==o){let e=`Invalid tool_call: ${JSON.stringify(o)}. ${JSON.stringify(l)} requested. Please try again`;this._addMessage({role:r,tool_call_id:n,content:e});continue}}else{let e=`Invalid tool_call: ${JSON.stringify(o)}. Available options are: ${Object.keys(u).map(e=>JSON.stringify(e)).join(", ")}. Please try again`;this._addMessage({role:r,tool_call_id:n,content:e});continue}try{t=nO(i)?await i.parse(a):a}catch(t){let e=t instanceof Error?t.message:String(t);this._addMessage({role:r,tool_call_id:n,content:e});continue}let s=await i.function(t,this),c=nD(this,ei,"m",ep).call(this,s);if(this._addMessage({role:r,tool_call_id:n,content:c}),l)return}}}}ei=new WeakSet,el=function(){return nD(this,ei,"m",es).call(this).content??null},es=function(){let e=this.messages.length;for(;e-- >0;){let t=this.messages[e];if(nC(t)){let{function_call:e,...n}=t,r={...n,content:t.content??null,refusal:t.refusal??null};return e&&(r.function_call=e),r}}throw new N("stream ended without producing a ChatCompletionMessage with role=assistant")},ec=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(nC(t)&&t?.function_call)return t.function_call;if(nC(t)&&t?.tool_calls?.length)return t.tool_calls.at(-1)?.function}},eu=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(nj(t)&&null!=t.content||n_(t)&&null!=t.content&&"string"==typeof t.content&&this.messages.some(e=>"assistant"===e.role&&e.tool_calls?.some(e=>"function"===e.type&&e.id===t.tool_call_id)))return t.content}},ed=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:t}of this._chatCompletions)t&&(e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens);return e},ef=function(e){if(null!=e.n&&e.n>1)throw new N("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},ep=function(e){return"string"==typeof e?e:void 0===e?"undefined":JSON.stringify(e)};class nZ extends nL{static runFunctions(e,t,n){let r=new nZ,o={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return r._run(()=>r._runFunctions(e,t,o)),r}static runTools(e,t,n){let r=new nZ,o={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(e,t,o)),r}_addMessage(e,t=!0){super._addMessage(e,t),nC(e)&&e.content&&this._emit("content",e.content)}}let nz={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,ALL:511};class nB extends Error{}class nF extends Error{}let nH=(e,t)=>{let n=e.length,r=0,o=e=>{throw new nB(`${e} at position ${r}`)},a=e=>{throw new nF(`${e} at position ${r}`)},i=()=>(d(),r>=n&&o("Unexpected end of input"),'"'===e[r])?l():"{"===e[r]?s():"["===e[r]?c():"null"===e.substring(r,r+4)||nz.NULL&t&&n-r<4&&"null".startsWith(e.substring(r))?(r+=4,null):"true"===e.substring(r,r+4)||nz.BOOL&t&&n-r<4&&"true".startsWith(e.substring(r))?(r+=4,!0):"false"===e.substring(r,r+5)||nz.BOOL&t&&n-r<5&&"false".startsWith(e.substring(r))?(r+=5,!1):"Infinity"===e.substring(r,r+8)||nz.INFINITY&t&&n-r<8&&"Infinity".startsWith(e.substring(r))?(r+=8,1/0):"-Infinity"===e.substring(r,r+9)||nz.MINUS_INFINITY&t&&1<n-r&&n-r<9&&"-Infinity".startsWith(e.substring(r))?(r+=9,-1/0):"NaN"===e.substring(r,r+3)||nz.NAN&t&&n-r<3&&"NaN".startsWith(e.substring(r))?(r+=3,NaN):u(),l=()=>{let i=r,l=!1;for(r++;r<n&&('"'!==e[r]||l&&"\\"===e[r-1]);)l="\\"===e[r]&&!l,r++;if('"'==e.charAt(r))try{return JSON.parse(e.substring(i,++r-Number(l)))}catch(e){a(String(e))}else if(nz.STR&t)try{return JSON.parse(e.substring(i,r-Number(l))+'"')}catch(t){return JSON.parse(e.substring(i,e.lastIndexOf("\\"))+'"')}o("Unterminated string literal")},s=()=>{r++,d();let a={};try{for(;"}"!==e[r];){if(d(),r>=n&&nz.OBJ&t)return a;let o=l();d(),r++;try{let e=i();Object.defineProperty(a,o,{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){if(nz.OBJ&t)return a;throw e}d(),","===e[r]&&r++}}catch(e){if(nz.OBJ&t)return a;o("Expected '}' at end of object")}return r++,a},c=()=>{r++;let n=[];try{for(;"]"!==e[r];)n.push(i()),d(),","===e[r]&&r++}catch(e){if(nz.ARR&t)return n;o("Expected ']' at end of array")}return r++,n},u=()=>{if(0===r){"-"===e&&nz.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e)}catch(n){if(nz.NUM&t)try{if("."===e[e.length-1])return JSON.parse(e.substring(0,e.lastIndexOf(".")));return JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch(e){}a(String(n))}}let i=r;for("-"===e[r]&&r++;e[r]&&!",]}".includes(e[r]);)r++;r!=n||nz.NUM&t||o("Unterminated number literal");try{return JSON.parse(e.substring(i,r))}catch(n){"-"===e.substring(i,r)&&nz.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e.substring(i,e.lastIndexOf("e")))}catch(e){a(String(e))}}},d=()=>{for(;r<n&&" \n\r ".includes(e[r]);)r++};return i()},nq=e=>(function(e,t=nz.ALL){if("string"!=typeof e)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return nH(e.trim(),t)})(e,nz.ALL^nz.NUM);var nW=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},nU=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nK extends nL{constructor(e){super(),eh.add(this),em.set(this,void 0),eg.set(this,void 0),ev.set(this,void 0),nW(this,em,e,"f"),nW(this,eg,[],"f")}get currentChatCompletionSnapshot(){return nU(this,ev,"f")}static fromReadableStream(e){let t=new nK(null);return t._run(()=>t._fromReadableStream(e)),t}static createChatCompletion(e,t,n){let r=new nK(t);return r._run(()=>r._runChatCompletion(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createChatCompletion(e,t,n){super._createChatCompletion;let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nU(this,eh,"m",ey).call(this);let o=await e.chat.completions.create({...t,stream:!0},{...n,signal:this.controller.signal});for await(let e of(this._connected(),o))nU(this,eh,"m",ex).call(this,e);if(o.controller.signal?.aborted)throw new A;return this._addChatCompletion(nU(this,eh,"m",eS).call(this))}async _fromReadableStream(e,t){let n;let r=t?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nU(this,eh,"m",ey).call(this),this._connected();let o=e8.fromReadableStream(e,this.controller);for await(let e of o)n&&n!==e.id&&this._addChatCompletion(nU(this,eh,"m",eS).call(this)),nU(this,eh,"m",ex).call(this,e),n=e.id;if(o.controller.signal?.aborted)throw new A;return this._addChatCompletion(nU(this,eh,"m",eS).call(this))}[(em=new WeakMap,eg=new WeakMap,ev=new WeakMap,eh=new WeakSet,ey=function(){this.ended||nW(this,ev,void 0,"f")},eb=function(e){let t=nU(this,eg,"f")[e.index];return t||(t={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},nU(this,eg,"f")[e.index]=t),t},ex=function(e){if(this.ended)return;let t=nU(this,eh,"m",eO).call(this,e);for(let n of(this._emit("chunk",e,t),e.choices)){let e=t.choices[n.index];null!=n.delta.content&&e.message?.role==="assistant"&&e.message?.content&&(this._emit("content",n.delta.content,e.message.content),this._emit("content.delta",{delta:n.delta.content,snapshot:e.message.content,parsed:e.message.parsed})),null!=n.delta.refusal&&e.message?.role==="assistant"&&e.message?.refusal&&this._emit("refusal.delta",{delta:n.delta.refusal,snapshot:e.message.refusal}),n.logprobs?.content!=null&&e.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:n.logprobs?.content,snapshot:e.logprobs?.content??[]}),n.logprobs?.refusal!=null&&e.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:n.logprobs?.refusal,snapshot:e.logprobs?.refusal??[]});let r=nU(this,eh,"m",eb).call(this,e);for(let t of(e.finish_reason&&(nU(this,eh,"m",ek).call(this,e),null!=r.current_tool_call_index&&nU(this,eh,"m",ew).call(this,e,r.current_tool_call_index)),n.delta.tool_calls??[]))r.current_tool_call_index!==t.index&&(nU(this,eh,"m",ek).call(this,e),null!=r.current_tool_call_index&&nU(this,eh,"m",ew).call(this,e,r.current_tool_call_index)),r.current_tool_call_index=t.index;for(let t of n.delta.tool_calls??[]){let n=e.message.tool_calls?.[t.index];n?.type&&(n?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:n.function?.name,index:t.index,arguments:n.function.arguments,parsed_arguments:n.function.parsed_arguments,arguments_delta:t.function?.arguments??""}):n?.type)}}},ew=function(e,t){if(nU(this,eh,"m",eb).call(this,e).done_tool_calls.has(t))return;let n=e.message.tool_calls?.[t];if(!n)throw Error("no tool call snapshot");if(!n.type)throw Error("tool call snapshot missing `type`");if("function"===n.type){let e=nU(this,em,"f")?.tools?.find(e=>"function"===e.type&&e.function.name===n.function.name);this._emit("tool_calls.function.arguments.done",{name:n.function.name,index:t,arguments:n.function.arguments,parsed_arguments:nM(e)?e.$parseRaw(n.function.arguments):e?.function.strict?JSON.parse(n.function.arguments):null})}else n.type},ek=function(e){let t=nU(this,eh,"m",eb).call(this,e);if(e.message.content&&!t.content_done){t.content_done=!0;let n=nU(this,eh,"m",eE).call(this);this._emit("content.done",{content:e.message.content,parsed:n?n.$parseRaw(e.message.content):null})}e.message.refusal&&!t.refusal_done&&(t.refusal_done=!0,this._emit("refusal.done",{refusal:e.message.refusal})),e.logprobs?.content&&!t.logprobs_content_done&&(t.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:e.logprobs.content})),e.logprobs?.refusal&&!t.logprobs_refusal_done&&(t.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:e.logprobs.refusal}))},eS=function(){if(this.ended)throw new N("stream has ended, this shouldn't happen");let e=nU(this,ev,"f");if(!e)throw new N("request ended without sending any chunks");return nW(this,ev,void 0,"f"),nW(this,eg,[],"f"),function(e,t){var n;let{id:r,choices:o,created:a,model:i,system_fingerprint:l,...s}=e;return n={...s,id:r,choices:o.map(({message:t,finish_reason:n,index:r,logprobs:o,...a})=>{if(!n)throw new N(`missing finish_reason for choice ${r}`);let{content:i=null,function_call:l,tool_calls:s,...c}=t,u=t.role;if(!u)throw new N(`missing role for choice ${r}`);if(l){let{arguments:e,name:s}=l;if(null==e)throw new N(`missing function_call.arguments for choice ${r}`);if(!s)throw new N(`missing function_call.name for choice ${r}`);return{...a,message:{content:i,function_call:{arguments:e,name:s},role:u,refusal:t.refusal??null},finish_reason:n,index:r,logprobs:o}}return s?{...a,index:r,finish_reason:n,logprobs:o,message:{...c,role:u,content:i,refusal:t.refusal??null,tool_calls:s.map((t,n)=>{let{function:o,type:a,id:i,...l}=t,{arguments:s,name:c,...u}=o||{};if(null==i)throw new N(`missing choices[${r}].tool_calls[${n}].id${n$(e)}`);if(null==a)throw new N(`missing choices[${r}].tool_calls[${n}].type${n$(e)}`);if(null==c)throw new N(`missing choices[${r}].tool_calls[${n}].function.name${n$(e)}`);if(null==s)throw new N(`missing choices[${r}].tool_calls[${n}].function.argumentsdiff --git a/ui/litellm-dashboard/out/_next/static/chunks/338-58247f2bc5fc3b51.js b/litellm/proxy/_experimental/out/_next/static/chunks/338-5db4fbaf3c5da53d.jssimilarity index 62%rename from ui/litellm-dashboard/out/_next/static/chunks/338-58247f2bc5fc3b51.jsrename to litellm/proxy/_experimental/out/_next/static/chunks/338-5db4fbaf3c5da53d.jsindex 2ff3fe44f14..81d117294fd 100644--- a/ui/litellm-dashboard/out/_next/static/chunks/338-58247f2bc5fc3b51.js+++ b/litellm/proxy/_experimental/out/_next/static/chunks/338-5db4fbaf3c5da53d.js@@ -1 +1 @@-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[338],{19250:function(e,t,o){o.r(t),o.d(t,{DEFAULT_ORGANIZATION:function(){return d},PredictedSpendLogsCall:function(){return e9},addAllowedIP:function(){return es},adminGlobalActivity:function(){return eb},adminGlobalActivityExceptions:function(){return eP},adminGlobalActivityExceptionsPerDeployment:function(){return ex},adminGlobalActivityPerModel:function(){return eF},adminGlobalCacheActivity:function(){return eN},adminSpendLogsCall:function(){return eE},adminTopEndUsersCall:function(){return eS},adminTopKeysCall:function(){return ej},adminTopModelsCall:function(){return eO},adminspendByProvider:function(){return ev},alertingSettingsCall:function(){return N},allEndUsersCall:function(){return ek},allTagNamesCall:function(){return em},availableTeamListCall:function(){return M},budgetCreateCall:function(){return j},budgetDeleteCall:function(){return E},budgetUpdateCall:function(){return S},cachingHealthCheckCall:function(){return tw},callMCPTool:function(){return tF},claimOnboardingToken:function(){return X},createGuardrailCall:function(){return tk},createMCPServer:function(){return tS},createPassThroughEndpoint:function(){return ts},credentialCreateCall:function(){return eV},credentialDeleteCall:function(){return eq},credentialGetCall:function(){return eH},credentialListCall:function(){return eD},credentialUpdateCall:function(){return eZ},defaultProxyBaseUrl:function(){return r},deleteAllowedIP:function(){return el},deleteCallback:function(){return t5},deleteConfigFieldSetting:function(){return ti},deleteGuardrailCall:function(){return tK},deleteMCPServer:function(){return tb},deletePassThroughEndpointsCall:function(){return td},fetchMCPAccessGroups:function(){return tj},fetchMCPServers:function(){return tE},getAllowedIPs:function(){return ec},getBudgetList:function(){return te},getBudgetSettings:function(){return tt},getCallbacksCall:function(){return to},getConfigFieldSetting:function(){return tn},getDefaultTeamSettings:function(){return tJ},getEmailEventSettings:function(){return tH},getGeneralSettingsCall:function(){return ta},getGuardrailInfo:function(){return tQ},getGuardrailProviderSpecificParams:function(){return tW},getGuardrailUISettings:function(){return tY},getGuardrailsList:function(){return tm},getInternalUserSettings:function(){return t_},getOnboardingCredentials:function(){return Q},getOpenAPISchema:function(){return m},getPassThroughEndpointInfo:function(){return t4},getPassThroughEndpointsCall:function(){return tr},getPossibleUserRoles:function(){return ez},getProxyBaseUrl:function(){return l},getProxyUISettings:function(){return ty},getPublicModelHubInfo:function(){return y},getRemainingUsers:function(){return t2},getSSOSettings:function(){return t$},getTeamPermissionsCall:function(){return tA},getTotalSpendCall:function(){return W},getUiConfig:function(){return f},healthCheckCall:function(){return tp},healthCheckHistoryCall:function(){return tg},individualModelHealthCheckCall:function(){return tu},invitationClaimCall:function(){return b},invitationCreateCall:function(){return v},keyCreateCall:function(){return P},keyCreateServiceAccountCall:function(){return F},keyDeleteCall:function(){return O},keyInfoCall:function(){return eB},keyInfoV1Call:function(){return eJ},keyListCall:function(){return eU},keySpendLogsCall:function(){return eg},keyUpdateCall:function(){return eK},latestHealthChecksCall:function(){return tf},listMCPTools:function(){return tN},makeModelGroupPublic:function(){return g},mcpToolsCall:function(){return t6},modelAvailableCall:function(){return ew},modelCostMap:function(){return k},modelCreateCall:function(){return C},modelDeleteCall:function(){return T},modelExceptionsCall:function(){return ep},modelHubCall:function(){return en},modelHubPublicModelsCall:function(){return er},modelInfoCall:function(){return eo},modelInfoV1Call:function(){return ea},modelMetricsCall:function(){return ei},modelMetricsSlowResponsesCall:function(){return eh},modelPatchUpdateCall:function(){return eW},modelSettingsCall:function(){return _},modelUpdateCall:function(){return eQ},organizationCreateCall:function(){return V},organizationDeleteCall:function(){return H},organizationInfoCall:function(){return L},organizationListCall:function(){return z},organizationMemberAddCall:function(){return e2},organizationMemberDeleteCall:function(){return e3},organizationMemberUpdateCall:function(){return e4},organizationUpdateCall:function(){return D},proxyBaseUrl:function(){return c},regenerateKeyCall:function(){return $},resetEmailEventSettings:function(){return tZ},serverRootPath:function(){return n},serviceHealthCheck:function(){return e8},sessionSpendLogsCall:function(){return tR},setCallbacksCall:function(){return th},setGlobalLitellmHeaderName:function(){return w},slackBudgetAlertsHealthCheck:function(){return e7},spendUsersCall:function(){return eA},streamingModelMetricsCall:function(){return ed},tagCreateCall:function(){return tP},tagDailyActivityCall:function(){return K},tagDeleteCall:function(){return tG},tagInfoCall:function(){return tO},tagListCall:function(){return tB},tagUpdateCall:function(){return tx},tagsSpendLogsCall:function(){return ey},teamBulkMemberAddCall:function(){return e$},teamCreateCall:function(){return eL},teamDailyActivityCall:function(){return Y},teamDeleteCall:function(){return G},teamInfoCall:function(){return A},teamListCall:function(){return R},teamMemberAddCall:function(){return eX},teamMemberDeleteCall:function(){return e1},teamMemberUpdateCall:function(){return e0},teamPermissionsUpdateCall:function(){return tI},teamSpendLogsCall:function(){return ef},teamUpdateCall:function(){return eY},testConnectionRequest:function(){return eG},testMCPConnectionRequest:function(){return t9},testMCPToolsListRequest:function(){return t7},transformRequestCall:function(){return q},uiAuditLogsCall:function(){return t1},uiSpendLogDetailsCall:function(){return tC},uiSpendLogsCall:function(){return eT},updateConfigFieldSetting:function(){return tl},updateDefaultTeamSettings:function(){return tU},updateEmailEventSettings:function(){return tq},updateGuardrailCall:function(){return tX},updateInternalUserSettings:function(){return tT},updateMCPServer:function(){return tv},updatePassThroughEndpoint:function(){return t3},updatePassThroughFieldSetting:function(){return tc},updateSSOSettings:function(){return t0},updateUsefulLinksCall:function(){return eu},userBulkUpdateUserCall:function(){return e6},userCreateCall:function(){return x},userDailyActivityCall:function(){return Z},userDeleteCall:function(){return B},userFilterUICall:function(){return eC},userGetAllUsersCall:function(){return eM},userGetRequesedtModelsCall:function(){return eR},userInfoCall:function(){return U},userListCall:function(){return J},userRequestModelCall:function(){return eI},userSpendLogsCall:function(){return e_},userUpdateUserCall:function(){return e5},v2TeamListCall:function(){return I},vectorStoreCreateCall:function(){return tM},vectorStoreDeleteCall:function(){return tL},vectorStoreInfoCall:function(){return tV},vectorStoreListCall:function(){return tz},vectorStoreSearchCall:function(){return t8},vectorStoreUpdateCall:function(){return tD}});var a=o(41021);let r=null,n="/",c=null;console.log=function(){};let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=window.location.origin,a=t||o;console.log("proxyBaseUrl:",c),console.log("serverRootPath:",e),e.length>0&&!a.endsWith(e)&&"/"!=e&&(a+=e,c=a),console.log("Updated proxyBaseUrl:",c)},l=()=>c||window.location.origin,i={GET:"GET",DELETE:"DELETE"},d="default_organization",h=0,p=async e=>{let t=Date.now();t-h>6e4?(e.includes("Authentication Error - Expired Key")&&(a.ZP.info("UI Session Expired. Logging out."),h=t,document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",window.location.href=window.location.pathname),h=t):console.log("Error suppressed to prevent spam:",e)},u="Authorization";function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authorization";console.log("setGlobalLitellmHeaderName: ".concat(e)),u=e}let g=async(e,t)=>{let o=c?"".concat(c,"/model_group/make_public"):"/model_group/make_public";return(await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},f=async()=>{console.log("Getting UI config");let e=await fetch(r?"".concat(r,"/litellm/.well-known/litellm-ui-config"):"/litellm/.well-known/litellm-ui-config"),t=await e.json();return console.log("jsonData in getUiConfig:",t),s(t.server_root_path,t.proxy_base_url),t},y=async()=>{let e=await fetch(r?"".concat(r,"/public/model_hub/info"):"/public/model_hub/info");return await e.json()},m=async()=>{let e=c?"".concat(c,"/openapi.json"):"/openapi.json",t=await fetch(e);return await t.json()},k=async e=>{try{let t=c?"".concat(c,"/get/litellm_model_cost_map"):"/get/litellm_model_cost_map",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("received litellm model cost data: ".concat(a)),a}catch(e){throw console.error("Failed to get model cost map:",e),e}},C=async(e,t)=>{try{let o=c?"".concat(c,"/model/new"):"/model/new",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text()||"Network response was not ok";throw a.ZP.error(e),Error(e)}let n=await r.json();return console.log("API Response:",n),a.ZP.destroy(),a.ZP.success("Model ".concat(t.model_name," created successfully"),2),n}catch(e){throw console.error("Failed to create key:",e),e}},_=async e=>{try{let t=c?"".concat(c,"/model/settings"):"/model/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){console.error("Failed to get model settings:",e)}},T=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=c?"".concat(c,"/model/delete"):"/model/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},E=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=c?"".concat(c,"/budget/delete"):"/budget/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},j=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/budget/new"):"/budget/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},S=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/budget/update"):"/budget/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},v=async(e,t)=>{try{let o=c?"".concat(c,"/invitation/new"):"/invitation/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},b=async(e,t)=>{try{console.log("Form Values in invitationCreateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/invitation/claim"):"/invitation/claim",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},N=async e=>{try{let t=c?"".concat(c,"/alerting/settings"):"/alerting/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},F=async(e,t)=>{try{if(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",t);let o=c?"".concat(c,"/key/service-account/generate"):"/key/service-account/generate",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},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 Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=c?"".concat(c,"/key/generate"):"/key/generate",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},x=async(e,t,o)=>{try{if(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),o.auto_create_key=!1,o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=c?"".concat(c,"/user/new"):"/user/new",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},O=async(e,t)=>{try{let o=c?"".concat(c,"/key/delete"):"/key/delete";console.log("in keyDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},B=async(e,t)=>{try{let o=c?"".concat(c,"/user/delete"):"/user/delete";console.log("in userDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_ids:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete user(s):",e),e}},G=async(e,t)=>{try{let o=c?"".concat(c,"/team/delete"):"/team/delete";console.log("in teamDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},J=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let h=c?"".concat(c,"/user/list"):"/user/list";console.log("in userListCall");let w=new URLSearchParams;if(t&&t.length>0){let e=t.join(",");w.append("user_ids",e)}o&&w.append("page",o.toString()),a&&w.append("page_size",a.toString()),r&&w.append("user_email",r),n&&w.append("role",n),s&&w.append("team",s),l&&w.append("sso_user_ids",l),i&&w.append("sort_by",i),d&&w.append("sort_order",d);let g=w.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw p(e),Error("Network response was not ok")}let y=await f.json();return console.log("/user/list API Response:",y),y}catch(e){throw console.error("Failed to create key:",e),e}},U=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];console.log("userInfoCall: ".concat(t,", ").concat(o,", ").concat(a,", ").concat(r,", ").concat(n,", ").concat(s));try{let l;if(a){l=c?"".concat(c,"/user/list"):"/user/list";let e=new URLSearchParams;null!=r&&e.append("page",r.toString()),null!=n&&e.append("page_size",n.toString()),l+="?".concat(e.toString())}else l=c?"".concat(c,"/user/info"):"/user/info",("Admin"!==o&&"Admin Viewer"!==o||s)&&t&&(l+="?user_id=".concat(t));console.log("Requesting user data from:",l);let i=await fetch(l,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("API Response:",d),d}catch(e){throw console.error("Failed to fetch user data:",e),e}},A=async(e,t)=>{try{let o=c?"".concat(c,"/team/info"):"/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},I=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6],arguments.length>7&&void 0!==arguments[7]&&arguments[7],arguments.length>8&&void 0!==arguments[8]&&arguments[8];try{let n=c?"".concat(c,"/v2/team/list"):"/v2/team/list";console.log("in teamInfoCall");let s=new URLSearchParams;o&&s.append("user_id",o.toString()),t&&s.append("organization_id",t.toString()),a&&s.append("team_id",a.toString()),r&&s.append("team_alias",r.toString());let l=s.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("/v2/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},R=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/team/list"):"/team/list";console.log("in teamInfoCall");let s=new URLSearchParams;o&&s.append("user_id",o.toString()),t&&s.append("organization_id",t.toString()),a&&s.append("team_id",a.toString()),r&&s.append("team_alias",r.toString());let l=s.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},M=async e=>{try{let t=c?"".concat(c,"/team/available"):"/team/available";console.log("in availableTeamListCall");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("/team/available_teams API Response:",a),a}catch(e){throw e}},z=async e=>{try{let t=c?"".concat(c,"/organization/list"):"/organization/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},L=async(e,t)=>{try{let o=c?"".concat(c,"/organization/info"):"/organization/info";t&&(o="".concat(o,"?organization_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/organization/new"):"/organization/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},D=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let o=c?"".concat(c,"/organization/update"):"/organization/update",a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},H=async(e,t)=>{try{let o=c?"".concat(c,"/organization/delete"):"/organization/delete",a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Error deleting organization: ".concat(e))}return await a.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},q=async(e,t)=>{try{let o=c?"".concat(c,"/utils/transform_request"):"/utils/transform_request",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},Z=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;try{let r=c?"".concat(c,"/user/daily/activity"):"/user/daily/activity",n=new URLSearchParams,s=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",s(t)),n.append("end_date",s(o)),n.append("page_size","1000"),n.append("page",a.toString());let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}return await i.json()}catch(e){throw console.error("Failed to create key:",e),e}},K=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/tag/daily/activity"):"/tag/daily/activity",s=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};s.append("start_date",l(t)),s.append("end_date",l(o)),s.append("page_size","1000"),s.append("page",a.toString()),r&&s.append("tags",r.join(","));let i=s.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw p(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},Y=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/team/daily/activity"):"/team/daily/activity",s=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};s.append("start_date",l(t)),s.append("end_date",l(o)),s.append("page_size","1000"),s.append("page",a.toString()),r&&s.append("team_ids",r.join(",")),s.append("exclude_team_ids","litellm-dashboard");let i=s.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw p(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},W=async e=>{try{let t=c?"".concat(c,"/global/spend"):"/global/spend",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},Q=async e=>{try{let t=c?"".concat(c,"/onboarding/get_token"):"/onboarding/get_token";t+="?invite_link=".concat(e);let o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},X=async(e,t,o,a)=>{let r=c?"".concat(c,"/onboarding/claim_token"):"/onboarding/claim_token";try{let n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({invitation_link:t,user_id:o,password:a})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to delete key:",e),e}},$=async(e,t,o)=>{try{let a=c?"".concat(c,"/key/").concat(t,"/regenerate"):"/key/".concat(t,"/regenerate"),r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Regenerate key Response:",n),n}catch(e){throw console.error("Failed to regenerate key:",e),e}},ee=!1,et=null,eo=async(e,t,o)=>{try{console.log("modelInfoCall:",e,t,o);let r=c?"".concat(c,"/v2/model/info"):"/v2/model/info",n=new URLSearchParams;n.append("include_team_models","true"),n.toString()&&(r+="?".concat(n.toString()));let s=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw e+="error shown=".concat(ee),ee||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),a.ZP.info(e,10),ee=!0,et&&clearTimeout(et),et=setTimeout(()=>{ee=!1},1e4)),Error("Network response was not ok")}let l=await s.json();return console.log("modelInfoCall:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},ea=async(e,t)=>{try{let o=c?"".concat(c,"/v1/model/info"):"/v1/model/info";o+="?litellm_model_id=".concat(t);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let r=await a.json();return console.log("modelInfoV1Call:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},er=async()=>{let e=c?"".concat(c,"/public/model_hub"):"/public/model_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},en=async e=>{try{let t=c?"".concat(c,"/model_group/info"):"/model_group/info",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("modelHubCall:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},ec=async e=>{try{let t=c?"".concat(c,"/get/allowed_ips"):"/get/allowed_ips",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw Error("Network response was not ok: ".concat(e))}let a=await o.json();return console.log("getAllowedIPs:",a),a.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},es=async(e,t)=>{try{let o=c?"".concat(c,"/add/allowed_ip"):"/add/allowed_ip",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},el=async(e,t)=>{try{let o=c?"".concat(c,"/delete/allowed_ip"):"/delete/allowed_ip",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},ei=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics"):"/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ed=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/model/streaming_metrics"):"/model/streaming_metrics";t&&(r="".concat(r,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let n=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},eh=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics/slow_responses"):"/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ep=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics/exceptions"):"/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eu=async(e,t)=>{try{let o=c?"".concat(c,"/model_hub/update_useful_links"):"/model_hub/update_useful_links",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({useful_links:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},ew=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6]);console.log("in /models calls, globalLitellmHeaderName",u);try{let t=c?"".concat(c,"/models"):"/models",o=new URLSearchParams;o.append("include_model_access_groups","True"),!0===a&&o.append("return_wildcard_routes","True"),!0===n&&o.append("only_model_access_groups","True"),r&&o.append("team_id",r.toString()),o.toString()&&(t+="?".concat(o.toString()));let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to create key:",e),e}},eg=async(e,t)=>{try{let o=c?"".concat(c,"/global/spend/logs"):"/global/spend/logs";console.log("in keySpendLogsCall:",o);let a=await fetch("".concat(o,"?api_key=").concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},ef=async e=>{try{let t=c?"".concat(c,"/global/spend/teams"):"/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ey=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/tags"):"/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),a&&(r+="".concat(r,"&tags=").concat(a.join(","))),console.log("in tagsSpendLogsCall:",r);let n=await fetch("".concat(r),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});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 create key:",e),e}},em=async e=>{try{let t=c?"".concat(c,"/global/spend/all_tag_names"):"/global/spend/all_tag_names";console.log("in global/spend/all_tag_names call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ek=async e=>{try{let t=c?"".concat(c,"/global/all_end_users"):"/global/all_end_users";console.log("in global/all_end_users call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eC=async(e,t)=>{try{let o=c?"".concat(c,"/user/filter/ui"):"/user/filter/ui";t.get("user_email")&&(o+="?user_email=".concat(t.get("user_email"))),t.get("user_id")&&(o+="?user_id=".concat(t.get("user_id")));let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},e_=async(e,t,o,a,r,n)=>{try{console.log("user role in spend logs call: ".concat(o));let t=c?"".concat(c,"/spend/logs"):"/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(r,"&end_date=").concat(n):"".concat(t,"?start_date=").concat(r,"&end_date=").concat(n);let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},eT=async(e,t,o,a,r,n,s,l,i,d,h,w)=>{try{let g=c?"".concat(c,"/spend/logs/ui"):"/spend/logs/ui",f=new URLSearchParams;t&&f.append("api_key",t),o&&f.append("team_id",o),a&&f.append("request_id",a),r&&f.append("start_date",r),n&&f.append("end_date",n),s&&f.append("page",s.toString()),l&&f.append("page_size",l.toString()),i&&f.append("user_id",i),d&&f.append("end_user",d),h&&f.append("status_filter",h),w&&f.append("model",w);let y=f.toString();y&&(g+="?".concat(y));let m=await fetch(g,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!m.ok){let e=await m.text();throw p(e),Error("Network response was not ok")}let k=await m.json();return console.log("Spend Logs Response:",k),k}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eE=async e=>{try{let t=c?"".concat(c,"/global/spend/logs"):"/global/spend/logs",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ej=async e=>{try{let t=c?"".concat(c,"/global/spend/keys?limit=5"):"/global/spend/keys?limit=5",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eS=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/end_users"):"/global/spend/end_users",n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let s={method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n},l=await fetch(r,s);if(!l.ok){let e=await l.text();throw p(e),Error("Network response was not ok")}let i=await l.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/provider"):"/global/spend/provider";o&&a&&(r+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(r+="&api_key=".concat(t));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eb=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity"):"/global/activity";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eN=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity/cache_hits"):"/global/activity/cache_hits";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eF=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity/model"):"/global/activity/model";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eP=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/activity/exceptions"):"/global/activity/exceptions";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok)throw await s.text(),Error("Network response was not ok");let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},ex=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/activity/exceptions/deployment"):"/global/activity/exceptions/deployment";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok)throw await s.text(),Error("Network response was not ok");let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eO=async e=>{try{let t=c?"".concat(c,"/global/spend/models?limit=5"):"/global/spend/models?limit=5",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eB=async(e,t)=>{try{let o=c?"".concat(c,"/v2/key/info"):"/v2/key/info",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!a.ok){let e=await a.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},eG=async(e,t,o)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let r=c?"".concat(c,"/health/test_connection"):"/health/test_connection",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify({litellm_params:t,mode:o})}),s=n.headers.get("content-type");if(!s||!s.includes("application/json")){let e=await n.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(n.status,": ").concat(n.statusText,"). Check network tab for details."))}let l=await n.json();if(!n.ok||"error"===l.status){if("error"===l.status);else{var a;return{status:"error",message:(null===(a=l.error)||void 0===a?void 0:a.message)||"Connection test failed: ".concat(n.status," ").concat(n.statusText)}}}return l}catch(e){throw console.error("Model connection test error:",e),e}},eJ=async(e,t)=>{try{console.log("entering keyInfoV1Call");let o=c?"".concat(c,"/key/info"):"/key/info";o="".concat(o,"?key=").concat(t);let r=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(console.log("response",r),!r.ok){let e=await r.text();p(e),a.ZP.error("Failed to fetch key info - "+e)}let n=await r.json();return console.log("data",n),n}catch(e){throw console.error("Failed to fetch key info:",e),e}},eU=async function(e,t,o,a,r,n,s,l){let i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let h=c?"".concat(c,"/key/list"):"/key/list";console.log("in keyListCall");let w=new URLSearchParams;o&&w.append("team_id",o.toString()),t&&w.append("organization_id",t.toString()),a&&w.append("key_alias",a),n&&w.append("key_hash",n),r&&w.append("user_id",r.toString()),s&&w.append("page",s.toString()),l&&w.append("size",l.toString()),i&&w.append("sort_by",i),d&&w.append("sort_order",d),w.append("return_full_object","true"),w.append("include_team_keys","true");let g=w.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw p(e),Error("Network response was not ok")}let y=await f.json();return console.log("/team/list API Response:",y),y}catch(e){throw console.error("Failed to create key:",e),e}},eA=async(e,t)=>{try{let o=c?"".concat(c,"/spend/users"):"/spend/users";console.log("in spendUsersCall:",o);let a=await fetch("".concat(o,"?user_id=").concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get spend for user",e),e}},eI=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/user/request_model"):"/user/request_model",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({models:[t],user_id:o,justification:a})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return console.log(s),s}catch(e){throw console.error("Failed to create key:",e),e}},eR=async e=>{try{let t=c?"".concat(c,"/user/get_requests"):"/user/get_requests";console.log("in userGetRequesedtModelsCall:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to get requested models:",e),e}},eM=async(e,t)=>{try{let o=c?"".concat(c,"/user/get_users?role=").concat(t):"/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get requested models:",e),e}},ez=async e=>{try{let t=c?"".concat(c,"/user/available_roles"):"/user/available_roles",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("response from user/available_role",a),a}catch(e){throw e}},eL=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/team/new"):"/team/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eV=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/credentials"):"/credentials",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eD=async e=>{try{let t=c?"".concat(c,"/credentials"):"/credentials";console.log("in credentialListCall");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("/credentials API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},eH=async(e,t,o)=>{try{let a=c?"".concat(c,"/credentials"):"/credentials";t?a+="/by_name/".concat(t):o&&(a+="/by_model/".concat(o)),console.log("in credentialListCall");let r=await fetch(a,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("/credentials API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eq=async(e,t)=>{try{let o=c?"".concat(c,"/credentials/").concat(t):"/credentials/".concat(t);console.log("in credentialDeleteCall:",t);let a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},eZ=async(e,t,o)=>{try{if(console.log("Form Values in credentialUpdateCall:",o),o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let a=c?"".concat(c,"/credentials/").concat(t):"/credentials/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eK=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let o=c?"".concat(c,"/key/update"):"/key/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update key Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eY=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=c?"".concat(c,"/team/update"):"/team/update",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),a.ZP.error("Failed to update team settings: "+e),Error(e)}let n=await r.json();return console.log("Update Team Response:",n),n}catch(e){throw console.error("Failed to update team:",e),e}},eW=async(e,t,o)=>{try{console.log("Form Values in modelUpateCall:",t);let a=c?"".concat(c,"/model/").concat(o,"/update"):"/model/".concat(o,"/update"),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("Update model Response:",n),n}catch(e){throw console.error("Failed to update model:",e),e}},eQ=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=c?"".concat(c,"/model/update"):"/model/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update model Response:",r),r}catch(e){throw console.error("Failed to update model:",e),e}},eX=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let r=c?"".concat(c,"/team/member_add"):"/team/member_add",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},e$=async(e,t,o,a)=>{try{console.log("Bulk add team members:",{teamId:t,members:o,maxBudgetInTeam:a});let n=c?"".concat(c,"/team/bulk_member_add"):"/team/bulk_member_add",s={team_id:t,members:o};null!=a&&(s.max_budget_in_team=a);let l=await fetch(n,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(s)});if(!l.ok){var r;let e=await l.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(r=t.detail)||void 0===r?void 0:r.error)||"Failed to bulk add team members",a=Error(o);throw a.raw=t,a}let i=await l.json();return console.log("Bulk team member add API Response:",i),i}catch(e){throw console.error("Failed to bulk add team members:",e),e}},e0=async(e,t,o)=>{try{console.log("Form Values in teamMemberUpdateCall:",o);let r=c?"".concat(c,"/team/member_update"):"/team/member_update",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,role:o.role,user_id:o.user_id})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to update team member:",e),e}},e1=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=c?"".concat(c,"/team/member_delete"):"/team/member_delete",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,...void 0!==o.user_email&&{user_email:o.user_email},...void 0!==o.user_id&&{user_id:o.user_id}})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},e2=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=c?"".concat(c,"/organization/member_add"):"/organization/member_add",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create organization member:",e),e}},e3=async(e,t,o)=>{try{console.log("Form Values in organizationMemberDeleteCall:",o);let a=c?"".concat(c,"/organization/member_delete"):"/organization/member_delete",r=await fetch(a,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,user_id:o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},e4=async(e,t,o)=>{try{console.log("Form Values in organizationMemberUpdateCall:",o);let a=c?"".concat(c,"/organization/member_update"):"/organization/member_update",r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},e5=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=c?"".concat(c,"/user/update"):"/user/update",r={...t};null!==o&&(r.user_role=o),r=JSON.stringify(r);let n=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!n.ok){let e=await n.text();throw p(e),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}},e6=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=c?"".concat(c,"/user/bulk_update"):"/user/bulk_update",r=[];for(let e of o)r.push({user_id:e,...t});let n=JSON.stringify({users:r}),s=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n});if(!s.ok){let e=await s.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let l=await s.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},e9=async(e,t)=>{try{let o=c?"".concat(c,"/global/predict/spend/logs"):"/global/predict/spend/logs",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},e7=async e=>{try{let t=c?"".concat(c,"/health/services?service=slack_budget_alerts"):"/health/services?service=slack_budget_alerts";console.log("Checking Slack Budget Alerts service health");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}let r=await o.json();return a.ZP.success("Test Slack Alert worked - check your Slack!"),console.log("Service Health Response:",r),r}catch(e){throw console.error("Failed to perform health check:",e),e}},e8=async(e,t)=>{try{let o=c?"".concat(c,"/health/services?service=").concat(t):"/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let r=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error(e)}let n=await r.json();return a.ZP.success("Test request to ".concat(t," made - check logs/alerts on ").concat(t," to verify")),n}catch(e){throw console.error("Failed to perform health check:",e),e}},te=async e=>{try{let t=c?"".concat(c,"/budget/list"):"/budget/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tt=async e=>{try{let t=c?"".concat(c,"/budget/settings"):"/budget/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},to=async(e,t,o)=>{try{let t=c?"".concat(c,"/get/config/callbacks"):"/get/config/callbacks",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},ta=async e=>{try{let t=c?"".concat(c,"/config/list?config_type=general_settings"):"/config/list?config_type=general_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tr=async e=>{try{let t=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tn=async(e,t)=>{try{let o=c?"".concat(c,"/config/field/info?field_name=").concat(t):"/config/field/info?field_name=".concat(t),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tc=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Successfully updated value!"),s}catch(e){throw console.error("Failed to set callbacks:",e),e}},ts=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tl=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/field/update"):"/config/field/update",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Successfully updated value!"),s}catch(e){throw console.error("Failed to set callbacks:",e),e}},ti=async(e,t)=>{try{let o=c?"".concat(c,"/config/field/delete"):"/config/field/delete",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return a.ZP.success("Field reset on proxy"),n}catch(e){throw console.error("Failed to get callbacks:",e),e}},td=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint?endpoint_id=").concat(t):"/config/pass_through_endpoint".concat(t),a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},th=async(e,t)=>{try{let o=c?"".concat(c,"/config/update"):"/config/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tp=async e=>{try{let t=c?"".concat(c,"/health"):"/health",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to call /health:",e),e}},tu=async(e,t)=>{try{let o=c?"".concat(c,"/health?model=").concat(encodeURIComponent(t)):"/health?model=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw Error(e||"Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to call /health for model ".concat(t,":"),e),e}},tw=async e=>{try{let t=c?"".concat(c,"/cache/ping"):"/cache/ping",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tg=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;try{let n=c?"".concat(c,"/health/history"):"/health/history",s=new URLSearchParams;t&&s.append("model",t),o&&s.append("status_filter",o),s.append("limit",a.toString()),s.append("offset",r.toString()),s.toString()&&(n+="?".concat(s.toString()));let l=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw p(e),Error(e)}return await l.json()}catch(e){throw console.error("Failed to call /health/history:",e),e}},tf=async e=>{try{let t=c?"".concat(c,"/health/latest"):"/health/latest",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},ty=async e=>{try{console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",c);let t=c?"".concat(c,"/sso/get/ui_settings"):"/sso/get/ui_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tm=async e=>{try{let t=c?"".concat(c,"/v2/guardrails/list"):"/v2/guardrails/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}},tk=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails"):"/guardrails",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!a.ok){let e=await a.text();throw p(e),Error(e)}let r=await a.json();return console.log("Create guardrail response:",r),r}catch(e){throw console.error("Failed to create guardrail:",e),e}},tC=async(e,t,o)=>{try{let a=c?"".concat(c,"/spend/logs/ui/").concat(t,"?start_date=").concat(encodeURIComponent(o)):"/spend/logs/ui/".concat(t,"?start_date=").concat(encodeURIComponent(o));console.log("Fetching log details from:",a);let r=await fetch(a,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Fetched log details:",n),n}catch(e){throw console.error("Failed to fetch log details:",e),e}},t_=async e=>{try{let t=c?"".concat(c,"/get/internal_user_settings"):"/get/internal_user_settings";console.log("Fetching SSO settings from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO settings:",a),a}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},tT=async(e,t)=>{try{let o=c?"".concat(c,"/update/internal_user_settings"):"/update/internal_user_settings";console.log("Updating internal user settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw p(e),Error(e)}let n=await r.json();return console.log("Updated internal user settings:",n),a.ZP.success("Internal user settings updated successfully"),n}catch(e){throw console.error("Failed to update internal user settings:",e),e}},tE=async e=>{try{let t=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server";console.log("Fetching MCP servers from:",t);let o=await fetch(t,{method:i.GET,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP servers:",a),a}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},tj=async e=>{try{let t=c?"".concat(c,"/v1/mcp/access_groups"):"/v1/mcp/access_groups";console.log("Fetching MCP access groups from:",t);let o=await fetch(t,{method:i.GET,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP access groups:",a),a.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},tS=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let o=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tv=async(e,t)=>{try{let o=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"PUT",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to update MCP server:",e),e}},tb=async(e,t)=>{try{let o=(c?"".concat(c):"")+"/v1/mcp/server/".concat(t);console.log("in deleteMCPServer:",t);let a=await fetch(o,{method:i.DELETE,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}}catch(e){throw console.error("Failed to delete key:",e),e}},tN=async(e,t)=>{try{let o=c?"".concat(c,"/mcp-rest/tools/list?server_id=").concat(t):"/mcp-rest/tools/list?server_id=".concat(t);console.log("Fetching MCP tools from:",o);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}}),r=await a.json();if(console.log("Fetched MCP tools response:",r),!a.ok){if(r.error&&r.message)throw Error(r.message);throw Error("Failed to fetch MCP tools")}return r}catch(e){return console.error("Failed to fetch MCP tools:",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools"}}},tF=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/mcp-rest/tools/call"):"/mcp-rest/tools/call";console.log("Calling MCP tool:",t,"with arguments:",o);let n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"x-mcp-auth":a,"Content-Type":"application/json"},body:JSON.stringify({name:t,arguments:o})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return console.log("MCP tool call response:",s),s}catch(e){throw console.error("Failed to call MCP tool:",e),e}},tP=async(e,t)=>{try{let o=c?"".concat(c,"/tag/new"):"/tag/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error creating tag:",e),e}},tx=async(e,t)=>{try{let o=c?"".concat(c,"/tag/update"):"/tag/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error updating tag:",e),e}},tO=async(e,t)=>{try{let o=c?"".concat(c,"/tag/info"):"/tag/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({names:t})});if(!a.ok){let e=await a.text();return await p(e),{}}return await a.json()}catch(e){throw console.error("Error getting tag info:",e),e}},tB=async e=>{try{let t=c?"".concat(c,"/tag/list"):"/tag/list",o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.text();return await p(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},tG=async(e,t)=>{try{let o=c?"".concat(c,"/tag/delete"):"/tag/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({name:t})});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error deleting tag:",e),e}},tJ=async e=>{try{let t=c?"".concat(c,"/get/default_team_settings"):"/get/default_team_settings";console.log("Fetching default team settings from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched default team settings:",a),a}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},tU=async(e,t)=>{try{let o=c?"".concat(c,"/update/default_team_settings"):"/update/default_team_settings";console.log("Updating default team settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Updated default team settings:",n),a.ZP.success("Default team settings updated successfully"),n}catch(e){throw console.error("Failed to update default team settings:",e),e}},tA=async(e,t)=>{try{let o=c?"".concat(c,"/team/permissions_list?team_id=").concat(t):"/team/permissions_list?team_id=".concat(t),a=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("Team permissions response:",r),r}catch(e){throw console.error("Failed to get team permissions:",e),e}},tI=async(e,t,o)=>{try{let a=c?"".concat(c,"/team/permissions_update"):"/team/permissions_update",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({team_id:t,team_member_permissions:o})});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},tR=async(e,t)=>{try{let o=c?"".concat(c,"/spend/logs/session/ui?session_id=").concat(encodeURIComponent(t)):"/spend/logs/session/ui?session_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},tM=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/new"):"/vector_store/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create vector store")}return await a.json()}catch(e){throw console.error("Error creating vector store:",e),e}},tz=async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let t=c?"".concat(c,"/vector_store/list"):"/vector_store/list",o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.json();throw Error(e.detail||"Failed to list vector stores")}return await o.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},tL=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/delete"):"/vector_store/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to delete vector store")}return await a.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},tV=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/info"):"/vector_store/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to get vector store info")}return await a.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},tD=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/update"):"/vector_store/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update vector store")}return await a.json()}catch(e){throw console.error("Error updating vector store:",e),e}},tH=async e=>{try{let t=c?"".concat(c,"/email/event_settings"):"/email/event_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get email event settings")}let a=await o.json();return console.log("Email event settings response:",a),a}catch(e){throw console.error("Failed to get email event settings:",e),e}},tq=async(e,t)=>{try{let o=c?"".concat(c,"/email/event_settings"):"/email/event_settings",a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Failed to update email event settings")}let r=await a.json();return console.log("Update email event settings response:",r),r}catch(e){throw console.error("Failed to update email event settings:",e),e}},tZ=async e=>{try{let t=c?"".concat(c,"/email/event_settings/reset"):"/email/event_settings/reset",o=await fetch(t,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to reset email event settings")}let a=await o.json();return console.log("Reset email event settings response:",a),a}catch(e){throw console.error("Failed to reset email event settings:",e),e}},tK=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails/").concat(t):"/guardrails/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error(e)}let r=await a.json();return console.log("Delete guardrail response:",r),r}catch(e){throw console.error("Failed to delete guardrail:",e),e}},tY=async e=>{try{let t=c?"".concat(c,"/guardrails/ui/add_guardrail_settings"):"/guardrails/ui/add_guardrail_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get guardrail UI settings")}let a=await o.json();return console.log("Guardrail UI settings response:",a),a}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},tW=async e=>{try{let t=c?"".concat(c,"/guardrails/ui/provider_specific_params"):"/guardrails/ui/provider_specific_params",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get guardrail provider specific parameters")}let a=await o.json();return console.log("Guardrail provider specific params response:",a),a}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},tQ=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails/").concat(t,"/info"):"/guardrails/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Failed to get guardrail info")}let r=await a.json();return console.log("Guardrail info response:",r),r}catch(e){throw console.error("Failed to get guardrail info:",e),e}},tX=async(e,t,o)=>{try{let a=c?"".concat(c,"/guardrails/").concat(t):"/guardrails/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw p(e),Error("Failed to update guardrail")}let n=await r.json();return console.log("Update guardrail response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},t$=async e=>{try{let t=c?"".concat(c,"/get/sso_settings"):"/get/sso_settings";console.log("Fetching SSO configuration from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO configuration:",a),a}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},t0=async(e,t)=>{try{let o=c?"".concat(c,"/update/sso_settings"):"/update/sso_settings";console.log("Updating SSO configuration:",t);let a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("Updated SSO configuration:",r),r}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},t1=async(e,t,o,a,r)=>{try{let t=c?"".concat(c,"/audit"):"/audit",o=new URLSearchParams;a&&o.append("page",a.toString()),r&&o.append("page_size",r.toString());let n=o.toString();n&&(t+="?".concat(n));let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},t2=async e=>{try{let t=c?"".concat(c,"/user/available_users"):"/user/available_users",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e)}});if(!o.ok){if(404===o.status)return null;let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},t3=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/pass_through_endpoint/").concat(encodeURIComponent(t)):"/config/pass_through_endpoint/".concat(encodeURIComponent(t)),n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Pass through endpoint updated successfully"),s}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},t4=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint?endpoint_id=").concat(encodeURIComponent(t)):"/config/pass_through_endpoint?endpoint_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=(await a.json()).endpoints;if(!r||0===r.length)throw Error("Pass through endpoint not found");return r[0]}catch(e){throw console.error("Failed to get pass through endpoint info:",e),e}},t5=async(e,t)=>{try{let o=c?"".concat(c,"/config/callback/delete"):"/config/callback/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({callback_name:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to delete specific callback:",e),e}},t6=async e=>{let t=l(),o=await fetch("".concat(t,"/v1/mcp/tools"),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw Error("HTTP error! status: ".concat(o.status));return await o.json()},t9=async(e,t)=>{try{console.log("Testing MCP connection with config:",JSON.stringify(t));let a=c?"".concat(c,"/mcp-rest/test/connection"):"/mcp-rest/test/connection",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify(t)}),n=r.headers.get("content-type");if(!n||!n.includes("application/json")){let e=await r.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(r.status,": ").concat(r.statusText,"). Check network tab for details."))}let s=await r.json();if(!r.ok||"error"===s.status){if("error"===s.status);else{var o;return{status:"error",message:(null===(o=s.error)||void 0===o?void 0:o.message)||"MCP connection test failed: ".concat(r.status," ").concat(r.statusText)}}}return s}catch(e){throw console.error("MCP connection test error:",e),e}},t7=async(e,t)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let o=c?"".concat(c,"/mcp-rest/test/tools/list"):"/mcp-rest/test/tools/list",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify(t)}),r=a.headers.get("content-type");if(!r||!r.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(a.status,": ").concat(a.statusText,"). Check network tab for details."))}let n=await a.json();if((!a.ok||n.error)&&!n.error)return{tools:[],error:"request_failed",message:n.message||"MCP tools list failed: ".concat(a.status," ").concat(a.statusText)};return n}catch(e){throw console.error("MCP tools list test error:",e),e}},t8=async(e,t,o)=>{try{let a="".concat(l(),"/v1/vector_stores/").concat(t,"/search"),r=await fetch(a,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o})});if(!r.ok){let e=await r.text();return await p(e),null}return await r.json()}catch(e){throw console.error("Error testing vector store search:",e),e}}},3914:function(e,t,o){function a(){let e=window.location.hostname,t=["Lax","Strict","None"];["/","/ui"].forEach(o=>{document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,";"),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,";"),t.forEach(t=>{let a="None"===t?" Secure;":"";document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; SameSite=").concat(t,";").concat(a),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,"; SameSite=").concat(t,";").concat(a)})}),console.log("After clearing cookies:",document.cookie)}function r(e){let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}o.d(t,{b:function(){return a},e:function(){return r}})}}]);\ No newline at end of file+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[338],{19250:function(e,t,o){o.r(t),o.d(t,{DEFAULT_ORGANIZATION:function(){return d},PredictedSpendLogsCall:function(){return e9},addAllowedIP:function(){return es},adminGlobalActivity:function(){return eb},adminGlobalActivityExceptions:function(){return eP},adminGlobalActivityExceptionsPerDeployment:function(){return ex},adminGlobalActivityPerModel:function(){return eF},adminGlobalCacheActivity:function(){return eN},adminSpendLogsCall:function(){return eE},adminTopEndUsersCall:function(){return eS},adminTopKeysCall:function(){return ej},adminTopModelsCall:function(){return eO},adminspendByProvider:function(){return ev},alertingSettingsCall:function(){return N},allEndUsersCall:function(){return ek},allTagNamesCall:function(){return em},availableTeamListCall:function(){return M},budgetCreateCall:function(){return j},budgetDeleteCall:function(){return E},budgetUpdateCall:function(){return S},cachingHealthCheckCall:function(){return tw},callMCPTool:function(){return tF},claimOnboardingToken:function(){return X},createGuardrailCall:function(){return tk},createMCPServer:function(){return tS},createPassThroughEndpoint:function(){return ts},credentialCreateCall:function(){return eV},credentialDeleteCall:function(){return eq},credentialGetCall:function(){return eH},credentialListCall:function(){return eD},credentialUpdateCall:function(){return eZ},defaultProxyBaseUrl:function(){return r},deleteAllowedIP:function(){return el},deleteCallback:function(){return t5},deleteConfigFieldSetting:function(){return ti},deleteGuardrailCall:function(){return tK},deleteMCPServer:function(){return tb},deletePassThroughEndpointsCall:function(){return td},fetchMCPAccessGroups:function(){return tj},fetchMCPServers:function(){return tE},getAllowedIPs:function(){return ec},getBudgetList:function(){return te},getBudgetSettings:function(){return tt},getCallbacksCall:function(){return to},getConfigFieldSetting:function(){return tn},getDefaultTeamSettings:function(){return tJ},getEmailEventSettings:function(){return tH},getGeneralSettingsCall:function(){return ta},getGuardrailInfo:function(){return tQ},getGuardrailProviderSpecificParams:function(){return tW},getGuardrailUISettings:function(){return tY},getGuardrailsList:function(){return tm},getInternalUserSettings:function(){return t_},getOnboardingCredentials:function(){return Q},getOpenAPISchema:function(){return m},getPassThroughEndpointInfo:function(){return t4},getPassThroughEndpointsCall:function(){return tr},getPossibleUserRoles:function(){return ez},getProxyBaseUrl:function(){return l},getProxyUISettings:function(){return ty},getPublicModelHubInfo:function(){return y},getRemainingUsers:function(){return t3},getSSOSettings:function(){return t$},getTeamPermissionsCall:function(){return tA},getTotalSpendCall:function(){return W},getUiConfig:function(){return f},healthCheckCall:function(){return tp},healthCheckHistoryCall:function(){return tg},individualModelHealthCheckCall:function(){return tu},invitationClaimCall:function(){return b},invitationCreateCall:function(){return v},keyCreateCall:function(){return P},keyCreateServiceAccountCall:function(){return F},keyDeleteCall:function(){return O},keyInfoCall:function(){return eB},keyInfoV1Call:function(){return eJ},keyListCall:function(){return eU},keySpendLogsCall:function(){return eg},keyUpdateCall:function(){return eK},latestHealthChecksCall:function(){return tf},listMCPTools:function(){return tN},makeModelGroupPublic:function(){return g},mcpToolsCall:function(){return t6},modelAvailableCall:function(){return ew},modelCostMap:function(){return k},modelCreateCall:function(){return C},modelDeleteCall:function(){return T},modelExceptionsCall:function(){return ep},modelHubCall:function(){return en},modelHubPublicModelsCall:function(){return er},modelInfoCall:function(){return eo},modelInfoV1Call:function(){return ea},modelMetricsCall:function(){return ei},modelMetricsSlowResponsesCall:function(){return eh},modelPatchUpdateCall:function(){return eW},modelSettingsCall:function(){return _},modelUpdateCall:function(){return eQ},organizationCreateCall:function(){return V},organizationDeleteCall:function(){return H},organizationInfoCall:function(){return L},organizationListCall:function(){return z},organizationMemberAddCall:function(){return e3},organizationMemberDeleteCall:function(){return e2},organizationMemberUpdateCall:function(){return e4},organizationUpdateCall:function(){return D},proxyBaseUrl:function(){return c},regenerateKeyCall:function(){return $},resetEmailEventSettings:function(){return tZ},serverRootPath:function(){return n},serviceHealthCheck:function(){return e8},sessionSpendLogsCall:function(){return tR},setCallbacksCall:function(){return th},setGlobalLitellmHeaderName:function(){return w},slackBudgetAlertsHealthCheck:function(){return e7},spendUsersCall:function(){return eA},streamingModelMetricsCall:function(){return ed},tagCreateCall:function(){return tP},tagDailyActivityCall:function(){return K},tagDeleteCall:function(){return tG},tagInfoCall:function(){return tO},tagListCall:function(){return tB},tagUpdateCall:function(){return tx},tagsSpendLogsCall:function(){return ey},teamBulkMemberAddCall:function(){return e$},teamCreateCall:function(){return eL},teamDailyActivityCall:function(){return Y},teamDeleteCall:function(){return G},teamInfoCall:function(){return A},teamListCall:function(){return R},teamMemberAddCall:function(){return eX},teamMemberDeleteCall:function(){return e1},teamMemberUpdateCall:function(){return e0},teamPermissionsUpdateCall:function(){return tI},teamSpendLogsCall:function(){return ef},teamUpdateCall:function(){return eY},testConnectionRequest:function(){return eG},testMCPConnectionRequest:function(){return t9},testMCPToolsListRequest:function(){return t7},transformRequestCall:function(){return q},uiAuditLogsCall:function(){return t1},uiSpendLogDetailsCall:function(){return tC},uiSpendLogsCall:function(){return eT},updateConfigFieldSetting:function(){return tl},updateDefaultTeamSettings:function(){return tU},updateEmailEventSettings:function(){return tq},updateGuardrailCall:function(){return tX},updateInternalUserSettings:function(){return tT},updateMCPServer:function(){return tv},updatePassThroughEndpoint:function(){return t2},updatePassThroughFieldSetting:function(){return tc},updateSSOSettings:function(){return t0},updateUsefulLinksCall:function(){return eu},userBulkUpdateUserCall:function(){return e6},userCreateCall:function(){return x},userDailyActivityCall:function(){return Z},userDeleteCall:function(){return B},userFilterUICall:function(){return eC},userGetAllUsersCall:function(){return eM},userGetRequesedtModelsCall:function(){return eR},userInfoCall:function(){return U},userListCall:function(){return J},userRequestModelCall:function(){return eI},userSpendLogsCall:function(){return e_},userUpdateUserCall:function(){return e5},v2TeamListCall:function(){return I},vectorStoreCreateCall:function(){return tM},vectorStoreDeleteCall:function(){return tL},vectorStoreInfoCall:function(){return tV},vectorStoreListCall:function(){return tz},vectorStoreSearchCall:function(){return t8},vectorStoreUpdateCall:function(){return tD}});var a=o(41021);let r=null,n="/",c=null;console.log=function(){};let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=window.location.origin,a=t||o;console.log("proxyBaseUrl:",c),console.log("serverRootPath:",e),e.length>0&&!a.endsWith(e)&&"/"!=e&&(a+=e,c=a),console.log("Updated proxyBaseUrl:",c)},l=()=>c||window.location.origin,i={GET:"GET",DELETE:"DELETE"},d="default_organization",h=0,p=async e=>{let t=Date.now();t-h>6e4?(e.includes("Authentication Error - Expired Key")&&(a.ZP.info("UI Session Expired. Logging out."),h=t,document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",window.location.href=window.location.pathname),h=t):console.log("Error suppressed to prevent spam:",e)},u="Authorization";function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authorization";console.log("setGlobalLitellmHeaderName: ".concat(e)),u=e}let g=async(e,t)=>{let o=c?"".concat(c,"/model_group/make_public"):"/model_group/make_public";return(await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},f=async()=>{console.log("Getting UI config");let e=await fetch(r?"".concat(r,"/litellm/.well-known/litellm-ui-config"):"/litellm/.well-known/litellm-ui-config"),t=await e.json();return console.log("jsonData in getUiConfig:",t),s(t.server_root_path,t.proxy_base_url),t},y=async()=>{let e=await fetch(r?"".concat(r,"/public/model_hub/info"):"/public/model_hub/info");return await e.json()},m=async()=>{let e=c?"".concat(c,"/openapi.json"):"/openapi.json",t=await fetch(e);return await t.json()},k=async e=>{try{let t=c?"".concat(c,"/get/litellm_model_cost_map"):"/get/litellm_model_cost_map",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("received litellm model cost data: ".concat(a)),a}catch(e){throw console.error("Failed to get model cost map:",e),e}},C=async(e,t)=>{try{let o=c?"".concat(c,"/model/new"):"/model/new",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text()||"Network response was not ok";throw a.ZP.error(e),Error(e)}let n=await r.json();return console.log("API Response:",n),a.ZP.destroy(),a.ZP.success("Model ".concat(t.model_name," created successfully"),2),n}catch(e){throw console.error("Failed to create key:",e),e}},_=async e=>{try{let t=c?"".concat(c,"/model/settings"):"/model/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){console.error("Failed to get model settings:",e)}},T=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=c?"".concat(c,"/model/delete"):"/model/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},E=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=c?"".concat(c,"/budget/delete"):"/budget/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},j=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/budget/new"):"/budget/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},S=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/budget/update"):"/budget/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},v=async(e,t)=>{try{let o=c?"".concat(c,"/invitation/new"):"/invitation/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},b=async(e,t)=>{try{console.log("Form Values in invitationCreateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/invitation/claim"):"/invitation/claim",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},N=async e=>{try{let t=c?"".concat(c,"/alerting/settings"):"/alerting/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},F=async(e,t)=>{try{if(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",t);let o=c?"".concat(c,"/key/service-account/generate"):"/key/service-account/generate",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},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 Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=c?"".concat(c,"/key/generate"):"/key/generate",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},x=async(e,t,o)=>{try{if(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),o.auto_create_key=!1,o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=c?"".concat(c,"/user/new"):"/user/new",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},O=async(e,t)=>{try{let o=c?"".concat(c,"/key/delete"):"/key/delete";console.log("in keyDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},B=async(e,t)=>{try{let o=c?"".concat(c,"/user/delete"):"/user/delete";console.log("in userDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_ids:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete user(s):",e),e}},G=async(e,t)=>{try{let o=c?"".concat(c,"/team/delete"):"/team/delete";console.log("in teamDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},J=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let h=c?"".concat(c,"/user/list"):"/user/list";console.log("in userListCall");let w=new URLSearchParams;if(t&&t.length>0){let e=t.join(",");w.append("user_ids",e)}o&&w.append("page",o.toString()),a&&w.append("page_size",a.toString()),r&&w.append("user_email",r),n&&w.append("role",n),s&&w.append("team",s),l&&w.append("sso_user_ids",l),i&&w.append("sort_by",i),d&&w.append("sort_order",d);let g=w.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw p(e),Error("Network response was not ok")}let y=await f.json();return console.log("/user/list API Response:",y),y}catch(e){throw console.error("Failed to create key:",e),e}},U=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];console.log("userInfoCall: ".concat(t,", ").concat(o,", ").concat(a,", ").concat(r,", ").concat(n,", ").concat(s));try{let l;if(a){l=c?"".concat(c,"/user/list"):"/user/list";let e=new URLSearchParams;null!=r&&e.append("page",r.toString()),null!=n&&e.append("page_size",n.toString()),l+="?".concat(e.toString())}else l=c?"".concat(c,"/user/info"):"/user/info",("Admin"!==o&&"Admin Viewer"!==o||s)&&t&&(l+="?user_id=".concat(t));console.log("Requesting user data from:",l);let i=await fetch(l,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("API Response:",d),d}catch(e){throw console.error("Failed to fetch user data:",e),e}},A=async(e,t)=>{try{let o=c?"".concat(c,"/team/info"):"/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},I=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6],arguments.length>7&&void 0!==arguments[7]&&arguments[7],arguments.length>8&&void 0!==arguments[8]&&arguments[8];try{let n=c?"".concat(c,"/v2/team/list"):"/v2/team/list";console.log("in teamInfoCall");let s=new URLSearchParams;o&&s.append("user_id",o.toString()),t&&s.append("organization_id",t.toString()),a&&s.append("team_id",a.toString()),r&&s.append("team_alias",r.toString());let l=s.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("/v2/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},R=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/team/list"):"/team/list";console.log("in teamInfoCall");let s=new URLSearchParams;o&&s.append("user_id",o.toString()),t&&s.append("organization_id",t.toString()),a&&s.append("team_id",a.toString()),r&&s.append("team_alias",r.toString());let l=s.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},M=async e=>{try{let t=c?"".concat(c,"/team/available"):"/team/available";console.log("in availableTeamListCall");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("/team/available_teams API Response:",a),a}catch(e){throw e}},z=async e=>{try{let t=c?"".concat(c,"/organization/list"):"/organization/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},L=async(e,t)=>{try{let o=c?"".concat(c,"/organization/info"):"/organization/info";t&&(o="".concat(o,"?organization_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/organization/new"):"/organization/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},D=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let o=c?"".concat(c,"/organization/update"):"/organization/update",a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},H=async(e,t)=>{try{let o=c?"".concat(c,"/organization/delete"):"/organization/delete",a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Error deleting organization: ".concat(e))}return await a.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},q=async(e,t)=>{try{let o=c?"".concat(c,"/utils/transform_request"):"/utils/transform_request",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},Z=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;try{let r=c?"".concat(c,"/user/daily/activity"):"/user/daily/activity",n=new URLSearchParams,s=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",s(t)),n.append("end_date",s(o)),n.append("page_size","1000"),n.append("page",a.toString());let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}return await i.json()}catch(e){throw console.error("Failed to create key:",e),e}},K=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/tag/daily/activity"):"/tag/daily/activity",s=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};s.append("start_date",l(t)),s.append("end_date",l(o)),s.append("page_size","1000"),s.append("page",a.toString()),r&&s.append("tags",r.join(","));let i=s.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw p(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},Y=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/team/daily/activity"):"/team/daily/activity",s=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};s.append("start_date",l(t)),s.append("end_date",l(o)),s.append("page_size","1000"),s.append("page",a.toString()),r&&s.append("team_ids",r.join(",")),s.append("exclude_team_ids","litellm-dashboard");let i=s.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw p(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},W=async e=>{try{let t=c?"".concat(c,"/global/spend"):"/global/spend",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},Q=async e=>{try{let t=c?"".concat(c,"/onboarding/get_token"):"/onboarding/get_token";t+="?invite_link=".concat(e);let o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},X=async(e,t,o,a)=>{let r=c?"".concat(c,"/onboarding/claim_token"):"/onboarding/claim_token";try{let n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({invitation_link:t,user_id:o,password:a})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to delete key:",e),e}},$=async(e,t,o)=>{try{let a=c?"".concat(c,"/key/").concat(t,"/regenerate"):"/key/".concat(t,"/regenerate"),r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Regenerate key Response:",n),n}catch(e){throw console.error("Failed to regenerate key:",e),e}},ee=!1,et=null,eo=async(e,t,o)=>{try{console.log("modelInfoCall:",e,t,o);let r=c?"".concat(c,"/v2/model/info"):"/v2/model/info",n=new URLSearchParams;n.append("include_team_models","true"),n.toString()&&(r+="?".concat(n.toString()));let s=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw e+="error shown=".concat(ee),ee||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),a.ZP.info(e,10),ee=!0,et&&clearTimeout(et),et=setTimeout(()=>{ee=!1},1e4)),Error("Network response was not ok")}let l=await s.json();return console.log("modelInfoCall:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},ea=async(e,t)=>{try{let o=c?"".concat(c,"/v1/model/info"):"/v1/model/info";o+="?litellm_model_id=".concat(t);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let r=await a.json();return console.log("modelInfoV1Call:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},er=async()=>{let e=c?"".concat(c,"/public/model_hub"):"/public/model_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},en=async e=>{try{let t=c?"".concat(c,"/model_group/info"):"/model_group/info",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("modelHubCall:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},ec=async e=>{try{let t=c?"".concat(c,"/get/allowed_ips"):"/get/allowed_ips",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw Error("Network response was not ok: ".concat(e))}let a=await o.json();return console.log("getAllowedIPs:",a),a.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},es=async(e,t)=>{try{let o=c?"".concat(c,"/add/allowed_ip"):"/add/allowed_ip",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},el=async(e,t)=>{try{let o=c?"".concat(c,"/delete/allowed_ip"):"/delete/allowed_ip",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},ei=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics"):"/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ed=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/model/streaming_metrics"):"/model/streaming_metrics";t&&(r="".concat(r,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let n=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},eh=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics/slow_responses"):"/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ep=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics/exceptions"):"/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eu=async(e,t)=>{try{let o=c?"".concat(c,"/model_hub/update_useful_links"):"/model_hub/update_useful_links",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({useful_links:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},ew=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6]);console.log("in /models calls, globalLitellmHeaderName",u);try{let t=c?"".concat(c,"/models"):"/models",o=new URLSearchParams;o.append("include_model_access_groups","True"),!0===a&&o.append("return_wildcard_routes","True"),!0===n&&o.append("only_model_access_groups","True"),r&&o.append("team_id",r.toString()),o.toString()&&(t+="?".concat(o.toString()));let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to create key:",e),e}},eg=async(e,t)=>{try{let o=c?"".concat(c,"/global/spend/logs"):"/global/spend/logs";console.log("in keySpendLogsCall:",o);let a=await fetch("".concat(o,"?api_key=").concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},ef=async e=>{try{let t=c?"".concat(c,"/global/spend/teams"):"/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ey=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/tags"):"/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),a&&(r+="".concat(r,"&tags=").concat(a.join(","))),console.log("in tagsSpendLogsCall:",r);let n=await fetch("".concat(r),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});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 create key:",e),e}},em=async e=>{try{let t=c?"".concat(c,"/global/spend/all_tag_names"):"/global/spend/all_tag_names";console.log("in global/spend/all_tag_names call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ek=async e=>{try{let t=c?"".concat(c,"/global/all_end_users"):"/global/all_end_users";console.log("in global/all_end_users call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eC=async(e,t)=>{try{let o=c?"".concat(c,"/user/filter/ui"):"/user/filter/ui";t.get("user_email")&&(o+="?user_email=".concat(t.get("user_email"))),t.get("user_id")&&(o+="?user_id=".concat(t.get("user_id")));let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},e_=async(e,t,o,a,r,n)=>{try{console.log("user role in spend logs call: ".concat(o));let t=c?"".concat(c,"/spend/logs"):"/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(r,"&end_date=").concat(n):"".concat(t,"?start_date=").concat(r,"&end_date=").concat(n);let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},eT=async(e,t,o,a,r,n,s,l,i,d,h,w)=>{try{let g=c?"".concat(c,"/spend/logs/ui"):"/spend/logs/ui",f=new URLSearchParams;t&&f.append("api_key",t),o&&f.append("team_id",o),a&&f.append("request_id",a),r&&f.append("start_date",r),n&&f.append("end_date",n),s&&f.append("page",s.toString()),l&&f.append("page_size",l.toString()),i&&f.append("user_id",i),d&&f.append("end_user",d),h&&f.append("status_filter",h),w&&f.append("model",w);let y=f.toString();y&&(g+="?".concat(y));let m=await fetch(g,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!m.ok){let e=await m.text();throw p(e),Error("Network response was not ok")}let k=await m.json();return console.log("Spend Logs Response:",k),k}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eE=async e=>{try{let t=c?"".concat(c,"/global/spend/logs"):"/global/spend/logs",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ej=async e=>{try{let t=c?"".concat(c,"/global/spend/keys?limit=5"):"/global/spend/keys?limit=5",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eS=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/end_users"):"/global/spend/end_users",n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let s={method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n},l=await fetch(r,s);if(!l.ok){let e=await l.text();throw p(e),Error("Network response was not ok")}let i=await l.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/provider"):"/global/spend/provider";o&&a&&(r+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(r+="&api_key=".concat(t));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eb=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity"):"/global/activity";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eN=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity/cache_hits"):"/global/activity/cache_hits";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eF=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity/model"):"/global/activity/model";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eP=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/activity/exceptions"):"/global/activity/exceptions";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok)throw await s.text(),Error("Network response was not ok");let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},ex=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/activity/exceptions/deployment"):"/global/activity/exceptions/deployment";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok)throw await s.text(),Error("Network response was not ok");let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eO=async e=>{try{let t=c?"".concat(c,"/global/spend/models?limit=5"):"/global/spend/models?limit=5",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eB=async(e,t)=>{try{let o=c?"".concat(c,"/v2/key/info"):"/v2/key/info",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!a.ok){let e=await a.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},eG=async(e,t,o)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let r=c?"".concat(c,"/health/test_connection"):"/health/test_connection",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify({litellm_params:t,mode:o})}),s=n.headers.get("content-type");if(!s||!s.includes("application/json")){let e=await n.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(n.status,": ").concat(n.statusText,"). Check network tab for details."))}let l=await n.json();if(!n.ok||"error"===l.status){if("error"===l.status);else{var a;return{status:"error",message:(null===(a=l.error)||void 0===a?void 0:a.message)||"Connection test failed: ".concat(n.status," ").concat(n.statusText)}}}return l}catch(e){throw console.error("Model connection test error:",e),e}},eJ=async(e,t)=>{try{console.log("entering keyInfoV1Call");let o=c?"".concat(c,"/key/info"):"/key/info";o="".concat(o,"?key=").concat(t);let r=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(console.log("response",r),!r.ok){let e=await r.text();p(e),a.ZP.error("Failed to fetch key info - "+e)}let n=await r.json();return console.log("data",n),n}catch(e){throw console.error("Failed to fetch key info:",e),e}},eU=async function(e,t,o,a,r,n,s,l){let i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let h=c?"".concat(c,"/key/list"):"/key/list";console.log("in keyListCall");let w=new URLSearchParams;o&&w.append("team_id",o.toString()),t&&w.append("organization_id",t.toString()),a&&w.append("key_alias",a),n&&w.append("key_hash",n),r&&w.append("user_id",r.toString()),s&&w.append("page",s.toString()),l&&w.append("size",l.toString()),i&&w.append("sort_by",i),d&&w.append("sort_order",d),w.append("return_full_object","true"),w.append("include_team_keys","true");let g=w.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw p(e),Error("Network response was not ok")}let y=await f.json();return console.log("/team/list API Response:",y),y}catch(e){throw console.error("Failed to create key:",e),e}},eA=async(e,t)=>{try{let o=c?"".concat(c,"/spend/users"):"/spend/users";console.log("in spendUsersCall:",o);let a=await fetch("".concat(o,"?user_id=").concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get spend for user",e),e}},eI=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/user/request_model"):"/user/request_model",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({models:[t],user_id:o,justification:a})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return console.log(s),s}catch(e){throw console.error("Failed to create key:",e),e}},eR=async e=>{try{let t=c?"".concat(c,"/user/get_requests"):"/user/get_requests";console.log("in userGetRequesedtModelsCall:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to get requested models:",e),e}},eM=async(e,t)=>{try{let o=c?"".concat(c,"/user/get_users?role=").concat(t):"/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get requested models:",e),e}},ez=async e=>{try{let t=c?"".concat(c,"/user/available_roles"):"/user/available_roles",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("response from user/available_role",a),a}catch(e){throw e}},eL=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/team/new"):"/team/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eV=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/credentials"):"/credentials",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eD=async e=>{try{let t=c?"".concat(c,"/credentials"):"/credentials";console.log("in credentialListCall");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("/credentials API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},eH=async(e,t,o)=>{try{let a=c?"".concat(c,"/credentials"):"/credentials";t?a+="/by_name/".concat(t):o&&(a+="/by_model/".concat(o)),console.log("in credentialListCall");let r=await fetch(a,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("/credentials API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eq=async(e,t)=>{try{let o=c?"".concat(c,"/credentials/").concat(t):"/credentials/".concat(t);console.log("in credentialDeleteCall:",t);let a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},eZ=async(e,t,o)=>{try{if(console.log("Form Values in credentialUpdateCall:",o),o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let a=c?"".concat(c,"/credentials/").concat(t):"/credentials/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eK=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let o=c?"".concat(c,"/key/update"):"/key/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update key Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eY=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=c?"".concat(c,"/team/update"):"/team/update",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),a.ZP.error("Failed to update team settings: "+e),Error(e)}let n=await r.json();return console.log("Update Team Response:",n),n}catch(e){throw console.error("Failed to update team:",e),e}},eW=async(e,t,o)=>{try{console.log("Form Values in modelUpateCall:",t);let a=c?"".concat(c,"/model/").concat(o,"/update"):"/model/".concat(o,"/update"),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("Update model Response:",n),n}catch(e){throw console.error("Failed to update model:",e),e}},eQ=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=c?"".concat(c,"/model/update"):"/model/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update model Response:",r),r}catch(e){throw console.error("Failed to update model:",e),e}},eX=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let r=c?"".concat(c,"/team/member_add"):"/team/member_add",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},e$=async(e,t,o,a,r)=>{try{console.log("Bulk add team members:",{teamId:t,members:o,maxBudgetInTeam:a});let s=c?"".concat(c,"/team/bulk_member_add"):"/team/bulk_member_add",l={team_id:t};r?l.all_users=!0:l.members=o,null!=a&&(l.max_budget_in_team=a);let i=await fetch(s,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){var n;let e=await i.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(n=t.detail)||void 0===n?void 0:n.error)||"Failed to bulk add team members",a=Error(o);throw a.raw=t,a}let d=await i.json();return console.log("Bulk team member add API Response:",d),d}catch(e){throw console.error("Failed to bulk add team members:",e),e}},e0=async(e,t,o)=>{try{console.log("Form Values in teamMemberUpdateCall:",o);let r=c?"".concat(c,"/team/member_update"):"/team/member_update",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,role:o.role,user_id:o.user_id})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to update team member:",e),e}},e1=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=c?"".concat(c,"/team/member_delete"):"/team/member_delete",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,...void 0!==o.user_email&&{user_email:o.user_email},...void 0!==o.user_id&&{user_id:o.user_id}})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},e3=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=c?"".concat(c,"/organization/member_add"):"/organization/member_add",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create organization member:",e),e}},e2=async(e,t,o)=>{try{console.log("Form Values in organizationMemberDeleteCall:",o);let a=c?"".concat(c,"/organization/member_delete"):"/organization/member_delete",r=await fetch(a,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,user_id:o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},e4=async(e,t,o)=>{try{console.log("Form Values in organizationMemberUpdateCall:",o);let a=c?"".concat(c,"/organization/member_update"):"/organization/member_update",r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},e5=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=c?"".concat(c,"/user/update"):"/user/update",r={...t};null!==o&&(r.user_role=o),r=JSON.stringify(r);let n=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!n.ok){let e=await n.text();throw p(e),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}},e6=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let r;console.log("Form Values in userUpdateUserCall:",t);let n=c?"".concat(c,"/user/bulk_update"):"/user/bulk_update";if(a)r=JSON.stringify({all_users:!0,user_updates:t});else if(o&&o.length>0){let e=[];for(let a of o)e.push({user_id:a,...t});r=JSON.stringify({users:e})}else throw Error("Must provide either userIds or set allUsers=true");let s=await fetch(n,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!s.ok){let e=await s.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let l=await s.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},e9=async(e,t)=>{try{let o=c?"".concat(c,"/global/predict/spend/logs"):"/global/predict/spend/logs",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},e7=async e=>{try{let t=c?"".concat(c,"/health/services?service=slack_budget_alerts"):"/health/services?service=slack_budget_alerts";console.log("Checking Slack Budget Alerts service health");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}let r=await o.json();return a.ZP.success("Test Slack Alert worked - check your Slack!"),console.log("Service Health Response:",r),r}catch(e){throw console.error("Failed to perform health check:",e),e}},e8=async(e,t)=>{try{let o=c?"".concat(c,"/health/services?service=").concat(t):"/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let r=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error(e)}let n=await r.json();return a.ZP.success("Test request to ".concat(t," made - check logs/alerts on ").concat(t," to verify")),n}catch(e){throw console.error("Failed to perform health check:",e),e}},te=async e=>{try{let t=c?"".concat(c,"/budget/list"):"/budget/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tt=async e=>{try{let t=c?"".concat(c,"/budget/settings"):"/budget/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},to=async(e,t,o)=>{try{let t=c?"".concat(c,"/get/config/callbacks"):"/get/config/callbacks",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},ta=async e=>{try{let t=c?"".concat(c,"/config/list?config_type=general_settings"):"/config/list?config_type=general_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tr=async e=>{try{let t=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tn=async(e,t)=>{try{let o=c?"".concat(c,"/config/field/info?field_name=").concat(t):"/config/field/info?field_name=".concat(t),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tc=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Successfully updated value!"),s}catch(e){throw console.error("Failed to set callbacks:",e),e}},ts=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tl=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/field/update"):"/config/field/update",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Successfully updated value!"),s}catch(e){throw console.error("Failed to set callbacks:",e),e}},ti=async(e,t)=>{try{let o=c?"".concat(c,"/config/field/delete"):"/config/field/delete",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return a.ZP.success("Field reset on proxy"),n}catch(e){throw console.error("Failed to get callbacks:",e),e}},td=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint?endpoint_id=").concat(t):"/config/pass_through_endpoint".concat(t),a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},th=async(e,t)=>{try{let o=c?"".concat(c,"/config/update"):"/config/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tp=async e=>{try{let t=c?"".concat(c,"/health"):"/health",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to call /health:",e),e}},tu=async(e,t)=>{try{let o=c?"".concat(c,"/health?model=").concat(encodeURIComponent(t)):"/health?model=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw Error(e||"Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to call /health for model ".concat(t,":"),e),e}},tw=async e=>{try{let t=c?"".concat(c,"/cache/ping"):"/cache/ping",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tg=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;try{let n=c?"".concat(c,"/health/history"):"/health/history",s=new URLSearchParams;t&&s.append("model",t),o&&s.append("status_filter",o),s.append("limit",a.toString()),s.append("offset",r.toString()),s.toString()&&(n+="?".concat(s.toString()));let l=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw p(e),Error(e)}return await l.json()}catch(e){throw console.error("Failed to call /health/history:",e),e}},tf=async e=>{try{let t=c?"".concat(c,"/health/latest"):"/health/latest",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},ty=async e=>{try{console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",c);let t=c?"".concat(c,"/sso/get/ui_settings"):"/sso/get/ui_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tm=async e=>{try{let t=c?"".concat(c,"/v2/guardrails/list"):"/v2/guardrails/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}},tk=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails"):"/guardrails",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!a.ok){let e=await a.text();throw p(e),Error(e)}let r=await a.json();return console.log("Create guardrail response:",r),r}catch(e){throw console.error("Failed to create guardrail:",e),e}},tC=async(e,t,o)=>{try{let a=c?"".concat(c,"/spend/logs/ui/").concat(t,"?start_date=").concat(encodeURIComponent(o)):"/spend/logs/ui/".concat(t,"?start_date=").concat(encodeURIComponent(o));console.log("Fetching log details from:",a);let r=await fetch(a,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Fetched log details:",n),n}catch(e){throw console.error("Failed to fetch log details:",e),e}},t_=async e=>{try{let t=c?"".concat(c,"/get/internal_user_settings"):"/get/internal_user_settings";console.log("Fetching SSO settings from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO settings:",a),a}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},tT=async(e,t)=>{try{let o=c?"".concat(c,"/update/internal_user_settings"):"/update/internal_user_settings";console.log("Updating internal user settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw p(e),Error(e)}let n=await r.json();return console.log("Updated internal user settings:",n),a.ZP.success("Internal user settings updated successfully"),n}catch(e){throw console.error("Failed to update internal user settings:",e),e}},tE=async e=>{try{let t=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server";console.log("Fetching MCP servers from:",t);let o=await fetch(t,{method:i.GET,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP servers:",a),a}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},tj=async e=>{try{let t=c?"".concat(c,"/v1/mcp/access_groups"):"/v1/mcp/access_groups";console.log("Fetching MCP access groups from:",t);let o=await fetch(t,{method:i.GET,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP access groups:",a),a.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},tS=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let o=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tv=async(e,t)=>{try{let o=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"PUT",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to update MCP server:",e),e}},tb=async(e,t)=>{try{let o=(c?"".concat(c):"")+"/v1/mcp/server/".concat(t);console.log("in deleteMCPServer:",t);let a=await fetch(o,{method:i.DELETE,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}}catch(e){throw console.error("Failed to delete key:",e),e}},tN=async(e,t)=>{try{let o=c?"".concat(c,"/mcp-rest/tools/list?server_id=").concat(t):"/mcp-rest/tools/list?server_id=".concat(t);console.log("Fetching MCP tools from:",o);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}}),r=await a.json();if(console.log("Fetched MCP tools response:",r),!a.ok){if(r.error&&r.message)throw Error(r.message);throw Error("Failed to fetch MCP tools")}return r}catch(e){return console.error("Failed to fetch MCP tools:",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools"}}},tF=async(e,t,o,a,r)=>{try{let n=c?"".concat(c,"/mcp-rest/tools/call"):"/mcp-rest/tools/call";console.log("Calling MCP tool:",t,"with arguments:",o);let s={[u]:"Bearer ".concat(e),"Content-Type":"application/json"};r?s["x-mcp-".concat(r,"-authorization")]=a:s["x-mcp-auth"]=a;let l=await fetch(n,{method:"POST",headers:s,body:JSON.stringify({name:t,arguments:o})});if(!l.ok){let e=await l.text();throw p(e),Error("Network response was not ok")}let i=await l.json();return console.log("MCP tool call response:",i),i}catch(e){throw console.error("Failed to call MCP tool:",e),e}},tP=async(e,t)=>{try{let o=c?"".concat(c,"/tag/new"):"/tag/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error creating tag:",e),e}},tx=async(e,t)=>{try{let o=c?"".concat(c,"/tag/update"):"/tag/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error updating tag:",e),e}},tO=async(e,t)=>{try{let o=c?"".concat(c,"/tag/info"):"/tag/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({names:t})});if(!a.ok){let e=await a.text();return await p(e),{}}return await a.json()}catch(e){throw console.error("Error getting tag info:",e),e}},tB=async e=>{try{let t=c?"".concat(c,"/tag/list"):"/tag/list",o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.text();return await p(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},tG=async(e,t)=>{try{let o=c?"".concat(c,"/tag/delete"):"/tag/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({name:t})});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error deleting tag:",e),e}},tJ=async e=>{try{let t=c?"".concat(c,"/get/default_team_settings"):"/get/default_team_settings";console.log("Fetching default team settings from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched default team settings:",a),a}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},tU=async(e,t)=>{try{let o=c?"".concat(c,"/update/default_team_settings"):"/update/default_team_settings";console.log("Updating default team settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Updated default team settings:",n),a.ZP.success("Default team settings updated successfully"),n}catch(e){throw console.error("Failed to update default team settings:",e),e}},tA=async(e,t)=>{try{let o=c?"".concat(c,"/team/permissions_list?team_id=").concat(t):"/team/permissions_list?team_id=".concat(t),a=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("Team permissions response:",r),r}catch(e){throw console.error("Failed to get team permissions:",e),e}},tI=async(e,t,o)=>{try{let a=c?"".concat(c,"/team/permissions_update"):"/team/permissions_update",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({team_id:t,team_member_permissions:o})});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},tR=async(e,t)=>{try{let o=c?"".concat(c,"/spend/logs/session/ui?session_id=").concat(encodeURIComponent(t)):"/spend/logs/session/ui?session_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},tM=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/new"):"/vector_store/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create vector store")}return await a.json()}catch(e){throw console.error("Error creating vector store:",e),e}},tz=async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let t=c?"".concat(c,"/vector_store/list"):"/vector_store/list",o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.json();throw Error(e.detail||"Failed to list vector stores")}return await o.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},tL=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/delete"):"/vector_store/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to delete vector store")}return await a.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},tV=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/info"):"/vector_store/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to get vector store info")}return await a.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},tD=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/update"):"/vector_store/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update vector store")}return await a.json()}catch(e){throw console.error("Error updating vector store:",e),e}},tH=async e=>{try{let t=c?"".concat(c,"/email/event_settings"):"/email/event_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get email event settings")}let a=await o.json();return console.log("Email event settings response:",a),a}catch(e){throw console.error("Failed to get email event settings:",e),e}},tq=async(e,t)=>{try{let o=c?"".concat(c,"/email/event_settings"):"/email/event_settings",a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Failed to update email event settings")}let r=await a.json();return console.log("Update email event settings response:",r),r}catch(e){throw console.error("Failed to update email event settings:",e),e}},tZ=async e=>{try{let t=c?"".concat(c,"/email/event_settings/reset"):"/email/event_settings/reset",o=await fetch(t,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to reset email event settings")}let a=await o.json();return console.log("Reset email event settings response:",a),a}catch(e){throw console.error("Failed to reset email event settings:",e),e}},tK=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails/").concat(t):"/guardrails/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error(e)}let r=await a.json();return console.log("Delete guardrail response:",r),r}catch(e){throw console.error("Failed to delete guardrail:",e),e}},tY=async e=>{try{let t=c?"".concat(c,"/guardrails/ui/add_guardrail_settings"):"/guardrails/ui/add_guardrail_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get guardrail UI settings")}let a=await o.json();return console.log("Guardrail UI settings response:",a),a}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},tW=async e=>{try{let t=c?"".concat(c,"/guardrails/ui/provider_specific_params"):"/guardrails/ui/provider_specific_params",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get guardrail provider specific parameters")}let a=await o.json();return console.log("Guardrail provider specific params response:",a),a}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},tQ=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails/").concat(t,"/info"):"/guardrails/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Failed to get guardrail info")}let r=await a.json();return console.log("Guardrail info response:",r),r}catch(e){throw console.error("Failed to get guardrail info:",e),e}},tX=async(e,t,o)=>{try{let a=c?"".concat(c,"/guardrails/").concat(t):"/guardrails/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw p(e),Error("Failed to update guardrail")}let n=await r.json();return console.log("Update guardrail response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},t$=async e=>{try{let t=c?"".concat(c,"/get/sso_settings"):"/get/sso_settings";console.log("Fetching SSO configuration from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO configuration:",a),a}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},t0=async(e,t)=>{try{let o=c?"".concat(c,"/update/sso_settings"):"/update/sso_settings";console.log("Updating SSO configuration:",t);let a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("Updated SSO configuration:",r),r}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},t1=async(e,t,o,a,r)=>{try{let t=c?"".concat(c,"/audit"):"/audit",o=new URLSearchParams;a&&o.append("page",a.toString()),r&&o.append("page_size",r.toString());let n=o.toString();n&&(t+="?".concat(n));let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},t3=async e=>{try{let t=c?"".concat(c,"/user/available_users"):"/user/available_users",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e)}});if(!o.ok){if(404===o.status)return null;let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},t2=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/pass_through_endpoint/").concat(encodeURIComponent(t)):"/config/pass_through_endpoint/".concat(encodeURIComponent(t)),n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Pass through endpoint updated successfully"),s}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},t4=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint?endpoint_id=").concat(encodeURIComponent(t)):"/config/pass_through_endpoint?endpoint_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=(await a.json()).endpoints;if(!r||0===r.length)throw Error("Pass through endpoint not found");return r[0]}catch(e){throw console.error("Failed to get pass through endpoint info:",e),e}},t5=async(e,t)=>{try{let o=c?"".concat(c,"/config/callback/delete"):"/config/callback/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({callback_name:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to delete specific callback:",e),e}},t6=async e=>{let t=l(),o=await fetch("".concat(t,"/v1/mcp/tools"),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw Error("HTTP error! status: ".concat(o.status));return await o.json()},t9=async(e,t)=>{try{console.log("Testing MCP connection with config:",JSON.stringify(t));let a=c?"".concat(c,"/mcp-rest/test/connection"):"/mcp-rest/test/connection",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify(t)}),n=r.headers.get("content-type");if(!n||!n.includes("application/json")){let e=await r.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(r.status,": ").concat(r.statusText,"). Check network tab for details."))}let s=await r.json();if(!r.ok||"error"===s.status){if("error"===s.status);else{var o;return{status:"error",message:(null===(o=s.error)||void 0===o?void 0:o.message)||"MCP connection test failed: ".concat(r.status," ").concat(r.statusText)}}}return s}catch(e){throw console.error("MCP connection test error:",e),e}},t7=async(e,t)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let o=c?"".concat(c,"/mcp-rest/test/tools/list"):"/mcp-rest/test/tools/list",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify(t)}),r=a.headers.get("content-type");if(!r||!r.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(a.status,": ").concat(a.statusText,"). Check network tab for details."))}let n=await a.json();if((!a.ok||n.error)&&!n.error)return{tools:[],error:"request_failed",message:n.message||"MCP tools list failed: ".concat(a.status," ").concat(a.statusText)};return n}catch(e){throw console.error("MCP tools list test error:",e),e}},t8=async(e,t,o)=>{try{let a="".concat(l(),"/v1/vector_stores/").concat(t,"/search"),r=await fetch(a,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o})});if(!r.ok){let e=await r.text();return await p(e),null}return await r.json()}catch(e){throw console.error("Error testing vector store search:",e),e}}},3914:function(e,t,o){function a(){let e=window.location.hostname,t=["Lax","Strict","None"];["/","/ui"].forEach(o=>{document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,";"),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,";"),t.forEach(t=>{let a="None"===t?" Secure;":"";document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; SameSite=").concat(t,";").concat(a),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,"; SameSite=").concat(t,";").concat(a)})}),console.log("After clearing cookies:",document.cookie)}function r(e){let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}o.d(t,{b:function(){return a},e:function(){return r}})}}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/layout-25a743106e1c9456.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/layout-25a743106e1c9456.jsdeleted file mode 100644index 4ac435a9659..00000000000--- a/litellm/proxy/_experimental/out/_next/static/chunks/app/layout-25a743106e1c9456.js+++ /dev/null@@ -1 +0,0 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{6580:function(n,e,t){Promise.resolve().then(t.t.bind(t,39974,23)),Promise.resolve().then(t.t.bind(t,2778,23))},2778:function(){},39974:function(n){n.exports={style:{fontFamily:"'__Inter_b0dd8a', '__Inter_Fallback_b0dd8a'",fontStyle:"normal"},className:"__className_b0dd8a"}}},function(n){n.O(0,[919,986,971,117,744],function(){return n(n.s=6580)}),_N_E=n.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/layout-f4acf18888f0aa20.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/layout-f4acf18888f0aa20.jsnew file mode 100644index 00000000000..62c2e56ed71--- /dev/null+++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/layout-f4acf18888f0aa20.js@@ -0,0 +1 @@+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{96443:function(n,e,t){Promise.resolve().then(t.t.bind(t,39974,23)),Promise.resolve().then(t.t.bind(t,2778,23))},2778:function(){},39974:function(n){n.exports={style:{fontFamily:"'__Inter_b0dd8a', '__Inter_Fallback_b0dd8a'",fontStyle:"normal"},className:"__className_b0dd8a"}}},function(n){n.O(0,[919,986,971,117,744],function(){return n(n.s=96443)}),_N_E=n.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/model_hub/page-43595a95e1b23546.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-1808d9da6d48b76d.jssimilarity index 63%rename from ui/litellm-dashboard/out/_next/static/chunks/app/model_hub/page-43595a95e1b23546.jsrename to litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-1808d9da6d48b76d.jsindex 27e12ec640c..262c47134bb 100644--- a/ui/litellm-dashboard/out/_next/static/chunks/app/model_hub/page-43595a95e1b23546.js+++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-1808d9da6d48b76d.js@@ -1 +1 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[418],{11790:function(e,n,t){Promise.resolve().then(t.bind(t,52829))},52829:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return f}});var u=t(57437),s=t(2265),c=t(99376),r=t(72162);function f(){let e=(0,c.useSearchParams)().get("key"),[n,t]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&t(e)},[e]),(0,u.jsx)(r.Z,{accessToken:n})}}},function(e){e.O(0,[445,152,338,162,971,117,744],function(){return e(e.s=11790)}),_N_E=e.O()}]);\ No newline at end of file+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[418],{21024:function(e,n,t){Promise.resolve().then(t.bind(t,52829))},52829:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return f}});var u=t(57437),s=t(2265),c=t(99376),r=t(72162);function f(){let e=(0,c.useSearchParams)().get("key"),[n,t]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&t(e)},[e]),(0,u.jsx)(r.Z,{accessToken:n})}}},function(e){e.O(0,[445,152,338,162,971,117,744],function(){return e(e.s=21024)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-f3fc1d21cad686db.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-6750ac8910a46248.jssimilarity index 68%rename from litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-f3fc1d21cad686db.jsrename to litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-6750ac8910a46248.jsindex 0e1a358a7e2..48a91877647 100644--- a/litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-f3fc1d21cad686db.js+++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-6750ac8910a46248.js@@ -1 +1 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{58538:function(e,n,u){Promise.resolve().then(u.bind(u,22775))},22775:function(e,n,u){"use strict";u.r(n),u.d(n,{default:function(){return f}});var t=u(57437),s=u(2265),r=u(99376),c=u(36172);function f(){let e=(0,r.useSearchParams)().get("key"),[n,u]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&u(e)},[e]),(0,t.jsx)(c.Z,{accessToken:n,publicPage:!0,premiumUser:!1,userRole:null})}}},function(e){e.O(0,[445,152,634,475,338,162,172,971,117,744],function(){return e(e.s=58538)}),_N_E=e.O()}]);\ No newline at end of file+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{64563:function(e,n,u){Promise.resolve().then(u.bind(u,22775))},22775:function(e,n,u){"use strict";u.r(n),u.d(n,{default:function(){return f}});var t=u(57437),s=u(2265),r=u(99376),c=u(36172);function f(){let e=(0,r.useSearchParams)().get("key"),[n,u]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&u(e)},[e]),(0,t.jsx)(c.Z,{accessToken:n,publicPage:!0,premiumUser:!1,userRole:null})}}},function(e){e.O(0,[445,152,634,475,338,162,172,971,117,744],function(){return e(e.s=64563)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-73a77fc5d4952c09.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-73a77fc5d4952c09.jsdeleted file mode 100644index a6cb163c79c..00000000000--- a/litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-73a77fc5d4952c09.js+++ /dev/null@@ -1 +0,0 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[461],{32922:function(e,r,t){Promise.resolve().then(t.bind(t,12011))},69262:function(e,r,t){"use strict";t.d(r,{Z:function(){return m}});var n=t(5853),o=t(2265);let s=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},l=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},a=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var c=t(96398),d=t(97324),i=t(1153);let m=o.forwardRef((e,r)=>{let{value:t,defaultValue:m,type:u,placeholder:p="Type...",icon:g,error:f=!1,errorMessage:b,disabled:h=!1,stepper:k,makeInputClassName:x,className:w,onChange:C,onValueChange:v,autoFocus:N}=e,y=(0,n._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[E,S]=(0,o.useState)(N||!1),[j,_]=(0,o.useState)(!1),Z=(0,o.useCallback)(()=>_(!j),[j,_]),I=(0,o.useRef)(null),q=(0,c.Uh)(t||m);return o.useEffect(()=>{let e=()=>S(!0),r=()=>S(!1),t=I.current;return t&&(t.addEventListener("focus",e),t.addEventListener("blur",r),N&&t.focus()),()=>{t&&(t.removeEventListener("focus",e),t.removeEventListener("blur",r))}},[N]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,d.q)(x("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,c.um)(q,h,f),E&&(0,d.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),w)},g?o.createElement(g,{className:(0,d.q)(x("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,i.lq)([I,r]),defaultValue:m,value:t,type:j?"text":u,className:(0,d.q)(x("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",g?"pl-2":"pl-3",f?"pr-3":"pr-4",h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:h,"data-testid":"base-input",onChange:e=>{null==C||C(e),null==v||v(e.target.value)}},y)),"password"!==u||h?null:o.createElement("button",{className:(0,d.q)(x("toggleButton"),"mr-2"),type:"button",onClick:()=>Z(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(a,{className:(0,d.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(l,{className:(0,d.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),f?o.createElement(s,{className:(0,d.q)(x("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=k?k:null),f&&b?o.createElement("p",{className:(0,d.q)(x("errorMessage"),"text-sm text-red-500 mt-1")},b):null)});m.displayName="BaseInput"},49566:function(e,r,t){"use strict";t.d(r,{Z:function(){return c}});var n=t(5853),o=t(2265);t(97324);var s=t(1153),l=t(69262);let a=(0,s.fn)("TextInput"),c=o.forwardRef((e,r)=>{let{type:t="text"}=e,s=(0,n._T)(e,["type"]);return o.createElement(l.Z,Object.assign({ref:r,type:t,makeInputClassName:a},s))});c.displayName="TextInput"},96398:function(e,r,t){"use strict";t.d(r,{Uh:function(){return d},n0:function(){return a},qg:function(){return s},sl:function(){return l},um:function(){return c}});var n=t(97324),o=t(2265);let s=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(s).join(""):"object"==typeof e&&e?s(e.props.children):void 0;function l(e){let r=new Map;return o.Children.map(e,e=>{var t;r.set(e.props.value,null!==(t=s(e))&&void 0!==t?t:e.props.value)}),r}function a(e,r){return o.Children.map(r,r=>{var t;if((null!==(t=s(r))&&void 0!==t?t:r.props.value).toLowerCase().includes(e.toLowerCase()))return r})}let c=function(e,r){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,n.q)(r?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!r&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",r&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",t&&"text-red-500",t?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function d(e){return null!=e&&""!==e}},49804:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(97324),s=t(1153),l=t(2265),a=t(9496);let c=(0,s.fn)("Col"),d=l.forwardRef((e,r)=>{let{numColSpan:t=1,numColSpanSm:s,numColSpanMd:d,numColSpanLg:i,children:m,className:u}=e,p=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),g=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"";return l.createElement("div",Object.assign({ref:r,className:(0,o.q)(c("root"),(()=>{let e=g(t,a.PT),r=g(s,a.SP),n=g(d,a.VS),l=g(i,a._w);return(0,o.q)(e,r,n,l)})(),u)},p),m)});d.displayName="Col"},67101:function(e,r,t){"use strict";t.d(r,{Z:function(){return i}});var n=t(5853),o=t(97324),s=t(1153),l=t(2265),a=t(9496);let c=(0,s.fn)("Grid"),d=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"",i=l.forwardRef((e,r)=>{let{numItems:t=1,numItemsSm:s,numItemsMd:i,numItemsLg:m,children:u,className:p}=e,g=(0,n._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=d(t,a._m),b=d(s,a.LH),h=d(i,a.l5),k=d(m,a.N4),x=(0,o.q)(f,b,h,k);return l.createElement("div",Object.assign({ref:r,className:(0,o.q)(c("root"),"grid",x,p)},g),u)});i.displayName="Grid"},9496:function(e,r,t){"use strict";t.d(r,{LH:function(){return o},N4:function(){return l},PT:function(){return a},SP:function(){return c},VS:function(){return d},_m:function(){return n},_w:function(){return i},l5:function(){return s}});let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},o={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},s={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},l={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},a={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},c={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},d={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},i={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},94789:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),s=t(26898),l=t(97324),a=t(1153);let c=(0,a.fn)("Callout"),d=o.forwardRef((e,r)=>{let{title:t,icon:d,color:i,className:m,children:u}=e,p=(0,n._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:r,className:(0,l.q)(c("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",i?(0,l.q)((0,a.bM)(i,s.K.background).bgColor,(0,a.bM)(i,s.K.darkBorder).borderColor,(0,a.bM)(i,s.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,l.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),m)},p),o.createElement("div",{className:(0,l.q)(c("header"),"flex items-start")},d?o.createElement(d,{className:(0,l.q)(c("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,l.q)(c("title"),"font-semibold")},t)),o.createElement("p",{className:(0,l.q)(c("body"),"overflow-y-auto",u?"mt-2":"")},u))});d.displayName="Callout"},12011:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return w}});var n=t(57437),o=t(2265),s=t(99376),l=t(20831),a=t(94789),c=t(12514),d=t(49804),i=t(67101),m=t(84264),u=t(49566),p=t(96761),g=t(84566),f=t(19250),b=t(14474),h=t(13634),k=t(73002),x=t(3914);function w(){let[e]=h.Z.useForm(),r=(0,s.useSearchParams)();(0,x.e)("token");let t=r.get("invitation_id"),w=r.get("action"),[C,v]=(0,o.useState)(null),[N,y]=(0,o.useState)(""),[E,S]=(0,o.useState)(""),[j,_]=(0,o.useState)(null),[Z,I]=(0,o.useState)(""),[q,L]=(0,o.useState)(""),[M,T]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(0,f.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),T(!1)})},[]),(0,o.useEffect)(()=>{t&&!M&&(0,f.getOnboardingCredentials)(t).then(e=>{let r=e.login_url;console.log("login_url:",r),I(r);let t=e.token,n=(0,b.o)(t);L(t),console.log("decoded:",n),v(n.key),console.log("decoded user email:",n.user_email),S(n.user_email),_(n.user_id)})},[t,M]),(0,n.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,n.jsxs)(c.Z,{children:[(0,n.jsx)(p.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,n.jsx)(p.Z,{className:"text-xl",children:"reset_password"===w?"Reset Password":"Sign up"}),(0,n.jsx)(m.Z,{children:"reset_password"===w?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==w&&(0,n.jsx)(a.Z,{className:"mt-4",title:"SSO",icon:g.GH$,color:"sky",children:(0,n.jsxs)(i.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,n.jsx)(d.Z,{children:"SSO is under the Enterprise Tier."}),(0,n.jsx)(d.Z,{children:(0,n.jsx)(l.Z,{variant:"primary",className:"mb-2",children:(0,n.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,n.jsxs)(h.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",C,"token:",q,"formValues:",e),C&&q&&(e.user_email=E,j&&t&&(0,f.claimOnboardingToken)(C,t,j,e.password).then(e=>{let r="/ui/";r+="?login=success",document.cookie="token="+q,console.log("redirecting to:",r);let t=(0,f.getProxyBaseUrl)();console.log("proxyBaseUrl:",t),t?window.location.href=t+r:window.location.href=r}))},children:[(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.Z.Item,{label:"Email Address",name:"user_email",children:(0,n.jsx)(u.Z,{type:"email",disabled:!0,value:E,defaultValue:E,className:"max-w-md"})}),(0,n.jsx)(h.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===w?"Enter your new password":"Create a password for your account",children:(0,n.jsx)(u.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,n.jsx)("div",{className:"mt-10",children:(0,n.jsx)(k.ZP,{htmlType:"submit",children:"reset_password"===w?"Reset Password":"Sign Up"})})]})]})})}},14474:function(e,r,t){"use strict";t.d(r,{o:function(){return o}});class n extends Error{}function o(e,r){let t;if("string"!=typeof e)throw new n("Invalid token specified: must be a string");r||(r={});let o=!0===r.header?0:1,s=e.split(".")[o];if("string"!=typeof s)throw new n(`Invalid token specified: missing part #${o+1}`);try{t=function(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw Error("base64 string is not of the correct length")}try{var t;return t=r,decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(r)}}(s)}catch(e){throw new n(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new n(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}n.prototype.name="InvalidTokenError"}},function(e){e.O(0,[665,445,634,338,971,117,744],function(){return e(e.s=32922)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-acdf578c06ba6714.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-acdf578c06ba6714.jsnew file mode 100644index 00000000000..f7e8c6a96ad--- /dev/null+++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-acdf578c06ba6714.js@@ -0,0 +1 @@+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[461],{8672:function(e,r,t){Promise.resolve().then(t.bind(t,12011))},69262:function(e,r,t){"use strict";t.d(r,{Z:function(){return m}});var n=t(5853),o=t(2265);let s=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},l=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},a=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var c=t(96398),d=t(97324),i=t(1153);let m=o.forwardRef((e,r)=>{let{value:t,defaultValue:m,type:u,placeholder:p="Type...",icon:g,error:f=!1,errorMessage:b,disabled:h=!1,stepper:k,makeInputClassName:x,className:w,onChange:C,onValueChange:v,autoFocus:N}=e,y=(0,n._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[E,S]=(0,o.useState)(N||!1),[j,_]=(0,o.useState)(!1),Z=(0,o.useCallback)(()=>_(!j),[j,_]),I=(0,o.useRef)(null),q=(0,c.Uh)(t||m);return o.useEffect(()=>{let e=()=>S(!0),r=()=>S(!1),t=I.current;return t&&(t.addEventListener("focus",e),t.addEventListener("blur",r),N&&t.focus()),()=>{t&&(t.removeEventListener("focus",e),t.removeEventListener("blur",r))}},[N]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,d.q)(x("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,c.um)(q,h,f),E&&(0,d.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),w)},g?o.createElement(g,{className:(0,d.q)(x("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,i.lq)([I,r]),defaultValue:m,value:t,type:j?"text":u,className:(0,d.q)(x("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",g?"pl-2":"pl-3",f?"pr-3":"pr-4",h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:h,"data-testid":"base-input",onChange:e=>{null==C||C(e),null==v||v(e.target.value)}},y)),"password"!==u||h?null:o.createElement("button",{className:(0,d.q)(x("toggleButton"),"mr-2"),type:"button",onClick:()=>Z(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(a,{className:(0,d.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(l,{className:(0,d.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),f?o.createElement(s,{className:(0,d.q)(x("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=k?k:null),f&&b?o.createElement("p",{className:(0,d.q)(x("errorMessage"),"text-sm text-red-500 mt-1")},b):null)});m.displayName="BaseInput"},49566:function(e,r,t){"use strict";t.d(r,{Z:function(){return c}});var n=t(5853),o=t(2265);t(97324);var s=t(1153),l=t(69262);let a=(0,s.fn)("TextInput"),c=o.forwardRef((e,r)=>{let{type:t="text"}=e,s=(0,n._T)(e,["type"]);return o.createElement(l.Z,Object.assign({ref:r,type:t,makeInputClassName:a},s))});c.displayName="TextInput"},96398:function(e,r,t){"use strict";t.d(r,{Uh:function(){return d},n0:function(){return a},qg:function(){return s},sl:function(){return l},um:function(){return c}});var n=t(97324),o=t(2265);let s=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(s).join(""):"object"==typeof e&&e?s(e.props.children):void 0;function l(e){let r=new Map;return o.Children.map(e,e=>{var t;r.set(e.props.value,null!==(t=s(e))&&void 0!==t?t:e.props.value)}),r}function a(e,r){return o.Children.map(r,r=>{var t;if((null!==(t=s(r))&&void 0!==t?t:r.props.value).toLowerCase().includes(e.toLowerCase()))return r})}let c=function(e,r){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,n.q)(r?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!r&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",r&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",t&&"text-red-500",t?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function d(e){return null!=e&&""!==e}},49804:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(97324),s=t(1153),l=t(2265),a=t(9496);let c=(0,s.fn)("Col"),d=l.forwardRef((e,r)=>{let{numColSpan:t=1,numColSpanSm:s,numColSpanMd:d,numColSpanLg:i,children:m,className:u}=e,p=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),g=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"";return l.createElement("div",Object.assign({ref:r,className:(0,o.q)(c("root"),(()=>{let e=g(t,a.PT),r=g(s,a.SP),n=g(d,a.VS),l=g(i,a._w);return(0,o.q)(e,r,n,l)})(),u)},p),m)});d.displayName="Col"},67101:function(e,r,t){"use strict";t.d(r,{Z:function(){return i}});var n=t(5853),o=t(97324),s=t(1153),l=t(2265),a=t(9496);let c=(0,s.fn)("Grid"),d=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"",i=l.forwardRef((e,r)=>{let{numItems:t=1,numItemsSm:s,numItemsMd:i,numItemsLg:m,children:u,className:p}=e,g=(0,n._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=d(t,a._m),b=d(s,a.LH),h=d(i,a.l5),k=d(m,a.N4),x=(0,o.q)(f,b,h,k);return l.createElement("div",Object.assign({ref:r,className:(0,o.q)(c("root"),"grid",x,p)},g),u)});i.displayName="Grid"},9496:function(e,r,t){"use strict";t.d(r,{LH:function(){return o},N4:function(){return l},PT:function(){return a},SP:function(){return c},VS:function(){return d},_m:function(){return n},_w:function(){return i},l5:function(){return s}});let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},o={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},s={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},l={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},a={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},c={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},d={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},i={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},94789:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),s=t(26898),l=t(97324),a=t(1153);let c=(0,a.fn)("Callout"),d=o.forwardRef((e,r)=>{let{title:t,icon:d,color:i,className:m,children:u}=e,p=(0,n._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:r,className:(0,l.q)(c("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",i?(0,l.q)((0,a.bM)(i,s.K.background).bgColor,(0,a.bM)(i,s.K.darkBorder).borderColor,(0,a.bM)(i,s.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,l.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),m)},p),o.createElement("div",{className:(0,l.q)(c("header"),"flex items-start")},d?o.createElement(d,{className:(0,l.q)(c("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,l.q)(c("title"),"font-semibold")},t)),o.createElement("p",{className:(0,l.q)(c("body"),"overflow-y-auto",u?"mt-2":"")},u))});d.displayName="Callout"},12011:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return w}});var n=t(57437),o=t(2265),s=t(99376),l=t(20831),a=t(94789),c=t(12514),d=t(49804),i=t(67101),m=t(84264),u=t(49566),p=t(96761),g=t(84566),f=t(19250),b=t(14474),h=t(13634),k=t(73002),x=t(3914);function w(){let[e]=h.Z.useForm(),r=(0,s.useSearchParams)();(0,x.e)("token");let t=r.get("invitation_id"),w=r.get("action"),[C,v]=(0,o.useState)(null),[N,y]=(0,o.useState)(""),[E,S]=(0,o.useState)(""),[j,_]=(0,o.useState)(null),[Z,I]=(0,o.useState)(""),[q,L]=(0,o.useState)(""),[M,T]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(0,f.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),T(!1)})},[]),(0,o.useEffect)(()=>{t&&!M&&(0,f.getOnboardingCredentials)(t).then(e=>{let r=e.login_url;console.log("login_url:",r),I(r);let t=e.token,n=(0,b.o)(t);L(t),console.log("decoded:",n),v(n.key),console.log("decoded user email:",n.user_email),S(n.user_email),_(n.user_id)})},[t,M]),(0,n.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,n.jsxs)(c.Z,{children:[(0,n.jsx)(p.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,n.jsx)(p.Z,{className:"text-xl",children:"reset_password"===w?"Reset Password":"Sign up"}),(0,n.jsx)(m.Z,{children:"reset_password"===w?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==w&&(0,n.jsx)(a.Z,{className:"mt-4",title:"SSO",icon:g.GH$,color:"sky",children:(0,n.jsxs)(i.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,n.jsx)(d.Z,{children:"SSO is under the Enterprise Tier."}),(0,n.jsx)(d.Z,{children:(0,n.jsx)(l.Z,{variant:"primary",className:"mb-2",children:(0,n.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,n.jsxs)(h.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",C,"token:",q,"formValues:",e),C&&q&&(e.user_email=E,j&&t&&(0,f.claimOnboardingToken)(C,t,j,e.password).then(e=>{let r="/ui/";r+="?login=success",document.cookie="token="+q,console.log("redirecting to:",r);let t=(0,f.getProxyBaseUrl)();console.log("proxyBaseUrl:",t),t?window.location.href=t+r:window.location.href=r}))},children:[(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.Z.Item,{label:"Email Address",name:"user_email",children:(0,n.jsx)(u.Z,{type:"email",disabled:!0,value:E,defaultValue:E,className:"max-w-md"})}),(0,n.jsx)(h.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===w?"Enter your new password":"Create a password for your account",children:(0,n.jsx)(u.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,n.jsx)("div",{className:"mt-10",children:(0,n.jsx)(k.ZP,{htmlType:"submit",children:"reset_password"===w?"Reset Password":"Sign Up"})})]})]})})}},14474:function(e,r,t){"use strict";t.d(r,{o:function(){return o}});class n extends Error{}function o(e,r){let t;if("string"!=typeof e)throw new n("Invalid token specified: must be a string");r||(r={});let o=!0===r.header?0:1,s=e.split(".")[o];if("string"!=typeof s)throw new n(`Invalid token specified: missing part #${o+1}`);try{t=function(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw Error("base64 string is not of the correct length")}try{var t;return t=r,decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(r)}}(s)}catch(e){throw new n(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new n(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}n.prototype.name="InvalidTokenError"}},function(e){e.O(0,[665,445,634,338,971,117,744],function(){return e(e.s=8672)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-ae1e298d739b09ba.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-ae1e298d739b09ba.jsnew file mode 100644index 00000000000..a502942992d--- /dev/null+++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-ae1e298d739b09ba.js@@ -0,0 +1 @@+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{36362:function(e,s,t){Promise.resolve().then(t.bind(t,58193))},12011:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return _}});var l=t(57437),a=t(2265),r=t(99376),i=t(20831),n=t(94789),o=t(12514),c=t(49804),d=t(67101),m=t(84264),u=t(49566),x=t(96761),h=t(84566),p=t(19250),g=t(14474),j=t(13634),f=t(73002),v=t(3914);function _(){let[e]=j.Z.useForm(),s=(0,r.useSearchParams)();(0,v.e)("token");let t=s.get("invitation_id"),_=s.get("action"),[y,b]=(0,a.useState)(null),[N,Z]=(0,a.useState)(""),[w,k]=(0,a.useState)(""),[S,C]=(0,a.useState)(null),[I,P]=(0,a.useState)(""),[A,E]=(0,a.useState)(""),[T,L]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(0,p.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),L(!1)})},[]),(0,a.useEffect)(()=>{t&&!T&&(0,p.getOnboardingCredentials)(t).then(e=>{let s=e.login_url;console.log("login_url:",s),P(s);let t=e.token,l=(0,g.o)(t);E(t),console.log("decoded:",l),b(l.key),console.log("decoded user email:",l.user_email),k(l.user_email),C(l.user_id)})},[t,T]),(0,l.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(x.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,l.jsx)(x.Z,{className:"text-xl",children:"reset_password"===_?"Reset Password":"Sign up"}),(0,l.jsx)(m.Z,{children:"reset_password"===_?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==_&&(0,l.jsx)(n.Z,{className:"mt-4",title:"SSO",icon:h.GH$,color:"sky",children:(0,l.jsxs)(d.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,l.jsx)(c.Z,{children:"SSO is under the Enterprise Tier."}),(0,l.jsx)(c.Z,{children:(0,l.jsx)(i.Z,{variant:"primary",className:"mb-2",children:(0,l.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,l.jsxs)(j.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",y,"token:",A,"formValues:",e),y&&A&&(e.user_email=w,S&&t&&(0,p.claimOnboardingToken)(y,t,S,e.password).then(e=>{let s="/ui/";s+="?login=success",document.cookie="token="+A,console.log("redirecting to:",s);let t=(0,p.getProxyBaseUrl)();console.log("proxyBaseUrl:",t),t?window.location.href=t+s:window.location.href=s}))},children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(j.Z.Item,{label:"Email Address",name:"user_email",children:(0,l.jsx)(u.Z,{type:"email",disabled:!0,value:w,defaultValue:w,className:"max-w-md"})}),(0,l.jsx)(j.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===_?"Enter your new password":"Create a password for your account",children:(0,l.jsx)(u.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,l.jsx)("div",{className:"mt-10",children:(0,l.jsx)(f.ZP,{htmlType:"submit",children:"reset_password"===_?"Reset Password":"Sign Up"})})]})]})})}},58193:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return nI}});var l,a,r,i,n,o,c=t(57437),d=t(2265),m=t(99376),u=t(14474),x=t(21623),h=t(29827),p=t(65373),g=t(19250);let j=async(e,s,t,l,a)=>{let r;r="Admin"!=t&&"Admin Viewer"!=t?await (0,g.teamListCall)(e,(null==l?void 0:l.organization_id)||null,s):await (0,g.teamListCall)(e,(null==l?void 0:l.organization_id)||null),console.log("givenTeams: ".concat(r)),a(r)};var f=t(49804),v=t(67101),_=t(20831),y=t(49566),b=t(87452),N=t(88829),Z=t(72208),w=t(84264),k=t(96761),S=t(29233),C=t(52787),I=t(13634),P=t(41021),A=t(91679),E=t(29967),T=t(73002),L=t(64482),O=t(30150),M=e=>{let{step:s=.01,style:t={width:"100%"},placeholder:l="Enter a numerical value",min:a,max:r,onChange:i,...n}=e;return(0,c.jsx)(O.Z,{onWheel:e=>e.currentTarget.blur(),step:s,style:t,placeholder:l,min:a,max:r,onChange:i,...n})};let D=async(e,s,t)=>{try{if(null===e||null===s)return;if(null!==t){let l=(await (0,g.modelAvailableCall)(t,e,s,!0,null,!0)).data.map(e=>e.id),a=[],r=[];return l.forEach(e=>{e.endsWith("/*")?a.push(e):r.push(e)}),[...a,...r]}}catch(e){console.error("Error fetching user models:",e)}},F=e=>{if(e.endsWith("/*")){let s=e.replace("/*","");return"All ".concat(s," models")}return e},R=(e,s)=>{let t=[],l=[];return console.log("teamModels",e),console.log("allModels",s),e.forEach(e=>{if(e.endsWith("/*")){let a=e.replace("/*",""),r=s.filter(e=>e.startsWith(a+"/"));l.push(...r),t.push(e)}else l.push(e)}),[...t,...l].filter((e,s,t)=>t.indexOf(e)===s)};var q=t(20577),U=t(15424),z=t(89970);let V=(e,s)=>["metadata","config","enforced_params","aliases"].includes(e)||"json"===s.format,K=e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}},B=(e,s,t)=>{let l={max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"}[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[t]||"Text input";return V(e,s)?"".concat(l,"\nMust be valid JSON format"):s.enum?"Select from available options\nAllowed values: ".concat(s.enum.join(", ")):l};var G=e=>{let{schemaComponent:s,excludedFields:t=[],form:l,overrideLabels:a={},overrideTooltips:r={},customValidation:i={},defaultValues:n={}}=e,[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getOpenAPISchema)()).components.schemas[s];if(!e)throw Error('Schema component "'.concat(s,'" not found'));m(e);let a={};Object.keys(e.properties).filter(e=>!t.includes(e)&&void 0!==n[e]).forEach(e=>{a[e]=n[e]}),l.setFieldsValue(a)}catch(e){console.error("Schema fetch error:",e),x(e instanceof Error?e.message:"Failed to fetch schema")}})()},[s,l,t]);let h=e=>{if(e.type)return e.type;if(e.anyOf){let s=e.anyOf.map(e=>e.type);if(s.includes("number")||s.includes("integer"))return"number";s.includes("string")}return"string"},p=(e,s)=>{var t;let l;let d=h(s),m=null==o?void 0:null===(t=o.required)||void 0===t?void 0:t.includes(e),u=a[e]||s.title||e,x=r[e]||s.description,p=[];m&&p.push({required:!0,message:"".concat(u," is required")}),i[e]&&p.push({validator:i[e]}),V(e,s)&&p.push({validator:async(e,s)=>{if(s&&!K(s))throw Error("Please enter valid JSON")}});let g=x?(0,c.jsxs)("span",{children:[u," ",(0,c.jsx)(z.Z,{title:x,children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}):u;return l=V(e,s)?(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):s.enum?(0,c.jsx)(C.default,{children:s.enum.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"number"===d||"integer"===d?(0,c.jsx)(q.Z,{style:{width:"100%"},precision:"integer"===d?0:void 0}):"duration"===e?(0,c.jsx)(y.Z,{placeholder:"eg: 30s, 30h, 30d"}):(0,c.jsx)(y.Z,{placeholder:x||""}),(0,c.jsx)(I.Z.Item,{label:g,name:e,className:"mt-8",rules:p,initialValue:n[e],help:(0,c.jsx)("div",{className:"text-xs text-gray-500",children:B(e,s,d)}),children:l},e)};return u?(0,c.jsxs)("div",{className:"text-red-500",children:["Error: ",u]}):(null==o?void 0:o.properties)?(0,c.jsx)("div",{children:Object.entries(o.properties).filter(e=>{let[s]=e;return!t.includes(s)}).map(e=>{let[s,t]=e;return p(s,t)})}):null},H=e=>{let{onChange:s,value:t,className:l,accessToken:a,placeholder:r="Select vector stores",disabled:i=!1}=e,[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a){u(!0);try{let e=await (0,g.vectorStoreListCall)(a);e.data&&o(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{u(!1)}}})()},[a]),(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:r,onChange:s,value:t,loading:m,className:l,options:n.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:i})})},J=e=>{let{teams:s,value:t,onChange:l,disabled:a}=e;return console.log("disabled",a),(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Search or select a team",value:t,onChange:l,disabled:a,filterOption:(e,t)=>{if(!t)return!1;let l=null==s?void 0:s.find(e=>e.team_id===t.key);if(!l)return!1;let a=e.toLowerCase().trim(),r=(l.team_alias||"").toLowerCase(),i=(l.team_id||"").toLowerCase();return r.includes(a)||i.includes(a)},optionFilterProp:"children",children:null==s?void 0:s.map(e=>(0,c.jsxs)(C.default.Option,{value:e.team_id,children:[(0,c.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,c.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})},Y=t(23496),W=t(12514),$=t(91777),Q=t(82182),X=t(22452),ee=t(74998);(l=i||(i={})).Braintrust="Braintrust",l.CustomCallbackAPI="Custom Callback API",l.Datadog="Datadog",l.Langfuse="Langfuse",l.LangSmith="LangSmith",l.Lago="Lago",l.OpenMeter="OpenMeter",l.OTel="Open Telemetry",l.S3="S3",l.Arize="Arize";let es={Braintrust:"braintrust",CustomCallbackAPI:"custom_callback_api",Datadog:"datadog",Langfuse:"langfuse",LangSmith:"langsmith",Lago:"lago",OpenMeter:"openmeter",OTel:"otel",S3:"s3",Arize:"arize"},et=Object.fromEntries(Object.entries(es).map(e=>{let[s,t]=e;return[t,s]})),el=e=>e.map(e=>et[e]||e),ea=e=>e.map(e=>es[e]||e),er="/assets/logos/",ei={Langfuse:{logo:"".concat(er,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"}},Arize:{logo:"".concat(er,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"text"}},LangSmith:{logo:"".concat(er,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text"}},Braintrust:{logo:"".concat(er,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{}},"Custom Callback API":{logo:"".concat(er,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{}},Datadog:{logo:"".concat(er,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{}},Lago:{logo:"".concat(er,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{}},OpenMeter:{logo:"".concat(er,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{}},"Open Telemetry":{logo:"".concat(er,"otel.png"),supports_key_team_logging:!1,dynamic_params:{}},S3:{logo:"".concat(er,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{}}},{Option:en}=C.default;var eo=e=>{let{value:s=[],onChange:t,disabledCallbacks:l=[],onDisabledCallbacksChange:a}=e,r=Object.entries(ei).filter(e=>{let[s,t]=e;return t.supports_key_team_logging}).map(e=>{let[s,t]=e;return s}),i=Object.keys(ei),n=e=>{null==t||t(e)},o=e=>{n(s.filter((s,t)=>t!==e))},d=(e,t,l)=>{let a=[...s];if("callback_name"===t){let s=es[l]||l;a[e]={...a[e],[t]:s,callback_vars:{}}}else a[e]={...a[e],[t]:l};n(a)},m=(e,t,l)=>{let a=[...s];a[e]={...a[e],callback_vars:{...a[e].callback_vars,[t]:l}},n(a)},u=(e,s)=>{var t,l;if(!e.callback_name)return null;let a=null===(t=Object.entries(es).find(s=>{let[t,l]=s;return l===e.callback_name}))||void 0===t?void 0:t[0];if(!a)return null;let r=(null===(l=ei[a])||void 0===l?void 0:l.dynamic_params)||{};return 0===Object.keys(r).length?null:(0,c.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,c.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,c.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,c.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(r).map(t=>{let[l,a]=t;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,c.jsx)("span",{children:l.replace(/_/g," ")}),(0,c.jsx)(z.Z,{title:"Environment variable reference recommended: os.environ/".concat(l.toUpperCase()),children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===a&&(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"})]}),(0,c.jsx)(y.Z,{type:"password"===a?"password":"text",placeholder:"os.environ/".concat(l.toUpperCase()),value:e.callback_vars[l]||"",onChange:e=>m(s,l,e.target.value)})]},l)})})]})};return(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)($.Z,{className:"w-5 h-5 text-red-500"}),(0,c.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,c.jsx)(z.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help"})})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:l,onChange:e=>{let s=ea(e);null==a||a(s)},style:{width:"100%"},optionLabelProp:"label",children:i.map(e=>{var s;let t=null===(s=ei[e])||void 0===s?void 0:s.logo;return(0,c.jsx)(en,{value:e,label:e,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:e,className:"w-4 h-4 object-contain"}),(0,c.jsx)("span",{children:e})]})},e)})}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,c.jsx)(Y.Z,{}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(Q.Z,{className:"w-5 h-5 text-blue-500"}),(0,c.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,c.jsx)(z.Z,{title:"Configure callback logging integrations for this team.",children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help"})})]}),(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{n([...s,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:X.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,c.jsx)("div",{className:"space-y-4",children:s.map((e,s)=>{var t,l;let a=e.callback_name?null===(t=Object.entries(es).find(s=>{let[t,l]=s;return l===e.callback_name}))||void 0===t?void 0:t[0]:void 0,i=a?null===(l=ei[a])||void 0===l?void 0:l.logo:null;return(0,c.jsxs)(W.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,c.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[i&&(0,c.jsx)("img",{src:i,alt:a,className:"w-5 h-5 object-contain"}),(0,c.jsxs)("span",{className:"text-sm font-medium",children:[a||"New Integration"," Configuration"]})]}),(0,c.jsx)(_.Z,{variant:"light",onClick:()=>o(s),icon:ee.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,c.jsx)(C.default,{value:a,placeholder:"Select integration",onChange:e=>d(s,"callback_name",e),className:"w-full",optionLabelProp:"label",children:r.map(e=>{var s;let t=null===(s=ei[e])||void 0===s?void 0:s.logo;return(0,c.jsx)(en,{value:e,label:e,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:e,className:"w-4 h-4 object-contain"}),(0,c.jsx)("span",{children:e})]})},e)})})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,c.jsxs)(C.default,{value:e.callback_type,onChange:e=>d(s,"callback_type",e),className:"w-full",children:[(0,c.jsx)(en,{value:"success",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{children:"Success Only"})]})}),(0,c.jsx)(en,{value:"failure",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,c.jsx)("span",{children:"Failure Only"})]})}),(0,c.jsx)(en,{value:"success_and_failure",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),u(e,s)]})]},s)})}),0===s.length&&(0,c.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,c.jsx)(Q.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,c.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,c.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})},ec=function(e){let{value:s,onChange:t,premiumUser:l=!1,disabledCallbacks:a=[],onDisabledCallbacksChange:r}=e;return l?(0,c.jsx)(eo,{value:s,onChange:t,disabledCallbacks:a,onDisabledCallbacksChange:r}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,c.jsxs)(w.Z,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})},ed=t(57365),em=t(93192);function eu(e){let{isInvitationLinkModalVisible:s,setIsInvitationLinkModalVisible:t,baseUrl:l,invitationLinkData:a,modalType:r="invitation"}=e,{Title:i,Paragraph:n}=em.default,o=()=>{if(!l)return"";let e=new URL(l).pathname,s=e&&"/"!==e?"".concat(e,"/ui"):"ui";if(null==a?void 0:a.has_user_setup_sso)return new URL(s,l).toString();let t="".concat(s,"?invitation_id=").concat(null==a?void 0:a.id);return"resetPassword"===r&&(t+="&action=reset_password"),new URL(t,l).toString()};return(0,c.jsxs)(A.Z,{title:"invitation"===r?"Invitation Link":"Reset Password Link",visible:s,width:800,footer:null,onOk:()=>{t(!1)},onCancel:()=>{t(!1)},children:[(0,c.jsx)(n,{children:"invitation"===r?"Copy and send the generated link to onboard this user to the proxy.":"Copy and send the generated link to the user to reset their password."}),(0,c.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,c.jsx)(w.Z,{className:"text-base",children:"User ID"}),(0,c.jsx)(w.Z,{children:null==a?void 0:a.user_id})]}),(0,c.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,c.jsx)(w.Z,{children:"invitation"===r?"Invitation Link":"Reset Password Link"}),(0,c.jsx)(w.Z,{children:(0,c.jsx)(w.Z,{children:o()})})]}),(0,c.jsx)("div",{className:"flex justify-end mt-5",children:(0,c.jsx)(S.CopyToClipboard,{text:o(),onCopy:()=>P.ZP.success("Copied!"),children:(0,c.jsx)(_.Z,{variant:"primary",children:"invitation"===r?"Copy invitation link":"Copy password reset link"})})})]})}var ex=t(85010),eh=t(72188),ep=t(73879),eg=t(34310),ej=t(38434),ef=t(26349),ev=t(35291),e_=t(3632),ey=t(15452),eb=t.n(ey),eN=t(71157),eZ=t(44643),ew=t(88532),ek=e=>{let{accessToken:s,teams:t,possibleUIRoles:l,onUsersCreated:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(null),[k,C]=(0,d.useState)("http://localhost:4000");(0,d.useEffect)(()=>{(async()=>{try{let e=await (0,g.getProxyUISettings)(s);Z(e)}catch(e){console.error("Error fetching UI settings:",e)}})(),C(new URL("/",window.location.href).toString())},[s]);let I=async()=>{u(!0);let e=n.map(e=>({...e,status:"pending"}));o(e);let t=!1;for(let a=0;a<e.length;a++){var l,r,i;let n=e[a];try{let e={user_email:n.user_email,user_role:n.user_role};if(n.teams&&"string"==typeof n.teams&&""!==n.teams.trim()&&(e.teams=n.teams.split(",").map(e=>e.trim()).filter(Boolean),0===e.teams.length&&delete e.teams),n.models&&"string"==typeof n.models&&""!==n.models.trim()&&(e.models=n.models.split(",").map(e=>e.trim()).filter(Boolean),0===e.models.length&&delete e.models),n.max_budget&&""!==n.max_budget.toString().trim()){let s=parseFloat(n.max_budget.toString());!isNaN(s)&&s>0&&(e.max_budget=s)}n.budget_duration&&""!==n.budget_duration.trim()&&(e.budget_duration=n.budget_duration.trim()),n.metadata&&"string"==typeof n.metadata&&""!==n.metadata.trim()&&(e.metadata=n.metadata.trim()),console.log("Sending user data:",e);let r=await (0,g.userCreateCall)(s,null,e);if(console.log("Full response:",r),r&&(r.key||r.user_id)){t=!0,console.log("Success case triggered");let e=(null===(l=r.data)||void 0===l?void 0:l.user_id)||r.user_id;try{if(null==N?void 0:N.SSO_ENABLED){let e=new URL("/ui",k).toString();o(s=>s.map((s,t)=>t===a?{...s,status:"success",key:r.key||r.user_id,invitation_link:e}:s))}else{let t=await (0,g.invitationCreateCall)(s,e),l=new URL("/ui?invitation_id=".concat(t.id),k).toString();o(e=>e.map((e,s)=>s===a?{...e,status:"success",key:r.key||r.user_id,invitation_link:l}:e))}}catch(e){console.error("Error creating invitation:",e),o(e=>e.map((e,s)=>s===a?{...e,status:"success",key:r.key||r.user_id,error:"User created but failed to generate invitation link"}:e))}}else{console.log("Error case triggered");let e=(null==r?void 0:r.error)||"Failed to create user";console.log("Error message:",e),o(s=>s.map((s,t)=>t===a?{...s,status:"failed",error:e}:s))}}catch(s){console.error("Caught error:",s);let e=(null==s?void 0:null===(i=s.response)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.error)||(null==s?void 0:s.message)||String(s);o(s=>s.map((s,t)=>t===a?{...s,status:"failed",error:e}:s))}}u(!1),t&&a&&a()};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_.Z,{className:"mb-0",onClick:()=>i(!0),children:"+ Bulk Invite Users"}),(0,c.jsx)(A.Z,{title:"Bulk Invite Users",visible:r,width:800,onCancel:()=>i(!1),bodyStyle:{maxHeight:"70vh",overflow:"auto"},footer:null,children:(0,c.jsx)("div",{className:"flex flex-col",children:0===n.length?(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"1"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Download and fill the template"})]}),(0,c.jsxs)("div",{className:"ml-11 mb-6",children:[(0,c.jsx)("p",{className:"mb-4",children:"Add multiple users at once by following these steps:"}),(0,c.jsxs)("ol",{className:"list-decimal list-inside space-y-2 ml-2 mb-4",children:[(0,c.jsx)("li",{children:"Download our CSV template"}),(0,c.jsx)("li",{children:"Add your users' information to the spreadsheet"}),(0,c.jsx)("li",{children:"Save the file and upload it here"}),(0,c.jsx)("li",{children:"After creation, download the results file containing the API keys for each user"})]}),(0,c.jsxs)("div",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 mb-4",children:[(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Template Column Names"}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"user_email"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"User's email address (required)"})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"user_role"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'User\'s role (one of: "proxy_admin", "proxy_admin_view_only", "internal_user", "internal_user_view_only")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"teams"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated team IDs (e.g., "team-1,team-2")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"max_budget"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Maximum budget as a number (e.g., "100")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"budget_duration"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Budget reset period (e.g., "30d", "1mo")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"models"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated allowed models (e.g., "gpt-3.5-turbo,gpt-4")'})]})]})]})]}),(0,c.jsxs)(_.Z,{onClick:()=>{let e=new Blob([eb().unparse([["user_email","user_role","teams","max_budget","budget_duration","models"],["[email protected]","internal_user","team-id-1,team-id-2","100","30d","gpt-3.5-turbo,gpt-4"]])],{type:"text/csv"}),s=window.URL.createObjectURL(e),t=document.createElement("a");t.href=s,t.download="bulk_users_template.csv",document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(s)},size:"lg",className:"w-full md:w-auto",children:[(0,c.jsx)(ep.Z,{className:"mr-2"})," Download CSV Template"]})]}),(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"2"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Upload your completed CSV"})]}),(0,c.jsxs)("div",{className:"ml-11",children:[y?(0,c.jsxs)("div",{className:"mb-4 p-4 rounded-md border ".concat(f?"bg-red-50 border-red-200":"bg-blue-50 border-blue-200"),children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[f?(0,c.jsx)(eg.Z,{className:"text-red-500 text-xl mr-3"}):(0,c.jsx)(ej.Z,{className:"text-blue-500 text-xl mr-3"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(em.default.Text,{strong:!0,className:f?"text-red-800":"text-blue-800",children:y.name}),(0,c.jsxs)(em.default.Text,{className:"block text-xs ".concat(f?"text-red-600":"text-blue-600"),children:[(y.size/1024).toFixed(1)," KB • ",new Date().toLocaleDateString()]})]})]}),(0,c.jsxs)(_.Z,{size:"xs",variant:"secondary",onClick:()=>{b(null),o([]),h(null),j(null),v(null)},className:"flex items-center",children:[(0,c.jsx)(ef.Z,{className:"mr-1"})," Remove"]})]}),f?(0,c.jsxs)("div",{className:"mt-3 text-red-600 text-sm flex items-start",children:[(0,c.jsx)(ev.Z,{className:"mr-2 mt-0.5"}),(0,c.jsx)("span",{children:f})]}):!p&&(0,c.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1.5",children:(0,c.jsx)("div",{className:"bg-blue-500 h-1.5 rounded-full w-full animate-pulse"})}),(0,c.jsx)("span",{className:"ml-2 text-xs text-blue-600",children:"Processing..."})]})]}):(0,c.jsx)(ex.default,{beforeUpload:e=>((h(null),j(null),v(null),b(e),"text/csv"===e.type||e.name.endsWith(".csv"))?e.size>5242880?v("File is too large (".concat((e.size/1048576).toFixed(1)," MB). Please upload a CSV file smaller than 5MB.")):eb().parse(e,{complete:e=>{if(!e.data||0===e.data.length){j("The CSV file appears to be empty. Please upload a file with data."),o([]);return}if(1===e.data.length){j("The CSV file only contains headers but no user data. Please add user data to your CSV."),o([]);return}let s=e.data[0];if(0===s.length||1===s.length&&""===s[0]){j("The CSV file doesn't contain any column headers. Please make sure your CSV has headers."),o([]);return}let l=["user_email","user_role"].filter(e=>!s.includes(e));if(l.length>0){j("Your CSV is missing these required columns: ".concat(l.join(", "),". Please add these columns to your CSV file.")),o([]);return}try{let l=e.data.slice(1).map((e,l)=>{var a,r,i,n,o,c;if(0===e.length||1===e.length&&""===e[0])return null;if(e.length<s.length)return{rowNumber:l+2,isValid:!1,error:"Row ".concat(l+2," has fewer columns than the header row. Please ensure all data is properly formatted."),user_email:"",user_role:""};let d={user_email:(null===(a=e[s.indexOf("user_email")])||void 0===a?void 0:a.trim())||"",user_role:(null===(r=e[s.indexOf("user_role")])||void 0===r?void 0:r.trim())||"",teams:null===(i=e[s.indexOf("teams")])||void 0===i?void 0:i.trim(),max_budget:null===(n=e[s.indexOf("max_budget")])||void 0===n?void 0:n.trim(),budget_duration:null===(o=e[s.indexOf("budget_duration")])||void 0===o?void 0:o.trim(),models:null===(c=e[s.indexOf("models")])||void 0===c?void 0:c.trim(),rowNumber:l+2,isValid:!0,error:""},m=[];if(d.user_email?d.user_email.includes("@")&&d.user_email.includes(".")||m.push("Invalid email format (must contain @ and domain)"):m.push("Email is required"),d.user_role){let e=["proxy_admin","proxy_admin_view_only","internal_user","internal_user_view_only"];e.includes(d.user_role)||m.push('Invalid role "'.concat(d.user_role,'". Must be one of: ').concat(e.join(", ")))}else m.push("Role is required");if(d.max_budget&&""!==d.max_budget.toString().trim()&&(isNaN(parseFloat(d.max_budget.toString()))?m.push('Max budget "'.concat(d.max_budget,'" must be a number')):0>=parseFloat(d.max_budget.toString())&&m.push("Max budget must be greater than 0")),d.budget_duration&&!d.budget_duration.match(/^\d+[dhmwy]$|^\d+mo$/)&&m.push('Invalid budget duration format "'.concat(d.budget_duration,'". Use format like "30d", "1mo", "2w", "6h"')),d.teams&&"string"==typeof d.teams&&t&&t.length>0){let e=t.map(e=>e.team_id),s=d.teams.split(",").map(e=>e.trim()).filter(s=>!e.includes(s));s.length>0&&m.push("Unknown team(s): ".concat(s.join(", ")))}return m.length>0&&(d.isValid=!1,d.error=m.join(", ")),d}).filter(Boolean),a=l.filter(e=>e.isValid);o(l),0===l.length?j("No valid data rows found in the CSV file. Please check your file format."):0===a.length?h("No valid users found in the CSV. Please check the errors below and fix your CSV file."):a.length<l.length?h("Found ".concat(l.length-a.length," row(s) with errors out of ").concat(l.length," total rows. Please correct them before proceeding.")):P.ZP.success("Successfully parsed ".concat(a.length," users"))}catch(s){let e=s instanceof Error?s.message:"Unknown error";h("Error parsing CSV: ".concat(e)),o([])}},error:e=>{h("Failed to parse CSV file: ".concat(e.message)),o([])},header:!1}):(v("Invalid file type: ".concat(e.name,". Please upload a CSV file (.csv extension).")),P.ZP.error("Invalid file type. Please upload a CSV file.")),!1),accept:".csv",maxCount:1,showUploadList:!1,children:(0,c.jsxs)("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-500 transition-colors cursor-pointer",children:[(0,c.jsx)(e_.Z,{className:"text-3xl text-gray-400 mb-2"}),(0,c.jsx)("p",{className:"mb-1",children:"Drag and drop your CSV file here"}),(0,c.jsx)("p",{className:"text-sm text-gray-500 mb-3",children:"or"}),(0,c.jsx)(_.Z,{size:"sm",children:"Browse files"}),(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-4",children:"Only CSV files (.csv) are supported"})]})}),p&&(0,c.jsx)("div",{className:"mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(ew.Z,{className:"h-5 w-5 text-yellow-500 mr-2 mt-0.5"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(em.default.Text,{strong:!0,className:"text-yellow-800",children:"CSV Structure Error"}),(0,c.jsx)(em.default.Paragraph,{className:"text-yellow-700 mt-1 mb-0",children:p}),(0,c.jsx)(em.default.Paragraph,{className:"text-yellow-700 mt-2 mb-0",children:"Please download our template and ensure your CSV follows the required format."})]})]})})]})]}):(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"3"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:n.some(e=>"success"===e.status||"failed"===e.status)?"User Creation Results":"Review and create users"})]}),x&&(0,c.jsx)("div",{className:"ml-11 mb-4 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(ev.Z,{className:"text-red-500 mr-2 mt-1"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-red-600 font-medium",children:x}),n.some(e=>!e.isValid)&&(0,c.jsxs)("ul",{className:"mt-2 list-disc list-inside text-red-600 text-sm",children:[(0,c.jsx)("li",{children:"Check the table below for specific errors in each row"}),(0,c.jsx)("li",{children:"Common issues include invalid email formats, missing required fields, or incorrect role values"}),(0,c.jsx)("li",{children:"Fix these issues in your CSV file and upload again"})]})]})]})}),(0,c.jsxs)("div",{className:"ml-11",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,c.jsx)("div",{className:"flex items-center",children:n.some(e=>"success"===e.status||"failed"===e.status)?(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{className:"text-lg font-medium mr-3",children:"Creation Summary"}),(0,c.jsxs)(w.Z,{className:"text-sm bg-green-100 text-green-800 px-2 py-1 rounded mr-2",children:[n.filter(e=>"success"===e.status).length," Successful"]}),n.some(e=>"failed"===e.status)&&(0,c.jsxs)(w.Z,{className:"text-sm bg-red-100 text-red-800 px-2 py-1 rounded",children:[n.filter(e=>"failed"===e.status).length," Failed"]})]}):(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{className:"text-lg font-medium mr-3",children:"User Preview"}),(0,c.jsxs)(w.Z,{className:"text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded",children:[n.filter(e=>e.isValid).length," of ",n.length," users valid"]})]})}),!n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",children:"Back"}),(0,c.jsx)(_.Z,{onClick:I,disabled:0===n.filter(e=>e.isValid).length||m,children:m?"Creating...":"Create ".concat(n.filter(e=>e.isValid).length," Users")})]})]}),n.some(e=>"success"===e.status)&&(0,c.jsx)("div",{className:"mb-4 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"mr-3 mt-1",children:(0,c.jsx)(eZ.Z,{className:"h-5 w-5 text-blue-500"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-blue-800",children:"User creation complete"}),(0,c.jsxs)(w.Z,{className:"block text-sm text-blue-700 mt-1",children:[(0,c.jsx)("span",{className:"font-medium",children:"Next step:"})," Download the credentials file containing API keys and invitation links. Users will need these API keys to make LLM requests through LiteLLM."]})]})]})}),(0,c.jsx)(eh.Z,{dataSource:n,columns:[{title:"Row",dataIndex:"rowNumber",key:"rowNumber",width:80},{title:"Email",dataIndex:"user_email",key:"user_email"},{title:"Role",dataIndex:"user_role",key:"user_role"},{title:"Teams",dataIndex:"teams",key:"teams"},{title:"Budget",dataIndex:"max_budget",key:"max_budget"},{title:"Status",key:"status",render:(e,s)=>s.isValid?s.status&&"pending"!==s.status?"success"===s.status?(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(eZ.Z,{className:"h-5 w-5 text-green-500 mr-2"}),(0,c.jsx)("span",{className:"text-green-500",children:"Success"})]}),s.invitation_link&&(0,c.jsx)("div",{className:"mt-1",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{className:"text-xs text-gray-500 truncate max-w-[150px]",children:s.invitation_link}),(0,c.jsx)(S.CopyToClipboard,{text:s.invitation_link,onCopy:()=>P.ZP.success("Invitation link copied!"),children:(0,c.jsx)("button",{className:"ml-1 text-blue-500 text-xs hover:text-blue-700",children:"Copy"})})]})})]}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(eN.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsx)("span",{className:"text-red-500",children:"Failed"})]}),s.error&&(0,c.jsx)("span",{className:"text-sm text-red-500 ml-7",children:JSON.stringify(s.error)})]}):(0,c.jsx)("span",{className:"text-gray-500",children:"Pending"}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(eN.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsx)("span",{className:"text-red-500",children:"Invalid"})]}),s.error&&(0,c.jsx)("span",{className:"text-sm text-red-500 ml-7",children:s.error})]})}],size:"small",pagination:{pageSize:5},scroll:{y:300},rowClassName:e=>e.isValid?"":"bg-red-50"}),!n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",className:"mr-3",children:"Back"}),(0,c.jsx)(_.Z,{onClick:I,disabled:0===n.filter(e=>e.isValid).length||m,children:m?"Creating...":"Create ".concat(n.filter(e=>e.isValid).length," Users")})]}),n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",className:"mr-3",children:"Start New Bulk Import"}),(0,c.jsxs)(_.Z,{onClick:()=>{let e=n.map(e=>({user_email:e.user_email,user_role:e.user_role,status:e.status,key:e.key||"",invitation_link:e.invitation_link||"",error:e.error||""})),s=new Blob([eb().unparse(e)],{type:"text/csv"}),t=window.URL.createObjectURL(s),l=document.createElement("a");l.href=t,l.download="bulk_users_results.csv",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(t)},variant:"primary",className:"flex items-center",children:[(0,c.jsx)(ep.Z,{className:"mr-2"})," Download User Credentials"]})]})]})]})})})]})};let{Option:eS}=C.default,eC=()=>"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let s=16*Math.random()|0;return("x"==e?s:3&s|8).toString(16)});var eI=e=>{let{userID:s,accessToken:t,teams:l,possibleUIRoles:a,onUserCreated:r,isEmbedded:i=!1}=e,n=(0,h.NL)(),[o,m]=(0,d.useState)(null),[u]=I.Z.useForm(),[x,p]=(0,d.useState)(!1),[j,f]=(0,d.useState)(!1),[v,S]=(0,d.useState)([]),[E,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(null),[R,q]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=async()=>{try{let e=await (0,g.modelAvailableCall)(t,s,"any"),l=[];for(let s=0;s<e.data.length;s++){let t=e.data[s];l.push(t.id)}console.log("Model data response:",e.data),console.log("Available models:",l),S(l);let a=await (0,g.getProxyUISettings)(t);console.log("uiSettingsResponse:",a),m(a)}catch(e){console.error("Error fetching model data:",e)}};q((0,g.getProxyBaseUrl)()),e()},[]);let V=async e=>{var l,a,c;try{P.ZP.info("Making API Call"),i||p(!0),e.models&&0!==e.models.length||"proxy_admin"===e.user_role||(console.log("formValues.user_role",e.user_role),e.models=["no-default-models"]),console.log("formValues in create user:",e);let a=await (0,g.userCreateCall)(t,null,e);await n.invalidateQueries({queryKey:["userList"]}),console.log("user create Response:",a),f(!0);let c=(null===(l=a.data)||void 0===l?void 0:l.user_id)||a.user_id;if(r&&i){r(c),u.resetFields();return}if(null==o?void 0:o.SSO_ENABLED){let e={id:eC(),user_id:c,is_accepted:!1,accepted_at:null,expires_at:new Date(Date.now()+6048e5),created_at:new Date,created_by:s,updated_at:new Date,updated_by:s,has_user_setup_sso:!0};D(e),O(!0)}else(0,g.invitationCreateCall)(t,c).then(e=>{e.has_user_setup_sso=!1,D(e),O(!0)});P.ZP.success("API user Created"),u.resetFields(),localStorage.removeItem("userData"+s)}catch(s){let e=(null===(c=s.response)||void 0===c?void 0:null===(a=c.data)||void 0===a?void 0:a.detail)||(null==s?void 0:s.message)||"Error creating the user";P.ZP.error(e),console.error("Error creating the user:",s)}};return i?(0,c.jsxs)(I.Z,{form:u,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"User Email",name:"user_email",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"User Role",name:"user_role",children:(0,c.jsx)(C.default,{children:a&&Object.entries(a).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ed.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",children:(0,c.jsx)(C.default,{placeholder:"Select Team ID",style:{width:"100%"},children:l?l.map(e=>(0,c.jsx)(eS,{value:e.team_id,children:e.team_alias},e.team_id)):(0,c.jsx)(eS,{value:null,children:"Default Team"},"default")})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create User"})})]}):(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{className:"mb-0",onClick:()=>p(!0),children:"+ Invite User"}),(0,c.jsx)(ek,{accessToken:t,teams:l,possibleUIRoles:a}),(0,c.jsxs)(A.Z,{title:"Invite User",visible:x,width:800,footer:null,onOk:()=>{p(!1),u.resetFields()},onCancel:()=>{p(!1),f(!1),u.resetFields()},children:[(0,c.jsx)(w.Z,{className:"mb-1",children:"Create a User who can own keys"}),(0,c.jsxs)(I.Z,{form:u,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"User Email",name:"user_email",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Global Proxy Role"," ",(0,c.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,c.jsx)(U.Z,{})})]}),name:"user_role",children:(0,c.jsx)(C.default,{children:a&&Object.entries(a).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ed.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",className:"gap-2",name:"team_id",help:"If selected, user will be added as a 'user' role to the team.",children:(0,c.jsx)(C.default,{placeholder:"Select Team ID",style:{width:"100%"},children:l?l.map(e=>(0,c.jsx)(eS,{value:e.team_id,children:e.team_alias},e.team_id)):(0,c.jsx)(eS,{value:null,children:"Default Team"},"default")})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsxs)(b.Z,{children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)(k.Z,{children:"Personal Key Creation"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)(I.Z.Item,{className:"gap-2",label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"Models user has access to, outside of team scope.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",help:"Models user has access to, outside of team scope.",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),v.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})})})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create User"})})]})]}),j&&(0,c.jsx)(eu,{isInvitationLinkModalVisible:E,setIsInvitationLinkModalVisible:O,baseUrl:R||"",invitationLinkData:M})]})},eP=t(7310),eA=t.n(eP),eE=t(20347);let{Option:eT}=C.default,eL=e=>e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";var eO=e=>{let{value:s,onChange:t,className:l="",style:a={}}=e;return(0,c.jsxs)(C.default,{style:{width:"100%",...a},value:s||void 0,onChange:t,className:l,placeholder:"n/a",children:[(0,c.jsx)(eT,{value:"24h",children:"daily"}),(0,c.jsx)(eT,{value:"7d",children:"weekly"}),(0,c.jsx)(eT,{value:"30d",children:"monthly"})]})};function eM(e,s){let t=structuredClone(e);for(let[e,l]of Object.entries(s))e in t&&(t[e]=l);return t}let eD=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null==e?"-":e.toLocaleString("en-US",{minimumFractionDigits:s,maximumFractionDigits:s})},eF=async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;try{return await navigator.clipboard.writeText(e),P.ZP.success(s),!0}catch(e){return P.ZP.error("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}};var eR=e=>{let{onChange:s,value:t,className:l,accessToken:a,placeholder:r="Select MCP servers",disabled:i=!1}=e,[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(a){h(!0);try{let[e,s]=await Promise.all([(0,g.fetchMCPServers)(a),(0,g.fetchMCPAccessGroups)(a)]),t=Array.isArray(e)?e:e.data||[],l=Array.isArray(s)?s:s.data||[];o(t),u(l)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[a]);let p=[...m.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...n.map(e=>({label:"".concat(e.server_name||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.server_name||e.server_id," ").concat(e.server_id," MCP Server")}))],j=[...(null==t?void 0:t.servers)||[],...(null==t?void 0:t.accessGroups)||[]];return(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:r,onChange:e=>{s({servers:e.filter(e=>!m.includes(e)),accessGroups:e.filter(e=>m.includes(e))})},value:j,loading:x,className:l,showSearch:!0,style:{width:"100%"},disabled:i,filterOption:(e,s)=>{var t;return((null===(t=p.find(e=>e.value===(null==s?void 0:s.value)))||void 0===t?void 0:t.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:p.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,label:e.label,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,c.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,c.jsx)("span",{style:{flex:1},children:e.label}),(0,c.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})};let{Option:eq}=C.default,eU=e=>{let s=[];if(console.log("data:",JSON.stringify(e)),e)for(let t of e)t.metadata&&t.metadata.tags&&s.push(...t.metadata.tags);let t=Array.from(new Set(s)).map(e=>({value:e,label:e}));return console.log("uniqueTags:",t),t},ez=async(e,s,t,l)=>{try{if(null===e||null===s)return[];if(null!==t){let a=(await (0,g.modelAvailableCall)(t,e,s,!0,l,!0)).data.map(e=>e.id);return console.log("available_model_names:",a),a}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},eV=async(e,s,t,l)=>{try{if(null===e||null===s)return;if(null!==t){let a=(await (0,g.modelAvailableCall)(t,e,s)).data.map(e=>e.id);console.log("available_model_names:",a),l(a)}}catch(e){console.error("Error fetching user models:",e)}};var eK=e=>{let{userID:s,team:t,teams:l,userRole:a,accessToken:r,data:i,addKey:n,premiumUser:o=!1}=e,[m]=I.Z.useForm(),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(null),[j,O]=(0,d.useState)(null),[D,R]=(0,d.useState)([]),[q,V]=(0,d.useState)([]),[K,B]=(0,d.useState)("you"),[Y,W]=(0,d.useState)(eU(i)),[$,Q]=(0,d.useState)([]),[X,ee]=(0,d.useState)([]),[es,et]=(0,d.useState)(t),[el,er]=(0,d.useState)(!1),[ei,en]=(0,d.useState)(null),[eo,ed]=(0,d.useState)({}),[em,eu]=(0,d.useState)([]),[ex,eh]=(0,d.useState)(!1),[ep,eg]=(0,d.useState)([]),[ej,ef]=(0,d.useState)(!1),[ev,e_]=(0,d.useState)([]),[ey,eb]=(0,d.useState)("default"),eN=()=>{x(!1),m.resetFields(),ee([]),e_([]),eb("default")},eZ=()=>{x(!1),p(null),et(null),m.resetFields(),ee([]),e_([]),eb("default")};(0,d.useEffect)(()=>{s&&a&&r&&eV(s,a,r,R)},[r,s,a]);let ew=async()=>{try{if(null==r)return;let e=await (0,g.fetchMCPAccessGroups)(r);eg(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,d.useEffect)(()=>{ew()},[r]),(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getGuardrailsList)(r)).guardrails.map(e=>e.guardrail_name);Q(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[r]),(0,d.useEffect)(()=>{(async()=>{try{if(r){let e=sessionStorage.getItem("possibleUserRoles");if(e)ed(JSON.parse(e));else{let e=await (0,g.getPossibleUserRoles)(r);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),ed(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[r]);let ek=q.includes("no-default-models")&&!es,eS=async e=>{try{var t,l,a,o,c;let d;let u=null!==(a=null==e?void 0:e.key_alias)&&void 0!==a?a:"",h=null!==(o=null==e?void 0:e.team_id)&&void 0!==o?o:null;if((null!==(c=null==i?void 0:i.filter(e=>e.team_id===h).map(e=>e.key_alias))&&void 0!==c?c:[]).includes(u))throw Error("Key alias ".concat(u," already exists for team with ID ").concat(h,", please provide another key alias"));P.ZP.info("Making API Call"),x(!0),"you"===K&&(e.user_id=s);let j={};try{j=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===K&&(j.service_account_id=e.key_alias),X.length>0&&(j={...j,logging:X.filter(e=>e.callback_name)}),ev.length>0){let e=ea(ev);j={...j,litellm_disabled_callbacks:e}}if(e.metadata=JSON.stringify(j),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0)){e.object_permission||(e.object_permission={});let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),d="service_account"===K?await (0,g.keyCreateServiceAccountCall)(r,e):await (0,g.keyCreateCall)(r,s,e),console.log("key create Response:",d),n(d),p(d.key),O(d.soft_budget),P.ZP.success("API Key Created"),m.resetFields(),localStorage.removeItem("userData"+s)}catch(e){console.log("error in create key:",e),P.ZP.error("Error creating the key: ".concat(e))}};(0,d.useEffect)(()=>{if(s&&a&&r){var e;ez(s,a,r,null!==(e=null==es?void 0:es.team_id)&&void 0!==e?e:null).then(e=>{var s;V(Array.from(new Set([...null!==(s=null==es?void 0:es.models)&&void 0!==s?s:[],...e])))})}m.setFieldValue("models",[])},[es,r,s,a]);let eC=async e=>{if(!e){eu([]);return}eh(!0);try{let s=new URLSearchParams;if(s.append("user_email",e),null==r)return;let t=(await (0,g.userFilterUICall)(r,s)).map(e=>({label:"".concat(e.user_email," (").concat(e.user_id,")"),value:e.user_id,user:e}));eu(t)}catch(e){console.error("Error fetching users:",e),P.ZP.error("Failed to search for users")}finally{eh(!1)}},eP=(0,d.useCallback)(eA()(e=>eC(e),300),[r]),eT=(e,s)=>{let t=s.user;m.setFieldsValue({user_id:t.user_id})};return(0,c.jsxs)("div",{children:[a&&eE.LQ.includes(a)&&(0,c.jsx)(_.Z,{className:"mx-auto",onClick:()=>x(!0),children:"+ Create New Key"}),(0,c.jsx)(A.Z,{visible:u,width:1e3,footer:null,onOk:eN,onCancel:eZ,children:(0,c.jsxs)(I.Z,{form:m,onFinish:eS,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(k.Z,{className:"mb-4",children:"Key Ownership"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Owned By"," ",(0,c.jsx)(z.Z,{title:"Select who will own this API key",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,c.jsxs)(E.ZP.Group,{onChange:e=>B(e.target.value),value:K,children:[(0,c.jsx)(E.ZP,{value:"you",children:"You"}),(0,c.jsx)(E.ZP,{value:"service_account",children:"Service Account"}),"Admin"===a&&(0,c.jsx)(E.ZP,{value:"another_user",children:"Another User"})]})}),"another_user"===K&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["User ID"," ",(0,c.jsx)(z.Z,{title:"The user who will own this key and be responsible for its usage",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===K,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{eP(e)},onSelect:(e,s)=>eT(e,s),options:em,loading:ex,allowClear:!0,style:{width:"100%"},notFoundContent:ex?"Searching...":"No users found"}),(0,c.jsx)(T.ZP,{onClick:()=>er(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Team"," ",(0,c.jsx)(z.Z,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:t?t.team_id:null,className:"mt-4",children:(0,c.jsx)(J,{teams:l,onChange:e=>{et((null==l?void 0:l.find(s=>s.team_id===e))||null)}})})]}),ek&&(0,c.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your API key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!ek&&(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(k.Z,{className:"mb-4",children:"Key Details"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["you"===K||"another_user"===K?"Key Name":"Service Account ID"," ",(0,c.jsx)(z.Z,{title:"you"===K||"another_user"===K?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:"Please input a ".concat("you"===K?"key name":"service account ID")}],help:"required",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",rules:"management"===ey||"read_only"===ey?[]:[{required:!0,message:"Please select a model"}],help:"management"===ey||"read_only"===ey?"Models field is disabled for this key type":"required",className:"mt-4",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===ey||"read_only"===ey,onChange:e=>{e.includes("all-team-models")&&m.setFieldsValue({models:["all-team-models"]})},children:[(0,c.jsx)(eq,{value:"all-team-models",children:"All Team Models"},"all-team-models"),q.map(e=>(0,c.jsx)(eq,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Key Type"," ",(0,c.jsx)(z.Z,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"default",className:"mt-4",children:(0,c.jsxs)(C.default,{defaultValue:"default",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{eb(e),("management"===e||"read_only"===e)&&m.setFieldsValue({models:[]})},children:[(0,c.jsx)(eq,{value:"default",label:"Default",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call LLM API + Management routes"})]})}),(0,c.jsx)(eq,{value:"llm_api",label:"LLM API",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"LLM API"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only LLM API routes (chat/completions, embeddings, etc.)"})]})}),(0,c.jsx)(eq,{value:"management",label:"Management",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})}),(0,c.jsx)(eq,{value:"read_only",label:"Read Only",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Read Only"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can only call only info routes (e.g. /key/info, /user/info, /team/info)"})]})})]})})]}),!ek&&(0,c.jsx)("div",{className:"mb-8",children:(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",onClick:()=>{ej||(ew(),ef(!0))},children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)(k.Z,{className:"m-0",children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Max Budget (USD)"," ",(0,c.jsx)(z.Z,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==t?void 0:t.max_budget)!==null&&(null==t?void 0:t.max_budget)!==void 0?null==t?void 0:t.max_budget:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.max_budget&&s>t.max_budget)throw Error("Budget cannot exceed team max budget: $".concat(eD(t.max_budget,4)))}}],children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Reset Budget"," ",(0,c.jsx)(z.Z,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:"Team Reset Budget: ".concat((null==t?void 0:t.budget_duration)!==null&&(null==t?void 0:t.budget_duration)!==void 0?null==t?void 0:t.budget_duration:"None"),children:(0,c.jsx)(eO,{onChange:e=>m.setFieldValue("budget_duration",e)})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,c.jsx)(z.Z,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==t?void 0:t.tpm_limit)!==null&&(null==t?void 0:t.tpm_limit)!==void 0?null==t?void 0:t.tpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.tpm_limit&&s>t.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(t.tpm_limit))}}],children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,c.jsx)(z.Z,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==t?void 0:t.rpm_limit)!==null&&(null==t?void 0:t.rpm_limit)!==void 0?null==t?void 0:t.rpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.rpm_limit&&s>t.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(t.rpm_limit))}}],children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Expire Key"," ",(0,c.jsx)(z.Z,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days)",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"duration",className:"mt-4",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:$.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,c.jsx)(H,{onChange:e=>m.setFieldValue("allowed_vector_store_ids",e),value:m.getFieldValue("allowed_vector_store_ids"),accessToken:r,placeholder:"Select vector stores (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers or access groups this key can access. ",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this key can access. ",children:(0,c.jsx)(eR,{onChange:e=>m.setFieldValue("allowed_mcp_servers_and_groups",e),value:m.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:r,placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Tags"," ",(0,c.jsx)(z.Z,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Enter tags",tokenSeparators:[","],options:Y})}),(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Logging Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(ec,{value:X,onChange:ee,premiumUser:o,disabledCallbacks:ev,onDisabledCallbacksChange:e_})})})]}),(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("b",{children:"Advanced Settings"}),(0,c.jsx)(z.Z,{title:(0,c.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,c.jsx)("a",{href:g.proxyBaseUrl?"".concat(g.proxyBaseUrl,"/#/key%20management/generate_key_fn_key_generate_post"):"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,c.jsx)(U.Z,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)(G,{schemaComponent:"GenerateKeyRequest",form:m,excludedFields:["key_alias","team_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit"]})})]})]})]})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",disabled:ek,style:{opacity:ek?.5:1},children:"Create Key"})})]})}),el&&(0,c.jsx)(A.Z,{title:"Create New User",visible:el,onCancel:()=>er(!1),footer:null,width:800,children:(0,c.jsx)(eI,{userID:s,accessToken:r,teams:l,possibleUIRoles:eo,onUserCreated:e=>{en(e),m.setFieldsValue({user_id:e}),er(!1)},isEmbedded:!0})}),h&&(0,c.jsx)(A.Z,{visible:u,onOk:eN,onCancel:eZ,footer:null,children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Save your Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,c.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,c.jsx)(f.Z,{numColSpan:1,children:null!=h?(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"API Key:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:h})}),(0,c.jsx)(S.CopyToClipboard,{text:h,onCopy:()=>{P.ZP.success("API Key copied to clipboard")},children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,c.jsx)(w.Z,{children:"Key being created, this might take 30s"})})]})})]})},eB=t(7366),eG=e=>{let{selectedTeam:s,currentOrg:t,selectedKeyAlias:l,accessToken:a,createClicked:r}=e,[i,n]=(0,d.useState)({keys:[],total_count:0,current_page:1,total_pages:0}),[o,c]=(0,d.useState)(!0),[m,u]=(0,d.useState)(null),x=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(console.log("calling fetchKeys"),!a){console.log("accessToken",a);return}c(!0);let s="number"==typeof e.page?e.page:1,t="number"==typeof e.pageSize?e.pageSize:100,l=await (0,g.keyListCall)(a,null,null,null,null,null,s,t);console.log("data",l),n(l),u(null)}catch(e){u(e instanceof Error?e:Error("An error occurred"))}finally{c(!1)}};return(0,d.useEffect)(()=>{x(),console.log("selectedTeam",s,"currentOrg",t,"accessToken",a,"selectedKeyAlias",l)},[s,t,a,l,r]),{keys:i.keys,isLoading:o,error:m,pagination:{currentPage:i.current_page,totalPages:i.total_pages,totalCount:i.total_count},refresh:x,setKeys:e=>{n(s=>{let t="function"==typeof e?e(s.keys):e;return{...s,keys:t}})}}},eH=t(27281),eJ=t(41649),eY=t(12485),eW=t(18135),e$=t(35242),eQ=t(29706),eX=t(77991),e0=t(10900),e1=t(23628),e2=e=>{let{value:s,onChange:t,disabledCallbacks:l=[],onDisabledCallbacksChange:a}=e;return(0,c.jsx)(eo,{value:s,onChange:t,disabledCallbacks:l,onDisabledCallbacksChange:a})};let e4=["logging"],e5=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!e4.includes(s)})):{},e6=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],e3=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(e5(e),null,s)};function e8(e){var s,t,l,a,r,i,n;let{keyData:o,onCancel:m,onSubmit:u,teams:x,accessToken:h,userID:p,userRole:j,premiumUser:f=!1}=e,[v]=I.Z.useForm(),[b,N]=(0,d.useState)([]),Z=null==x?void 0:x.find(e=>e.team_id===o.team_id),[w,k]=(0,d.useState)([]),[S,P]=(0,d.useState)([]),[A,E]=(0,d.useState)(!1),[O,D]=(0,d.useState)(Array.isArray(null===(s=o.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?el(o.metadata.litellm_disabled_callbacks):[]);(0,d.useEffect)(()=>{(async()=>{if(p&&j&&h)try{if(null===o.team_id){let e=(await (0,g.modelAvailableCall)(h,p,j)).data.map(e=>e.id);k(e)}else if(null==Z?void 0:Z.team_id){let e=await ez(p,j,h,Z.team_id);k(Array.from(new Set([...Z.models,...e])))}}catch(e){console.error("Error fetching models:",e)}})()},[p,j,h,Z,o.team_id]),(0,d.useEffect)(()=>{v.setFieldValue("disabled_callbacks",O)},[v,O]);let F={...o,budget_duration:(n=o.budget_duration)&&({"24h":"daily","7d":"weekly","30d":"monthly"})[n]||null,metadata:e3(o.metadata),guardrails:(null===(t=o.metadata)||void 0===t?void 0:t.guardrails)||[],vector_stores:(null===(l=o.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=o.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(r=o.object_permission)||void 0===r?void 0:r.mcp_access_groups)||[]},logging_settings:e6(o.metadata),disabled_callbacks:Array.isArray(null===(i=o.metadata)||void 0===i?void 0:i.litellm_disabled_callbacks)?el(o.metadata.litellm_disabled_callbacks):[]};return(0,c.jsxs)(I.Z,{form:v,onFinish:u,initialValues:F,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[w.length>0&&(0,c.jsx)(C.default.Option,{value:"all-team-models",children:"All Team Models"}),w.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"daily",children:"Daily"}),(0,c.jsx)(C.default.Option,{value:"weekly",children:"Weekly"}),(0,c.jsx)(C.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,c.jsx)(I.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,c.jsx)(I.Z.Item,{label:"Guardrails",name:"guardrails",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails"})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>v.setFieldValue("vector_stores",e),value:v.getFieldValue("vector_stores"),accessToken:h||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(eR,{onChange:e=>v.setFieldValue("mcp_servers_and_groups",e),value:v.getFieldValue("mcp_servers_and_groups"),accessToken:h||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",children:(0,c.jsx)(C.default,{placeholder:"Select team",style:{width:"100%"},children:null==x?void 0:x.map(e=>(0,c.jsx)(C.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,c.jsx)(I.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,c.jsx)(e2,{value:v.getFieldValue("logging_settings"),onChange:e=>v.setFieldValue("logging_settings",e),disabledCallbacks:O,onDisabledCallbacksChange:e=>{D(el(e)),v.setFieldValue("disabled_callbacks",e)}})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:10})}),(0,c.jsx)(I.Z.Item,{name:"token",hidden:!0,children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,c.jsx)(L.default,{})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{onClick:m,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]})}function e7(e){let{selectedToken:s,visible:t,onClose:l,accessToken:a,premiumUser:r,setAccessToken:i,onKeyUpdate:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(null),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),[b,N]=(0,d.useState)(!1),[Z,C]=(0,d.useState)(!1),[E,T]=(0,d.useState)(null);(0,d.useEffect)(()=>{t&&s&&a&&(o.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),T(a),C(s.key_name===a))},[t,s,o,a]),(0,d.useEffect)(()=>{t||(u(null),N(!1),C(!1),T(null),o.resetFields())},[t,o]);let L=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,eB.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,eB.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,eB.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,d.useEffect)(()=>{(null==x?void 0:x.duration)?j(L(x.duration)):j(null)},[null==x?void 0:x.duration]);let O=async()=>{if(s&&E){N(!0);try{let e=await o.validateFields(),t=await (0,g.regenerateKeyCall)(E,s.token||s.token_id,e);u(t.key),P.ZP.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let l={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?L(e.duration):s.expires,...t};console.log("Updated key data with new token:",l),Z&&(T(t.key),i&&i(t.key)),n&&n(l),N(!1)}catch(e){console.error("Error regenerating key:",e),P.ZP.error("Failed to regenerate API Key"),N(!1)}}},M=()=>{u(null),N(!1),C(!1),T(null),o.resetFields(),l()};return(0,c.jsx)(A.Z,{title:"Regenerate API Key",open:t,onCancel:M,footer:m?[(0,c.jsx)(_.Z,{onClick:M,children:"Close"},"close")]:[(0,c.jsx)(_.Z,{onClick:M,className:"mr-2",children:"Cancel"},"cancel"),(0,c.jsx)(_.Z,{onClick:O,disabled:b,children:b?"Regenerating...":"Regenerate"},"regenerate")],children:m?(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Regenerated Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons, ",(0,c.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,c.jsxs)(f.Z,{numColSpan:1,children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"Key Alias:"}),(0,c.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,c.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,c.jsx)(w.Z,{className:"mt-3",children:"New API Key:"}),(0,c.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,c.jsx)("pre",{className:"break-words whitespace-normal",children:m})}),(0,c.jsx)(S.CopyToClipboard,{text:m,onCopy:()=>P.ZP.success("API Key copied to clipboard"),children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,c.jsxs)(I.Z,{form:o,layout:"vertical",onValuesChange:e=>{"duration"in e&&h(s=>({...s,duration:e.duration}))},children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,c.jsx)(y.Z,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),p&&(0,c.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",p]})]})})}var e9=t(79814),se=function(e){let{vectorStores:s,accessToken:t}=e,[l,a]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,g.vectorStoreListCall)(t);e.data&&a(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,s.length]);let r=e=>{let s=l.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(e9.Z,{className:"h-4 w-4 text-blue-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,c.jsx)(eJ.Z,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:r(e)},s))}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(e9.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},ss=t(25327),st=function(e){let{mcpServers:s,mcpAccessGroups:l=[],accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(a&&s.length>0)try{let e=await (0,g.fetchMCPServers)(a);e&&Array.isArray(e)?i(e):e.data&&Array.isArray(e.data)&&i(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[a,s.length]),(0,d.useEffect)(()=>{(async()=>{if(a&&l.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(a));o(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[a,l.length]);let m=e=>{let s=r.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}return e},u=e=>e,x=[...s.map(e=>({type:"server",value:e})),...l.map(e=>({type:"accessGroup",value:e}))],h=x.length;return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(ss.Z,{className:"h-4 w-4 text-gray-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,c.jsx)(eJ.Z,{color:"gray",size:"xs",children:h})]}),h>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:x.map((e,s)=>"server"===e.type?(0,c.jsx)(z.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium cursor-help",children:m(e.value)})},s):(0,c.jsxs)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium",children:[(0,c.jsx)("span",{className:"inline-block w-2 h-2 bg-green-500 rounded-full mr-2"}),u(e.value)," ",(0,c.jsx)("span",{className:"ml-1 text-xs text-green-500",children:"(Access Group)"})]},s))}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(ss.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},sl=function(e){let{objectPermission:s,variant:t="card",className:l="",accessToken:a}=e,r=(null==s?void 0:s.vector_stores)||[],i=(null==s?void 0:s.mcp_servers)||[],n=(null==s?void 0:s.mcp_access_groups)||[],o=(0,c.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,c.jsx)(se,{vectorStores:r,accessToken:a}),(0,c.jsx)(st,{mcpServers:i,mcpAccessGroups:n,accessToken:a})]});return"card"===t?(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,c.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),o]}):(0,c.jsxs)("div",{className:"".concat(l),children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),o]})},sa=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:l="card",className:a=""}=e,r=e=>{var s;return(null===(s=Object.entries(es).find(s=>{let[t,l]=s;return l===e}))||void 0===s?void 0:s[0])||e},i=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},n=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},o=(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(Q.Z,{className:"h-4 w-4 text-blue-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,c.jsx)(eJ.Z,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,c.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let l=r(e.callback_name),a=null===(t=ei[l])||void 0===t?void 0:t.logo;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[a?(0,c.jsx)("img",{src:a,alt:l,className:"w-5 h-5 object-contain"}):(0,c.jsx)(Q.Z,{className:"h-5 w-5 text-gray-400"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-blue-800",children:l}),(0,c.jsxs)(w.Z,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,c.jsx)(eJ.Z,{color:i(e.callback_type),size:"sm",children:n(e.callback_type)})]},s)})}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(Q.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)($.Z,{className:"h-4 w-4 text-red-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,c.jsx)(eJ.Z,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,c.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let l=et[e]||e,a=null===(t=ei[l])||void 0===t?void 0:t.logo;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[a?(0,c.jsx)("img",{src:a,alt:l,className:"w-5 h-5 object-contain"}):(0,c.jsx)($.Z,{className:"h-5 w-5 text-gray-400"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-red-800",children:l}),(0,c.jsx)(w.Z,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,c.jsx)(eJ.Z,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)($.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===l?(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(a),children:[(0,c.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),o]}):(0,c.jsxs)("div",{className:"".concat(a),children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),o]})},sr=t(30401),si=t(78867);function sn(e){var s,t,l,a;let{keyId:r,onClose:i,keyData:n,accessToken:o,userID:m,userRole:u,teams:x,onKeyDataUpdate:h,onDelete:p,premiumUser:j,setAccessToken:f}=e,[y,b]=(0,d.useState)(!1),[N]=I.Z.useForm(),[Z,S]=(0,d.useState)(!1),[C,A]=(0,d.useState)(!1),[E,L]=(0,d.useState)({}),[O,M]=(0,d.useState)(n),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)(!1);if((0,d.useEffect)(()=>{n&&M(n)},[n]),(0,d.useEffect)(()=>{if(R){let e=setTimeout(()=>{q(!1)},5e3);return()=>clearTimeout(e)}},[R]),!O)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:i,className:"mb-4",children:"Back to Keys"}),(0,c.jsx)(w.Z,{children:"Key not found"})]});let U=async e=>{try{var s,t,l,a;if(!o)return;let r=e.token;if(e.key=r,void 0!==e.vector_stores&&(e.object_permission={...O.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...O.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},delete e.mcp_servers_and_groups}if(e.metadata&&"string"==typeof e.metadata)try{let l=JSON.parse(e.metadata);e.metadata={...l,...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:ea(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),P.ZP.error("Invalid metadata JSON");return}else e.metadata={...e.metadata||{},...(null===(l=e.guardrails)||void 0===l?void 0:l.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(a=e.disabled_callbacks)||void 0===a?void 0:a.length)>0?{litellm_disabled_callbacks:ea(e.disabled_callbacks)}:{}};delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let i=await (0,g.keyUpdateCall)(o,e);M(e=>e?{...e,...i}:void 0),h&&h(i),P.ZP.success("Key updated successfully"),b(!1)}catch(e){P.ZP.error("Failed to update key"),console.error("Error updating key:",e)}},V=async()=>{try{if(!o)return;await (0,g.keyDeleteCall)(o,O.token||O.token_id),P.ZP.success("Key deleted successfully"),p&&p(),i()}catch(e){console.error("Error deleting the key:",e),P.ZP.error("Failed to delete key")}},K=async(e,s)=>{await eF(e)&&(L(e=>({...e,[s]:!0})),setTimeout(()=>{L(e=>({...e,[s]:!1}))},2e3))},B=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),l=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(l)};return(0,c.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:i,className:"mb-4",children:"Back to Keys"}),(0,c.jsx)(k.Z,{children:O.key_alias||"API Key"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono text-sm",children:O.token_id||O.token})]}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:E["key-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>K(O.token_id||O.token,"key-id"),className:"ml-2 transition-all duration-200".concat(E["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,c.jsx)(w.Z,{className:"text-sm text-gray-500",children:O.updated_at&&O.updated_at!==O.created_at?"Updated: ".concat(B(O.updated_at)):"Created: ".concat(B(O.created_at))}),R&&(0,c.jsx)(eJ.Z,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),D&&(0,c.jsx)(eJ.Z,{color:"blue",size:"xs",children:"Regenerated"})]})]}),u&&eE.LQ.includes(u)&&(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(z.Z,{title:j?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,c.jsx)("span",{className:"inline-block",children:(0,c.jsx)(_.Z,{icon:e1.Z,variant:"secondary",onClick:()=>A(!0),className:"flex items-center",disabled:!j,children:"Regenerate Key"})})}),(0,c.jsx)(_.Z,{icon:ee.Z,variant:"secondary",onClick:()=>S(!0),className:"flex items-center",children:"Delete Key"})]})]}),(0,c.jsx)(e7,{selectedToken:O,visible:C,onClose:()=>A(!1),accessToken:o,premiumUser:j,setAccessToken:f,onKeyUpdate:e=>{M(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),F(new Date),q(!0),h&&h({...e,created_at:new Date().toLocaleString()})}}),Z&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:V,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>S(!1),children:"Cancel"})]})]})]})}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"}),(0,c.jsx)(eY.Z,{children:"Settings"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Spend"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eD(O.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null!==O.max_budget?"$".concat(eD(O.max_budget)):"Unlimited"]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",null!==O.tpm_limit?O.tpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",null!==O.rpm_limit?O.rpm_limit:"Unlimited"]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:O.models&&O.models.length>0?O.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s)):(0,c.jsx)(w.Z,{children:"No models specified"})})]}),(0,c.jsx)(W.Z,{children:(0,c.jsx)(sl,{objectPermission:O.object_permission,variant:"inline",accessToken:o})}),(0,c.jsx)(sa,{loggingConfigs:e6(O.metadata),disabledCallbacks:Array.isArray(null===(s=O.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?el(O.metadata.litellm_disabled_callbacks):[],variant:"card"})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Key Settings"}),!y&&u&&eE.LQ.includes(u)&&(0,c.jsx)(_.Z,{variant:"light",onClick:()=>b(!0),children:"Edit Settings"})]}),y?(0,c.jsx)(e8,{keyData:O,onCancel:()=>b(!1),onSubmit:U,teams:x,accessToken:o,userID:m,userRole:u}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Key ID"}),(0,c.jsx)(w.Z,{className:"font-mono",children:O.token_id||O.token})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Key Alias"}),(0,c.jsx)(w.Z,{children:O.key_alias||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Secret Key"}),(0,c.jsx)(w.Z,{className:"font-mono",children:O.key_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)(w.Z,{children:O.team_id||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization"}),(0,c.jsx)(w.Z,{children:O.organization_id||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:B(O.created_at)})]}),D&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Regenerated"}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:B(D)}),(0,c.jsx)(eJ.Z,{color:"green",size:"xs",children:"Recent"})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Expires"}),(0,c.jsx)(w.Z,{children:O.expires?B(O.expires):"Never"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Spend"}),(0,c.jsxs)(w.Z,{children:["$",eD(O.spend,4)," USD"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Budget"}),(0,c.jsx)(w.Z,{children:null!==O.max_budget?"$".concat(eD(O.max_budget,2)):"Unlimited"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:O.models&&O.models.length>0?O.models.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,c.jsx)(w.Z,{children:"No models specified"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)(w.Z,{children:["TPM: ",null!==O.tpm_limit?O.tpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",null!==O.rpm_limit?O.rpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Max Parallel Requests:"," ",null!==O.max_parallel_requests?O.max_parallel_requests:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Model TPM Limits:"," ",(null===(t=O.metadata)||void 0===t?void 0:t.model_tpm_limit)?JSON.stringify(O.metadata.model_tpm_limit):"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Model RPM Limits:"," ",(null===(l=O.metadata)||void 0===l?void 0:l.model_rpm_limit)?JSON.stringify(O.metadata.model_rpm_limit):"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:e3(O.metadata)})]}),(0,c.jsx)(sl,{objectPermission:O.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o}),(0,c.jsx)(sa,{loggingConfigs:e6(O.metadata),disabledCallbacks:Array.isArray(null===(a=O.metadata)||void 0===a?void 0:a.litellm_disabled_callbacks)?el(O.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}var so=t(2356),sc=e=>{let{options:s,onApplyFilters:t,onResetFilters:l,initialValues:a={},buttonLabel:r="Filters"}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(a),[u,x]=(0,d.useState)({}),[h,p]=(0,d.useState)({}),[g,j]=(0,d.useState)({}),f=(0,d.useCallback)(eA()(async(e,s)=>{if(s.isSearchable&&s.searchFn){p(e=>({...e,[s.name]:!0}));try{let t=await s.searchFn(e);x(e=>({...e,[s.name]:t}))}catch(e){console.error("Error searching:",e),x(e=>({...e,[s.name]:[]}))}finally{p(e=>({...e,[s.name]:!1}))}}},300),[]),v=(e,s)=>{let l={...o,[e]:s};m(l),t(l)};return(0,c.jsxs)("div",{className:"w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(so.Z,{className:"h-4 w-4"}),onClick:()=>n(!i),className:"flex items-center gap-2",children:r}),(0,c.jsx)(T.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),m(e),l()},children:"Reset Filters"})]}),i&&(0,c.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Key Hash","Model"].map(e=>{let t=s.find(s=>s.label===e||s.name===e);return t?(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsx)("label",{className:"text-sm text-gray-600",children:t.label||t.name}),t.isSearchable?(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(t.label||t.name,"..."),value:o[t.name]||void 0,onChange:e=>v(t.name,e),onSearch:e=>{j(s=>({...s,[t.name]:e})),t.searchFn&&f(e,t)},filterOption:!1,loading:h[t.name],options:u[t.name]||[],allowClear:!0}):t.options?(0,c.jsx)(C.default,{className:"w-full",placeholder:"Select ".concat(t.label||t.name,"..."),value:o[t.name]||void 0,onChange:e=>v(t.name,e),allowClear:!0,children:t.options.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))}):(0,c.jsx)(L.default,{className:"w-full",placeholder:"Enter ".concat(t.label||t.name,"..."),value:o[t.name]||"",onChange:e=>v(t.name,e.target.value),allowClear:!0})]},t.name):null})})]})},sd=t(16593);let sm=async e=>{if(!e)return[];try{let s=[],t=1,l=!0;for(;l;){let a=await (0,g.keyListCall)(e,null,"",null,null,null,t,100),r=a.keys.map(e=>e.key_alias).filter(Boolean);s=[...s,...r],t<a.total_pages?t++:l=!1}return Array.from(new Set(s))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},su=async(e,s)=>{if(!e)return[];try{let t=[],l=1,a=!0;for(;a;){let r=await (0,g.teamListCall)(e,s||null,null);t=[...t,...r],l<r.total_pages?l++:a=!1}return t}catch(e){return console.error("Error fetching all teams:",e),[]}},sx=async e=>{if(!e)return[];try{let s=[],t=1,l=!0;for(;l;){let a=await (0,g.organizationListCall)(e);s=[...s,...a],t<a.total_pages?t++:l=!1}return s}catch(e){return console.error("Error fetching all organizations:",e),[]}},sh=()=>{let[e,s]=(0,d.useState)("http://localhost:4000");return(0,d.useEffect)(()=>{{let{protocol:e,host:t}=window.location;s("".concat(e,"//").concat(t))}},[]),e};var sp=t(71594),sg=t(24525),sj=t(47323),sf=t(21626),sv=t(97214),s_=t(28241),sy=t(58834),sb=t(69552),sN=t(71876),sZ=t(86462),sw=t(47686),sk=t(44633),sS=t(49084);function sC(e){let{keys:s,setKeys:t,isLoading:l=!1,pagination:a,onPageChange:r,pageSize:i=50,teams:n,selectedTeam:o,setSelectedTeam:m,selectedKeyAlias:u,setSelectedKeyAlias:x,accessToken:h,userID:p,userRole:j,organizations:f,setCurrentOrg:v,refresh:y,onSortChange:b,currentSort:N,premiumUser:Z,setAccessToken:k}=e,[S,C]=(0,d.useState)(null),[I,P]=(0,d.useState)([]),[A,E]=d.useState(()=>N?[{id:N.sortBy,desc:"desc"===N.sortOrder}]:[{id:"created_at",desc:!0}]),[T,L]=(0,d.useState)({}),{filters:O,filteredKeys:M,allKeyAliases:D,allTeams:R,allOrganizations:q,handleFilterChange:U,handleFilterReset:V}=function(e){let{keys:s,teams:t,organizations:l,accessToken:a}=e,r={"Team ID":"","Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"},[i,n]=(0,d.useState)(r),[o,c]=(0,d.useState)(t||[]),[m,u]=(0,d.useState)(l||[]),[x,h]=(0,d.useState)(s),p=(0,d.useRef)(0),j=(0,d.useCallback)(eA()(async e=>{if(!a)return;let s=Date.now();p.current=s;try{let t=await (0,g.keyListCall)(a,e["Organization ID"]||null,e["Team ID"]||null,e["Key Alias"]||null,e["User ID"]||null,e["Key Hash"]||null,1,25,e["Sort By"]||null,e["Sort Order"]||null);s===p.current&&t&&(h(t.keys),console.log("called from debouncedSearch filters:",JSON.stringify(e)),console.log("called from debouncedSearch data:",JSON.stringify(t)))}catch(e){console.error("Error searching users:",e)}},300),[a]);(0,d.useEffect)(()=>{if(!s){h([]);return}let e=[...s];i["Team ID"]&&(e=e.filter(e=>e.team_id===i["Team ID"])),i["Organization ID"]&&(e=e.filter(e=>e.organization_id===i["Organization ID"])),h(e)},[s,i]),(0,d.useEffect)(()=>{let e=async()=>{let e=await su(a);e.length>0&&c(e);let s=await sx(a);s.length>0&&u(s)};a&&e()},[a]);let f=(0,sd.a)({queryKey:["allKeys"],queryFn:async()=>{if(!a)throw Error("Access token required");return await sm(a)},enabled:!!a}).data||[];return(0,d.useEffect)(()=>{t&&t.length>0&&c(e=>e.length<t.length?t:e)},[t]),(0,d.useEffect)(()=>{l&&l.length>0&&u(e=>e.length<l.length?l:e)},[l]),{filters:i,filteredKeys:x,allKeyAliases:f,allTeams:o,allOrganizations:m,handleFilterChange:e=>{n({"Team ID":e["Team ID"]||"","Organization ID":e["Organization ID"]||"","Key Alias":e["Key Alias"]||"","User ID":e["User ID"]||"","Sort By":e["Sort By"]||"created_at","Sort Order":e["Sort Order"]||"desc"}),j({...i,...e})},handleFilterReset:()=>{n(r),j(r)}}}({keys:s,teams:n,organizations:f,accessToken:h});(0,d.useEffect)(()=>{if(h){let e=s.map(e=>e.user_id).filter(e=>null!==e);(async()=>{P((await (0,g.userListCall)(h,e,1,100)).users)})()}},[h,s]),(0,d.useEffect)(()=>{if(y){let e=()=>{y()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},[y]);let K=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return s.getCanExpand()?(0,c.jsx)("button",{onClick:s.getToggleExpandedHandler(),style:{cursor:"pointer"},children:s.getIsExpanded()?"▼":"▶"}):null}},{id:"token",accessorKey:"token",header:"Key ID",cell:e=>(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.getValue(),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>C(e.getValue()),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",cell:e=>{let s=e.getValue();return(0,c.jsx)(z.Z,{title:s,children:s?s.length>20?"".concat(s.slice(0,20),"..."):s:"-"})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",cell:e=>(0,c.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"team_alias",accessorKey:"team_id",header:"Team Alias",cell:e=>{let{row:s,getValue:t}=e,l=t(),a=null==n?void 0:n.find(e=>e.team_id===l);return(null==a?void 0:a.team_alias)||"Unknown"}},{id:"team_id",accessorKey:"team_id",header:"Team ID",cell:e=>(0,c.jsx)(z.Z,{title:e.getValue(),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user_id",header:"User Email",cell:e=>{let s=e.getValue(),t=I.find(e=>e.user_id===s);return(null==t?void 0:t.user_email)?(0,c.jsx)(z.Z,{title:null==t?void 0:t.user_email,children:(0,c.jsxs)("span",{children:[null==t?void 0:t.user_email.slice(0,20),"..."]})}):"-"}},{id:"user_id",accessorKey:"user_id",header:"User ID",cell:e=>{let s=e.getValue();return s&&s.length>15?(0,c.jsx)(z.Z,{title:s,children:(0,c.jsxs)("span",{children:[s.slice(0,7),"..."]})}):s||"-"}},{id:"created_at",accessorKey:"created_at",header:"Created At",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",cell:e=>{let s=e.getValue();return s&&s.length>15?(0,c.jsx)(z.Z,{title:s,children:(0,c.jsxs)("span",{children:[s.slice(0,7),"..."]})}):s}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"Never"}},{id:"expires",accessorKey:"expires",header:"Expires",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",cell:e=>eD(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",cell:e=>{let s=e.getValue();return null===s?"Unlimited":"$".concat(eD(s))}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",cell:e=>{let s=e.getValue();return(0,c.jsx)("div",{className:"flex flex-col py-2",children:Array.isArray(s)?(0,c.jsx)("div",{className:"flex flex-col",children:0===s.length?(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[s.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sj.Z,{icon:T[e.row.id]?sZ.Z:sw.Z,className:"cursor-pointer",size:"xs",onClick:()=>{L(s=>({...s,[e.row.id]:!s[e.row.id]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),s.length>3&&!T[e.row.id]&&(0,c.jsx)(eJ.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",s.length-3," ",s.length-3==1?"more model":"more models"]})}),T[e.row.id]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:s.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:["TPM: ",null!==t.tpm_limit?t.tpm_limit:"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",null!==t.rpm_limit?t.rpm_limit:"Unlimited"]})]})}}];console.log("keys: ".concat(JSON.stringify(s)));let B=(0,sp.b7)({data:M,columns:K.filter(e=>"expander"!==e.id),state:{sorting:A},onSortingChange:e=>{let s="function"==typeof e?e(A):e;if(console.log("newSorting: ".concat(JSON.stringify(s))),E(s),s&&s.length>0){let e=s[0],t=e.id,l=e.desc?"desc":"asc";console.log("sortBy: ".concat(t,", sortOrder: ").concat(l)),U({...O,"Sort By":t,"Sort Order":l}),null==b||b(t,l)}},getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0,manualSorting:!1});return d.useEffect(()=>{N&&E([{id:N.sortBy,desc:"desc"===N.sortOrder}])},[N]),(0,c.jsx)("div",{className:"w-full h-full overflow-hidden",children:S?(0,c.jsx)(sn,{keyId:S,onClose:()=>C(null),keyData:M.find(e=>e.token===S),onKeyDataUpdate:e=>{t(s=>s.map(s=>s.token===e.token?eM(s,e):s)),y&&y()},onDelete:()=>{t(e=>e.filter(e=>e.token!==S)),y&&y()},accessToken:h,userID:p,userRole:j,teams:R,premiumUser:Z,setAccessToken:k}):(0,c.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,c.jsx)("div",{className:"w-full mb-6",children:(0,c.jsx)(sc,{options:[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>R&&0!==R.length?R.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Organization ID",label:"Organization ID",isSearchable:!0,searchFn:async e=>q&&0!==q.length?q.filter(s=>{var t,l;return null!==(l=null===(t=s.organization_id)||void 0===t?void 0:t.toLowerCase().includes(e.toLowerCase()))&&void 0!==l&&l}).filter(e=>null!==e.organization_id&&void 0!==e.organization_id).map(e=>({label:"".concat(e.organization_id||"Unknown"," (").concat(e.organization_id,")"),value:e.organization_id})):[]},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>D.filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))},{name:"User ID",label:"User ID",isSearchable:!1},{name:"Key Hash",label:"Key Hash",isSearchable:!1}],onApplyFilters:U,initialValues:O,onResetFilters:V})}),(0,c.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[(0,c.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",l?"...":"".concat((a.currentPage-1)*i+1," - ").concat(Math.min(a.currentPage*i,a.totalCount))," of ",l?"...":a.totalCount," results"]}),(0,c.jsxs)("div",{className:"inline-flex items-center gap-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",l?"...":a.currentPage," of ",l?"...":a.totalPages]}),(0,c.jsx)("button",{onClick:()=>r(a.currentPage-1),disabled:l||1===a.currentPage,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>r(a.currentPage+1),disabled:l||a.currentPage===a.totalPages,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,c.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sf.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sy.Z,{children:B.getHeaderGroups().map(e=>(0,c.jsx)(sN.Z,{children:e.headers.map(e=>(0,c.jsx)(sb.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(sv.Z,{children:l?(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:K.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"\uD83D\uDE85 Loading keys..."})})})}):M.length>0?B.getRowModel().rows.map(e=>(0,c.jsx)(sN.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(s_.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("models"===e.column.id&&e.getValue().length>3?"px-0":""),children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:K.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No keys found"})})})})})]})})})})]})})}var sI=e=>{let{userID:s,userRole:t,accessToken:l,selectedTeam:a,setSelectedTeam:r,data:i,setData:n,teams:o,premiumUser:m,currentOrg:u,organizations:x,setCurrentOrg:h,selectedKeyAlias:p,setSelectedKeyAlias:j,createClicked:b,setAccessToken:N}=e,[Z,C]=(0,d.useState)(!1),[E,T]=(0,d.useState)(!1),[L,O]=(0,d.useState)(null),[M,F]=(0,d.useState)(null),[R,U]=(0,d.useState)(null),[z,V]=(0,d.useState)((null==a?void 0:a.team_id)||"");(0,d.useEffect)(()=>{V((null==a?void 0:a.team_id)||"")},[a]);let{keys:K,isLoading:B,error:G,pagination:H,refresh:J,setKeys:Y}=eG({selectedTeam:a||void 0,currentOrg:u,selectedKeyAlias:p,accessToken:l||"",createClicked:b}),[W,$]=(0,d.useState)(!1),[Q,X]=(0,d.useState)(!1),[ee,es]=(0,d.useState)(null),[et,el]=(0,d.useState)([]),ea=new Set,[er,ei]=(0,d.useState)(!1),[en,eo]=(0,d.useState)(!1),[ec,ed]=(0,d.useState)(null),[em,eu]=(0,d.useState)(null),[ex]=I.Z.useForm(),[eh,ep]=(0,d.useState)(null),[eg,ej]=(0,d.useState)(ea),[ef,ev]=(0,d.useState)([]);(0,d.useEffect)(()=>{console.log("in calculateNewExpiryTime for selectedToken",ee),(null==em?void 0:em.duration)?ep((e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,eB.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,eB.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,eB.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}catch(e){return null}})(em.duration)):ep(null),console.log("calculateNewExpiryTime:",eh)},[ee,null==em?void 0:em.duration]),(0,d.useEffect)(()=>{(async()=>{try{if(null===s||null===t||null===l)return;let e=await D(s,t,l);e&&el(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,s,t]),(0,d.useEffect)(()=>{if(o){let e=new Set;o.forEach((s,t)=>{let l=s.team_id;e.add(l)}),ej(e)}},[o]);let e_=async()=>{if(null!=L&&null!=i){try{if(!l)return;await (0,g.keyDeleteCall)(l,L);let e=i.filter(e=>e.token!==L);n(e)}catch(e){console.error("Error deleting the key:",e)}T(!1),O(null)}},ey=(e,s)=>{eu(t=>({...t,[e]:s}))},eb=async()=>{if(!m){P.ZP.error("Regenerate API Key is an Enterprise feature. Please upgrade to use this feature.");return}if(null!=ee)try{let e=await ex.validateFields();if(!l)return;let s=await (0,g.regenerateKeyCall)(l,ee.token||ee.token_id,e);if(ed(s.key),i){let t=i.map(t=>t.token===(null==ee?void 0:ee.token)?{...t,key_name:s.key_name,...e}:t);n(t)}eo(!1),ex.resetFields(),P.ZP.success("API Key regenerated successfully")}catch(e){console.error("Error regenerating key:",e),P.ZP.error("Failed to regenerate API Key")}};return(0,c.jsxs)("div",{children:[(0,c.jsx)(sC,{keys:K,setKeys:Y,isLoading:B,pagination:H,onPageChange:e=>{J({page:e})},pageSize:100,teams:o,selectedTeam:a,setSelectedTeam:r,accessToken:l,userID:s,userRole:t,organizations:x,setCurrentOrg:h,refresh:J,selectedKeyAlias:p,setSelectedKeyAlias:j,premiumUser:m,setAccessToken:N}),E&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key ?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:e_,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{T(!1),O(null)},children:"Cancel"})]})]})]})}),(0,c.jsx)(A.Z,{title:"Regenerate API Key",visible:en,onCancel:()=>{eo(!1),ex.resetFields()},footer:[(0,c.jsx)(_.Z,{onClick:()=>{eo(!1),ex.resetFields()},className:"mr-2",children:"Cancel"},"cancel"),(0,c.jsx)(_.Z,{onClick:eb,disabled:!m,children:m?"Regenerate":"Upgrade to Regenerate"},"regenerate")],children:m?(0,c.jsxs)(I.Z,{form:ex,layout:"vertical",onValuesChange:(e,s)=>{"duration"in e&&ey("duration",e.duration)},children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,c.jsx)(y.Z,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry:"," ",(null==ee?void 0:ee.expires)!=null?new Date(ee.expires).toLocaleString():"Never"]}),eh&&(0,c.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",eh]})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,c.jsx)(_.Z,{variant:"primary",className:"mb-2",children:(0,c.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",children:"Get Free Trial"})})]})}),ec&&(0,c.jsx)(A.Z,{visible:!!ec,onCancel:()=>ed(null),footer:[(0,c.jsx)(_.Z,{onClick:()=>ed(null),children:"Close"},"close")],children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Regenerated Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons, ",(0,c.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,c.jsxs)(f.Z,{numColSpan:1,children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"Key Alias:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:(null==ee?void 0:ee.key_alias)||"No alias set"})}),(0,c.jsx)(w.Z,{className:"mt-3",children:"New API Key:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:ec})}),(0,c.jsx)(S.CopyToClipboard,{text:ec,onCopy:()=>P.ZP.success("API Key copied to clipboard"),children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]})]})})]})},sP=t(12011),sA=t(3914),sE=e=>{let{userID:s,userRole:t,teams:l,keys:a,setUserRole:r,userEmail:i,setUserEmail:n,setTeams:o,setKeys:x,premiumUser:h,organizations:p,addKey:_,createClicked:y}=e,[b,N]=(0,d.useState)(null),[Z,w]=(0,d.useState)(null),k=(0,m.useSearchParams)(),S=function(e){console.log("COOKIES",document.cookie);let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));return s?s.split("=")[1]:null}("token"),C=k.get("invitation_id"),[I,P]=(0,d.useState)(null),[A,E]=(0,d.useState)(null),[T,L]=(0,d.useState)([]),[O,M]=(0,d.useState)(null),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)(null);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,d.useEffect)(()=>{if(S){let e=(0,u.o)(S);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),P(e.key),e.user_role){let s=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";case"internal_user":return"Internal User";case"internal_user_viewer":return"Internal Viewer";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",s),r(s)}else console.log("User role not defined");e.user_email?n(e.user_email):console.log("User Email is not set ".concat(e))}}if(s&&I&&t&&!a&&!b){let e=sessionStorage.getItem("userModels"+s);e?L(JSON.parse(e)):(console.log("currentOrg: ".concat(JSON.stringify(Z))),(async()=>{try{let e=await (0,g.getProxyUISettings)(I);M(e);let l=await (0,g.userInfoCall)(I,s,t,!1,null,null);N(l.user_info),console.log("userSpendData: ".concat(JSON.stringify(b))),(null==l?void 0:l.teams[0].keys)?x(l.keys.concat(l.teams.filter(e=>"Admin"===t||e.user_id===s).flatMap(e=>e.keys))):x(l.keys),sessionStorage.setItem("userData"+s,JSON.stringify(l.keys)),sessionStorage.setItem("userSpendData"+s,JSON.stringify(l.user_info));let a=(await (0,g.modelAvailableCall)(I,s,t)).data.map(e=>e.id);console.log("available_model_names:",a),L(a),console.log("userModels:",T),sessionStorage.setItem("userModels"+s,JSON.stringify(a))}catch(e){console.error("There was an error fetching the data",e),e.message.includes("Invalid proxy server token passed")&&U()}})(),j(I,s,t,Z,o))}},[s,S,I,a,t]),(0,d.useEffect)(()=>{I&&(async()=>{try{let e=await (0,g.keyInfoCall)(I,[I]);console.log("keyInfo: ",e)}catch(e){e.message.includes("Invalid proxy server token passed")&&U()}})()},[I]),(0,d.useEffect)(()=>{console.log("currentOrg: ".concat(JSON.stringify(Z),", accessToken: ").concat(I,", userID: ").concat(s,", userRole: ").concat(t)),I&&(console.log("fetching teams"),j(I,s,t,Z,o))},[Z]),(0,d.useEffect)(()=>{if(null!==a&&null!=D&&null!==D.team_id){let e=0;for(let s of(console.log("keys: ".concat(JSON.stringify(a))),a))D.hasOwnProperty("team_id")&&null!==s.team_id&&s.team_id===D.team_id&&(e+=s.spend);console.log("sum: ".concat(e)),E(e)}else if(null!==a){let e=0;for(let s of a)e+=s.spend;E(e)}},[D]),null!=C)return(0,c.jsx)(sP.default,{});function U(){(0,sA.b)();let e=(0,g.getProxyBaseUrl)();console.log("proxyBaseUrl:",e);let s=e?"".concat(e,"/sso/key/generate"):"/sso/key/generate";return console.log("Full URL:",s),window.location.href=s,null}if(null==S)return console.log("All cookies before redirect:",document.cookie),U(),null;try{let e=(0,u.o)(S);console.log("Decoded token:",e);let s=e.exp,t=Math.floor(Date.now()/1e3);if(s&&t>=s)return console.log("Token expired, redirecting to login"),U(),null}catch(e){return console.error("Error decoding token:",e),(0,sA.b)(),U(),null}if(null==I)return null;if(null==s)return(0,c.jsx)("h1",{children:"User ID is not set"});if(null==t&&r("App Owner"),t&&"Admin Viewer"==t){let{Title:e,Paragraph:s}=em.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",D),console.log("All cookies after redirect:",document.cookie),(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,c.jsx)(eK,{userID:s,team:D,teams:l,userRole:t,accessToken:I,data:a,addKey:_,premiumUser:h},D?D.team_id:null),(0,c.jsx)(sI,{userID:s,userRole:t,accessToken:I,selectedTeam:D||null,setSelectedTeam:F,selectedKeyAlias:R,setSelectedKeyAlias:q,data:a,setData:x,premiumUser:h,teams:l,currentOrg:Z,setCurrentOrg:w,organizations:p,createClicked:y,setAccessToken:P})]})})})},sT=t(97765),sL=t(42673);let sO=async(e,s,t)=>{try{console.log("handling submit for formValues:",e);let s=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,l=sL.fK[t]+"/*";e.model_name=l,s.push({public_name:l,litellm_model:l}),e.model=l}let t=[];for(let l of s){let s={},a={},r=l.public_name;for(let[t,r]of(s.model=l.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),s.model=l.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==r&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)s.model=r;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",r);let e=sL.fK[r];s.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)a[t]=r;else if("team_id"===t)a.team_id=r;else if("model_access_group"===t)a.access_groups=r;else if("mode"==t)console.log("placing mode in modelInfo"),a.mode=r,delete s.mode;else if("custom_model_name"===t)s.model=r;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw P.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,l]of Object.entries(e))s[t]=l}}else if("model_info_params"==t){console.log("model_info_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw P.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[s,t]of Object.entries(e))a[s]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){r&&(s[t]=Number(r));continue}else s[t]=r}t.push({litellmParamsObj:s,modelInfoObj:a,modelName:r})}return t}catch(e){P.ZP.error("Failed to create model: "+e,10)}},sM=async(e,s,t,l)=>{try{let a=await sO(e,s,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:l,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:l},i=await (0,g.modelCreateCall)(s,r);console.log("response for model create call: ".concat(i.data))}l&&l(),t.resetFields()}catch(e){P.ZP.error("Failed to add model: "+e,10)}};var sD=t(53410),sF=t(47451),sR=t(69410);let{Link:sq}=em.default,sU={[sL.Cl.OpenAI]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sL.Cl.OpenAI_Text]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sL.Cl.Vertex_AI]:[{key:"vertex_project",label:"Vertex Project",placeholder:"adroit-cadet-1234..",required:!0},{key:"vertex_location",label:"Vertex Location",placeholder:"us-east-1",required:!0},{key:"vertex_credentials",label:"Vertex Credentials",required:!0,type:"upload"}],[sL.Cl.AssemblyAI]:[{key:"api_base",label:"API Base",type:"select",required:!0,options:["https://api.assemblyai.com","https://api.eu.assemblyai.com"]},{key:"api_key",label:"AssemblyAI API Key",type:"password",required:!0}],[sL.Cl.Azure]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_version",label:"API Version",placeholder:"2023-07-01-preview",tooltip:"By default litellm will use the latest version. If you want to use a different version, you can specify it here"},{key:"base_model",label:"Base Model",placeholder:"azure/gpt-3.5-turbo"},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[sL.Cl.Azure_AI_Studio]:[{key:"api_base",label:"API Base",placeholder:"https://<test>.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",tooltip:"Enter your full Target URI from Azure Foundry here. Example: https://litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",required:!0},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[sL.Cl.OpenAI_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sL.Cl.OpenAI_Text_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sL.Cl.Bedrock]:[{key:"aws_access_key_id",label:"AWS Access Key ID",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_secret_access_key",label:"AWS Secret Access Key",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_region_name",label:"AWS Region Name",placeholder:"us-east-1",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."}],[sL.Cl.Ollama]:[{key:"api_base",label:"API Base",placeholder:"http://localhost:11434",defaultValue:"http://localhost:11434",required:!1,tooltip:"The base URL for your Ollama server. Defaults to http://localhost:11434 if not specified."}],[sL.Cl.Anthropic]:[{key:"api_key",label:"API Key",placeholder:"sk-",type:"password",required:!0}],[sL.Cl.Deepgram]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.ElevenLabs]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Google_AI_Studio]:[{key:"api_key",label:"API Key",placeholder:"aig-",type:"password",required:!0}],[sL.Cl.Groq]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.MistralAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Deepseek]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Cohere]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Databricks]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.xAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Cerebras]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Sambanova]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Perplexity]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.TogetherAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Openrouter]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.FireworksAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Triton]:[{key:"api_key",label:"API Key",type:"password",required:!1},{key:"api_base",label:"API Base",placeholder:"http://localhost:8000/generate",required:!1}]};var sz=e=>{let{selectedProvider:s,uploadProps:t}=e,l=sL.Cl[s],a=I.Z.useFormInstance(),r=d.useMemo(()=>sU[l]||[],[l]),i={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let s=new FileReader;s.onload=e=>{if(e.target){let s=e.target.result;console.log("Setting field value from JSON, length: ".concat(s.length)),a.setFieldsValue({vertex_credentials:s}),console.log("Form values after setting:",a.getFieldsValue())}},s.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",a.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,c.jsx)(c.Fragment,{children:r.map(e=>{var s;return(0,c.jsxs)(d.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,c.jsx)(C.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(s=e.options)||void 0===s?void 0:s.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,c.jsx)(ex.default,{...i,onChange:s=>{(null==t?void 0:t.onChange)&&t.onChange(s),setTimeout(()=>{let s=a.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(s))},500)},children:(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(e_.Z,{}),children:"Click to Upload"})}):(0,c.jsx)(y.Z,{placeholder:e.placeholder,type:"password"===e.type?"password":"text"})}),"vertex_credentials"===e.key&&(0,c.jsx)(sF.Z,{children:(0,c.jsx)(sR.Z,{children:(0,c.jsx)(w.Z,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,c.jsxs)(sF.Z,{children:[(0,c.jsx)(sR.Z,{span:10}),(0,c.jsx)(sR.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,c.jsx)(sq,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})})};let{Title:sV,Link:sK}=em.default;var sB=e=>{let{isVisible:s,onCancel:t,onAddCredential:l,onUpdateCredential:a,uploadProps:r,addOrEdit:i,existingCredential:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(sL.Cl.OpenAI),[x,h]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{n&&(o.setFieldsValue({credential_name:n.credential_name,custom_llm_provider:n.credential_info.custom_llm_provider,api_base:n.credential_values.api_base,api_version:n.credential_values.api_version,base_model:n.credential_values.base_model,api_key:n.credential_values.api_key}),u(n.credential_info.custom_llm_provider))},[n]),(0,c.jsx)(A.Z,{title:"add"===i?"Add New Credential":"Edit Credential",visible:s,onCancel:()=>{t(),o.resetFields()},footer:null,width:600,children:(0,c.jsxs)(I.Z,{form:o,onFinish:e=>{let s=Object.entries(e).reduce((e,s)=>{let[t,l]=s;return""!==l&&null!=l&&(e[t]=l),e},{});"add"===i?l(s):a(s),o.resetFields()},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==n?void 0:n.credential_name,children:(0,c.jsx)(y.Z,{placeholder:"Enter a friendly name for these credentials",disabled:null!=n&&!!n.credential_name})}),(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,c.jsx)(C.default,{showSearch:!0,onChange:e=>{u(e),o.setFieldValue("custom_llm_provider",e)},children:Object.entries(sL.Cl).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sL.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(sz,{selectedProvider:m,uploadProps:r}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(sK,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:()=>{t(),o.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"add"===i?"Add Credential":"Update Credential"})]})]})]})})},sG=e=>{let{accessToken:s,uploadProps:t,credentialList:l,fetchCredentials:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(null),[x]=I.Z.useForm(),h=["credential_name","custom_llm_provider"],p=async e=>{if(!s)return;let t=Object.entries(e).filter(e=>{let[s]=e;return!h.includes(s)}).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:l}},{}),l={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,g.credentialUpdateCall)(s,e.credential_name,l),P.ZP.success("Credential updated successfully"),o(!1),a(s)},j=async e=>{if(!s)return;let t=Object.entries(e).filter(e=>{let[s]=e;return!h.includes(s)}).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:l}},{}),l={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,g.credentialCreateCall)(s,l),P.ZP.success("Credential added successfully"),i(!1),a(s)};(0,d.useEffect)(()=>{s&&a(s)},[s]);let f=e=>{let s={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=s[e.toLowerCase()]||s.default;return(0,c.jsx)(eJ.Z,{color:t,size:"xs",children:e})},v=async e=>{s&&(await (0,g.credentialDeleteCall)(s,e),P.ZP.success("Credential deleted successfully"),a(s))};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(w.Z,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,c.jsx)(W.Z,{children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Credential Name"}),(0,c.jsx)(sb.Z,{children:"Provider"}),(0,c.jsx)(sb.Z,{children:"Description"})]})}),(0,c.jsx)(sv.Z,{children:l&&0!==l.length?l.map((e,s)=>{var t,l;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.credential_name}),(0,c.jsx)(s_.Z,{children:f((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,c.jsx)(s_.Z,{children:(null===(l=e.credential_info)||void 0===l?void 0:l.description)||"-"}),(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(_.Z,{icon:sD.Z,variant:"light",size:"sm",onClick:()=>{u(e),o(!0)}}),(0,c.jsx)(_.Z,{icon:ee.Z,variant:"light",size:"sm",onClick:()=>v(e.credential_name)})]})]},s)}):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),(0,c.jsx)(_.Z,{onClick:()=>i(!0),className:"mt-4",children:"Add Credential"}),r&&(0,c.jsx)(sB,{onAddCredential:j,isVisible:r,onCancel:()=>i(!1),uploadProps:t,addOrEdit:"add",onUpdateCredential:p,existingCredential:null}),n&&(0,c.jsx)(sB,{onAddCredential:j,isVisible:n,existingCredential:m,onUpdateCredential:p,uploadProps:t,onCancel:()=>o(!1),addOrEdit:"edit"})]})};let sH=e=>{var s;return(null==e?void 0:null===(s=e.model_info)||void 0===s?void 0:s.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var sJ=t(53003),sY=e=>{let{value:s,onValueChange:t,label:l="Select Time Range",className:a="",showTimeRange:r=!0}=e;return(0,c.jsxs)("div",{className:a,children:[l&&(0,c.jsx)(w.Z,{className:"mb-2",children:l}),(0,c.jsx)(sJ.Z,{enableSelect:!0,value:s,onValueChange:e=>{if(e.from){let s;let l={...e},a=new Date(e.from);s=new Date(e.to?e.to:e.from),a.toDateString(),s.toDateString(),a.setHours(0,0,0,0),s.setHours(23,59,59,999),l.from=a,l.to=s,t(l)}else t(e)}}),r&&s.from&&s.to&&(0,c.jsx)(w.Z,{className:"mt-1 text-xs text-gray-500",children:((e,s)=>{if(!e||!s)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==s.toDateString())return"".concat(t(e)," - ").concat(t(s));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),l=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(l," - ").concat(a)}})(s.from,s.to)})]})},sW=t(75105),s$=t(40278),sQ=t(14301),sX=t(59664),s0=e=>{let{modelMetrics:s,modelMetricsCategories:t,customTooltip:l,premiumUser:a}=e;return(0,c.jsx)(sX.Z,{title:"Time to First token (s)",className:"h-72",data:s,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:l})},s1=e=>{let{teamData:s,canEditTeam:t,handleMemberDelete:l,setSelectedEditMember:a,setIsEditMemberModalVisible:r,setIsAddMemberModalVisible:i}=e,n=e=>{if(null==e)return"0";if("number"==typeof e){let s=Number(e);return s===Math.floor(s)?s.toString():eD(s,8).replace(/\.?0+$/,"")}return"0"},o=e=>{if(!e)return 0;let t=s.team_memberships.find(s=>s.user_id===e);return(null==t?void 0:t.spend)||0},d=e=>{var t;if(!e)return null;let l=s.team_memberships.find(s=>s.user_id===e);console.log("membership=".concat(l));let a=null==l?void 0:null===(t=l.litellm_budget_table)||void 0===t?void 0:t.max_budget;return null==a?null:n(a)};return(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(W.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"User ID"}),(0,c.jsx)(sb.Z,{children:"User Email"}),(0,c.jsx)(sb.Z,{children:"Role"}),(0,c.jsxs)(sb.Z,{children:["Team Member Spend (USD)"," ",(0,c.jsx)(z.Z,{title:"This is the amount spent by a user in the team.",children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(sb.Z,{children:"Team Member Budget (USD)"}),(0,c.jsx)(sb.Z,{})]})}),(0,c.jsx)(sv.Z,{children:s.team_info.members_with_roles.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_id})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.role})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{className:"font-mono",children:["$",eD(o(e.user_id),4)]})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:d(e.user_id)?"$".concat(eD(Number(d(e.user_id)),4)):"No Limit"})}),(0,c.jsx)(s_.Z,{children:t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{a(e),r(!0)}}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>l(e)})]})})]},s))})]})}),(0,c.jsx)(_.Z,{onClick:()=>i(!0),children:"Add Member"})]})},s2=t(61994),s4=t(85180),s5=t(89245),s6=t(78355);let s3={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team"},s8=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",s7=e=>{let s=s8(e),t=s3[e];if(!t){for(let[s,l]of Object.entries(s3))if(e.includes(s)){t=l;break}}return t||(t="Access ".concat(e)),{method:s,endpoint:e,description:t,route:e}};var s9=e=>{let{teamId:s,accessToken:t,canEditTeam:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)([]),[o,m]=(0,d.useState)(!0),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),j=async()=>{try{if(m(!0),!t)return;let e=await (0,g.getTeamPermissionsCall)(t,s),l=e.all_available_permissions||[];r(l);let a=e.team_member_permissions||[];n(a),p(!1)}catch(e){P.ZP.error("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{m(!1)}};(0,d.useEffect)(()=>{j()},[s,t]);let f=(e,s)=>{n(s?[...i,e]:i.filter(s=>s!==e)),p(!0)},v=async()=>{try{if(!t)return;x(!0),await (0,g.teamPermissionsUpdateCall)(t,s,i),P.ZP.success("Permissions updated successfully"),p(!1)}catch(e){P.ZP.error("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(o)return(0,c.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let y=a.length>0;return(0,c.jsxs)(W.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,c.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,c.jsx)(k.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),l&&h&&(0,c.jsxs)("div",{className:"flex gap-3",children:[(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(s5.Z,{}),onClick:()=>{j()},children:"Reset"}),(0,c.jsxs)(_.Z,{onClick:v,loading:u,className:"flex items-center gap-2",children:[(0,c.jsx)(s6.Z,{})," Save Changes"]})]})]}),(0,c.jsx)(w.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),y?(0,c.jsxs)(sf.Z,{className:"mt-4",children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Method"}),(0,c.jsx)(sb.Z,{children:"Endpoint"}),(0,c.jsx)(sb.Z,{children:"Description"}),(0,c.jsx)(sb.Z,{className:"text-right",children:"Access"})]})}),(0,c.jsx)(sv.Z,{children:a.map(e=>{let s=s7(e);return(0,c.jsxs)(sN.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===s.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:s.method})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)("span",{className:"font-mono text-sm text-gray-800",children:s.endpoint})}),(0,c.jsx)(s_.Z,{className:"text-gray-700",children:s.description}),(0,c.jsx)(s_.Z,{className:"text-right",children:(0,c.jsx)(s2.Z,{checked:i.includes(e),onChange:s=>f(e,s.target.checked),disabled:!l})})]},e)})})]}):(0,c.jsx)("div",{className:"py-12",children:(0,c.jsx)(s4.Z,{description:"No permissions available"})})]})},te=e=>{var s,t,l;let{visible:a,onCancel:r,onSubmit:i,initialData:n,mode:o,config:m}=e,[u]=I.Z.useForm();console.log("Initial Data:",n),(0,d.useEffect)(()=>{if(a){if("edit"===o&&n)u.setFieldsValue({...n,role:n.role||m.defaultRole});else{var e;u.resetFields(),u.setFieldsValue({role:m.defaultRole||(null===(e=m.roleOptions[0])||void 0===e?void 0:e.value)})}}},[a,n,o,u,m.defaultRole,m.roleOptions]);let x=async e=>{try{let s=Object.entries(e).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:"string"==typeof l?l.trim():l}},{});i(s),u.resetFields()}catch(e){console.error("Form submission error:",e)}},h=e=>{switch(e.type){case"input":return(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",onChange:e=>{e.target.value=e.target.value.trim()}});case"select":var s;return(0,c.jsx)(C.default,{children:null===(s=e.options)||void 0===s?void 0:s.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))});default:return null}};return(0,c.jsx)(A.Z,{title:m.title||("add"===o?"Add Member":"Edit Member"),open:a,width:800,footer:null,onCancel:r,children:(0,c.jsxs)(I.Z,{form:u,onFinish:x,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[m.showEmail&&(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",placeholder:"[email protected]",onChange:e=>{e.target.value=e.target.value.trim()}})}),m.showEmail&&m.showUserId&&(0,c.jsx)("div",{className:"text-center mb-4",children:(0,c.jsx)(w.Z,{children:"OR"})}),m.showUserId&&(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",placeholder:"user_123",onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{children:"Role"}),"edit"===o&&n&&(0,c.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(t=n.role,(null===(l=m.roleOptions.find(e=>e.value===t))||void 0===l?void 0:l.label)||t),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,c.jsx)(C.default,{children:"edit"===o&&n?[...m.roleOptions.filter(e=>e.value===n.role),...m.roleOptions.filter(e=>e.value!==n.role)].map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value)):m.roleOptions.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))})}),null===(s=m.additionalFields)||void 0===s?void 0:s.map(e=>(0,c.jsx)(I.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:h(e)},e.name)),(0,c.jsxs)("div",{className:"text-right mt-6",children:[(0,c.jsx)(T.ZP,{onClick:r,className:"mr-2",children:"Cancel"}),(0,c.jsx)(T.ZP,{type:"default",htmlType:"submit",children:"add"===o?"Add Member":"Save Changes"})]})]})})},ts=e=>{let{isVisible:s,onCancel:t,onSubmit:l,accessToken:a,title:r="Add Team Member",roles:i=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:n="user"}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)("user_email"),f=async(e,s)=>{if(!e){u([]);return}h(!0);try{let t=new URLSearchParams;if(t.append(s,e),null==a)return;let l=(await (0,g.userFilterUICall)(a,t)).map(e=>({label:"user_email"===s?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===s?e.user_email:e.user_id,user:e}));u(l)}catch(e){console.error("Error fetching users:",e)}finally{h(!1)}},v=(0,d.useCallback)(eA()((e,s)=>f(e,s),300),[]),_=(e,s)=>{j(s),v(e,s)},y=(e,s)=>{let t=s.user;o.setFieldsValue({user_email:t.user_email,user_id:t.user_id,role:o.getFieldValue("role")})};return(0,c.jsx)(A.Z,{title:r,open:s,onCancel:()=>{o.resetFields(),u([]),t()},footer:null,width:800,children:(0,c.jsxs)(I.Z,{form:o,onFinish:l,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:n},children:[(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>_(e,"user_email"),onSelect:(e,s)=>y(e,s),options:"user_email"===p?m:[],loading:x,allowClear:!0})}),(0,c.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>_(e,"user_id"),onSelect:(e,s)=>y(e,s),options:"user_id"===p?m:[],loading:x,allowClear:!0})}),(0,c.jsx)(I.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,c.jsx)(C.default,{defaultValue:n,children:i.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:(0,c.jsxs)(z.Z,{title:e.description,children:[(0,c.jsx)("span",{className:"font-medium",children:e.label}),(0,c.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,c.jsx)("div",{className:"text-right mt-4",children:(0,c.jsx)(T.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})},tt=e=>{var s,t,l,a,r,i,n,o,m,u,x;let{teamId:h,onClose:p,accessToken:j,is_team_admin:f,is_proxy_admin:b,userModels:N,editTeam:Z,premiumUser:S=!1,onUpdate:A}=e,[E,O]=(0,d.useState)(null),[D,R]=(0,d.useState)(!0),[q,V]=(0,d.useState)(!1),[K]=I.Z.useForm(),[B,G]=(0,d.useState)(!1),[J,Y]=(0,d.useState)(null),[$,Q]=(0,d.useState)(!1),[X,ee]=(0,d.useState)([]),[es,et]=(0,d.useState)(!1),[el,ea]=(0,d.useState)({}),[er,ei]=(0,d.useState)([]);console.log("userModels in team info",N);let en=f||b,eo=async()=>{try{if(R(!0),!j)return;let e=await (0,g.teamInfoCall)(j,h);O(e)}catch(e){P.ZP.error("Failed to load team information"),console.error("Error fetching team info:",e)}finally{R(!1)}};(0,d.useEffect)(()=>{eo()},[h,j]),(0,d.useEffect)(()=>{(async()=>{try{if(!j)return;let e=(await (0,g.getGuardrailsList)(j)).guardrails.map(e=>e.guardrail_name);ei(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[j]);let ec=async e=>{try{if(null==j)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.teamMemberAddCall)(j,h,s),P.ZP.success("Team member added successfully"),V(!1),K.resetFields();let t=await (0,g.teamInfoCall)(j,h);O(t),A(t)}catch(a){var s,t,l;let e="Failed to add team member";(null==a?void 0:null===(l=a.raw)||void 0===l?void 0:null===(t=l.detail)||void 0===t?void 0:null===(s=t.error)||void 0===s?void 0:s.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==a?void 0:a.message)&&(e=a.message),P.ZP.error(e),console.error("Error adding team member:",a)}},ed=async e=>{try{if(null==j)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};P.ZP.destroy(),await (0,g.teamMemberUpdateCall)(j,h,s),P.ZP.success("Team member updated successfully"),G(!1);let t=await (0,g.teamInfoCall)(j,h);O(t),A(t)}catch(l){var s,t;let e="Failed to update team member";(null==l?void 0:null===(t=l.raw)||void 0===t?void 0:null===(s=t.detail)||void 0===s?void 0:s.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==l?void 0:l.message)&&(e=l.message),G(!1),P.ZP.destroy(),P.ZP.error(e),console.error("Error updating team member:",l)}},em=async e=>{try{if(null==j)return;await (0,g.teamMemberDeleteCall)(j,h,e),P.ZP.success("Team member removed successfully");let s=await (0,g.teamInfoCall)(j,h);O(s),A(s)}catch(e){P.ZP.error("Failed to remove team member"),console.error("Error removing team member:",e)}},eu=async e=>{try{if(!j)return;let s={};try{s=e.metadata?JSON.parse(e.metadata):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={team_id:h,team_alias:e.team_alias,models:e.models,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...s,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};void 0!==e.team_member_budget&&(t.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(t.team_member_key_duration=e.team_member_key_duration);let{servers:l,accessGroups:a}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};(l&&l.length>0||a&&a.length>0)&&(t.object_permission={},l&&l.length>0&&(t.object_permission.mcp_servers=l),a&&a.length>0&&(t.object_permission.mcp_access_groups=a)),delete e.mcp_servers_and_groups,await (0,g.teamUpdateCall)(j,t),P.ZP.success("Team settings updated successfully"),Q(!1),eo()}catch(e){console.error("Error updating team:",e)}};if(D)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==E?void 0:E.team_info))return(0,c.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:ex}=E,eh=async(e,s)=>{await eF(e)&&(ea(e=>({...e,[s]:!0})),setTimeout(()=>{ea(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:p,className:"mb-4",children:"Back to Teams"}),(0,c.jsx)(k.Z,{children:ex.team_alias}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:ex.team_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:el["team-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>eh(ex.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(el["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:Z?3:0,children:[(0,c.jsx)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"},"overview"),...en?[(0,c.jsx)(eY.Z,{children:"Members"},"members"),(0,c.jsx)(eY.Z,{children:"Member Permissions"},"member-permissions"),(0,c.jsx)(eY.Z,{children:"Settings"},"settings")]:[]]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Budget Status"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eD(ex.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null===ex.max_budget?"Unlimited":"$".concat(eD(ex.max_budget,4))]}),ex.budget_duration&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Reset: ",ex.budget_duration]}),(0,c.jsx)("br",{}),ex.team_member_budget_table&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Team Member Budget: $",eD(ex.team_member_budget_table.max_budget,4)]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",ex.tpm_limit||"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",ex.rpm_limit||"Unlimited"]}),ex.max_parallel_requests&&(0,c.jsxs)(w.Z,{children:["Max Parallel Requests: ",ex.max_parallel_requests]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===ex.models.length?(0,c.jsx)(eJ.Z,{color:"red",children:"All proxy models"}):ex.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["User Keys: ",E.keys.filter(e=>e.user_id).length]}),(0,c.jsxs)(w.Z,{children:["Service Account Keys: ",E.keys.filter(e=>!e.user_id).length]}),(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Total: ",E.keys.length]})]})]}),(0,c.jsx)(sl,{objectPermission:ex.object_permission,variant:"card",accessToken:j}),(0,c.jsx)(sa,{loggingConfigs:(null===(s=ex.metadata)||void 0===s?void 0:s.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(s1,{teamData:E,canEditTeam:en,handleMemberDelete:em,setSelectedEditMember:Y,setIsEditMemberModalVisible:G,setIsAddMemberModalVisible:V})}),en&&(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(s9,{teamId:h,accessToken:j,canEditTeam:en})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Team Settings"}),en&&!$&&(0,c.jsx)(_.Z,{onClick:()=>Q(!0),children:"Edit Settings"})]}),$?(0,c.jsxs)(I.Z,{form:K,onFinish:eu,initialValues:{...ex,team_alias:ex.team_alias,models:ex.models,tpm_limit:ex.tpm_limit,rpm_limit:ex.rpm_limit,max_budget:ex.max_budget,budget_duration:ex.budget_duration,guardrails:(null===(t=ex.metadata)||void 0===t?void 0:t.guardrails)||[],metadata:ex.metadata?JSON.stringify((e=>{let{logging:s,...t}=e;return t})(ex.metadata),null,2):"",logging_settings:(null===(l=ex.metadata)||void 0===l?void 0:l.logging)||[],organization_id:ex.organization_id,vector_stores:(null===(a=ex.object_permission)||void 0===a?void 0:a.vector_stores)||[],mcp_servers:(null===(r=ex.object_permission)||void 0===r?void 0:r.mcp_servers)||[],mcp_access_groups:(null===(i=ex.object_permission)||void 0===i?void 0:i.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(n=ex.object_permission)||void 0===n?void 0:n.mcp_servers)||[],accessGroups:(null===(o=ex.object_permission)||void 0===o?void 0:o.mcp_access_groups)||[]}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,c.jsx)(L.default,{type:""})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Array.from(new Set(N)).map((e,s)=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},s))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Setup your first guardrail",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",placeholder:"Select or enter guardrails",options:er.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>K.setFieldValue("vector_stores",e),value:K.getFieldValue("vector_stores"),accessToken:j||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(eR,{onChange:e=>K.setFieldValue("mcp_servers_and_groups",e),value:K.getFieldValue("mcp_servers_and_groups"),accessToken:j||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,c.jsx)(L.default,{type:""})}),(0,c.jsx)(I.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,c.jsx)(e2,{value:K.getFieldValue("logging_settings"),onChange:e=>K.setFieldValue("logging_settings",e)})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:10})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{htmlType:"button",onClick:()=>Q(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team Name"}),(0,c.jsx)("div",{children:ex.team_alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)("div",{className:"font-mono",children:ex.team_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:new Date(ex.created_at).toLocaleString()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:ex.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)("div",{children:["TPM: ",ex.tpm_limit||"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",ex.rpm_limit||"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team Budget"}),(0,c.jsxs)("div",{children:["Max Budget:"," ",null!==ex.max_budget?"$".concat(eD(ex.max_budget,4)):"No Limit"]}),(0,c.jsxs)("div",{children:["Budget Reset: ",ex.budget_duration||"Never"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Team Member Settings"," ",(0,c.jsx)(z.Z,{title:"These are limits on individual team members",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),(0,c.jsxs)("div",{children:["Max Budget:"," ",(null===(m=ex.team_member_budget_table)||void 0===m?void 0:m.max_budget)||"No Limit"]}),(0,c.jsxs)("div",{children:["Key Duration:"," ",(null===(u=ex.metadata)||void 0===u?void 0:u.team_member_key_duration)||"No Limit"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization ID"}),(0,c.jsx)("div",{children:ex.organization_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Status"}),(0,c.jsx)(eJ.Z,{color:ex.blocked?"red":"green",children:ex.blocked?"Blocked":"Active"})]}),(0,c.jsx)(sl,{objectPermission:ex.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:j}),(0,c.jsx)(sa,{loggingConfigs:(null===(x=ex.metadata)||void 0===x?void 0:x.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,c.jsx)(te,{visible:B,onCancel:()=>G(!1),onSubmit:ed,initialData:J,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}]}}),(0,c.jsx)(ts,{isVisible:q,onCancel:()=>V(!1),onSubmit:ec,accessToken:j})]})},tl=t(45589);let{Title:ta,Link:tr}=em.default;var ti=e=>{let{isVisible:s,onCancel:t,onAddCredential:l,existingCredential:a,setIsCredentialModalOpen:r}=e,[i]=I.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(a))),(0,c.jsx)(A.Z,{title:"Reuse Credentials",visible:s,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,c.jsxs)(I.Z,{form:i,onFinish:e=>{l(e),i.resetFields(),r(!1)},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==a?void 0:a.credential_name,children:(0,c.jsx)(y.Z,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==a?void 0:a.credential_values)||{}).map(e=>{let[s,t]=e;return(0,c.jsx)(I.Z.Item,{label:s,name:s,initialValue:t,children:(0,c.jsx)(y.Z,{placeholder:"Enter ".concat(s),disabled:!0})},s)}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(tr,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})},tn=t(63709),to=t(45246),tc=t(96473);let{Text:td}=em.default;var tm=e=>{let{form:s,showCacheControl:t,onCacheControlChange:l}=e,a=e=>{let t=s.getFieldValue("litellm_extra_params");try{let l=t?JSON.parse(t):{};e.length>0?l.cache_control_injection_points=e:delete l.cache_control_injection_points,Object.keys(l).length>0?s.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):s.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,c.jsx)(tn.Z,{onChange:l,className:"bg-gray-600"})}),t&&(0,c.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,c.jsx)(td,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,c.jsx)(I.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:l,remove:r}=t;return(0,c.jsxs)(c.Fragment,{children:[e.map((t,l)=>(0,c.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,c.jsx)(I.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,c.jsx)(C.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,c.jsx)(I.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,c.jsx)(C.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{a(s.getFieldValue("cache_control_points"))}})}),(0,c.jsx)(I.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,c.jsx)(M,{type:"number",placeholder:"Optional",step:1,min:0,onChange:()=>{a(s.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,c.jsx)(to.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{r(t.name),setTimeout(()=>{a(s.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,c.jsx)(I.Z.Item,{children:(0,c.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>l(),children:[(0,c.jsx)(tc.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})};let tu=async e=>{try{let s=await (0,g.modelHubCall)(e);if(console.log("model_info:",s),(null==s?void 0:s.data.length)>0){let e=s.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,s)=>e.model_group.localeCompare(s.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};var tx=t(44851),th=t(67960),tp=t(70464);let{TextArea:tg}=L.default,{Panel:tj}=tx.default;var tf=e=>{let{modelInfo:s,value:t,onChange:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]);(0,d.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,s)=>({id:e.id||"route-".concat(s,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));r(e),m(e.map(e=>e.id))}else r([]),m([])},[t]);let u=e=>{let s=a.filter(s=>s.id!==e);r(s),h(s),m(s=>s.filter(s=>s!==e))},x=(e,s,t)=>{let l=a.map(l=>l.id===e?{...l,[s]:t}:l);r(l),h(l)},h=e=>{let s={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==l||l(s)},p=s.map(e=>({value:e.model_group,label:e.model_group}));return(0,c.jsxs)("div",{className:"w-full max-w-none",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,c.jsx)(z.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(T.ZP,{type:"primary",icon:(0,c.jsx)(tc.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),s=[...a,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];r(s),h(s),m(s=>[...s,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===a.length?(0,c.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,c.jsx)(w.Z,{children:"No routes configured. Click “Add Route” to get started."})}):(0,c.jsx)("div",{className:"space-y-3 mb-6 w-full",children:a.map((e,s)=>(0,c.jsx)(th.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,c.jsx)(tx.default,{ghost:!0,expandIcon:e=>{let{isActive:s}=e;return(0,c.jsx)(tp.Z,{rotate:s?180:0})},activeKey:o,onChange:e=>m(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,c.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,c.jsxs)(w.Z,{className:"font-medium text-base",children:["Route ",s+1,": ",e.model||"Unnamed"]}),(0,c.jsx)(T.ZP,{type:"text",danger:!0,icon:(0,c.jsx)(ef.Z,{}),onClick:s=>{s.stopPropagation(),u(e.id)},className:"mr-2"})]}),children:(0,c.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,c.jsx)(C.default,{value:e.model,onChange:s=>x(e.id,"model",s),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,c.jsx)(tg,{value:e.description,onChange:s=>x(e.id,"description",s.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium",children:"Score Threshold"}),(0,c.jsx)(z.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(q.Z,{value:e.score_threshold,onChange:s=>x(e.id,"score_threshold",s||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,c.jsxs)("div",{className:"w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium",children:"Example Utterances"}),(0,c.jsx)(z.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,c.jsx)(C.default,{mode:"tags",value:e.utterances,onChange:s=>x(e.id,"utterances",s),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,c.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,c.jsx)(T.ZP,{type:"link",onClick:()=>n(!i),className:"text-blue-600 p-0",children:i?"Hide":"Show"})]}),i&&(0,c.jsx)(th.Z,{className:"bg-gray-50 w-full",children:(0,c.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:a.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})},tv=e=>{let{isVisible:s,onCancel:t,onSuccess:l,modelData:a,accessToken:r,userRole:i}=e,[n]=I.Z.useForm(),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)(!1),[v,_]=(0,d.useState)(!1),[b,N]=(0,d.useState)(null);(0,d.useEffect)(()=>{s&&a&&Z()},[s,a]),(0,d.useEffect)(()=>{let e=async()=>{if(r)try{let e=await (0,g.modelAvailableCall)(r,"","",!1,null,!0,!0);x(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(r)try{let e=await tu(r);p(e)}catch(e){console.error("Error fetching model info:",e)}};s&&(e(),t())},[s,r]);let Z=()=>{try{var e,s,t,l,r,i;let o=null;(null===(e=a.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(o="string"==typeof a.litellm_params.auto_router_config?JSON.parse(a.litellm_params.auto_router_config):a.litellm_params.auto_router_config),N(o),n.setFieldsValue({auto_router_name:a.model_name,auto_router_default_model:(null===(s=a.litellm_params)||void 0===s?void 0:s.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=a.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(l=a.model_info)||void 0===l?void 0:l.access_groups)||[]});let c=new Set(h.map(e=>e.model_group));f(!c.has(null===(r=a.litellm_params)||void 0===r?void 0:r.auto_router_default_model)),_(!c.has(null===(i=a.litellm_params)||void 0===i?void 0:i.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),P.ZP.error("Error loading auto router configuration")}},k=async()=>{try{m(!0);let e=await n.validateFields(),s={...a.litellm_params,auto_router_config:JSON.stringify(b),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},i={...a.model_info,access_groups:e.model_access_group||[]},o={model_name:e.auto_router_name,litellm_params:s,model_info:i};await (0,g.modelPatchUpdateCall)(r,o,a.model_info.id);let c={...a,model_name:e.auto_router_name,litellm_params:s,model_info:i};P.ZP.success("Auto router configuration updated successfully"),l(c),t()}catch(e){console.error("Error updating auto router:",e),P.ZP.error("Failed to update auto router configuration")}finally{m(!1)}},S=h.map(e=>({value:e.model_group,label:e.model_group}));return(0,c.jsx)(A.Z,{title:"Edit Auto Router Configuration",open:s,onCancel:t,footer:[(0,c.jsx)(T.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,c.jsx)(T.ZP,{loading:o,onClick:k,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsx)(w.Z,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,c.jsxs)(I.Z,{form:n,layout:"vertical",className:"space-y-4",children:[(0,c.jsx)(I.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(tf,{modelInfo:h,value:b,onChange:e=>{N(e)}})}),(0,c.jsx)(I.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,c.jsx)(C.default,{placeholder:"Select a default model",onChange:e=>{f("custom"===e)},options:[...S,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,c.jsx)(I.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,c.jsx)(C.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{_("custom"===e)},options:[...S,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===i&&(0,c.jsx)(I.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:u.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};function t_(e){var s,t,l,a,r,i,n,o,m,u,x,h,p,j,f,b,N,Z,S,E,O,D,F,R,q,V,K,B;let{modelId:G,onClose:H,modelData:J,accessToken:Y,userID:$,userRole:Q,editModel:X,setEditModalVisible:es,setSelectedModel:et,onModelUpdate:el,modelAccessGroups:ea}=e,[er]=I.Z.useForm(),[ei,en]=(0,d.useState)(null),[eo,ec]=(0,d.useState)(!1),[ed,em]=(0,d.useState)(!1),[eu,ex]=(0,d.useState)(!1),[eh,ep]=(0,d.useState)(!1),[eg,ej]=(0,d.useState)(!1),[ef,ev]=(0,d.useState)(null),[e_,ey]=(0,d.useState)(!1),[eb,eN]=(0,d.useState)({}),[eZ,ew]=(0,d.useState)(!1),[ek,eS]=(0,d.useState)([]),eC="Admin"===Q||(null==J?void 0:null===(s=J.model_info)||void 0===s?void 0:s.created_by)===$,eI=(null==J?void 0:null===(t=J.litellm_params)||void 0===t?void 0:t.auto_router_config)!=null,eP=(null==J?void 0:null===(l=J.litellm_params)||void 0===l?void 0:l.litellm_credential_name)!=null&&(null==J?void 0:null===(a=J.litellm_params)||void 0===a?void 0:a.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eP),console.log("modelData.litellm_params.litellm_credential_name, ",null==J?void 0:null===(r=J.litellm_params)||void 0===r?void 0:r.litellm_credential_name),(0,d.useEffect)(()=>{let e=async()=>{var e;if(!Y)return;let s=await (0,g.modelInfoV1Call)(Y,G);console.log("modelInfoResponse, ",s);let t=s.data[0];en(t),(null==t?void 0:null===(e=t.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&ey(!0)},s=async()=>{if(Y)try{let e=(await (0,g.getGuardrailsList)(Y)).guardrails.map(e=>e.guardrail_name);eS(e)}catch(e){console.error("Failed to fetch guardrails:",e)}};(async()=>{if(console.log("accessToken, ",Y),!Y||eP)return;let e=await (0,g.credentialGetCall)(Y,null,G);console.log("existingCredentialResponse, ",e),ev({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e(),s()},[Y,G]);let eA=async e=>{var s;if(console.log("values, ",e),!Y)return;let t={credential_name:e.credential_name,model_id:G,credential_info:{custom_llm_provider:null===(s=ei.litellm_params)||void 0===s?void 0:s.custom_llm_provider}};P.ZP.info("Storing credential.."),console.log("credentialResponse, ",await (0,g.credentialCreateCall)(Y,t)),P.ZP.success("Credential stored successfully")},eE=async e=>{try{var s;let t;if(!Y)return;ep(!0),console.log("values.model_name, ",e.model_name);let l={...ei.litellm_params,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6};e.guardrails&&(l.guardrails=e.guardrails),e.cache_control&&(null===(s=e.cache_control_injection_points)||void 0===s?void 0:s.length)>0?l.cache_control_injection_points=e.cache_control_injection_points:delete l.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):J.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){P.ZP.error("Invalid JSON in Model Info");return}let a={model_name:e.model_name,litellm_params:l,model_info:t};await (0,g.modelPatchUpdateCall)(Y,a,G);let r={...ei,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:l,model_info:t};en(r),el&&el(r),P.ZP.success("Model settings updated successfully"),ex(!1),ej(!1)}catch(e){console.error("Error updating model:",e),P.ZP.error("Failed to update model settings")}finally{ep(!1)}};if(!J)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Models"}),(0,c.jsx)(w.Z,{children:"Model not found"})]});let eT=async()=>{try{if(!Y)return;await (0,g.modelDeleteCall)(Y,G),P.ZP.success("Model deleted successfully"),el&&el({deleted:!0,model_info:{id:G}}),H()}catch(e){console.error("Error deleting the model:",e),P.ZP.error("Failed to delete model")}},eL=async(e,s)=>{await eF(e)&&(eN(e=>({...e,[s]:!0})),setTimeout(()=>{eN(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Models"}),(0,c.jsxs)(k.Z,{children:["Public Model Name: ",sH(J)]}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:J.model_info.id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:eb["model-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>eL(J.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eb["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{className:"flex gap-2",children:["Admin"===Q&&(0,c.jsx)(_.Z,{icon:tl.Z,variant:"secondary",onClick:()=>em(!0),className:"flex items-center",children:"Re-use Credentials"}),eC&&(0,c.jsx)(_.Z,{icon:ee.Z,variant:"secondary",onClick:()=>ec(!0),className:"flex items-center",children:"Delete Model"})]})]}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-6",children:[(0,c.jsx)(eY.Z,{children:"Overview"}),(0,c.jsx)(eY.Z,{children:"Raw JSON"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Provider"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[J.provider&&(0,c.jsx)("img",{src:(0,sL.dr)(J.provider).logo,alt:"".concat(J.provider," logo"),className:"w-4 h-4",onError:e=>{let s=e.target,t=s.parentElement;if(t){var l;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(l=J.provider)||void 0===l?void 0:l.charAt(0))||"-",t.replaceChild(e,s)}}}),(0,c.jsx)(k.Z,{children:J.provider||"Not Set"})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"LiteLLM Model"}),(0,c.jsx)("pre",{children:(0,c.jsx)(k.Z,{children:J.litellm_model_name||"Not Set"})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Pricing"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["Input: $",J.input_cost,"/1M tokens"]}),(0,c.jsxs)(w.Z,{children:["Output: $",J.output_cost,"/1M tokens"]})]})]})]}),(0,c.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,c.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",J.model_info.created_at?new Date(J.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,c.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",J.model_info.created_by||"Not Set"]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Model Settings"}),(0,c.jsxs)("div",{className:"flex gap-2",children:[eI&&eC&&!eg&&(0,c.jsx)(_.Z,{variant:"primary",onClick:()=>ew(!0),className:"flex items-center",children:"Edit Auto Router"}),eC&&!eg&&(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>ej(!0),className:"flex items-center",children:"Edit Model"})]})]}),ei?(0,c.jsx)(I.Z,{form:er,onFinish:eE,initialValues:{model_name:ei.model_name,litellm_model_name:ei.litellm_model_name,api_base:ei.litellm_params.api_base,custom_llm_provider:ei.litellm_params.custom_llm_provider,organization:ei.litellm_params.organization,tpm:ei.litellm_params.tpm,rpm:ei.litellm_params.rpm,max_retries:ei.litellm_params.max_retries,timeout:ei.litellm_params.timeout,stream_timeout:ei.litellm_params.stream_timeout,input_cost:ei.litellm_params.input_cost_per_token?1e6*ei.litellm_params.input_cost_per_token:(null===(i=ei.model_info)||void 0===i?void 0:i.input_cost_per_token)*1e6||null,output_cost:(null===(n=ei.litellm_params)||void 0===n?void 0:n.output_cost_per_token)?1e6*ei.litellm_params.output_cost_per_token:(null===(o=ei.model_info)||void 0===o?void 0:o.output_cost_per_token)*1e6||null,cache_control:null!==(m=ei.litellm_params)&&void 0!==m&&!!m.cache_control_injection_points,cache_control_injection_points:(null===(u=ei.litellm_params)||void 0===u?void 0:u.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(x=ei.model_info)||void 0===x?void 0:x.access_groups)?ei.model_info.access_groups:[],guardrails:Array.isArray(null===(h=ei.litellm_params)||void 0===h?void 0:h.guardrails)?ei.litellm_params.guardrails:[]},layout:"vertical",onValuesChange:()=>ex(!0),children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Name"}),eg?(0,c.jsx)(I.Z.Item,{name:"model_name",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter model name"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:ei.model_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eg?(0,c.jsx)(I.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter LiteLLM model name"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:ei.litellm_model_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eg?(0,c.jsx)(I.Z.Item,{name:"input_cost",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter input cost"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==ei?void 0:null===(p=ei.litellm_params)||void 0===p?void 0:p.input_cost_per_token)?((null===(j=ei.litellm_params)||void 0===j?void 0:j.input_cost_per_token)*1e6).toFixed(4):(null==ei?void 0:null===(f=ei.model_info)||void 0===f?void 0:f.input_cost_per_token)?(1e6*ei.model_info.input_cost_per_token).toFixed(4):null})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eg?(0,c.jsx)(I.Z.Item,{name:"output_cost",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter output cost"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==ei?void 0:null===(b=ei.litellm_params)||void 0===b?void 0:b.output_cost_per_token)?(1e6*ei.litellm_params.output_cost_per_token).toFixed(4):(null==ei?void 0:null===(N=ei.model_info)||void 0===N?void 0:N.output_cost_per_token)?(1e6*ei.model_info.output_cost_per_token).toFixed(4):null})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"API Base"}),eg?(0,c.jsx)(I.Z.Item,{name:"api_base",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter API base"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(Z=ei.litellm_params)||void 0===Z?void 0:Z.api_base)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Custom LLM Provider"}),eg?(0,c.jsx)(I.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter custom LLM provider"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(S=ei.litellm_params)||void 0===S?void 0:S.custom_llm_provider)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization"}),eg?(0,c.jsx)(I.Z.Item,{name:"organization",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter organization"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(E=ei.litellm_params)||void 0===E?void 0:E.organization)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eg?(0,c.jsx)(I.Z.Item,{name:"tpm",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter TPM"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(O=ei.litellm_params)||void 0===O?void 0:O.tpm)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eg?(0,c.jsx)(I.Z.Item,{name:"rpm",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter RPM"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=ei.litellm_params)||void 0===D?void 0:D.rpm)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Max Retries"}),eg?(0,c.jsx)(I.Z.Item,{name:"max_retries",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter max retries"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(F=ei.litellm_params)||void 0===F?void 0:F.max_retries)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Timeout (seconds)"}),eg?(0,c.jsx)(I.Z.Item,{name:"timeout",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter timeout"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=ei.litellm_params)||void 0===R?void 0:R.timeout)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eg?(0,c.jsx)(I.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter stream timeout"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=ei.litellm_params)||void 0===q?void 0:q.stream_timeout)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Access Groups"}),eg?(0,c.jsx)(I.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==ea?void 0:ea.map(e=>({value:e,label:e}))})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(V=ei.model_info)||void 0===V?void 0:V.access_groups)?Array.isArray(ei.model_info.access_groups)?ei.model_info.access_groups.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:ei.model_info.access_groups.map((e,s)=>(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},s))}):"No groups assigned":ei.model_info.access_groups:"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Apply safety guardrails to this model to filter content or enforce policies",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),eg?(0,c.jsx)(I.Z.Item,{name:"guardrails",className:"mb-0",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing guardrails or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:ek.map(e=>({value:e,label:e}))})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(K=ei.litellm_params)||void 0===K?void 0:K.guardrails)?Array.isArray(ei.litellm_params.guardrails)?ei.litellm_params.guardrails.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:ei.litellm_params.guardrails.map((e,s)=>(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:e},s))}):"No guardrails assigned":ei.litellm_params.guardrails:"Not Set"})]}),eg?(0,c.jsx)(tm,{form:er,showCacheControl:e_,onCacheControlChange:e=>ey(e)}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cache Control"}),(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(B=ei.litellm_params)||void 0===B?void 0:B.cache_control_injection_points)?(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"Enabled"}),(0,c.jsx)("div",{className:"mt-2",children:ei.litellm_params.cache_control_injection_points.map((e,s)=>(0,c.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,c.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,c.jsxs)("span",{children:[" Index: ",e.index]})]},s))})]}):"Disabled"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Info"}),eg?(0,c.jsx)(I.Z.Item,{name:"model_info",className:"mb-0",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify(J.model_info,null,2)})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(ei.model_info,null,2)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:J.model_info.team_id||"Not Set"})]})]}),eg&&(0,c.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{er.resetFields(),ex(!1),ej(!1)},children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",onClick:()=>er.submit(),loading:eh,children:"Save Changes"})]})]})}):(0,c.jsx)(w.Z,{children:"Loading..."})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(W.Z,{children:(0,c.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify(J,null,2)})})})]})]}),eo&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Model"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this model?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(T.ZP,{onClick:eT,className:"ml-2",danger:!0,children:"Delete"}),(0,c.jsx)(T.ZP,{onClick:()=>ec(!1),children:"Cancel"})]})]})]})}),ed&&!eP?(0,c.jsx)(ti,{isVisible:ed,onCancel:()=>em(!1),onAddCredential:eA,existingCredential:ef,setIsCredentialModalOpen:em}):(0,c.jsx)(A.Z,{open:ed,onCancel:()=>em(!1),title:"Using Existing Credential",children:(0,c.jsx)(w.Z,{children:J.litellm_params.litellm_credential_name})}),(0,c.jsx)(tv,{isVisible:eZ,onCancel:()=>ew(!1),onSuccess:e=>{en(e),el&&el(e)},modelData:ei||J,accessToken:Y||"",userRole:Q||""})]})}var ty=e=>{let{selectedProvider:s,providerModels:t,getPlaceholder:l}=e,a=I.Z.useFormInstance(),r=e=>{let s=e.target.value,t=(a.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?{public_name:s,litellm_model:s}:e);a.setFieldsValue({model_mappings:t})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(I.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"Actual model name used for making litellm.completion() / litellm.embedding() call.",className:"mb-0",children:[(0,c.jsx)(I.Z.Item,{name:"model",rules:[{required:!0,message:"Please select at least one model."}],noStyle:!0,children:s===sL.Cl.Azure||s===sL.Cl.OpenAI_Compatible||s===sL.Cl.Ollama?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(y.Z,{placeholder:l(s)})}):t.length>0?(0,c.jsx)(C.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let s=Array.isArray(e)?e:[e];if(s.includes("all-wildcard"))a.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(a.getFieldValue("model"))!==JSON.stringify(s)){let e=s.map(e=>({public_name:e,litellm_model:e}));a.setFieldsValue({model:s,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(s," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,c.jsx)(y.Z,{placeholder:l(s)})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.model!==s.model,children:e=>{let{getFieldValue:s}=e,t=s("model")||[];return(Array.isArray(t)?t:[t]).includes("custom")&&(0,c.jsx)(I.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,c.jsx)(y.Z,{placeholder:"Enter custom model name",onChange:r})})}})]}),(0,c.jsxs)(sF.Z,{children:[(0,c.jsx)(sR.Z,{span:10}),(0,c.jsx)(sR.Z,{span:10,children:(0,c.jsx)(w.Z,{className:"mb-3 mt-1",children:"Actual model name used for making litellm.completion() call. We loadbalance models with the same public name"})})]})]})},tb=()=>{let e=I.Z.useFormInstance(),[s,t]=(0,d.useState)(0),l=I.Z.useWatch("model",e)||[],a=Array.isArray(l)?l:[l],r=I.Z.useWatch("custom_model_name",e),i=!a.includes("all-wildcard");if((0,d.useEffect)(()=>{if(r&&a.includes("custom")){let s=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?{public_name:r,litellm_model:r}:e);e.setFieldValue("model_mappings",s),t(e=>e+1)}},[r,a,e]),(0,d.useEffect)(()=>{if(a.length>0&&!a.includes("all-wildcard")){let s=e.getFieldValue("model_mappings")||[];if(s.length!==a.length||!a.every(e=>s.some(s=>"custom"===e?"custom"===s.litellm_model||s.litellm_model===r:s.litellm_model===e))){let s=a.map(e=>"custom"===e&&r?{public_name:r,litellm_model:r}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",s),t(e=>e+1)}}},[a,r,e]),!i)return null;let n=[{title:"Public Name",dataIndex:"public_name",key:"public_name",render:(s,t,l)=>(0,c.jsx)(y.Z,{value:s,onChange:s=>{let t=[...e.getFieldValue("model_mappings")];t[l].public_name=s.target.value,e.setFieldValue("model_mappings",t)}})},{title:"LiteLLM Model",dataIndex:"litellm_model",key:"litellm_model"}];return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(I.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",rules:[{required:!0,validator:async(e,s)=>{if(!s||0===s.length)throw Error("At least one model mapping is required");if(s.filter(e=>!e.public_name||""===e.public_name.trim()).length>0)throw Error("All model mappings must have valid public names")}}],children:(0,c.jsx)(eh.Z,{dataSource:e.getFieldValue("model_mappings"),columns:n,pagination:!1,size:"small"},s)})})},tN=t(90464);let{Link:tZ}=em.default;var tw=e=>{let{showAdvancedSettings:s,setShowAdvancedSettings:t,teams:l,guardrailsList:a}=e,[r]=I.Z.useForm(),[i,n]=d.useState(!1),[o,m]=d.useState("per_token"),[u,x]=d.useState(!1),h=(e,s)=>s&&(isNaN(Number(s))||0>Number(s))?Promise.reject("Please enter a valid positive number"):Promise.resolve(),p=(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}};return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(b.Z,{className:"mt-2 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Advanced Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,c.jsx)(I.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,c.jsx)(tn.Z,{onChange:e=>{n(e),e||r.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails. Go to 'Guardrails' tab to create new guardrails.",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:a.map(e=>({value:e,label:e}))})}),i&&(0,c.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,c.jsx)(I.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,c.jsx)(C.default,{defaultValue:"per_token",onChange:e=>m(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===o?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:h}],className:"mb-4",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:h}],className:"mb-4",children:(0,c.jsx)(y.Z,{})})]}):(0,c.jsx)(I.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:h}],className:"mb-4",children:(0,c.jsx)(y.Z,{})})]}),(0,c.jsx)(I.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,c.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,c.jsx)(tZ,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,c.jsx)(tn.Z,{onChange:e=>{let s=r.getFieldValue("litellm_extra_params");try{let t=s?JSON.parse(s):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?r.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):r.setFieldValue("litellm_extra_params","")}catch(s){e?r.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):r.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,c.jsx)(tm,{form:r,showCacheControl:u,onCacheControlChange:e=>{if(x(e),!e){let e=r.getFieldValue("litellm_extra_params");try{let s=e?JSON.parse(e):{};delete s.cache_control_injection_points,Object.keys(s).length>0?r.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):r.setFieldValue("litellm_extra_params","")}catch(e){r.setFieldValue("litellm_extra_params","")}}}}),(0,c.jsx)(I.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:p}],children:(0,c.jsx)(tN.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,c.jsxs)(sF.Z,{className:"mb-4",children:[(0,c.jsx)(sR.Z,{span:10}),(0,c.jsx)(sR.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,c.jsx)(tZ,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,c.jsx)(I.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:p}],children:(0,c.jsx)(tN.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},tk=t(29),tS=t.n(tk),tC=t(23639);let{Text:tI}=em.default;var tP=e=>{let{formValues:s,accessToken:t,testMode:l,modelName:a="this model",onClose:r,onTestComplete:i}=e,[n,o]=d.useState(null),[m,u]=d.useState(null),[x,h]=d.useState(null),[p,j]=d.useState(!0),[f,v]=d.useState(!1),[_,y]=d.useState(!1),b=async()=>{j(!0),y(!1),o(null),u(null),h(null),v(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",s);let a=await sO(s,t,null);if(!a){console.log("No result from prepareModelAddRequest"),o("Failed to prepare model data. Please check your form inputs."),v(!1),j(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:i,modelName:n}=a[0],c=await (0,g.testConnectionRequest)(t,r,null==i?void 0:i.mode);if("success"===c.status)P.ZP.success("Connection test successful!"),o(null),v(!0);else{var e,l;let s=(null===(e=c.result)||void 0===e?void 0:e.error)||c.message||"Unknown error";o(s),u(r),h(null===(l=c.result)||void 0===l?void 0:l.raw_request_typed_dict),v(!1)}}catch(e){console.error("Test connection error:",e),o(e instanceof Error?e.message:String(e)),v(!1)}finally{j(!1),i&&i()}};d.useEffect(()=>{let e=setTimeout(()=>{b()},200);return()=>clearTimeout(e)},[]);let N=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",Z="string"==typeof n?N(n):(null==n?void 0:n.message)?N(n.message):"Unknown error",w=x?((e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")})(x.raw_request_api_base,x.raw_request_body,x.raw_request_headers||{}):"";return(0,c.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[p?(0,c.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-776cdcbc0448e4ea",children:[(0,c.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-776cdcbc0448e4ea loading-spinner",children:(0,c.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-776cdcbc0448e4ea"})}),(0,c.jsxs)(tI,{style:{fontSize:"16px"},children:["Testing connection to ",a,"..."]}),(0,c.jsx)(tS(),{id:"776cdcbc0448e4ea",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):f?(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,c.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,c.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,c.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,c.jsxs)(tI,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",a," successful!"]})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,c.jsx)(ev.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,c.jsxs)(tI,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",a," failed"]})]}),(0,c.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,c.jsx)(tI,{strong:!0,style:{display:"block",marginBottom:"8px"},children:"Error: "}),(0,c.jsx)(tI,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:Z}),n&&(0,c.jsx)("div",{style:{marginTop:"12px"},children:(0,c.jsx)(T.ZP,{type:"link",onClick:()=>y(!_),style:{paddingLeft:0,height:"auto"},children:_?"Hide Details":"Show Details"})})]}),_&&(0,c.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,c.jsx)(tI,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,c.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof n?n:JSON.stringify(n,null,2)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(tI,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,c.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:w||"No request data available"}),(0,c.jsx)(T.ZP,{style:{marginTop:"8px"},icon:(0,c.jsx)(tC.Z,{}),onClick:()=>{navigator.clipboard.writeText(w||""),P.ZP.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,c.jsx)(Y.Z,{style:{margin:"24px 0 16px"}}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,c.jsx)(T.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,c.jsx)(U.Z,{}),children:"View Documentation"})})]})};let tA=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"}];var tE=t(92858);let tT=async(e,s,t,l)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",s?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",l?"Present":"Missing");let a={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:s?"Present":"Missing",config:a});let r=await (0,g.modelCreateCall)(s,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),P.ZP.error("Failed to add auto router: "+e,10)}},{Title:tL,Link:tO}=em.default;var tM=e=>{let{form:s,handleOk:t,accessToken:l,userRole:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)([]),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)(!1),[_,b]=(0,d.useState)(!1),[N,Z]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{h((await (0,g.modelAvailableCall)(l,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[l]),(0,d.useEffect)(()=>{(async()=>{try{let e=await tu(l);console.log("Fetched models for auto router:",e),j(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[l]);let k=eE.ZL.includes(a),S=async()=>{o(!0),u("test-".concat(Date.now())),i(!0)},E=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",N);let e=s.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){P.ZP.error("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){P.ZP.error("Please select a Default Model");return}if(s.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!N||!N.routes||0===N.routes.length){P.ZP.error("Please configure at least one route for the auto router");return}if(N.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){P.ZP.error("Please ensure all routes have a target model, description, and at least one utterance");return}s.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let a={...e,auto_router_config:N};console.log("Final submit values:",a),tT(a,l,s,t)}).catch(e=>{console.error("Validation failed:",e);let s=e.errorFields||[];if(s.length>0){let e=s.map(e=>{let s=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[s]||s});P.ZP.error("Please fill in the following required fields: ".concat(e.join(", ")))}else P.ZP.error("Please fill in all required fields")})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tL,{level:2,children:"Add Auto Router"}),(0,c.jsx)(w.Z,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,c.jsx)(th.Z,{children:(0,c.jsxs)(I.Z,{form:s,onFinish:E,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(y.Z,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,c.jsx)("div",{className:"w-full mb-4",children:(0,c.jsx)(tf,{modelInfo:p,value:N,onChange:e=>{Z(e),s.setFieldValue("auto_router_config",e)}})}),(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(C.default,{placeholder:"Select a default model",onChange:e=>{v("custom"===e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,c.jsx)(I.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(C.default,{value:s.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{b("custom"===e),s.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),k&&(0,c.jsx)(I.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(em.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{className:"space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:S,loading:n,children:"Test Connect"}),(0,c.jsx)(T.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",N),console.log("Current form values:",s.getFieldsValue()),E()},children:"Add Auto Router"})]})]})]})}),(0,c.jsx)(A.Z,{title:"Connection Test Results",open:r,onCancel:()=>{i(!1),o(!1)},footer:[(0,c.jsx)(T.ZP,{onClick:()=>{i(!1),o(!1)},children:"Close"},"close")],width:700,children:r&&(0,c.jsx)(tP,{formValues:s.getFieldsValue(),accessToken:l,testMode:"chat",modelName:s.getFieldValue("auto_router_name"),onClose:()=>{i(!1),o(!1)},onTestComplete:()=>o(!1)},m)})]})};let{Title:tD,Link:tF}=em.default;var tR=e=>{let{form:s,handleOk:t,selectedProvider:l,setSelectedProvider:a,providerModels:r,setProviderModelsFn:i,getPlaceholder:n,uploadProps:o,showAdvancedSettings:m,setShowAdvancedSettings:u,teams:x,credentials:h,accessToken:p,userRole:j,premiumUser:f}=e,[v]=I.Z.useForm(),[_,y]=(0,d.useState)("chat"),[b,N]=(0,d.useState)(!1),[Z,k]=(0,d.useState)(!1),[S,P]=(0,d.useState)([]),[E,L]=(0,d.useState)("");(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getGuardrailsList)(p)).guardrails.map(e=>e.guardrail_name);P(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[p]);let O=async()=>{k(!0),L("test-".concat(Date.now())),N(!0)},[M,D]=(0,d.useState)(!1),[F,R]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{R((await (0,g.modelAvailableCall)(p,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[p]);let q=eE.ZL.includes(j);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(eW.Z,{className:"w-full",children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Add Model"}),(0,c.jsx)(eY.Z,{children:"Add Auto Router"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(tD,{level:2,children:"Add Model"}),(0,c.jsx)(th.Z,{children:(0,c.jsx)(I.Z,{form:s,onFinish:e=>{console.log("\uD83D\uDD25 Form onFinish triggered with values:",e),t()},onFinishFailed:e=>{console.log("\uD83D\uDCA5 Form onFinishFailed triggered:",e)},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(C.default,{showSearch:!0,value:l,onChange:e=>{a(e),i(e),s.setFieldsValue({model:[],model_name:void 0})},children:Object.entries(sL.Cl).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sL.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(ty,{selectedProvider:l,providerModels:r,getPlaceholder:n}),(0,c.jsx)(tb,{}),(0,c.jsx)(I.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,c.jsx)(C.default,{style:{width:"100%"},value:_,onChange:e=>y(e),options:tA})}),(0,c.jsxs)(sF.Z,{children:[(0,c.jsx)(sR.Z,{span:10}),(0,c.jsx)(sR.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"mb-5 mt-1",children:[(0,c.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model ",(0,c.jsx)(tF,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsx)(em.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,c.jsx)(I.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...h.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.litellm_credential_name!==s.litellm_credential_name||e.provider!==s.provider,children:e=>{let{getFieldValue:s}=e,t=s("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?(0,c.jsx)("div",{className:"text-gray-500 text-sm text-center",children:"Using existing credentials - no additional provider fields needed"}):(0,c.jsx)(sz,{selectedProvider:l,uploadProps:o})}}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,c.jsx)(z.Z,{title:f?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,c.jsx)(tE.Z,{checked:M,onChange:e=>{D(e),e||s.setFieldValue("team_id",void 0)},disabled:!f})})}),M&&(0,c.jsx)(I.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:M&&!q,message:"Please select a team."}],children:(0,c.jsx)(J,{teams:x,disabled:!f})}),q&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(I.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:F.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,c.jsx)(tw,{showAdvancedSettings:m,setShowAdvancedSettings:u,teams:x,guardrailsList:S}),(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(em.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{className:"space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:O,loading:Z,children:"Test Connect"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(tM,{form:v,handleOk:()=>{v.validateFields().then(e=>{tT(e,p,v,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:p,userRole:j})})]})]}),(0,c.jsx)(A.Z,{title:"Connection Test Results",open:b,onCancel:()=>{N(!1),k(!1)},footer:[(0,c.jsx)(T.ZP,{onClick:()=>{N(!1),k(!1)},children:"Close"},"close")],width:700,children:b&&(0,c.jsx)(tP,{formValues:s.getFieldsValue(),accessToken:p,testMode:_,modelName:s.getFieldValue("model_name")||s.getFieldValue("model"),onClose:()=>{N(!1),k(!1)},onTestComplete:()=>k(!1)},E)})]})},tq=t(8048);let tU=(e,s,t,l,a,r,i,n,o,d,m)=>[{header:"Model ID",accessorKey:"model_info.id",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.model_info.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>l(t.model_info.id),children:t.model_info.id})})}},{header:"Public Model Name",accessorKey:"model_name",cell:e=>{let{row:s}=e,t=r(s.original)||"-";return(0,c.jsx)(z.Z,{title:t,children:(0,c.jsx)("div",{className:"text-xs truncate whitespace-nowrap",children:t})})}},{header:"Provider",accessorKey:"provider",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t.provider&&(0,c.jsx)("img",{src:(0,sL.dr)(t.provider).logo,alt:"".concat(t.provider," logo"),className:"w-4 h-4",onError:e=>{let s=e.target,l=s.parentElement;if(l){var a;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(a=t.provider)||void 0===a?void 0:a.charAt(0))||"-",l.replaceChild(e,s)}}}),(0,c.jsx)("p",{className:"text-xs",children:t.provider||"-"})]})}},{header:"LiteLLM Model Name",accessorKey:"litellm_model_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.litellm_model_name,children:(0,c.jsx)("div",{className:"text-xs truncate whitespace-nowrap",children:t.litellm_model_name||"-"})})}},{header:"Created At",accessorKey:"model_info.created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.created_at?new Date(t.model_info.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:"Created By",accessorKey:"model_info.created_by",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.created_by||"-"})}},{header:()=>(0,c.jsx)(z.Z,{title:"Cost per 1M tokens",children:(0,c.jsx)("span",{children:"Input Cost"})}),accessorKey:"input_cost",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("pre",{className:"text-xs",children:t.input_cost||"-"})}},{header:()=>(0,c.jsx)(z.Z,{title:"Cost per 1M tokens",children:(0,c.jsx)("span",{children:"Output Cost"})}),accessorKey:"output_cost",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("pre",{className:"text-xs",children:t.output_cost||"-"})}},{header:"Team ID",accessorKey:"model_info.team_id",cell:e=>{let{row:s}=e,t=s.original;return t.model_info.team_id?(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:t.model_info.team_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>a(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:"Model Access Group",accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:s}=e,t=s.original,l=t.model_info.access_groups;if(!l||0===l.length)return"-";let a=t.model_info.id,r=d.has(a),i=l.length>1,n=()=>{let e=new Set(d);r?e.delete(a):e.add(a),m(e)};return(0,c.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:l[0]}),(r||!i&&2===l.length)&&l.slice(1).map((e,s)=>(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},s+1)),i&&(0,c.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:r?"−":"+".concat(l.length-1)})]})}},{header:"Credentials",accessorKey:"litellm_credential_name",cell:e=>{let{row:s}=e,t=s.original;return t.litellm_params&&t.litellm_params.litellm_credential_name?(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsxs)(z.Z,{title:t.litellm_params.litellm_credential_name,children:[t.litellm_params.litellm_credential_name.slice(0,7),"..."]})}):(0,c.jsx)("span",{className:"text-gray-400",children:"-"})}},{header:"Status",accessorKey:"model_info.db_model",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:"",cell:t=>{var a;let{row:r}=t,i=r.original,n="Admin"===e||(null===(a=i.model_info)||void 0===a?void 0:a.created_by)===s;return(0,c.jsxs)("div",{className:"flex items-center justify-end gap-2 pr-4",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{n&&(l(i.model_info.id),o(!0))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>{n&&(l(i.model_info.id),o(!1))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"})]})}}];var tz=t(15731),tV=t(91126);let tK=(e,s,t,l,a,r,i,n,o,d,m)=>[{header:()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(s2.Z,{checked:t,indeterminate:s.length>0&&!t,onChange:e=>a(e.target.checked),onClick:e=>e.stopPropagation()}),(0,c.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,a=t.original,r=a.model_name,i=s.includes(r);return(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(s2.Z,{checked:i,onChange:e=>l(r,e.target.checked),onClick:e=>e.stopPropagation()}),(0,c.jsx)(z.Z,{title:a.model_info.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(a.model_info.id),children:a.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,t=s.original,l=n(t)||t.model_name;return(0,c.jsx)("div",{className:"font-medium text-sm",children:(0,c.jsx)(z.Z,{title:l,children:(0,c.jsx)("div",{className:"truncate max-w-[200px]",children:l})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,s,t)=>{var l,a;let r=e.getValue("health_status")||"unknown",i=s.getValue("health_status")||"unknown",n={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(l=n[r])&&void 0!==l?l:4)-(null!==(a=n[i])&&void 0!==a?a:4)},cell:s=>{var t;let{row:l}=s,a=l.original,r={status:a.health_status,loading:a.health_loading,error:a.health_error};if(r.loading)return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:"Checking..."})]});let n=a.model_name,o="healthy"===r.status&&(null===(t=e[n])||void 0===t?void 0:t.successResponse);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[i(r.status),o&&d&&(0,c.jsx)(z.Z,{title:"View response details",placement:"top",children:(0,c.jsx)("button",{onClick:()=>{var s;return d(n,null===(s=e[n])||void 0===s?void 0:s.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,c.jsx)(tz.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:s=>{let{row:t}=s,l=t.original.model_name,a=e[l];if(!(null==a?void 0:a.error))return(0,c.jsx)(w.Z,{className:"text-gray-400 text-sm",children:"No errors"});let r=a.error,i=a.fullError||a.error;return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"max-w-[200px]",children:(0,c.jsx)(z.Z,{title:r,placement:"top",children:(0,c.jsx)(w.Z,{className:"text-red-600 text-sm truncate",children:r})})}),o&&i!==r&&(0,c.jsx)(z.Z,{title:"View full error details",placement:"top",children:(0,c.jsx)("button",{onClick:()=>o(l,r,i),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,c.jsx)(tz.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,s,t)=>{let l=e.getValue("last_check")||"Never checked",a=s.getValue("last_check")||"Never checked";if("Never checked"===l&&"Never checked"===a)return 0;if("Never checked"===l)return 1;if("Never checked"===a)return -1;if("Check in progress..."===l&&"Check in progress..."===a)return 0;if("Check in progress..."===l)return -1;if("Check in progress..."===a)return 1;let r=new Date(l),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,s,t)=>{let l=e.getValue("last_success")||"Never succeeded",a=s.getValue("last_success")||"Never succeeded";if("Never succeeded"===l&&"Never succeeded"===a)return 0;if("Never succeeded"===l)return 1;if("Never succeeded"===a)return -1;if("None"===l&&"None"===a)return 0;if("None"===l)return 1;if("None"===a)return -1;let r=new Date(l),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:s=>{let{row:t}=s,l=e[t.original.model_name],a=(null==l?void 0:l.lastSuccess)||"None";return(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:a})}},{header:"Actions",id:"actions",cell:e=>{let{row:s}=e,t=s.original,l=t.model_name,a=t.health_status&&"none"!==t.health_status,i=t.health_loading?"Checking...":a?"Re-run Health Check":"Run Health Check";return(0,c.jsx)(z.Z,{title:i,placement:"top",children:(0,c.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||r(l)},disabled:t.health_loading,children:t.health_loading?(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):a?(0,c.jsx)(e1.Z,{className:"h-4 w-4"}):(0,c.jsx)(tV.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],tB=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var tG=e=>{let{accessToken:s,modelData:t,all_models_on_proxy:l,getDisplayModelName:a,setSelectedModelId:r}=e,[i,n]=(0,d.useState)({}),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[j,f]=(0,d.useState)(null),[v,y]=(0,d.useState)(!1),[b,N]=(0,d.useState)(null),Z=(0,d.useRef)(null);(0,d.useEffect)(()=>{s&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(s=>{e[s.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let l=await (0,g.latestHealthChecksCall)(s);l&&l.latest_health_checks&&"object"==typeof l.latest_health_checks&&Object.entries(l.latest_health_checks).forEach(s=>{let[l,a]=s;if(!a)return;let r=null,i=t.data.find(e=>e.model_name===l);if(i)r=i.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===l);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let s=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:s?S(s):void 0,fullError:s,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}n(e)})()},[s,t]);let S=e=>{var s;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),l=t.match(/(\w+Error):\s*(\d{3})/i);if(l)return"".concat(l[1],": ").concat(l[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],s={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return s?"".concat(e,": ").concat(s):e}for(let{pattern:e,replacement:s}of tB)if(e.test(t))return s;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let i=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),n=null===(s=i.split(/[.!?]/)[0])||void 0===s?void 0:s.trim();return n&&n.length>0?n.length>100?n.substring(0,97)+"...":n:i.length>100?i.substring(0,97)+"...":i},C=async e=>{if(s){n(s=>({...s,[e]:{...s[e],loading:!0,status:"checking"}}));try{var l,a;let r=await (0,g.individualModelHealthCheckCall)(s,e),i=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let s=(null===(l=r.unhealthy_endpoints[0])||void 0===l?void 0:l.error)||"Health check failed",t=S(s);n(l=>{var a;return{...l,[e]:{status:"unhealthy",lastCheck:i,lastSuccess:(null===(a=l[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:s}}})}else n(s=>({...s,[e]:{status:"healthy",lastCheck:i,lastSuccess:i,loading:!1,successResponse:r}}));try{let l=await (0,g.latestHealthChecksCall)(s),r=t.data.find(s=>s.model_name===e);if(r){let s=r.model_info.id,t=null===(a=l.latest_health_checks)||void 0===a?void 0:a[s];if(t){let s=t.error_message||void 0;n(l=>{var a,r,i,n,o,c,d;return{...l,[e]:{status:t.status||(null===(a=l[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=l[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(i=l[e])||void 0===i?void 0:i.lastSuccess)||"None":(null===(n=l[e])||void 0===n?void 0:n.lastSuccess)||"None",loading:!1,error:s?S(s):null===(o=l[e])||void 0===o?void 0:o.error,fullError:s||(null===(c=l[e])||void 0===c?void 0:c.fullError),successResponse:"healthy"===t.status?t:null===(d=l[e])||void 0===d?void 0:d.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let s=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),l=S(t);n(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:s,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:l,fullError:t}}})}}},I=async()=>{let e=o.length>0?o:l,a=e.reduce((e,s)=>(e[s]={...i[s],loading:!0,status:"checking"},e),{});n(e=>({...e,...a}));let r={},c=e.map(async e=>{if(s)try{let l=await (0,g.individualModelHealthCheckCall)(s,e);r[e]=l;let a=new Date().toLocaleString();if(l.unhealthy_count>0&&l.unhealthy_endpoints&&l.unhealthy_endpoints.length>0){var t;let s=(null===(t=l.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",r=S(s);n(t=>{var l;return{...t,[e]:{status:"unhealthy",lastCheck:a,lastSuccess:(null===(l=t[e])||void 0===l?void 0:l.lastSuccess)||"None",loading:!1,error:r,fullError:s}}})}else n(s=>({...s,[e]:{status:"healthy",lastCheck:a,lastSuccess:a,loading:!1,successResponse:l}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let s=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),l=S(t);n(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:s,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:l,fullError:t}}})}});await Promise.allSettled(c);try{if(!s)return;let l=await (0,g.latestHealthChecksCall)(s);l.latest_health_checks&&Object.entries(l.latest_health_checks).forEach(s=>{let[l,a]=s,r=t.data.find(e=>e.model_info.id===l);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,s=a.error_message||void 0;n(t=>{let l=t[e];return{...t,[e]:{status:a.status||(null==l?void 0:l.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==l?void 0:l.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==l?void 0:l.lastSuccess)||"None",loading:!1,error:s?S(s):null==l?void 0:l.error,fullError:s||(null==l?void 0:l.fullError),successResponse:"healthy"===a.status?a:null==l?void 0:l.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},P=e=>{x(e),e?m(l):m([])},E=()=>{p(!1),f(null)},L=()=>{y(!1),N(null)};return(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"mb-6",children:(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Model Health Status"}),(0,c.jsx)(w.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[o.length>0&&(0,c.jsx)(_.Z,{size:"sm",variant:"light",onClick:()=>P(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,c.jsx)(_.Z,{size:"sm",variant:"secondary",onClick:I,disabled:Object.values(i).some(e=>e.loading),className:"px-3 py-1 text-sm",children:o.length>0&&o.length<l.length?"Run Selected Checks":"Run All Checks"})]})]})}),(0,c.jsx)("div",{children:(0,c.jsx)(tq.C,{columns:tK(i,o,u,(e,s)=>{s?m(s=>[...s,e]):(m(s=>s.filter(s=>s!==e)),x(!1))},P,C,e=>{switch(e){case"healthy":return(0,c.jsx)(eJ.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,c.jsx)(eJ.Z,{color:"red",children:"unhealthy"});case"checking":return(0,c.jsx)(eJ.Z,{color:"blue",children:"checking"});case"none":return(0,c.jsx)(eJ.Z,{color:"gray",children:"none"});default:return(0,c.jsx)(eJ.Z,{color:"gray",children:"unknown"})}},a,(e,s,t)=>{f({modelName:e,cleanedError:s,fullError:t}),p(!0)},(e,s)=>{N({modelName:e,response:s}),y(!0)},r),data:t.data.map(e=>{let s=i[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:s.status,last_check:s.lastCheck,last_success:s.lastSuccess||"None",health_loading:s.loading,health_error:s.error,health_full_error:s.fullError}}),isLoading:!1,table:Z})}),(0,c.jsx)(A.Z,{title:j?"Health Check Error - ".concat(j.modelName):"Error Details",open:h,onCancel:E,footer:[(0,c.jsx)(T.ZP,{onClick:E,children:"Close"},"close")],width:800,children:j&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Error:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-red-800",children:j.cleanedError})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Full Error Details:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:j.fullError})})]})]})}),(0,c.jsx)(A.Z,{title:b?"Health Check Response - ".concat(b.modelName):"Response Details",open:v,onCancel:L,footer:[(0,c.jsx)(T.ZP,{onClick:L,children:"Close"},"close")],width:800,children:b&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Status:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Response Details:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(b.response,null,2)})})]})]})})]})},tH=t(61778),tJ=t(12660),tY=t(93142),tW=e=>{let{value:s={},onChange:t}=e,[l,a]=(0,d.useState)(Object.entries(s)),r=e=>{let s=l.filter((s,t)=>t!==e);a(s),null==t||t(Object.fromEntries(s))},i=(e,s,r)=>{let i=[...l];i[e]=[s,r],a(i),null==t||t(Object.fromEntries(i))};return(0,c.jsxs)("div",{children:[l.map((e,s)=>{let[t,l]=e;return(0,c.jsxs)(tY.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,c.jsx)(y.Z,{placeholder:"Header Name",value:t,onChange:e=>i(s,e.target.value,l)}),(0,c.jsx)(y.Z,{placeholder:"Header Value",value:l,onChange:e=>i(s,t,e.target.value)}),(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,c.jsx)(to.Z,{onClick:()=>r(s),style:{cursor:"pointer"}})})]},s)}),(0,c.jsx)(T.ZP,{type:"dashed",onClick:()=>{a([...l,["",""]])},icon:(0,c.jsx)(tc.Z,{}),children:"Add Header"})]})},t$=t(77565),tQ=e=>{let{pathValue:s,targetValue:t,includeSubpath:l}=e,a=(0,g.getProxyBaseUrl)();return s&&t?(0,c.jsxs)(W.Z,{className:"p-5",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,c.jsx)(sT.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,c.jsxs)("div",{className:"space-y-5",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,c.jsx)("code",{className:"font-mono text-sm text-gray-900",children:s?"".concat(a).concat(s):""})]}),(0,c.jsx)("div",{className:"text-gray-400",children:(0,c.jsx)(t$.Z,{className:"text-lg"})}),(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,c.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),l&&(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,c.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[s&&"".concat(a).concat(s),(0,c.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,c.jsx)("div",{className:"text-gray-400",children:(0,c.jsx)(t$.Z,{className:"text-lg"})}),(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,c.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,c.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,c.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",s," will be appended to the target URL"]})]})}),!l&&(0,c.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(U.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,c.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like ",(0,c.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null};let{Option:tX}=C.default;var t0=e=>{let{accessToken:s,setPassThroughItems:t,passThroughItems:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)(""),[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(!0),b=()=>{a.resetFields(),h(""),j(""),v(!0),i(!1)},N=e=>{let s=e;e&&!e.startsWith("/")&&(s="/"+e),h(s),a.setFieldsValue({path:s})},Z=async e=>{console.log("addPassThrough called with:",e),o(!0);try{console.log("formValues: ".concat(JSON.stringify(e)));let r=(await (0,g.createPassThroughEndpoint)(s,e)).endpoints[0],n=[...l,r];t(n),P.ZP.success("Pass-through endpoint created successfully"),a.resetFields(),h(""),j(""),v(!0),i(!1)}catch(e){P.ZP.error("Error creating pass-through endpoint: "+e,20)}finally{o(!1)}};return(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>i(!0),children:"+ Add Pass-Through Endpoint"}),(0,c.jsx)(A.Z,{title:(0,c.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,c.jsx)(tJ.Z,{className:"text-xl text-blue-500"}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:r,width:1e3,onCancel:b,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,c.jsxs)("div",{className:"mt-6",children:[(0,c.jsx)(tH.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,c.jsxs)(I.Z,{form:a,onFinish:Z,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:x,target:p},children:[(0,c.jsxs)(W.Z,{className:"p-5",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,c.jsx)(sT.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,c.jsxs)("div",{className:"space-y-5",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)(y.Z,{placeholder:"bria",value:x,onChange:e=>N(e.target.value),className:"flex-1"})})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,c.jsx)(y.Z,{placeholder:"https://engine.prod.bria-api.com",value:p,onChange:e=>{j(e.target.value),a.setFieldsValue({target:e.target.value})}})}),(0,c.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,c.jsx)(I.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,c.jsx)(tE.Z,{checked:f,onChange:v})})]})]})]}),(0,c.jsx)(tQ,{pathValue:x,targetValue:p,includeSubpath:f}),(0,c.jsxs)(W.Z,{className:"p-6",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,c.jsx)(sT.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,c.jsx)(z.Z,{title:"Authentication and other headers to forward with requests",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,c.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,c.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,c.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,c.jsx)(tW,{})})]}),(0,c.jsxs)(W.Z,{className:"p-6",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,c.jsx)(sT.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,c.jsx)(z.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,c.jsx)(M,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,c.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:b,children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",loading:n,onClick:()=>{console.log("Submit button clicked"),a.submit()},children:n?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},t1=t(87769),t2=t(42208);let t4=e=>{let{value:s}=e,[t,l]=(0,d.useState)(!1),a=JSON.stringify(s,null,2);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?a:"••••••••"}),(0,c.jsx)("button",{onClick:()=>l(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,c.jsx)(t1.Z,{className:"w-4 h-4 text-gray-500"}):(0,c.jsx)(t2.Z,{className:"w-4 h-4 text-gray-500"})})]})};var t5=e=>{let{endpointData:s,onClose:t,accessToken:l,isAdmin:a,onEndpointUpdated:r}=e,[i,n]=(0,d.useState)(s),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)(!1),[h]=I.Z.useForm(),p=async e=>{try{if(!l||!(null==i?void 0:i.id))return;let s={};if(e.headers)try{s="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){P.ZP.error("Invalid JSON format for headers");return}let t={path:i.path,target:e.target,headers:s,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request};await (0,g.updatePassThroughEndpoint)(l,i.id,t),n({...i,...t}),x(!1),r&&r()}catch(e){console.error("Error updating endpoint:",e),P.ZP.error("Failed to update pass through endpoint")}},j=async()=>{try{if(!l||!(null==i?void 0:i.id))return;await (0,g.deletePassThroughEndpointsCall)(l,i.id),P.ZP.success("Pass through endpoint deleted successfully"),t(),r&&r()}catch(e){console.error("Error deleting endpoint:",e),P.ZP.error("Failed to delete pass through endpoint")}};return o?(0,c.jsx)("div",{className:"p-4",children:"Loading..."}):i?(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,c.jsxs)(k.Z,{children:["Pass Through Endpoint: ",i.path]}),(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:i.id})]})}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"},"overview"),a?(0,c.jsx)(eY.Z,{children:"Settings"},"settings"):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Path"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{className:"font-mono",children:i.path})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Target"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{children:i.target})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Configuration"}),(0,c.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,c.jsx)("div",{children:(0,c.jsx)(eJ.Z,{color:i.include_subpath?"green":"gray",children:i.include_subpath?"Include Subpath":"Exact Path"})}),void 0!==i.cost_per_request&&(0,c.jsx)("div",{children:(0,c.jsxs)(w.Z,{children:["Cost per request: $",i.cost_per_request]})})]})]})]}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(tQ,{pathValue:i.path,targetValue:i.target,includeSubpath:i.include_subpath||!1})}),i.headers&&Object.keys(i.headers).length>0&&(0,c.jsxs)(W.Z,{className:"mt-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Headers"}),(0,c.jsxs)(eJ.Z,{color:"blue",children:[Object.keys(i.headers).length," headers configured"]})]}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(t4,{value:i.headers})})]})]}),a&&(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Pass Through Endpoint Settings"}),(0,c.jsx)("div",{className:"space-x-2",children:!u&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_.Z,{onClick:()=>x(!0),children:"Edit Settings"}),(0,c.jsx)(_.Z,{onClick:j,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),u?(0,c.jsxs)(I.Z,{form:h,onFinish:p,initialValues:{target:i.target,headers:i.headers?JSON.stringify(i.headers,null,2):"",include_subpath:i.include_subpath||!1,cost_per_request:i.cost_per_request},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,c.jsx)(y.Z,{placeholder:"https://api.example.com"})}),(0,c.jsx)(I.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,c.jsx)(L.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,c.jsx)(I.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,c.jsx)(tn.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,c.jsx)(q.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,c.jsx)(T.ZP,{onClick:()=>x(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{children:"Save Changes"})]})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Path"}),(0,c.jsx)("div",{className:"font-mono",children:i.path})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Target URL"}),(0,c.jsx)("div",{children:i.target})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Include Subpath"}),(0,c.jsx)(eJ.Z,{color:i.include_subpath?"green":"gray",children:i.include_subpath?"Yes":"No"})]}),void 0!==i.cost_per_request&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cost per Request"}),(0,c.jsxs)("div",{children:["$",i.cost_per_request]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Headers"}),i.headers&&Object.keys(i.headers).length>0?(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(t4,{value:i.headers})}):(0,c.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,c.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},t6=t(19130);function t3(e){let{data:s=[],columns:t,getRowCanExpand:l,renderSubComponent:a,isLoading:r=!1,loadingMessage:i="\uD83D\uDE85 Loading logs...",noDataMessage:n="No logs found"}=e,o=(0,sp.b7)({data:s,columns:t,getRowCanExpand:l,getRowId:(e,s)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(s)},getCoreRowModel:(0,sg.sC)(),getExpandedRowModel:(0,sg.rV)()});return(0,c.jsx)("div",{className:"rounded-lg custom-border",children:(0,c.jsxs)(t6.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(t6.ss,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(t6.SC,{children:e.headers.map(e=>(0,c.jsx)(t6.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,c.jsx)(t6.RM,{children:r?(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:i})})})}):o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsxs)(d.Fragment,{children:[(0,c.jsx)(t6.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(t6.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:e.getVisibleCells().length,children:a({row:e})})})]},e.id)):(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:n})})})})})]})})}let t8=e=>{let{value:s}=e,[t,l]=(0,d.useState)(!1),a=JSON.stringify(s);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"font-mono text-xs",children:t?a:"••••••••"}),(0,c.jsx)("button",{onClick:()=>l(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,c.jsx)(t1.Z,{className:"w-4 h-4 text-gray-500"}):(0,c.jsx)(t2.Z,{className:"w-4 h-4 text-gray-500"})})]})};var t7=e=>{let{accessToken:s,userRole:t,userID:l,modelData:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{s&&t&&l&&(0,g.getPassThroughEndpointsCall)(s).then(e=>{i(e.endpoints)})},[s,t,l]);let p=async e=>{h(e),u(!0)},j=async()=>{if(null!=x&&s){try{await (0,g.deletePassThroughEndpointsCall)(s,x);let e=r.filter(e=>e.id!==x);i(e),P.ZP.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.ZP.error("Error deleting the endpoint: "+e)}u(!1),h(null)}},f=(e,s)=>{p(e)},v=[{header:"ID",accessorKey:"id",cell:e=>(0,c.jsx)(z.Z,{title:e.row.original.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&o(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,c.jsx)(w.Z,{children:e.getValue()})},{header:"Headers",accessorKey:"headers",cell:e=>(0,c.jsx)(t8,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>s.original.id&&o(s.original.id),title:"Edit"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>f(s.original.id,s.index),title:"Delete"})]})}}];if(!s)return null;if(n){console.log("selectedEndpointId",n),console.log("generalSettings",r);let e=r.find(e=>e.id===n);return e?(0,c.jsx)(t5,{endpointData:e,onClose:()=>o(null),accessToken:s,isAdmin:"Admin"===t||"admin"===t,onEndpointUpdated:()=>{s&&(0,g.getPassThroughEndpointsCall)(s).then(e=>{i(e.endpoints)})}}):(0,c.jsx)("div",{children:"Endpoint not found"})}return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Pass Through Endpoints"}),(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,c.jsx)(t0,{accessToken:s,setPassThroughItems:i,passThroughItems:r}),(0,c.jsx)(t3,{data:r,columns:v,renderSubComponent:()=>(0,c.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),m&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:j,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{u(!1),h(null)},children:"Cancel"})]})]})]})})]})};let t9={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var le=e=>{let{accessToken:s,token:t,userRole:l,userID:a,modelData:r={data:[]},keys:i,setModelData:n,premiumUser:o,teams:m}=e,[u]=I.Z.useForm(),[x]=I.Z.useForm(),[h,p]=(0,d.useState)(null),[j,y]=(0,d.useState)(""),[b,N]=(0,d.useState)([]),[Z,S]=(0,d.useState)([]),[C,A]=(0,d.useState)(sL.Cl.OpenAI),[E,T]=(0,d.useState)(null),[L,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(!1),[F,R]=(0,d.useState)(null),[z,V]=(0,d.useState)([]),[K,B]=(0,d.useState)([]),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)([]),[$,Q]=(0,d.useState)([]),[X,ee]=(0,d.useState)([]),[es,et]=(0,d.useState)([]),[el,ea]=(0,d.useState)([]),[er,ei]=(0,d.useState)([]),[en,eo]=(0,d.useState)([]),[ec,eu]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ex,eh]=(0,d.useState)(null),[ep,eg]=(0,d.useState)(null),[ej,ef]=(0,d.useState)(0),[ev,e_]=(0,d.useState)({}),[ey,eb]=(0,d.useState)([]),[eN,eZ]=(0,d.useState)(!1),[ew,ek]=(0,d.useState)(null),[eS,eC]=(0,d.useState)(null),[eI,eP]=(0,d.useState)([]),[eA,eT]=(0,d.useState)([]),[eL,eO]=(0,d.useState)(!1),[eM,eD]=(0,d.useState)(null),[eF,eR]=(0,d.useState)(!1),[eq,eU]=(0,d.useState)(null),[ez,eV]=(0,d.useState)(null),[eK,eB]=(0,d.useState)(null),[eG,eJ]=(0,d.useState)(null),[e0,e2]=(0,d.useState)("personal"),[e4,e5]=(0,d.useState)("current_team"),[e6,e3]=(0,d.useState)(!1),[e8,e7]=(0,d.useState)(!1),[e9,se]=(0,d.useState)(new Set),ss=(0,d.useRef)(null),st=(0,d.useRef)(null),[sl,sa]=(0,d.useState)(0),sr=async(e,t,r)=>{if(console.log("Updating model metrics for group:",e),!s||!a||!l||!t||!r)return;console.log("inside updateModelMetrics - startTime:",t,"endTime:",r),H(e);let i=null==ew?void 0:ew.token;void 0===i&&(i=null);let n=eS;void 0===n&&(n=null);try{let o=await (0,g.modelMetricsCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);console.log("Model metrics response:",o),Y(o.data),Q(o.all_api_bases);let c=await (0,g.streamingModelMetricsCall)(s,e,t.toISOString(),r.toISOString());ee(c.data),et(c.all_api_bases);let d=await (0,g.modelExceptionsCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);console.log("Model exceptions response:",d),ea(d.data),ei(d.exception_types);let m=await (0,g.modelMetricsSlowResponsesCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);if(console.log("slowResponses:",m),eo(m),e){let l=await (0,g.adminGlobalActivityExceptions)(s,null==t?void 0:t.toISOString().split("T")[0],null==r?void 0:r.toISOString().split("T")[0],e);e_(l);let a=await (0,g.adminGlobalActivityExceptionsPerDeployment)(s,null==t?void 0:t.toISOString().split("T")[0],null==r?void 0:r.toISOString().split("T")[0],e);eb(a)}}catch(e){console.error("Failed to fetch model metrics",e)}},si=async e=>{try{let s=await (0,g.credentialListCall)(e);console.log("credentials: ".concat(JSON.stringify(s))),eT(s.credentials)}catch(e){console.error("Error fetching credentials:",e)}};(0,d.useEffect)(()=>{sr(G,ec.from,ec.to)},[ew,eS,ez]),(0,d.useEffect)(()=>{let e=e=>{ss.current&&!ss.current.contains(e.target)&&e7(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let sn={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let s=new FileReader;s.onload=e=>{if(e.target){let s=e.target.result;console.log("Resetting vertex_credentials to JSON; jsonStr: ".concat(s)),u.setFieldsValue({vertex_credentials:s}),console.log("Form values right after setting:",u.getFieldsValue())}},s.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered with values:",e),console.log("Current form values:",u.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?P.ZP.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&P.ZP.error("".concat(e.file.name," file upload failed."))}},sc=()=>{y(new Date().toLocaleString())},sd=async()=>{if(!s){console.error("Access token is missing");return}try{let e={router_settings:{}};"global"===G?(console.log("Saving global retry policy:",ep),ep&&(e.router_settings.retry_policy=ep),P.ZP.success("Global retry settings saved successfully")):(console.log("Saving model group retry policy for",G,":",ex),ex&&(e.router_settings.model_group_retry_policy=ex),P.ZP.success("Retry settings saved successfully for ".concat(G))),await (0,g.setCallbacksCall)(s,e)}catch(e){console.error("Failed to save retry settings:",e),P.ZP.error("Failed to save retry settings")}};if((0,d.useEffect)(()=>{if(!s||!t||!l||!a)return;let e=async()=>{try{var e,t,r,i,o,c,d,m,u,x,h,p;let j=await (0,g.modelInfoCall)(s,a,l);console.log("Model data response:",j.data),n(j);let f=await (0,g.modelSettingsCall)(s);f&&S(f);let v=new Set;for(let e=0;e<j.data.length;e++){let s=j.data[e];v.add(s.model_name)}console.log("all_model_groups:",v);let _=Array.from(v);_=_.sort(),V(_);let y=new Set;for(let e=0;e<j.data.length;e++){let s=j.data[e].model_info;if(s){let e=s.access_groups;if(e)for(let s=0;s<e.length;s++)y.add(e[s])}}B(Array.from(y)),console.log("array_model_groups:",_);let b="all";_.length>0&&(b=_[_.length-1],console.log("_initial_model_group:",b)),console.log("selectedModelGroup:",G);let N=await (0,g.modelMetricsCall)(s,a,l,b,null===(e=ec.from)||void 0===e?void 0:e.toISOString(),null===(t=ec.to)||void 0===t?void 0:t.toISOString(),null==ew?void 0:ew.token,eS);console.log("Model metrics response:",N),Y(N.data),Q(N.all_api_bases);let Z=await (0,g.streamingModelMetricsCall)(s,b,null===(r=ec.from)||void 0===r?void 0:r.toISOString(),null===(i=ec.to)||void 0===i?void 0:i.toISOString());ee(Z.data),et(Z.all_api_bases);let w=await (0,g.modelExceptionsCall)(s,a,l,b,null===(o=ec.from)||void 0===o?void 0:o.toISOString(),null===(c=ec.to)||void 0===c?void 0:c.toISOString(),null==ew?void 0:ew.token,eS);console.log("Model exceptions response:",w),ea(w.data),ei(w.exception_types);let k=await (0,g.modelMetricsSlowResponsesCall)(s,a,l,b,null===(d=ec.from)||void 0===d?void 0:d.toISOString(),null===(m=ec.to)||void 0===m?void 0:m.toISOString(),null==ew?void 0:ew.token,eS),C=await (0,g.adminGlobalActivityExceptions)(s,null===(u=ec.from)||void 0===u?void 0:u.toISOString().split("T")[0],null===(x=ec.to)||void 0===x?void 0:x.toISOString().split("T")[0],b);e_(C);let I=await (0,g.adminGlobalActivityExceptionsPerDeployment)(s,null===(h=ec.from)||void 0===h?void 0:h.toISOString().split("T")[0],null===(p=ec.to)||void 0===p?void 0:p.toISOString().split("T")[0],b);eb(I),console.log("dailyExceptions:",C),console.log("dailyExceptionsPerDeplyment:",I),console.log("slowResponses:",k),eo(k);let P=await (0,g.allEndUsersCall)(s);eP(null==P?void 0:P.end_users);let A=(await (0,g.getCallbacksCall)(s,a,l)).router_settings;console.log("routerSettingsInfo:",A);let E=A.model_group_retry_policy,T=A.num_retries;console.log("model_group_retry_policy:",E),console.log("default_retries:",T),eh(E),eg(A.retry_policy),ef(T)}catch(e){console.error("There was an error fetching the model data",e)}};s&&t&&l&&a&&e();let r=async()=>{let e=await (0,g.modelCostMap)(s);console.log("received model cost map data: ".concat(Object.keys(e))),p(e)};null==h&&r(),sc()},[s,t,l,a,h,j,ez]),!r||!s||!t||!l||!a)return(0,c.jsx)("div",{children:"Loading..."});let sm=[],su=[];for(let e=0;e<r.data.length;e++){var sx,sh,sp;let s=r.data[e],t=null==s?void 0:null===(sx=s.litellm_params)||void 0===sx?void 0:sx.model,l=null==s?void 0:null===(sh=s.litellm_params)||void 0===sh?void 0:sh.custom_llm_provider,a=null==s?void 0:s.model_info,i="",n="Undefined",o="Undefined",c="Undefined",d="Undefined",m={},u=e=>(console.log("GET PROVIDER CALLED! - ".concat(h)),null!=h&&"object"==typeof h&&e in h)?h[e].litellm_provider:"openai";if(t){let e=t.split("/"),s=e[0];(i=l)||(i=1===e.length?u(t):s)}else i="-";a&&(n=null==a?void 0:a.input_cost_per_token,o=null==a?void 0:a.output_cost_per_token,c=null==a?void 0:a.max_tokens,d=null==a?void 0:a.max_input_tokens),(null==s?void 0:s.litellm_params)&&(m=Object.fromEntries(Object.entries(null==s?void 0:s.litellm_params).filter(e=>{let[s]=e;return"model"!==s&&"api_base"!==s}))),r.data[e].provider=i,r.data[e].input_cost=n,r.data[e].output_cost=o,r.data[e].litellm_model_name=t,su.push(i),r.data[e].input_cost&&(r.data[e].input_cost=(1e6*Number(r.data[e].input_cost)).toFixed(2)),r.data[e].output_cost&&(r.data[e].output_cost=(1e6*Number(r.data[e].output_cost)).toFixed(2)),r.data[e].max_tokens=c,r.data[e].max_input_tokens=d,r.data[e].api_base=null==s?void 0:null===(sp=s.litellm_params)||void 0===sp?void 0:sp.api_base,r.data[e].cleanedLitellmParams=m,sm.push(s.model_name),console.log(r.data[e])}if(l&&"Admin Viewer"==l){let{Title:e,Paragraph:s}=em.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to view all models"})]})}let sg=(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mb-1",children:"Select API Key Name"}),o?(0,c.jsxs)("div",{children:[(0,c.jsxs)(eH.Z,{defaultValue:"all-keys",children:[(0,c.jsx)(ed.Z,{value:"all-keys",onClick:()=>{ek(null)},children:"All Keys"},"all-keys"),null==i?void 0:i.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,c.jsx)(ed.Z,{value:String(s),onClick:()=>{ek(e)},children:e.key_alias},s):null)]}),(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Customer Name"}),(0,c.jsxs)(eH.Z,{defaultValue:"all-customers",children:[(0,c.jsx)(ed.Z,{value:"all-customers",onClick:()=>{eC(null)},children:"All Customers"},"all-customers"),null==eI?void 0:eI.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,onClick:()=>{eC(e)},children:e},s))]}),(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Team"}),(0,c.jsxs)(eH.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=eK?eK:"all",onValueChange:e=>eB("all"===e?null:e),children:[(0,c.jsx)(ed.Z,{value:"all",children:"All Teams"}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ed.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Team"}),(0,c.jsxs)(eH.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=eK?eK:"all",onValueChange:e=>eB("all"===e?null:e),children:[(0,c.jsx)(ed.Z,{value:"all",children:"All Teams"}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ed.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]}),sZ=e=>{var s,t;let{payload:l,active:a}=e;if(!a||!l)return null;let r=null===(t=l[0])||void 0===t?void 0:null===(s=t.payload)||void 0===s?void 0:s.date,i=l.sort((e,s)=>s.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:l.slice(5).reduce((e,s)=>e+s.value,0),color:"gray"})}return(0,c.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,c.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",r]}),i.map((e,s)=>{let t=parseFloat(e.value.toFixed(5)),l=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,c.jsxs)("div",{className:"flex justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,c.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,c.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:l})]},s)})]})};console.log("selectedProvider: ".concat(C)),console.log("providerModels.length: ".concat(b.length));let sw=Object.keys(sL.Cl).find(e=>sL.Cl[e]===C);return(sw&&Z&&Z.find(e=>e.name===sL.fK[sw]),eq)?(0,c.jsx)("div",{className:"w-full h-full",children:(0,c.jsx)(tt,{teamId:eq,onClose:()=>eU(null),accessToken:s,is_team_admin:"Admin"===l,is_proxy_admin:"Proxy Admin"===l,userModels:sm,editTeam:!1,onUpdate:sc})}):(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:eM?(0,c.jsx)(t_,{modelId:eM,editModel:!0,onClose:()=>{eD(null),eR(!1)},modelData:r.data.find(e=>e.model_info.id===eM),accessToken:s,userID:a,userRole:l,setEditModalVisible:D,setSelectedModel:R,onModelUpdate:e=>{n({...r,data:r.data.map(s=>s.model_info.id===e.model_info.id?e:s)}),sc()},modelAccessGroups:K}):(0,c.jsxs)(eW.Z,{index:sl,onIndexChange:sa,className:"gap-2 h-[75vh] w-full ",children:[(0,c.jsxs)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[eE.ZL.includes(l)?(0,c.jsx)(eY.Z,{children:"All Models"}):(0,c.jsx)(eY.Z,{children:"Your Models"}),(0,c.jsx)(eY.Z,{children:"Add Model"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"LLM Credentials"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"Pass-Through Endpoints"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"Health Status"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"Model Analytics"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"Model Retry Settings"})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[j&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",j]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center",onClick:sc})]})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(v.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Model Management"}),eE.ZL.includes(l)?(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Add and manage models for the proxy"}):(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Add models for teams you are an admin for."})]})}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,c.jsxs)(eH.Z,{className:"w-80",defaultValue:"personal",value:e0,onValueChange:e=>e2(e),children:[(0,c.jsx)(ed.Z,{value:"personal",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ed.Z,{value:e.team_id,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),"current_team"===e4&&(0,c.jsxs)("div",{className:"flex items-start gap-2 mt-2 bg-gray-50 rounded",children:[(0,c.jsx)(U.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===e0?(0,c.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,c.jsx)("a",{href:"/?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,c.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',e0,'" on the'," ",(0,c.jsx)("a",{href:"/?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,c.jsxs)(eH.Z,{className:"w-64",defaultValue:"current_team",value:e4,onValueChange:e=>e5(e),children:[(0,c.jsx)(ed.Z,{value:"current_team",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,c.jsx)(ed.Z,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),(0,c.jsx)("div",{className:"flex items-center justify-between",children:(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:"Filter by Public Model Name:"}),(0,c.jsxs)(eH.Z,{className:"w-64",defaultValue:null!=G?G:"all",onValueChange:e=>H("all"===e?"all":e),value:null!=G?G:"all",children:[(0,c.jsx)(ed.Z,{value:"all",children:"All Models"}),(0,c.jsx)(ed.Z,{value:"wildcard",children:"Wildcard Models (*)"}),z.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,children:e},s))]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:"Filter by Model Access Group:"}),(0,c.jsxs)(eH.Z,{className:"w-64",defaultValue:"all",value:null!=eG?eG:"all",onValueChange:e=>eJ("all"===e?null:e),children:[(0,c.jsx)(ed.Z,{value:"all",children:"All Model Access Groups"}),K.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,children:e},s))]})]})]})}),(0,c.jsx)("div",{className:"flex justify-between items-center",children:(0,c.jsxs)(w.Z,{className:"text-sm text-gray-700",children:["Showing"," ",r&&r.data.length>0?r.data.filter(e=>{var s,t,l,a;let r="all"===G||e.model_name===G||!G,i="all"===eG||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(eG))||!eG,n=!0;return"current_team"===e4&&(n="personal"===e0?(null===(t=e.model_info)||void 0===t?void 0:t.direct_access)===!0:(null===(a=e.model_info)||void 0===a?void 0:null===(l=a.access_via_team_ids)||void 0===l?void 0:l.includes(e0))===!0),r&&i&&n}).length:0," ","results"]})})]})}),(0,c.jsx)(tq.C,{columns:tU(l,a,o,eD,eU,sH,e=>{R(e),D(!0)},sc,eR,e9,se),data:r.data.filter(e=>{var s,t,l,a;let r="all"===G||e.model_name===G||!G||"wildcard"===G&&e.model_name.includes("*"),i="all"===eG||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(eG))||!eG,n=!0;return"current_team"===e4&&(n="personal"===e0?(null===(t=e.model_info)||void 0===t?void 0:t.direct_access)===!0:(null===(a=e.model_info)||void 0===a?void 0:null===(l=a.access_via_team_ids)||void 0===l?void 0:l.includes(e0))===!0),r&&i&&n}),isLoading:!1,table:st})]})]})})}),(0,c.jsx)(eQ.Z,{className:"h-full",children:(0,c.jsx)(tR,{form:u,handleOk:()=>{console.log("\uD83D\uDE80 handleOk called from model dashboard!"),console.log("Current form values:",u.getFieldsValue()),u.validateFields().then(e=>{console.log("✅ Validation passed, submitting:",e),sM(e,s,u,sc)}).catch(e=>{var s;console.error("❌ Validation failed:",e),console.error("Form errors:",e.errorFields);let t=(null===(s=e.errorFields)||void 0===s?void 0:s.map(e=>"".concat(e.name.join("."),": ").concat(e.errors.join(", "))).join(" | "))||"Unknown validation error";P.ZP.error("Please fill in the following required fields: ".concat(t))})},selectedProvider:C,setSelectedProvider:A,providerModels:b,setProviderModelsFn:e=>{let s=(0,sL.bK)(e,h);N(s),console.log("providerModels: ".concat(s))},getPlaceholder:sL.ph,uploadProps:sn,showAdvancedSettings:eL,setShowAdvancedSettings:eO,teams:m,credentials:eA,accessToken:s,userRole:l,premiumUser:o})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(sG,{accessToken:s,uploadProps:sn,credentialList:eA,fetchCredentials:si})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(t7,{accessToken:s,userRole:l,userID:a,modelData:r})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(tG,{accessToken:s,modelData:r,all_models_on_proxy:sm,getDisplayModelName:sH,setSelectedModelId:eD})}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:ec,className:"mr-2",onValueChange:e=>{eu(e),sr(G,e.from,e.to)}})}),(0,c.jsxs)(f.Z,{className:"ml-2",children:[(0,c.jsx)(w.Z,{children:"Select Model Group"}),(0,c.jsx)(eH.Z,{defaultValue:G||z[0],value:G||z[0],children:z.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,onClick:()=>sr(e,ec.from,ec.to),children:e},s))})]}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(sQ.Z,{trigger:"click",content:sg,overlayStyle:{width:"20vw"},children:(0,c.jsx)(_.Z,{icon:so.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>eZ(!0)})})})]}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(W.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eY.Z,{value:"1",children:"Avg. Latency per Token"}),(0,c.jsx)(eY.Z,{value:"2",children:"Time to first token"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)("p",{className:"text-gray-500 italic",children:[" ","(seconds/token)"]}),(0,c.jsx)(w.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),J&&$&&(0,c.jsx)(sW.Z,{title:"Model Latency",className:"h-72",data:J,showLegend:!1,index:"date",categories:$,connectNulls:!0,customTooltip:sZ})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(s0,{modelMetrics:X,modelMetricsCategories:es,customTooltip:sZ,premiumUser:o})})]})]})})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(W.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Deployment"}),(0,c.jsx)(sb.Z,{children:"Success Responses"}),(0,c.jsxs)(sb.Z,{children:["Slow Responses"," ",(0,c.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,c.jsx)(sv.Z,{children:en.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.api_base}),(0,c.jsx)(s_.Z,{children:e.total_count}),(0,c.jsx)(s_.Z,{children:e.slow_count})]},s))})]})})})]}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(k.Z,{children:["All Exceptions for ",G]}),(0,c.jsx)(s$.Z,{className:"h-60",data:el,index:"model",categories:er,stack:!0,yAxisWidth:30})]})}),(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(k.Z,{children:["All Up Rate Limit Errors (429) for ",G]}),(0,c.jsxs)(v.Z,{numItems:1,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors"," ",ev.sum_num_rate_limit_exceptions]}),(0,c.jsx)(s$.Z,{className:"h-40",data:ev.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,c.jsx)(f.Z,{})]})]}),o?(0,c.jsx)(c.Fragment,{children:ey.map((e,s)=>(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429)"," ",e.sum_num_rate_limit_exceptions]}),(0,c.jsx)(s$.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},s))}):(0,c.jsx)(c.Fragment,{children:ey&&ey.length>0&&ey.slice(0,1).map((e,s)=>(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,c.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,c.jsx)(_.Z,{variant:"primary",className:"mb-2",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:e.api_base}),(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors"," ",e.sum_num_rate_limit_exceptions]}),(0,c.jsx)(s$.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},s))})]})]}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)("div",{className:"flex items-center gap-4 mb-6",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{children:"Retry Policy Scope:"}),(0,c.jsxs)(eH.Z,{className:"ml-2 w-48",defaultValue:"global",value:"global"===G?"global":G||z[0],onValueChange:e=>H(e),children:[(0,c.jsx)(ed.Z,{value:"global",children:"Global Default"}),z.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,onClick:()=>H(e),children:e},s))]})]})}),"global"===G?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k.Z,{children:"Global Retry Policy"}),(0,c.jsx)(w.Z,{className:"mb-6",children:"Default retry settings applied to all model groups unless overridden"})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(k.Z,{children:["Retry Policy for ",G]}),(0,c.jsx)(w.Z,{className:"mb-6",children:"Model-specific retry settings. Falls back to global defaults if not set."})]}),t9&&(0,c.jsx)("table",{children:(0,c.jsx)("tbody",{children:Object.entries(t9).map((e,s)=>{var t,l,a,r;let i,[n,o]=e;if("global"===G)i=null!==(t=null==ep?void 0:ep[o])&&void 0!==t?t:ej;else{let e=null==ex?void 0:null===(l=ex[G])||void 0===l?void 0:l[o];i=null!=e?e:null!==(a=null==ep?void 0:ep[o])&&void 0!==a?a:ej}return(0,c.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,c.jsxs)("td",{children:[(0,c.jsx)(w.Z,{children:n}),"global"!==G&&(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500 ml-2",children:["(Global: ",null!==(r=null==ep?void 0:ep[o])&&void 0!==r?r:ej,")"]})]}),(0,c.jsx)("td",{children:(0,c.jsx)(q.Z,{className:"ml-5",value:i,min:0,step:1,onChange:e=>{"global"===G?eg(s=>null==e?s:{...null!=s?s:{},[o]:e}):eh(s=>{var t;let l=null!==(t=null==s?void 0:s[G])&&void 0!==t?t:{};return{...null!=s?s:{},[G]:{...l,[o]:e}}})}})})]},s)})})}),(0,c.jsx)(_.Z,{className:"mt-6 mr-8",onClick:sd,children:"Save"})]})]})]})})})})},ls=e=>{let{visible:s,possibleUIRoles:t,onCancel:l,user:a,onSubmit:r}=e,[i,n]=(0,d.useState)(a),[o]=I.Z.useForm();(0,d.useEffect)(()=>{o.resetFields()},[a]);let m=async()=>{o.resetFields(),l()},u=async e=>{r(e),o.resetFields(),l()};return a?(0,c.jsx)(A.Z,{visible:s,onCancel:m,footer:null,title:"Edit User "+a.user_id,width:1e3,children:(0,c.jsx)(I.Z,{form:o,onFinish:u,initialValues:a,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"User Role",name:"user_role",children:(0,c.jsx)(C.default,{children:t&&Object.entries(t).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ed.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,c.jsx)(q.Z,{min:0,step:.01})}),(0,c.jsx)(I.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,c.jsx)(M,{min:0,step:.01})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},lt=t(16853);function ll(e){let{userData:s,onCancel:t,onSubmit:l,teams:a,accessToken:r,userID:i,userRole:n,userModels:o,possibleUIRoles:m,isBulkEdit:u=!1}=e,[x]=I.Z.useForm();return d.useEffect(()=>{var e,t,l,a,r;x.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_role:null===(t=s.user_info)||void 0===t?void 0:t.user_role,models:(null===(l=s.user_info)||void 0===l?void 0:l.models)||[],max_budget:null===(a=s.user_info)||void 0===a?void 0:a.max_budget,metadata:(null===(r=s.user_info)||void 0===r?void 0:r.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,x]),(0,c.jsxs)(I.Z,{form:x,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}l(e)},layout:"vertical",children:[!u&&(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",children:(0,c.jsx)(y.Z,{disabled:!0})}),!u&&(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Global Proxy Role"," ",(0,c.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,c.jsx)(U.Z,{})})]}),name:"user_role",children:(0,c.jsx)(C.default,{children:m&&Object.entries(m).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ed.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Personal Models"," ",(0,c.jsx)(z.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!eE.ZL.includes(n||""),children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,c.jsx)(C.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),o.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(lt.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",type:"button",onClick:t,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})]})}let{Text:la,Title:lr}=em.default;var li=e=>{let{visible:s,onCancel:t,selectedUsers:l,possibleUIRoles:a,accessToken:r,onSuccess:i,teams:n,userRole:o,userModels:m,allowAllUsers:u=!1}=e,[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)(null),[_,y]=(0,d.useState)(!1),[b,N]=(0,d.useState)(!1),Z=()=>{j([]),v(null),y(!1),N(!1),t()},w=d.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:n||[]}),[n,s]),k=async e=>{if(console.log("formValues",e),!r){P.ZP.error("Access token not found");return}h(!0);try{let s=l.map(e=>e.user_id),a={};e.user_role&&""!==e.user_role&&(a.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(a.max_budget=e.max_budget),e.models&&e.models.length>0&&(a.models=e.models),e.metadata&&Object.keys(e.metadata).length>0&&(a.metadata=e.metadata);let n=Object.keys(a).length>0,o=_&&p.length>0;if(!n&&!o){P.ZP.error("Please modify at least one field or select teams to add users to");return}let c=[];if(n){if(b){let e=await (0,g.userBulkUpdateUserCall)(r,a,void 0,!0);c.push("Updated all users (".concat(e.total_requested," total)"))}else await (0,g.userBulkUpdateUserCall)(r,a,s),c.push("Updated ".concat(s.length," user(s)"))}if(o){let e=[];for(let s of p)try{let t=null;b?t=null:l.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let a=await (0,g.teamBulkMemberAddCall)(r,s,t||null,f||void 0,b);console.log("result",a),e.push({teamId:s,success:!0,successfulAdditions:a.successful_additions,failedAdditions:a.failed_additions})}catch(t){console.error("Failed to add users to team ".concat(s,":"),t),e.push({teamId:s,success:!1,error:t})}let s=e.filter(e=>e.success),t=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);c.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}t.length>0&&P.ZP.warning("Failed to add users to ".concat(t.length," team(s)"))}c.length>0&&P.ZP.success(c.join(". ")),j([]),v(null),y(!1),N(!1),i(),t()}catch(e){console.error("Bulk operation failed:",e),P.ZP.error("Failed to perform bulk operations")}finally{h(!1)}};return(0,c.jsxs)(A.Z,{visible:s,onCancel:Z,footer:null,title:b?"Bulk Edit All Users":"Bulk Edit ".concat(l.length," User(s)"),width:800,children:[u&&(0,c.jsxs)("div",{className:"mb-4",children:[(0,c.jsx)(s2.Z,{checked:b,onChange:e=>N(e.target.checked),children:(0,c.jsx)(la,{strong:!0,children:"Update ALL users in the system"})}),b&&(0,c.jsx)("div",{style:{marginTop:8},children:(0,c.jsx)(la,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!b&&(0,c.jsxs)("div",{className:"mb-4",children:[(0,c.jsxs)(lr,{level:5,children:["Selected Users (",l.length,"):"]}),(0,c.jsx)(eh.Z,{size:"small",bordered:!0,dataSource:l,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,c.jsx)(la,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,c.jsx)(la,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,c.jsx)(la,{style:{fontSize:"12px"},children:(null==a?void 0:null===(s=a[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,c.jsx)(la,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,c.jsx)(Y.Z,{}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsxs)(la,{children:[(0,c.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,c.jsx)(th.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,c.jsxs)(tY.Z,{direction:"vertical",style:{width:"100%"},children:[(0,c.jsx)(s2.Z,{checked:_,onChange:e=>y(e.target.checked),children:"Add selected users to teams"}),_&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(la,{strong:!0,children:"Select Teams:"}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select teams to add users to",value:p,onChange:j,style:{width:"100%",marginTop:8},options:(null==n?void 0:n.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(la,{strong:!0,children:"Team Budget (Optional):"}),(0,c.jsx)(q.Z,{placeholder:"Max budget per user in team",value:f,onChange:e=>v(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,c.jsx)(la,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,c.jsx)(la,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,c.jsx)(ll,{userData:w,onCancel:Z,onSubmit:k,teams:n,accessToken:r,userID:"bulk_edit",userRole:o,userModels:m,possibleUIRoles:a,isBulkEdit:!0}),x&&(0,c.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,c.jsxs)(la,{children:["Updating ",b?"all users":l.length," user(s)..."]})})]})};let ln=(e,s,t,l,a,r)=>{let i=[{header:"User ID",accessorKey:"user_id",cell:e=>{let{row:s}=e;return(0,c.jsx)(z.Z,{title:s.original.user_id,children:(0,c.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"User Email",accessorKey:"user_email",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",cell:s=>{var t;let{row:l}=s;return(0,c.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(t=e[l.original.user_role])||void 0===t?void 0:t.ui_label)||"-"})}},{header:"User Spend ($ USD)",accessorKey:"spend",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.spend?eD(s.original.spend,4):"-"})}},{header:"User Max Budget ($ USD)",accessorKey:"max_budget",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{children:"SSO ID"}),(0,c.jsx)(z.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,c.jsx)(tz.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"API Keys",accessorKey:"key_count",cell:e=>{let{row:s}=e;return(0,c.jsx)(v.Z,{numItems:2,children:s.original.key_count>0?(0,c.jsxs)(eJ.Z,{size:"xs",color:"indigo",children:[s.original.key_count," Keys"]}):(0,c.jsx)(eJ.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(z.Z,{title:"Edit user details",zIndex:9999,children:(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>a(s.original.user_id,!0)})}),(0,c.jsx)(z.Z,{title:"Delete user",zIndex:9999,children:(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>t(s.original.user_id)})}),(0,c.jsx)(z.Z,{title:"Reset Password",zIndex:9999,children:(0,c.jsx)(sj.Z,{icon:e1.Z,size:"sm",onClick:()=>l(s.original.user_id)})})]})}}];if(r){let{onSelectUser:e,onSelectAll:s,isUserSelected:t,isAllSelected:l,isIndeterminate:a}=r;return[{id:"select",header:()=>(0,c.jsx)(s2.Z,{indeterminate:a,checked:l,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:l}=s;return(0,c.jsx)(s2.Z,{checked:t(l.original),onChange:s=>e(l.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...i]}return i};function lo(e){var s,t,l,a,r,i,n,o,m,u,x,h,p,j,f,y,b,N,Z,S,C,I,A,E,L,O,M;let{userId:D,onClose:F,accessToken:R,userRole:q,onDelete:U,possibleUIRoles:z,initialTab:V=0,startInEditMode:K=!1}=e,[B,G]=(0,d.useState)(null),[H,J]=(0,d.useState)(!1),[Y,$]=(0,d.useState)(!0),[Q,X]=(0,d.useState)(K),[es,et]=(0,d.useState)([]),[el,ea]=(0,d.useState)(!1),[er,ei]=(0,d.useState)(null),[en,eo]=(0,d.useState)(null),[ec,ed]=(0,d.useState)(V),[em,ex]=(0,d.useState)({});d.useEffect(()=>{eo((0,g.getProxyBaseUrl)())},[]),d.useEffect(()=>{console.log("userId: ".concat(D,", userRole: ").concat(q,", accessToken: ").concat(R)),(async()=>{try{if(!R)return;let e=await (0,g.userInfoCall)(R,D,q||"",!1,null,null,!0);G(e);let s=(await (0,g.modelAvailableCall)(R,D,q||"")).data.map(e=>e.id);et(s)}catch(e){console.error("Error fetching user data:",e),P.ZP.error("Failed to fetch user data")}finally{$(!1)}})()},[R,D,q]);let eh=async()=>{if(!R){P.ZP.error("Access token not found");return}try{P.ZP.success("Generating password reset link...");let e=await (0,g.invitationCreateCall)(R,D);ei(e),ea(!0)}catch(e){P.ZP.error("Failed to generate password reset link")}},ep=async()=>{try{if(!R)return;await (0,g.userDeleteCall)(R,[D]),P.ZP.success("User deleted successfully"),U&&U(),F()}catch(e){console.error("Error deleting user:",e),P.ZP.error("Failed to delete user")}},eg=async e=>{try{if(!R||!B)return;await (0,g.userUpdateUserCall)(R,e,null),G({...B,user_info:{...B.user_info,user_email:e.user_email,models:e.models,max_budget:e.max_budget,metadata:e.metadata}}),P.ZP.success("User updated successfully"),X(!1)}catch(e){console.error("Error updating user:",e),P.ZP.error("Failed to update user")}};if(Y)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(w.Z,{children:"Loading user data..."})]});if(!B)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(w.Z,{children:"User not found"})]});let ej=async(e,s)=>{await eF(e)&&(ex(e=>({...e,[s]:!0})),setTimeout(()=>{ex(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(k.Z,{children:(null===(s=B.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:B.user_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:em["user-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>ej(B.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(em["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),q&&eE.LQ.includes(q)&&(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"secondary",onClick:eh,className:"flex items-center",children:"Reset Password"}),(0,c.jsx)(_.Z,{icon:ee.Z,variant:"secondary",onClick:()=>J(!0),className:"flex items-center",children:"Delete User"})]})]}),H&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:ep,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>J(!1),children:"Cancel"})]})]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:ec,onIndexChange:ed,children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"}),(0,c.jsx)(eY.Z,{children:"Details"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Spend"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eD((null===(t=B.user_info)||void 0===t?void 0:t.spend)||0,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",(null===(l=B.user_info)||void 0===l?void 0:l.max_budget)!==null?"$".concat(eD(B.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Teams"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(w.Z,{children:[(null===(a=B.teams)||void 0===a?void 0:a.length)||0," teams"]})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"API Keys"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(w.Z,{children:[(null===(r=B.keys)||void 0===r?void 0:r.length)||0," keys"]})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Personal Models"}),(0,c.jsx)("div",{className:"mt-2",children:(null===(n=B.user_info)||void 0===n?void 0:null===(i=n.models)||void 0===i?void 0:i.length)&&(null===(m=B.user_info)||void 0===m?void 0:null===(o=m.models)||void 0===o?void 0:o.length)>0?null===(x=B.user_info)||void 0===x?void 0:null===(u=x.models)||void 0===u?void 0:u.map((e,s)=>(0,c.jsx)(w.Z,{children:e},s)):(0,c.jsx)(w.Z,{children:"All proxy models"})})]})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"User Settings"}),!Q&&q&&eE.LQ.includes(q)&&(0,c.jsx)(_.Z,{variant:"light",onClick:()=>X(!0),children:"Edit Settings"})]}),Q&&B?(0,c.jsx)(ll,{userData:B,onCancel:()=>X(!1),onSubmit:eg,teams:B.teams,accessToken:R,userID:D,userRole:q,userModels:es,possibleUIRoles:z}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"User ID"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"font-mono",children:B.user_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:em["user-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>ej(B.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(em["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Email"}),(0,c.jsx)(w.Z,{children:(null===(h=B.user_info)||void 0===h?void 0:h.user_email)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Role"}),(0,c.jsx)(w.Z,{children:(null===(p=B.user_info)||void 0===p?void 0:p.user_role)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:(null===(j=B.user_info)||void 0===j?void 0:j.created_at)?new Date(B.user_info.created_at).toLocaleString():"Unknown"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(w.Z,{children:(null===(f=B.user_info)||void 0===f?void 0:f.updated_at)?new Date(B.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Teams"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(y=B.teams)||void 0===y?void 0:y.length)&&(null===(b=B.teams)||void 0===b?void 0:b.length)>0?null===(N=B.teams)||void 0===N?void 0:N.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e.team_alias||e.team_id},s)):(0,c.jsx)(w.Z,{children:"No teams"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(S=B.user_info)||void 0===S?void 0:null===(Z=S.models)||void 0===Z?void 0:Z.length)&&(null===(I=B.user_info)||void 0===I?void 0:null===(C=I.models)||void 0===C?void 0:C.length)>0?null===(E=B.user_info)||void 0===E?void 0:null===(A=E.models)||void 0===A?void 0:A.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,c.jsx)(w.Z,{children:"All proxy models"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"API Keys"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(L=B.keys)||void 0===L?void 0:L.length)&&(null===(O=B.keys)||void 0===O?void 0:O.length)>0?B.keys.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,c.jsx)(w.Z,{children:"No API keys"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(M=B.user_info)||void 0===M?void 0:M.metadata)||{},null,2)})]})]})]})})]})]}),(0,c.jsx)(eu,{isInvitationLinkModalVisible:el,setIsInvitationLinkModalVisible:ea,baseUrl:en||"",invitationLinkData:er,modalType:"resetPassword"})]})}function lc(e){let{data:s=[],columns:t,isLoading:l=!1,onSortChange:a,currentSort:r,accessToken:i,userRole:n,possibleUIRoles:o,handleEdit:m,handleDelete:u,handleResetPassword:x,selectedUsers:h=[],onSelectionChange:p,enableSelection:g=!1}=e,[j,f]=d.useState([{id:(null==r?void 0:r.sortBy)||"created_at",desc:(null==r?void 0:r.sortOrder)==="desc"}]),[v,_]=d.useState(null),[y,b]=d.useState(!1),N=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_(e),b(s)},Z=(e,s)=>{p&&(s?p([...h,e]):p(h.filter(s=>s.user_id!==e.user_id)))},w=e=>{p&&(e?p(s):p([]))},k=e=>h.some(s=>s.user_id===e.user_id),S=s.length>0&&h.length===s.length,C=h.length>0&&h.length<s.length,I=d.useMemo(()=>o?ln(o,m,u,x,N,g?{selectedUsers:h,onSelectUser:Z,onSelectAll:w,isUserSelected:k,isAllSelected:S,isIndeterminate:C}:void 0):t,[o,m,u,x,N,t,g,h,S,C]),P=(0,sp.b7)({data:s,columns:I,state:{sorting:j},onSortingChange:e=>{if(f(e),e.length>0){let s=e[0],t=s.id,l=s.desc?"desc":"asc";null==a||a(t,l)}},getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0});return(d.useEffect(()=>{r&&f([{id:r.sortBy,desc:"desc"===r.sortOrder}])},[r]),v)?(0,c.jsx)(lo,{userId:v,onClose:()=>{_(null),b(!1)},accessToken:i,userRole:n,possibleUIRoles:o,initialTab:y?1:0,startInEditMode:y}):(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(t6.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(t6.ss,{children:P.getHeaderGroups().map(e=>(0,c.jsx)(t6.SC,{children:e.headers.map(e=>(0,c.jsx)(t6.xs,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(t6.RM,{children:l?(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:I.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?P.getRowModel().rows.map(e=>(0,c.jsx)(t6.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(t6.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&N(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:I.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No users found"})})})})})]})})})}var ld=t(67982),lm=t(87908),lu=e=>{var s;let{accessToken:t,possibleUIRoles:l,userID:a,userRole:r}=e,[i,n]=(0,d.useState)(!0),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)({}),[j,f]=(0,d.useState)(!1),[v,b]=(0,d.useState)([]),{Paragraph:N}=em.default,{Option:Z}=C.default;(0,d.useEffect)(()=>{(async()=>{if(!t){n(!1);return}try{let e=await (0,g.getInternalUserSettings)(t);if(m(e),p(e.values||{}),t)try{let e=await (0,g.modelAvailableCall)(t,a,r);if(e&&e.data){let s=e.data.map(e=>e.id);b(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),P.ZP.error("Failed to fetch SSO settings")}finally{n(!1)}})()},[t]);let S=async()=>{if(t){f(!0);try{let e=Object.entries(h).reduce((e,s)=>{let[t,l]=s;return e[t]=""===l?null:l,e},{}),s=await (0,g.updateInternalUserSettings)(t,e);m({...o,values:s.settings}),x(!1)}catch(e){console.error("Error updating SSO settings:",e),P.ZP.error("Failed to update settings: "+e)}finally{f(!1)}}},I=(e,s)=>{p(t=>({...t,[e]:s}))},A=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],E=e=>{let s=A(e),t=(e,t,l)=>{let a=[...s];a[e]={...a[e],[t]:l},I("teams",a)},l=e=>{I("teams",s.filter((s,t)=>t!==e))};return(0,c.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,c.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Team ",s+1]}),(0,c.jsx)(_.Z,{size:"sm",variant:"secondary",icon:ef.Z,onClick:()=>l(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,c.jsx)(y.Z,{value:e.team_id,onChange:e=>t(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,c.jsx)(q.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>t(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,c.jsxs)(C.default,{style:{width:"100%"},value:e.user_role,onChange:e=>t(s,"user_role",e),children:[(0,c.jsx)(Z,{value:"user",children:"User"}),(0,c.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,c.jsx)(_.Z,{variant:"secondary",icon:tc.Z,onClick:()=>{I("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},T=(e,s,t)=>{var a;let r=s.type;if("teams"===e)return(0,c.jsx)("div",{className:"mt-2",children:E(h[e]||[])});if("user_role"===e&&l)return(0,c.jsx)(C.default,{style:{width:"100%"},value:h[e]||"",onChange:s=>I(e,s),className:"mt-2",children:Object.entries(l).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(Z,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{children:t}),(0,c.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:l})]})},s)})});if("budget_duration"===e)return(0,c.jsx)(eO,{value:h[e]||null,onChange:s=>I(e,s),className:"mt-2"});if("boolean"===r)return(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(tn.Z,{checked:!!h[e],onChange:s=>I(e,s)})});if("array"===r&&(null===(a=s.items)||void 0===a?void 0:a.enum))return(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:h[e]||[],onChange:s=>I(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,c.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,c.jsxs)(C.default,{mode:"multiple",style:{width:"100%"},value:h[e]||[],onChange:s=>I(e,s),className:"mt-2",children:[(0,c.jsx)(Z,{value:"no-default-models",children:"No Default Models"}),v.map(e=>(0,c.jsx)(Z,{value:e,children:F(e)},e))]});if("string"===r&&s.enum)return(0,c.jsx)(C.default,{style:{width:"100%"},value:h[e]||"",onChange:s=>I(e,s),className:"mt-2",children:s.enum.map(e=>(0,c.jsx)(Z,{value:e,children:e},e))});else return(0,c.jsx)(y.Z,{value:void 0!==h[e]?String(h[e]):"",onChange:s=>I(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},L=(e,s)=>{if(null==s)return(0,c.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,c.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=A(s);return(0,c.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,c.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,c.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,c.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat(eD(e.max_budget_in_team,4)):"No limit"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,c.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&l&&l[s]){let{ui_label:e,description:t}=l[s];return(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium",children:e}),t&&(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:t})]})}return"budget_duration"===e?(0,c.jsx)("span",{children:eL(s)}):"boolean"==typeof s?(0,c.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:F(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,c.jsx)("span",{children:String(s)})};return i?(0,c.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,c.jsx)(lm.Z,{size:"large"})}):o?(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Default User Settings"}),!i&&o&&(u?(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{x(!1),p(o.values||{})},disabled:j,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:S,loading:j,children:"Save Changes"})]}):(0,c.jsx)(_.Z,{onClick:()=>x(!0),children:"Edit Settings"}))]}),(null==o?void 0:null===(s=o.field_schema)||void 0===s?void 0:s.description)&&(0,c.jsx)(N,{className:"mb-4",children:o.field_schema.description}),(0,c.jsx)(ld.Z,{}),(0,c.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=o;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,l]=s,a=e[t],r=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,c.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,c.jsx)(w.Z,{className:"font-medium text-lg",children:r}),(0,c.jsx)(N,{className:"text-sm text-gray-500 mt-1",children:l.description||"No description available"}),u?(0,c.jsx)("div",{className:"mt-2",children:T(t,l,a)}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:L(t,a)})]},t)}):(0,c.jsx)(w.Z,{children:"No schema information available"})})()})]}):(0,c.jsx)(W.Z,{children:(0,c.jsx)(w.Z,{children:"No settings available or you do not have permission to view them."})})},lx=t(19616);let lh={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var lp=e=>{var s;let{accessToken:t,token:l,userRole:a,userID:r,teams:i}=e,n=(0,h.NL)(),[o,m]=(0,d.useState)(1),[u,x]=(0,d.useState)(!1),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)(!1),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)("users"),[w,k]=(0,d.useState)(lh),[S,C,I]=(0,lx.G)(w,{wait:300}),[A,E]=(0,d.useState)(!1),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(null),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)([]),[U,z]=(0,d.useState)(!1),[V,K]=(0,d.useState)(!1),[B,G]=(0,d.useState)([]),H=e=>{b(e),v(!0)};(0,d.useEffect)(()=>()=>{I.cancel()},[I]),(0,d.useEffect)(()=>{F((0,g.getProxyBaseUrl)())},[]),(0,d.useEffect)(()=>{(async()=>{try{if(!r||!a||!t)return;let e=(await (0,g.modelAvailableCall)(t,r,a)).data.map(e=>e.id);console.log("available_model_names:",e),G(e)}catch(e){console.error("Error fetching user models:",e)}})()},[t,r,a]);let J=e=>{k(s=>{let t={...s,...e};return C(t),t})},Y=async e=>{if(!t){P.ZP.error("Access token not found");return}try{P.ZP.success("Generating password reset link...");let s=await (0,g.invitationCreateCall)(t,e);M(s),L(!0)}catch(e){P.ZP.error("Failed to generate password reset link")}},W=async()=>{if(y&&t)try{await (0,g.userDeleteCall)(t,[y]),n.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==y);return{...e,users:s}}),P.ZP.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),P.ZP.error("Failed to delete user")}v(!1),b(null)},$=async()=>{j(null),x(!1)},Q=async e=>{if(console.log("inside handleEditSubmit:",e),t&&l&&a&&r){try{let s=await (0,g.userUpdateUserCall)(t,e,null);n.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let t=e.users.map(e=>e.user_id===s.data.user_id?eM(e,s.data):e);return{...e,users:t}}),P.ZP.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}j(null),x(!1)}},X=async e=>{m(e)},ee=(0,sd.a)({queryKey:["userList",{debouncedFilter:S,currentPage:o}],queryFn:async()=>{if(!t)throw Error("Access token required");return await (0,g.userListCall)(t,S.user_id?[S.user_id]:null,o,25,S.email||null,S.user_role||null,S.team||null,S.sso_user_id||null,S.sort_by,S.sort_order)},enabled:!!(t&&l&&a&&r),placeholderData:e=>e}),es=ee.data,et=(0,sd.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!t)throw Error("Access token required");return await (0,g.getPossibleUserRoles)(t)},enabled:!!(t&&l&&a&&r)}).data;if(ee.isLoading||!t||!l||!a||!r)return(0,c.jsx)("div",{children:"Loading..."});let el=ln(et,e=>{j(e),x(!0)},H,Y,()=>{});return(0,c.jsxs)("div",{className:"w-full p-6",children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)(eI,{userID:r,accessToken:t,teams:i,possibleUIRoles:et}),(0,c.jsx)(_.Z,{onClick:()=>{K(!V),q([])},variant:V?"primary":"secondary",className:"flex items-center",children:V?"Cancel Selection":"Select Users"}),V&&(0,c.jsxs)(_.Z,{onClick:()=>{if(0===R.length){P.ZP.error("Please select users to edit");return}z(!0)},disabled:0===R.length,className:"flex items-center",children:["Bulk Edit (",R.length," selected)"]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:0,onIndexChange:e=>Z(0===e?"users":"settings"),children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Users"}),(0,c.jsx)(eY.Z,{children:"Default User Settings"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by email...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.email,onChange:e=>J({email:e.target.value})}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(A?"bg-gray-100":""),onClick:()=>E(!A),children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(w.user_id||w.user_role||w.team)&&(0,c.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{J(lh)},children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),A&&(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Filter by User ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.user_id,onChange:e=>J({user_id:e.target.value})}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eH.Z,{value:w.user_role,onValueChange:e=>J({user_role:e}),placeholder:"Select Role",children:Object.entries(et).map(e=>{let[s,t]=e;return(0,c.jsx)(ed.Z,{value:s,children:t.ui_label},s)})})}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eH.Z,{value:w.team,onValueChange:e=>J({team:e}),placeholder:"Select Team",children:null==i?void 0:i.map(e=>(0,c.jsx)(ed.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,c.jsx)("div",{className:"relative w-64",children:(0,c.jsx)("input",{type:"text",placeholder:"Filter by SSO ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.sso_user_id,onChange:e=>J({sso_user_id:e.target.value})})})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",es&&es.users&&es.users.length>0?(es.page-1)*es.page_size+1:0," ","-"," ",es&&es.users?Math.min(es.page*es.page_size,es.total):0," ","of ",es?es.total:0," results"]}),(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{onClick:()=>X(o-1),disabled:1===o,className:"px-3 py-1 text-sm border rounded-md ".concat(1===o?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,c.jsx)("button",{onClick:()=>X(o+1),disabled:!es||o>=es.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!es||o>=es.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,c.jsx)(lc,{data:(null===(s=ee.data)||void 0===s?void 0:s.users)||[],columns:el,isLoading:ee.isLoading,accessToken:t,userRole:a,onSortChange:(e,s)=>{J({sort_by:e,sort_order:s})},currentSort:{sortBy:w.sort_by,sortOrder:w.sort_order},possibleUIRoles:et,handleEdit:e=>{j(e),x(!0)},handleDelete:H,handleResetPassword:Y,enableSelection:V,selectedUsers:R,onSelectionChange:e=>{q(e)}})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lu,{accessToken:t,possibleUIRoles:et,userID:r,userRole:a})})]})]}),(0,c.jsx)(ls,{visible:u,possibleUIRoles:et,onCancel:$,user:p,onSubmit:Q}),f&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"}),(0,c.jsxs)("p",{className:"text-sm font-medium text-gray-900 mt-2",children:["User ID: ",y]})]})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:W,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{v(!1),b(null)},children:"Cancel"})]})]})]})}),(0,c.jsx)(eu,{isInvitationLinkModalVisible:T,setIsInvitationLinkModalVisible:L,baseUrl:D||"",invitationLinkData:O,modalType:"resetPassword"}),(0,c.jsx)(li,{visible:U,onCancel:()=>z(!1),selectedUsers:R,possibleUIRoles:et,accessToken:t,onSuccess:()=>{n.invalidateQueries({queryKey:["userList"]}),q([]),K(!1)},teams:i,userRole:a,userModels:B,allowAllUsers:!!a&&(0,eE.tY)(a)})]})},lg=e=>{var s;let{accessToken:t,userID:l,userRole:a}=e,[r,i]=(0,d.useState)(!0),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)({}),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)([]),{Paragraph:b}=em.default,{Option:N}=C.default;(0,d.useEffect)(()=>{(async()=>{if(!t){i(!1);return}try{let e=await (0,g.getDefaultTeamSettings)(t);if(o(e),h(e.values||{}),t)try{let e=await (0,g.modelAvailableCall)(t,l,a);if(e&&e.data){let s=e.data.map(e=>e.id);v(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),P.ZP.error("Failed to fetch team settings")}finally{i(!1)}})()},[t]);let Z=async()=>{if(t){j(!0);try{let e=await (0,g.updateDefaultTeamSettings)(t,x);o({...n,values:e.settings}),u(!1),P.ZP.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),P.ZP.error("Failed to update team settings")}finally{j(!1)}}},S=(e,s)=>{h(t=>({...t,[e]:s}))},I=(e,s,t)=>{var l;let a=s.type;return"budget_duration"===e?(0,c.jsx)(eO,{value:x[e]||null,onChange:s=>S(e,s),className:"mt-2"}):"boolean"===a?(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(tn.Z,{checked:!!x[e],onChange:s=>S(e,s)})}):"array"===a&&(null===(l=s.items)||void 0===l?void 0:l.enum)?(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:x[e]||[],onChange:s=>S(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,c.jsx)(N,{value:e,children:e},e))}):"models"===e?(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:x[e]||[],onChange:s=>S(e,s),className:"mt-2",children:f.map(e=>(0,c.jsx)(N,{value:e,children:F(e)},e))}):"string"===a&&s.enum?(0,c.jsx)(C.default,{style:{width:"100%"},value:x[e]||"",onChange:s=>S(e,s),className:"mt-2",children:s.enum.map(e=>(0,c.jsx)(N,{value:e,children:e},e))}):(0,c.jsx)(y.Z,{value:void 0!==x[e]?String(x[e]):"",onChange:s=>S(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},A=(e,s)=>null==s?(0,c.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,c.jsx)("span",{children:eL(s)}):"boolean"==typeof s?(0,c.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:F(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,c.jsx)("span",{children:String(s)});return r?(0,c.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,c.jsx)(lm.Z,{size:"large"})}):n?(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{className:"text-xl",children:"Default Team Settings"}),!r&&n&&(m?(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{u(!1),h(n.values||{})},disabled:p,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:Z,loading:p,children:"Save Changes"})]}):(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Settings"}))]}),(0,c.jsx)(w.Z,{children:"These settings will be applied by default when creating new teams."}),(null==n?void 0:null===(s=n.field_schema)||void 0===s?void 0:s.description)&&(0,c.jsx)(b,{className:"mb-4 mt-2",children:n.field_schema.description}),(0,c.jsx)(ld.Z,{}),(0,c.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=n;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,l]=s,a=e[t],r=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,c.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,c.jsx)(w.Z,{className:"font-medium text-lg",children:r}),(0,c.jsx)(b,{className:"text-sm text-gray-500 mt-1",children:l.description||"No description available"}),m?(0,c.jsx)("div",{className:"mt-2",children:I(t,l,a)}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:A(t,a)})]},t)}):(0,c.jsx)(w.Z,{children:"No schema information available"})})()})]}):(0,c.jsx)(W.Z,{children:(0,c.jsx)(w.Z,{children:"No team settings available or you do not have permission to view them."})})},lj=e=>{let{accessToken:s,userID:t}=e,[l,a]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(s&&t)try{let e=await (0,g.availableTeamListCall)(s);a(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,t]);let r=async e=>{if(s&&t)try{await (0,g.teamMemberAddCall)(s,e,{user_id:t,role:"user"}),P.ZP.success("Successfully joined team"),a(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),P.ZP.error("Failed to join team")}};return(0,c.jsx)(W.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Team Name"}),(0,c.jsx)(sb.Z,{children:"Description"}),(0,c.jsx)(sb.Z,{children:"Members"}),(0,c.jsx)(sb.Z,{children:"Models"}),(0,c.jsx)(sb.Z,{children:"Actions"})]})}),(0,c.jsxs)(sv.Z,{children:[l.map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:e.team_alias})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:e.description||"No description available"})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{children:[e.members_with_roles.length," members"]})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})})})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(_.Z,{size:"xs",variant:"secondary",onClick:()=>r(e.team_id),children:"Join Team"})})]},e.team_id)),0===l.length&&(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:5,className:"text-center",children:(0,c.jsx)(w.Z,{children:"No available teams to join"})})})]})]})})};let lf=(e,s)=>{let t=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),t=e.models):t=s,R(t,s)};var lv=e=>{let{teams:s,searchParams:t,accessToken:l,setTeams:a,userID:r,userRole:i,organizations:n,premiumUser:o=!1}=e,[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)(null),[p,k]=(0,d.useState)(null),[S,E]=(0,d.useState)(!1),[O,R]=(0,d.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"});(0,d.useEffect)(()=>{console.log("inside useeffect - ".concat(m)),l&&j(l,r,i,x,a),ez()},[m]);let[q]=I.Z.useForm(),[V]=I.Z.useForm(),{Title:K,Paragraph:B}=em.default,[G,J]=(0,d.useState)(""),[Y,$]=(0,d.useState)(!1),[Q,X]=(0,d.useState)(null),[es,et]=(0,d.useState)(null),[el,ea]=(0,d.useState)(!1),[er,ei]=(0,d.useState)(!1),[en,eo]=(0,d.useState)(!1),[eu,ex]=(0,d.useState)(!1),[eh,ep]=(0,d.useState)([]),[eg,ej]=(0,d.useState)(!1),[ef,ev]=(0,d.useState)(null),[e_,ey]=(0,d.useState)([]),[eb,eN]=(0,d.useState)({}),[eZ,ew]=(0,d.useState)([]),[ek,eS]=(0,d.useState)({}),[eC,eI]=(0,d.useState)([]),[eP,eA]=(0,d.useState)([]),[eT,eL]=(0,d.useState)(!1);(0,d.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(p));let e=lf(p,eh);console.log("models: ".concat(e)),ey(e),q.setFieldValue("models",[])},[p,eh]),(0,d.useEffect)(()=>{(async()=>{try{if(null==l)return;let e=(await (0,g.getGuardrailsList)(l)).guardrails.map(e=>e.guardrail_name);ew(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[l]);let eO=async()=>{try{if(null==l)return;let e=await (0,g.fetchMCPAccessGroups)(l);eA(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,d.useEffect)(()=>{eO()},[l]),(0,d.useEffect)(()=>{s&&eN(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let eF=async e=>{ev(e),ej(!0)},eq=async()=>{if(null!=ef&&null!=s&&null!=l){try{await (0,g.teamDeleteCall)(l,ef),j(l,r,i,x,a)}catch(e){console.error("Error deleting the team:",e)}ej(!1),ev(null)}};(0,d.useEffect)(()=>{(async()=>{try{if(null===r||null===i||null===l)return;let e=await D(r,i,l);e&&ep(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,r,i,s]);let eU=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=l){var t,r,i;let n=null==e?void 0:e.team_alias,o=null!==(i=null==s?void 0:s.map(e=>e.team_alias))&&void 0!==i?i:[],c=(null==e?void 0:e.organization_id)||(null==x?void 0:x.organization_id);if(""===c||"string"!=typeof c?e.organization_id=null:e.organization_id=c.trim(),o.includes(n))throw Error("Team alias ".concat(n," already exists, please pick another alias"));if(P.ZP.info("Creating Team"),eC.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:eC.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if((e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(r=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===r?void 0:r.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups)){let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups);let d=await (0,g.teamCreateCall)(l,e);null!==s?a([...s,d]):a([d]),console.log("response for team create call: ".concat(d)),P.ZP.success("Team created"),q.resetFields(),eI([]),ei(!1)}}catch(e){console.error("Error creating the team:",e),P.ZP.error("Error creating the team: "+e,20)}},ez=()=>{u(new Date().toLocaleString())},eV=(e,s)=>{let t={...O,[e]:s};R(t),l&&(0,g.v2TeamListCall)(l,t.organization_id||null,null,t.team_id||null,t.team_alias||null).then(e=>{e&&e.teams&&a(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})};return(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==i||"Org Admin"==i)&&(0,c.jsx)(_.Z,{className:"w-fit",onClick:()=>ei(!0),children:"+ Create New Team"}),es?(0,c.jsx)(tt,{teamId:es,onUpdate:e=>{a(s=>{if(null==s)return s;let t=s.map(s=>e.team_id===s.team_id?eM(s,e):s);return l&&j(l,r,i,x,a),t})},onClose:()=>{et(null),ea(!1)},accessToken:l,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;s<e.members_with_roles.length;s++){let t=e.members_with_roles[s];if(t.user_id==r&&"admin"==t.role)return!0}return!1})(null==s?void 0:s.find(e=>e.team_id===es)),is_proxy_admin:"Admin"==i,userModels:eh,editTeam:el}):(0,c.jsxs)(eW.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eY.Z,{children:"Your Teams"}),(0,c.jsx)(eY.Z,{children:"Available Teams"}),(0,eE.tY)(i||"")&&(0,c.jsx)(eY.Z,{children:"Default Team Settings"})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",m]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center",onClick:ez})]})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(w.Z,{children:["Click on “Team ID” to view team details"," ",(0,c.jsx)("b",{children:"and"})," manage team members."]}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:O.team_alias,onChange:e=>eV("team_alias",e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(S?"bg-gray-100":""),onClick:()=>E(!S),children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(O.team_id||O.team_alias||O.organization_id)&&(0,c.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{R({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),l&&(0,g.v2TeamListCall)(l,null,r||null,null,null).then(e=>{e&&e.teams&&a(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),S&&(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:O.team_id,onChange:e=>eV("team_id",e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eH.Z,{value:O.organization_id||"",onValueChange:e=>eV("organization_id",e),placeholder:"Select Organization",children:null==n?void 0:n.map(e=>(0,c.jsx)(ed.Z,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})}),(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Team Name"}),(0,c.jsx)(sb.Z,{children:"Team ID"}),(0,c.jsx)(sb.Z,{children:"Created"}),(0,c.jsx)(sb.Z,{children:"Spend (USD)"}),(0,c.jsx)(sb.Z,{children:"Budget (USD)"}),(0,c.jsx)(sb.Z,{children:"Models"}),(0,c.jsx)(sb.Z,{children:"Organization"}),(0,c.jsx)(sb.Z,{children:"Info"})]})}),(0,c.jsx)(sv.Z,{children:s&&s.length>0?s.filter(e=>!x||e.organization_id===x.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.team_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{et(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,c.jsx)(s_.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,c.jsx)(s_.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:eD(e.spend,4)}),(0,c.jsx)(s_.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,c.jsx)(s_.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,c.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,c.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sj.Z,{icon:ek[e.team_id]?sZ.Z:sw.Z,className:"cursor-pointer",size:"xs",onClick:()=>{eS(s=>({...s,[e.team_id]:!s[e.team_id]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),e.models.length>3&&!ek[e.team_id]&&(0,c.jsx)(eJ.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),ek[e.team_id]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}),(0,c.jsx)(s_.Z,{children:e.organization_id}),(0,c.jsxs)(s_.Z,{children:[(0,c.jsxs)(w.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].keys&&eb[e.team_id].keys.length," ","Keys"]}),(0,c.jsxs)(w.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].team_info&&eb[e.team_id].team_info.members_with_roles&&eb[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,c.jsx)(s_.Z,{children:"Admin"==i?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{et(e.team_id),ea(!0)}}),(0,c.jsx)(sj.Z,{onClick:()=>eF(e.team_id),icon:ee.Z,size:"sm"})]}):null})]},e.team_id)):null})]}),eg&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Team"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this team ?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:eq,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{ej(!1),ev(null)},children:"Cancel"})]})]})]})})]})})})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lj,{accessToken:l,userID:r})}),(0,eE.tY)(i||"")&&(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lg,{accessToken:l,userID:r||"",userRole:i||""})})]})]}),("Admin"==i||"Org Admin"==i)&&(0,c.jsx)(A.Z,{title:"Create Team",visible:er,width:1e3,footer:null,onOk:()=>{ei(!1),q.resetFields(),eI([])},onCancel:()=>{ei(!1),q.resetFields(),eI([])},children:(0,c.jsxs)(I.Z,{form:q,onFinish:eU,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Organization"," ",(0,c.jsx)(z.Z,{title:(0,c.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:x?x.organization_id:null,className:"mt-8",children:(0,c.jsx)(C.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{q.setFieldValue("organization_id",e),k((null==n?void 0:n.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var t;return!!s&&((null===(t=s.children)||void 0===t?void 0:t.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==n?void 0:n.map(e=>(0,c.jsxs)(C.default.Option,{value:e.organization_id,children:[(0,c.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,c.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"These are the models that your selected team has access to",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),e_.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",onClick:()=>{eT||(eO(),eL(!0))},children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Additional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,c.jsx)(y.Z,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Setup your first guardrail",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:eZ.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,c.jsx)(H,{onChange:e=>q.setFieldValue("allowed_vector_store_ids",e),value:q.getFieldValue("allowed_vector_store_ids"),accessToken:l||"",placeholder:"Select vector stores (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers or access groups this team can access by default. ",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-8",help:"Select MCP servers or access groups this team can access. ",children:(0,c.jsx)(eR,{onChange:e=>q.setFieldValue("allowed_mcp_servers_and_groups",e),value:q.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:l||"",placeholder:"Select MCP servers or access groups (optional)"})})]})]}),(0,c.jsxs)(b.Z,{className:"mt-8 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Logging Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(ec,{value:eC,onChange:eI,premiumUser:o})})})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create Team"})})]})})]})})})},l_=e=>{var s,t,l,a,r;let{organizationId:i,onClose:n,accessToken:o,is_org_admin:m,is_proxy_admin:u,userModels:x,editOrg:h}=e,[p,j]=(0,d.useState)(null),[f,b]=(0,d.useState)(!0),[N]=I.Z.useForm(),[Z,S]=(0,d.useState)(!1),[A,E]=(0,d.useState)(!1),[O,D]=(0,d.useState)(!1),[R,q]=(0,d.useState)(null),[U,z]=(0,d.useState)({}),V=m||u,K=async()=>{try{if(b(!0),!o)return;let e=await (0,g.organizationInfoCall)(o,i);j(e)}catch(e){P.ZP.error("Failed to load organization information"),console.error("Error fetching organization info:",e)}finally{b(!1)}};(0,d.useEffect)(()=>{K()},[i,o]);let B=async e=>{try{if(null==o)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.organizationMemberAddCall)(o,i,s),P.ZP.success("Organization member added successfully"),E(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to add organization member"),console.error("Error adding organization member:",e)}},G=async e=>{try{if(!o)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.organizationMemberUpdateCall)(o,i,s),P.ZP.success("Organization member updated successfully"),D(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to update organization member"),console.error("Error updating organization member:",e)}},J=async e=>{try{if(!o)return;await (0,g.organizationMemberDeleteCall)(o,i,e.user_id),P.ZP.success("Organization member deleted successfully"),D(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to delete organization member"),console.error("Error deleting organization member:",e)}},Y=async e=>{try{if(!o)return;let s={organization_id:i,organization_alias:e.organization_alias,models:e.models,litellm_budget_table:{tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration},metadata:e.metadata?JSON.parse(e.metadata):null};if((void 0!==e.vector_stores||void 0!==e.mcp_servers_and_groups)&&(s.object_permission={...null==p?void 0:p.object_permission,vector_stores:e.vector_stores||[]},void 0!==e.mcp_servers_and_groups)){let{servers:t,accessGroups:l}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};t&&t.length>0&&(s.object_permission.mcp_servers=t),l&&l.length>0&&(s.object_permission.mcp_access_groups=l)}await (0,g.organizationUpdateCall)(o,s),P.ZP.success("Organization settings updated successfully"),S(!1),K()}catch(e){P.ZP.error("Failed to update organization settings"),console.error("Error updating organization:",e)}};if(f)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!p)return(0,c.jsx)("div",{className:"p-4",children:"Organization not found"});let $=async(e,s)=>{await eF(e)&&(z(e=>({...e,[s]:!0})),setTimeout(()=>{z(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,onClick:n,variant:"light",className:"mb-4",children:"Back to Organizations"}),(0,c.jsx)(k.Z,{children:p.organization_alias}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:p.organization_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:U["org-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>$(p.organization_id,"org-id"),className:"left-2 z-10 transition-all duration-200 ".concat(U["org-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:h?2:0,children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"}),(0,c.jsx)(eY.Z,{children:"Members"}),(0,c.jsx)(eY.Z,{children:"Settings"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Organization Details"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["Created: ",new Date(p.created_at).toLocaleDateString()]}),(0,c.jsxs)(w.Z,{children:["Updated: ",new Date(p.updated_at).toLocaleDateString()]}),(0,c.jsxs)(w.Z,{children:["Created By: ",p.created_by]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Budget Status"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eD(p.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null===p.litellm_budget_table.max_budget?"Unlimited":"$".concat(eD(p.litellm_budget_table.max_budget,4))]}),p.litellm_budget_table.budget_duration&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Reset: ",p.litellm_budget_table.budget_duration]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",p.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",p.litellm_budget_table.rpm_limit||"Unlimited"]}),p.litellm_budget_table.max_parallel_requests&&(0,c.jsxs)(w.Z,{children:["Max Parallel Requests: ",p.litellm_budget_table.max_parallel_requests]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===p.models.length?(0,c.jsx)(eJ.Z,{color:"red",children:"All proxy models"}):p.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Teams"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:null===(s=p.teams)||void 0===s?void 0:s.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e.team_id},s))})]}),(0,c.jsx)(sl,{objectPermission:p.object_permission,variant:"card",accessToken:o})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(W.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[75vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"User ID"}),(0,c.jsx)(sb.Z,{children:"Role"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{children:"Created At"}),(0,c.jsx)(sb.Z,{})]})}),(0,c.jsx)(sv.Z,{children:null===(t=p.members)||void 0===t?void 0:t.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_id})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_role})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{children:["$",eD(e.spend,4)]})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:new Date(e.created_at).toLocaleString()})}),(0,c.jsx)(s_.Z,{children:V&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{q({role:e.user_role,user_email:e.user_email,user_id:e.user_id}),D(!0)}}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>{J(e)}})]})})]},s))})]})}),V&&(0,c.jsx)(_.Z,{onClick:()=>{E(!0)},children:"Add Member"})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Organization Settings"}),V&&!Z&&(0,c.jsx)(_.Z,{onClick:()=>S(!0),children:"Edit Settings"})]}),Z?(0,c.jsxs)(I.Z,{form:N,onFinish:Y,initialValues:{organization_alias:p.organization_alias,models:p.models,tpm_limit:p.litellm_budget_table.tpm_limit,rpm_limit:p.litellm_budget_table.rpm_limit,max_budget:p.litellm_budget_table.max_budget,budget_duration:p.litellm_budget_table.budget_duration,metadata:p.metadata?JSON.stringify(p.metadata,null,2):"",vector_stores:(null===(l=p.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=p.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(r=p.object_permission)||void 0===r?void 0:r.mcp_access_groups)||[]}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),x.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>N.setFieldValue("vector_stores",e),value:N.getFieldValue("vector_stores"),accessToken:o||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers & Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(eR,{onChange:e=>N.setFieldValue("mcp_servers_and_groups",e),value:N.getFieldValue("mcp_servers_and_groups"),accessToken:o||"",placeholder:"Select MCP servers and access groups"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{onClick:()=>S(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization Name"}),(0,c.jsx)("div",{children:p.organization_alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization ID"}),(0,c.jsx)("div",{className:"font-mono",children:p.organization_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:new Date(p.created_at).toLocaleString()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:p.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)("div",{children:["TPM: ",p.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",p.litellm_budget_table.rpm_limit||"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Budget"}),(0,c.jsxs)("div",{children:["Max:"," ",null!==p.litellm_budget_table.max_budget?"$".concat(eD(p.litellm_budget_table.max_budget,4)):"No Limit"]}),(0,c.jsxs)("div",{children:["Reset: ",p.litellm_budget_table.budget_duration||"Never"]})]}),(0,c.jsx)(sl,{objectPermission:p.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o})]})]})})]})]}),(0,c.jsx)(ts,{isVisible:A,onCancel:()=>E(!1),onSubmit:B,accessToken:o,title:"Add Organization Member",roles:[{label:"org_admin",value:"org_admin",description:"Can add and remove members, and change their roles."},{label:"internal_user",value:"internal_user",description:"Can view/create keys for themselves within organization."},{label:"internal_user_viewer",value:"internal_user_viewer",description:"Can only view their keys within organization."}],defaultRole:"internal_user"}),(0,c.jsx)(te,{visible:O,onCancel:()=>D(!1),onSubmit:G,initialData:R,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Org Admin",value:"org_admin"},{label:"Internal User",value:"internal_user"},{label:"Internal User Viewer",value:"internal_user_viewer"}]}})]})};let ly=async(e,s)=>{s(await (0,g.organizationListCall)(e))};var lb=e=>{let{organizations:s,userRole:t,userModels:l,accessToken:a,lastRefreshed:r,handleRefreshClick:i,currentOrg:n,guardrailsList:o=[],setOrganizations:m,premiumUser:u}=e,[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(!1),[b,N]=(0,d.useState)(!1),[Z,k]=(0,d.useState)(null),[S,E]=(0,d.useState)(!1),[T]=I.Z.useForm(),[O,D]=(0,d.useState)({});(0,d.useEffect)(()=>{a&&ly(a,m)},[a]);let R=e=>{e&&(k(e),N(!0))},q=async()=>{if(Z&&a)try{await (0,g.organizationDeleteCall)(a,Z),P.ZP.success("Organization deleted successfully"),N(!1),k(null),ly(a,m)}catch(e){console.error("Error deleting organization:",e)}},V=async e=>{try{var s,t,l,r;if(!a)return;console.log("values in organizations new create call: ".concat(JSON.stringify(e))),(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(s=e.allowed_mcp_servers_and_groups.servers)||void 0===s?void 0:s.length)>0||(null===(t=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===t?void 0:t.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(l=e.allowed_mcp_servers_and_groups.servers)||void 0===l?void 0:l.length)>0&&(e.object_permission.mcp_servers=e.allowed_mcp_servers_and_groups.servers),(null===(r=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===r?void 0:r.length)>0&&(e.object_permission.mcp_access_groups=e.allowed_mcp_servers_and_groups.accessGroups),delete e.allowed_mcp_servers_and_groups)),await (0,g.organizationCreateCall)(a,e),E(!1),T.resetFields(),ly(a,m)}catch(e){console.error("Error creating organization:",e)}};return u?(0,c.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"===t||"Org Admin"===t)&&(0,c.jsx)(_.Z,{className:"w-fit",onClick:()=>E(!0),children:"+ Create New Organization"}),x?(0,c.jsx)(l_,{organizationId:x,onClose:()=>{h(null),j(!1)},accessToken:a,is_org_admin:!0,is_proxy_admin:"Admin"===t,userModels:l,editOrg:p}):(0,c.jsxs)(eW.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsx)("div",{className:"flex",children:(0,c.jsx)(eY.Z,{children:"Your Organizations"})}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",r]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center",onClick:i})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(w.Z,{children:"Click on “Organization ID” to view organization details."}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(W.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Organization ID"}),(0,c.jsx)(sb.Z,{children:"Organization Name"}),(0,c.jsx)(sb.Z,{children:"Created"}),(0,c.jsx)(sb.Z,{children:"Spend (USD)"}),(0,c.jsx)(sb.Z,{children:"Budget (USD)"}),(0,c.jsx)(sb.Z,{children:"Models"}),(0,c.jsx)(sb.Z,{children:"TPM / RPM Limits"}),(0,c.jsx)(sb.Z,{children:"Info"}),(0,c.jsx)(sb.Z,{children:"Actions"})]})}),(0,c.jsx)(sv.Z,{children:s&&s.length>0?s.sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>{var s,l,a,r,i,n,o,d,m;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.organization_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>h(e.organization_id),children:[null===(s=e.organization_id)||void 0===s?void 0:s.slice(0,7),"..."]})})})}),(0,c.jsx)(s_.Z,{children:e.organization_alias}),(0,c.jsx)(s_.Z,{children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,c.jsx)(s_.Z,{children:eD(e.spend,4)}),(0,c.jsx)(s_.Z,{children:(null===(l=e.litellm_budget_table)||void 0===l?void 0:l.max_budget)!==null&&(null===(a=e.litellm_budget_table)||void 0===a?void 0:a.max_budget)!==void 0?null===(r=e.litellm_budget_table)||void 0===r?void 0:r.max_budget:"No limit"}),(0,c.jsx)(s_.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,c.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,c.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sj.Z,{icon:O[e.organization_id||""]?sZ.Z:sw.Z,className:"cursor-pointer",size:"xs",onClick:()=>{D(s=>({...s,[e.organization_id||""]:!s[e.organization_id||""]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),e.models.length>3&&!O[e.organization_id||""]&&(0,c.jsx)(eJ.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),O[e.organization_id||""]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{children:["TPM:"," ",(null===(i=e.litellm_budget_table)||void 0===i?void 0:i.tpm_limit)?null===(n=e.litellm_budget_table)||void 0===n?void 0:n.tpm_limit:"Unlimited",(0,c.jsx)("br",{}),"RPM:"," ",(null===(o=e.litellm_budget_table)||void 0===o?void 0:o.rpm_limit)?null===(d=e.litellm_budget_table)||void 0===d?void 0:d.rpm_limit:"Unlimited"]})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{children:[(null===(m=e.members)||void 0===m?void 0:m.length)||0," Members"]})}),(0,c.jsx)(s_.Z,{children:"Admin"===t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{h(e.organization_id),j(!0)}}),(0,c.jsx)(sj.Z,{onClick:()=>R(e.organization_id),icon:ee.Z,size:"sm"})]})})]},e.organization_id)}):null})]})})})})]})})]})]})}),(0,c.jsx)(A.Z,{title:"Create Organization",visible:S,width:800,footer:null,onCancel:()=>{E(!1),T.resetFields()},children:(0,c.jsxs)(I.Z,{form:T,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),l&&l.length>0&&l.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this organization can access by default. Leave empty for access to all vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this organization can access. Leave empty for access to all vector stores",children:(0,c.jsx)(H,{onChange:e=>T.setFieldValue("allowed_vector_store_ids",e),value:T.getFieldValue("allowed_vector_store_ids"),accessToken:a||"",placeholder:"Select vector stores (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers and access groups this organization can access by default.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers and access groups this organization can access.",children:(0,c.jsx)(eR,{onChange:e=>T.setFieldValue("allowed_mcp_servers_and_groups",e),value:T.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:a||"",placeholder:"Select MCP servers and access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(_.Z,{type:"submit",children:"Create Organization"})})]})}),b?(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Organization"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this organization?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:q,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{N(!1),k(null)},children:"Cancel"})]})]})]})}):(0,c.jsx)(c.Fragment,{})]}):(0,c.jsx)("div",{children:(0,c.jsxs)(w.Z,{children:["This is a LiteLLM Enterprise feature, and requires a valid key to use. Get a trial key"," ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})},lN=t(94789);let lZ={google:"https://artificialanalysis.ai/img/logos/google_small.svg",microsoft:"https://upload.wikimedia.org/wikipedia/commons/a/a8/Microsoft_Azure_Logo.svg",okta:"https://www.okta.com/sites/default/files/Okta_Logo_BrightBlue_Medium.png",generic:""},lw={google:{envVarMap:{google_client_id:"GOOGLE_CLIENT_ID",google_client_secret:"GOOGLE_CLIENT_SECRET"},fields:[{label:"GOOGLE CLIENT ID",name:"google_client_id"},{label:"GOOGLE CLIENT SECRET",name:"google_client_secret"}]},microsoft:{envVarMap:{microsoft_client_id:"MICROSOFT_CLIENT_ID",microsoft_client_secret:"MICROSOFT_CLIENT_SECRET",microsoft_tenant:"MICROSOFT_TENANT"},fields:[{label:"MICROSOFT CLIENT ID",name:"microsoft_client_id"},{label:"MICROSOFT CLIENT SECRET",name:"microsoft_client_secret"},{label:"MICROSOFT TENANT",name:"microsoft_tenant"}]},okta:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"GENERIC CLIENT ID",name:"generic_client_id"},{label:"GENERIC CLIENT SECRET",name:"generic_client_secret"},{label:"AUTHORIZATION ENDPOINT",name:"generic_authorization_endpoint",placeholder:"https://your-okta-domain/authorize"},{label:"TOKEN ENDPOINT",name:"generic_token_endpoint",placeholder:"https://your-okta-domain/token"},{label:"USERINFO ENDPOINT",name:"generic_userinfo_endpoint",placeholder:"https://your-okta-domain/userinfo"}]},generic:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"GENERIC CLIENT ID",name:"generic_client_id"},{label:"GENERIC CLIENT SECRET",name:"generic_client_secret"},{label:"AUTHORIZATION ENDPOINT",name:"generic_authorization_endpoint"},{label:"TOKEN ENDPOINT",name:"generic_token_endpoint"},{label:"USERINFO ENDPOINT",name:"generic_userinfo_endpoint"}]}};var lk=e=>{let{isAddSSOModalVisible:s,isInstructionsModalVisible:t,handleAddSSOOk:l,handleAddSSOCancel:a,handleShowInstructions:r,handleInstructionsOk:i,handleInstructionsCancel:n,form:o,accessToken:m,ssoConfigured:u=!1}=e,[x,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(s&&m)try{let s=await (0,g.getSSOSettings)(m);if(console.log("Raw SSO data received:",s),s&&s.values){console.log("SSO values:",s.values),console.log("user_email from API:",s.values.user_email);let l=null;if(s.values.google_client_id)l="google";else if(s.values.microsoft_client_id)l="microsoft";else if(s.values.generic_client_id){var e,t;l=(null===(e=s.values.generic_authorization_endpoint)||void 0===e?void 0:e.includes("okta"))||(null===(t=s.values.generic_authorization_endpoint)||void 0===t?void 0:t.includes("auth0"))?"okta":"generic"}let a={sso_provider:l,proxy_base_url:s.values.proxy_base_url,user_email:s.values.user_email,...s.values};console.log("Setting form values:",a),o.resetFields(),setTimeout(()=>{o.setFieldsValue(a),console.log("Form values set, current form values:",o.getFieldsValue())},100)}}catch(e){console.error("Failed to load SSO settings:",e)}})()},[s,m,o]);let p=async e=>{if(!m){P.ZP.error("No access token available");return}try{await (0,g.updateSSOSettings)(m,e),r(e)}catch(e){console.error("Failed to save SSO settings:",e),P.ZP.error("Failed to save SSO settings")}},j=async()=>{if(!m){P.ZP.error("No access token available");return}try{await (0,g.updateSSOSettings)(m,{google_client_id:"",google_client_secret:"",microsoft_client_id:"",microsoft_client_secret:"",microsoft_tenant:"",generic_client_id:"",generic_client_secret:"",generic_authorization_endpoint:"",generic_token_endpoint:"",generic_userinfo_endpoint:"",proxy_base_url:"",user_email:"",sso_provider:""}),o.resetFields(),h(!1),l(),P.ZP.success("SSO settings cleared successfully")}catch(e){console.error("Failed to clear SSO settings:",e),P.ZP.error("Failed to clear SSO settings")}},f=e=>{let s=lw[e];return s?s.fields.map(e=>(0,c.jsx)(I.Z.Item,{label:e.label,name:e.name,rules:[{required:!0,message:"Please enter the ".concat(e.label.toLowerCase())}],children:e.name.includes("client")?(0,c.jsx)(L.default.Password,{}):(0,c.jsx)(y.Z,{placeholder:e.placeholder})},e.name)):null};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(A.Z,{title:u?"Edit SSO Settings":"Add SSO",visible:s,width:800,footer:null,onOk:l,onCancel:a,children:(0,c.jsxs)(I.Z,{form:o,onFinish:p,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"SSO Provider",name:"sso_provider",rules:[{required:!0,message:"Please select an SSO provider"}],children:(0,c.jsx)(C.default,{children:Object.entries(lZ).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0"},children:[t&&(0,c.jsx)("img",{src:t,alt:s,style:{height:24,width:24,marginRight:12,objectFit:"contain"}}),(0,c.jsxs)("span",{children:[s.charAt(0).toUpperCase()+s.slice(1)," SSO"]})]})},s)})})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.sso_provider!==s.sso_provider,children:e=>{let{getFieldValue:s}=e,t=s("sso_provider");return t?f(t):null}}),(0,c.jsx)(I.Z.Item,{label:"Proxy Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"PROXY BASE URL",name:"proxy_base_url",rules:[{required:!0,message:"Please enter the proxy base url"}],children:(0,c.jsx)(y.Z,{})})]}),(0,c.jsxs)("div",{style:{textAlign:"right",marginTop:"10px",display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px"},children:[u&&(0,c.jsx)(T.ZP,{onClick:()=>h(!0),style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#5558eb",e.currentTarget.style.borderColor="#5558eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1",e.currentTarget.style.borderColor="#6366f1"},children:"Clear"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})]})]})}),(0,c.jsxs)(A.Z,{title:"Confirm Clear SSO Settings",visible:x,onOk:j,onCancel:()=>h(!1),okText:"Yes, Clear",cancelText:"Cancel",okButtonProps:{danger:!0,style:{backgroundColor:"#dc2626",borderColor:"#dc2626"}},children:[(0,c.jsx)("p",{children:"Are you sure you want to clear all SSO settings? This action cannot be undone."}),(0,c.jsx)("p",{children:"Users will no longer be able to login using SSO after this change."})]}),(0,c.jsxs)(A.Z,{title:"SSO Setup Instructions",visible:t,width:800,footer:null,onOk:i,onCancel:n,children:[(0,c.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{onClick:i,children:"Done"})})]})]})},lS=t(62272),lC=t(92403),lI=t(29271),lP=t(34419);let lA=e=>{if(!e)return"An unknown error occurred";if("string"==typeof e)return e;if(e.message)try{let s=JSON.parse(e.message);if(s.error&&s.error.message)return s.error.message;return"string"==typeof s?s:JSON.stringify(s,null,2)}catch(s){return e.message}if(e.response&&e.response.data){if("string"==typeof e.response.data)return e.response.data;if(e.response.data.message)return e.response.data.message;if(e.response.data.error)return"string"==typeof e.response.data.error?e.response.data.error:e.response.data.error.message||JSON.stringify(e.response.data.error)}return String(e)};var lE=e=>{let{accessToken:s,userID:t,proxySettings:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)("<your_proxy_base_url>");(0,d.useEffect)(()=>{let e="<your_proxy_base_url>";u(l&&l.PROXY_BASE_URL&&void 0!==l.PROXY_BASE_URL?l.PROXY_BASE_URL:window.location.origin)},[l]);let x="".concat(m,"/scim/v2"),h=async e=>{if(!s||!t){P.ZP.error("You need to be logged in to create a SCIM token");return}try{i(!0);let l={key_alias:e.key_alias||"SCIM Access Token",team_id:null,models:[],allowed_routes:["/scim/*"]},a=await (0,g.keyCreateCall)(s,t,l);o(a),P.ZP.success("SCIM token created successfully")}catch(e){console.error("Error creating SCIM token:",e),P.ZP.error("Failed to create SCIM token: "+lA(e))}finally{i(!1)}};return(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)("div",{className:"flex items-center mb-4",children:(0,c.jsx)(k.Z,{children:"SCIM Configuration"})}),(0,c.jsx)(w.Z,{className:"text-gray-600",children:"System for Cross-domain Identity Management (SCIM) allows you to automatically provision and manage users and groups in LiteLLM."}),(0,c.jsx)(ld.Z,{}),(0,c.jsxs)("div",{className:"space-y-8",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"1"}),(0,c.jsxs)(k.Z,{className:"text-lg flex items-center",children:[(0,c.jsx)(lS.Z,{className:"h-5 w-5 mr-2"}),"SCIM Tenant URL"]})]}),(0,c.jsx)(w.Z,{className:"text-gray-600 mb-3",children:"Use this URL in your identity provider SCIM integration settings."}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(y.Z,{value:x,disabled:!0,className:"flex-grow"}),(0,c.jsx)(S.CopyToClipboard,{text:x,onCopy:()=>P.ZP.success("URL copied to clipboard"),children:(0,c.jsxs)(_.Z,{variant:"primary",className:"ml-2 flex items-center",children:[(0,c.jsx)(tC.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"2"}),(0,c.jsxs)(k.Z,{className:"text-lg flex items-center",children:[(0,c.jsx)(lC.Z,{className:"h-5 w-5 mr-2"}),"Authentication Token"]})]}),(0,c.jsx)(lN.Z,{title:"Using SCIM",color:"blue",className:"mb-4",children:"You need a SCIM token to authenticate with the SCIM API. Create one below and use it in your SCIM provider configuration."}),n?(0,c.jsxs)(W.Z,{className:"border border-yellow-300 bg-yellow-50",children:[(0,c.jsxs)("div",{className:"flex items-center mb-2 text-yellow-800",children:[(0,c.jsx)(lI.Z,{className:"h-5 w-5 mr-2"}),(0,c.jsx)(k.Z,{className:"text-lg text-yellow-800",children:"Your SCIM Token"})]}),(0,c.jsx)(w.Z,{className:"text-yellow-800 mb-4 font-medium",children:"Make sure to copy this token now. You will not be able to see it again."}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(y.Z,{value:n.key,className:"flex-grow mr-2 bg-white",type:"password",disabled:!0}),(0,c.jsx)(S.CopyToClipboard,{text:n.key,onCopy:()=>P.ZP.success("Token copied to clipboard"),children:(0,c.jsxs)(_.Z,{variant:"primary",className:"flex items-center",children:[(0,c.jsx)(tC.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,c.jsxs)(_.Z,{className:"mt-4 flex items-center",variant:"secondary",onClick:()=>o(null),children:[(0,c.jsx)(lP.Z,{className:"h-4 w-4 mr-1"}),"Create Another Token"]})]}):(0,c.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,c.jsxs)(I.Z,{form:a,onFinish:h,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Token Name",rules:[{required:!0,message:"Please enter a name for your token"}],children:(0,c.jsx)(y.Z,{placeholder:"SCIM Access Token"})}),(0,c.jsx)(I.Z.Item,{children:(0,c.jsxs)(_.Z,{variant:"primary",type:"submit",loading:r,className:"flex items-center",children:[(0,c.jsx)(lC.Z,{className:"h-4 w-4 mr-1"}),"Create SCIM Token"]})})]})})]})]})]})})},lT=e=>{let{accessToken:s,onSuccess:t}=e,[l]=I.Z.useForm(),[a,r]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(s)try{let e=await (0,g.getSSOSettings)(s);if(e&&e.values){let s=e.values.ui_access_mode,t={};s&&"object"==typeof s?t={ui_access_mode_type:s.type,restricted_sso_group:s.restricted_sso_group,sso_group_jwt_field:s.sso_group_jwt_field}:"string"==typeof s&&(t={ui_access_mode_type:s,restricted_sso_group:e.values.restricted_sso_group,sso_group_jwt_field:e.values.team_ids_jwt_field||e.values.sso_group_jwt_field}),l.setFieldsValue(t)}}catch(e){console.error("Failed to load UI access settings:",e)}})()},[s,l]);let i=async e=>{if(!s){P.ZP.error("No access token available");return}r(!0);try{let l={ui_access_mode:{type:e.ui_access_mode_type,restricted_sso_group:e.restricted_sso_group,sso_group_jwt_field:e.sso_group_jwt_field}};await (0,g.updateSSOSettings)(s,l),t()}catch(e){console.error("Failed to save UI access settings:",e),P.ZP.error("Failed to save UI access settings")}finally{r(!1)}};return(0,c.jsxs)("div",{style:{padding:"16px"},children:[(0,c.jsx)("div",{style:{marginBottom:"16px"},children:(0,c.jsx)(w.Z,{style:{fontSize:"14px",color:"#6b7280"},children:"Configure who can access the UI interface and how group information is extracted from JWT tokens."})}),(0,c.jsxs)(I.Z,{form:l,onFinish:i,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"UI Access Mode",name:"ui_access_mode_type",tooltip:"Controls who can access the UI interface",children:(0,c.jsxs)(C.default,{placeholder:"Select access mode",children:[(0,c.jsx)(C.default.Option,{value:"all_authenticated_users",children:"All Authenticated Users"}),(0,c.jsx)(C.default.Option,{value:"restricted_sso_group",children:"Restricted SSO Group"})]})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.ui_access_mode_type!==s.ui_access_mode_type,children:e=>{let{getFieldValue:s}=e;return"restricted_sso_group"===s("ui_access_mode_type")?(0,c.jsx)(I.Z.Item,{label:"Restricted SSO Group",name:"restricted_sso_group",rules:[{required:!0,message:"Please enter the restricted SSO group"}],children:(0,c.jsx)(y.Z,{placeholder:"ui-access-group"})}):null}}),(0,c.jsx)(I.Z.Item,{label:"SSO Group JWT Field",name:"sso_group_jwt_field",tooltip:"JWT field name that contains team/group information. Use dot notation to access nested fields.",children:(0,c.jsx)(y.Z,{placeholder:"groups"})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"16px"},children:(0,c.jsx)(T.ZP,{type:"primary",htmlType:"submit",loading:a,style:{backgroundColor:"#6366f1",borderColor:"#6366f1"},children:"Update UI Access Control"})})]})]})},lL=t(382),lO=e=>{let{searchParams:s,accessToken:t,userID:l,showSSOBanner:a,premiumUser:r,proxySettings:i,userRole:n}=e,[o]=I.Z.useForm(),[u]=I.Z.useForm(),{Title:x,Paragraph:h}=em.default,[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(!1),[w,k]=(0,d.useState)(!1),[S,C]=(0,d.useState)(!1),[E,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(!1),[F,R]=(0,d.useState)(!1),[q,U]=(0,d.useState)(!1),[z,V]=(0,d.useState)(!1),[K,B]=(0,d.useState)(!1),[G,H]=(0,d.useState)(!1),[J,Y]=(0,d.useState)([]),[$,Q]=(0,d.useState)(null),[X,ee]=(0,d.useState)(!1);(0,m.useRouter)();let[es,et]=(0,d.useState)(null);console.log=function(){};let el=sh(),ea="All IP Addresses Allowed",er=el;er+="/fallback/login";let ei=async()=>{if(t&&r)try{let e=await (0,g.getSSOSettings)(t);if(console.log("SSO data:",e),e&&e.values){let s=e.values.google_client_id&&e.values.google_client_secret,t=e.values.microsoft_client_id&&e.values.microsoft_client_secret,l=e.values.generic_client_id&&e.values.generic_client_secret;ee(s||t||l)}else ee(!1)}catch(e){console.error("Error checking SSO configuration:",e),ee(!1)}},en=async()=>{try{if(!0!==r){P.ZP.error("This feature is only available for premium users. Please upgrade your account.");return}if(t){let e=await (0,g.getAllowedIPs)(t);Y(e&&e.length>0?e:[ea])}else Y([ea])}catch(e){console.error("Error fetching allowed IPs:",e),P.ZP.error("Failed to fetch allowed IPs ".concat(e)),Y([ea])}finally{!0===r&&U(!0)}},eo=async e=>{try{if(t){await (0,g.addAllowedIP)(t,e.ip);let s=await (0,g.getAllowedIPs)(t);Y(s),P.ZP.success("IP address added successfully")}}catch(e){console.error("Error adding IP:",e),P.ZP.error("Failed to add IP address ".concat(e))}finally{V(!1)}},ec=async e=>{Q(e),B(!0)},ed=async()=>{if($&&t)try{await (0,g.deleteAllowedIP)(t,$);let e=await (0,g.getAllowedIPs)(t);Y(e.length>0?e:[ea]),P.ZP.success("IP address deleted successfully")}catch(e){console.error("Error deleting IP:",e),P.ZP.error("Failed to delete IP address ".concat(e))}finally{B(!1),Q(null)}};(0,d.useEffect)(()=>{(async()=>{if(null!=t){let e=[],s=await (0,g.userGetAllUsersCall)(t,"proxy_admin_viewer");console.log("proxy admin viewer response: ",s);let l=s.users;console.log("proxy viewers response: ".concat(l)),l.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy viewers: ".concat(l));let a=(await (0,g.userGetAllUsersCall)(t,"proxy_admin")).users;a.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy admins: ".concat(a)),console.log("combinedList: ".concat(e)),v(e),et(await (0,g.getPossibleUserRoles)(t))}})()},[t]),(0,d.useEffect)(()=>{ei()},[t,r]);let eu=()=>{H(!1)};return console.log("admins: ".concat(null==f?void 0:f.length)),(0,c.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,c.jsx)(x,{level:4,children:"Admin Access "}),(0,c.jsx)(h,{children:"Go to 'Internal Users' page to add other admins."}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsx)(eY.Z,{children:"Security Settings"}),(0,c.jsx)(eY.Z,{children:"SCIM"}),(0,c.jsx)(eY.Z,{children:"Useful Links"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(x,{level:4,children:" ✨ Security Settings"}),(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",marginTop:"1rem",marginLeft:"0.5rem"},children:[(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:()=>!0===r?D(!0):P.ZP.error("Only premium users can add SSO"),children:X?"Edit SSO Settings":"Add SSO"})}),(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:en,children:"Allowed IPs"})}),(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:()=>!0===r?H(!0):P.ZP.error("Only premium users can configure UI access control"),children:"UI Access Control"})})]})]}),(0,c.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,c.jsx)(lk,{isAddSSOModalVisible:M,isInstructionsModalVisible:F,handleAddSSOOk:()=>{D(!1),o.resetFields(),t&&r&&ei()},handleAddSSOCancel:()=>{D(!1),o.resetFields()},handleShowInstructions:e=>{D(!1),R(!0)},handleInstructionsOk:()=>{R(!1),t&&r&&ei()},handleInstructionsCancel:()=>{R(!1),t&&r&&ei()},form:o,accessToken:t,ssoConfigured:X}),(0,c.jsx)(A.Z,{title:"Manage Allowed IP Addresses",width:800,visible:q,onCancel:()=>U(!1),footer:[(0,c.jsx)(_.Z,{className:"mx-1",onClick:()=>V(!0),children:"Add IP Address"},"add"),(0,c.jsx)(_.Z,{onClick:()=>U(!1),children:"Close"},"close")],children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"IP Address"}),(0,c.jsx)(sb.Z,{className:"text-right",children:"Action"})]})}),(0,c.jsx)(sv.Z,{children:J.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e}),(0,c.jsx)(s_.Z,{className:"text-right",children:e!==ea&&(0,c.jsx)(_.Z,{onClick:()=>ec(e),color:"red",size:"xs",children:"Delete"})})]},s))})]})}),(0,c.jsx)(A.Z,{title:"Add Allowed IP Address",visible:z,onCancel:()=>V(!1),footer:null,children:(0,c.jsxs)(I.Z,{onFinish:eo,children:[(0,c.jsx)(I.Z.Item,{name:"ip",rules:[{required:!0,message:"Please enter an IP address"}],children:(0,c.jsx)(L.default,{placeholder:"Enter IP address"})}),(0,c.jsx)(I.Z.Item,{children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add IP Address"})})]})}),(0,c.jsx)(A.Z,{title:"Confirm Delete",visible:K,onCancel:()=>B(!1),onOk:ed,footer:[(0,c.jsx)(_.Z,{className:"mx-1",onClick:()=>ed(),children:"Yes"},"delete"),(0,c.jsx)(_.Z,{onClick:()=>B(!1),children:"Close"},"close")],children:(0,c.jsxs)("p",{children:["Are you sure you want to delete the IP address: ",$,"?"]})}),(0,c.jsx)(A.Z,{title:"UI Access Control Settings",visible:G,width:600,footer:null,onOk:eu,onCancel:()=>{H(!1)},children:(0,c.jsx)(lT,{accessToken:t,onSuccess:()=>{eu(),P.ZP.success("UI Access Control settings updated successfully")}})})]}),(0,c.jsxs)(lN.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access"," ",(0,c.jsxs)("a",{href:er,target:"_blank",children:[(0,c.jsx)("b",{children:er})," "]})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lE,{accessToken:t,userID:l,proxySettings:i})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lL.Z,{accessToken:t,userRole:n||null})})]})]})]})};let{Title:lM}=em.default;var lD=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)([]);(0,d.useEffect)(()=>{i()},[s]);let i=async()=>{if(s){l(!0);try{let e=await (0,g.getEmailEventSettings)(s);r(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),P.ZP.error("Failed to fetch email event settings")}finally{l(!1)}}},n=(e,s)=>{r(a.map(t=>t.event===e?{...t,enabled:s}:t))},o=async()=>{if(s)try{await (0,g.updateEmailEventSettings)(s,{settings:a}),P.ZP.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),P.ZP.error("Failed to update email event settings")}},m=async()=>{if(s)try{await (0,g.resetEmailEventSettings)(s),P.ZP.success("Email event settings reset to defaults"),i()}catch(e){console.error("Failed to reset email event settings:",e),P.ZP.error("Failed to reset email event settings")}},u=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let s=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(s)}};return(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(lM,{level:4,children:"Email Notifications"}),(0,c.jsx)(w.Z,{children:"Select which events should trigger email notifications."}),(0,c.jsx)(Y.Z,{}),t?(0,c.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,c.jsx)(lm.Z,{size:"large"})}):(0,c.jsx)("div",{className:"space-y-4",children:a.map(e=>(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(s2.Z,{checked:e.enabled,onChange:s=>n(e.event,s.target.checked)}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)(w.Z,{children:e.event}),(0,c.jsx)("div",{className:"text-sm text-gray-500 block",children:u(e.event)})]})]},e.event))}),(0,c.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,c.jsx)(_.Z,{onClick:o,disabled:t,children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:m,variant:"secondary",disabled:t,children:"Reset to Defaults"})]})]})};let{Title:lF}=em.default;var lR=e=>{let{accessToken:s,premiumUser:t,alerts:l}=e,a=()=>{if(!s)return;let e={};l.filter(e=>"email"===e.name).forEach(s=>{var t;Object.entries(null!==(t=s.variables)&&void 0!==t?t:{}).forEach(s=>{let[t,l]=s,a=document.querySelector('input[name="'.concat(t,'"]'));a&&a.value&&(e[t]=null==a?void 0:a.value)})}),console.log("updatedVariables",e);try{(0,g.setCallbacksCall)(s,{general_settings:{alerting:["email"]},environment_variables:e})}catch(e){P.ZP.error("Failed to update alerts: "+e,20)}P.ZP.success("Email settings updated successfully")};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 mb-6",children:(0,c.jsx)(lD,{accessToken:s})}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(lF,{level:4,children:"Email Server Settings"}),(0,c.jsxs)(w.Z,{children:[(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:" LiteLLM Docs: email alerts"})," ",(0,c.jsx)("br",{})]}),(0,c.jsx)("div",{className:"flex w-full",children:l.filter(e=>"email"===e.name).map((e,s)=>{var l;return(0,c.jsx)(s_.Z,{children:(0,c.jsx)("ul",{children:(0,c.jsx)(v.Z,{numItems:2,children:Object.entries(null!==(l=e.variables)&&void 0!==l?l:{}).map(e=>{let[s,l]=e;return(0,c.jsxs)("li",{className:"mx-2 my-2",children:[!0!=t&&("EMAIL_LOGO_URL"===s||"EMAIL_SUPPORT_CONTACT"===s)?(0,c.jsxs)("div",{children:[(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,c.jsxs)(w.Z,{className:"mt-2",children:[" ","✨ ",s]})}),(0,c.jsx)(y.Z,{name:s,defaultValue:l,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-2",children:s}),(0,c.jsx)(y.Z,{name:s,defaultValue:l,type:"password",style:{width:"400px"}})]}),(0,c.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===s&&(0,c.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `[email protected]`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `[email protected]`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===s&&(0,c.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===s&&(0,c.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is [email protected]"})]})]},s)})})})},s)})}),(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>a(),children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:()=>s&&(0,g.serviceHealthCheck)(s,"email"),className:"mx-2",children:"Test Email Alerts"})]})]})},lq=e=>{let{alertingSettings:s,handleInputChange:t,handleResetField:l,handleSubmit:a,premiumUser:r}=e,[i]=I.Z.useForm();return(0,c.jsxs)(I.Z,{form:i,onFinish:()=>{console.log("INSIDE ONFINISH");let e=i.getFieldsValue(),s=Object.entries(e).every(e=>{let[s,t]=e;return"boolean"!=typeof t&&(""===t||null==t)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(s)),s?console.log("Some form fields are empty."):a(e)},labelAlign:"left",children:[s.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsxs)(s_.Z,{align:"center",children:[(0,c.jsx)(w.Z,{children:e.field_name}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?r?(0,c.jsx)(I.Z.Item,{name:e.field_name,children:(0,c.jsx)(s_.Z,{children:"Integer"===e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>t(e.field_name,s)}):"Boolean"===e.field_type?(0,c.jsx)(tE.Z,{checked:e.field_value,onChange:s=>t(e.field_name,s)}):(0,c.jsx)(L.default,{value:e.field_value,onChange:s=>t(e.field_name,s)})})}):(0,c.jsx)(s_.Z,{children:(0,c.jsx)(_.Z,{className:"flex items-center justify-center",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,c.jsx)(I.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,c.jsx)(s_.Z,{children:"Integer"===e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>t(e.field_name,s),className:"p-0"}):"Boolean"===e.field_type?(0,c.jsx)(tE.Z,{checked:e.field_value,onChange:s=>{t(e.field_name,s),i.setFieldsValue({[e.field_name]:s})}}):(0,c.jsx)(L.default,{value:e.field_value,onChange:s=>t(e.field_name,s)})})}),(0,c.jsx)(s_.Z,{children:!0==e.stored_in_db?(0,c.jsx)(eJ.Z,{icon:eZ.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,c.jsx)(eJ.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,c.jsx)(eJ.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(sj.Z,{icon:ee.Z,color:"red",onClick:()=>l(e.field_name,s),children:"Reset"})})]},s)),(0,c.jsx)("div",{children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Update Settings"})})]})},lU=e=>{let{accessToken:s,premiumUser:t}=e,[l,a]=(0,d.useState)([]);return(0,d.useEffect)(()=>{s&&(0,g.alertingSettingsCall)(s).then(e=>{a(e)})},[s]),(0,c.jsx)(lq,{alertingSettings:l,handleInputChange:(e,s)=>{let t=l.map(t=>t.field_name===e?{...t,field_value:s}:t);console.log("updatedSettings: ".concat(JSON.stringify(t))),a(t)},handleResetField:(e,t)=>{if(s)try{let s=l.map(s=>s.field_name===e?{...s,stored_in_db:null,field_value:s.field_default_value}:s);a(s)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!s||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let t={};l.forEach(e=>{t[e.field_name]=e.field_value});let a={...e,...t};console.log("mergedFormValues: ".concat(JSON.stringify(a)));let{slack_alerting:r,...i}=a;console.log("slack_alerting: ".concat(r,", alertingArgs: ").concat(JSON.stringify(i)));try{(0,g.updateConfigFieldSetting)(s,"alerting_args",i),"boolean"==typeof r&&(!0==r?(0,g.updateConfigFieldSetting)(s,"alerting",["slack"]):(0,g.updateConfigFieldSetting)(s,"alerting",[])),P.ZP.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:t})},lz=t(38994);let{Title:lV,Paragraph:lK}=em.default;var lB=e=>{let{accessToken:s,userRole:t,userID:l,premiumUser:a}=e,[r,n]=(0,d.useState)([]),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(!1),[h]=I.Z.useForm(),[p,j]=(0,d.useState)(null),[f,b]=(0,d.useState)(""),[N,Z]=(0,d.useState)({}),[k,S]=(0,d.useState)([]),[E,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)([]),[D,F]=(0,d.useState)([]),[R,q]=(0,d.useState)(!1),[U,z]=(0,d.useState)(null),[V,K]=(0,d.useState)(!1),[B,G]=(0,d.useState)(null),H=e=>{k.includes(e)?S(k.filter(s=>s!==e)):S([...k,e])},J={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,d.useEffect)(()=>{s&&t&&l&&(0,g.getCallbacksCall)(s,l,t).then(e=>{n(e.callbacks),M(e.available_callbacks);let s=e.alerts;if(s&&s.length>0){let e=s[0],t=e.variables.SLACK_WEBHOOK_URL;S(e.active_alerts),b(t),Z(e.alerts_to_webhook)}m(s)})},[s,t,l]);let Y=e=>k&&k.includes(e),$=async e=>{if(!s)return;let t={};Object.entries(e).forEach(e=>{let[s,l]=e;"callback"!==s&&(t[s]=l)});try{await (0,g.setCallbacksCall)(s,{environment_variables:t}),P.ZP.success("Callback added successfully"),x(!1),h.resetFields(),j(null)}catch(e){P.ZP.error("Failed to add callback: "+e,20)}},Q=async e=>{if(!s)return;let t=null==e?void 0:e.callback,l={};Object.entries(e).forEach(e=>{let[s,t]=e;"callback"!==s&&(l[s]=t)});try{await (0,g.setCallbacksCall)(s,{environment_variables:l,litellm_settings:{success_callback:[t]}}),P.ZP.success("Callback ".concat(t," added successfully")),x(!1),h.resetFields(),j(null)}catch(e){P.ZP.error("Failed to add callback: "+e,20)}},X=e=>{j(e.litellm_callback_name),e&&e.litellm_callback_params?F(e.litellm_callback_params):F([])},et=e=>{G(e),K(!0)},el=async()=>{if(B&&s)try{if(await (0,g.deleteCallback)(s,B),P.ZP.success("Callback ".concat(B," deleted successfully")),l&&t){let e=await (0,g.getCallbacksCall)(s,l,t);n(e.callbacks)}K(!1),G(null)}catch(e){console.error("Failed to delete callback:",e),P.ZP.error("Failed to delete callback: ".concat(e))}};return s?(0,c.jsxs)("div",{className:"w-full mx-4",children:[(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eY.Z,{value:"1",children:"Logging Callbacks"}),(0,c.jsx)(eY.Z,{value:"2",children:"Alerting Types"}),(0,c.jsx)(eY.Z,{value:"3",children:"Alerting Settings"}),(0,c.jsx)(eY.Z,{value:"4",children:"Email Alerts"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(lV,{level:4,children:"Active Logging Callbacks"}),(0,c.jsx)(v.Z,{numItems:2,children:(0,c.jsx)(W.Z,{className:"max-h-[50vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(sN.Z,{children:(0,c.jsx)(sb.Z,{children:"Callback Name"})})}),(0,c.jsx)(sv.Z,{children:r.map((e,t)=>(0,c.jsxs)(sN.Z,{className:"flex justify-between",children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:e.name})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"flex justify-between",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{z(e),q(!0)}}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>et(e.name),className:"text-red-500 hover:text-red-700 cursor-pointer"}),(0,c.jsx)(_.Z,{onClick:()=>(0,g.serviceHealthCheck)(s,e.name),className:"ml-2",variant:"secondary",children:"Test Callback"})]})})]},t))})]})})}),(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>L(!0),children:"Add Callback"})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(w.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,c.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{}),(0,c.jsx)(sb.Z,{}),(0,c.jsx)(sb.Z,{children:"Slack Webhook URL"})]})}),(0,c.jsx)(sv.Z,{children:Object.entries(J).map((e,s)=>{let[t,l]=e;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:"region_outage_alerts"==t?a?(0,c.jsx)(tE.Z,{id:"switch",name:"switch",checked:Y(t),onChange:()=>H(t)}):(0,c.jsx)(_.Z,{className:"flex items-center justify-center",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,c.jsx)(tE.Z,{id:"switch",name:"switch",checked:Y(t),onChange:()=>H(t)})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:l})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(y.Z,{name:t,type:"password",defaultValue:N&&N[t]?N[t]:f})})]},s)})})]}),(0,c.jsx)(_.Z,{size:"xs",className:"mt-2",onClick:()=>{if(!s)return;let e={};Object.entries(J).forEach(s=>{let[t,l]=s,a=document.querySelector('input[name="'.concat(t,'"]')),r=(null==a?void 0:a.value)||"";e[t]=r});try{(0,g.setCallbacksCall)(s,{general_settings:{alert_to_webhook_url:e,alert_types:k}})}catch(e){P.ZP.error("Failed to update alerts: "+e,20)}P.ZP.success("Alerts updated successfully")},children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:()=>(0,g.serviceHealthCheck)(s,"slack"),className:"mx-2",children:"Test Alerts"})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lU,{accessToken:s,premiumUser:a})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lR,{accessToken:s,premiumUser:a,alerts:o})})]})]})}),(0,c.jsxs)(A.Z,{title:"Add Logging Callback",visible:E,width:800,onCancel:()=>L(!1),footer:null,children:[(0,c.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,c.jsx)(I.Z,{form:h,onFinish:Q,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(lz.Z,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,c.jsx)(C.default,{onChange:e=>{let s=O[e];s&&X(s)},children:Object.entries(i).map(e=>{var s;let[t,l]=e;return(0,c.jsx)(ed.Z,{value:es[t],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(null===(s=ei[l])||void 0===s?void 0:s.logo)?(0,c.jsx)("div",{className:"w-5 h-5 flex items-center justify-center",children:(0,c.jsx)("img",{src:ei[l].logo,alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{e.currentTarget.style.display="none"}})}):(0,c.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:l.charAt(0).toUpperCase()}),(0,c.jsx)("span",{children:l})]})},l)})})}),D&&D.map(e=>(0,c.jsx)(lz.Z,{label:e,name:e,rules:[{required:!0,message:"Please enter the value for "+e}],children:(0,c.jsx)(y.Z,{type:"password"})},e)),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})]}),(0,c.jsx)(A.Z,{visible:R,width:800,title:"Edit ".concat(null==U?void 0:U.name," Settings"),onCancel:()=>q(!1),footer:null,children:(0,c.jsxs)(I.Z,{form:h,onFinish:$,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(c.Fragment,{children:U&&U.variables&&Object.entries(U.variables).map(e=>{let[s,t]=e;return(0,c.jsx)(lz.Z,{label:s,name:s,children:(0,c.jsx)(y.Z,{type:"password",defaultValue:t})},s)})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,c.jsx)(A.Z,{title:"Confirm Delete",visible:V,onOk:el,onCancel:()=>{K(!1),G(null)},okText:"Delete",cancelText:"Cancel",okButtonProps:{danger:!0},children:(0,c.jsxs)("p",{children:["Are you sure you want to delete the callback - ",B,"? This action cannot be undone."]})})]}):null},lG=t(92414),lH=t(46030);let{Option:lJ}=C.default;var lY=e=>{let{models:s,accessToken:t,routerSettings:l,setRouterSettings:a}=e,[r]=I.Z.useForm(),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)("");return(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{className:"mx-auto",onClick:()=>n(!0),children:"+ Add Fallbacks"}),(0,c.jsx)(A.Z,{title:"Add Fallbacks",visible:i,width:800,footer:null,onOk:()=>{n(!1),r.resetFields()},onCancel:()=>{n(!1),r.resetFields()},children:(0,c.jsxs)(I.Z,{form:r,onFinish:e=>{console.log(e);let{model_name:s,models:i}=e,o=[...l.fallbacks||[],{[s]:i}],c={...l,fallbacks:o};console.log(c);try{(0,g.setCallbacksCall)(t,{router_settings:c}),a(c)}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}P.ZP.success("router settings updated successfully"),n(!1),r.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Public Model Name",name:"model_name",rules:[{required:!0,message:"Set the model to fallback for"}],help:"required",children:(0,c.jsx)(eH.Z,{defaultValue:o,children:s&&s.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,onClick:()=>m(e),children:e},s))})}),(0,c.jsx)(I.Z.Item,{label:"Fallback Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,c.jsx)(lG.Z,{value:s,children:s&&s.filter(e=>e!=o).map(e=>(0,c.jsx)(lH.Z,{value:e,children:e},e))})})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add Fallbacks"})})]})})]})},lW=t(26433);async function l$(e,s){console.log=function(){},console.log("isLocal:",!1);let t=window.location.origin,l=new lW.ZP.OpenAI({apiKey:s,baseURL:t,dangerouslyAllowBrowser:!0});try{let s=await l.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});P.ZP.success((0,c.jsxs)("span",{children:["Test model=",(0,c.jsx)("strong",{children:e}),", received model=",(0,c.jsx)("strong",{children:s.model}),". See"," ",(0,c.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}let lQ={ttl:3600,lowest_latency_buffer:0},lX=e=>{let{selectedStrategy:s,strategyArgs:t,paramExplanation:l}=e;return(0,c.jsxs)(b.Z,{children:[(0,c.jsx)(Z.Z,{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Routing Strategy Specific Args"}),(0,c.jsx)(N.Z,{children:"latency-based-routing"==s?(0,c.jsx)(W.Z,{children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Setting"}),(0,c.jsx)(sb.Z,{children:"Value"})]})}),(0,c.jsx)(sv.Z,{children:Object.entries(t).map(e=>{let[s,t]=e;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(w.Z,{children:s}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:l[s]})]}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(y.Z,{name:s,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t.toString()})})]},s)})})]})}):(0,c.jsx)(w.Z,{children:"No specific settings"})})]})};var l0=e=>{let{accessToken:s,userRole:t,userID:l,modelData:a}=e,[r,i]=(0,d.useState)({}),[n,o]=(0,d.useState)({}),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p]=I.Z.useForm(),[j,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),A={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,d.useEffect)(()=>{s&&t&&l&&((0,g.getCallbacksCall)(s,l,t).then(e=>{console.log("callbacks",e);let s=e.router_settings;"model_group_retry_policy"in s&&delete s.model_group_retry_policy,i(s)}),(0,g.getGeneralSettingsCall)(s).then(e=>{u(e)}))},[s,t,l]);let E=async e=>{if(!s)return;console.log("received key: ".concat(e)),console.log("routerSettings['fallbacks']: ".concat(r.fallbacks));let t=r.fallbacks.map(s=>(e in s&&delete s[e],s)).filter(e=>Object.keys(e).length>0),l={...r,fallbacks:t};try{await (0,g.setCallbacksCall)(s,{router_settings:l}),i(l),P.ZP.success("Router settings updated successfully")}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}},T=(e,s)=>{u(m.map(t=>t.field_name===e?{...t,field_value:s}:t))},L=(e,t)=>{if(!s)return;let l=m[t].field_value;if(null!=l&&void 0!=l)try{(0,g.updateConfigFieldSetting)(s,e,l);let t=m.map(s=>s.field_name===e?{...s,stored_in_db:!0}:s);u(t)}catch(e){}},O=(e,t)=>{if(s)try{(0,g.deleteConfigFieldSetting)(s,e);let t=m.map(s=>s.field_name===e?{...s,stored_in_db:null,field_value:null}:s);u(t)}catch(e){}},M=e=>{if(!s)return;console.log("router_settings",e);let t=Object.fromEntries(Object.entries(e).map(e=>{let[s,t]=e;if("routing_strategy_args"!==s&&"routing_strategy"!==s){var l;return[s,(null===(l=document.querySelector('input[name="'.concat(s,'"]')))||void 0===l?void 0:l.value)||t]}if("routing_strategy"==s)return[s,N];if("routing_strategy_args"==s&&"latency-based-routing"==N){let e={},s=document.querySelector('input[name="lowest_latency_buffer"]'),t=document.querySelector('input[name="ttl"]');return(null==s?void 0:s.value)&&(e.lowest_latency_buffer=Number(s.value)),(null==t?void 0:t.value)&&(e.ttl=Number(t.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",t);try{(0,g.setCallbacksCall)(s,{router_settings:t})}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}P.ZP.success("router settings updated successfully")};return s?(0,c.jsx)("div",{className:"w-full mx-4",children:(0,c.jsxs)(eW.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)(e$.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eY.Z,{value:"1",children:"Loadbalancing"}),(0,c.jsx)(eY.Z,{value:"2",children:"Fallbacks"}),(0,c.jsx)(eY.Z,{value:"3",children:"General"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,c.jsx)(k.Z,{children:"Router Settings"}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Setting"}),(0,c.jsx)(sb.Z,{children:"Value"})]})}),(0,c.jsx)(sv.Z,{children:Object.entries(r).filter(e=>{let[s,t]=e;return"fallbacks"!=s&&"context_window_fallbacks"!=s&&"routing_strategy_args"!=s}).map(e=>{let[s,t]=e;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(w.Z,{children:s}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:A[s]})]}),(0,c.jsx)(s_.Z,{children:"routing_strategy"==s?(0,c.jsxs)(eH.Z,{defaultValue:t,className:"w-full max-w-md",onValueChange:Z,children:[(0,c.jsx)(ed.Z,{value:"usage-based-routing",children:"usage-based-routing"}),(0,c.jsx)(ed.Z,{value:"latency-based-routing",children:"latency-based-routing"}),(0,c.jsx)(ed.Z,{value:"simple-shuffle",children:"simple-shuffle"})]}):(0,c.jsx)(y.Z,{name:s,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t.toString()})})]},s)})})]}),(0,c.jsx)(lX,{selectedStrategy:N,strategyArgs:r&&r.routing_strategy_args&&Object.keys(r.routing_strategy_args).length>0?r.routing_strategy_args:lQ,paramExplanation:A})]}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>M(r),children:"Save Changes"})})]})}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Model Name"}),(0,c.jsx)(sb.Z,{children:"Fallbacks"})]})}),(0,c.jsx)(sv.Z,{children:r.fallbacks&&r.fallbacks.map((e,t)=>Object.entries(e).map(e=>{let[l,a]=e;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:l}),(0,c.jsx)(s_.Z,{children:Array.isArray(a)?a.join(", "):a}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(_.Z,{onClick:()=>l$(l,s),children:"Test Fallback"})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>E(l)})})]},t.toString()+l)}))})]}),(0,c.jsx)(lY,{models:(null==a?void 0:a.data)?a.data.map(e=>e.model_name):[],accessToken:s,routerSettings:r,setRouterSettings:i})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(W.Z,{children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Setting"}),(0,c.jsx)(sb.Z,{children:"Value"}),(0,c.jsx)(sb.Z,{children:"Status"}),(0,c.jsx)(sb.Z,{children:"Action"})]})}),(0,c.jsx)(sv.Z,{children:m.filter(e=>"TypedDictionary"!==e.field_type).map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(w.Z,{children:e.field_name}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,c.jsx)(s_.Z,{children:"Integer"==e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>T(e.field_name,s)}):null}),(0,c.jsx)(s_.Z,{children:!0==e.stored_in_db?(0,c.jsx)(eJ.Z,{icon:eZ.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,c.jsx)(eJ.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,c.jsx)(eJ.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(_.Z,{onClick:()=>L(e.field_name,s),children:"Update"}),(0,c.jsx)(sj.Z,{icon:ee.Z,color:"red",onClick:()=>O(e.field_name,s),children:"Reset"})]})]},s))})]})})})]})]})}):null},l1=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:l,setBudgetList:a}=e,[r]=I.Z.useForm(),i=async e=>{if(null!=t&&void 0!=t)try{P.ZP.info("Making API Call");let s=await (0,g.budgetCreateCall)(t,e);console.log("key create Response:",s),a(e=>e?[...e,s]:[s]),P.ZP.success("Budget Created"),r.resetFields()}catch(e){console.error("Error creating the key:",e),P.ZP.error("Error creating the key: ".concat(e),20)}};return(0,c.jsx)(A.Z,{title:"Create Budget",visible:s,width:800,footer:null,onOk:()=>{l(!1),r.resetFields()},onCancel:()=>{l(!1),r.resetFields()},children:(0,c.jsxs)(I.Z,{form:r,onFinish:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},l2=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:l,setBudgetList:a,existingBudget:r,handleUpdateCall:i}=e;console.log("existingBudget",r);let[n]=I.Z.useForm();(0,d.useEffect)(()=>{n.setFieldsValue(r)},[r,n]);let o=async e=>{if(null!=t&&void 0!=t)try{P.ZP.info("Making API Call"),l(!0);let s=await (0,g.budgetUpdateCall)(t,e);a(e=>e?[...e,s]:[s]),P.ZP.success("Budget Updated"),n.resetFields(),i()}catch(e){console.error("Error creating the key:",e),P.ZP.error("Error creating the key: ".concat(e),20)}};return(0,c.jsx)(A.Z,{title:"Edit Budget",visible:s,width:800,footer:null,onOk:()=>{l(!1),n.resetFields()},onCancel:()=>{l(!1),n.resetFields()},children:(0,c.jsxs)(I.Z,{form:n,onFinish:o,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:r,children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})},l4=t(17906),l5=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)(!1),[a,r]=(0,d.useState)(!1),[i,n]=(0,d.useState)(null),[o,m]=(0,d.useState)([]);(0,d.useEffect)(()=>{s&&(0,g.getBudgetList)(s).then(e=>{m(e)})},[s]);let u=async(e,t)=>{console.log("budget_id",e),null!=s&&(n(o.find(s=>s.budget_id===e)||null),r(!0))},x=async(e,t)=>{if(null==s)return;P.ZP.info("Request made"),await (0,g.budgetDeleteCall)(s,e);let l=[...o];l.splice(t,1),m(l),P.ZP.success("Budget Deleted.")},h=async()=>{null!=s&&(0,g.getBudgetList)(s).then(e=>{m(e)})};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)(_.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>l(!0),children:"+ Create Budget"}),(0,c.jsx)(l1,{accessToken:s,isModalVisible:t,setIsModalVisible:l,setBudgetList:m}),i&&(0,c.jsx)(l2,{accessToken:s,isModalVisible:a,setIsModalVisible:r,setBudgetList:m,existingBudget:i,handleUpdateCall:h}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Create a budget to assign to customers."}),(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Budget ID"}),(0,c.jsx)(sb.Z,{children:"Max Budget"}),(0,c.jsx)(sb.Z,{children:"TPM"}),(0,c.jsx)(sb.Z,{children:"RPM"})]})}),(0,c.jsx)(sv.Z,{children:o.slice().sort((e,s)=>new Date(s.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.budget_id}),(0,c.jsx)(s_.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,c.jsx)(s_.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,c.jsx)(s_.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>u(e.budget_id,s)}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>x(e.budget_id,s)})]},s))})]})]}),(0,c.jsxs)("div",{className:"mt-5",children:[(0,c.jsx)(w.Z,{className:"text-base",children:"How to use budget id"}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsx)(eY.Z,{children:"Assign Budget to Customer"}),(0,c.jsx)(eY.Z,{children:"Test it (Curl)"}),(0,c.jsx)(eY.Z,{children:"Test it (OpenAI SDK)"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.Z,{language:"bash",children:"\ncurl -X POST --location '<your_proxy_base_url>/end_user/new' \n-H 'Authorization: Bearer <your-master-key>' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"<BUDGET_ID>\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.Z,{language:"bash",children:'\ncurl -X POST --location \'<your_proxy_base_url>/chat/completions\' \n-H \'Authorization: Bearer <your-master-key>\' \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,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="<your_proxy_base_url>",\n api_key="<your_proxy_key>"\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})},l6=t(77398),l3=t.n(l6);let l8=e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}},l7=e=>{let{utcTime:s}=e;return(0,c.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:l8(s)})},l9=(e,s)=>{var t,l;return(null===(l=e.metadata)||void 0===l?void 0:null===(t=l.mcp_tool_call_metadata)||void 0===t?void 0:t.mcp_server_logo_url)?e.metadata.mcp_tool_call_metadata.mcp_server_logo_url:s?(0,sL.dr)(s).logo:""},ae=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,c.jsx)(()=>{let[e,t]=d.useState(s.getIsExpanded()),l=d.useCallback(()=>{t(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,c.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,c.jsx)("svg",{className:"w-4 h-4 transform transition-transform duration-75 ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,c.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Time",accessorKey:"startTime",cell:e=>(0,c.jsx)(l7,{utcTime:e.getValue()})},{header:"Status",accessorKey:"metadata.status",cell:e=>{let s="failure"!==(e.getValue()||"Success").toLowerCase();return(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat(s?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let s=String(e.getValue()||""),t=e.row.original.onSessionClick;return(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>null==t?void 0:t(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:"Cost",accessorKey:"spend",cell:e=>(0,c.jsxs)("span",{children:["$",eD(e.getValue()||0,6)]})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let s=String(e.getValue()||"-"),t=e.row.original.onKeyHashClick;return(0,c.jsx)(z.Z,{title:s,children:(0,c.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>null==t?void 0:t(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Model",accessorKey:"model",cell:e=>{let s=e.row.original,t=s.custom_llm_provider,l=String(e.getValue()||"");return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:l9(s,t),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)(z.Z,{title:l,children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:l})})]})}},{header:"Tokens",accessorKey:"total_tokens",cell:e=>{let s=e.row.original;return(0,c.jsxs)("span",{className:"text-sm",children:[String(s.total_tokens||"0"),(0,c.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(s.prompt_tokens||"0"),"+",String(s.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let s=e.getValue();if(!s||0===Object.keys(s).length)return"-";let t=Object.entries(s),l=t[0],a=t.slice(1);return(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,c.jsx)(z.Z,{title:(0,c.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{children:[s,": ",String(t)]},s)})}),children:(0,c.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[l[0],": ",String(l[1]),a.length>0&&" +".concat(a.length)]})})})}}],as=e=>(0,c.jsx)(eJ.Z,{color:"gray",className:"flex items-center gap-1",children:(0,c.jsx)("span",{className:"whitespace-nowrap text-xs",children:e})}),at=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,c.jsx)(()=>{let[e,t]=d.useState(s.getIsExpanded()),l=d.useCallback(()=>{t(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,c.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,c.jsx)("svg",{className:"w-4 h-4 transform transition-transform ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,c.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Timestamp",accessorKey:"updated_at",cell:e=>(0,c.jsx)(l7,{utcTime:e.getValue()})},{header:"Table Name",accessorKey:"table_name",cell:e=>{let s=e.getValue(),t=s;switch(s){case"LiteLLM_VerificationToken":t="Keys";break;case"LiteLLM_TeamTable":t="Teams";break;case"LiteLLM_OrganizationTable":t="Organizations";break;case"LiteLLM_UserTable":t="Users";break;case"LiteLLM_ProxyModelTable":t="Models";break;default:t=s}return(0,c.jsx)("span",{children:t})}},{header:"Action",accessorKey:"action",cell:e=>(0,c.jsx)("span",{children:as(e.getValue())})},{header:"Changed By",accessorKey:"changed_by",cell:e=>{let s=e.row.original.changed_by,t=e.row.original.changed_by_api_key;return(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsx)("div",{className:"font-medium",children:s}),t&&(0,c.jsx)(z.Z,{title:t,children:(0,c.jsxs)("div",{className:"text-xs text-muted-foreground max-w-[15ch] truncate",children:[" ",t]})})]})}},{header:"Affected Item ID",accessorKey:"object_id",cell:e=>(0,c.jsx)(()=>{let s=e.getValue(),[t,l]=(0,d.useState)(!1);if(!s)return(0,c.jsx)(c.Fragment,{children:"-"});let a=async()=>{try{await navigator.clipboard.writeText(String(s)),l(!0),setTimeout(()=>l(!1),1500)}catch(e){console.error("Failed to copy object ID: ",e)}};return(0,c.jsx)(z.Z,{title:t?"Copied!":String(s),children:(0,c.jsx)("span",{className:"max-w-[20ch] truncate block cursor-pointer hover:text-blue-600",onClick:a,children:String(s)})})},{})}],al=async(e,s,t,l)=>{console.log("prefetchLogDetails called with",e.length,"logs");let a=e.map(e=>{if(e.request_id)return console.log("Prefetching details for request_id:",e.request_id),l.prefetchQuery({queryKey:["logDetails",e.request_id,s],queryFn:async()=>{console.log("Fetching details for",e.request_id);let l=await (0,g.uiSpendLogDetailsCall)(t,e.request_id,s);return console.log("Received details for",e.request_id,":",l?"success":"failed"),l},staleTime:6e5,gcTime:6e5})});try{let e=await Promise.all(a);return console.log("All prefetch promises completed:",e.length),e}catch(e){throw console.error("Error in prefetchLogDetails:",e),e}};function aa(e){let{row:s,hasMessages:t,hasResponse:l,hasError:a,errorInfo:r,getRawRequest:i,formattedResponse:n}=e,o=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let t=document.execCommand("copy");if(document.body.removeChild(s),!t)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},d=async()=>{await o(JSON.stringify(i(),null,2))?P.ZP.success("Request copied to clipboard"):P.ZP.error("Failed to copy request")},m=async()=>{await o(JSON.stringify(n(),null,2))?P.ZP.success("Response copied to clipboard"):P.ZP.error("Failed to copy response")};return(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request"}),(0,c.jsx)("button",{onClick:d,className:"p-1 hover:bg-gray-200 rounded",title:"Copy request",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-96",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(i(),null,2)})})]}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsxs)("h3",{className:"text-lg font-medium",children:["Response",a&&(0,c.jsxs)("span",{className:"ml-2 text-sm text-red-600",children:["• HTTP code ",(null==r?void 0:r.error_code)||400]})]}),(0,c.jsx)("button",{onClick:m,className:"p-1 hover:bg-gray-200 rounded",title:"Copy response",disabled:!l,children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-96 bg-gray-50",children:l?(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(n(),null,2)}):(0,c.jsx)("div",{className:"text-gray-500 text-sm italic text-center py-4",children:"Response data not available"})})]})]})}let ar=e=>{var s;let{errorInfo:t}=e,[l,a]=d.useState({}),[r,i]=d.useState(!1),n=e=>{a(s=>({...s,[e]:!s[e]}))},o=t.traceback&&(s=t.traceback)?Array.from(s.matchAll(/File "([^"]+)", line (\d+)/g)).map(e=>{let t=e[1],l=e[2],a=t.split("/").pop()||t,r=e.index||0,i=s.indexOf('File "',r+1),n=i>-1?s.substring(r,i).trim():s.substring(r).trim(),o=n.split("\n"),c="";return o.length>1&&(c=o[o.length-1].trim()),{filePath:t,fileName:a,lineNumber:l,code:c,inFunction:n.includes(" in ")?n.split(" in ")[1].split("\n")[0]:""}}):[];return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"p-4 border-b",children:(0,c.jsxs)("h3",{className:"text-lg font-medium flex items-center text-red-600",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Error Details"]})}),(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"bg-red-50 rounded-md p-4 mb-4",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"text-red-800 font-medium w-20",children:"Type:"}),(0,c.jsx)("span",{className:"text-red-700",children:t.error_class||"Unknown Error"})]}),(0,c.jsxs)("div",{className:"flex mt-2",children:[(0,c.jsx)("span",{className:"text-red-800 font-medium w-20 flex-shrink-0",children:"Message:"}),(0,c.jsx)("span",{className:"text-red-700 break-words whitespace-pre-wrap",children:t.error_message||"Unknown error occurred"})]})]}),t.traceback&&(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,c.jsx)("h4",{className:"font-medium",children:"Traceback"}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsx)("button",{onClick:()=>{let e=!r;if(i(e),o.length>0){let s={};o.forEach((t,l)=>{s[l]=e}),a(s)}},className:"text-gray-500 hover:text-gray-700 flex items-center text-sm",children:r?"Collapse All":"Expand All"}),(0,c.jsxs)("button",{onClick:()=>navigator.clipboard.writeText(t.traceback||""),className:"text-gray-500 hover:text-gray-700 flex items-center",title:"Copy traceback",children:[(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,c.jsx)("span",{className:"ml-1",children:"Copy"})]})]})]}),(0,c.jsx)("div",{className:"bg-white rounded-md border border-gray-200 overflow-hidden shadow-sm",children:o.map((e,s)=>(0,c.jsxs)("div",{className:"border-b border-gray-200 last:border-b-0",children:[(0,c.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between cursor-pointer hover:bg-gray-50",onClick:()=>n(s),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{className:"text-gray-400 mr-2 w-12 text-right",children:e.lineNumber}),(0,c.jsx)("span",{className:"text-gray-600 font-medium",children:e.fileName}),(0,c.jsx)("span",{className:"text-gray-500 mx-1",children:"in"}),(0,c.jsx)("span",{className:"text-indigo-600 font-medium",children:e.inFunction||e.fileName})]}),(0,c.jsx)("svg",{className:"w-5 h-5 text-gray-500 transition-transform ".concat(l[s]?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(l[s]||!1)&&e.code&&(0,c.jsx)("div",{className:"px-12 py-2 font-mono text-sm text-gray-800 bg-gray-50 overflow-x-auto border-t border-gray-100",children:e.code})]},s))})]})]})]})},ai=e=>{let{show:s}=e;return s?(0,c.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start",children:[(0,c.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Request/Response Data Not Available"}),(0,c.jsxs)("p",{className:"text-sm text-blue-700 mt-1",children:["To view request and response details, enable prompt storage in your LiteLLM configuration by adding the following to your ",(0,c.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded",children:"proxy_config.yaml"})," file:"]}),(0,c.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"general_settings:\n store_model_in_db: true\n store_prompts_in_spend_logs: true"}),(0,c.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change."})]})]}):null};var an=t(35829);let ao=e=>{let{sessionId:s,logs:t,onBack:l}=e,[a,r]=(0,d.useState)(null),[i,n]=(0,d.useState)({}),o=t.reduce((e,s)=>e+(s.spend||0),0),m=t.reduce((e,s)=>e+(s.total_tokens||0),0),u=t.length>0?new Date(t[0].startTime):new Date;(((t.length>0?new Date(t[t.length-1].endTime):new Date).getTime()-u.getTime())/1e3).toFixed(2),t.map(e=>({time:new Date(e.startTime).toISOString(),tokens:e.total_tokens||0,cost:e.spend||0}));let x=async(e,s)=>{await eF(e)&&(n(e=>({...e,[s]:!0})),setTimeout(()=>{n(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:l,className:"mb-4",children:"Back to All Logs"}),(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsx)("h1",{className:"text-2xl font-semibold text-gray-900",children:"Session Details"}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)("p",{className:"text-sm text-gray-500 font-mono",children:s}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:i["session-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>x(s,"session-id"),className:"left-2 z-10 transition-all duration-200 ".concat(i["session-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/ui_logs_sessions",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 flex items-center gap-1",children:["Get started with session management here",(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(an.Z,{children:t.length})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Cost"}),(0,c.jsxs)(an.Z,{children:["$",eD(o,6)]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(an.Z,{children:m})]})]}),(0,c.jsx)(k.Z,{children:"Session Logs"}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(t3,{columns:ae,data:t,renderSubComponent:ag,getRowCanExpand:()=>!0,loadingMessage:"Loading logs...",noDataMessage:"No logs found"})})]})};function ac(e){let{data:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)({});if(!s||0===s.length)return null;let i=e=>new Date(1e3*e).toLocaleString(),n=(e,s)=>"".concat(((s-e)*1e3).toFixed(2),"ms"),o=(e,s)=>{let t="".concat(e,"-").concat(s);r(e=>({...e,[t]:!e[t]}))};return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Vector Store Requests"})]}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:t?"Click to collapse":"Click to expand"})]}),t&&(0,c.jsx)("div",{className:"p-4",children:s.map((e,s)=>(0,c.jsxs)("div",{className:"mb-6 last:mb-0",children:[(0,c.jsx)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Query:"}),(0,c.jsx)("span",{className:"font-mono",children:e.query})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Vector Store ID:"}),(0,c.jsx)("span",{className:"font-mono",children:e.vector_store_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,c.jsx)("span",{className:"flex items-center",children:(()=>{let{logo:s,displayName:t}=(0,sL.dr)(e.custom_llm_provider);return(0,c.jsxs)(c.Fragment,{children:[s&&(0,c.jsx)("img",{src:s,alt:"".concat(t," logo"),className:"h-5 w-5 mr-2"}),t]})})()})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:i(e.start_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:i(e.end_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsx)("span",{children:n(e.start_time,e.end_time)})]})]})]})}),(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Search Results"}),(0,c.jsx)("div",{className:"space-y-2",children:e.vector_store_search_response.data.map((e,t)=>{let l=a["".concat(s,"-").concat(t)]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,c.jsxs)("div",{className:"flex items-center p-3 bg-gray-50 cursor-pointer",onClick:()=>o(s,t),children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(l?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsxs)("span",{className:"font-medium mr-2",children:["Result ",t+1]}),(0,c.jsxs)("span",{className:"text-gray-500 text-sm",children:["Score: ",(0,c.jsx)("span",{className:"font-mono",children:e.score.toFixed(4)})]})]})]}),l&&(0,c.jsx)("div",{className:"p-3 border-t bg-white",children:e.content.map((e,s)=>(0,c.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,c.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:e.type}),(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all bg-gray-50 p-2 rounded",children:e.text})]},s))})]},t)})})]},s))})]})}function ad(e){let{data:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)(!0),[i,n]=(0,d.useState)({});if(!s)return null;let o=s.masked_entity_count?Object.values(s.masked_entity_count).reduce((e,s)=>e+s,0):0,m=e=>new Date(1e3*e).toLocaleString(),u=e=>{n(s=>({...s,[e]:!s[e]}))},x=e=>e>=.8?"text-green-600":"text-yellow-600";return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Guardrail Information"}),(0,c.jsx)("span",{className:"ml-3 px-2 py-1 rounded-md text-xs font-medium inline-block ".concat("success"===s.guardrail_status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.guardrail_status}),o>0&&(0,c.jsxs)("span",{className:"ml-3 px-2 py-1 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[o," masked ",1===o?"entity":"entities"]})]}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:t?"Click to collapse":"Click to expand"})]}),t&&(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:[(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail Name:"}),(0,c.jsx)("span",{className:"font-mono",children:s.guardrail_name})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Mode:"}),(0,c.jsx)("span",{className:"font-mono",children:s.guardrail_mode})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat("success"===s.guardrail_status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.guardrail_status})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:m(s.start_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:m(s.end_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsxs)("span",{children:[s.duration.toFixed(4),"s"]})]})]})]}),s.masked_entity_count&&Object.keys(s.masked_entity_count).length>0&&(0,c.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Masked Entity Summary"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(s.masked_entity_count).map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{className:"px-3 py-1.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[s,": ",t]},s)})})]})]}),s.guardrail_response&&s.guardrail_response.length>0&&(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>r(!a),children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsxs)("h4",{className:"font-medium",children:["Detected Entities (",s.guardrail_response.length,")"]})]}),a&&(0,c.jsx)("div",{className:"space-y-2",children:s.guardrail_response.map((e,s)=>{let t=i[s]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>u(s),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("span",{className:"font-medium mr-2",children:e.entity_type}),(0,c.jsxs)("span",{className:"font-mono ".concat(x(e.score)),children:["Score: ",e.score.toFixed(2)]})]}),(0,c.jsxs)("span",{className:"text-xs text-gray-500",children:["Position: ",e.start,"-",e.end]})]}),t&&(0,c.jsx)("div",{className:"p-3 border-t bg-white",children:(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-2",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Entity Type:"}),(0,c.jsx)("span",{children:e.entity_type})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Position:"}),(0,c.jsxs)("span",{children:["Characters ",e.start,"-",e.end]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Confidence:"}),(0,c.jsx)("span",{className:x(e.score),children:e.score.toFixed(2)})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[e.recognition_metadata&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Recognizer:"}),(0,c.jsx)("span",{children:e.recognition_metadata.recognizer_name})]}),(0,c.jsxs)("div",{className:"flex overflow-hidden",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Identifier:"}),(0,c.jsx)("span",{className:"truncate text-xs font-mono",children:e.recognition_metadata.recognizer_identifier})]})]}),e.analysis_explanation&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Explanation:"}),(0,c.jsx)("span",{children:e.analysis_explanation})]})]})]})})]},s)})})]})]})]})}let am={TEAM_ID:"Team ID",KEY_HASH:"Key Hash",REQUEST_ID:"Request ID",MODEL:"Model",USER_ID:"User ID",END_USER:"End User",STATUS:"Status",KEY_ALIAS:"Key Alias"},au="".concat("../ui/assets/","audit-logs-preview.png");function ax(e){let{userID:s,userRole:t,token:l,accessToken:a,isActive:r,premiumUser:i,allTeams:n}=e,[o,m]=(0,d.useState)(l3()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),u=(0,d.useRef)(null),x=(0,d.useRef)(null),[h,p]=(0,d.useState)(1),[j]=(0,d.useState)(50),[f,v]=(0,d.useState)({}),[_,y]=(0,d.useState)(""),[b,N]=(0,d.useState)(""),[Z,k]=(0,d.useState)(""),[S,C]=(0,d.useState)("all"),[I,P]=(0,d.useState)("all"),[A,E]=(0,d.useState)(!1),[T,L]=(0,d.useState)(!1),O=(0,sd.a)({queryKey:["all_audit_logs",a,l,t,s,o],queryFn:async()=>{if(!a||!l||!t||!s)return[];let e=l3()(o).utc().format("YYYY-MM-DD HH:mm:ss"),r=l3()().utc().format("YYYY-MM-DD HH:mm:ss"),i=[],n=1,c=1;do{let s=await (0,g.uiAuditLogsCall)(a,e,r,n,50);i=i.concat(s.audit_logs),c=s.total_pages,n++}while(n<=c);return i},enabled:!!a&&!!l&&!!t&&!!s&&r,refetchInterval:5e3,refetchIntervalInBackground:!0}),M=(0,d.useCallback)(async e=>{if(a)try{let s=(await (0,g.keyListCall)(a,null,null,e,null,null,1,10)).keys.find(s=>s.key_alias===e);s?N(s.token):N("")}catch(e){console.error("Error fetching key hash for alias:",e),N("")}},[a]);(0,d.useEffect)(()=>{if(!a)return;let e=!1,s=!1;f["Team ID"]?_!==f["Team ID"]&&(y(f["Team ID"]),e=!0):""!==_&&(y(""),e=!0),f["Key Hash"]?b!==f["Key Hash"]&&(N(f["Key Hash"]),s=!0):f["Key Alias"]?M(f["Key Alias"]):""!==b&&(N(""),s=!0),(e||s)&&p(1)},[f,a,M,_,b]),(0,d.useEffect)(()=>{p(1)},[_,b,o,Z,S,I]),(0,d.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&E(!1),x.current&&!x.current.contains(e.target)&&L(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let D=(0,d.useMemo)(()=>O.data?O.data.filter(e=>{var s,t,l,a,r,i,n;let o=!0,c=!0,d=!0,m=!0,u=!0;if(_){let r="string"==typeof e.before_value?null===(s=JSON.parse(e.before_value))||void 0===s?void 0:s.team_id:null===(t=e.before_value)||void 0===t?void 0:t.team_id,i="string"==typeof e.updated_values?null===(l=JSON.parse(e.updated_values))||void 0===l?void 0:l.team_id:null===(a=e.updated_values)||void 0===a?void 0:a.team_id;o=r===_||i===_}if(b)try{let s="string"==typeof e.before_value?JSON.parse(e.before_value):e.before_value,t="string"==typeof e.updated_values?JSON.parse(e.updated_values):e.updated_values,l=null==s?void 0:s.token,a=null==t?void 0:t.token;c="string"==typeof l&&l.includes(b)||"string"==typeof a&&a.includes(b)}catch(e){c=!1}if(Z&&(d=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(Z.toLowerCase())),"all"!==S&&(m=(null===(i=e.action)||void 0===i?void 0:i.toLowerCase())===S.toLowerCase()),"all"!==I){let s="";switch(I){case"keys":s="litellm_verificationtoken";break;case"teams":s="litellm_teamtable";break;case"users":s="litellm_usertable";break;default:s=I}u=(null===(n=e.table_name)||void 0===n?void 0:n.toLowerCase())===s}return o&&c&&d&&m&&u}):[],[O.data,_,b,Z,S,I]),F=D.length,R=Math.ceil(F/j)||1,q=(0,d.useMemo)(()=>{let e=(h-1)*j,s=e+j;return D.slice(e,s)},[D,h,j]),U=!O.data||0===O.data.length,z=(0,d.useCallback)(e=>{let{row:s}=e;return(0,c.jsx)(e=>{let{rowData:s}=e,{before_value:t,updated_values:l,table_name:a,action:r}=s,i=(e,s)=>{if(!e||0===Object.keys(e).length)return(0,c.jsx)(w.Z,{children:"N/A"});if(s){let s=Object.keys(e),t=["token","spend","max_budget"];if(s.every(e=>t.includes(e))&&s.length>0)return(0,c.jsxs)("div",{children:[s.includes("token")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Token:"})," ",e.token||"N/A"]}),s.includes("spend")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Spend:"})," ",void 0!==e.spend?"$".concat(eD(e.spend,6)):"N/A"]}),s.includes("max_budget")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Max Budget:"})," ",void 0!==e.max_budget?"$".concat(eD(e.max_budget,6)):"N/A"]})]});if(e["No differing fields detected in 'before' state"]||e["No differing fields detected in 'updated' state"]||e["No fields changed"])return(0,c.jsx)(w.Z,{children:e[Object.keys(e)[0]]})}return(0,c.jsx)("pre",{className:"p-2 bg-gray-50 border rounded text-xs overflow-auto max-h-60",children:JSON.stringify(e,null,2)})},n=t,o=l;if(("updated"===r||"rotated"===r)&&t&&l&&("LiteLLM_TeamTable"===a||"LiteLLM_UserTable"===a||"LiteLLM_VerificationToken"===a)){let e={},s={};new Set([...Object.keys(t),...Object.keys(l)]).forEach(a=>{JSON.stringify(t[a])!==JSON.stringify(l[a])&&(t.hasOwnProperty(a)&&(e[a]=t[a]),l.hasOwnProperty(a)&&(s[a]=l[a]))}),Object.keys(t).forEach(a=>{l.hasOwnProperty(a)||e.hasOwnProperty(a)||(e[a]=t[a],s[a]=void 0)}),Object.keys(l).forEach(a=>{t.hasOwnProperty(a)||s.hasOwnProperty(a)||(s[a]=l[a],e[a]=void 0)}),n=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},o=Object.keys(s).length>0?s:{"No differing fields detected in 'updated' state":"N/A"},0===Object.keys(e).length&&0===Object.keys(s).length&&(n={"No fields changed":"N/A"},o={"No fields changed":"N/A"})}return(0,c.jsxs)("div",{className:"-mx-4 p-4 bg-slate-100 border-y border-slate-300 grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Before Value:"}),i(n,"LiteLLM_VerificationToken"===a)]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Updated Value:"}),i(o,"LiteLLM_VerificationToken"===a)]})]})},{rowData:s.original})},[]);if(!i)return(0,c.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,c.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,c.jsx)(w.Z,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,c.jsx)(w.Z,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,c.jsx)("img",{src:au,alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{console.error("Failed to load audit logs preview image"),e.target.style.display="none"}})]});let V=F>0?(h-1)*j+1:0,K=Math.min(h*j,F);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4"}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,c.jsx)("h1",{className:"text-xl font-semibold py-4",children:"Audit Logs"}),(0,c.jsx)(e=>{let{show:s}=e;return s?(0,c.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start mb-6",children:[(0,c.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Audit Logs Not Available"}),(0,c.jsx)("p",{className:"text-sm text-blue-700 mt-1",children:"To enable audit logging, add the following configuration to your LiteLLM proxy configuration file:"}),(0,c.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"litellm_settings:\n store_audit_logs: true"}),(0,c.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change and proxy restart."})]})]}):null},{show:U}),(0,c.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,c.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)("input",{type:"text",placeholder:"Search by Object ID...",value:Z,onChange:e=>k(e.target.value),className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,c.jsxs)("button",{onClick:()=>{O.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,c.jsx)("svg",{className:"w-4 h-4 ".concat(O.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,c.jsx)("span",{children:"Refresh"})]})]})}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsxs)("div",{className:"relative",ref:u,children:[(0,c.jsx)("label",{htmlFor:"actionFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Action:"}),(0,c.jsxs)("button",{id:"actionFilterDisplay",onClick:()=>E(!A),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,c.jsxs)("span",{children:["all"===S&&"All Actions","created"===S&&"Created","updated"===S&&"Updated","deleted"===S&&"Deleted","rotated"===S&&"Rotated"]}),(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),A&&(0,c.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,c.jsx)("div",{className:"space-y-1",children:[{label:"All Actions",value:"all"},{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}].map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(S===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{C(e.value),E(!1)},children:e.label},e.value))})})]}),(0,c.jsxs)("div",{className:"relative",ref:x,children:[(0,c.jsx)("label",{htmlFor:"tableFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Table:"}),(0,c.jsxs)("button",{id:"tableFilterDisplay",onClick:()=>L(!T),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,c.jsxs)("span",{children:["all"===I&&"All Tables","keys"===I&&"Keys","teams"===I&&"Teams","users"===I&&"Users"]}),(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),T&&(0,c.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,c.jsx)("div",{className:"space-y-1",children:[{label:"All Tables",value:"all"},{label:"Keys",value:"keys"},{label:"Teams",value:"teams"},{label:"Users",value:"users"}].map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(I===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{P(e.value),L(!1)},children:e.label},e.value))})})]}),(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",O.isLoading?"...":V," ","-"," ",O.isLoading?"...":K," ","of"," ",O.isLoading?"...":F," ","results"]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",O.isLoading?"...":h," of"," ",O.isLoading?"...":R]}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.max(1,e-1)),disabled:O.isLoading||1===h,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.min(R,e+1)),disabled:O.isLoading||h===R,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),(0,c.jsx)(t3,{columns:at,data:q,renderSubComponent:z,getRowCanExpand:()=>!0})]})]})}let ah=(e,s,t)=>{if(e)return"".concat(l3()(s).format("MMM D, h:mm A")," - ").concat(l3()(t).format("MMM D, h:mm A"));let l=l3()(),a=l3()(s),r=l.diff(a,"minutes");if(r>=0&&r<2)return"Last 1 Minute";if(r>=2&&r<16)return"Last 15 Minutes";if(r>=16&&r<61)return"Last Hour";let i=l.diff(a,"hours");return i>=1&&i<5?"Last 4 Hours":i>=5&&i<25?"Last 24 Hours":i>=25&&i<169?"Last 7 Days":"".concat(a.format("MMM D")," - ").concat(l.format("MMM D"))};function ap(e){var s,t,l;let{accessToken:a,token:r,userRole:i,userID:n,allTeams:o,premiumUser:m}=e,[u,x]=(0,d.useState)(""),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)(!1),[_,y]=(0,d.useState)(1),[b]=(0,d.useState)(50),N=(0,d.useRef)(null),Z=(0,d.useRef)(null),w=(0,d.useRef)(null),[k,S]=(0,d.useState)(l3()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[C,I]=(0,d.useState)(l3()().format("YYYY-MM-DDTHH:mm")),[P,A]=(0,d.useState)(!1),[E,T]=(0,d.useState)(!1),[L,O]=(0,d.useState)(""),[M,D]=(0,d.useState)(""),[F,R]=(0,d.useState)(""),[q,U]=(0,d.useState)(""),[z,V]=(0,d.useState)(""),[K,B]=(0,d.useState)(null),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)(""),[W,$]=(0,d.useState)(i&&eE.lo.includes(i)),[Q,X]=(0,d.useState)("request logs"),[ee,es]=(0,d.useState)(null),[et,el]=(0,d.useState)(null),ea=(0,h.NL)(),[er,ei]=(0,d.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,d.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(er))},[er]);let[en,eo]=(0,d.useState)({value:24,unit:"hours"});(0,d.useEffect)(()=>{(async()=>{G&&a&&B({...(await (0,g.keyInfoV1Call)(a,G)).info,token:G,api_key:G})})()},[G,a]),(0,d.useEffect)(()=>{function e(e){N.current&&!N.current.contains(e.target)&&v(!1),Z.current&&!Z.current.contains(e.target)&&j(!1),w.current&&!w.current.contains(e.target)&&T(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,d.useEffect)(()=>{i&&eE.lo.includes(i)&&$(!0)},[i]);let ec=(0,sd.a)({queryKey:["logs","table",_,b,k,C,F,q,W?n:null,J,z],queryFn:async()=>{if(!a||!r||!i||!n)return{data:[],total:0,page:1,page_size:b,total_pages:0};let e=l3()(k).utc().format("YYYY-MM-DD HH:mm:ss"),s=P?l3()(C).utc().format("YYYY-MM-DD HH:mm:ss"):l3()().utc().format("YYYY-MM-DD HH:mm:ss"),t=await (0,g.uiSpendLogsCall)(a,q||void 0,F||void 0,void 0,e,s,_,b,W?n:void 0,J,z);return await al(t.data,e,a,ea),t.data=t.data.map(s=>{let t=ea.getQueryData(["logDetails",s.request_id,e]);return(null==t?void 0:t.messages)&&(null==t?void 0:t.response)&&(s.messages=t.messages,s.response=t.response),s}),t},enabled:!!a&&!!r&&!!i&&!!n&&"request logs"===Q,refetchInterval:!!er&&1===_&&15e3,refetchIntervalInBackground:!0}),{filters:ed,filteredLogs:em,allTeams:eu,allKeyAliases:ex,handleFilterChange:eh,handleFilterReset:ep}=function(e){let{logs:s,accessToken:t,startTime:l,endTime:a,pageSize:r=25,isCustomDate:i,setCurrentPage:n,userID:o,userRole:c}=e,m=(0,d.useMemo)(()=>({[am.TEAM_ID]:"",[am.KEY_HASH]:"",[am.REQUEST_ID]:"",[am.MODEL]:"",[am.USER_ID]:"",[am.END_USER]:"",[am.STATUS]:"",[am.KEY_ALIAS]:""}),[]),[u,x]=(0,d.useState)(m),[h,p]=(0,d.useState)(s),j=(0,d.useRef)(0),f=(0,d.useCallback)(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t)return;let n=Date.now();j.current=n;let o=l3()(l).utc().format("YYYY-MM-DD HH:mm:ss"),c=i?l3()(a).utc().format("YYYY-MM-DD HH:mm:ss"):l3()().utc().format("YYYY-MM-DD HH:mm:ss");try{let l=await (0,g.uiSpendLogsCall)(t,e[am.KEY_HASH]||void 0,e[am.TEAM_ID]||void 0,e[am.REQUEST_ID]||void 0,o,c,s,r,e[am.USER_ID]||void 0,e[am.END_USER]||void 0,e[am.STATUS]||void 0,e[am.MODEL]||void 0);n===j.current&&l.data&&p(l)}catch(e){console.error("Error searching users:",e)}},[t,l,a,i,r]),v=(0,d.useMemo)(()=>eA()((e,s)=>f(e,s),300),[f]);(0,d.useEffect)(()=>()=>v.cancel(),[v]);let _=(0,sd.a)({queryKey:["allKeys"],queryFn:async()=>{if(!t)throw Error("Access token required");return await sm(t)},enabled:!!t}).data||[];(0,d.useEffect)(()=>{if(!s||!s.data){p({data:[],total:0,page:1,page_size:50,total_pages:0});return}let e=[...s.data];if(u[am.TEAM_ID]&&(e=e.filter(e=>e.team_id===u[am.TEAM_ID])),u[am.STATUS]&&(e=e.filter(e=>"success"===u[am.STATUS]?!e.status||"success"===e.status:e.status===u[am.STATUS])),u[am.MODEL]&&(e=e.filter(e=>e.model===u[am.MODEL])),u[am.KEY_HASH]&&(e=e.filter(e=>e.api_key===u[am.KEY_HASH])),u[am.END_USER]&&(e=e.filter(e=>e.end_user===u[am.END_USER])),u[am.KEY_ALIAS])try{let s=u[am.KEY_ALIAS];s&&(e=e.filter(e=>{var t;return(null===(t=e.metadata)||void 0===t?void 0:t.user_api_key_alias)===s}))}catch(e){console.error("Error fetching key info for alias:",e)}let t={data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages};JSON.stringify(t)!==JSON.stringify(h)&&p(t)},[s,u,h,t]);let{data:y}=(0,sd.a)({queryKey:["allTeamsForLogFilters",t],queryFn:async()=>t&&await su(t)||[],enabled:!!t});return{filters:u,filteredLogs:h,allKeyAliases:_,allTeams:y,handleFilterChange:e=>{x(s=>{let t={...s,...e};for(let e of Object.keys(m))e in t||(t[e]=m[e]);return JSON.stringify(t)!==JSON.stringify(s)&&(n(1),v(t,1)),t})},handleFilterReset:()=>{x(m),v(m,1)}}}({logs:ec.data||{data:[],total:0,page:1,page_size:b||10,total_pages:1},accessToken:a,startTime:k,endTime:C,pageSize:b,isCustomDate:P,setCurrentPage:y,userID:n,userRole:i}),eg=(0,d.useCallback)(async e=>{if(a)try{let s=(await (0,g.keyListCall)(a,null,null,e,null,null,_,b)).keys.find(s=>s.key_alias===e);s&&U(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[a,_,b]);(0,d.useEffect)(()=>{a&&(ed["Team ID"]?R(ed["Team ID"]):R(""),Y(ed.Status||""),V(ed.Model||""),ed["Key Hash"]?U(ed["Key Hash"]):ed["Key Alias"]?eg(ed["Key Alias"]):U(""))},[ed,a,eg]);let ej=(0,sd.a)({queryKey:["sessionLogs",et],queryFn:async()=>{if(!a||!et)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,g.sessionSpendLogsCall)(a,et);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!a&&!!et});if((0,d.useEffect)(()=>{var e;(null===(e=ec.data)||void 0===e?void 0:e.data)&&ee&&!ec.data.data.some(e=>e.request_id===ee)&&es(null)},[null===(s=ec.data)||void 0===s?void 0:s.data,ee]),!a||!r||!i||!n)return null;let ef=em.data.filter(e=>!u||e.request_id.includes(u)||e.model.includes(u)||e.user&&e.user.includes(u)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>H(e),onSessionClick:e=>{e&&el(e)}}))||[],ev=(null===(l=ej.data)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.map(e=>({...e,onKeyHashClick:e=>H(e),onSessionClick:e=>{}})))||[],e_=[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>o&&0!==o.length?o.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",isSearchable:!1},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>a?(await sm(a)).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e})):[]},{name:"End User",label:"End User",isSearchable:!0,searchFn:async e=>{if(!a)return[];let s=await (0,g.allEndUsersCall)(a);return((null==s?void 0:s.end_users)||[]).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Key Hash",label:"Key Hash",isSearchable:!1}];if(et&&ej.data)return(0,c.jsx)("div",{className:"w-full p-6",children:(0,c.jsx)(ao,{sessionId:et,logs:ej.data.data,onBack:()=>el(null)})});let ey=[{label:"Last 15 Minutes",value:15,unit:"minutes"},{label:"Last Hour",value:1,unit:"hours"},{label:"Last 4 Hours",value:4,unit:"hours"},{label:"Last 24 Hours",value:24,unit:"hours"},{label:"Last 7 Days",value:7,unit:"days"}],eb=ey.find(e=>e.value===en.value&&e.unit===en.unit),eN=P?ah(P,k,C):null==eb?void 0:eb.label;return(0,c.jsx)("div",{className:"w-full p-6",children:(0,c.jsxs)(eW.Z,{defaultIndex:0,onIndexChange:e=>X(0===e?"request logs":"audit logs"),children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsx)(eY.Z,{children:"Request Logs"}),(0,c.jsx)(eY.Z,{children:"Audit Logs"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,c.jsx)("h1",{className:"text-xl font-semibold",children:et?(0,c.jsxs)(c.Fragment,{children:["Session: ",(0,c.jsx)("span",{className:"font-mono",children:et}),(0,c.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>el(null),children:"← Back to All Logs"})]}):"Request Logs"})}),K&&G&&K.api_key===G?(0,c.jsx)(sn,{keyId:G,keyData:K,accessToken:a,userID:n,userRole:i,teams:o,onClose:()=>H(null),premiumUser:m}):et?(0,c.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,c.jsx)(t3,{columns:ae,data:ev,renderSubComponent:ag,getRowCanExpand:()=>!0})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sc,{options:e_,onApplyFilters:eh,onResetFilters:ep}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:u,onChange:e=>x(e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsxs)("div",{className:"relative",ref:w,children:[(0,c.jsxs)("button",{onClick:()=>T(!E),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),eN]}),E&&(0,c.jsx)("div",{className:"absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,c.jsxs)("div",{className:"space-y-1",children:[ey.map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eN===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{I(l3()().format("YYYY-MM-DDTHH:mm")),S(l3()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eo({value:e.value,unit:e.unit}),A(!1),T(!1)},children:e.label},e.label)),(0,c.jsx)("div",{className:"border-t my-2"}),(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(P?"bg-blue-50 text-blue-600":""),onClick:()=>A(!P),children:"Custom Range"})]})})]}),(0,c.jsx)(()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,c.jsx)(tE.Z,{color:"green",checked:er,defaultChecked:!0,onChange:ei})]}),{}),(0,c.jsxs)("button",{onClick:()=>{ec.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,c.jsx)("svg",{className:"w-4 h-4 ".concat(ec.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,c.jsx)("span",{children:"Refresh"})]})]}),P&&(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{children:(0,c.jsx)("input",{type:"datetime-local",value:k,onChange:e=>{S(e.target.value),y(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,c.jsx)("span",{className:"text-gray-500",children:"to"}),(0,c.jsx)("div",{children:(0,c.jsx)("input",{type:"datetime-local",value:C,onChange:e=>{I(e.target.value),y(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",ec.isLoading?"...":em?(_-1)*b+1:0," ","-"," ",ec.isLoading?"...":em?Math.min(_*b,em.total):0," ","of"," ",ec.isLoading?"...":em?em.total:0," ","results"]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",ec.isLoading?"...":_," of"," ",ec.isLoading?"...":em?em.total_pages:1]}),(0,c.jsx)("button",{onClick:()=>y(e=>Math.max(1,e-1)),disabled:ec.isLoading||1===_,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>y(e=>Math.min(em.total_pages||1,e+1)),disabled:ec.isLoading||_===(em.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),er&&1===_&&(0,c.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-greem-200 rounded-md flex items-center justify-between",children:[(0,c.jsx)("div",{className:"flex items-center gap-2",children:(0,c.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,c.jsx)("button",{onClick:()=>ei(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,c.jsx)(t3,{columns:ae,data:ef,renderSubComponent:ag,getRowCanExpand:()=>!0})]})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(ax,{userID:n,userRole:i,token:r,accessToken:a,isActive:"audit logs"===Q,premiumUser:m,allTeams:o})})]})]})})}function ag(e){var s,t,l,a,r;let{row:i}=e,n=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},o=i.original.metadata||{},d="failure"===o.status,m=d?o.error_information:null,u=i.original.messages&&(Array.isArray(i.original.messages)?i.original.messages.length>0:Object.keys(i.original.messages).length>0),x=i.original.response&&Object.keys(n(i.original.response)).length>0,h=o.vector_store_request_metadata&&Array.isArray(o.vector_store_request_metadata)&&o.vector_store_request_metadata.length>0,p=i.original.metadata&&i.original.metadata.guardrail_information,g=p&&(null===(r=i.original.metadata)||void 0===r?void 0:r.guardrail_information.masked_entity_count)?Object.values(i.original.metadata.guardrail_information.masked_entity_count).reduce((e,s)=>e+("number"==typeof s?s:0),0):0;return(0,c.jsxs)("div",{className:"p-6 bg-gray-50 space-y-6",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"p-4 border-b",children:(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request Details"})}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 p-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Request ID:"}),(0,c.jsx)("span",{className:"font-mono text-sm",children:i.original.request_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Model:"}),(0,c.jsx)("span",{children:i.original.model})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Model ID:"}),(0,c.jsx)("span",{children:i.original.model_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Call Type:"}),(0,c.jsx)("span",{children:i.original.call_type})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,c.jsx)("span",{children:i.original.custom_llm_provider||"-"})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"API Base:"}),(0,c.jsx)(z.Z,{title:i.original.api_base||"-",children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:i.original.api_base||"-"})})]}),(null==i?void 0:null===(s=i.original)||void 0===s?void 0:s.requester_ip_address)&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"IP Address:"}),(0,c.jsx)("span",{children:null==i?void 0:null===(t=i.original)||void 0===t?void 0:t.requester_ip_address})]}),p&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail:"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-mono",children:i.original.metadata.guardrail_information.guardrail_name}),g>0&&(0,c.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[g," masked"]})]})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Tokens:"}),(0,c.jsxs)("span",{children:[i.original.total_tokens," (",i.original.prompt_tokens,"+",i.original.completion_tokens,")"]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Cost:"}),(0,c.jsxs)("span",{children:["$",eD(i.original.spend||0,6)]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Cache Hit:"}),(0,c.jsx)("span",{children:i.original.cache_hit})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat("failure"!==((null===(l=i.original.metadata)||void 0===l?void 0:l.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(a=i.original.metadata)||void 0===a?void 0:a.status)||"Success").toLowerCase()?"Success":"Failure"})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:i.original.startTime})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:i.original.endTime})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsxs)("span",{children:[i.original.duration," s."]})]})]})]})]}),(0,c.jsx)(ai,{show:!u&&!x}),(0,c.jsx)(aa,{row:i,hasMessages:u,hasResponse:x,hasError:d,errorInfo:m,getRawRequest:()=>{var e;return(null===(e=i.original)||void 0===e?void 0:e.proxy_server_request)?n(i.original.proxy_server_request):n(i.original.messages)},formattedResponse:()=>d&&m?{error:{message:m.error_message||"An error occurred",type:m.error_class||"error",code:m.error_code||"unknown",param:null}}:n(i.original.response)}),p&&(0,c.jsx)(ad,{data:i.original.metadata.guardrail_information}),h&&(0,c.jsx)(ac,{data:o.vector_store_request_metadata}),d&&m&&(0,c.jsx)(ar,{errorInfo:m}),i.original.request_tags&&Object.keys(i.original.request_tags).length>0&&(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"flex justify-between items-center p-4 border-b",children:(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request Tags"})}),(0,c.jsx)("div",{className:"p-4",children:(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(i.original.request_tags).map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[s,": ",String(t)]},s)})})})]}),i.original.metadata&&Object.keys(i.original.metadata).length>0&&(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Metadata"}),(0,c.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(i.original.metadata,null,2))},className:"p-1 hover:bg-gray-200 rounded",title:"Copy metadata",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-64",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(i.original.metadata,null,2)})})]})]})}var aj=t(36172),af=t(14042),av=e=>{let{userID:s,userRole:t,accessToken:l,userSpend:a,userMaxBudget:r,selectedTeam:i}=e;console.log("userSpend: ".concat(a));let[n,o]=(0,d.useState)(null!==a?a:0),[m,u]=(0,d.useState)(i?Number(eD(i.max_budget,4)):null);(0,d.useEffect)(()=>{if(i){if("Default Team"===i.team_alias)u(r);else{let e=!1;if(i.team_memberships)for(let t of i.team_memberships)t.user_id===s&&"max_budget"in t.litellm_budget_table&&null!==t.litellm_budget_table.max_budget&&(u(t.litellm_budget_table.max_budget),e=!0);e||u(i.max_budget)}}},[i,r]);let[x,h]=(0,d.useState)([]);(0,d.useEffect)(()=>{let e=async()=>{if(!l||!s||!t)return};(async()=>{try{if(null===s||null===t)return;if(null!==l){let e=(await (0,g.modelAvailableCall)(l,s,t)).data.map(e=>e.id);console.log("available_model_names:",e),h(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[t,l,s]),(0,d.useEffect)(()=>{null!==a&&o(a)},[a]);let p=[];i&&i.models&&(p=i.models),p&&p.includes("all-proxy-models")?(console.log("user models:",x),p=x):p&&p.includes("all-team-models")?p=i.models:p&&0===p.length&&(p=x);let j=null!==m?"$".concat(eD(Number(m),4)," limit"):"No limit",f=void 0!==n?eD(n,4):null;return console.log("spend in view user spend: ".concat(n)),(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,c.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",f]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,c.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:j})]})]})})};let a_=e=>{let{key:s,info:t}=e;return{token:s,...t}};var ay=e=>{let{topKeys:s,accessToken:t,userID:l,userRole:a,teams:r,premiumUser:i}=e,[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(null),[x,h]=(0,d.useState)(void 0),[p,j]=(0,d.useState)("table"),f=async e=>{if(t)try{let s=await (0,g.keyInfoV1Call)(t,e.api_key),l=a_(s);h(l),u(e.api_key),o(!0)}catch(e){console.error("Error fetching key info:",e)}},v=()=>{o(!1),u(null),h(void 0)};d.useEffect(()=>{let e=e=>{"Escape"===e.key&&n&&v()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n]);let y=s.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{onClick:()=>j("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===p?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,c.jsx)("button",{onClick:()=>j("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===p?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===p?(0,c.jsx)("div",{className:"relative",children:(0,c.jsx)(s$.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:y,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat(eD(e,2)):"No Key Alias",onValueChange:e=>f(e),showTooltip:!0,customTooltip:e=>{var s,t;let l=null===(t=e.payload)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.payload;return(0,c.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,c.jsxs)("div",{className:"space-y-1.5",children:[(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,c.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==l?void 0:l.key_alias})]}),(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,c.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==l?void 0:l.api_key})]}),(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,c.jsxs)("span",{className:"text-white font-medium",children:["$",eD(null==l?void 0:l.spend,2)]})]})]})})}})}):(0,c.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,c.jsx)(t3,{columns:[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.getValue(),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>f(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>"$".concat(eD(e.getValue(),2))}],data:s,renderSubComponent:()=>(0,c.jsx)(c.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),n&&m&&x&&(console.log("Rendering modal with:",{isModalOpen:n,selectedKey:m,keyData:x}),(0,c.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&v()},children:(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,c.jsx)("button",{onClick:v,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,c.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,c.jsx)("div",{className:"p-6 h-full",children:(0,c.jsx)(sn,{keyId:m,onClose:v,keyData:x,accessToken:t,userID:l,userRole:a,teams:r,premiumUser:i})})]})}))]})};function ab(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function aN(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let aZ={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6"},aw=e=>{let{active:s,payload:t,label:l}=e;if(s&&t&&t.length){let e=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),s=(e,s)=>{let t=s.substring(s.indexOf(".")+1);if(e.metrics&&t in e.metrics)return e.metrics[t]};return(0,c.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,c.jsx)("p",{className:"text-tremor-content-strong",children:l}),t.map(t=>{var l;let a=null===(l=t.dataKey)||void 0===l?void 0:l.toString();if(!a||!t.payload)return null;let r=s(t.payload,a),i=a.includes("spend"),n=void 0!==r?i?"$".concat(r.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})):r.toLocaleString():"N/A",o=aZ[t.color]||t.color;return(0,c.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:o}}),(0,c.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:e(a)})]}),(0,c.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:n})]},a)})]})}return null},ak=e=>{let{categories:s,colors:t}=e,l=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return(0,c.jsx)("div",{className:"flex items-center justify-end space-x-4",children:s.map((e,s)=>{let a=aZ[t[s]]||t[s];return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:a}}),(0,c.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:l(e)})]},e)})})},aS=e=>{var s,t;let{modelName:l,metrics:a}=e;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)(v.Z,{numItems:4,className:"gap-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(k.Z,{children:a.total_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Successful Requests"}),(0,c.jsx)(k.Z,{children:a.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(k.Z,{children:a.total_tokens.toLocaleString()}),(0,c.jsxs)(w.Z,{children:[Math.round(a.total_tokens/a.total_successful_requests)," ","avg per successful request"]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Spend"}),(0,c.jsxs)(k.Z,{children:["$",eD(a.total_spend,2)]}),(0,c.jsxs)(w.Z,{children:["$",eD(a.total_spend/a.total_successful_requests,3)," ","per successful request"]})]})]}),a.top_api_keys&&a.top_api_keys.length>0&&(0,c.jsxs)(W.Z,{className:"mt-4",children:[(0,c.jsx)(k.Z,{children:"Top API Keys by Spend"}),(0,c.jsx)("div",{className:"mt-3",children:(0,c.jsx)("div",{className:"grid grid-cols-1 gap-2",children:a.top_api_keys.map((e,s)=>(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:e.key_alias||"".concat(e.api_key.substring(0,10),"...")}),e.team_id&&(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,c.jsxs)("div",{className:"text-right",children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["$",eD(e.spend,2)]}),(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(ak,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:ab,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Requests per day"}),(0,c.jsx)(ak,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:ab,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Spend per day"}),(0,c.jsx)(ak,{categories:["metrics.spend"],colors:["green"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:aN,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Success vs Failed Requests"}),(0,c.jsx)(ak,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:ab,stack:!0,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Prompt Caching Metrics"}),(0,c.jsx)(ak,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,c.jsxs)("div",{className:"mb-2",children:[(0,c.jsxs)(w.Z,{children:["Cache Read:"," ",(null===(s=a.total_cache_read_input_tokens)||void 0===s?void 0:s.toLocaleString())||0," ","tokens"]}),(0,c.jsxs)(w.Z,{children:["Cache Creation:"," ",(null===(t=a.total_cache_creation_input_tokens)||void 0===t?void 0:t.toLocaleString())||0," ","tokens"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:ab,customTooltip:aw,showLegend:!1})]})]})]})},aC=e=>{let{modelMetrics:s}=e,t=Object.keys(s).sort((e,t)=>""===e?1:""===t?-1:s[t].total_spend-s[e].total_spend),l={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(s).forEach(e=>{l.total_requests+=e.total_requests,l.total_successful_requests+=e.total_successful_requests,l.total_tokens+=e.total_tokens,l.total_spend+=e.total_spend,l.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,l.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{l.daily_data[e.date]||(l.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),l.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,l.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,l.daily_data[e.date].total_tokens+=e.metrics.total_tokens,l.daily_data[e.date].api_requests+=e.metrics.api_requests,l.daily_data[e.date].spend+=e.metrics.spend,l.daily_data[e.date].successful_requests+=e.metrics.successful_requests,l.daily_data[e.date].failed_requests+=e.metrics.failed_requests,l.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,l.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let a=Object.entries(l.daily_data).map(e=>{let[s,t]=e;return{date:s,metrics:t}}).sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime());return(0,c.jsxs)("div",{className:"space-y-8",children:[(0,c.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,c.jsx)(k.Z,{children:"Overall Usage"}),(0,c.jsxs)(v.Z,{numItems:4,className:"gap-4 mb-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(k.Z,{children:l.total_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Successful Requests"}),(0,c.jsx)(k.Z,{children:l.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(k.Z,{children:l.total_tokens.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Spend"}),(0,c.jsxs)(k.Z,{children:["$",eD(l.total_spend,2)]})]})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Tokens Over Time"}),(0,c.jsx)(ak,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:ab,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Requests Over Time"}),(0,c.jsx)(ak,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:ab,stack:!0,customTooltip:aw,showLegend:!1})]})]})]}),(0,c.jsx)(tx.default,{defaultActiveKey:t[0],children:t.map(e=>(0,c.jsx)(tx.default.Panel,{header:(0,c.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,c.jsx)(k.Z,{children:s[e].label||"Unknown Item"}),(0,c.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,c.jsxs)("span",{children:["$",eD(s[e].total_spend,2)]}),(0,c.jsxs)("span",{children:[s[e].total_requests.toLocaleString()," ","requests"]})]})]}),children:(0,c.jsx)(aS,{modelName:e||"Unknown Model",metrics:s[e]})},e))})]})},aI=(e,s)=>{let t=e.metadata.key_alias||"key-hash-".concat(s),l=e.metadata.team_id;return l?"".concat(t," (team_id: ").concat(l,")"):t},aP=(e,s)=>{let t={};return e.results.forEach(e=>{Object.entries(e.breakdown[s]||{}).forEach(l=>{let[a,r]=l;t[a]||(t[a]={label:"api_keys"===s?aI(r,a):a,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],daily_data:[]}),t[a].total_requests+=r.metrics.api_requests,t[a].prompt_tokens+=r.metrics.prompt_tokens,t[a].completion_tokens+=r.metrics.completion_tokens,t[a].total_tokens+=r.metrics.total_tokens,t[a].total_spend+=r.metrics.spend,t[a].total_successful_requests+=r.metrics.successful_requests,t[a].total_failed_requests+=r.metrics.failed_requests,t[a].total_cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,t[a].total_cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0,t[a].daily_data.push({date:e.date,metrics:{prompt_tokens:r.metrics.prompt_tokens,completion_tokens:r.metrics.completion_tokens,total_tokens:r.metrics.total_tokens,api_requests:r.metrics.api_requests,spend:r.metrics.spend,successful_requests:r.metrics.successful_requests,failed_requests:r.metrics.failed_requests,cache_read_input_tokens:r.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:r.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==s&&Object.entries(t).forEach(l=>{let[a,r]=l,i={};e.results.forEach(e=>{var t;let l=null===(t=e.breakdown[s])||void 0===t?void 0:t[a];l&&"api_key_breakdown"in l&&Object.entries(l.api_key_breakdown||{}).forEach(e=>{let[s,t]=e;i[s]||(i[s]={api_key:s,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),i[s].spend+=t.metrics.spend,i[s].requests+=t.metrics.api_requests,i[s].tokens+=t.metrics.total_tokens})}),t[a].top_api_keys=Object.values(i).sort((e,s)=>s.spend-e.spend).slice(0,5)}),Object.values(t).forEach(e=>{e.daily_data.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime())}),t};var aA=e=>{let{accessToken:s,entityType:t,entityId:l,userID:a,userRole:r,entityList:i,premiumUser:n}=e,[o,m]=(0,d.useState)({results:[],metadata:{total_spend:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0}}),u=aP(o,"models"),x=aP(o,"api_keys"),[h,p]=(0,d.useState)([]),[j,_]=(0,d.useState)({from:new Date(Date.now()-24192e5),to:new Date}),y=async()=>{if(!s||!j.from||!j.to)return;let e=new Date(j.from),l=new Date(j.to);if("tag"===t)m(await (0,g.tagDailyActivityCall)(s,e,l,1,h.length>0?h:null));else if("team"===t)m(await (0,g.teamDailyActivityCall)(s,e,l,1,h.length>0?h:null));else throw Error("Invalid entity type")};(0,d.useEffect)(()=>{y()},[s,j,l,h]);let b=()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=l.metrics.spend,e[t].requests+=l.metrics.api_requests,e[t].successful_requests+=l.metrics.successful_requests,e[t].failed_requests+=l.metrics.failed_requests,e[t].tokens+=l.metrics.total_tokens}catch(e){console.error("Error processing provider ".concat(t,": ").concat(e))}})}),Object.values(e).filter(e=>e.spend>0).sort((e,s)=>s.spend-e.spend)},N=e=>0===h.length?e:e.filter(e=>h.includes(e.metadata.id)),Z=()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.entities||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:l.metadata.team_alias||t,id:t}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.total_tokens+=l.metrics.total_tokens})}),N(Object.values(e).sort((e,s)=>s.metrics.spend-e.metrics.spend))};return(0,c.jsxs)("div",{style:{width:"100%"},children:[(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full mb-4",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:j,onValueChange:_})}),i&&i.length>0&&(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(w.Z,{children:["Filter by ","tag"===t?"Tags":"Teams"]}),(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select ".concat("tag"===t?"tags":"teams"," to filter..."),value:h,onChange:p,options:(()=>{if(i)return i})(),className:"mt-2",allowClear:!0})]})]}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eY.Z,{children:"Cost"}),(0,c.jsx)(eY.Z,{children:"Model Activity"}),(0,c.jsx)(eY.Z,{children:"Key Activity"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full",children:[(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(k.Z,{children:["tag"===t?"Tag":"Team"," Spend Overview"]}),(0,c.jsxs)(v.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Spend"}),(0,c.jsxs)(w.Z,{className:"text-2xl font-bold mt-2",children:["$",eD(o.metadata.total_spend,2)]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:o.metadata.total_api_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Successful Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:o.metadata.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Failed Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:o.metadata.total_failed_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:o.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend"}),(0,c.jsx)(s$.Z,{data:[...o.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aN,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:l}=e;if(!l||!(null==s?void 0:s[0]))return null;let a=s[0].payload,r=Object.keys(a.breakdown.entities||{}).length;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:a.date}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",eD(a.metrics.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",a.metrics.api_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Successful: ",a.metrics.successful_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Failed: ",a.metrics.failed_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",a.metrics.total_tokens]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["tag"===t?"Total Tags":"Total Teams",": ",r]}),(0,c.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,c.jsxs)("p",{className:"font-semibold",children:["Spend by ","tag"===t?"Tag":"Team",":"]}),Object.entries(a.breakdown.entities||{}).sort((e,s)=>{let[,t]=e,[,l]=s,a=t.metrics.spend;return l.metrics.spend-a}).slice(0,5).map(e=>{let[s,t]=e;return(0,c.jsxs)("p",{className:"text-sm text-gray-600",children:[t.metadata.team_alias||s,": $",eD(t.metrics.spend,2)]},s)}),r>5&&(0,c.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",r-5," more"]})]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,c.jsxs)(k.Z,{children:["Spend Per ","tag"===t?"Tag":"Team"]}),(0,c.jsx)(sT.Z,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,c.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,c.jsxs)("span",{children:["Get Started by Tracking cost per ",t," "]}),(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-6",children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(s$.Z,{className:"mt-4 h-52",data:Z().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?"".concat(e.metadata.alias.slice(0,15),"..."):e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aN,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.metadata.alias}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eD(l.metrics.spend,4)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Requests:"," ",l.metrics.api_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-green-600",children:["Successful:"," ",l.metrics.successful_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-red-600",children:["Failed:"," ",l.metrics.failed_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens:"," ",l.metrics.total_tokens.toLocaleString()]})]})}})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"tag"===t?"Tag":"Team"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sb.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sb.Z,{children:"Tokens"})]})}),(0,c.jsx)(sv.Z,{children:Z().filter(e=>e.metrics.spend>0).map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.metadata.alias}),(0,c.jsxs)(s_.Z,{children:["$",eD(e.metrics.spend,4)]}),(0,c.jsx)(s_.Z,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ay,{topKeys:(()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:l.metadata.key_alias,team_id:l.metadata.team_id||null}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:s,userID:a,userRole:r,teams:null,premiumUser:n})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Top Models"}),(0,c.jsx)(s$.Z,{className:"mt-4 h-40",data:(()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=l.metrics.spend}catch(e){console.error("Error adding spend for ".concat(t,": ").concat(e,", got metrics: ").concat(JSON.stringify(l)))}e[t].requests+=l.metrics.api_requests,e[t].successful_requests+=l.metrics.successful_requests,e[t].failed_requests+=l.metrics.failed_requests,e[t].tokens+=l.metrics.total_tokens})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,...t}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"display_key",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$".concat(eD(e,2)),layout:"vertical",yAxisWidth:200,showLegend:!1})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsx)(k.Z,{children:"Provider Usage"}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(af.Z,{className:"mt-4 h-40",data:b(),index:"provider",category:"spend",valueFormatter:e=>"$".concat(eD(e,2)),colors:["cyan","blue","indigo","violet","purple"]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Provider"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sb.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sb.Z,{children:"Tokens"})]})}),(0,c.jsx)(sv.Z,{children:b().map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.provider}),(0,c.jsxs)(s_.Z,{children:["$",eD(e.spend,2)]}),(0,c.jsx)(s_.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:u})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:x})})]})]})]})},aE=e=>{let{isOpen:s,onClose:t,accessToken:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)("cloudzero"),[p,g]=(0,d.useState)(!1);(0,d.useEffect)(()=>{s&&l&&j()},[s,l]);let j=async()=>{u(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"}});if(e.ok){let s=await e.json();o(s),a.setFieldsValue({connection_id:s.connection_id})}else if(404!==e.status){let s=await e.json();P.ZP.error("Failed to load existing settings: ".concat(s.error||"Unknown error"))}}catch(e){console.error("Error loading CloudZero settings:",e),P.ZP.error("Failed to load existing settings")}finally{u(!1)}},f=async e=>{if(!l){P.ZP.error("No access token available");return}i(!0);try{let s={...e,timezone:"UTC"},t=await fetch(n?"/cloudzero/settings":"/cloudzero/init",{method:n?"PUT":"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(t.ok)return P.ZP.success(a.message||"CloudZero settings saved successfully"),o({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return P.ZP.error(a.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),P.ZP.error("Failed to save CloudZero settings"),!1}finally{i(!1)}},v=async()=>{if(!l){P.ZP.error("No access token available");return}g(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),s=await e.json();e.ok?(P.ZP.success(s.message||"Export to CloudZero completed successfully"),t()):P.ZP.error(s.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),P.ZP.error("Failed to export to CloudZero")}finally{g(!1)}},b=async()=>{g(!0);try{P.ZP.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),P.ZP.error("Failed to export CSV")}finally{g(!1)}},N=async()=>{if("cloudzero"===x){if(!n){let e=await a.validateFields();if(!await f(e))return}await v()}else await b()},Z=()=>{a.resetFields(),h("cloudzero"),o(null),t()},k=[{value:"cloudzero",label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,c.jsx)("span",{children:"Export to CSV"})]})}];return(0,c.jsx)(A.Z,{title:"Export Data",open:s,onCancel:Z,footer:null,width:600,destroyOnClose:!0,children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,c.jsx)(C.default,{value:x,onChange:h,options:k,className:"w-full",size:"large"})]}),"cloudzero"===x&&(0,c.jsx)("div",{children:m?(0,c.jsx)("div",{className:"flex justify-center py-8",children:(0,c.jsx)(lm.Z,{size:"large"})}):(0,c.jsxs)(c.Fragment,{children:[n&&(0,c.jsx)(lN.Z,{title:"Existing CloudZero Configuration",icon:()=>(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,c.jsxs)(w.Z,{children:["API Key: ",n.api_key_masked,(0,c.jsx)("br",{}),"Connection ID: ",n.connection_id]})}),!n&&(0,c.jsxs)(I.Z,{form:a,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,c.jsx)(y.Z,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,c.jsx)(I.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===x&&(0,c.jsx)(lN.Z,{title:"CSV Export",icon:()=>(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,c.jsx)(w.Z,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:Z,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:N,loading:r||p,disabled:r||p,children:"cloudzero"===x?"Export to CloudZero":"Export CSV"})]})]})})},aT=e=>{var s,t,l,a,r,i,n,o,m,u;let{accessToken:x,userRole:h,userID:p,teams:j,premiumUser:_}=e,[y,b]=(0,d.useState)({results:[],metadata:{}}),[N,Z]=(0,d.useState)({from:new Date(Date.now()-24192e5),to:new Date}),[S,C]=(0,d.useState)([]),[I,P]=(0,d.useState)("groups"),[A,E]=(0,d.useState)(!1),T=async()=>{x&&C(Object.values(await (0,g.tagListCall)(x)).map(e=>({label:e.name,value:e.name})))};(0,d.useEffect)(()=>{T()},[x]);let L=(null===(s=y.metadata)||void 0===s?void 0:s.total_spend)||0,O=()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{provider:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}})},M=async()=>{if(!x||!N.from||!N.to)return;let e=new Date(N.from),s=new Date(N.to);try{let t=await (0,g.userDailyActivityCall)(x,e,s);if(t.metadata.total_pages>10)throw Error("Too many pages of data (>10). Please select a smaller date range.");if(t.metadata.total_pages<=1){b(t);return}let l=[...t.results],a={...t.metadata};for(let r=2;r<=t.metadata.total_pages;r++){let t=await (0,g.userDailyActivityCall)(x,e,s,r);l.push(...t.results),t.metadata&&(a.total_spend+=t.metadata.total_spend||0,a.total_api_requests+=t.metadata.total_api_requests||0,a.total_successful_requests+=t.metadata.total_successful_requests||0,a.total_failed_requests+=t.metadata.total_failed_requests||0,a.total_tokens+=t.metadata.total_tokens||0)}b({results:l,metadata:a})}catch(e){throw console.error("Error fetching user spend data:",e),e}};(0,d.useEffect)(()=>{M()},[x,N]);let D=aP(y,"models"),F=aP(y,"api_keys"),R=aP(y,"mcp_servers");return(0,c.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"solid",className:"mt-1",children:[eE.ZL.includes(h||"")?(0,c.jsx)(eY.Z,{children:"Global Usage"}):(0,c.jsx)(eY.Z,{children:"Your Usage"}),(0,c.jsx)(eY.Z,{children:"Team Usage"}),eE.ZL.includes(h||"")?(0,c.jsx)(eY.Z,{children:"Tag Usage"}):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(v.Z,{numItems:2,className:"gap-2 w-full mb-4",children:(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:N,onValueChange:e=>{Z(e)}})})}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eY.Z,{children:"Cost"}),(0,c.jsx)(eY.Z,{children:"Model Activity"}),(0,c.jsx)(eY.Z,{children:"Key Activity"}),(0,c.jsx)(eY.Z,{children:"MCP Server Activity"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(w.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend"," ",new Date().toLocaleString("default",{month:"long"})," ","1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,c.jsx)(av,{userID:p,userRole:h,accessToken:x,userSpend:L,selectedTeam:null,userMaxBudget:null})]}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Usage Metrics"}),(0,c.jsxs)(v.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:(null===(l=y.metadata)||void 0===l?void 0:null===(t=l.total_api_requests)||void 0===t?void 0:t.toLocaleString())||0})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Successful Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:(null===(r=y.metadata)||void 0===r?void 0:null===(a=r.total_successful_requests)||void 0===a?void 0:a.toLocaleString())||0})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Failed Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:(null===(n=y.metadata)||void 0===n?void 0:null===(i=n.total_failed_requests)||void 0===i?void 0:i.toLocaleString())||0})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:(null===(m=y.metadata)||void 0===m?void 0:null===(o=m.total_tokens)||void 0===o?void 0:o.toLocaleString())||0})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Average Cost per Request"}),(0,c.jsxs)(w.Z,{className:"text-2xl font-bold mt-2",children:["$",eD((L||0)/((null===(u=y.metadata)||void 0===u?void 0:u.total_api_requests)||1),4)]})]})]})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend"}),(0,c.jsx)(s$.Z,{data:[...y.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aN,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.date}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eD(l.metrics.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Requests: ",l.metrics.api_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Successful: ",l.metrics.successful_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Failed: ",l.metrics.failed_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",l.metrics.total_tokens]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ay,{topKeys:(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:l.metadata.key_alias,team_id:null}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:x,userID:p,userRole:h,teams:null,premiumUser:_})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"groups"===I?"Top Public Model Names":"Top Litellm Models"}),(0,c.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,c.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("groups"===I?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>P("groups"),children:"Public Model Name"}),(0,c.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("individual"===I?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>P("individual"),children:"Litellm Model Name"})]})]}),(0,c.jsx)(s$.Z,{className:"mt-4 h-40",data:"groups"===I?(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.model_groups||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})():(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:aN,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.key}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eD(l.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Requests:"," ",l.requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-green-600",children:["Successful:"," ",l.successful_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-red-600",children:["Failed:"," ",l.failed_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",l.tokens.toLocaleString()]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(k.Z,{children:"Spend by Provider"})}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(af.Z,{className:"mt-4 h-40",data:O(),index:"provider",category:"spend",valueFormatter:e=>"$".concat(eD(e,2)),colors:["cyan"]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Provider"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sb.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sb.Z,{children:"Tokens"})]})}),(0,c.jsx)(sv.Z,{children:O().filter(e=>e.spend>0).map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.provider}),(0,c.jsxs)(s_.Z,{children:["$",eD(e.spend,2)]}),(0,c.jsx)(s_.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:D})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:F})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:R})})]})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aA,{accessToken:x,entityType:"team",userID:p,userRole:h,entityList:(null==j?void 0:j.map(e=>({label:e.team_alias,value:e.team_id})))||null,premiumUser:_})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aA,{accessToken:x,entityType:"tag",userID:p,userRole:h,entityList:S,premiumUser:_})})]})]}),(0,c.jsx)(aE,{isOpen:A,onClose:()=>E(!1),accessToken:x})]})},aL=e=>{let{proxySettings:s}=e,t="<your_proxy_base_url>";return s&&s.PROXY_BASE_URL&&void 0!==s.PROXY_BASE_URL&&(t=s.PROXY_BASE_URL),(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(v.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,c.jsxs)("div",{className:"mb-5",children:[(0,c.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,c.jsx)(w.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,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsx)(eY.Z,{children:"OpenAI Python SDK"}),(0,c.jsx)(eY.Z,{children:"LlamaIndex"}),(0,c.jsx)(eY.Z,{children:"Langchain Py"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(t,'" # 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,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.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="'.concat(t,'", # 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="').concat(t,'",\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,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.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="'.concat(t,'",\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 ')})})]})]})]})})})},aO=t(243),aM=t(93837);async function aD(e,s,t,l,a,r,i,n,o,c,d,m,u){console.log=function(){},console.log("isLocal:",!1);let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new lW.ZP.OpenAI({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a;let h=Date.now(),g=!1,w=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0;for await(let l of(await p.chat.completions.create({model:t,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:c,messages:e,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...w?{tools:w,tool_choice:"auto"}:{}},{signal:r}))){var j,f,v,_,y,b,N,Z;console.log("Stream chunk:",l);let e=null===(j=l.choices[0])||void 0===j?void 0:j.delta;if(console.log("Delta content:",null===(v=l.choices[0])||void 0===v?void 0:null===(f=v.delta)||void 0===f?void 0:f.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!g&&((null===(y=l.choices[0])||void 0===y?void 0:null===(_=y.delta)||void 0===_?void 0:_.content)||e&&e.reasoning_content)&&(g=!0,a=Date.now()-h,console.log("First token received! Time:",a,"ms"),n?(console.log("Calling onTimingData with:",a),n(a)):console.log("onTimingData callback is not defined!")),null===(N=l.choices[0])||void 0===N?void 0:null===(b=N.delta)||void 0===b?void 0:b.content){let e=l.choices[0].delta.content;s(e,l.model)}if(e&&e.reasoning_content){let s=e.reasoning_content;i&&i(s)}if(l.usage&&o){console.log("Usage data found:",l.usage);let e={completionTokens:l.usage.completion_tokens,promptTokens:l.usage.prompt_tokens,totalTokens:l.usage.total_tokens};(null===(Z=l.usage.completion_tokens_details)||void 0===Z?void 0:Z.reasoning_tokens)&&(e.reasoningTokens=l.usage.completion_tokens_details.reasoning_tokens),o(e)}}}catch(e){throw(null==r?void 0:r.aborted)&&console.log("Chat completion request was cancelled"),e}}async function aF(e,s,t,l,a,r){console.log=function(){},console.log("isLocal:",!1);let i=(0,g.getProxyBaseUrl)(),n=new lW.ZP.OpenAI({apiKey:l,baseURL:i,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let l=await n.images.generate({model:t,prompt:e},{signal:r});if(console.log(l.data),l.data&&l.data[0]){if(l.data[0].url)s(l.data[0].url,t);else if(l.data[0].b64_json){let e=l.data[0].b64_json;s("data:image/png;base64,".concat(e),t)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==r?void 0:r.aborted)?console.log("Image generation request was cancelled"):P.ZP.error("Error occurred while generating image. Please try again. Error: ".concat(e),20),e}}async function aR(e,s,t,l,a,r,i){console.log=function(){},console.log("isLocal:",!1);let n=(0,g.getProxyBaseUrl)(),o=new lW.ZP.OpenAI({apiKey:a,baseURL:n,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{let a=await o.images.edit({model:l,image:e,prompt:s},{signal:i});if(console.log(a.data),a.data&&a.data[0]){if(a.data[0].url)t(a.data[0].url,l);else if(a.data[0].b64_json){let e=a.data[0].b64_json;t("data:image/png;base64,".concat(e),l)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==i?void 0:i.aborted)?console.log("Image edits request was cancelled"):P.ZP.error("Error occurred while editing image. Please try again. Error: ".concat(e),20),e}}async function aq(e,s,t,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,n=arguments.length>7?arguments[7]:void 0,o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!l)throw Error("API key is required");console.log=function(){};let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new lW.ZP.OpenAI({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a=Date.now(),h=!1,g=e.map(e=>({role:e.role,content:e.content,type:"message"})),_=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0,y=await p.responses.create({model:t,input:g,stream:!0,litellm_trace_id:c,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},..._?{tools:_,tool_choice:"required"}:{}},{signal:r}),b="";for await(let e of y)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var j,f,v;if("response.output_item.done"===e.type&&(null===(j=e.item)||void 0===j?void 0:j.type)==="mcp_call"&&(null===(f=e.item)||void 0===f?void 0:f.name)&&(b=e.item.name,console.log("MCP tool used:",b)),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let l=e.delta;if(console.log("Text delta",l),l.trim().length>0&&(s("assistant",l,t),!h)){h=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),n&&n(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let s=e.delta;"string"==typeof s&&i&&i(s)}if("response.completed"===e.type&&"response"in e){let s=e.response.usage;if(console.log("Usage data:",s),s&&o){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(v=s.completion_tokens_details)||void 0===v?void 0:v.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),o(e,b)}}}return y}catch(e){throw(null==r?void 0:r.aborted)?console.log("Responses API request was cancelled"):P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20),e}}var aU=t(85498);async function az(e,s,t,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,n=arguments.length>7?arguments[7]:void 0,o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!l)throw Error("API key is required");console.log=function(){};let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new aU.ZP({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a=Date.now(),h=!1,g=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0,j={model:t,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(j.vector_store_ids=d),m&&(j.guardrails=m),g&&(j.tools=g,j.tool_choice="auto"),p.messages.stream(j,{signal:r}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let l=e.delta;if(!h){h=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),n&&n(e)}"text_delta"===l.type?s("assistant",l.text,t):"reasoning_delta"===l.type&&i&&i(l.text)}if("message_delta"===e.type&&e.usage&&o){let s=e.usage;console.log("Usage data found:",s);let t={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.input_tokens+s.output_tokens};o(t)}}}catch(e){throw(null==r?void 0:r.aborted)?console.log("Anthropic messages request was cancelled"):P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20),e}}async function aV(e){try{return(await (0,g.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),P.ZP.error("Failed to fetch MCP tools"),[]}}var aK=t(49817),aB=t(94263),aG=e=>{let{endpointType:s,onEndpointChange:t,className:l}=e,a=[{value:aK.KP.CHAT,label:"/v1/chat/completions"},{value:aK.KP.RESPONSES,label:"/v1/responses"},{value:aK.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:aK.KP.IMAGE,label:"/v1/images/generations"},{value:aK.KP.IMAGE_EDITS,label:"/v1/images/edits"}];return(0,c.jsxs)("div",{className:l,children:[(0,c.jsx)(w.Z,{children:"Endpoint Type:"}),(0,c.jsx)(C.default,{showSearch:!0,value:s,style:{width:"100%"},onChange:t,options:a,className:"rounded-md"})]})},aH=e=>{let{onChange:s,value:t,className:l,accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a)try{let e=await (0,g.tagListCall)(a);console.log("List tags response:",e),i(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}})()},[]),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select tags",onChange:s,value:t,loading:n,className:l,options:r.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})},aJ=e=>{let{onChange:s,value:t,className:l,accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a){o(!0);try{let e=await (0,g.getGuardrailsList)(a);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),i(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{o(!1)}}})()},[a]),(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:t,loading:n,className:l,options:r.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})},aY=t(88658),aW=t(83322),a$=e=>{let{reasoningContent:s}=e,[t,l]=(0,d.useState)(!0);return s?(0,c.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,c.jsxs)(T.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>l(!t),icon:(0,c.jsx)(aW.Z,{}),children:[t?"Hide reasoning":"Show reasoning",t?(0,c.jsx)(tp.Z,{className:"ml-1"}):(0,c.jsx)(t$.Z,{className:"ml-1"})]}),t&&(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,c.jsx)(aO.U,{components:{code(e){let{node:s,inline:t,className:l,children:a,...r}=e,i=/language-(\w+)/.exec(l||"");return!t&&i?(0,c.jsx)(l4.Z,{style:aB.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(a).replace(/\n$/,"")}):(0,c.jsx)("code",{className:"".concat(l," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...r,children:a})}},children:s})})]}):null},aQ=t(5540),aX=t(71282),a0=t(11741),a1=t(16601),a2=t(58630),a4=e=>{let{timeToFirstToken:s,usage:t,toolName:l}=e;return s||t?(0,c.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==s&&(0,c.jsx)(z.Z,{title:"Time to first token",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(aQ.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:[(s/1e3).toFixed(2),"s"]})]})}),(null==t?void 0:t.promptTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Prompt tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(aX.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["In: ",t.promptTokens]})]})}),(null==t?void 0:t.completionTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Completion tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a0.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Out: ",t.completionTokens]})]})}),(null==t?void 0:t.reasoningTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Reasoning tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(aW.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Reasoning: ",t.reasoningTokens]})]})}),(null==t?void 0:t.totalTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Total tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a1.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Total: ",t.totalTokens]})]})}),l&&(0,c.jsx)(z.Z,{title:"Tool used",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Tool: ",l]})]})})]}):null},a5=t(61935),a6=t(69993),a3=t(71891),a8=t(44625),a7=t(57400),a9=t(26430),re=t(11894),rs=t(15883),rt=t(99890),rl=t(23907);let{TextArea:ra}=L.default,{Dragger:rr}=ex.default;var ri=e=>{let{accessToken:s,token:t,userRole:l,userID:a,disabledPersonalKeyCreation:r}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let s=e?JSON.parse(e):[];return Array.isArray(s)?s[0]||"":s}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),""}}),[h,p]=(0,d.useState)(!1),[g,j]=(0,d.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return r?"custom":"session"}),[f,v]=(0,d.useState)(()=>sessionStorage.getItem("apiKey")||""),[b,N]=(0,d.useState)(""),[Z,S]=(0,d.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[I,E]=(0,d.useState)(()=>sessionStorage.getItem("selectedModel")||void 0),[L,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)([]),F=(0,d.useRef)(null),[R,q]=(0,d.useState)(()=>sessionStorage.getItem("endpointType")||aK.KP.CHAT),[V,K]=(0,d.useState)(!1),B=(0,d.useRef)(null),[G,J]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[Y,$]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[Q,X]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[ee,es]=(0,d.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[et,el]=(0,d.useState)(null),[ea,er]=(0,d.useState)(null),[ei,en]=(0,d.useState)(!1),[eo,ec]=(0,d.useState)(""),[ed,eu]=(0,d.useState)("openai"),ex=(0,d.useRef)(null),eh=async()=>{let e="session"===g?s:f;if(e){p(!0);try{let s=await aV(e);m(s)}catch(e){console.error("Error fetching MCP tools:",e)}finally{p(!1)}}};(0,d.useEffect)(()=>{i&&eh()},[i,s,f,g]),(0,d.useEffect)(()=>{ei&&ec((0,aY.L)({apiKeySource:g,accessToken:s,apiKey:f,inputMessage:b,chatHistory:Z,selectedTags:G,selectedVectorStores:Y,selectedGuardrails:Q,endpointType:R,selectedModel:I,selectedSdk:ed}))},[ei,ed,g,s,f,b,Z,G,Y,Q,R,I]),(0,d.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(Z))},500);return()=>{clearTimeout(e)}},[Z]),(0,d.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(g)),sessionStorage.setItem("apiKey",f),sessionStorage.setItem("endpointType",R),sessionStorage.setItem("selectedTags",JSON.stringify(G)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(Y)),sessionStorage.setItem("selectedGuardrails",JSON.stringify(Q)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(u)),I?sessionStorage.setItem("selectedModel",I):sessionStorage.removeItem("selectedModel"),ee?sessionStorage.setItem("messageTraceId",ee):sessionStorage.removeItem("messageTraceId")},[g,f,I,R,G,Y,Q,ee,u]),(0,d.useEffect)(()=>{let e="session"===g?s:f;if(!e||!t||!l||!a){console.log("userApiKey or token or userRole or userID is missing = ",e,t,l,a);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let s=await tu(e);console.log("Fetched models:",s),s.length>0&&(D(s),I||E(s[0].model_group))}catch(e){console.error("Error fetching model info:",e)}})(),eh()},[s,a,l,g,f,t]),(0,d.useEffect)(()=>{ex.current&&setTimeout(()=>{var e;null===(e=ex.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[Z]);let ep=(e,s,t)=>{console.log("updateTextUI called with:",e,s,t),S(l=>{let a=l[l.length-1];if(!a||a.role!==e||a.isImage)return[...l,{role:e,content:s,model:t}];{var r;let e={...a,content:a.content+s,model:null!==(r=a.model)&&void 0!==r?r:t};return[...l.slice(0,-1),e]}})},eg=e=>{S(s=>{let t=s[s.length-1];return t&&"assistant"===t.role&&!t.isImage?[...s.slice(0,s.length-1),{...t,reasoningContent:(t.reasoningContent||"")+e}]:s.length>0&&"user"===s[s.length-1].role?[...s,{role:"assistant",content:"",reasoningContent:e}]:s})},ej=e=>{console.log("updateTimingData called with:",e),S(s=>{let t=s[s.length-1];if(console.log("Current last message:",t),t&&"assistant"===t.role){console.log("Updating assistant message with timeToFirstToken:",e);let l=[...s.slice(0,s.length-1),{...t,timeToFirstToken:e}];return console.log("Updated chat history:",l),l}return t&&"user"===t.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...s,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),s)})},ev=(e,s)=>{console.log("Received usage data:",e),S(t=>{let l=t[t.length-1];if(l&&"assistant"===l.role){console.log("Updating message with usage data:",e);let a={...l,usage:e,toolName:s};return console.log("Updated message:",a),[...t.slice(0,t.length-1),a]}return t})},e_=(e,s)=>{S(t=>[...t,{role:"assistant",content:e,model:s,isImage:!0}])},ey=()=>{ea&&URL.revokeObjectURL(ea),el(null),er(null)},eb=async()=>{if(""===b.trim())return;if(R===aK.KP.IMAGE_EDITS&&!et){P.ZP.error("Please upload an image for editing");return}if(!t||!l||!a)return;let e="session"===g?s:f;if(!e){P.ZP.error("Please provide an API key or select Current UI Session");return}B.current=new AbortController;let r=B.current.signal,i={role:"user",content:b},n=ee||(0,aM.Z)();ee||es(n),S([...Z,i]),K(!0);try{if(I){if(R===aK.KP.CHAT){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aD(s,(e,s)=>ep("assistant",e,s),I,e,G,r,eg,ej,ev,n,Y.length>0?Y:void 0,Q.length>0?Q:void 0,u)}else if(R===aK.KP.IMAGE)await aF(b,(e,s)=>e_(e,s),I,e,G,r);else if(R===aK.KP.IMAGE_EDITS)et&&await aR(et,b,(e,s)=>e_(e,s),I,e,G,r);else if(R===aK.KP.RESPONSES){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aq(s,(e,s,t)=>ep(e,s,t),I,e,G,r,eg,ej,ev,n,Y.length>0?Y:void 0,Q.length>0?Q:void 0,u)}else if(R===aK.KP.ANTHROPIC_MESSAGES){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await az(s,(e,s,t)=>ep(e,s,t),I,e,G,r,eg,ej,ev,n,Y.length>0?Y:void 0,Q.length>0?Q:void 0,u)}}}catch(e){r.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),ep("assistant","Error fetching response:"+e))}finally{K(!1),B.current=null,R===aK.KP.IMAGE_EDITS&&ey()}N("")};if(l&&"Admin Viewer"===l){let{Title:e,Paragraph:s}=em.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to test models"})]})}let eN=(0,c.jsx)(a5.Z,{style:{fontSize:24},spin:!0});return(0,c.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,c.jsx)(W.Z,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,c.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,c.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,c.jsx)(k.Z,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(lC.Z,{className:"mr-2"})," API Key Source"]}),(0,c.jsx)(C.default,{disabled:r,value:g,style:{width:"100%"},onChange:e=>{j(e),x("")},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===g&&(0,c.jsx)(y.Z,{className:"mt-2",placeholder:"Enter custom API key",type:"password",onValueChange:v,value:f,icon:lC.Z})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a6.Z,{className:"mr-2"})," Select Model"]}),(0,c.jsx)(C.default,{value:I,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),E(e),O("custom"===e)},options:[...Array.from(new Set(M.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),L&&(0,c.jsx)(y.Z,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{E(e)},500)}})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(tJ.Z,{className:"mr-2"})," Endpoint Type"]}),(0,c.jsx)(aG,{endpointType:R,onEndpointChange:e=>{q(e),e!==aK.KP.RESPONSES&&x("")},className:"mb-4"})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a3.Z,{className:"mr-2"})," Tags"]}),(0,c.jsx)(aH,{value:G,onChange:J,className:"mb-4",accessToken:s||""})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-2"})," MCP Tool",(0,c.jsx)(z.Z,{className:"ml-1",title:"Select an MCP tool to use in your conversation, only available for virtual keys and /v1/responses endpoint",children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(C.default,{style:{width:"100%"},placeholder:"Select MCP tool",value:u,onChange:e=>x(e),loading:h,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:!("custom"===g&&R===aK.KP.RESPONSES),children:Array.isArray(o)&&o.map(e=>(0,c.jsx)(C.default.Option,{value:e.name,label:(0,c.jsx)("div",{className:"font-medium",children:e.name}),children:(0,c.jsxs)("div",{className:"flex flex-col py-1",children:[(0,c.jsx)("span",{className:"font-medium",children:e.name}),(0,c.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a8.Z,{className:"mr-2"})," Vector Store",(0,c.jsx)(z.Z,{className:"ml-1",title:(0,c.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store ",(0,c.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(H,{value:Y,onChange:$,className:"mb-4",accessToken:s||""})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a7.Z,{className:"mr-2"})," Guardrails",(0,c.jsx)(z.Z,{className:"ml-1",title:(0,c.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails ",(0,c.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(aJ,{value:Q,onChange:X,className:"mb-4",accessToken:s||""})]}),(0,c.jsx)("div",{className:"space-y-2 mt-4",children:(0,c.jsx)(_.Z,{onClick:()=>{S([]),es(null),ey(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),P.ZP.success("Chat history cleared.")},className:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:a9.Z,children:"Clear Chat"})})]})]}),(0,c.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,c.jsx)(k.Z,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,c.jsx)("div",{className:"flex gap-2",children:(0,c.jsx)(_.Z,{onClick:()=>en(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:re.Z,children:"Get Code"})})]}),(0,c.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===Z.length&&(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a6.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(w.Z,{children:"Start a conversation or generate an image"})]}),Z.map((e,s)=>(0,c.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,c.jsx)(rs.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,c.jsx)(a6.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,c.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,c.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,c.jsx)(a$,{reasoningContent:e.reasoningContent}),(0,c.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,c.jsx)("img",{src:e.content,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):(0,c.jsx)(aO.U,{components:{code(e){let{node:s,inline:t,className:l,children:a,...r}=e,i=/language-(\w+)/.exec(l||"");return!t&&i?(0,c.jsx)(l4.Z,{style:aB.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...r,children:String(a).replace(/\n$/,"")}):(0,c.jsx)("code",{className:"".concat(l," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...r,children:a})},pre:e=>{let{node:s,...t}=e;return(0,c.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...t})}},children:e.content}),"assistant"===e.role&&(e.timeToFirstToken||e.usage)&&(0,c.jsx)(a4,{timeToFirstToken:e.timeToFirstToken,usage:e.usage,toolName:e.toolName})]})]})},s)),V&&(0,c.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,c.jsx)(lm.Z,{indicator:eN})}),(0,c.jsx)("div",{ref:ex,style:{height:"1px"}})]}),(0,c.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[R===aK.KP.IMAGE_EDITS&&(0,c.jsx)("div",{className:"mb-4",children:et?(0,c.jsxs)("div",{className:"relative inline-block",children:[(0,c.jsx)("img",{src:ea||"",alt:"Upload preview",className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,c.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:ey,children:(0,c.jsx)(ef.Z,{})})]}):(0,c.jsxs)(rr,{beforeUpload:e=>(el(e),er(URL.createObjectURL(e)),!1),accept:"image/*",showUploadList:!1,className:"border-dashed border-2 border-gray-300 rounded-lg p-4",children:[(0,c.jsx)("p",{className:"ant-upload-drag-icon",children:(0,c.jsx)(rt.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,c.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag image to upload"}),(0,c.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats"})]})}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(ra,{value:b,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eb())},placeholder:R===aK.KP.CHAT||R===aK.KP.RESPONSES||R===aK.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":R===aK.KP.IMAGE_EDITS?"Describe how you want to edit the image...":"Describe the image you want to generate...",disabled:V,className:"flex-1",autoSize:{minRows:1,maxRows:6},style:{resize:"none",paddingRight:"10px",paddingLeft:"10px"}}),V?(0,c.jsx)(_.Z,{onClick:()=>{B.current&&(B.current.abort(),B.current=null,K(!1),P.ZP.info("Request cancelled"))},className:"ml-2 bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:ef.Z,children:"Cancel"}):(0,c.jsx)(_.Z,{onClick:eb,className:"ml-2 text-white",icon:R===aK.KP.CHAT||R===aK.KP.RESPONSES||R===aK.KP.ANTHROPIC_MESSAGES?rl.Z:a6.Z,children:R===aK.KP.CHAT||R===aK.KP.RESPONSES||R===aK.KP.ANTHROPIC_MESSAGES?"Send":R===aK.KP.IMAGE_EDITS?"Edit":"Generate"})]})]})]})]})}),(0,c.jsxs)(A.Z,{title:"Generated Code",visible:ei,onCancel:()=>en(!1),footer:null,width:800,children:[(0,c.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,c.jsx)(C.default,{value:ed,onChange:e=>eu(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,c.jsx)(T.ZP,{onClick:()=>{navigator.clipboard.writeText(eo),P.ZP.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,c.jsx)(l4.Z,{language:"python",style:aB.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:eo})]}),"custom"===g&&(0,c.jsx)(A.Z,{title:"Select MCP Tool",visible:i,onCancel:()=>n(!1),onOk:()=>{n(!1),P.ZP.success("MCP tool selection updated")},width:800,children:h?(0,c.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,c.jsx)(lm.Z,{indicator:(0,c.jsx)(a5.Z,{style:{fontSize:24},spin:!0})})}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(w.Z,{className:"text-gray-600 block mb-4",children:"Select the MCP tool you want to use in your conversation."}),(0,c.jsx)(C.default,{style:{width:"100%"},placeholder:"Select MCP tool",value:u,onChange:e=>x(e),optionLabelProp:"label",allowClear:!0,children:o.map(e=>(0,c.jsx)(C.default.Option,{value:e.name,label:(0,c.jsx)("div",{className:"font-medium",children:e.name}),children:(0,c.jsxs)("div",{className:"flex flex-col py-1",children:[(0,c.jsx)("span",{className:"font-medium",children:e.name}),(0,c.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})},rn=t(19226),ro=t(45937),rc=t(28595),rd=t(68208),rm=t(9775),ru=t(41361),rx=t(37527),rh=t(88009),rp=t(48231),rg=t(41169),rj=t(55322),rf=t(76865),rv=t(70525),r_=t(95805),ry=t(51817),rb=t(21047);t(22135),t(40875);var rN=t(49663);let rZ=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter(Boolean).join(" ")};function rw(e){let{accessToken:s,width:t=220}=e,[l,a]=(0,d.useState)(!1),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{if(s){u(!0),h(null);try{let e=await (0,g.getRemainingUsers)(s);o(e)}catch(e){console.error("Failed to fetch usage data:",e),h("Failed to load usage data")}finally{u(!1)}}})()},[s]);let{isOverLimit:p,isNearLimit:j,usagePercentage:f,userMetrics:v,teamMetrics:_}=(e=>{if(!e)return{isOverLimit:!1,isNearLimit:!1,usagePercentage:0,userMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0},teamMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0}};let s=!!e.total_users_remaining&&e.total_users_remaining<=0,t=!!e.total_users_remaining&&e.total_users_remaining<=5&&e.total_users_remaining>0,l=e.total_users?e.total_users_used/e.total_users*100:0,a=!!e.total_teams_remaining&&e.total_teams_remaining<=0,r=!!e.total_teams_remaining&&e.total_teams_remaining<=5&&e.total_teams_remaining>0,i=e.total_teams?e.total_teams_used/e.total_teams*100:0,n=s||a;return{isOverLimit:n,isNearLimit:(t||r)&&!n,usagePercentage:Math.max(l,i),userMetrics:{isOverLimit:s,isNearLimit:t,usagePercentage:l},teamMetrics:{isOverLimit:a,isNearLimit:r,usagePercentage:i}}})(n),y=()=>p?"red":j?"yellow":"green",b=()=>p?"Over Limit":j?"Near Limit":"Active",N=()=>p?(0,c.jsx)(rf.Z,{className:"h-3 w-3"}):j?(0,c.jsx)(rv.Z,{className:"h-3 w-3"}):null;return s&&((null==n?void 0:n.total_users)!==null||(null==n?void 0:n.total_teams)!==null)?(0,c.jsx)("div",{className:"fixed bottom-4 left-4 z-50",style:{width:"".concat(Math.min(t,220),"px")},children:(0,c.jsx)(()=>{if(r){let e=p||j;return(0,c.jsx)("button",{onClick:()=>i(!1),className:rZ("bg-white border border-gray-200 rounded-lg shadow-sm p-3 hover:shadow-md transition-all w-full",e&&p&&"border-red-200 bg-red-50",e&&j&&"border-yellow-200 bg-yellow-50"),title:"Show usage details",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(r_.Z,{className:"h-4 w-4 flex-shrink-0"}),e&&(0,c.jsx)("span",{className:"flex-shrink-0",children:N()}),(0,c.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium truncate",children:[n&&null!==n.total_users&&(0,c.jsxs)("span",{className:"flex-shrink-0",children:["U: ",n.total_users_used,"/",n.total_users]}),n&&null!==n.total_teams&&(0,c.jsxs)("span",{className:"flex-shrink-0",children:["T: ",n.total_teams_used,"/",n.total_teams]}),!n||null===n.total_users&&null===n.total_teams&&(0,c.jsx)("span",{className:"truncate",children:"Usage"})]})]})})}return m?(0,c.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 w-full",children:(0,c.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,c.jsx)(ry.Z,{className:"h-4 w-4 animate-spin"}),(0,c.jsx)("span",{className:"text-sm text-gray-500 truncate",children:"Loading..."})]})}):x||!n?(0,c.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 group w-full",children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex-1 min-w-0",children:(0,c.jsx)("span",{className:"text-sm text-gray-500 truncate block",children:x||"No data"})}),(0,c.jsx)("button",{onClick:()=>i(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,c.jsx)(rb.Z,{className:"h-3 w-3 text-gray-400"})})]})}):(0,c.jsxs)("div",{className:rZ("bg-white border rounded-lg shadow-sm p-3 transition-all duration-200 group w-full",p&&"border-red-200 bg-red-50",j&&"border-yellow-200 bg-yellow-50"),children:[(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,c.jsx)(r_.Z,{className:"h-4 w-4 flex-shrink-0"}),(0,c.jsx)("span",{className:"font-medium text-sm truncate",children:"Usage"}),(p||j)&&(0,c.jsx)(eJ.Z,{color:y(),className:"text-xs px-1.5 py-0.5 flex-shrink-0",children:b()})]}),(0,c.jsx)("button",{onClick:()=>i(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,c.jsx)(rb.Z,{className:"h-3 w-3 text-gray-400"})})]}),(0,c.jsxs)("div",{className:"space-y-3 text-sm",children:[null!==n.total_users&&(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-600 mb-1",children:[(0,c.jsx)(r_.Z,{className:"h-3 w-3"}),(0,c.jsx)("span",{className:"font-medium",children:"Users"})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[n.total_users_used,"/",n.total_users]})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,c.jsx)("span",{className:rZ("font-medium text-right",v.isOverLimit&&"text-red-600",v.isNearLimit&&"text-yellow-600"),children:n.total_users_remaining})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[Math.round(v.usagePercentage),"%"]})]}),(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,c.jsx)("div",{className:rZ("h-2 rounded-full transition-all duration-300",v.isOverLimit&&"bg-red-500",v.isNearLimit&&"bg-yellow-500",!v.isOverLimit&&!v.isNearLimit&&"bg-green-500"),style:{width:"".concat(Math.min(v.usagePercentage,100),"%")}})})]}),null!==n.total_teams&&(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-600 mb-1",children:[(0,c.jsx)(rN.Z,{className:"h-3 w-3"}),(0,c.jsx)("span",{className:"font-medium",children:"Teams"})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[n.total_teams_used,"/",n.total_teams]})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,c.jsx)("span",{className:rZ("font-medium text-right",_.isOverLimit&&"text-red-600",_.isNearLimit&&"text-yellow-600"),children:n.total_teams_remaining})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[Math.round(_.usagePercentage),"%"]})]}),(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,c.jsx)("div",{className:rZ("h-2 rounded-full transition-all duration-300",_.isOverLimit&&"bg-red-500",_.isNearLimit&&"bg-yellow-500",!_.isOverLimit&&!_.isNearLimit&&"bg-green-500"),style:{width:"".concat(Math.min(_.usagePercentage,100),"%")}})})]})]})]})},{})}):null}let{Sider:rk}=rn.default;var rS=e=>{let{accessToken:s,setPage:t,userRole:l,defaultSelectedKey:a}=e,r=[{key:"1",page:"api-keys",label:"Virtual Keys",icon:(0,c.jsx)(lC.Z,{})},{key:"3",page:"llm-playground",label:"Test Key",icon:(0,c.jsx)(rc.Z,{}),roles:eE.LQ},{key:"2",page:"models",label:"Models + Endpoints",icon:(0,c.jsx)(rd.Z,{}),roles:eE.LQ},{key:"12",page:"new_usage",label:"Usage",icon:(0,c.jsx)(rm.Z,{}),roles:[...eE.ZL,...eE.lo]},{key:"6",page:"teams",label:"Teams",icon:(0,c.jsx)(ru.Z,{})},{key:"17",page:"organizations",label:"Organizations",icon:(0,c.jsx)(rx.Z,{}),roles:eE.ZL},{key:"5",page:"users",label:"Internal Users",icon:(0,c.jsx)(rs.Z,{}),roles:eE.ZL},{key:"14",page:"api_ref",label:"API Reference",icon:(0,c.jsx)(tJ.Z,{})},{key:"16",page:"model-hub-table",label:"Model Hub",icon:(0,c.jsx)(rh.Z,{})},{key:"15",page:"logs",label:"Logs",icon:(0,c.jsx)(rp.Z,{})},{key:"11",page:"guardrails",label:"Guardrails",icon:(0,c.jsx)(a7.Z,{}),roles:eE.ZL},{key:"26",page:"tools",label:"Tools",icon:(0,c.jsx)(a2.Z,{}),children:[{key:"18",page:"mcp-servers",label:"MCP Servers",icon:(0,c.jsx)(a2.Z,{})},{key:"21",page:"vector-stores",label:"Vector Stores",icon:(0,c.jsx)(a8.Z,{}),roles:eE.ZL}]},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,c.jsx)(rg.Z,{}),children:[{key:"9",page:"caching",label:"Caching",icon:(0,c.jsx)(a8.Z,{}),roles:eE.ZL},{key:"10",page:"budgets",label:"Budgets",icon:(0,c.jsx)(rx.Z,{}),roles:eE.ZL},{key:"20",page:"transform-request",label:"API Playground",icon:(0,c.jsx)(tJ.Z,{}),roles:[...eE.ZL,...eE.lo]},{key:"19",page:"tag-management",label:"Tag Management",icon:(0,c.jsx)(a3.Z,{}),roles:eE.ZL},{key:"4",page:"usage",label:"Old Usage",icon:(0,c.jsx)(rm.Z,{})}]},{key:"settings",page:"settings",label:"Settings",icon:(0,c.jsx)(rj.Z,{}),roles:eE.ZL,children:[{key:"11",page:"general-settings",label:"Router Settings",icon:(0,c.jsx)(rj.Z,{}),roles:eE.ZL},{key:"8",page:"settings",label:"Logging & Alerts",icon:(0,c.jsx)(rj.Z,{}),roles:eE.ZL},{key:"13",page:"admin-panel",label:"Admin Settings",icon:(0,c.jsx)(rj.Z,{}),roles:eE.ZL}]}],i=(e=>{let s=r.find(s=>s.page===e);if(s)return s.key;for(let s of r)if(s.children){let t=s.children.find(s=>s.page===e);if(t)return t.key}return"1"})(a),n=r.filter(e=>{let s=!e.roles||e.roles.includes(l);return console.log("Menu item ".concat(e.label,": roles=").concat(e.roles,", userRole=").concat(l,", hasAccess=").concat(s)),!!s&&(e.children&&(e.children=e.children.filter(e=>!e.roles||e.roles.includes(l))),!0)});return(0,c.jsx)(rn.default,{style:{minHeight:"100vh"},children:(0,c.jsxs)(rk,{theme:"light",width:220,children:[(0,c.jsx)(ro.Z,{mode:"inline",selectedKeys:[i],defaultOpenKeys:["llm-tools"],style:{borderRight:0,backgroundColor:"transparent",fontSize:"14px"},items:n.map(e=>{var s;return{key:e.key,icon:e.icon,label:e.label,children:null===(s=e.children)||void 0===s?void 0:s.map(e=>({key:e.key,icon:e.icon,label:e.label,onClick:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}})),onClick:e.children?void 0:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}}})}),(0,eE.tY)(l)&&(0,c.jsx)(rw,{accessToken:s,width:220})]})})},rC=t(96889);console.log("process.env.NODE_ENV","production");let rI=e=>null!==e&&("Admin"===e||"Admin Viewer"===e);var rP=e=>{let{accessToken:s,token:t,userRole:l,userID:a,keys:r,premiumUser:i}=e,n=new Date,[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,y]=(0,d.useState)([]),[b,N]=(0,d.useState)([]),[Z,S]=(0,d.useState)([]),[C,I]=(0,d.useState)([]),[P,A]=(0,d.useState)([]),[E,T]=(0,d.useState)([]),[L,O]=(0,d.useState)([]),[M,D]=(0,d.useState)({}),[F,R]=(0,d.useState)([]),[q,U]=(0,d.useState)(""),[z,V]=(0,d.useState)(["all-tags"]),[K,B]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)(0),$=new Date(n.getFullYear(),n.getMonth(),1),Q=new Date(n.getFullYear(),n.getMonth()+1,0),X=er($),ee=er(Q);function es(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",r),console.log("premium user in usage",i);let et=async()=>{if(s)try{let e=await (0,g.getProxyUISettings)(s);return console.log("usage tab: proxy_settings",e),e}catch(e){console.error("Error fetching proxy settings:",e)}};(0,d.useEffect)(()=>{ea(K.from,K.to)},[K,z]);let el=async(e,t,l)=>{if(!e||!t||!s)return;console.log("uiSelectedKey",l);let a=await (0,g.adminTopEndUsersCall)(s,l,e.toISOString(),t.toISOString());console.log("End user data updated successfully",a),y(a)},ea=async(e,t)=>{if(!e||!t||!s)return;let l=await et();null!=l&&l.DISABLE_EXPENSIVE_DB_QUERIES||(S((await (0,g.tagsSpendLogsCall)(s,e.toISOString(),t.toISOString(),0===z.length?void 0:z)).spend_per_tag),console.log("Tag spend data updated successfully"))};function er(e){let s=e.getFullYear(),t=e.getMonth()+1,l=e.getDate();return"".concat(s,"-").concat(t<10?"0"+t:t,"-").concat(l<10?"0"+l:l)}console.log("Start date is ".concat(X)),console.log("End date is ".concat(ee));let ei=async(e,s,t)=>{try{let t=await e();s(t)}catch(e){console.error(t,e)}},en=(e,s,t,l)=>{let a=[],r=new Date(s),i=e=>{if(e.includes("-"))return e;{let[s,t]=e.split(" ");return new Date(new Date().getFullYear(),new Date("".concat(s," 01 2024")).getMonth(),parseInt(t)).toISOString().split("T")[0]}},n=new Map(e.map(e=>{let s=i(e.date);return[s,{...e,date:s}]}));for(;r<=t;){let e=r.toISOString().split("T")[0];if(n.has(e))a.push(n.get(e));else{let s={date:e,api_requests:0,total_tokens:0};l.forEach(e=>{s[e]||(s[e]=0)}),a.push(s)}r.setDate(r.getDate()+1)}return a},eo=async()=>{if(s)try{let e=await (0,g.adminSpendLogsCall)(s),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=en(e,l,a,[]),i=Number(r.reduce((e,s)=>e+(s.spend||0),0).toFixed(2));Y(i),m(r)}catch(e){console.error("Error fetching overall spend:",e)}},ec=()=>ei(()=>s&&t?(0,g.adminspendByProvider)(s,t,X,ee):Promise.reject("No access token or token"),O,"Error fetching provider spend"),em=async()=>{s&&await ei(async()=>(await (0,g.adminTopKeysCall)(s)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),x,"Error fetching top keys")},eu=async()=>{s&&await ei(async()=>(await (0,g.adminTopModelsCall)(s)).map(e=>({key:e.model,spend:eD(e.total_spend,2)})),p,"Error fetching top models")},ex=async()=>{s&&await ei(async()=>{let e=await (0,g.teamSpendLogsCall)(s),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0);return N(en(e.daily_spend,l,a,e.teams)),A(e.teams),e.total_spend_per_team.map(e=>({name:e.team_id||"",value:eD(e.total_spend||0,2)}))},T,"Error fetching team spend")},eh=()=>{s&&ei(async()=>(await (0,g.allTagNamesCall)(s)).tag_names,I,"Error fetching tag names")},ep=()=>{s&&ei(()=>{var e,t;return(0,g.tagsSpendLogsCall)(s,null===(e=K.from)||void 0===e?void 0:e.toISOString(),null===(t=K.to)||void 0===t?void 0:t.toISOString(),void 0)},e=>S(e.spend_per_tag),"Error fetching top tags")},eg=()=>{s&&ei(()=>(0,g.adminTopEndUsersCall)(s,null,void 0,void 0),y,"Error fetching top end users")},ej=async()=>{if(s)try{let e=await (0,g.adminGlobalActivity)(s,X,ee),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=en(e.daily_data||[],l,a,["api_requests","total_tokens"]);D({...e,daily_data:r})}catch(e){console.error("Error fetching global activity:",e)}},ef=async()=>{if(s)try{let e=await (0,g.adminGlobalActivityPerModel)(s,X,ee),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=e.map(e=>({...e,daily_data:en(e.daily_data||[],l,a,["api_requests","total_tokens"])}));R(r)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,d.useEffect)(()=>{(async()=>{if(s&&t&&l&&a){let e=await et();e&&(H(e),null!=e&&e.DISABLE_EXPENSIVE_DB_QUERIES)||(console.log("fetching data - valiue of proxySettings",G),eo(),ec(),em(),eu(),ej(),ef(),rI(l)&&(ex(),eh(),ep(),eg()))}})()},[s,t,l,a,X,ee]),null==G?void 0:G.DISABLE_EXPENSIVE_DB_QUERIES)?(0,c.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Database Query Limit Reached"}),(0,c.jsxs)(w.Z,{className:"mt-4",children:["SpendLogs in DB has ",G.NUM_SPEND_LOGS_ROWS," rows.",(0,c.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,c.jsx)(_.Z,{className:"mt-4",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,c.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mt-2",children:[(0,c.jsx)(eY.Z,{children:"All Up"}),rI(l)?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(eY.Z,{children:"Team Based Usage"}),(0,c.jsx)(eY.Z,{children:"Customer Usage"}),(0,c.jsx)(eY.Z,{children:"Tag Based Usage"})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{})})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eY.Z,{children:"Cost"}),(0,c.jsx)(eY.Z,{children:"Activity"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(w.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 - ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,c.jsx)(av,{userID:a,userRole:l,accessToken:s,userSpend:J,selectedTeam:null,userMaxBudget:null})]}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Monthly Spend"}),(0,c.jsx)(s$.Z,{data:o,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$ ".concat(eD(e,2)),yAxisWidth:100,tickGap:5})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ay,{topKeys:u,accessToken:s,userID:a,userRole:l,teams:null,premiumUser:i})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top Models"}),(0,c.jsx)(s$.Z,{className:"mt-4 h-40",data:h,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>"$".concat(eD(e,2))})]})}),(0,c.jsx)(f.Z,{numColSpan:1}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{className:"mb-2",children:[(0,c.jsx)(k.Z,{children:"Spend by Provider"}),(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(af.Z,{className:"mt-4 h-40",variant:"pie",data:L,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>"$".concat(eD(e,2))})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Provider"}),(0,c.jsx)(sb.Z,{children:"Spend"})]})}),(0,c.jsx)(sv.Z,{children:L.map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.provider}),(0,c.jsx)(s_.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":eD(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"All Up"}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",es(M.sum_api_requests)]}),(0,c.jsx)(sW.Z,{className:"h-40",data:M.daily_data,valueFormatter:es,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",es(M.sum_total_tokens)]}),(0,c.jsx)(s$.Z,{className:"h-40",data:M.daily_data,valueFormatter:es,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,c.jsx)(c.Fragment,{children:F.map((e,s)=>(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:e.model}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",es(e.sum_api_requests)]}),(0,c.jsx)(sW.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:es,onValueChange:e=>console.log(e)})]}),(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",es(e.sum_total_tokens)]}),(0,c.jsx)(s$.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:es,onValueChange:e=>console.log(e)})]})]})]},s))})]})})]})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(W.Z,{className:"mb-2",children:[(0,c.jsx)(k.Z,{children:"Total Spend Per Team"}),(0,c.jsx)(rC.Z,{data:E})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend Per Team"}),(0,c.jsx)(s$.Z,{className:"h-72",data:b,showLegend:!0,index:"date",categories:P,yAxisWidth:80,stack:!0})]})]}),(0,c.jsx)(f.Z,{numColSpan:2})]})}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls ",(0,c.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:K,onValueChange:e=>{B(e),el(e.from,e.to,null)}})}),(0,c.jsxs)(f.Z,{children:[(0,c.jsx)(w.Z,{children:"Select Key"}),(0,c.jsxs)(eH.Z,{defaultValue:"all-keys",children:[(0,c.jsx)(ed.Z,{value:"all-keys",onClick:()=>{el(K.from,K.to,null)},children:"All Keys"},"all-keys"),null==r?void 0:r.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,c.jsx)(ed.Z,{value:String(s),onClick:()=>{el(K.from,K.to,e.token)},children:e.key_alias},s):null)]})]})]}),(0,c.jsx)(W.Z,{className:"mt-4",children:(0,c.jsxs)(sf.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Customer"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{children:"Total Events"})]})}),(0,c.jsx)(sv.Z,{children:null==j?void 0:j.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.end_user}),(0,c.jsx)(s_.Z,{children:eD(e.total_spend,2)}),(0,c.jsx)(s_.Z,{children:e.total_count})]},s))})]})})]}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(sY,{className:"mb-4",value:K,onValueChange:e=>{B(e),ea(e.from,e.to)}})}),(0,c.jsx)(f.Z,{children:i?(0,c.jsx)("div",{children:(0,c.jsxs)(lG.Z,{value:z,onValueChange:e=>V(e),children:[(0,c.jsx)(lH.Z,{value:"all-tags",onClick:()=>V(["all-tags"]),children:"All Tags"},"all-tags"),C&&C.filter(e=>"all-tags"!==e).map((e,s)=>(0,c.jsx)(lH.Z,{value:String(e),children:e},e))]})}):(0,c.jsx)("div",{children:(0,c.jsxs)(lG.Z,{value:z,onValueChange:e=>V(e),children:[(0,c.jsx)(lH.Z,{value:"all-tags",onClick:()=>V(["all-tags"]),children:"All Tags"},"all-tags"),C&&C.filter(e=>"all-tags"!==e).map((e,s)=>(0,c.jsxs)(ed.Z,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Spend Per Tag"}),(0,c.jsxs)(w.Z,{children:["Get Started by Tracking cost per tag ",(0,c.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,c.jsx)(s$.Z,{className:"h-72",data:Z,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,c.jsx)(f.Z,{numColSpan:2})]})]})]})]})})},rA=t(51853);let rE=e=>{let{responseTimeMs:s}=e;return null==s?null:(0,c.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-500 font-mono",children:[(0,c.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{d:"M12 6V12L16 14M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,c.jsxs)("span",{children:[s.toFixed(0),"ms"]})]})},rT=e=>{let s=e;if("string"==typeof s)try{s=JSON.parse(s)}catch(e){}return s},rL=e=>{let{label:s,value:t}=e,[l,a]=d.useState(!1),[r,i]=d.useState(!1),n=(null==t?void 0:t.toString())||"N/A",o=n.length>50?n.substring(0,50)+"...":n;return(0,c.jsx)("tr",{className:"hover:bg-gray-50",children:(0,c.jsx)("td",{className:"px-4 py-2 align-top",colSpan:2,children:(0,c.jsxs)("div",{className:"flex items-center justify-between group",children:[(0,c.jsxs)("div",{className:"flex items-center flex-1",children:[(0,c.jsx)("button",{onClick:()=>a(!l),className:"text-gray-400 hover:text-gray-600 mr-2",children:l?"▼":"▶"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-sm text-gray-600",children:s}),(0,c.jsx)("pre",{className:"mt-1 text-sm font-mono text-gray-800 whitespace-pre-wrap",children:l?n:o})]})]}),(0,c.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2e3)},className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-gray-600",children:(0,c.jsx)(rA.Z,{className:"h-4 w-4"})})]})})})},rO=e=>{var s,t,l,a,r,i,n,o,d,m,u,x,h,p;let{response:g}=e,j=null,f={},v={};try{if(null==g?void 0:g.error)try{let e="string"==typeof g.error.message?JSON.parse(g.error.message):g.error.message;j={message:(null==e?void 0:e.message)||"Unknown error",traceback:(null==e?void 0:e.traceback)||"No traceback available",litellm_params:(null==e?void 0:e.litellm_cache_params)||{},health_check_cache_params:(null==e?void 0:e.health_check_cache_params)||{}},f=rT(j.litellm_params)||{},v=rT(j.health_check_cache_params)||{}}catch(e){console.warn("Error parsing error details:",e),j={message:String(g.error.message||"Unknown error"),traceback:"Error parsing details",litellm_params:{},health_check_cache_params:{}}}else f=rT(null==g?void 0:g.litellm_cache_params)||{},v=rT(null==g?void 0:g.health_check_cache_params)||{}}catch(e){console.warn("Error in response parsing:",e),f={},v={}}let _={redis_host:(null==v?void 0:null===(l=v.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==v?void 0:null===(i=v.redis_async_client)||void 0===i?void 0:null===(r=i.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host)||(null==v?void 0:null===(n=v.connection_kwargs)||void 0===n?void 0:n.host)||(null==v?void 0:v.host)||"N/A",redis_port:(null==v?void 0:null===(m=v.redis_client)||void 0===m?void 0:null===(d=m.connection_pool)||void 0===d?void 0:null===(o=d.connection_kwargs)||void 0===o?void 0:o.port)||(null==v?void 0:null===(h=v.redis_async_client)||void 0===h?void 0:null===(x=h.connection_pool)||void 0===x?void 0:null===(u=x.connection_kwargs)||void 0===u?void 0:u.port)||(null==v?void 0:null===(p=v.connection_kwargs)||void 0===p?void 0:p.port)||(null==v?void 0:v.port)||"N/A",redis_version:(null==v?void 0:v.redis_version)||"N/A",startup_nodes:(()=>{try{var e,s,t,l,a,r,i,n,o,c,d,m,u;if(null==v?void 0:null===(e=v.redis_kwargs)||void 0===e?void 0:e.startup_nodes)return JSON.stringify(v.redis_kwargs.startup_nodes);let x=(null==v?void 0:null===(l=v.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==v?void 0:null===(i=v.redis_async_client)||void 0===i?void 0:null===(r=i.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host),h=(null==v?void 0:null===(c=v.redis_client)||void 0===c?void 0:null===(o=c.connection_pool)||void 0===o?void 0:null===(n=o.connection_kwargs)||void 0===n?void 0:n.port)||(null==v?void 0:null===(u=v.redis_async_client)||void 0===u?void 0:null===(m=u.connection_pool)||void 0===m?void 0:null===(d=m.connection_kwargs)||void 0===d?void 0:d.port);return x&&h?JSON.stringify([{host:x,port:h}]):"N/A"}catch(e){return"N/A"}})(),namespace:(null==v?void 0:v.namespace)||"N/A"};return(0,c.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"border-b border-gray-200 px-4",children:[(0,c.jsx)(eY.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Summary"}),(0,c.jsx)(eY.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Raw Response"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{className:"p-4",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-6",children:[(null==g?void 0:g.status)==="healthy"?(0,c.jsx)(eZ.Z,{className:"h-5 w-5 text-green-500 mr-2"}):(0,c.jsx)(eN.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsxs)(w.Z,{className:"text-sm font-medium ".concat((null==g?void 0:g.status)==="healthy"?"text-green-500":"text-red-500"),children:["Cache Status: ",(null==g?void 0:g.status)||"unhealthy"]})]}),(0,c.jsx)("table",{className:"w-full border-collapse",children:(0,c.jsxs)("tbody",{children:[j&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold text-red-600",children:"Error Details"})}),(0,c.jsx)(rL,{label:"Error Message",value:j.message}),(0,c.jsx)(rL,{label:"Traceback",value:j.traceback})]}),(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Cache Details"})}),(0,c.jsx)(rL,{label:"Cache Configuration",value:String(null==f?void 0:f.type)}),(0,c.jsx)(rL,{label:"Ping Response",value:String(g.ping_response)}),(0,c.jsx)(rL,{label:"Set Cache Response",value:g.set_cache_response||"N/A"}),(0,c.jsx)(rL,{label:"litellm_settings.cache_params",value:JSON.stringify(f,null,2)}),(null==f?void 0:f.type)==="redis"&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Redis Details"})}),(0,c.jsx)(rL,{label:"Redis Host",value:_.redis_host||"N/A"}),(0,c.jsx)(rL,{label:"Redis Port",value:_.redis_port||"N/A"}),(0,c.jsx)(rL,{label:"Redis Version",value:_.redis_version||"N/A"}),(0,c.jsx)(rL,{label:"Startup Nodes",value:_.startup_nodes||"N/A"}),(0,c.jsx)(rL,{label:"Namespace",value:_.namespace||"N/A"})]})]})})]})}),(0,c.jsx)(eQ.Z,{className:"p-4",children:(0,c.jsx)("div",{className:"bg-gray-50 rounded-md p-4 font-mono text-sm",children:(0,c.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto max-h-[500px]",children:(()=>{try{let e={...g,litellm_cache_params:f,health_check_cache_params:v},s=JSON.parse(JSON.stringify(e,(e,s)=>{if("string"==typeof s)try{return JSON.parse(s)}catch(e){}return s}));return JSON.stringify(s,null,2)}catch(e){return"Error formatting JSON: "+e.message}})()})})})]})]})})},rM=e=>{let{accessToken:s,healthCheckResponse:t,runCachingHealthCheck:l,responseTimeMs:a}=e,[r,i]=d.useState(null),[n,o]=d.useState(!1),m=async()=>{o(!0);let e=performance.now();await l(),i(performance.now()-e),o(!1)};return(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)(_.Z,{onClick:m,disabled:n,className:"bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 text-white text-sm px-4 py-2 rounded-md",children:n?"Running Health Check...":"Run Health Check"}),(0,c.jsx)(rE,{responseTimeMs:r})]}),t&&(0,c.jsx)(rO,{response:t})]})},rD=e=>{if(e)return e.toISOString().split("T")[0]};function rF(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}var rR=e=>{let{accessToken:s,token:t,userRole:l,userID:a,premiumUser:r}=e,[i,n]=(0,d.useState)([]),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,_]=(0,d.useState)("0"),[y,b]=(0,d.useState)("0"),[N,Z]=(0,d.useState)("0"),[k,S]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[C,I]=(0,d.useState)(""),[A,E]=(0,d.useState)("");(0,d.useEffect)(()=>{s&&k&&((async()=>{p(await (0,g.adminGlobalCacheActivity)(s,rD(k.from),rD(k.to)))})(),I(new Date().toLocaleString()))},[s]);let T=Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.api_key)&&void 0!==s?s:""}))),L=Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.model)&&void 0!==s?s:""})));Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.call_type)&&void 0!==s?s:""})));let O=async(e,t)=>{e&&t&&s&&p(await (0,g.adminGlobalCacheActivity)(s,rD(e),rD(t)))};(0,d.useEffect)(()=>{console.log("DATA IN CACHE DASHBOARD",h);let e=h;o.length>0&&(e=e.filter(e=>o.includes(e.api_key))),u.length>0&&(e=e.filter(e=>u.includes(e.model))),console.log("before processed data in cache dashboard",e);let s=0,t=0,l=0,a=e.reduce((e,a)=>{console.log("Processing item:",a),a.call_type||(console.log("Item has no call_type:",a),a.call_type="Unknown"),s+=(a.total_rows||0)-(a.cache_hit_true_rows||0),t+=a.cache_hit_true_rows||0,l+=a.cached_completion_tokens||0;let r=e.find(e=>e.name===a.call_type);return r?(r["LLM API requests"]+=(a.total_rows||0)-(a.cache_hit_true_rows||0),r["Cache hit"]+=a.cache_hit_true_rows||0,r["Cached Completion Tokens"]+=a.cached_completion_tokens||0,r["Generated Completion Tokens"]+=a.generated_completion_tokens||0):e.push({name:a.call_type,"LLM API requests":(a.total_rows||0)-(a.cache_hit_true_rows||0),"Cache hit":a.cache_hit_true_rows||0,"Cached Completion Tokens":a.cached_completion_tokens||0,"Generated Completion Tokens":a.generated_completion_tokens||0}),e},[]);_(rF(t)),b(rF(l));let r=t+s;r>0?Z((t/r*100).toFixed(2)):Z("0"),n(a),console.log("PROCESSED DATA IN CACHE DASHBOARD",a)},[o,u,k,h]);let M=async()=>{try{P.ZP.info("Running cache health check..."),E("");let e=await (0,g.cachingHealthCheckCall)(null!==s?s:"");console.log("CACHING HEALTH CHECK RESPONSE",e),E(e)}catch(s){let e;if(console.error("Error running health check:",s),s&&s.message)try{let t=JSON.parse(s.message);t.error&&(t=t.error),e=t}catch(t){e={message:s.message}}else e={message:"Unknown error occurred"};E({error:e})}};return(0,c.jsxs)(eW.Z,{className:"gap-2 p-8 h-full w-full mt-2 mb-8",children:[(0,c.jsxs)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eY.Z,{children:"Cache Analytics"}),(0,c.jsx)(eY.Z,{children:(0,c.jsx)("pre",{children:"Cache Health"})})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[C&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",C]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center",onClick:()=>{I(new Date().toLocaleString())}})]})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(v.Z,{numItems:3,className:"gap-4 mt-4",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(lG.Z,{placeholder:"Select API Keys",value:o,onValueChange:m,children:T.map(e=>(0,c.jsx)(lH.Z,{value:e,children:e},e))})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(lG.Z,{placeholder:"Select Models",value:u,onValueChange:x,children:L.map(e=>(0,c.jsx)(lH.Z,{value:e,children:e},e))})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:k,onValueChange:e=>{S(e),O(e.from,e.to)}})})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hit Ratio"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsxs)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[N,"%"]})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hits"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:j})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cached Tokens"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:y})})]})]}),(0,c.jsx)(sT.Z,{className:"mt-4",children:"Cache Hits vs API Requests"}),(0,c.jsx)(s$.Z,{title:"Cache Hits vs API Requests",data:i,stack:!0,index:"name",valueFormatter:rF,categories:["LLM API requests","Cache hit"],colors:["sky","teal"],yAxisWidth:48}),(0,c.jsx)(sT.Z,{className:"mt-4",children:"Cached Completion Tokens vs Generated Completion Tokens"}),(0,c.jsx)(s$.Z,{className:"mt-6",data:i,stack:!0,index:"name",valueFormatter:rF,categories:["Generated Completion Tokens","Cached Completion Tokens"],colors:["sky","teal"],yAxisWidth:48})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(rM,{accessToken:s,healthCheckResponse:A,runCachingHealthCheck:M})})]})]})},rq=t(91810),rU=t(3810);(a=n||(n={})).PresidioPII="Presidio PII",a.Bedrock="Bedrock Guardrail",a.Lakera="Lakera";let rz={},rV=e=>{let s={};return s.PresidioPII="Presidio PII",s.Bedrock="Bedrock Guardrail",s.Lakera="Lakera",Object.entries(e).forEach(e=>{let[t,l]=e;l&&"object"==typeof l&&"ui_friendly_name"in l&&(s[t.split("_").map((e,s)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l.ui_friendly_name)}),rz=s,s},rK=()=>Object.keys(rz).length>0?rz:n,rB={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2"},rG=e=>{Object.entries(e).forEach(e=>{let[s,t]=e;t&&"object"==typeof t&&"ui_friendly_name"in t&&(rB[s.split("_").map((e,s)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=s)})},rH=e=>!!e&&"Presidio PII"===rK()[e],rJ="../ui/assets/logos/",rY={"Presidio PII":"".concat(rJ,"presidio.png"),"Bedrock Guardrail":"".concat(rJ,"bedrock.svg"),Lakera:"".concat(rJ,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(rJ,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(rJ,"presidio.png")},rW=e=>{if(!e)return{logo:"",displayName:"-"};let s=Object.keys(rB).find(s=>rB[s].toLowerCase()===e.toLowerCase());if(!s)return{logo:"",displayName:e};let t=rK()[s];return{logo:rY[t]||"",displayName:t||e}};var r$=t(33866),rQ=t(97416),rX=t(8881),r0=t(10798),r1=t(49638);let{Text:r2}=em.default,{Option:r4}=C.default,r5=e=>e.replace(/_/g," "),r6=e=>{switch(e){case"MASK":return(0,c.jsx)(rQ.Z,{style:{marginRight:4}});case"BLOCK":return(0,c.jsx)(rX.Z,{style:{marginRight:4}});default:return null}},r3=e=>{let{categories:s,selectedCategories:t,onChange:l}=e;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)(r0.Z,{className:"text-gray-500 mr-1"}),(0,c.jsx)(r2,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:l,value:t,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,c.jsx)(rU.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:s.map(e=>(0,c.jsx)(r4,{value:e.category,children:e.category},e.category))})]})},r8=e=>{let{onSelectAll:s,onUnselectAll:t,hasSelectedEntities:l}=e;return(0,c.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(r2,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,c.jsx)(z.Z,{title:"Apply action to all PII types at once",children:(0,c.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,c.jsx)(T.ZP,{type:"default",onClick:t,disabled:!l,icon:(0,c.jsx)(r1.Z,{}),className:"border-gray-300 hover:text-red-600 hover:border-red-300",children:"Unselect All"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsx)(T.ZP,{type:"default",onClick:()=>s("MASK"),className:"flex items-center justify-center h-10 border-blue-200 hover:border-blue-300 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 text-blue-600",block:!0,icon:(0,c.jsx)(rQ.Z,{}),children:"Select All & Mask"}),(0,c.jsx)(T.ZP,{type:"default",onClick:()=>s("BLOCK"),className:"flex items-center justify-center h-10 border-red-200 hover:border-red-300 hover:text-red-700 bg-red-50 hover:bg-red-100 text-red-600",block:!0,icon:(0,c.jsx)(rX.Z,{}),children:"Select All & Block"})]})]})},r7=e=>{let{entities:s,selectedEntities:t,selectedActions:l,actions:a,onEntitySelect:r,onActionSelect:i,entityToCategoryMap:n}=e;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,c.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,c.jsx)(r2,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,c.jsx)(r2,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,c.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===s.length?(0,c.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):s.map(e=>(0,c.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(t.includes(e)?"bg-blue-50":""),children:[(0,c.jsxs)("div",{className:"flex items-center flex-1",children:[(0,c.jsx)(s2.Z,{checked:t.includes(e),onChange:()=>r(e),className:"mr-3"}),(0,c.jsx)(r2,{className:t.includes(e)?"font-medium text-gray-900":"text-gray-700",children:r5(e)}),n.get(e)&&(0,c.jsx)(rU.Z,{className:"ml-2 text-xs",color:"blue",children:n.get(e)})]}),(0,c.jsx)("div",{className:"w-32",children:(0,c.jsx)(C.default,{value:t.includes(e)&&l[e]||"MASK",onChange:s=>i(e,s),style:{width:120},disabled:!t.includes(e),className:"".concat(t.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:a.map(e=>(0,c.jsx)(r4,{value:e,children:(0,c.jsxs)("div",{className:"flex items-center",children:[r6(e),e]})},e))})})]},e))})]})},{Title:r9,Text:ie}=em.default;var is=e=>{let{entities:s,actions:t,selectedEntities:l,selectedActions:a,onEntitySelect:r,onActionSelect:i,entityCategories:n=[]}=e,[o,m]=(0,d.useState)([]),u=new Map;n.forEach(e=>{e.entities.forEach(s=>{u.set(s,e.category)})});let x=s.filter(e=>0===o.length||o.includes(u.get(e)||""));return(0,c.jsxs)("div",{className:"pii-configuration",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)(r9,{level:4,className:"mb-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,c.jsx)(r$.Z,{count:l.length,showZero:!0,style:{backgroundColor:l.length>0?"#4f46e5":"#d9d9d9"},overflowCount:999,children:(0,c.jsxs)(ie,{className:"text-gray-500",children:[l.length," items selected"]})})]}),(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsx)(r3,{categories:n,selectedCategories:o,onChange:m}),(0,c.jsx)(r8,{onSelectAll:e=>{s.forEach(s=>{l.includes(s)||r(s),i(s,e)})},onUnselectAll:()=>{l.forEach(e=>{r(e)})},hasSelectedEntities:l.length>0})]}),(0,c.jsx)(r7,{entities:x,selectedEntities:l,selectedActions:a,actions:t,onEntitySelect:r,onActionSelect:i,entityToCategoryMap:u})]})},it=e=>{var s;let{selectedProvider:t,accessToken:l,providerParams:a=null,value:r=null}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(a),[u,x]=(0,d.useState)(null);if((0,d.useEffect)(()=>{if(a){m(a);return}let e=async()=>{if(l){n(!0),x(null);try{let e=await (0,g.getGuardrailProviderSpecificParams)(l);console.log("Provider params API response:",e),m(e),rV(e),rG(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{n(!1)}}};a||e()},[l,a]),!t)return null;if(i)return(0,c.jsx)(lm.Z,{tip:"Loading provider parameters..."});if(u)return(0,c.jsx)("div",{className:"text-red-500",children:u});let h=null===(s=rB[t])||void 0===s?void 0:s.toLowerCase(),p=o&&o[h];if(console.log("Provider key:",h),console.log("Provider fields:",p),!p||0===Object.keys(p).length)return(0,c.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",r);let j=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[l,a]=e,i=s?"".concat(s,".").concat(l):l,n=t?t[l]:null==r?void 0:r[l];return(console.log("Field value:",n),"ui_friendly_name"===l||"optional_params"===l&&"nested"===a.type&&a.fields)?null:"nested"===a.type&&a.fields?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"mb-2 font-medium",children:l}),(0,c.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:j(a.fields,i,n)})]},i):(0,c.jsx)(I.Z.Item,{name:i,label:l,tooltip:a.description,rules:a.required?[{required:!0,message:"".concat(l," is required")}]:void 0,children:"select"===a.type&&a.options?(0,c.jsx)(C.default,{placeholder:a.description,defaultValue:n||a.default_value,children:a.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"multiselect"===a.type&&a.options?(0,c.jsx)(C.default,{mode:"multiple",placeholder:a.description,defaultValue:n||a.default_value,children:a.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"bool"===a.type||"boolean"===a.type?(0,c.jsxs)(C.default,{placeholder:a.description,defaultValue:void 0!==n?String(n):a.default_value,children:[(0,c.jsx)(C.default.Option,{value:"true",children:"True"}),(0,c.jsx)(C.default.Option,{value:"false",children:"False"})]}):"number"===a.type?(0,c.jsx)(M,{step:1,width:400,placeholder:a.description,defaultValue:void 0!==n?Number(n):void 0}):l.includes("password")||l.includes("secret")||l.includes("key")?(0,c.jsx)(y.Z,{placeholder:a.description,type:"password",defaultValue:n||""}):(0,c.jsx)(y.Z,{placeholder:a.description,type:"text",defaultValue:n||""})},i)})};return(0,c.jsx)(c.Fragment,{children:j(p)})};let{Title:il}=em.default,ia=e=>{let{field:s,fieldKey:t,fullFieldKey:l,value:a}=e,[r,i]=d.useState([]),[n,o]=d.useState(s.dict_key_options||[]);d.useEffect(()=>{if(a&&"object"==typeof a){let e=Object.keys(a);i(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),o((s.dict_key_options||[]).filter(s=>!e.includes(s)))}},[a,s.dict_key_options]);let m=e=>{e&&(i([...r,{key:e,id:"".concat(e,"_").concat(Date.now())}]),o(n.filter(s=>s!==e)))},u=(e,s)=>{i(r.filter(s=>s.id!==e)),o([...n,s].sort())};return(0,c.jsxs)("div",{className:"space-y-3",children:[r.map(e=>(0,c.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,c.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,c.jsx)("div",{className:"flex-1",children:(0,c.jsx)(I.Z.Item,{name:Array.isArray(l)?[...l,e.key]:[l,e.key],style:{marginBottom:0},initialValue:a&&"object"==typeof a?a[e.key]:void 0,normalize:"number"===s.dict_value_type?e=>{if(null==e||""===e)return;let s=Number(e);return isNaN(s)?e:s}:void 0,children:"number"===s.dict_value_type?(0,c.jsx)(M,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===s.dict_value_type?(0,c.jsxs)(C.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,c.jsx)(C.default.Option,{value:!0,children:"True"}),(0,c.jsx)(C.default.Option,{value:!1,children:"False"})]}):(0,c.jsx)(y.Z,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,c.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>u(e.id,e.key),children:"Remove"})]},e.id)),n.length>0&&(0,c.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,c.jsx)(C.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&m(e),value:void 0,children:n.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var ir=e=>{let{optionalParams:s,parentFieldKey:t,values:l}=e,a=(e,s)=>{let a="".concat(t,".").concat(e),r=null==l?void 0:l[e];return(console.log("value",r),"dict"===s.type&&s.dict_key_options)?(0,c.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,c.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,c.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,c.jsx)(ia,{field:s,fieldKey:e,fullFieldKey:[t,e],value:r})]},a):(0,c.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,c.jsx)(I.Z.Item,{name:[t,e],label:(0,c.jsxs)("div",{className:"mb-2",children:[(0,c.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,c.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),rules:s.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==r?r:s.default_value,normalize:"number"===s.type?e=>{if(null==e||""===e)return;let s=Number(e);return isNaN(s)?e:s}:void 0,children:"select"===s.type&&s.options?(0,c.jsx)(C.default,{placeholder:s.description,children:s.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"multiselect"===s.type&&s.options?(0,c.jsx)(C.default,{mode:"multiple",placeholder:s.description,children:s.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"bool"===s.type||"boolean"===s.type?(0,c.jsxs)(C.default,{placeholder:s.description,children:[(0,c.jsx)(C.default.Option,{value:"true",children:"True"}),(0,c.jsx)(C.default.Option,{value:"false",children:"False"})]}):"number"===s.type?(0,c.jsx)(M,{step:1,width:400,placeholder:s.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,c.jsx)(y.Z,{placeholder:s.description,type:"password"}):(0,c.jsx)(y.Z,{placeholder:s.description,type:"text"})})},a)};return s.fields&&0!==Object.keys(s.fields).length?(0,c.jsxs)("div",{className:"guardrail-optional-params",children:[(0,c.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,c.jsx)(il,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,c.jsx)("p",{className:"text-gray-600 text-sm",children:s.description||"Configure additional settings for this guardrail provider"})]}),(0,c.jsx)("div",{className:"space-y-8",children:Object.entries(s.fields).map(e=>{let[s,t]=e;return a(s,t)})})]}):null};let{Title:ii,Text:io,Link:ic}=em.default,{Option:id}=C.default,{Step:im}=rq.default,iu={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call"};var ix=e=>{let{visible:s,onClose:t,accessToken:l,onSuccess:a}=e,[r]=I.Z.useForm(),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)({}),[v,b]=(0,d.useState)(0),[N,Z]=(0,d.useState)(null),[w,k]=(0,d.useState)([]),[S,E]=(0,d.useState)(2),[T,L]=(0,d.useState)({});(0,d.useEffect)(()=>{l&&(async()=>{try{let[e,s]=await Promise.all([(0,g.getGuardrailUISettings)(l),(0,g.getGuardrailProviderSpecificParams)(l)]);x(e),Z(s),rV(s),rG(s)}catch(e){console.error("Error fetching guardrail data:",e),P.ZP.error("Failed to load guardrail configuration")}})()},[l]);let O=e=>{m(e),r.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),p([]),f({}),k([]),E(2),L({})},M=e=>{p(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},D=(e,s)=>{f(t=>({...t,[e]:s}))},F=async()=>{try{if(0===v&&(await r.validateFields(["guardrail_name","provider","mode","default_on"]),o)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===o&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await r.validateFields(e)}if(1===v&&rH(o)&&0===h.length){P.ZP.error("Please select at least one PII entity to continue");return}b(v+1)}catch(e){console.error("Form validation failed:",e)}},R=()=>{r.resetFields(),m(null),p([]),f({}),k([]),E(2),L({}),b(0)},q=()=>{R(),t()},U=async()=>{try{n(!0),await r.validateFields();let s=r.getFieldsValue(!0),i=rB[s.provider],c={guardrail_name:s.guardrail_name,litellm_params:{guardrail:i,mode:s.mode,default_on:s.default_on},guardrail_info:{}};if("PresidioPII"===s.provider&&h.length>0){let e={};h.forEach(s=>{e[s]=j[s]||"MASK"}),c.litellm_params.pii_entities_config=e,s.presidio_analyzer_api_base&&(c.litellm_params.presidio_analyzer_api_base=s.presidio_analyzer_api_base),s.presidio_anonymizer_api_base&&(c.litellm_params.presidio_anonymizer_api_base=s.presidio_anonymizer_api_base)}else if(s.config)try{let e=JSON.parse(s.config);c.guardrail_info=e}catch(e){P.ZP.error("Invalid JSON in configuration"),n(!1);return}if(console.log("values: ",JSON.stringify(s)),N&&o){var e;let t=null===(e=rB[o])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",t);let l=N[t]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(e=>{let t=s[e];if(null==t||""===t){var l;t=null===(l=s.optional_params)||void 0===l?void 0:l[e]}null!=t&&""!==t&&(c.litellm_params[e]=t)})}if(!l)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(c)),await (0,g.createGuardrailCall)(l,c),P.ZP.success("Guardrail created successfully"),R(),a(),t()}catch(e){console.error("Failed to create guardrail:",e),P.ZP.error("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{n(!1)}},z=()=>{var e;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter a name for this guardrail"})}),(0,c.jsx)(I.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{placeholder:"Select a guardrail provider",onChange:O,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(rK()).map(e=>{let[s,t]=e;return(0,c.jsx)(id,{value:s,label:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rY[t]&&(0,c.jsx)("img",{src:rY[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]}),children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rY[t]&&(0,c.jsx)("img",{src:rY[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(I.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,c.jsx)(C.default,{optionLabelProp:"label",mode:"multiple",children:(null==u?void 0:null===(e=u.supported_modes)||void 0===e?void 0:e.map(e=>(0,c.jsx)(id,{value:e,label:e,children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:e}),"pre_call"===e&&(0,c.jsx)(rU.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu[e]})]})},e)))||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(id,{value:"pre_call",label:"pre_call",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:"pre_call"})," ",(0,c.jsx)(rU.Z,{color:"green",children:"Recommended"})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu.pre_call})]})}),(0,c.jsx)(id,{value:"during_call",label:"during_call",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"during_call"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu.during_call})]})}),(0,c.jsx)(id,{value:"post_call",label:"post_call",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"post_call"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu.post_call})]})}),(0,c.jsx)(id,{value:"logging_only",label:"logging_only",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"logging_only"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu.logging_only})]})})]})})}),(0,c.jsx)(I.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:!0,children:"Yes"}),(0,c.jsx)(C.default.Option,{value:!1,children:"No"})]})}),(0,c.jsx)(it,{selectedProvider:o,accessToken:l,providerParams:N})]})},V=()=>u&&"PresidioPII"===o?(0,c.jsx)(is,{entities:u.supported_entities,actions:u.supported_actions,selectedEntities:h,selectedActions:j,onEntitySelect:M,onActionSelect:D,entityCategories:u.pii_entity_categories}):null,K=()=>{var e;if(!o||!N)return null;console.log("guardrail_provider_map: ",rB),console.log("selectedProvider: ",o);let s=null===(e=rB[o])||void 0===e?void 0:e.toLowerCase(),t=N&&N[s];return t&&t.optional_params?(0,c.jsx)(ir,{optionalParams:t.optional_params,parentFieldKey:"optional_params"}):null};return(0,c.jsx)(A.Z,{title:"Add Guardrail",open:s,onCancel:q,footer:null,width:700,children:(0,c.jsxs)(I.Z,{form:r,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,c.jsxs)(rq.default,{current:v,className:"mb-6",children:[(0,c.jsx)(im,{title:"Basic Info"}),(0,c.jsx)(im,{title:rH(o)?"PII Configuration":"Provider Configuration"})]}),(()=>{switch(v){case 0:return z();case 1:if(rH(o))return V();return K();default:return null}})(),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[v>0&&(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{b(v-1)},children:"Previous"}),v<2&&(0,c.jsx)(_.Z,{onClick:F,children:"Next"}),2===v&&(0,c.jsx)(_.Z,{onClick:U,loading:i,children:"Create Guardrail"}),(0,c.jsx)(_.Z,{variant:"secondary",onClick:q,children:"Cancel"})]})]})})};let{Title:ih,Text:ip}=em.default,{Option:ig}=C.default;var ij=e=>{var s;let{visible:t,onClose:l,accessToken:a,onSuccess:r,guardrailId:i,initialValues:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)((null==n?void 0:n.provider)||null),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)([]),[b,N]=(0,d.useState)({});(0,d.useEffect)(()=>{(async()=>{try{if(!a)return;let e=await (0,g.getGuardrailUISettings)(a);j(e)}catch(e){console.error("Error fetching guardrail settings:",e),P.ZP.error("Failed to load guardrail settings")}})()},[a]),(0,d.useEffect)(()=>{(null==n?void 0:n.pii_entities_config)&&Object.keys(n.pii_entities_config).length>0&&(v(Object.keys(n.pii_entities_config)),N(n.pii_entities_config))},[n]);let Z=e=>{v(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},w=(e,s)=>{N(t=>({...t,[e]:s}))},k=async()=>{try{u(!0);let e=await o.validateFields(),s=rB[e.provider],t={guardrail_id:i,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:s,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&f.length>0){let e={};f.forEach(s=>{e[s]=b[s]||"MASK"}),t.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let s=JSON.parse(e.config);"Bedrock"===e.provider&&s?(s.guardrail_id&&(t.guardrail.litellm_params.guardrailIdentifier=s.guardrail_id),s.guardrail_version&&(t.guardrail.litellm_params.guardrailVersion=s.guardrail_version)):t.guardrail.guardrail_info=s}catch(e){P.ZP.error("Invalid JSON in configuration"),u(!1);return}if(!a)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(t));let n=await fetch("/guardrails/".concat(i),{method:"PUT",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw Error(e||"Failed to update guardrail")}P.ZP.success("Guardrail updated successfully"),r(),l()}catch(e){console.error("Failed to update guardrail:",e),P.ZP.error("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{u(!1)}},S=()=>p&&x&&"PresidioPII"===x?(0,c.jsx)(is,{entities:p.supported_entities,actions:p.supported_actions,selectedEntities:f,selectedActions:b,onEntitySelect:Z,onActionSelect:w,entityCategories:p.pii_entity_categories}):null;return(0,c.jsx)(A.Z,{title:"Edit Guardrail",open:t,onCancel:l,footer:null,width:700,children:(0,c.jsxs)(I.Z,{form:o,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter a name for this guardrail"})}),(0,c.jsx)(I.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{placeholder:"Select a guardrail provider",onChange:e=>{h(e),o.setFieldsValue({config:void 0}),v([]),N({})},disabled:!0,optionLabelProp:"label",children:Object.entries(rK()).map(e=>{let[s,t]=e;return(0,c.jsx)(ig,{value:s,label:t,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rY[t]&&(0,c.jsx)("img",{src:rY[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(I.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,c.jsx)(C.default,{children:(null==p?void 0:null===(s=p.supported_modes)||void 0===s?void 0:s.map(e=>(0,c.jsx)(ig,{value:e,children:e},e)))||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ig,{value:"pre_call",children:"pre_call"}),(0,c.jsx)(ig,{value:"post_call",children:"post_call"})]})})}),(0,c.jsx)(I.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,c.jsx)(tn.Z,{})}),(()=>{if(!x)return null;if("PresidioPII"===x)return S();switch(x){case"Aporia":return(0,c.jsx)(I.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,c.jsx)(I.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,c.jsx)(I.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,c.jsx)(I.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,c.jsx)(I.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,c.jsx)(I.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,c.jsx)(I.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:k,loading:m,children:"Update Guardrail"})]})]})})},iv=e=>{let{guardrailsList:s,isLoading:t,onDeleteClick:l,accessToken:a,onGuardrailUpdated:r,isAdmin:i=!1,onGuardrailClick:n}=e,[o,m]=(0,d.useState)([{id:"created_at",desc:!0}]),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(null),g=e=>e?new Date(e).toLocaleString():"-",j=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&n(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.guardrail_name,children:(0,c.jsx)("span",{className:"text-xs font-medium",children:t.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:s}=e,{logo:t,displayName:l}=rW(s.original.litellm_params.guardrail);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:"".concat(l," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)("span",{className:"text-xs",children:l})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var s,t;let{row:l}=e,a=l.original;return(0,c.jsx)(eJ.Z,{color:(null===(s=a.litellm_params)||void 0===s?void 0:s.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(t=a.litellm_params)||void 0===t?void 0:t.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.created_at,children:(0,c.jsx)("span",{className:"text-xs",children:g(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.updated_at,children:(0,c.jsx)("span",{className:"text-xs",children:g(t.updated_at)})})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"flex space-x-2",children:(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>t.guardrail_id&&l(t.guardrail_id,t.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500",tooltip:"Delete guardrail"})})}}],f=(0,sp.b7)({data:s,columns:j,state:{sorting:o},onSortingChange:m,getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0});return(0,c.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sf.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sy.Z,{children:f.getHeaderGroups().map(e=>(0,c.jsx)(sN.Z,{children:e.headers.map(e=>(0,c.jsx)(sb.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(sv.Z,{children:t?(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:j.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"Loading..."})})})}):s.length>0?f.getRowModel().rows.map(e=>(0,c.jsx)(sN.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(s_.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:j.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No guardrails found"})})})})})]})}),h&&(0,c.jsx)(ij,{visible:u,onClose:()=>x(!1),accessToken:a,onSuccess:()=>{x(!1),p(null),r()},guardrailId:h.guardrail_id||"",initialValues:{guardrail_name:h.guardrail_name||"",provider:Object.keys(rB).find(e=>rB[e]===(null==h?void 0:h.litellm_params.guardrail))||"",mode:h.litellm_params.mode,default_on:h.litellm_params.default_on,pii_entities_config:h.litellm_params.pii_entities_config,...h.guardrail_info}})]})},i_=e=>{var s,t,l,a,r,i,n,o,m,u,x;let{guardrailId:h,onClose:p,accessToken:j,isAdmin:f}=e,[b,N]=(0,d.useState)(null),[Z,S]=(0,d.useState)(null),[A,E]=(0,d.useState)(!0),[O,M]=(0,d.useState)(!1),[D]=I.Z.useForm(),[F,R]=(0,d.useState)([]),[q,U]=(0,d.useState)({}),[z,V]=(0,d.useState)(null),[K,B]=(0,d.useState)({}),G=async()=>{try{var e;if(E(!0),!j)return;let s=await (0,g.getGuardrailInfo)(j,h);if(N(s),null===(e=s.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=s.litellm_params.pii_entities_config;if(R([]),U({}),Object.keys(e).length>0){let s=[],t={};Object.entries(e).forEach(e=>{let[l,a]=e;s.push(l),t[l]="string"==typeof a?a:"MASK"}),R(s),U(t)}}else R([]),U({})}catch(e){P.ZP.error("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{E(!1)}},H=async()=>{try{if(!j)return;let e=await (0,g.getGuardrailProviderSpecificParams)(j);S(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},J=async()=>{try{if(!j)return;let e=await (0,g.getGuardrailUISettings)(j);V(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,d.useEffect)(()=>{H()},[j]),(0,d.useEffect)(()=>{G(),J()},[h,j]),(0,d.useEffect)(()=>{if(b&&D){var e;D.setFieldsValue({guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(e=b.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:b.litellm_params.optional_params}})}},[b,Z,D]);let $=async e=>{try{var s,t,l;if(!j)return;let a={litellm_params:{}};e.guardrail_name!==b.guardrail_name&&(a.guardrail_name=e.guardrail_name),e.default_on!==(null===(s=b.litellm_params)||void 0===s?void 0:s.default_on)&&(a.litellm_params.default_on=e.default_on);let r=b.guardrail_info,i=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(r)!==JSON.stringify(i)&&(a.guardrail_info=i);let n=(null===(t=b.litellm_params)||void 0===t?void 0:t.pii_entities_config)||{},o={};F.forEach(e=>{o[e]=q[e]||"MASK"}),JSON.stringify(n)!==JSON.stringify(o)&&(a.litellm_params.pii_entities_config=o);let c=Object.keys(rB).find(e=>{var s;return rB[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)});if(console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",c),Z&&c){let s=Z[null===(l=rB[c])||void 0===l?void 0:l.toLowerCase()]||{},t=new Set;console.log("providerSpecificParams: ",JSON.stringify(s)),Object.keys(s).forEach(e=>{"optional_params"!==e&&t.add(e)}),s.optional_params&&s.optional_params.fields&&Object.keys(s.optional_params.fields).forEach(e=>{t.add(e)}),console.log("allowedParams: ",t),t.forEach(s=>{var t,l;let r=e[s];(null==r||""===r)&&(r=null===(l=e.optional_params)||void 0===l?void 0:l[s]);let i=null===(t=b.litellm_params)||void 0===t?void 0:t[s];JSON.stringify(r)!==JSON.stringify(i)&&(null!=r&&""!==r?a.litellm_params[s]=r:null!=i&&""!==i&&(a.litellm_params[s]=null))})}if(0===Object.keys(a.litellm_params).length&&delete a.litellm_params,0===Object.keys(a).length){P.ZP.info("No changes detected"),M(!1);return}await (0,g.updateGuardrailCall)(j,h,a),P.ZP.success("Guardrail updated successfully"),G(),M(!1)}catch(e){console.error("Error updating guardrail:",e),P.ZP.error("Failed to update guardrail")}};if(A)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!b)return(0,c.jsx)("div",{className:"p-4",children:"Guardrail not found"});let Q=e=>e?new Date(e).toLocaleString():"-",{logo:X,displayName:ee}=rW((null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)||""),es=async(e,s)=>{await eF(e)&&(B(e=>({...e,[s]:!0})),setTimeout(()=>{B(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:p,className:"mb-4",children:"Back to Guardrails"}),(0,c.jsx)(k.Z,{children:b.guardrail_name||"Unnamed Guardrail"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:b.guardrail_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:K["guardrail-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>es(b.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(K["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"},"overview"),f?(0,c.jsx)(eY.Z,{children:"Settings"},"settings"):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Provider"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[X&&(0,c.jsx)("img",{src:X,alt:"".concat(ee," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)(k.Z,{children:ee})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Mode"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:(null===(t=b.litellm_params)||void 0===t?void 0:t.mode)||"-"}),(0,c.jsx)(eJ.Z,{color:(null===(l=b.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",children:(null===(a=b.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Created At"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:Q(b.created_at)}),(0,c.jsxs)(w.Z,{children:["Last Updated: ",Q(b.updated_at)]})]})]})]}),(null===(r=b.litellm_params)||void 0===r?void 0:r.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,c.jsx)(W.Z,{className:"mt-6",children:(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"PII Protection"}),(0,c.jsxs)(eJ.Z,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),b.guardrail_info&&Object.keys(b.guardrail_info).length>0&&(0,c.jsxs)(W.Z,{className:"mt-6",children:[(0,c.jsx)(w.Z,{children:"Guardrail Info"}),(0,c.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(b.guardrail_info).map(e=>{let[s,t]=e;return(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(w.Z,{className:"font-medium w-1/3",children:s}),(0,c.jsx)(w.Z,{className:"w-2/3",children:"object"==typeof t?JSON.stringify(t,null,2):String(t)})]},s)})})]})]}),f&&(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Guardrail Settings"}),!O&&(0,c.jsx)(_.Z,{onClick:()=>M(!0),children:"Edit Settings"})]}),O?(0,c.jsxs)(I.Z,{form:D,onFinish:$,initialValues:{guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(i=b.litellm_params)||void 0===i?void 0:i.optional_params)&&{optional_params:b.litellm_params.optional_params}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Default On",name:"default_on",children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:!0,children:"Yes"}),(0,c.jsx)(C.default.Option,{value:!1,children:"No"})]})}),(null===(n=b.litellm_params)||void 0===n?void 0:n.guardrail)==="presidio"&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Y.Z,{orientation:"left",children:"PII Protection"}),(0,c.jsx)("div",{className:"mb-6",children:z&&(0,c.jsx)(is,{entities:z.supported_entities,actions:z.supported_actions,selectedEntities:F,selectedActions:q,onEntitySelect:e=>{R(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},onActionSelect:(e,s)=>{U(t=>({...t,[e]:s}))},entityCategories:z.pii_entity_categories})})]}),(0,c.jsx)(Y.Z,{orientation:"left",children:"Provider Settings"}),(0,c.jsx)(it,{selectedProvider:Object.keys(rB).find(e=>{var s;return rB[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)})||null,accessToken:j,providerParams:Z,value:b.litellm_params}),Z&&(()=>{var e;let s=Object.keys(rB).find(e=>{var s;return rB[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)});if(!s)return null;let t=Z[null===(e=rB[s])||void 0===e?void 0:e.toLowerCase()];return t&&t.optional_params?(0,c.jsx)(ir,{optionalParams:t.optional_params,parentFieldKey:"optional_params",values:b.litellm_params}):null})(),(0,c.jsx)(Y.Z,{orientation:"left",children:"Advanced Settings"}),(0,c.jsx)(I.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,c.jsx)(L.default.TextArea,{rows:5})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,c.jsx)(T.ZP,{onClick:()=>M(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{children:"Save Changes"})]})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Guardrail ID"}),(0,c.jsx)("div",{className:"font-mono",children:b.guardrail_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Guardrail Name"}),(0,c.jsx)("div",{children:b.guardrail_name||"Unnamed Guardrail"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Provider"}),(0,c.jsx)("div",{children:ee})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Mode"}),(0,c.jsx)("div",{children:(null===(o=b.litellm_params)||void 0===o?void 0:o.mode)||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Default On"}),(0,c.jsx)(eJ.Z,{color:(null===(m=b.litellm_params)||void 0===m?void 0:m.default_on)?"green":"gray",children:(null===(u=b.litellm_params)||void 0===u?void 0:u.default_on)?"Yes":"No"})]}),(null===(x=b.litellm_params)||void 0===x?void 0:x.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"PII Protection"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(eJ.Z,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:Q(b.created_at)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)("div",{children:Q(b.updated_at)})]})]})]})})]})]})]})},iy=e=>{let{accessToken:s,userRole:t}=e,[l,a]=(0,d.useState)([]),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),f=!!t&&(0,eE.tY)(t),v=async()=>{if(s){o(!0);try{let e=await (0,g.getGuardrailsList)(s);console.log("guardrails: ".concat(JSON.stringify(e))),a(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{o(!1)}}};(0,d.useEffect)(()=>{v()},[s]);let y=async()=>{if(x&&s){u(!0);try{await (0,g.deleteGuardrailCall)(s,x.id),P.ZP.success('Guardrail "'.concat(x.name,'" deleted successfully')),v()}catch(e){console.error("Error deleting guardrail:",e),P.ZP.error("Failed to delete guardrail")}finally{u(!1),h(null)}}};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(_.Z,{onClick:()=>{p&&j(null),i(!0)},disabled:!s,children:"+ Add New Guardrail"})}),p?(0,c.jsx)(i_,{guardrailId:p,onClose:()=>j(null),accessToken:s,isAdmin:f}):(0,c.jsx)(iv,{guardrailsList:l,isLoading:n,onDeleteClick:(e,s)=>{h({id:e,name:s})},accessToken:s,onGuardrailUpdated:v,isAdmin:f,onGuardrailClick:e=>j(e)}),(0,c.jsx)(ix,{visible:r,onClose:()=>{i(!1)},accessToken:s,onSuccess:()=>{v()}}),x&&(0,c.jsxs)(A.Z,{title:"Delete Guardrail",open:null!==x,onOk:y,onCancel:()=>{h(null)},confirmLoading:m,okText:"Delete",okButtonProps:{danger:!0},children:[(0,c.jsxs)("p",{children:["Are you sure you want to delete guardrail: ",x.name," ?"]}),(0,c.jsx)("p",{children:"This action cannot be undone."})]})]})},ib=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[a,r]=(0,d.useState)(""),[i,n]=(0,d.useState)(!1),o=(e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")},m=async()=>{n(!0);try{let e;try{e=JSON.parse(t)}catch(e){P.ZP.error("Invalid JSON in request body"),n(!1);return}let l={call_type:"completion",request_body:e};if(!s){P.ZP.error("No access token found"),n(!1);return}let a=await (0,g.transformRequestCall)(s,l);if(a.raw_request_api_base&&a.raw_request_body){let e=o(a.raw_request_api_base,a.raw_request_body,a.raw_request_headers||{});r(e),P.ZP.success("Request transformed successfully")}else{let e="string"==typeof a?a:JSON.stringify(a);r(e),P.ZP.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),P.ZP.error("Failed to transform request")}finally{n(!1)}};return(0,c.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,c.jsx)(k.Z,{children:"Playground"}),(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,c.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,c.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,c.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,c.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,c.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,c.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>l(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),m())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,c.jsxs)(T.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:m,loading:i,children:[(0,c.jsx)("span",{children:"Transform"}),(0,c.jsx)("span",{children:"→"})]})})]}),(0,c.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,c.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,c.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,c.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,c.jsx)("br",{}),(0,c.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,c.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,c.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:a||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,c.jsx)(T.ZP,{type:"text",icon:(0,c.jsx)(tC.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(a||""),P.ZP.success("Copied to clipboard")}})]})]})]}),(0,c.jsx)("div",{className:"mt-4 text-right w-full",children:(0,c.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue ",(0,c.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})};let iN=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let t=e.split("/mcp/");if(2!==t.length)return{token:null,baseUrl:e};let l=t[0]+"/mcp/",a=t[1];if(!a)return{token:null,baseUrl:e};return{token:a,baseUrl:l}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},iZ=e=>{let{token:s,baseUrl:t}=iN(e);return s?t+"...":e},iw=e=>{let{token:s}=iN(e);return{maskedUrl:iZ(e),hasToken:!!s}},ik=(e,s,t,l)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:t}=e;return(0,c.jsxs)("button",{onClick:()=>s(t.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[t.original.server_id.slice(0,7),"..."]})}},{accessorKey:"server_name",header:"Name"},{accessorKey:"alias",header:"Alias"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:t}=iw(s.original.url);return(0,c.jsx)("span",{className:"font-mono text-sm",children:t})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,c.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,c.jsx)("span",{children:s()||"none"})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,t=s.original.mcp_access_groups;if(Array.isArray(t)&&t.length>0&&"string"==typeof t[0]){let e=t.join(", ");return(0,c.jsx)(z.Z,{title:e,children:(0,c.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,c.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.created_at?new Date(t.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.updated_at?new Date(t.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>t(s.original.server_id),className:"cursor-pointer"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>l(s.original.server_id),className:"cursor-pointer"})]})}}];var iS=t(82376),iC=t(71437);let iI={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic"},iP={SSE:"sse"},iA=e=>(console.log(e),null==e)?iP.SSE:e,iE=e=>null==e?iI.NONE:e,iT=e=>iE(e)!==iI.NONE;var iL=t(62670),iO=e=>{let{value:s={},onChange:t,tools:l=[],disabled:a=!1}=e,r=(e,l)=>{let a={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:l}};null==t||t(a)};return(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,c.jsx)(iL.Z,{className:"text-green-600"}),(0,c.jsx)(k.Z,{children:"Cost Configuration"}),(0,c.jsx)(z.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,c.jsx)(z.Z,{title:"Default cost charged for each tool call to this server.",children:(0,c.jsx)(U.Z,{className:"ml-1 text-gray-400"})})]}),(0,c.jsx)(q.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let l={...s,default_cost_per_query:e};null==t||t(l)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,c.jsx)(w.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),l.length>0&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,c.jsx)(z.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,c.jsx)(U.Z,{className:"ml-1 text-gray-400"})})]}),(0,c.jsx)(tx.default,{items:[{key:"1",label:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-2 text-blue-500"}),(0,c.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,c.jsx)(r$.Z,{count:l.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,c.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:l.map((e,t)=>{var l;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,c.jsx)("div",{className:"ml-4",children:(0,c.jsx)(q.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(l=s.tool_name_to_cost_per_query)||void 0===l?void 0:l[e.name],onChange:s=>r(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},t)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,c.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,c.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,t]=e;return null!=t&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• ",s,": $",t.toFixed(4)," per query"]},s)})]})]})]})})},iM=e=>{let{mcpServer:s,accessToken:t,onCancel:l,onSuccess:a,availableAccessGroups:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)({}),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(!1);(0,d.useEffect)(()=>{var e;(null===(e=s.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&o(s.mcp_info.mcp_server_cost_info)},[s]),(0,d.useEffect)(()=>{if(s.mcp_access_groups){let e=s.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));i.setFieldValue("mcp_access_groups",e)}},[s]),(0,d.useEffect)(()=>{b()},[s,t]);let b=async()=>{if(t&&s.url){h(!0);try{let e={server_id:s.server_id,server_name:s.server_name,url:s.url,transport:s.transport,spec_version:s.spec_version,auth_type:s.auth_type,mcp_info:s.mcp_info},l=await (0,g.testMCPToolsListRequest)(t,e);l.tools&&!l.error?u(l.tools):(console.error("Failed to fetch tools:",l.message),u([]))}catch(e){console.error("Tools fetch error:",e),u([])}finally{h(!1)}}},N=async e=>{if(t)try{let l=(e.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),r={...e,server_id:s.server_id,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(n).length>0?n:null},mcp_access_groups:l,alias:e.alias},i=await (0,g.updateMCPServer)(t,r);P.ZP.success("MCP Server updated successfully"),a(i)}catch(e){P.ZP.error("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"grid w-full grid-cols-2",children:[(0,c.jsx)(eY.Z,{children:"Server Configuration"}),(0,c.jsx)(eY.Z,{children:"Cost Configuration"})]}),(0,c.jsxs)(eX.Z,{className:"mt-6",children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:N,initialValues:s,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Alias",name:"alias",rules:[{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{onChange:()=>v(!0)})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,c.jsx)(C.default.Option,{value:"http",children:"HTTP"})]})}),(0,c.jsx)(I.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"none",children:"None"}),(0,c.jsx)(C.default.Option,{value:"api_key",children:"API Key"}),(0,c.jsx)(C.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,c.jsx)(C.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,c.jsx)(I.Z.Item,{label:"MCP Version",name:"spec_version",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"2025-03-26",children:"2025-03-26 (Latest)"}),(0,c.jsx)(C.default.Option,{value:"2024-11-05",children:"2024-11-05"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,c.jsx)(z.Z,{title:"Define access groups for this MCP server. Each group represents a set of permissions.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",getValueFromEvent:e=>e,children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},showSearch:!0,placeholder:"Add or select access groups",tokenSeparators:[","],optionFilterProp:"value",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.value)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>j(e),options:(()=>{let e=r.map(e=>({value:e,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})}));return p&&!r.some(e=>e.toLowerCase().includes(p.toLowerCase()))&&e.push({value:p,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:p}),(0,c.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e})(),getPopupContainer:e=>e.parentNode})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,c.jsx)(T.ZP,{onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsx)(iO,{value:n,onChange:o,tools:m,disabled:x}),(0,c.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,c.jsx)(T.ZP,{onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:()=>i.submit(),children:"Save Changes"})]})]})})]})]})},iD=e=>{let{costConfig:s}=e,t=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,l=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return t||l?(0,c.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,c.jsxs)("div",{className:"space-y-4",children:[t&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Default Cost per Query"}),(0,c.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Tool-Specific Costs"}),(0,c.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,t]=e;return null!=t&&(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:s}),(0,c.jsxs)(w.Z,{className:"text-green-600 font-mono",children:["$",t.toFixed(4)," per query"]})]},s)})})]}),(0,c.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,c.jsxs)("div",{className:"mt-2 space-y-1",children:[t&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,c.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,c.jsx)("div",{className:"space-y-4",children:(0,c.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,c.jsx)(w.Z,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})};let iF=e=>{var s,t,l,a;let{mcpServer:r,onBack:i,isEditing:n,isProxyAdmin:o,accessToken:m,userRole:u,userID:x,availableAccessGroups:h}=e,[p,g]=(0,d.useState)(n),[j,f]=(0,d.useState)(!1),[y,b]=(0,d.useState)({}),{maskedUrl:N,hasToken:Z}=iw(r.url),S=(e,s)=>Z?s?e:N:e,C=async(e,s)=>{await eF(e)&&(b(e=>({...e,[s]:!0})),setTimeout(()=>{b(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4 max-w-full",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",className:"mb-4",onClick:i,children:"Back to All Servers"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(k.Z,{children:r.server_name}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-server_name"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>C(r.server_name,"mcp-server_name"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),r.alias&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"ml-4 text-gray-500",children:"Alias:"}),(0,c.jsx)("span",{className:"ml-1 font-mono text-blue-600",children:r.alias}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-alias"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>C(r.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:r.server_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-server-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>C(r.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:p?2:0,children:[(0,c.jsx)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"},"overview"),(0,c.jsx)(eY.Z,{children:"MCP Tools"},"tools"),...o?[(0,c.jsx)(eY.Z,{children:"Settings"},"settings")]:[]]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Transport"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{children:iA(null!==(l=r.transport)&&void 0!==l?l:void 0)})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Auth Type"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(w.Z,{children:iE(null!==(a=r.auth_type)&&void 0!==a?a:void 0)})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Host Url"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,c.jsx)(w.Z,{className:"break-all overflow-wrap-anywhere",children:S(r.url,j)}),Z&&(0,c.jsx)("button",{onClick:()=>f(!j),className:"p-1 hover:bg-gray-100 rounded",children:(0,c.jsx)(sj.Z,{icon:j?iS.Z:iC.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,c.jsxs)(W.Z,{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:"Cost Configuration"}),(0,c.jsx)(iD,{costConfig:null===(s=r.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(nt,{serverId:r.server_id,accessToken:m,auth_type:r.auth_type,userRole:u,userID:x})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"MCP Server Settings"}),p?null:(0,c.jsx)(_.Z,{variant:"light",onClick:()=>g(!0),children:"Edit Settings"})]}),p?(0,c.jsx)(iM,{mcpServer:r,accessToken:m,onCancel:()=>g(!1),onSuccess:e=>{g(!1),i()},availableAccessGroups:h}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Server Name"}),(0,c.jsx)("div",{children:r.server_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Alias"}),(0,c.jsx)("div",{children:r.alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Description"}),(0,c.jsx)("div",{children:r.description})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"URL"}),(0,c.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[S(r.url,j),Z&&(0,c.jsx)("button",{onClick:()=>f(!j),className:"p-1 hover:bg-gray-100 rounded",children:(0,c.jsx)(sj.Z,{icon:j?iS.Z:iC.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Transport"}),(0,c.jsx)("div",{children:iA(r.transport)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Auth Type"}),(0,c.jsx)("div",{children:iE(r.auth_type)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Spec Version"}),(0,c.jsx)("div",{children:r.spec_version})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Access Groups"}),(0,c.jsx)("div",{children:r.mcp_access_groups&&r.mcp_access_groups.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:r.mcp_access_groups.map((e,s)=>{var t;return(0,c.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:""},s)})}):(0,c.jsx)(w.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cost Configuration"}),(0,c.jsx)(iD,{costConfig:null===(t=r.mcp_info)||void 0===t?void 0:t.mcp_server_cost_info})]})]})]})})]})]})]})};var iR=t(83669);let{Panel:iq}=tx.default;var iU=e=>{let{accessToken:s,formValues:t,onToolsLoaded:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),h=t.url&&t.transport&&t.auth_type&&s,p=async()=>{if(s&&t.url){n(!0),m(null);try{let e={server_id:t.server_id||"",server_name:t.server_name||"",url:t.url,transport:t.transport,spec_version:t.spec_version,auth_type:t.auth_type,mcp_info:t.mcp_info},a=await (0,g.testMCPToolsListRequest)(s,e);if(a.tools&&!a.error)r(a.tools),m(null),null==l||l(a.tools),a.tools.length>0&&!u&&x(!0);else{let e=a.message||"Failed to retrieve tools list";m(e),r([]),null==l||l([]),x(!1)}}catch(e){console.error("Tools fetch error:",e),m(e instanceof Error?e.message:String(e)),r([]),null==l||l([]),x(!1)}finally{n(!1)}}};return((0,d.useEffect)(()=>{h?p():(r([]),m(null),x(!1),null==l||l([]))},[t.url,t.transport,t.auth_type,t.spec_version,s]),h||t.url)?(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(iR.Z,{className:"text-blue-600"}),(0,c.jsx)(k.Z,{children:"Connection Status"})]}),!h&&t.url&&(0,c.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,c.jsx)(a2.Z,{className:"text-2xl mb-2"}),(0,c.jsx)(w.Z,{children:"Complete required fields to test connection"}),(0,c.jsx)("br",{}),(0,c.jsx)(w.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),h&&(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":a.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,c.jsx)("br",{}),(0,c.jsxs)(w.Z,{className:"text-gray-500 text-sm",children:["Server: ",t.url]})]}),i&&(0,c.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,c.jsx)(lm.Z,{size:"small",className:"mr-2"}),(0,c.jsx)(w.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&a.length>0&&(0,c.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,c.jsx)(iR.Z,{className:"mr-1"}),(0,c.jsx)(w.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,c.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,c.jsx)(lI.Z,{className:"mr-1"}),(0,c.jsx)(w.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,c.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,c.jsx)(lm.Z,{size:"large"}),(0,c.jsx)(w.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,c.jsx)(tH.Z,{message:"Connection Failed",description:o,type:"error",showIcon:!0,action:(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(s5.Z,{}),onClick:p,size:"small",children:"Retry"})}),!i&&a.length>0&&(0,c.jsx)(tx.default,{items:[{key:"1",label:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-2 text-green-500"}),(0,c.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,c.jsx)(r$.Z,{count:a.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,c.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:a.map((e,s)=>(0,c.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]},s))})}]}),!i&&0===a.length&&!o&&(0,c.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,c.jsx)(iR.Z,{className:"text-2xl mb-2 text-green-500"}),(0,c.jsx)(w.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,c.jsx)("br",{}),(0,c.jsx)(w.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},iz=e=>{let{isVisible:s}=e;return s?(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,c.jsx)(z.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,c.jsx)(L.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null};let iV="".concat("../ui/assets/logos/","mcp_logo.png");var iK=e=>{let{userRole:s,accessToken:t,onCreateSuccess:l,isModalVisible:a,setModalVisible:r,availableAccessGroups:i}=e,[n]=I.Z.useForm(),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)({}),[h,p]=(0,d.useState)({}),[j,f]=(0,d.useState)(!1),[v,b]=(0,d.useState)([]),[N,Z]=(0,d.useState)("sse"),[w,k]=(0,d.useState)(""),S=async e=>{m(!0);try{let s=e.mcp_access_groups,a={};if(e.stdio_config&&"stdio"===N)try{let s=JSON.parse(e.stdio_config),t=s;if(s.mcpServers&&"object"==typeof s.mcpServers){let l=Object.keys(s.mcpServers);if(l.length>0){let a=l[0];t=s.mcpServers[a],e.server_name||(e.server_name=a.replace(/-/g,"_"))}}a={command:t.command,args:t.args,env:t.env},console.log("Parsed stdio config:",a)}catch(e){P.ZP.error("Invalid JSON in stdio configuration");return}let i={...e,...a,stdio_config:void 0,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(u).length>0?u:null},mcp_access_groups:s,alias:e.alias};if(console.log("Payload: ".concat(JSON.stringify(i))),null!=t){let e=await (0,g.createMCPServer)(t,i);P.ZP.success("MCP Server created successfully"),n.resetFields(),x({}),b([]),r(!1),l(e)}}catch(e){P.ZP.error("Error creating MCP Server: "+e,20)}finally{m(!1)}},E=()=>{n.resetFields(),x({}),b([]),r(!1)};return(d.useEffect(()=>{if(!j&&h.server_name){let e=h.server_name.replace(/\s+/g,"_");n.setFieldsValue({alias:e}),p(s=>({...s,alias:e}))}},[h.server_name]),(0,eE.tY)(s))?(0,c.jsx)(A.Z,{title:(0,c.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,c.jsx)("img",{src:iV,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:a,width:1e3,onCancel:E,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsxs)(I.Z,{form:n,onFinish:S,onValuesChange:(e,s)=>p(s),layout:"vertical",className:"space-y-6",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,c.jsx)(z.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,c.jsx)(z.Z,{title:"A short, unique identifier for this server. Defaults to the server name with spaces replaced by underscores.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>f(!0)})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description"}],children:(0,c.jsx)(y.Z,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,c.jsxs)(C.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{Z(e),"stdio"===e?n.setFieldsValue({url:void 0,auth_type:void 0}):n.setFieldsValue({command:void 0,args:void 0,env:void 0})},value:N,children:[(0,c.jsx)(C.default.Option,{value:"http",children:"HTTP"}),(0,c.jsx)(C.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,c.jsx)(C.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==N&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{type:"url",message:"Please enter a valid URL"}],children:(0,c.jsx)(y.Z,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==N&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,c.jsxs)(C.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,c.jsx)(C.default.Option,{value:"none",children:"None"}),(0,c.jsx)(C.default.Option,{value:"api_key",children:"API Key"}),(0,c.jsx)(C.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,c.jsx)(C.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,c.jsx)(iz,{isVisible:"stdio"===N}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Version",(0,c.jsx)(z.Z,{title:"Select the MCP specification version your server supports",children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"spec_version",rules:[{required:!0,message:"Please select a spec version"}],children:(0,c.jsxs)(C.default,{placeholder:"Select MCP version",className:"rounded-lg",size:"large",children:[(0,c.jsx)(C.default.Option,{value:"2025-03-26",children:"2025-03-26 (Latest)"}),(0,c.jsx)(C.default.Option,{value:"2024-11-05",children:"2024-11-05"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,c.jsx)(z.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.value)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>k(e),tokenSeparators:[","],options:(()=>{let e=i.map(e=>({value:e,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})}));return w&&!i.some(e=>e.toLowerCase().includes(w.toLowerCase()))&&e.push({value:w,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:w}),(0,c.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e})(),maxTagCount:"responsive",allowClear:!0})})]}),(0,c.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,c.jsx)(iU,{accessToken:t,formValues:h,onToolsLoaded:b})}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(iO,{value:u,onChange:x,tools:v,disabled:!1})}),(0,c.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:E,children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",loading:o,children:o?"Creating...":"Add MCP Server"})]})]})})}):null},iB=t(64935),iG=t(11239),iH=t(54001),iJ=t(96137),iY=t(96362),iW=t(80221),i$=t(29202);let{Title:iQ,Text:iX}=em.default,{Panel:i0}=tx.default,i1=e=>{let{icon:s,title:t,description:l,children:a,serverName:r,accessGroups:i=["dev"]}=e,[n,o]=(0,d.useState)(!1),m=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(n&&r){let s=[r.replace(/\s+/g,"_"),...i].join(",");e["x-mcp-servers"]=[s]}return e};return(0,c.jsxs)(th.Z,{className:"border border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,c.jsxs)("div",{children:[(0,c.jsx)(iQ,{level:5,className:"mb-0",children:t}),(0,c.jsx)(iX,{className:"text-gray-600",children:l})]})]}),r&&("Implementation Example"===t||"Configuration"===t)&&(0,c.jsxs)(I.Z.Item,{className:"mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(tn.Z,{size:"small",checked:n,onChange:o}),(0,c.jsxs)(iX,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,c.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),n&&(0,c.jsx)(tH.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,c.jsxs)("div",{children:[(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,c.jsxs)("code",{children:['["',r.replace(/\s+/g,"_"),'"]']})]}),(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,c.jsx)("code",{children:'["dev-group"]'})]}),(0,c.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,c.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),d.Children.map(a,e=>{if(d.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return d.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(m(),null,8)))})}return e})]})};var i2=e=>{let{currentServerAccessGroups:s=[]}=e,t=(0,g.getProxyBaseUrl)(),[l,a]=(0,d.useState)({}),[r,i]=(0,d.useState)({openai:[],litellm:[],cursor:[],http:[]}),[n]=(0,d.useState)("Zapier_MCP"),o=async(e,s)=>{await eF(e)&&(a(e=>({...e,[s]:!0})),setTimeout(()=>{a(e=>({...e,[s]:!1}))},2e3))},m=e=>{let{code:s,copyKey:t,title:a,className:r=""}=e;return(0,c.jsxs)("div",{className:"relative group",children:[a&&(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(iB.Z,{size:16,className:"text-blue-600"}),(0,c.jsx)(iX,{strong:!0,className:"text-gray-700",children:a})]}),(0,c.jsxs)(th.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(r),children:[(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:l[t]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>o(s,t),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(l[t]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,c.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},u=e=>{let{step:s,title:t,children:l}=e;return(0,c.jsxs)("div",{className:"flex gap-4",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsx)(iX,{strong:!0,className:"text-gray-800 block mb-2",children:t}),l]})]})};return(0,c.jsx)("div",{children:(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,c.jsx)(w.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,c.jsxs)(eW.Z,{className:"w-full",children:[(0,c.jsx)(e$.Z,{className:"flex justify-start mt-8 mb-6",children:(0,c.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,c.jsx)(eY.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iB.Z,{size:18}),"OpenAI API"]})}),(0,c.jsx)(eY.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iG.Z,{size:18}),"LiteLLM Proxy"]})}),(0,c.jsx)(eY.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iW.Z,{size:18}),"Cursor"]})}),(0,c.jsx)(eY.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(i$.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iB.Z,{className:"text-blue-600",size:24}),(0,c.jsx)(iQ,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,c.jsx)(iX,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(i1,{icon:(0,c.jsx)(iH.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,c.jsxs)(tY.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsxs)(iX,{children:["Get your API key from the"," ",(0,c.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,c.jsx)(iY.Z,{size:12})]})]})}),(0,c.jsx)(m,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iJ.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"openai-server-url"})}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iB.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,c.jsx)(m,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(t,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,c.jsx)(eQ.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iG.Z,{className:"text-emerald-600",size:24}),(0,c.jsx)(iQ,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,c.jsx)(iX,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(i1,{icon:(0,c.jsx)(iH.Z,{className:"text-emerald-600",size:16}),title:"API Key Setup",description:"Configure your LiteLLM Proxy API key for authentication",children:(0,c.jsxs)(tY.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsx)(iX,{children:"Get your API key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,c.jsx)(m,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iJ.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"litellm-server-url"})}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iB.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:n,accessGroups:["dev"],children:(0,c.jsx)(m,{code:"curl --location '".concat(t,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_API_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(t,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,c.jsx)(eQ.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iW.Z,{className:"text-purple-600",size:24}),(0,c.jsx)(iQ,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,c.jsx)(iX,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,c.jsxs)(th.Z,{className:"border border-gray-200",children:[(0,c.jsx)(iQ,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(u,{step:1,title:"Open Cursor Settings",children:(0,c.jsxs)(iX,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,c.jsx)(u,{step:2,title:"Navigate to MCP Tools",children:(0,c.jsx)(iX,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,c.jsxs)(u,{step:3,title:"Add Configuration",children:[(0,c.jsxs)(iX,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iB.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,c.jsx)(m,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "server_url": "'.concat(t,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,c.jsx)(eQ.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(i$.Z,{className:"text-green-600",size:24}),(0,c.jsx)(iQ,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,c.jsx)(iX,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,c.jsx)(i1,{icon:(0,c.jsx)(i$.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,c.jsxs)(tY.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsx)(iX,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"http-server-url"}),(0,c.jsx)(m,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(T.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,c.jsx)(iY.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},i4=t(67187);let{Option:i5}=C.default,i6=e=>{let{isModalOpen:s,title:t,confirmDelete:l,cancelDelete:a}=e;return s?(0,c.jsx)(A.Z,{open:s,onOk:l,okType:"danger",onCancel:a,children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:t}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)("p",{children:"Are you sure you want to delete this MCP Server?"})})]})}):null};var i3=e=>{let{accessToken:s,userRole:t,userID:l}=e,{data:a,isLoading:r,refetch:i}=(0,sd.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,g.fetchMCPServers)(s)},enabled:!!s}),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)("all"),[y,b]=(0,d.useState)("all"),[N,Z]=(0,d.useState)([]),[S,I]=(0,d.useState)(!1),A="Internal User"===t,E=d.useMemo(()=>{if(!a)return[];let e=new Set,s=[];return a.forEach(t=>{t.teams&&t.teams.forEach(t=>{let l=t.team_id;e.has(l)||(e.add(l),s.push(t))})}),s},[a]),T=d.useMemo(()=>a?Array.from(new Set(a.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[a]),L=e=>{v(e),M(e,y)},O=e=>{b(e),M(f,e)},M=(e,s)=>{if(!a)return Z([]);let t=a;if("personal"===e){Z([]);return}"all"!==e&&(t=t.filter(s=>{var t;return null===(t=s.teams)||void 0===t?void 0:t.some(s=>s.team_id===e)})),"all"!==s&&(t=t.filter(e=>{var t;return null===(t=e.mcp_access_groups)||void 0===t?void 0:t.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),Z(t)};(0,d.useEffect)(()=>{M(f,y)},[a]);let D=d.useMemo(()=>ik(null!=t?t:"",e=>{h(e),j(!1)},e=>{h(e),j(!0)},F),[t]);function F(e){o(e),u(!0)}let R=async()=>{if(null!=n&&null!=s){try{await (0,g.deleteMCPServer)(s,n),P.ZP.success("Deleted MCP Server successfully"),i()}catch(e){console.error("Error deleting the mcp server:",e)}u(!1),o(null)}};return s&&t&&l?(0,c.jsxs)("div",{className:"w-full h-full p-6",children:[(0,c.jsx)(i6,{isModalOpen:m,title:"Delete MCP Server",confirmDelete:R,cancelDelete:()=>{u(!1),o(null)}}),(0,c.jsx)(iK,{userRole:t,accessToken:s,onCreateSuccess:e=>{Z(s=>[...s,e]),I(!1)},isModalVisible:S,setModalVisible:I,availableAccessGroups:T}),(0,c.jsx)(k.Z,{children:"MCP Servers"}),(0,c.jsx)(w.Z,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,eE.tY)(t)&&(0,c.jsx)(_.Z,{className:"mt-4 mb-4",onClick:()=>I(!0),children:"+ Add New MCP Server"}),(0,c.jsxs)(eW.Z,{className:"w-full h-full",children:[(0,c.jsx)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eY.Z,{children:"All Servers"}),(0,c.jsx)(eY.Z,{children:"Connect"})]})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(()=>x?(0,c.jsx)(iF,{mcpServer:N.find(e=>e.server_id===x)||{server_id:"",server_name:"",alias:"",url:"",transport:"",spec_version:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{j(!1),h(null),i()},isProxyAdmin:(0,eE.tY)(t),isEditing:p,accessToken:s,userID:l,userRole:t,availableAccessGroups:T}):(0,c.jsxs)("div",{className:"w-full h-full",children:[(0,c.jsx)("div",{className:"w-full px-6",children:(0,c.jsx)("div",{className:"flex flex-col space-y-4",children:(0,c.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,c.jsxs)(C.default,{value:f,onChange:L,style:{width:300},children:[(0,c.jsx)(i5,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:A?"All Available Servers":"All Servers"})]})}),(0,c.jsx)(i5,{value:"personal",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Personal"})]})}),E.map(e=>(0,c.jsx)(i5,{value:e.team_id,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,c.jsxs)(w.Z,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,c.jsx)(z.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,c.jsx)(i4.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,c.jsxs)(C.default,{value:y,onChange:O,style:{width:300},children:[(0,c.jsx)(i5,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),T.map(e=>(0,c.jsx)(i5,{value:e,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,c.jsx)("div",{className:"w-full px-6 mt-6",children:(0,c.jsx)(t3,{data:N,columns:D,renderSubComponent:()=>(0,c.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:r,noDataMessage:"No MCP servers configured"})})]}),{})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(i2,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:t,userID:l}),(0,c.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},i8=t(21770);function i7(e){let{tool:s,needsAuth:t,authValue:l,onSubmit:a,isLoading:r,result:i,error:n,onClose:o}=e,[m]=I.Z.useForm(),[u,x]=d.useState("formatted"),[h,p]=d.useState(null),[g,j]=d.useState(null),f=d.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),v=d.useMemo(()=>f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{type:"object",properties:f.properties.params.properties,required:f.properties.params.required||[]}:f,[f]);d.useEffect(()=>{h&&(i||n)&&j(Date.now()-h)},[i,n,h]);let b=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let t=document.execCommand("copy");if(document.body.removeChild(s),!t)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},N=async()=>{await b(JSON.stringify(i,null,2))?P.ZP.success("Result copied to clipboard"):P.ZP.error("Failed to copy result")},Z=async()=>{await b(s.name)?P.ZP.success("Tool name copied to clipboard"):P.ZP.error("Failed to copy tool name")};return(0,c.jsxs)("div",{className:"space-y-4 h-full",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,c.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,c.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,c.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:Z,title:"Click to copy tool name",children:[(0,c.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,c.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,c.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,c.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,c.jsx)(_.Z,{onClick:o,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,c.jsx)(z.Z,{title:"Configure the input parameters for this tool call",children:(0,c.jsx)(U.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,c.jsx)("div",{className:"p-4",children:(0,c.jsxs)(I.Z,{form:m,onFinish:e=>{p(Date.now()),j(null);let s={};Object.entries(e).forEach(e=>{var t;let[l,a]=e,r=null===(t=v.properties)||void 0===t?void 0:t[l];if(r&&null!=a&&""!==a)switch(r.type){case"boolean":s[l]="true"===a||!0===a;break;case"number":s[l]=Number(a);break;case"string":s[l]=String(a);break;default:s[l]=a}else null!=a&&""!==a&&(s[l]=a)}),a(f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,c.jsx)("div",{className:"space-y-3",children:(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,c.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,c.jsx)(y.Z,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===v.properties?(0,c.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,c.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,c.jsx)("div",{className:"space-y-3",children:Object.entries(v.properties).map(e=>{var s,t,l,a,r;let[i,n]=e;return(0,c.jsxs)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=v.required)||void 0===s?void 0:s.includes(i))&&(0,c.jsx)("span",{className:"text-red-500",children:"*"}),n.description&&(0,c.jsx)(z.Z,{title:n.description,children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(t=v.required)||void 0===t?void 0:t.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===n.type&&n.enum&&(0,c.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:n.default,children:[!(null===(l=v.required)||void 0===l?void 0:l.includes(i))&&(0,c.jsxs)("option",{value:"",children:["Select ",i]}),n.enum.map(e=>(0,c.jsx)("option",{value:e,children:e},e))]}),"string"===n.type&&!n.enum&&(0,c.jsx)(y.Z,{placeholder:n.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===n.type&&(0,c.jsx)("input",{type:"number",placeholder:n.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===n.type&&(0,c.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=n.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(r=v.required)||void 0===r?void 0:r.includes(i))&&(0,c.jsxs)("option",{value:"",children:["Select ",i]}),(0,c.jsx)("option",{value:"true",children:"True"}),(0,c.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,c.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,c.jsx)(_.Z,{onClick:()=>m.submit(),disabled:r,variant:"primary",className:"w-full",loading:r,children:r?"Calling Tool...":i||n?"Call Again":"Call Tool"})})]})})]}),(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,c.jsx)("div",{className:"p-4",children:i||n||r?(0,c.jsxs)("div",{className:"space-y-3",children:[i&&!r&&!n&&(0,c.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,c.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,c.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,c.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,c.jsx)("button",{onClick:()=>x("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,c.jsx)("button",{onClick:()=>x("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,c.jsx)("button",{onClick:N,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,c.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[r&&(0,c.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,c.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,c.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,c.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),n&&(0,c.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,c.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,c.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,c.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,c.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:n.message})})]})]})}),i&&!r&&!n&&(0,c.jsx)("div",{className:"space-y-3",children:"formatted"===u?i.map((e,s)=>(0,c.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,c.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let t=e.replace(/^#+\s/,"");return(0,c.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:t})},s)}let t=/(https?:\/\/[^\s\)]+)/g;if(t.test(e)){let l=e.split(t);return(0,c.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,c.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:l.map((e,s)=>t.test(e)?(0,c.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,c.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,c.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,c.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,c.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,c.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,c.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,c.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,c.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,c.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,c.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,c.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(i,null,2)})})})})]})]}):(0,c.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,c.jsxs)("div",{className:"text-center max-w-sm",children:[(0,c.jsx)("div",{className:"mb-3",children:(0,c.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,c.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,c.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var i9=t(36724);let ne=e=>{let s,{visible:t,onOk:l,onCancel:a,authType:r}=e,[i]=I.Z.useForm();if(r===iI.API_KEY||r===iI.BEARER_TOKEN){let e=r===iI.API_KEY?"API Key":"Bearer Token";s=(0,c.jsx)(I.Z.Item,{name:"authValue",label:e,rules:[{required:!0,message:"Please input your ".concat(e)}],children:(0,c.jsx)(L.default.Password,{})})}else r===iI.BASIC&&(s=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{name:"username",label:"Username",rules:[{required:!0,message:"Please input your username"}],children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{name:"password",label:"Password",rules:[{required:!0,message:"Please input your password"}],children:(0,c.jsx)(L.default.Password,{})})]}));return(0,c.jsx)(A.Z,{open:t,title:"Authentication",onOk:()=>{i.validateFields().then(e=>{r===iI.BASIC?l("".concat(e.username.trim(),":").concat(e.password.trim())):l(e.authValue.trim())})},onCancel:a,destroyOnClose:!0,children:(0,c.jsx)(I.Z,{form:i,layout:"vertical",children:s})})},ns=e=>{let{authType:s,onAuthSubmit:t,hasAuth:l}=e,[a,r]=(0,d.useState)(!1);return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)(i9.xv,{className:"text-sm font-medium text-gray-700",children:["Authentication ",l?"✓":""]}),(0,c.jsx)(i9.zx,{onClick:()=>r(!0),size:"sm",variant:"secondary",className:"text-xs",children:l?"Update":"Add Auth"})]}),(0,c.jsx)(i9.xv,{className:"text-xs text-gray-500",children:l?"Authentication configured":"Some tools may require authentication"}),(0,c.jsx)(ne,{visible:a,onOk:e=>{t(e),r(!1)},onCancel:()=>r(!1),authType:s})]})};var nt=e=>{let{serverId:s,accessToken:t,auth_type:l,userRole:a,userID:r}=e,[i,n]=(0,d.useState)(""),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)(null),{data:j,isLoading:f,error:v}=(0,sd.a)({queryKey:["mcpTools"],queryFn:()=>{if(!t)throw Error("Access Token required");return(0,g.listMCPTools)(t,s)},enabled:!!t}),{mutate:_,isPending:y}=(0,i8.D)({mutationFn:e=>{if(!t)throw Error("Access Token required");return(0,g.callMCPTool)(t,e.tool.name,e.arguments,e.authValue)},onSuccess:e=>{x(e),p(null)},onError:e=>{p(e),x(null)}}),b=(null==j?void 0:j.tools)||[],N=""!==i;return(0,c.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,c.jsx)(i9.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,c.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,c.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,c.jsx)(i9.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,c.jsxs)("div",{className:"flex flex-col flex-1 space-y-6",children:[(0,c.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,c.jsxs)(i9.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-2"})," Available Tools",b.length>0&&(0,c.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:b.length})]}),f&&(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,c.jsxs)("div",{className:"relative mb-3",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,c.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,c.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==j?void 0:j.error)&&(0,c.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,c.jsxs)("p",{className:"font-medium",children:["Error: ",j.message]})}),!f&&!(null==j?void 0:j.error)&&(!b||0===b.length)&&(0,c.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,c.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!f&&!(null==j?void 0:j.error)&&b.length>0&&(0,c.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:b.map(e=>(0,c.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==o?void 0:o.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{m(e),x(null),p(null)},children:[(0,c.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,c.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,c.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,c.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==o?void 0:o.name)===e.name&&(0,c.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,c.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,c.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]}),iT(l)&&(0,c.jsxs)("div",{className:"pt-4 border-t border-gray-200 flex-shrink-0",children:[(0,c.jsxs)(i9.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,c.jsx)(a7.Z,{className:"mr-2"})," Authentication"]}),(0,c.jsx)(ns,{authType:l,onAuthSubmit:e=>n(e),hasAuth:N})]})]})]}),(0,c.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,c.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,c.jsx)(i9.Dx,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,c.jsx)("div",{className:"flex-1 overflow-auto p-4",children:o?(0,c.jsx)("div",{className:"h-full",children:(0,c.jsx)(i7,{tool:o,needsAuth:iT(l),authValue:i,onSubmit:e=>{_({tool:o,arguments:e,authValue:i})},result:u,error:h,isLoading:y,onClose:()=>m(null)})}):(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a6.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(i9.xv,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,c.jsx)(i9.xv,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})},nl=t(57018),na=e=>{let{tagId:s,onClose:t,accessToken:l,is_admin:a,editTag:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(r),[x,h]=(0,d.useState)([]),p=async()=>{if(l)try{let e=(await (0,g.tagInfoCall)(l,[s]))[s];e&&(o(e),r&&i.setFieldsValue({name:e.name,description:e.description,models:e.models}))}catch(e){console.error("Error fetching tag details:",e),P.ZP.error("Error fetching tag details: "+e)}};(0,d.useEffect)(()=>{p()},[s,l]),(0,d.useEffect)(()=>{l&&eV("dummy-user","Admin",l,h)},[l]);let j=async e=>{if(l)try{await (0,g.tagUpdateCall)(l,{name:e.name,description:e.description,models:e.models}),P.ZP.success("Tag updated successfully"),u(!1),p()}catch(e){console.error("Error updating tag:",e),P.ZP.error("Error updating tag: "+e)}};return n?(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.zx,{onClick:t,className:"mb-4",children:"← Back to Tags"}),(0,c.jsxs)(nl.Dx,{children:["Tag Name: ",n.name]}),(0,c.jsx)(nl.xv,{className:"text-gray-500",children:n.description||"No description"})]}),a&&!m&&(0,c.jsx)(nl.zx,{onClick:()=>u(!0),children:"Edit Tag"})]}),m?(0,c.jsx)(nl.Zb,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:j,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{label:"Tag Name",name:"name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed LLMs"," ",(0,c.jsx)(z.Z,{title:"Select which LLMs are allowed to process this type of data",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select LLMs",children:x.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(nl.zx,{onClick:()=>u(!1),children:"Cancel"}),(0,c.jsx)(nl.zx,{type:"submit",children:"Save Changes"})]})]})}):(0,c.jsx)("div",{className:"space-y-6",children:(0,c.jsxs)(nl.Zb,{children:[(0,c.jsx)(nl.Dx,{children:"Tag Details"}),(0,c.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Name"}),(0,c.jsx)(nl.xv,{children:n.name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Description"}),(0,c.jsx)(nl.xv,{children:n.description||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Allowed LLMs"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:0===n.models.length?(0,c.jsx)(nl.Ct,{color:"red",children:"All Models"}):n.models.map(e=>{var s;return(0,c.jsx)(nl.Ct,{color:"blue",children:(0,c.jsx)(z.Z,{title:"ID: ".concat(e),children:(null===(s=n.model_info)||void 0===s?void 0:s[e])||e})},e)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Created"}),(0,c.jsx)(nl.xv,{children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(nl.xv,{children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]})]})]})})]}):(0,c.jsx)("div",{children:"Loading..."})},nr=e=>{let{data:s,onEdit:t,onDelete:l,onSelectTag:a}=e,[r,i]=d.useState([{id:"created_at",desc:!0}]),n=[{header:"Tag Name",accessorKey:"name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:t.name,children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5",onClick:()=>a(t.name),children:t.name})})})}},{header:"Description",accessorKey:"description",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.description,children:(0,c.jsx)("span",{className:"text-xs",children:t.description||"-"})})}},{header:"Allowed LLMs",accessorKey:"models",cell:e=>{var s,t;let{row:l}=e,a=l.original;return(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:(null==a?void 0:null===(s=a.models)||void 0===s?void 0:s.length)===0?(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"red",children:"All Models"}):null==a?void 0:null===(t=a.models)||void 0===t?void 0:t.map(e=>{var s;return(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,c.jsx)(z.Z,{title:"ID: ".concat(e),children:(0,c.jsx)(w.Z,{children:(null===(s=a.model_info)||void 0===s?void 0:s[e])||e})})},e)})})}},{header:"Created",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,a=s.original;return(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>t(a),className:"cursor-pointer"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>l(a.name),className:"cursor-pointer"})]})}}],o=(0,sp.b7)({data:s,columns:n,state:{sorting:r},onSortingChange:i,getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0});return(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sf.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sy.Z,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(sN.Z,{children:e.headers.map(e=>(0,c.jsx)(sb.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(sv.Z,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsx)(sN.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(s_.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:n.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No tags found"})})})})})]})})})},ni=e=>{let{accessToken:s,userID:t,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[j,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(""),[k]=I.Z.useForm(),[S,E]=(0,d.useState)([]),T=async()=>{if(s)try{let e=await (0,g.tagListCall)(s);console.log("List tags response:",e),r(Object.values(e))}catch(e){console.error("Error fetching tags:",e),P.ZP.error("Error fetching tags: "+e)}},O=async e=>{if(s)try{await (0,g.tagCreateCall)(s,{name:e.tag_name,description:e.description,models:e.allowed_llms}),P.ZP.success("Tag created successfully"),n(!1),k.resetFields(),T()}catch(e){console.error("Error creating tag:",e),P.ZP.error("Error creating tag: "+e)}},M=async e=>{b(e),p(!0)},D=async()=>{if(s&&j){try{await (0,g.tagDeleteCall)(s,j),P.ZP.success("Tag deleted successfully"),T()}catch(e){console.error("Error deleting tag:",e),P.ZP.error("Error deleting tag: "+e)}p(!1),b(null)}};return(0,d.useEffect)(()=>{t&&l&&s&&(async()=>{try{let e=await (0,g.modelInfoCall)(s,t,l);e&&e.data&&E(e.data)}catch(e){console.error("Error fetching models:",e),P.ZP.error("Error fetching models: "+e)}})()},[s,t,l]),(0,d.useEffect)(()=>{T()},[s]),(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:o?(0,c.jsx)(na,{tagId:o,onClose:()=>{m(null),x(!1)},accessToken:s,is_admin:"Admin"===l,editTag:u}):(0,c.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,c.jsx)("h1",{children:"Tag Management"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[N&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",N]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{T(),Z(new Date().toLocaleString())}})]})]}),(0,c.jsxs)(w.Z,{className:"mb-4",children:["Click on a tag name to view and edit its details.",(0,c.jsxs)("p",{children:["You can use tags to restrict the usage of certain LLMs based on tags passed in the request. Read more about tag routing ",(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/tag_routing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})]}),(0,c.jsx)(_.Z,{className:"mb-4",onClick:()=>n(!0),children:"+ Create New Tag"}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(nr,{data:a,onEdit:e=>{m(e.name),x(!0)},onDelete:M,onSelectTag:m})})}),(0,c.jsx)(A.Z,{title:"Create New Tag",visible:i,width:800,footer:null,onCancel:()=>{n(!1),k.resetFields()},children:(0,c.jsxs)(I.Z,{form:k,onFinish:O,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"Tag Name",name:"tag_name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Models"," ",(0,c.jsx)(z.Z,{title:"Select which LLMs are allowed to process requests from this tag",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_llms",children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select LLMs",children:S.map(e=>(0,c.jsx)(C.default.Option,{value:e.model_info.id,children:(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{children:e.model_name}),(0,c.jsxs)("span",{className:"text-gray-400 ml-2",children:["(",e.model_info.id,")"]})]})},e.model_info.id))})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(_.Z,{type:"submit",children:"Create Tag"})})]})}),h&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Tag"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this tag?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:D,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{p(!1),b(null)},children:"Cancel"})]})]})]})})]})})},nn=e=>{let{data:s,onView:t,onEdit:l,onDelete:a}=e,[r,i]=d.useState([{id:"created_at",desc:!0}]),n=[{header:"Vector Store ID",accessorKey:"vector_store_id",cell:e=>{let{row:s}=e,l=s.original;return(0,c.jsx)("button",{onClick:()=>t(l.vector_store_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:l.vector_store_id.length>15?"".concat(l.vector_store_id.slice(0,15),"..."):l.vector_store_id})}},{header:"Name",accessorKey:"vector_store_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.vector_store_name,children:(0,c.jsx)("span",{className:"text-xs",children:t.vector_store_name||"-"})})}},{header:"Description",accessorKey:"vector_store_description",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.vector_store_description,children:(0,c.jsx)("span",{className:"text-xs",children:t.vector_store_description||"-"})})}},{header:"Provider",accessorKey:"custom_llm_provider",cell:e=>{let{row:s}=e,t=s.original,{displayName:l,logo:a}=(0,sL.dr)(t.custom_llm_provider);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,c.jsx)("img",{src:a,alt:l,className:"h-4 w-4"}),(0,c.jsx)("span",{className:"text-xs",children:l})]})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.updated_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>l(t.vector_store_id),className:"cursor-pointer"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>a(t.vector_store_id),className:"cursor-pointer"})]})}}],o=(0,sp.b7)({data:s,columns:n,state:{sorting:r},onSortingChange:i,getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0});return(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sf.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sy.Z,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(sN.Z,{children:e.headers.map(e=>(0,c.jsx)(sb.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(sv.Z,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsx)(sN.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(s_.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:n.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No vector stores found"})})})})})]})})})};(r=o||(o={})).Bedrock="Amazon Bedrock",r.PgVector="PostgreSQL pgvector (LiteLLM Connector)",r.VertexRagEngine="Vertex AI RAG Engine",r.OpenAI="OpenAI",r.Azure="Azure OpenAI";let no={Bedrock:"bedrock",PgVector:"pg_vector",VertexRagEngine:"vertex_ai",OpenAI:"openai",Azure:"azure"},nc="/ui/assets/logos/",nd={"Amazon Bedrock":"".concat(nc,"bedrock.svg"),"PostgreSQL pgvector (LiteLLM Connector)":"".concat(nc,"postgresql.svg"),"Vertex AI RAG Engine":"".concat(nc,"google.svg"),OpenAI:"".concat(nc,"openai_small.svg"),"Azure OpenAI":"".concat(nc,"microsoft_azure.svg")},nm={bedrock:[],pg_vector:[{name:"api_base",label:"API Base",tooltip:"Enter the base URL of your deployed litellm-pgvector server (e.g., http://your-server:8000)",placeholder:"http://your-deployed-server:8000",required:!0,type:"text"},{name:"api_key",label:"API Key",tooltip:"Enter the API key from your deployed litellm-pgvector server",placeholder:"your-deployed-api-key",required:!0,type:"password"}],vertex_rag_engine:[],openai:[{name:"api_key",label:"API Key",tooltip:"Enter your OpenAI API key",placeholder:"sk-...",required:!0,type:"password"}],azure:[{name:"api_key",label:"API Key",tooltip:"Enter your Azure OpenAI API key",placeholder:"your-azure-api-key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Azure OpenAI endpoint (e.g., https://your-resource.openai.azure.com/)",placeholder:"https://your-resource.openai.azure.com/",required:!0,type:"text"}]},nu=e=>nm[e]||[];var nx=e=>{let{isVisible:s,onCancel:t,onSuccess:l,accessToken:a,credentials:r}=e,[i]=I.Z.useForm(),[n,m]=(0,d.useState)("{}"),[u,x]=(0,d.useState)("bedrock"),h=async e=>{if(a)try{let s={};try{s=n.trim()?JSON.parse(n):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:s,litellm_credential_name:e.litellm_credential_name},r=nu(e.custom_llm_provider).reduce((s,t)=>(s[t.name]=e[t.name],s),{});t.litellm_params=r,await (0,g.vectorStoreCreateCall)(a,t),P.ZP.success("Vector store created successfully"),i.resetFields(),m("{}"),l()}catch(e){console.error("Error creating vector store:",e),P.ZP.error("Error creating vector store: "+e)}},p=()=>{i.resetFields(),m("{}"),x("bedrock"),t()};return(0,c.jsx)(A.Z,{title:"Add New Vector Store",visible:s,width:1e3,footer:null,onCancel:p,children:(0,c.jsxs)(I.Z,{form:i,onFinish:h,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Provider"," ",(0,c.jsx)(z.Z,{title:"Select the provider for this vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],initialValue:"bedrock",children:(0,c.jsx)(C.default,{onChange:e=>x(e),children:Object.entries(o).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:no[s],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:nd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),"pg_vector"===u&&(0,c.jsx)(tH.Z,{message:"PG Vector Setup Required",description:(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"LiteLLM provides a server to connect to PG Vector. To use this provider:"}),(0,c.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,c.jsxs)("li",{children:["Deploy the litellm-pgvector server from: ",(0,c.jsx)("a",{href:"https://github.com/BerriAI/litellm-pgvector",target:"_blank",rel:"noopener noreferrer",children:"https://github.com/BerriAI/litellm-pgvector"})]}),(0,c.jsx)("li",{children:"Configure your PostgreSQL database with pgvector extension"}),(0,c.jsx)("li",{children:"Start the server and note the API base URL and API key"}),(0,c.jsx)("li",{children:"Enter those details in the fields below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_rag_engine"===u&&(0,c.jsx)(tH.Z,{message:"Vertex AI RAG Engine Setup",description:(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"To use Vertex AI RAG Engine:"}),(0,c.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,c.jsxs)("li",{children:["Set up your Vertex AI RAG Engine corpus following the guide: ",(0,c.jsx)("a",{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-overview",target:"_blank",rel:"noopener noreferrer",children:"Vertex AI RAG Engine Overview"})]}),(0,c.jsx)("li",{children:"Create a corpus in your Google Cloud project"}),(0,c.jsx)("li",{children:"Note the corpus ID from the Vertex AI console"}),(0,c.jsx)("li",{children:"Enter the corpus ID in the Vector Store ID field below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Vector Store ID"," ",(0,c.jsx)(z.Z,{title:"Enter the vector store ID from your api provider",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_id",rules:[{required:!0,message:"Please input the vector store ID from your api provider"}],children:(0,c.jsx)(y.Z,{placeholder:"vertex_rag_engine"===u?"6917529027641081856 (Get corpus ID from Vertex AI console)":"Enter vector store ID from your provider"})}),nu(u).map(e=>(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:[e.label," ",(0,c.jsx)(z.Z,{title:e.tooltip,children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:e.name,rules:e.required?[{required:!0,message:"Please input the ".concat(e.label.toLowerCase())}]:[],children:(0,c.jsx)(y.Z,{type:e.type||"text",placeholder:e.placeholder})},e.name)),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Vector Store Name"," ",(0,c.jsx)(z.Z,{title:"Custom name you want to give to the vector store, this name will be rendered on the LiteLLM UI",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_name",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"vector_store_description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Existing Credentials"," ",(0,c.jsx)(z.Z,{title:"Optionally select API provider credentials for this vector store eg. Bedrock API KEY",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...r.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON metadata for the vector store (optional)",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),children:(0,c.jsx)(L.default.TextArea,{rows:4,value:n,onChange:e=>m(e.target.value),placeholder:'{"key": "value"}'})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,c.jsx)(_.Z,{onClick:p,variant:"secondary",children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",type:"submit",children:"Create"})]})]})})},nh=e=>{let{isVisible:s,onCancel:t,onConfirm:l}=e;return(0,c.jsxs)(A.Z,{title:"Delete Vector Store",visible:s,footer:null,onCancel:t,children:[(0,c.jsx)("p",{children:"Are you sure you want to delete this vector store? This action cannot be undone."}),(0,c.jsxs)("div",{className:"px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:l,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:t,variant:"primary",children:"Cancel"})]})]})};let{TextArea:np}=L.default,{Text:ng,Title:nj}=em.default;var nf=e=>{let{vectorStoreId:s,accessToken:t,className:l=""}=e,[a,r]=(0,d.useState)(""),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)({}),h=async()=>{if(!a.trim()){P.ZP.warning("Please enter a search query");return}n(!0);try{let e=await (0,g.vectorStoreSearchCall)(t,s,a),l={query:a,response:e,timestamp:Date.now()};m(e=>[l,...e]),r("")}catch(e){console.error("Error searching vector store:",e),P.ZP.error("Failed to search vector store")}finally{n(!1)}},p=e=>new Date(e).toLocaleString(),j=(e,s)=>{let t="".concat(e,"-").concat(s);x(e=>({...e,[t]:!e[t]}))};return(0,c.jsx)(th.Z,{className:"w-full rounded-xl shadow-md",children:(0,c.jsxs)("div",{className:"flex flex-col h-[600px]",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a8.Z,{className:"mr-2 text-blue-500"}),(0,c.jsx)(nj,{level:4,className:"mb-0",children:"Test Vector Store"})]}),o.length>0&&(0,c.jsx)(T.ZP,{onClick:()=>{m([]),x({}),P.ZP.success("Search history cleared")},size:"small",children:"Clear History"})]}),(0,c.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===o.length?(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a8.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(ng,{children:"Test your vector store by entering a search query below"})]}):(0,c.jsx)("div",{className:"space-y-4",children:o.map((e,s)=>{var t;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("div",{className:"text-right",children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-blue-50 border border-blue-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,c.jsx)("strong",{className:"text-sm",children:"Query"}),(0,c.jsx)("span",{className:"text-xs text-gray-500",children:p(e.timestamp)})]}),(0,c.jsx)("div",{className:"text-left",children:e.query})]})}),(0,c.jsx)("div",{className:"text-left",children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-white border border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(a8.Z,{className:"text-green-500"}),(0,c.jsx)("strong",{className:"text-sm",children:"Vector Store Results"}),e.response&&(0,c.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600",children:[(null===(t=e.response.data)||void 0===t?void 0:t.length)||0," results"]})]}),e.response&&e.response.data&&e.response.data.length>0?(0,c.jsx)("div",{className:"space-y-3",children:e.response.data.map((e,t)=>{let l=u["".concat(s,"-").concat(t)]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden bg-gray-50",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>j(s,t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[l?(0,c.jsx)(tp.Z,{className:"text-gray-500 mr-2"}):(0,c.jsx)(t$.Z,{className:"text-gray-500 mr-2"}),(0,c.jsxs)("span",{className:"font-medium text-sm",children:["Result ",t+1]}),!l&&e.content&&e.content[0]&&(0,c.jsxs)("span",{className:"ml-2 text-xs text-gray-500 truncate max-w-md",children:["- ",e.content[0].text.substring(0,100),"..."]})]}),(0,c.jsxs)("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:["Score: ",e.score.toFixed(4)]})]}),l&&(0,c.jsxs)("div",{className:"border-t bg-white p-3",children:[e.content&&e.content.map((e,s)=>(0,c.jsxs)("div",{className:"mb-3",children:[(0,c.jsxs)("div",{className:"text-xs text-gray-500 mb-1",children:["Content (",e.type,")"]}),(0,c.jsx)("div",{className:"text-sm bg-gray-50 p-3 rounded border text-gray-800 max-h-40 overflow-y-auto",children:e.text})]},s)),(e.file_id||e.filename||e.attributes)&&(0,c.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[(0,c.jsx)("div",{className:"text-xs text-gray-500 mb-2 font-medium",children:"Metadata"}),(0,c.jsxs)("div",{className:"space-y-2 text-xs",children:[e.file_id&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium",children:"File ID:"})," ",e.file_id]}),e.filename&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium",children:"Filename:"})," ",e.filename]}),e.attributes&&Object.keys(e.attributes).length>0&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium block mb-1",children:"Attributes:"}),(0,c.jsx)("pre",{className:"text-xs bg-white p-2 rounded border overflow-x-auto",children:JSON.stringify(e.attributes,null,2)})]})]})]})]})]},t)})}):(0,c.jsx)("div",{className:"text-gray-500 text-sm",children:"No results found"})]})}),s<o.length-1&&(0,c.jsx)(Y.Z,{})]},s)})}),i&&(0,c.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,c.jsx)(lm.Z,{indicator:(0,c.jsx)(a5.Z,{style:{fontSize:24},spin:!0})})})]}),(0,c.jsx)("div",{className:"p-4 border-t border-gray-200 bg-white",children:(0,c.jsxs)("div",{className:"flex items-end space-x-2",children:[(0,c.jsx)("div",{className:"flex-1",children:(0,c.jsx)(np,{value:a,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),h())},placeholder:"Enter your search query... (Shift+Enter for new line)",disabled:i,autoSize:{minRows:1,maxRows:4},style:{resize:"none"}})}),(0,c.jsx)(T.ZP,{type:"primary",onClick:h,disabled:i||!a.trim(),icon:(0,c.jsx)(rl.Z,{}),loading:i,children:"Search"})]})})]})})},nv=e=>{let{vectorStoreId:s,onClose:t,accessToken:l,is_admin:a,editVectorStore:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(r),[x,h]=(0,d.useState)("{}"),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)("details"),y=async()=>{if(l)try{let e=await (0,g.vectorStoreInfoCall)(l,s);if(e&&e.vector_store){if(o(e.vector_store),e.vector_store.vector_store_metadata){let s="string"==typeof e.vector_store.vector_store_metadata?JSON.parse(e.vector_store.vector_store_metadata):e.vector_store.vector_store_metadata;h(JSON.stringify(s,null,2))}r&&i.setFieldsValue({vector_store_id:e.vector_store.vector_store_id,custom_llm_provider:e.vector_store.custom_llm_provider,vector_store_name:e.vector_store.vector_store_name,vector_store_description:e.vector_store.vector_store_description})}}catch(e){console.error("Error fetching vector store details:",e),P.ZP.error("Error fetching vector store details: "+e)}},b=async()=>{if(l)try{let e=await (0,g.credentialListCall)(l);console.log("List credentials response:",e),j(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e)}};(0,d.useEffect)(()=>{y(),b()},[s,l]);let N=async e=>{if(l)try{let s={};try{s=x?JSON.parse(x):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:s};await (0,g.vectorStoreUpdateCall)(l,t),P.ZP.success("Vector store updated successfully"),u(!1),y()}catch(e){console.error("Error updating vector store:",e),P.ZP.error("Error updating vector store: "+e)}};return n?(0,c.jsxs)("div",{className:"p-4 max-w-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",className:"mb-4",onClick:t,children:"Back to Vector Stores"}),(0,c.jsxs)(k.Z,{children:["Vector Store ID: ",n.vector_store_id]}),(0,c.jsx)(w.Z,{className:"text-gray-500",children:n.vector_store_description||"No description"})]}),a&&!m&&(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Vector Store"})]}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-6",children:[(0,c.jsx)(eY.Z,{children:"Details"}),(0,c.jsx)(eY.Z,{children:"Test Vector Store"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:m?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(k.Z,{children:"Edit Vector Store"})}),(0,c.jsx)(W.Z,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:N,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{label:"Vector Store ID",name:"vector_store_id",rules:[{required:!0,message:"Please input a vector store ID"}],children:(0,c.jsx)(L.default,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{label:"Vector Store Name",name:"vector_store_name",children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"vector_store_description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Provider"," ",(0,c.jsx)(z.Z,{title:"Select the provider for this vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{children:Object.entries(sL.Cl).map(e=>{let[s,t]=e;return"Bedrock"===s?(0,c.jsx)(C.default.Option,{value:sL.fK[s],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sL.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s):null})})}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsx)(w.Z,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter provider credentials below"})}),(0,c.jsx)(I.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...p.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON metadata for the vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),children:(0,c.jsx)(L.default.TextArea,{rows:4,value:x,onChange:e=>h(e.target.value),placeholder:'{"key": "value"}'})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:()=>u(!1),children:"Cancel"}),(0,c.jsx)(T.ZP,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]})})]}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Vector Store Details"}),a&&(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Vector Store"})]}),(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"ID"}),(0,c.jsx)(w.Z,{children:n.vector_store_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Name"}),(0,c.jsx)(w.Z,{children:n.vector_store_name||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Description"}),(0,c.jsx)(w.Z,{children:n.vector_store_description||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Provider"}),(0,c.jsx)("div",{className:"flex items-center space-x-2 mt-1",children:(()=>{let e=n.custom_llm_provider||"bedrock",{displayName:s,logo:t}=(()=>{let s=Object.keys(sL.fK).find(s=>sL.fK[s].toLowerCase()===e.toLowerCase());if(!s)return{displayName:e,logo:""};let t=sL.Cl[s],l=sL.cd[t];return{displayName:t,logo:l}})();return(0,c.jsxs)(c.Fragment,{children:[t&&(0,c.jsx)("img",{src:t,alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let t=e.target,l=t.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=s.charAt(0),l.replaceChild(e,t)}}}),(0,c.jsx)(eJ.Z,{color:"blue",children:s})]})})()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("div",{className:"bg-gray-50 p-3 rounded mt-2 font-mono text-xs overflow-auto max-h-48",children:(0,c.jsx)("pre",{children:x})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(w.Z,{children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]})]})})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(nf,{vectorStoreId:n.vector_store_id,accessToken:l||""})})]})]})]}):(0,c.jsx)("div",{children:"Loading..."})},n_=e=>{let{accessToken:s,userID:t,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)(""),[j,y]=(0,d.useState)([]),[b,N]=(0,d.useState)(null),[Z,k]=(0,d.useState)(!1),S=async()=>{if(s)try{let e=await (0,g.vectorStoreListCall)(s);console.log("List vector stores response:",e),r(e.data||[])}catch(e){console.error("Error fetching vector stores:",e),P.ZP.error("Error fetching vector stores: "+e)}},C=async()=>{if(s)try{let e=await (0,g.credentialListCall)(s);console.log("List credentials response:",e),y(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e),P.ZP.error("Error fetching credentials: "+e)}},I=async e=>{x(e),m(!0)},A=async()=>{if(s&&u){try{await (0,g.vectorStoreDeleteCall)(s,u),P.ZP.success("Vector store deleted successfully"),S()}catch(e){console.error("Error deleting vector store:",e),P.ZP.error("Error deleting vector store: "+e)}m(!1),x(null)}};return(0,d.useEffect)(()=>{S(),C()},[s]),b?(0,c.jsx)("div",{className:"w-full h-full",children:(0,c.jsx)(nv,{vectorStoreId:b,onClose:()=>{N(null),k(!1),S()},accessToken:s,is_admin:(0,eE.tY)(l||""),editVectorStore:Z})}):(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,c.jsx)("h1",{children:"Vector Store Management"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[h&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",h]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{S(),C(),p(new Date().toLocaleString())}})]})]}),(0,c.jsx)(w.Z,{className:"mb-4",children:(0,c.jsx)("p",{children:"You can use vector stores to store and retrieve LLM embeddings.."})}),(0,c.jsx)(_.Z,{className:"mb-4",onClick:()=>n(!0),children:"+ Add Vector Store"}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(nn,{data:a,onView:e=>{N(e),k(!1)},onEdit:e=>{N(e),k(!0)},onDelete:I})})}),(0,c.jsx)(nx,{isVisible:i,onCancel:()=>n(!1),onSuccess:()=>{n(!1),S()},accessToken:s,credentials:j}),(0,c.jsx)(nh,{isVisible:o,onCancel:()=>m(!1),onConfirm:A})]})})},ny=t(49096),nb=t(53335);let{cva:nN,cx:nZ,compose:nw}=(0,ny.ZD)({hooks:{onComplete:e=>(0,nb.m6)(e)}});function nk(e){var s,t;let{className:l="",...a}=e,r=(0,d.useId)();return s=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),s=e.find(e=>{var s;return(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))===r}),t=e.find(e=>{var s;return e.effect instanceof KeyframeEffect&&(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))!==r});s&&t&&(s.currentTime=t.currentTime)},t=[r],(0,d.useLayoutEffect)(s,t),(0,c.jsxs)("svg",{"data-spinner-id":r,className:nZ("pointer-events-none size-12 animate-spin text-current",l),fill:"none",viewBox:"0 0 24 24",...a,children:[(0,c.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,c.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}let nS=new x.S;function nC(){return(0,c.jsxs)("div",{className:nZ("h-screen","flex items-center justify-center gap-4"),children:[(0,c.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"\uD83D\uDE85 LiteLLM"}),(0,c.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,c.jsx)(nk,{className:"size-4"}),(0,c.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}function nI(){let[e,s]=(0,d.useState)(""),[t,l]=(0,d.useState)(!1),[a,r]=(0,d.useState)(!1),[i,n]=(0,d.useState)(null),[o,x]=(0,d.useState)(null),[f,v]=(0,d.useState)([]),[_,y]=(0,d.useState)([]),[b,N]=(0,d.useState)([]),[Z,w]=(0,d.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),[k,S]=(0,d.useState)(!0),C=(0,m.useSearchParams)(),[I,P]=(0,d.useState)({data:[]}),[A,E]=(0,d.useState)(null),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(!0),[D,F]=(0,d.useState)(null),R=C.get("invitation_id"),[q,U]=(0,d.useState)(()=>C.get("page")||"api-keys"),[z,V]=(0,d.useState)(null),K=e=>{v(s=>s?[...s,e]:[e]),L(()=>!T)},B=!1===O&&null===A&&null===R;return((0,d.useEffect)(()=>{let e=function(e){let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));return s?s.split("=")[1]:null}("token");(0,g.getUiConfig)().then(s=>{E(e),M(!1)})},[]),(0,d.useEffect)(()=>{B&&(window.location.href=(g.proxyBaseUrl||"")+"/sso/key/generate")},[B]),(0,d.useEffect)(()=>{if(!A)return;let e=(0,u.o)(A);if(e){if(V(e.key),r(e.disabled_non_admin_personal_key_creation),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);s(t),"Admin Viewer"==t&&U("usage")}e.user_email&&n(e.user_email),e.login_method&&S("username_password"==e.login_method),e.premium_user&&l(e.premium_user),e.auth_header_name&&(0,g.setGlobalLitellmHeaderName)(e.auth_header_name),e.user_id&&F(e.user_id)}},[A]),(0,d.useEffect)(()=>{z&&D&&e&&eV(D,e,z,N),z&&D&&e&&j(z,D,e,null,x),z&&ly(z,y)},[z,D,e]),O||B)?(0,c.jsx)(nC,{}):(0,c.jsx)(d.Suspense,{fallback:(0,c.jsx)(nC,{}),children:(0,c.jsx)(h.aH,{client:nS,children:R?(0,c.jsx)(sE,{userID:D,userRole:e,premiumUser:t,teams:o,keys:f,setUserRole:s,userEmail:i,setUserEmail:n,setTeams:x,setKeys:v,organizations:_,addKey:K,createClicked:T}):(0,c.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,c.jsx)(p.Z,{userID:D,userRole:e,premiumUser:t,userEmail:i,setProxySettings:w,proxySettings:Z,accessToken:z,isPublicPage:!1}),(0,c.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,c.jsx)("div",{className:"mt-8",children:(0,c.jsx)(rS,{accessToken:z,setPage:e=>{let s=new URLSearchParams(C);s.set("page",e),window.history.pushState(null,"","?".concat(s.toString())),U(e)},userRole:e,defaultSelectedKey:q})}),"api-keys"==q?(0,c.jsx)(sE,{userID:D,userRole:e,premiumUser:t,teams:o,keys:f,setUserRole:s,userEmail:i,setUserEmail:n,setTeams:x,setKeys:v,organizations:_,addKey:K,createClicked:T}):"models"==q?(0,c.jsx)(le,{userID:D,userRole:e,token:A,keys:f,accessToken:z,modelData:I,setModelData:P,premiumUser:t,teams:o}):"llm-playground"==q?(0,c.jsx)(ri,{userID:D,userRole:e,token:A,accessToken:z,disabledPersonalKeyCreation:a}):"users"==q?(0,c.jsx)(lp,{userID:D,userRole:e,token:A,keys:f,teams:o,accessToken:z,setKeys:v}):"teams"==q?(0,c.jsx)(lv,{teams:o,setTeams:x,searchParams:C,accessToken:z,userID:D,userRole:e,organizations:_,premiumUser:t}):"organizations"==q?(0,c.jsx)(lb,{organizations:_,setOrganizations:y,userModels:b,accessToken:z,userRole:e,premiumUser:t}):"admin-panel"==q?(0,c.jsx)(lO,{setTeams:x,searchParams:C,accessToken:z,userID:D,showSSOBanner:k,premiumUser:t,proxySettings:Z}):"api_ref"==q?(0,c.jsx)(aL,{proxySettings:Z}):"settings"==q?(0,c.jsx)(lB,{userID:D,userRole:e,accessToken:z,premiumUser:t}):"budgets"==q?(0,c.jsx)(l5,{accessToken:z}):"guardrails"==q?(0,c.jsx)(iy,{accessToken:z,userRole:e}):"transform-request"==q?(0,c.jsx)(ib,{accessToken:z}):"general-settings"==q?(0,c.jsx)(l0,{userID:D,userRole:e,accessToken:z,modelData:I}):"model-hub-table"==q?(0,c.jsx)(aj.Z,{accessToken:z,publicPage:!1,premiumUser:t,userRole:e}):"caching"==q?(0,c.jsx)(rR,{userID:D,userRole:e,token:A,accessToken:z,premiumUser:t}):"pass-through-settings"==q?(0,c.jsx)(t7,{userID:D,userRole:e,accessToken:z,modelData:I}):"logs"==q?(0,c.jsx)(ap,{userID:D,userRole:e,token:A,accessToken:z,allTeams:null!=o?o:[],premiumUser:t}):"mcp-servers"==q?(0,c.jsx)(i3,{accessToken:z,userRole:e,userID:D}):"tag-management"==q?(0,c.jsx)(ni,{accessToken:z,userRole:e,userID:D}):"vector-stores"==q?(0,c.jsx)(n_,{accessToken:z,userRole:e,userID:D}):"new_usage"==q?(0,c.jsx)(aT,{userID:D,userRole:e,accessToken:z,teams:null!=o?o:[],premiumUser:t}):(0,c.jsx)(rP,{userID:D,userRole:e,token:A,accessToken:z,keys:f,premiumUser:t})]})]})})})}}},function(e){e.O(0,[665,990,445,152,634,475,199,338,162,172,971,117,744],function(){return e(e.s=36362)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-f64fe7b1998a3ca8.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-f64fe7b1998a3ca8.jsdeleted file mode 100644index 6119f5206d0..00000000000--- a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-f64fe7b1998a3ca8.js+++ /dev/null@@ -1 +0,0 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{1900:function(e,s,t){Promise.resolve().then(t.bind(t,45976))},12011:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return _}});var l=t(57437),a=t(2265),r=t(99376),i=t(20831),n=t(94789),o=t(12514),c=t(49804),d=t(67101),m=t(84264),u=t(49566),x=t(96761),h=t(84566),p=t(19250),g=t(14474),j=t(13634),f=t(73002),v=t(3914);function _(){let[e]=j.Z.useForm(),s=(0,r.useSearchParams)();(0,v.e)("token");let t=s.get("invitation_id"),_=s.get("action"),[y,b]=(0,a.useState)(null),[N,Z]=(0,a.useState)(""),[w,k]=(0,a.useState)(""),[S,C]=(0,a.useState)(null),[I,P]=(0,a.useState)(""),[E,A]=(0,a.useState)(""),[T,L]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(0,p.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),L(!1)})},[]),(0,a.useEffect)(()=>{t&&!T&&(0,p.getOnboardingCredentials)(t).then(e=>{let s=e.login_url;console.log("login_url:",s),P(s);let t=e.token,l=(0,g.o)(t);A(t),console.log("decoded:",l),b(l.key),console.log("decoded user email:",l.user_email),k(l.user_email),C(l.user_id)})},[t,T]),(0,l.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(x.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,l.jsx)(x.Z,{className:"text-xl",children:"reset_password"===_?"Reset Password":"Sign up"}),(0,l.jsx)(m.Z,{children:"reset_password"===_?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==_&&(0,l.jsx)(n.Z,{className:"mt-4",title:"SSO",icon:h.GH$,color:"sky",children:(0,l.jsxs)(d.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,l.jsx)(c.Z,{children:"SSO is under the Enterprise Tier."}),(0,l.jsx)(c.Z,{children:(0,l.jsx)(i.Z,{variant:"primary",className:"mb-2",children:(0,l.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,l.jsxs)(j.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",y,"token:",E,"formValues:",e),y&&E&&(e.user_email=w,S&&t&&(0,p.claimOnboardingToken)(y,t,S,e.password).then(e=>{let s="/ui/";s+="?login=success",document.cookie="token="+E,console.log("redirecting to:",s);let t=(0,p.getProxyBaseUrl)();console.log("proxyBaseUrl:",t),t?window.location.href=t+s:window.location.href=s}))},children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(j.Z.Item,{label:"Email Address",name:"user_email",children:(0,l.jsx)(u.Z,{type:"email",disabled:!0,value:w,defaultValue:w,className:"max-w-md"})}),(0,l.jsx)(j.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===_?"Enter your new password":"Create a password for your account",children:(0,l.jsx)(u.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,l.jsx)("div",{className:"mt-10",children:(0,l.jsx)(f.ZP,{htmlType:"submit",children:"reset_password"===_?"Reset Password":"Sign Up"})})]})]})})}},45976:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return nP}});var l,a,r,i,n,o,c=t(57437),d=t(2265),m=t(99376),u=t(14474),x=t(21623),h=t(29827),p=t(65373),g=t(19250);let j=async(e,s,t,l,a)=>{let r;r="Admin"!=t&&"Admin Viewer"!=t?await (0,g.teamListCall)(e,(null==l?void 0:l.organization_id)||null,s):await (0,g.teamListCall)(e,(null==l?void 0:l.organization_id)||null),console.log("givenTeams: ".concat(r)),a(r)};var f=t(49804),v=t(67101),_=t(20831),y=t(49566),b=t(87452),N=t(88829),Z=t(72208),w=t(84264),k=t(96761),S=t(29233),C=t(52787),I=t(13634),P=t(41021),E=t(91679),A=t(29967),T=t(73002),L=t(64482),O=t(30150),M=e=>{let{step:s=.01,style:t={width:"100%"},placeholder:l="Enter a numerical value",min:a,max:r,onChange:i,...n}=e;return(0,c.jsx)(O.Z,{onWheel:e=>e.currentTarget.blur(),step:s,style:t,placeholder:l,min:a,max:r,onChange:i,...n})};let D=async(e,s,t)=>{try{if(null===e||null===s)return;if(null!==t){let l=(await (0,g.modelAvailableCall)(t,e,s,!0,null,!0)).data.map(e=>e.id),a=[],r=[];return l.forEach(e=>{e.endsWith("/*")?a.push(e):r.push(e)}),[...a,...r]}}catch(e){console.error("Error fetching user models:",e)}},F=e=>{if(e.endsWith("/*")){let s=e.replace("/*","");return"All ".concat(s," models")}return e},R=(e,s)=>{let t=[],l=[];return console.log("teamModels",e),console.log("allModels",s),e.forEach(e=>{if(e.endsWith("/*")){let a=e.replace("/*",""),r=s.filter(e=>e.startsWith(a+"/"));l.push(...r),t.push(e)}else l.push(e)}),[...t,...l].filter((e,s,t)=>t.indexOf(e)===s)};var q=t(20577),U=t(15424),z=t(89970);let V=(e,s)=>["metadata","config","enforced_params","aliases"].includes(e)||"json"===s.format,K=e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}},B=(e,s,t)=>{let l={max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"}[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[t]||"Text input";return V(e,s)?"".concat(l,"\nMust be valid JSON format"):s.enum?"Select from available options\nAllowed values: ".concat(s.enum.join(", ")):l};var G=e=>{let{schemaComponent:s,excludedFields:t=[],form:l,overrideLabels:a={},overrideTooltips:r={},customValidation:i={},defaultValues:n={}}=e,[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getOpenAPISchema)()).components.schemas[s];if(!e)throw Error('Schema component "'.concat(s,'" not found'));m(e);let a={};Object.keys(e.properties).filter(e=>!t.includes(e)&&void 0!==n[e]).forEach(e=>{a[e]=n[e]}),l.setFieldsValue(a)}catch(e){console.error("Schema fetch error:",e),x(e instanceof Error?e.message:"Failed to fetch schema")}})()},[s,l,t]);let h=e=>{if(e.type)return e.type;if(e.anyOf){let s=e.anyOf.map(e=>e.type);if(s.includes("number")||s.includes("integer"))return"number";s.includes("string")}return"string"},p=(e,s)=>{var t;let l;let d=h(s),m=null==o?void 0:null===(t=o.required)||void 0===t?void 0:t.includes(e),u=a[e]||s.title||e,x=r[e]||s.description,p=[];m&&p.push({required:!0,message:"".concat(u," is required")}),i[e]&&p.push({validator:i[e]}),V(e,s)&&p.push({validator:async(e,s)=>{if(s&&!K(s))throw Error("Please enter valid JSON")}});let g=x?(0,c.jsxs)("span",{children:[u," ",(0,c.jsx)(z.Z,{title:x,children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}):u;return l=V(e,s)?(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):s.enum?(0,c.jsx)(C.default,{children:s.enum.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"number"===d||"integer"===d?(0,c.jsx)(q.Z,{style:{width:"100%"},precision:"integer"===d?0:void 0}):"duration"===e?(0,c.jsx)(y.Z,{placeholder:"eg: 30s, 30h, 30d"}):(0,c.jsx)(y.Z,{placeholder:x||""}),(0,c.jsx)(I.Z.Item,{label:g,name:e,className:"mt-8",rules:p,initialValue:n[e],help:(0,c.jsx)("div",{className:"text-xs text-gray-500",children:B(e,s,d)}),children:l},e)};return u?(0,c.jsxs)("div",{className:"text-red-500",children:["Error: ",u]}):(null==o?void 0:o.properties)?(0,c.jsx)("div",{children:Object.entries(o.properties).filter(e=>{let[s]=e;return!t.includes(s)}).map(e=>{let[s,t]=e;return p(s,t)})}):null},H=e=>{let{onChange:s,value:t,className:l,accessToken:a,placeholder:r="Select vector stores",disabled:i=!1}=e,[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a){u(!0);try{let e=await (0,g.vectorStoreListCall)(a);e.data&&o(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{u(!1)}}})()},[a]),(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:r,onChange:s,value:t,loading:m,className:l,options:n.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:i})})},J=function(e){let{onChange:s,value:t,accessToken:l,placeholder:a="Select vector stores",premiumUser:r=!1}=e;return r?(0,c.jsx)(H,{onChange:s,value:t,accessToken:l,placeholder:a}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium opacity-50",children:"✨ premium-vector-store-1"}),(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium opacity-50",children:"✨ premium-vector-store-2"})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,c.jsxs)(w.Z,{className:"text-sm text-yellow-800",children:["Vector store access control is a LiteLLM Enterprise feature. Get a trial key ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})},Y=e=>{let{onChange:s,value:t,className:l,accessToken:a,placeholder:r="Select MCP servers",disabled:i=!1}=e,[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(a){h(!0);try{let[e,s]=await Promise.all([(0,g.fetchMCPServers)(a),(0,g.fetchMCPAccessGroups)(a)]),t=Array.isArray(e)?e:e.data||[],l=Array.isArray(s)?s:s.data||[];o(t),u(l)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[a]);let p=[...m.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...n.map(e=>({label:"".concat(e.alias||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.alias||e.server_id," ").concat(e.server_id," MCP Server")}))],j=[...(null==t?void 0:t.servers)||[],...(null==t?void 0:t.accessGroups)||[]];return(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:r,onChange:e=>{s({servers:e.filter(e=>!m.includes(e)),accessGroups:e.filter(e=>m.includes(e))})},value:j,loading:x,className:l,showSearch:!0,style:{width:"100%"},disabled:i,filterOption:(e,s)=>{var t;return((null===(t=p.find(e=>e.value===(null==s?void 0:s.value)))||void 0===t?void 0:t.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:p.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,label:e.label,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,c.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,c.jsx)("span",{style:{flex:1},children:e.label}),(0,c.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})},W=function(e){let{onChange:s,value:t,accessToken:l,placeholder:a="Select MCP servers",premiumUser:r=!1}=e;return r?(0,c.jsx)(Y,{onChange:s,value:t,accessToken:l,placeholder:a}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-purple-50 border border-purple-200 text-purple-800 text-sm font-medium opacity-50",children:"✨ premium-mcp-server-1"}),(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-purple-50 border border-purple-200 text-purple-800 text-sm font-medium opacity-50",children:"✨ premium-mcp-server-2"})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,c.jsxs)(w.Z,{className:"text-sm text-yellow-800",children:["MCP server access control is a LiteLLM Enterprise feature. Get a trial key ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})},$=e=>{let{teams:s,value:t,onChange:l,disabled:a}=e;return console.log("disabled",a),(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Search or select a team",value:t,onChange:l,disabled:a,filterOption:(e,t)=>{if(!t)return!1;let l=null==s?void 0:s.find(e=>e.team_id===t.key);if(!l)return!1;let a=e.toLowerCase().trim(),r=(l.team_alias||"").toLowerCase(),i=(l.team_id||"").toLowerCase();return r.includes(a)||i.includes(a)},optionFilterProp:"children",children:null==s?void 0:s.map(e=>(0,c.jsxs)(C.default.Option,{value:e.team_id,children:[(0,c.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,c.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})},Q=t(23496),X=t(12514),ee=t(91777),es=t(82182),et=t(22452),el=t(74998);(l=i||(i={})).Braintrust="Braintrust",l.CustomCallbackAPI="Custom Callback API",l.Datadog="Datadog",l.Langfuse="Langfuse",l.LangSmith="LangSmith",l.Lago="Lago",l.OpenMeter="OpenMeter",l.OTel="Open Telemetry",l.S3="S3",l.Arize="Arize";let ea={Braintrust:"braintrust",CustomCallbackAPI:"custom_callback_api",Datadog:"datadog",Langfuse:"langfuse",LangSmith:"langsmith",Lago:"lago",OpenMeter:"openmeter",OTel:"otel",S3:"s3",Arize:"arize"},er=Object.fromEntries(Object.entries(ea).map(e=>{let[s,t]=e;return[t,s]})),ei=e=>e.map(e=>er[e]||e),en=e=>e.map(e=>ea[e]||e),eo="/assets/logos/",ec={Langfuse:{logo:"".concat(eo,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"}},Arize:{logo:"".concat(eo,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"text"}},LangSmith:{logo:"".concat(eo,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text"}},Braintrust:{logo:"".concat(eo,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{}},"Custom Callback API":{logo:"".concat(eo,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{}},Datadog:{logo:"".concat(eo,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{}},Lago:{logo:"".concat(eo,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{}},OpenMeter:{logo:"".concat(eo,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{}},"Open Telemetry":{logo:"".concat(eo,"otel.png"),supports_key_team_logging:!1,dynamic_params:{}},S3:{logo:"".concat(eo,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{}}},{Option:ed}=C.default;var em=e=>{let{value:s=[],onChange:t,disabledCallbacks:l=[],onDisabledCallbacksChange:a}=e,r=Object.entries(ec).filter(e=>{let[s,t]=e;return t.supports_key_team_logging}).map(e=>{let[s,t]=e;return s}),i=Object.keys(ec),n=e=>{null==t||t(e)},o=e=>{n(s.filter((s,t)=>t!==e))},d=(e,t,l)=>{let a=[...s];if("callback_name"===t){let s=ea[l]||l;a[e]={...a[e],[t]:s,callback_vars:{}}}else a[e]={...a[e],[t]:l};n(a)},m=(e,t,l)=>{let a=[...s];a[e]={...a[e],callback_vars:{...a[e].callback_vars,[t]:l}},n(a)},u=(e,s)=>{var t,l;if(!e.callback_name)return null;let a=null===(t=Object.entries(ea).find(s=>{let[t,l]=s;return l===e.callback_name}))||void 0===t?void 0:t[0];if(!a)return null;let r=(null===(l=ec[a])||void 0===l?void 0:l.dynamic_params)||{};return 0===Object.keys(r).length?null:(0,c.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,c.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,c.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,c.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(r).map(t=>{let[l,a]=t;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,c.jsx)("span",{children:l.replace(/_/g," ")}),(0,c.jsx)(z.Z,{title:"Environment variable reference recommended: os.environ/".concat(l.toUpperCase()),children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===a&&(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"})]}),(0,c.jsx)(y.Z,{type:"password"===a?"password":"text",placeholder:"os.environ/".concat(l.toUpperCase()),value:e.callback_vars[l]||"",onChange:e=>m(s,l,e.target.value)})]},l)})})]})};return(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(ee.Z,{className:"w-5 h-5 text-red-500"}),(0,c.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,c.jsx)(z.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help"})})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:l,onChange:e=>{let s=en(e);null==a||a(s)},style:{width:"100%"},optionLabelProp:"label",children:i.map(e=>{var s;let t=null===(s=ec[e])||void 0===s?void 0:s.logo;return(0,c.jsx)(ed,{value:e,label:e,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:e,className:"w-4 h-4 object-contain"}),(0,c.jsx)("span",{children:e})]})},e)})}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,c.jsx)(Q.Z,{}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(es.Z,{className:"w-5 h-5 text-blue-500"}),(0,c.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,c.jsx)(z.Z,{title:"Configure callback logging integrations for this team.",children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help"})})]}),(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{n([...s,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:et.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,c.jsx)("div",{className:"space-y-4",children:s.map((e,s)=>{var t,l;let a=e.callback_name?null===(t=Object.entries(ea).find(s=>{let[t,l]=s;return l===e.callback_name}))||void 0===t?void 0:t[0]:void 0,i=a?null===(l=ec[a])||void 0===l?void 0:l.logo:null;return(0,c.jsxs)(X.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,c.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[i&&(0,c.jsx)("img",{src:i,alt:a,className:"w-5 h-5 object-contain"}),(0,c.jsxs)("span",{className:"text-sm font-medium",children:[a||"New Integration"," Configuration"]})]}),(0,c.jsx)(_.Z,{variant:"light",onClick:()=>o(s),icon:el.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,c.jsx)(C.default,{value:a,placeholder:"Select integration",onChange:e=>d(s,"callback_name",e),className:"w-full",optionLabelProp:"label",children:r.map(e=>{var s;let t=null===(s=ec[e])||void 0===s?void 0:s.logo;return(0,c.jsx)(ed,{value:e,label:e,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:e,className:"w-4 h-4 object-contain"}),(0,c.jsx)("span",{children:e})]})},e)})})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,c.jsxs)(C.default,{value:e.callback_type,onChange:e=>d(s,"callback_type",e),className:"w-full",children:[(0,c.jsx)(ed,{value:"success",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{children:"Success Only"})]})}),(0,c.jsx)(ed,{value:"failure",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,c.jsx)("span",{children:"Failure Only"})]})}),(0,c.jsx)(ed,{value:"success_and_failure",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),u(e,s)]})]},s)})}),0===s.length&&(0,c.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,c.jsx)(es.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,c.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,c.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})},eu=function(e){let{value:s,onChange:t,premiumUser:l=!1,disabledCallbacks:a=[],onDisabledCallbacksChange:r}=e;return l?(0,c.jsx)(em,{value:s,onChange:t,disabledCallbacks:a,onDisabledCallbacksChange:r}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,c.jsxs)(w.Z,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})},ex=t(57365),eh=t(93192);function ep(e){let{isInvitationLinkModalVisible:s,setIsInvitationLinkModalVisible:t,baseUrl:l,invitationLinkData:a,modalType:r="invitation"}=e,{Title:i,Paragraph:n}=eh.default,o=()=>{if(!l)return"";let e=new URL(l).pathname,s=e&&"/"!==e?"".concat(e,"/ui"):"ui";if(null==a?void 0:a.has_user_setup_sso)return new URL(s,l).toString();let t="".concat(s,"?invitation_id=").concat(null==a?void 0:a.id);return"resetPassword"===r&&(t+="&action=reset_password"),new URL(t,l).toString()};return(0,c.jsxs)(E.Z,{title:"invitation"===r?"Invitation Link":"Reset Password Link",visible:s,width:800,footer:null,onOk:()=>{t(!1)},onCancel:()=>{t(!1)},children:[(0,c.jsx)(n,{children:"invitation"===r?"Copy and send the generated link to onboard this user to the proxy.":"Copy and send the generated link to the user to reset their password."}),(0,c.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,c.jsx)(w.Z,{className:"text-base",children:"User ID"}),(0,c.jsx)(w.Z,{children:null==a?void 0:a.user_id})]}),(0,c.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,c.jsx)(w.Z,{children:"invitation"===r?"Invitation Link":"Reset Password Link"}),(0,c.jsx)(w.Z,{children:(0,c.jsx)(w.Z,{children:o()})})]}),(0,c.jsx)("div",{className:"flex justify-end mt-5",children:(0,c.jsx)(S.CopyToClipboard,{text:o(),onCopy:()=>P.ZP.success("Copied!"),children:(0,c.jsx)(_.Z,{variant:"primary",children:"invitation"===r?"Copy invitation link":"Copy password reset link"})})})]})}var eg=t(85010),ej=t(72188),ef=t(73879),ev=t(34310),e_=t(38434),ey=t(26349),eb=t(35291),eN=t(3632),eZ=t(15452),ew=t.n(eZ),ek=t(71157),eS=t(44643),eC=t(88532),eI=e=>{let{accessToken:s,teams:t,possibleUIRoles:l,onUsersCreated:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(null),[k,C]=(0,d.useState)("http://localhost:4000");(0,d.useEffect)(()=>{(async()=>{try{let e=await (0,g.getProxyUISettings)(s);Z(e)}catch(e){console.error("Error fetching UI settings:",e)}})(),C(new URL("/",window.location.href).toString())},[s]);let I=async()=>{u(!0);let e=n.map(e=>({...e,status:"pending"}));o(e);let t=!1;for(let a=0;a<e.length;a++){var l,r,i;let n=e[a];try{let e={user_email:n.user_email,user_role:n.user_role};if(n.teams&&"string"==typeof n.teams&&""!==n.teams.trim()&&(e.teams=n.teams.split(",").map(e=>e.trim()).filter(Boolean),0===e.teams.length&&delete e.teams),n.models&&"string"==typeof n.models&&""!==n.models.trim()&&(e.models=n.models.split(",").map(e=>e.trim()).filter(Boolean),0===e.models.length&&delete e.models),n.max_budget&&""!==n.max_budget.toString().trim()){let s=parseFloat(n.max_budget.toString());!isNaN(s)&&s>0&&(e.max_budget=s)}n.budget_duration&&""!==n.budget_duration.trim()&&(e.budget_duration=n.budget_duration.trim()),n.metadata&&"string"==typeof n.metadata&&""!==n.metadata.trim()&&(e.metadata=n.metadata.trim()),console.log("Sending user data:",e);let r=await (0,g.userCreateCall)(s,null,e);if(console.log("Full response:",r),r&&(r.key||r.user_id)){t=!0,console.log("Success case triggered");let e=(null===(l=r.data)||void 0===l?void 0:l.user_id)||r.user_id;try{if(null==N?void 0:N.SSO_ENABLED){let e=new URL("/ui",k).toString();o(s=>s.map((s,t)=>t===a?{...s,status:"success",key:r.key||r.user_id,invitation_link:e}:s))}else{let t=await (0,g.invitationCreateCall)(s,e),l=new URL("/ui?invitation_id=".concat(t.id),k).toString();o(e=>e.map((e,s)=>s===a?{...e,status:"success",key:r.key||r.user_id,invitation_link:l}:e))}}catch(e){console.error("Error creating invitation:",e),o(e=>e.map((e,s)=>s===a?{...e,status:"success",key:r.key||r.user_id,error:"User created but failed to generate invitation link"}:e))}}else{console.log("Error case triggered");let e=(null==r?void 0:r.error)||"Failed to create user";console.log("Error message:",e),o(s=>s.map((s,t)=>t===a?{...s,status:"failed",error:e}:s))}}catch(s){console.error("Caught error:",s);let e=(null==s?void 0:null===(i=s.response)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.error)||(null==s?void 0:s.message)||String(s);o(s=>s.map((s,t)=>t===a?{...s,status:"failed",error:e}:s))}}u(!1),t&&a&&a()};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_.Z,{className:"mb-0",onClick:()=>i(!0),children:"+ Bulk Invite Users"}),(0,c.jsx)(E.Z,{title:"Bulk Invite Users",visible:r,width:800,onCancel:()=>i(!1),bodyStyle:{maxHeight:"70vh",overflow:"auto"},footer:null,children:(0,c.jsx)("div",{className:"flex flex-col",children:0===n.length?(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"1"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Download and fill the template"})]}),(0,c.jsxs)("div",{className:"ml-11 mb-6",children:[(0,c.jsx)("p",{className:"mb-4",children:"Add multiple users at once by following these steps:"}),(0,c.jsxs)("ol",{className:"list-decimal list-inside space-y-2 ml-2 mb-4",children:[(0,c.jsx)("li",{children:"Download our CSV template"}),(0,c.jsx)("li",{children:"Add your users' information to the spreadsheet"}),(0,c.jsx)("li",{children:"Save the file and upload it here"}),(0,c.jsx)("li",{children:"After creation, download the results file containing the API keys for each user"})]}),(0,c.jsxs)("div",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 mb-4",children:[(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Template Column Names"}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"user_email"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"User's email address (required)"})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"user_role"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'User\'s role (one of: "proxy_admin", "proxy_admin_view_only", "internal_user", "internal_user_view_only")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"teams"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated team IDs (e.g., "team-1,team-2")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"max_budget"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Maximum budget as a number (e.g., "100")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"budget_duration"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Budget reset period (e.g., "30d", "1mo")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"models"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated allowed models (e.g., "gpt-3.5-turbo,gpt-4")'})]})]})]})]}),(0,c.jsxs)(_.Z,{onClick:()=>{let e=new Blob([ew().unparse([["user_email","user_role","teams","max_budget","budget_duration","models"],["[email protected]","internal_user","team-id-1,team-id-2","100","30d","gpt-3.5-turbo,gpt-4"]])],{type:"text/csv"}),s=window.URL.createObjectURL(e),t=document.createElement("a");t.href=s,t.download="bulk_users_template.csv",document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(s)},size:"lg",className:"w-full md:w-auto",children:[(0,c.jsx)(ef.Z,{className:"mr-2"})," Download CSV Template"]})]}),(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"2"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Upload your completed CSV"})]}),(0,c.jsxs)("div",{className:"ml-11",children:[y?(0,c.jsxs)("div",{className:"mb-4 p-4 rounded-md border ".concat(f?"bg-red-50 border-red-200":"bg-blue-50 border-blue-200"),children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[f?(0,c.jsx)(ev.Z,{className:"text-red-500 text-xl mr-3"}):(0,c.jsx)(e_.Z,{className:"text-blue-500 text-xl mr-3"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(eh.default.Text,{strong:!0,className:f?"text-red-800":"text-blue-800",children:y.name}),(0,c.jsxs)(eh.default.Text,{className:"block text-xs ".concat(f?"text-red-600":"text-blue-600"),children:[(y.size/1024).toFixed(1)," KB • ",new Date().toLocaleDateString()]})]})]}),(0,c.jsxs)(_.Z,{size:"xs",variant:"secondary",onClick:()=>{b(null),o([]),h(null),j(null),v(null)},className:"flex items-center",children:[(0,c.jsx)(ey.Z,{className:"mr-1"})," Remove"]})]}),f?(0,c.jsxs)("div",{className:"mt-3 text-red-600 text-sm flex items-start",children:[(0,c.jsx)(eb.Z,{className:"mr-2 mt-0.5"}),(0,c.jsx)("span",{children:f})]}):!p&&(0,c.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1.5",children:(0,c.jsx)("div",{className:"bg-blue-500 h-1.5 rounded-full w-full animate-pulse"})}),(0,c.jsx)("span",{className:"ml-2 text-xs text-blue-600",children:"Processing..."})]})]}):(0,c.jsx)(eg.default,{beforeUpload:e=>((h(null),j(null),v(null),b(e),"text/csv"===e.type||e.name.endsWith(".csv"))?e.size>5242880?v("File is too large (".concat((e.size/1048576).toFixed(1)," MB). Please upload a CSV file smaller than 5MB.")):ew().parse(e,{complete:e=>{if(!e.data||0===e.data.length){j("The CSV file appears to be empty. Please upload a file with data."),o([]);return}if(1===e.data.length){j("The CSV file only contains headers but no user data. Please add user data to your CSV."),o([]);return}let s=e.data[0];if(0===s.length||1===s.length&&""===s[0]){j("The CSV file doesn't contain any column headers. Please make sure your CSV has headers."),o([]);return}let l=["user_email","user_role"].filter(e=>!s.includes(e));if(l.length>0){j("Your CSV is missing these required columns: ".concat(l.join(", "),". Please add these columns to your CSV file.")),o([]);return}try{let l=e.data.slice(1).map((e,l)=>{var a,r,i,n,o,c;if(0===e.length||1===e.length&&""===e[0])return null;if(e.length<s.length)return{rowNumber:l+2,isValid:!1,error:"Row ".concat(l+2," has fewer columns than the header row. Please ensure all data is properly formatted."),user_email:"",user_role:""};let d={user_email:(null===(a=e[s.indexOf("user_email")])||void 0===a?void 0:a.trim())||"",user_role:(null===(r=e[s.indexOf("user_role")])||void 0===r?void 0:r.trim())||"",teams:null===(i=e[s.indexOf("teams")])||void 0===i?void 0:i.trim(),max_budget:null===(n=e[s.indexOf("max_budget")])||void 0===n?void 0:n.trim(),budget_duration:null===(o=e[s.indexOf("budget_duration")])||void 0===o?void 0:o.trim(),models:null===(c=e[s.indexOf("models")])||void 0===c?void 0:c.trim(),rowNumber:l+2,isValid:!0,error:""},m=[];if(d.user_email?d.user_email.includes("@")&&d.user_email.includes(".")||m.push("Invalid email format (must contain @ and domain)"):m.push("Email is required"),d.user_role){let e=["proxy_admin","proxy_admin_view_only","internal_user","internal_user_view_only"];e.includes(d.user_role)||m.push('Invalid role "'.concat(d.user_role,'". Must be one of: ').concat(e.join(", ")))}else m.push("Role is required");if(d.max_budget&&""!==d.max_budget.toString().trim()&&(isNaN(parseFloat(d.max_budget.toString()))?m.push('Max budget "'.concat(d.max_budget,'" must be a number')):0>=parseFloat(d.max_budget.toString())&&m.push("Max budget must be greater than 0")),d.budget_duration&&!d.budget_duration.match(/^\d+[dhmwy]$|^\d+mo$/)&&m.push('Invalid budget duration format "'.concat(d.budget_duration,'". Use format like "30d", "1mo", "2w", "6h"')),d.teams&&"string"==typeof d.teams&&t&&t.length>0){let e=t.map(e=>e.team_id),s=d.teams.split(",").map(e=>e.trim()).filter(s=>!e.includes(s));s.length>0&&m.push("Unknown team(s): ".concat(s.join(", ")))}return m.length>0&&(d.isValid=!1,d.error=m.join(", ")),d}).filter(Boolean),a=l.filter(e=>e.isValid);o(l),0===l.length?j("No valid data rows found in the CSV file. Please check your file format."):0===a.length?h("No valid users found in the CSV. Please check the errors below and fix your CSV file."):a.length<l.length?h("Found ".concat(l.length-a.length," row(s) with errors out of ").concat(l.length," total rows. Please correct them before proceeding.")):P.ZP.success("Successfully parsed ".concat(a.length," users"))}catch(s){let e=s instanceof Error?s.message:"Unknown error";h("Error parsing CSV: ".concat(e)),o([])}},error:e=>{h("Failed to parse CSV file: ".concat(e.message)),o([])},header:!1}):(v("Invalid file type: ".concat(e.name,". Please upload a CSV file (.csv extension).")),P.ZP.error("Invalid file type. Please upload a CSV file.")),!1),accept:".csv",maxCount:1,showUploadList:!1,children:(0,c.jsxs)("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-500 transition-colors cursor-pointer",children:[(0,c.jsx)(eN.Z,{className:"text-3xl text-gray-400 mb-2"}),(0,c.jsx)("p",{className:"mb-1",children:"Drag and drop your CSV file here"}),(0,c.jsx)("p",{className:"text-sm text-gray-500 mb-3",children:"or"}),(0,c.jsx)(_.Z,{size:"sm",children:"Browse files"}),(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-4",children:"Only CSV files (.csv) are supported"})]})}),p&&(0,c.jsx)("div",{className:"mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(eC.Z,{className:"h-5 w-5 text-yellow-500 mr-2 mt-0.5"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(eh.default.Text,{strong:!0,className:"text-yellow-800",children:"CSV Structure Error"}),(0,c.jsx)(eh.default.Paragraph,{className:"text-yellow-700 mt-1 mb-0",children:p}),(0,c.jsx)(eh.default.Paragraph,{className:"text-yellow-700 mt-2 mb-0",children:"Please download our template and ensure your CSV follows the required format."})]})]})})]})]}):(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"3"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:n.some(e=>"success"===e.status||"failed"===e.status)?"User Creation Results":"Review and create users"})]}),x&&(0,c.jsx)("div",{className:"ml-11 mb-4 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(eb.Z,{className:"text-red-500 mr-2 mt-1"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-red-600 font-medium",children:x}),n.some(e=>!e.isValid)&&(0,c.jsxs)("ul",{className:"mt-2 list-disc list-inside text-red-600 text-sm",children:[(0,c.jsx)("li",{children:"Check the table below for specific errors in each row"}),(0,c.jsx)("li",{children:"Common issues include invalid email formats, missing required fields, or incorrect role values"}),(0,c.jsx)("li",{children:"Fix these issues in your CSV file and upload again"})]})]})]})}),(0,c.jsxs)("div",{className:"ml-11",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,c.jsx)("div",{className:"flex items-center",children:n.some(e=>"success"===e.status||"failed"===e.status)?(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{className:"text-lg font-medium mr-3",children:"Creation Summary"}),(0,c.jsxs)(w.Z,{className:"text-sm bg-green-100 text-green-800 px-2 py-1 rounded mr-2",children:[n.filter(e=>"success"===e.status).length," Successful"]}),n.some(e=>"failed"===e.status)&&(0,c.jsxs)(w.Z,{className:"text-sm bg-red-100 text-red-800 px-2 py-1 rounded",children:[n.filter(e=>"failed"===e.status).length," Failed"]})]}):(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{className:"text-lg font-medium mr-3",children:"User Preview"}),(0,c.jsxs)(w.Z,{className:"text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded",children:[n.filter(e=>e.isValid).length," of ",n.length," users valid"]})]})}),!n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",children:"Back"}),(0,c.jsx)(_.Z,{onClick:I,disabled:0===n.filter(e=>e.isValid).length||m,children:m?"Creating...":"Create ".concat(n.filter(e=>e.isValid).length," Users")})]})]}),n.some(e=>"success"===e.status)&&(0,c.jsx)("div",{className:"mb-4 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"mr-3 mt-1",children:(0,c.jsx)(eS.Z,{className:"h-5 w-5 text-blue-500"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-blue-800",children:"User creation complete"}),(0,c.jsxs)(w.Z,{className:"block text-sm text-blue-700 mt-1",children:[(0,c.jsx)("span",{className:"font-medium",children:"Next step:"})," Download the credentials file containing API keys and invitation links. Users will need these API keys to make LLM requests through LiteLLM."]})]})]})}),(0,c.jsx)(ej.Z,{dataSource:n,columns:[{title:"Row",dataIndex:"rowNumber",key:"rowNumber",width:80},{title:"Email",dataIndex:"user_email",key:"user_email"},{title:"Role",dataIndex:"user_role",key:"user_role"},{title:"Teams",dataIndex:"teams",key:"teams"},{title:"Budget",dataIndex:"max_budget",key:"max_budget"},{title:"Status",key:"status",render:(e,s)=>s.isValid?s.status&&"pending"!==s.status?"success"===s.status?(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(eS.Z,{className:"h-5 w-5 text-green-500 mr-2"}),(0,c.jsx)("span",{className:"text-green-500",children:"Success"})]}),s.invitation_link&&(0,c.jsx)("div",{className:"mt-1",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{className:"text-xs text-gray-500 truncate max-w-[150px]",children:s.invitation_link}),(0,c.jsx)(S.CopyToClipboard,{text:s.invitation_link,onCopy:()=>P.ZP.success("Invitation link copied!"),children:(0,c.jsx)("button",{className:"ml-1 text-blue-500 text-xs hover:text-blue-700",children:"Copy"})})]})})]}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(ek.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsx)("span",{className:"text-red-500",children:"Failed"})]}),s.error&&(0,c.jsx)("span",{className:"text-sm text-red-500 ml-7",children:JSON.stringify(s.error)})]}):(0,c.jsx)("span",{className:"text-gray-500",children:"Pending"}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(ek.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsx)("span",{className:"text-red-500",children:"Invalid"})]}),s.error&&(0,c.jsx)("span",{className:"text-sm text-red-500 ml-7",children:s.error})]})}],size:"small",pagination:{pageSize:5},scroll:{y:300},rowClassName:e=>e.isValid?"":"bg-red-50"}),!n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",className:"mr-3",children:"Back"}),(0,c.jsx)(_.Z,{onClick:I,disabled:0===n.filter(e=>e.isValid).length||m,children:m?"Creating...":"Create ".concat(n.filter(e=>e.isValid).length," Users")})]}),n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",className:"mr-3",children:"Start New Bulk Import"}),(0,c.jsxs)(_.Z,{onClick:()=>{let e=n.map(e=>({user_email:e.user_email,user_role:e.user_role,status:e.status,key:e.key||"",invitation_link:e.invitation_link||"",error:e.error||""})),s=new Blob([ew().unparse(e)],{type:"text/csv"}),t=window.URL.createObjectURL(s),l=document.createElement("a");l.href=t,l.download="bulk_users_results.csv",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(t)},variant:"primary",className:"flex items-center",children:[(0,c.jsx)(ef.Z,{className:"mr-2"})," Download User Credentials"]})]})]})]})})})]})};let{Option:eP}=C.default;var eE=e=>{let{userID:s,accessToken:t,teams:l,possibleUIRoles:a,onUserCreated:r,isEmbedded:i=!1}=e,n=(0,h.NL)(),[o,m]=(0,d.useState)(null),[u]=I.Z.useForm(),[x,p]=(0,d.useState)(!1),[j,f]=(0,d.useState)(!1),[v,S]=(0,d.useState)([]),[A,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(null),[R,q]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=async()=>{try{let e=await (0,g.modelAvailableCall)(t,s,"any"),l=[];for(let s=0;s<e.data.length;s++){let t=e.data[s];l.push(t.id)}console.log("Model data response:",e.data),console.log("Available models:",l),S(l);let a=await (0,g.getProxyUISettings)(t);console.log("uiSettingsResponse:",a),m(a)}catch(e){console.error("Error fetching model data:",e)}};q((0,g.getProxyBaseUrl)()),e()},[]);let V=async e=>{var l,a,c;try{P.ZP.info("Making API Call"),i||p(!0),e.models&&0!==e.models.length||"proxy_admin"===e.user_role||(console.log("formValues.user_role",e.user_role),e.models=["no-default-models"]),console.log("formValues in create user:",e);let a=await (0,g.userCreateCall)(t,null,e);await n.invalidateQueries({queryKey:["userList"]}),console.log("user create Response:",a),f(!0);let c=(null===(l=a.data)||void 0===l?void 0:l.user_id)||a.user_id;if(r&&i){r(c),u.resetFields();return}if(null==o?void 0:o.SSO_ENABLED){let e={id:crypto.randomUUID(),user_id:c,is_accepted:!1,accepted_at:null,expires_at:new Date(Date.now()+6048e5),created_at:new Date,created_by:s,updated_at:new Date,updated_by:s,has_user_setup_sso:!0};D(e),O(!0)}else(0,g.invitationCreateCall)(t,c).then(e=>{e.has_user_setup_sso=!1,D(e),O(!0)});P.ZP.success("API user Created"),u.resetFields(),localStorage.removeItem("userData"+s)}catch(s){let e=(null===(c=s.response)||void 0===c?void 0:null===(a=c.data)||void 0===a?void 0:a.detail)||(null==s?void 0:s.message)||"Error creating the user";P.ZP.error(e),console.error("Error creating the user:",s)}};return i?(0,c.jsxs)(I.Z,{form:u,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"User Email",name:"user_email",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"User Role",name:"user_role",children:(0,c.jsx)(C.default,{children:a&&Object.entries(a).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ex.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",children:(0,c.jsx)(C.default,{placeholder:"Select Team ID",style:{width:"100%"},children:l?l.map(e=>(0,c.jsx)(eP,{value:e.team_id,children:e.team_alias},e.team_id)):(0,c.jsx)(eP,{value:null,children:"Default Team"},"default")})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create User"})})]}):(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{className:"mb-0",onClick:()=>p(!0),children:"+ Invite User"}),(0,c.jsx)(eI,{accessToken:t,teams:l,possibleUIRoles:a}),(0,c.jsxs)(E.Z,{title:"Invite User",visible:x,width:800,footer:null,onOk:()=>{p(!1),u.resetFields()},onCancel:()=>{p(!1),f(!1),u.resetFields()},children:[(0,c.jsx)(w.Z,{className:"mb-1",children:"Create a User who can own keys"}),(0,c.jsxs)(I.Z,{form:u,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"User Email",name:"user_email",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Global Proxy Role"," ",(0,c.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,c.jsx)(U.Z,{})})]}),name:"user_role",children:(0,c.jsx)(C.default,{children:a&&Object.entries(a).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ex.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",className:"gap-2",name:"team_id",help:"If selected, user will be added as a 'user' role to the team.",children:(0,c.jsx)(C.default,{placeholder:"Select Team ID",style:{width:"100%"},children:l?l.map(e=>(0,c.jsx)(eP,{value:e.team_id,children:e.team_alias},e.team_id)):(0,c.jsx)(eP,{value:null,children:"Default Team"},"default")})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsxs)(b.Z,{children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)(k.Z,{children:"Personal Key Creation"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)(I.Z.Item,{className:"gap-2",label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"Models user has access to, outside of team scope.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",help:"Models user has access to, outside of team scope.",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),v.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})})})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create User"})})]})]}),j&&(0,c.jsx)(ep,{isInvitationLinkModalVisible:A,setIsInvitationLinkModalVisible:O,baseUrl:R||"",invitationLinkData:M})]})},eA=t(7310),eT=t.n(eA),eL=t(20347);let{Option:eO}=C.default,eM=e=>e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";var eD=e=>{let{value:s,onChange:t,className:l="",style:a={}}=e;return(0,c.jsxs)(C.default,{style:{width:"100%",...a},value:s||void 0,onChange:t,className:l,placeholder:"n/a",children:[(0,c.jsx)(eO,{value:"24h",children:"daily"}),(0,c.jsx)(eO,{value:"7d",children:"weekly"}),(0,c.jsx)(eO,{value:"30d",children:"monthly"})]})};function eF(e,s){let t=structuredClone(e);for(let[e,l]of Object.entries(s))e in t&&(t[e]=l);return t}let eR=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null==e?"-":e.toLocaleString("en-US",{minimumFractionDigits:s,maximumFractionDigits:s})},eq=async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;try{return await navigator.clipboard.writeText(e),P.ZP.success(s),!0}catch(e){return P.ZP.error("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}},{Option:eU}=C.default,ez=e=>{let s=[];if(console.log("data:",JSON.stringify(e)),e)for(let t of e)t.metadata&&t.metadata.tags&&s.push(...t.metadata.tags);let t=Array.from(new Set(s)).map(e=>({value:e,label:e}));return console.log("uniqueTags:",t),t},eV=async(e,s,t,l)=>{try{if(null===e||null===s)return[];if(null!==t){let a=(await (0,g.modelAvailableCall)(t,e,s,!0,l,!0)).data.map(e=>e.id);return console.log("available_model_names:",a),a}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},eK=async(e,s,t,l)=>{try{if(null===e||null===s)return;if(null!==t){let a=(await (0,g.modelAvailableCall)(t,e,s)).data.map(e=>e.id);console.log("available_model_names:",a),l(a)}}catch(e){console.error("Error fetching user models:",e)}};var eB=e=>{let{userID:s,team:t,teams:l,userRole:a,accessToken:r,data:i,addKey:n,premiumUser:o=!1}=e,[m]=I.Z.useForm(),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(null),[j,O]=(0,d.useState)(null),[D,R]=(0,d.useState)([]),[q,V]=(0,d.useState)([]),[K,B]=(0,d.useState)("you"),[H,Y]=(0,d.useState)(ez(i)),[Q,X]=(0,d.useState)([]),[ee,es]=(0,d.useState)([]),[et,el]=(0,d.useState)(t),[ea,er]=(0,d.useState)(!1),[ei,eo]=(0,d.useState)(null),[ec,ed]=(0,d.useState)({}),[em,ex]=(0,d.useState)([]),[eh,ep]=(0,d.useState)(!1),[eg,ej]=(0,d.useState)([]),[ef,ev]=(0,d.useState)(!1),[e_,ey]=(0,d.useState)([]),[eb,eN]=(0,d.useState)("default"),eZ=()=>{x(!1),m.resetFields(),es([]),ey([]),eN("default")},ew=()=>{x(!1),p(null),el(null),m.resetFields(),es([]),ey([]),eN("default")};(0,d.useEffect)(()=>{s&&a&&r&&eK(s,a,r,R)},[r,s,a]);let ek=async()=>{try{if(null==r)return;let e=await (0,g.fetchMCPAccessGroups)(r);ej(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,d.useEffect)(()=>{ek()},[r]),(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getGuardrailsList)(r)).guardrails.map(e=>e.guardrail_name);X(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[r]),(0,d.useEffect)(()=>{(async()=>{try{if(r){let e=sessionStorage.getItem("possibleUserRoles");if(e)ed(JSON.parse(e));else{let e=await (0,g.getPossibleUserRoles)(r);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),ed(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[r]);let eS=q.includes("no-default-models")&&!et,eC=async e=>{try{var t,l,a,o,c;let d;let u=null!==(a=null==e?void 0:e.key_alias)&&void 0!==a?a:"",h=null!==(o=null==e?void 0:e.team_id)&&void 0!==o?o:null;if((null!==(c=null==i?void 0:i.filter(e=>e.team_id===h).map(e=>e.key_alias))&&void 0!==c?c:[]).includes(u))throw Error("Key alias ".concat(u," already exists for team with ID ").concat(h,", please provide another key alias"));P.ZP.info("Making API Call"),x(!0),"you"===K&&(e.user_id=s);let j={};try{j=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===K&&(j.service_account_id=e.key_alias),ee.length>0&&(j={...j,logging:ee.filter(e=>e.callback_name)}),e_.length>0){let e=en(e_);j={...j,litellm_disabled_callbacks:e}}if(e.metadata=JSON.stringify(j),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0)){e.object_permission||(e.object_permission={});let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),d="service_account"===K?await (0,g.keyCreateServiceAccountCall)(r,e):await (0,g.keyCreateCall)(r,s,e),console.log("key create Response:",d),n(d),p(d.key),O(d.soft_budget),P.ZP.success("API Key Created"),m.resetFields(),localStorage.removeItem("userData"+s)}catch(e){console.log("error in create key:",e),P.ZP.error("Error creating the key: ".concat(e))}};(0,d.useEffect)(()=>{if(s&&a&&r){var e;eV(s,a,r,null!==(e=null==et?void 0:et.team_id)&&void 0!==e?e:null).then(e=>{var s;V(Array.from(new Set([...null!==(s=null==et?void 0:et.models)&&void 0!==s?s:[],...e])))})}m.setFieldValue("models",[])},[et,r,s,a]);let eI=async e=>{if(!e){ex([]);return}ep(!0);try{let s=new URLSearchParams;if(s.append("user_email",e),null==r)return;let t=(await (0,g.userFilterUICall)(r,s)).map(e=>({label:"".concat(e.user_email," (").concat(e.user_id,")"),value:e.user_id,user:e}));ex(t)}catch(e){console.error("Error fetching users:",e),P.ZP.error("Failed to search for users")}finally{ep(!1)}},eP=(0,d.useCallback)(eT()(e=>eI(e),300),[r]),eA=(e,s)=>{let t=s.user;m.setFieldsValue({user_id:t.user_id})};return(0,c.jsxs)("div",{children:[a&&eL.LQ.includes(a)&&(0,c.jsx)(_.Z,{className:"mx-auto",onClick:()=>x(!0),children:"+ Create New Key"}),(0,c.jsx)(E.Z,{visible:u,width:1e3,footer:null,onOk:eZ,onCancel:ew,children:(0,c.jsxs)(I.Z,{form:m,onFinish:eC,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(k.Z,{className:"mb-4",children:"Key Ownership"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Owned By"," ",(0,c.jsx)(z.Z,{title:"Select who will own this API key",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,c.jsxs)(A.ZP.Group,{onChange:e=>B(e.target.value),value:K,children:[(0,c.jsx)(A.ZP,{value:"you",children:"You"}),(0,c.jsx)(A.ZP,{value:"service_account",children:"Service Account"}),"Admin"===a&&(0,c.jsx)(A.ZP,{value:"another_user",children:"Another User"})]})}),"another_user"===K&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["User ID"," ",(0,c.jsx)(z.Z,{title:"The user who will own this key and be responsible for its usage",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===K,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{eP(e)},onSelect:(e,s)=>eA(e,s),options:em,loading:eh,allowClear:!0,style:{width:"100%"},notFoundContent:eh?"Searching...":"No users found"}),(0,c.jsx)(T.ZP,{onClick:()=>er(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Team"," ",(0,c.jsx)(z.Z,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:t?t.team_id:null,className:"mt-4",children:(0,c.jsx)($,{teams:l,onChange:e=>{el((null==l?void 0:l.find(s=>s.team_id===e))||null)}})})]}),eS&&(0,c.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your API key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!eS&&(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(k.Z,{className:"mb-4",children:"Key Details"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["you"===K||"another_user"===K?"Key Name":"Service Account ID"," ",(0,c.jsx)(z.Z,{title:"you"===K||"another_user"===K?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:"Please input a ".concat("you"===K?"key name":"service account ID")}],help:"required",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",rules:"management"===eb||"read_only"===eb?[]:[{required:!0,message:"Please select a model"}],help:"management"===eb||"read_only"===eb?"Models field is disabled for this key type":"required",className:"mt-4",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===eb||"read_only"===eb,onChange:e=>{e.includes("all-team-models")&&m.setFieldsValue({models:["all-team-models"]})},children:[(0,c.jsx)(eU,{value:"all-team-models",children:"All Team Models"},"all-team-models"),q.map(e=>(0,c.jsx)(eU,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Key Type"," ",(0,c.jsx)(z.Z,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"default",className:"mt-4",children:(0,c.jsxs)(C.default,{defaultValue:"default",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{eN(e),("management"===e||"read_only"===e)&&m.setFieldsValue({models:[]})},children:[(0,c.jsx)(eU,{value:"default",label:"Default",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call LLM API + Management routes"})]})}),(0,c.jsx)(eU,{value:"llm_api",label:"LLM API",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"LLM API"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only LLM API routes (chat/completions, embeddings, etc.)"})]})}),(0,c.jsx)(eU,{value:"management",label:"Management",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})}),(0,c.jsx)(eU,{value:"read_only",label:"Read Only",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Read Only"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can only call only info routes (e.g. /key/info, /user/info, /team/info)"})]})})]})})]}),!eS&&(0,c.jsx)("div",{className:"mb-8",children:(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",onClick:()=>{ef||(ek(),ev(!0))},children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)(k.Z,{className:"m-0",children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Max Budget (USD)"," ",(0,c.jsx)(z.Z,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==t?void 0:t.max_budget)!==null&&(null==t?void 0:t.max_budget)!==void 0?null==t?void 0:t.max_budget:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.max_budget&&s>t.max_budget)throw Error("Budget cannot exceed team max budget: $".concat(eR(t.max_budget,4)))}}],children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Reset Budget"," ",(0,c.jsx)(z.Z,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:"Team Reset Budget: ".concat((null==t?void 0:t.budget_duration)!==null&&(null==t?void 0:t.budget_duration)!==void 0?null==t?void 0:t.budget_duration:"None"),children:(0,c.jsx)(eD,{onChange:e=>m.setFieldValue("budget_duration",e)})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,c.jsx)(z.Z,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==t?void 0:t.tpm_limit)!==null&&(null==t?void 0:t.tpm_limit)!==void 0?null==t?void 0:t.tpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.tpm_limit&&s>t.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(t.tpm_limit))}}],children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,c.jsx)(z.Z,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==t?void 0:t.rpm_limit)!==null&&(null==t?void 0:t.rpm_limit)!==void 0?null==t?void 0:t.rpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.rpm_limit&&s>t.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(t.rpm_limit))}}],children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Expire Key"," ",(0,c.jsx)(z.Z,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days)",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"duration",className:"mt-4",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:Q.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,c.jsx)(J,{onChange:e=>m.setFieldValue("allowed_vector_store_ids",e),value:m.getFieldValue("allowed_vector_store_ids"),accessToken:r,placeholder:"Select vector stores (optional)",premiumUser:o})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers or access groups this key can access. ",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this key can access. ",children:(0,c.jsx)(W,{onChange:e=>m.setFieldValue("allowed_mcp_servers_and_groups",e),value:m.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:r,placeholder:"Select MCP servers or access groups (optional)",premiumUser:o})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Tags"," ",(0,c.jsx)(z.Z,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Enter tags",tokenSeparators:[","],options:H})}),(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Logging Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(eu,{value:ee,onChange:es,premiumUser:o,disabledCallbacks:e_,onDisabledCallbacksChange:ey})})})]}),(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("b",{children:"Advanced Settings"}),(0,c.jsx)(z.Z,{title:(0,c.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,c.jsx)("a",{href:g.proxyBaseUrl?"".concat(g.proxyBaseUrl,"/#/key%20management/generate_key_fn_key_generate_post"):"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,c.jsx)(U.Z,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)(G,{schemaComponent:"GenerateKeyRequest",form:m,excludedFields:["key_alias","team_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit"]})})]})]})]})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",disabled:eS,style:{opacity:eS?.5:1},children:"Create Key"})})]})}),ea&&(0,c.jsx)(E.Z,{title:"Create New User",visible:ea,onCancel:()=>er(!1),footer:null,width:800,children:(0,c.jsx)(eE,{userID:s,accessToken:r,teams:l,possibleUIRoles:ec,onUserCreated:e=>{eo(e),m.setFieldsValue({user_id:e}),er(!1)},isEmbedded:!0})}),h&&(0,c.jsx)(E.Z,{visible:u,onOk:eZ,onCancel:ew,footer:null,children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Save your Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,c.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,c.jsx)(f.Z,{numColSpan:1,children:null!=h?(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"API Key:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:h})}),(0,c.jsx)(S.CopyToClipboard,{text:h,onCopy:()=>{P.ZP.success("API Key copied to clipboard")},children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,c.jsx)(w.Z,{children:"Key being created, this might take 30s"})})]})})]})},eG=t(7366),eH=e=>{let{selectedTeam:s,currentOrg:t,selectedKeyAlias:l,accessToken:a,createClicked:r}=e,[i,n]=(0,d.useState)({keys:[],total_count:0,current_page:1,total_pages:0}),[o,c]=(0,d.useState)(!0),[m,u]=(0,d.useState)(null),x=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(console.log("calling fetchKeys"),!a){console.log("accessToken",a);return}c(!0);let s="number"==typeof e.page?e.page:1,t="number"==typeof e.pageSize?e.pageSize:100,l=await (0,g.keyListCall)(a,null,null,null,null,null,s,t);console.log("data",l),n(l),u(null)}catch(e){u(e instanceof Error?e:Error("An error occurred"))}finally{c(!1)}};return(0,d.useEffect)(()=>{x(),console.log("selectedTeam",s,"currentOrg",t,"accessToken",a,"selectedKeyAlias",l)},[s,t,a,l,r]),{keys:i.keys,isLoading:o,error:m,pagination:{currentPage:i.current_page,totalPages:i.total_pages,totalCount:i.total_count},refresh:x,setKeys:e=>{n(s=>{let t="function"==typeof e?e(s.keys):e;return{...s,keys:t}})}}},eJ=t(27281),eY=t(41649),eW=t(12485),e$=t(18135),eQ=t(35242),eX=t(29706),e0=t(77991),e1=t(10900),e2=t(23628),e4=e=>{let{value:s,onChange:t,disabledCallbacks:l=[],onDisabledCallbacksChange:a}=e;return(0,c.jsx)(em,{value:s,onChange:t,disabledCallbacks:l,onDisabledCallbacksChange:a})};let e5=["logging"],e6=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!e5.includes(s)})):{},e3=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],e8=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(e6(e),null,s)};function e7(e){var s,t,l,a,r,i,n;let{keyData:o,onCancel:m,onSubmit:u,teams:x,accessToken:h,userID:p,userRole:j,premiumUser:f=!1}=e,[v]=I.Z.useForm(),[b,N]=(0,d.useState)([]),Z=null==x?void 0:x.find(e=>e.team_id===o.team_id),[w,k]=(0,d.useState)([]),[S,P]=(0,d.useState)([]),[E,A]=(0,d.useState)(!1),[O,D]=(0,d.useState)(Array.isArray(null===(s=o.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?ei(o.metadata.litellm_disabled_callbacks):[]);(0,d.useEffect)(()=>{(async()=>{if(p&&j&&h)try{if(null===o.team_id){let e=(await (0,g.modelAvailableCall)(h,p,j)).data.map(e=>e.id);k(e)}else if(null==Z?void 0:Z.team_id){let e=await eV(p,j,h,Z.team_id);k(Array.from(new Set([...Z.models,...e])))}}catch(e){console.error("Error fetching models:",e)}})()},[p,j,h,Z,o.team_id]),(0,d.useEffect)(()=>{v.setFieldValue("disabled_callbacks",O)},[v,O]);let F={...o,budget_duration:(n=o.budget_duration)&&({"24h":"daily","7d":"weekly","30d":"monthly"})[n]||null,metadata:e8(o.metadata),guardrails:(null===(t=o.metadata)||void 0===t?void 0:t.guardrails)||[],vector_stores:(null===(l=o.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=o.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(r=o.object_permission)||void 0===r?void 0:r.mcp_access_groups)||[]},logging_settings:e3(o.metadata),disabled_callbacks:Array.isArray(null===(i=o.metadata)||void 0===i?void 0:i.litellm_disabled_callbacks)?ei(o.metadata.litellm_disabled_callbacks):[]};return(0,c.jsxs)(I.Z,{form:v,onFinish:u,initialValues:F,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[w.length>0&&(0,c.jsx)(C.default.Option,{value:"all-team-models",children:"All Team Models"}),w.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"daily",children:"Daily"}),(0,c.jsx)(C.default.Option,{value:"weekly",children:"Weekly"}),(0,c.jsx)(C.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,c.jsx)(I.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,c.jsx)(I.Z.Item,{label:"Guardrails",name:"guardrails",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails"})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>v.setFieldValue("vector_stores",e),value:v.getFieldValue("vector_stores"),accessToken:h||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(Y,{onChange:e=>v.setFieldValue("mcp_servers_and_groups",e),value:v.getFieldValue("mcp_servers_and_groups"),accessToken:h||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",children:(0,c.jsx)(C.default,{placeholder:"Select team",style:{width:"100%"},children:null==x?void 0:x.map(e=>(0,c.jsx)(C.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,c.jsx)(I.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,c.jsx)(e4,{value:v.getFieldValue("logging_settings"),onChange:e=>v.setFieldValue("logging_settings",e),disabledCallbacks:O,onDisabledCallbacksChange:e=>{D(ei(e)),v.setFieldValue("disabled_callbacks",e)}})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:10})}),(0,c.jsx)(I.Z.Item,{name:"token",hidden:!0,children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,c.jsx)(L.default,{})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{onClick:m,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]})}function e9(e){let{selectedToken:s,visible:t,onClose:l,accessToken:a,premiumUser:r,setAccessToken:i,onKeyUpdate:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(null),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),[b,N]=(0,d.useState)(!1),[Z,C]=(0,d.useState)(!1),[A,T]=(0,d.useState)(null);(0,d.useEffect)(()=>{t&&s&&a&&(o.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),T(a),C(s.key_name===a))},[t,s,o,a]),(0,d.useEffect)(()=>{t||(u(null),N(!1),C(!1),T(null),o.resetFields())},[t,o]);let L=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,eG.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,eG.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,eG.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,d.useEffect)(()=>{(null==x?void 0:x.duration)?j(L(x.duration)):j(null)},[null==x?void 0:x.duration]);let O=async()=>{if(s&&A){N(!0);try{let e=await o.validateFields(),t=await (0,g.regenerateKeyCall)(A,s.token||s.token_id,e);u(t.key),P.ZP.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let l={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?L(e.duration):s.expires,...t};console.log("Updated key data with new token:",l),Z&&(T(t.key),i&&i(t.key)),n&&n(l),N(!1)}catch(e){console.error("Error regenerating key:",e),P.ZP.error("Failed to regenerate API Key"),N(!1)}}},M=()=>{u(null),N(!1),C(!1),T(null),o.resetFields(),l()};return(0,c.jsx)(E.Z,{title:"Regenerate API Key",open:t,onCancel:M,footer:m?[(0,c.jsx)(_.Z,{onClick:M,children:"Close"},"close")]:[(0,c.jsx)(_.Z,{onClick:M,className:"mr-2",children:"Cancel"},"cancel"),(0,c.jsx)(_.Z,{onClick:O,disabled:b,children:b?"Regenerating...":"Regenerate"},"regenerate")],children:m?(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Regenerated Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons, ",(0,c.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,c.jsxs)(f.Z,{numColSpan:1,children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"Key Alias:"}),(0,c.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,c.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,c.jsx)(w.Z,{className:"mt-3",children:"New API Key:"}),(0,c.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,c.jsx)("pre",{className:"break-words whitespace-normal",children:m})}),(0,c.jsx)(S.CopyToClipboard,{text:m,onCopy:()=>P.ZP.success("API Key copied to clipboard"),children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,c.jsxs)(I.Z,{form:o,layout:"vertical",onValuesChange:e=>{"duration"in e&&h(s=>({...s,duration:e.duration}))},children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,c.jsx)(y.Z,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),p&&(0,c.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",p]})]})})}var se=t(79814),ss=function(e){let{vectorStores:s,accessToken:t}=e,[l,a]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,g.vectorStoreListCall)(t);e.data&&a(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,s.length]);let r=e=>{let s=l.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(se.Z,{className:"h-4 w-4 text-blue-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,c.jsx)(eY.Z,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:r(e)},s))}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(se.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},st=t(25327),sl=function(e){let{mcpServers:s,mcpAccessGroups:l=[],accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(a&&s.length>0)try{let e=await (0,g.fetchMCPServers)(a);e&&Array.isArray(e)?i(e):e.data&&Array.isArray(e.data)&&i(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[a,s.length]),(0,d.useEffect)(()=>{(async()=>{if(a&&l.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(a));o(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[a,l.length]);let m=e=>{let s=r.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}return e},u=e=>e,x=[...s.map(e=>({type:"server",value:e})),...l.map(e=>({type:"accessGroup",value:e}))],h=x.length;return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(st.Z,{className:"h-4 w-4 text-gray-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,c.jsx)(eY.Z,{color:"gray",size:"xs",children:h})]}),h>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:x.map((e,s)=>"server"===e.type?(0,c.jsx)(z.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium cursor-help",children:m(e.value)})},s):(0,c.jsxs)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium",children:[(0,c.jsx)("span",{className:"inline-block w-2 h-2 bg-green-500 rounded-full mr-2"}),u(e.value)," ",(0,c.jsx)("span",{className:"ml-1 text-xs text-green-500",children:"(Access Group)"})]},s))}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(st.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},sa=function(e){let{objectPermission:s,variant:t="card",className:l="",accessToken:a}=e,r=(null==s?void 0:s.vector_stores)||[],i=(null==s?void 0:s.mcp_servers)||[],n=(null==s?void 0:s.mcp_access_groups)||[],o=(0,c.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,c.jsx)(ss,{vectorStores:r,accessToken:a}),(0,c.jsx)(sl,{mcpServers:i,mcpAccessGroups:n,accessToken:a})]});return"card"===t?(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,c.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),o]}):(0,c.jsxs)("div",{className:"".concat(l),children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),o]})},sr=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:l="card",className:a=""}=e,r=e=>{var s;return(null===(s=Object.entries(ea).find(s=>{let[t,l]=s;return l===e}))||void 0===s?void 0:s[0])||e},i=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},n=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},o=(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(es.Z,{className:"h-4 w-4 text-blue-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,c.jsx)(eY.Z,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,c.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let l=r(e.callback_name),a=null===(t=ec[l])||void 0===t?void 0:t.logo;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[a?(0,c.jsx)("img",{src:a,alt:l,className:"w-5 h-5 object-contain"}):(0,c.jsx)(es.Z,{className:"h-5 w-5 text-gray-400"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-blue-800",children:l}),(0,c.jsxs)(w.Z,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,c.jsx)(eY.Z,{color:i(e.callback_type),size:"sm",children:n(e.callback_type)})]},s)})}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(es.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(ee.Z,{className:"h-4 w-4 text-red-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,c.jsx)(eY.Z,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,c.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let l=er[e]||e,a=null===(t=ec[l])||void 0===t?void 0:t.logo;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[a?(0,c.jsx)("img",{src:a,alt:l,className:"w-5 h-5 object-contain"}):(0,c.jsx)(ee.Z,{className:"h-5 w-5 text-gray-400"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-red-800",children:l}),(0,c.jsx)(w.Z,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,c.jsx)(eY.Z,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(ee.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===l?(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(a),children:[(0,c.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),o]}):(0,c.jsxs)("div",{className:"".concat(a),children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),o]})},si=t(30401),sn=t(78867);function so(e){var s,t,l,a;let{keyId:r,onClose:i,keyData:n,accessToken:o,userID:m,userRole:u,teams:x,onKeyDataUpdate:h,onDelete:p,premiumUser:j,setAccessToken:f}=e,[y,b]=(0,d.useState)(!1),[N]=I.Z.useForm(),[Z,S]=(0,d.useState)(!1),[C,E]=(0,d.useState)(!1),[A,L]=(0,d.useState)({}),[O,M]=(0,d.useState)(n),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)(!1);if((0,d.useEffect)(()=>{n&&M(n)},[n]),(0,d.useEffect)(()=>{if(R){let e=setTimeout(()=>{q(!1)},5e3);return()=>clearTimeout(e)}},[R]),!O)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:i,className:"mb-4",children:"Back to Keys"}),(0,c.jsx)(w.Z,{children:"Key not found"})]});let U=async e=>{try{var s,t,l,a;if(!o)return;let r=e.token;if(e.key=r,void 0!==e.vector_stores&&(e.object_permission={...O.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...O.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},delete e.mcp_servers_and_groups}if(e.metadata&&"string"==typeof e.metadata)try{let l=JSON.parse(e.metadata);e.metadata={...l,...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:en(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),P.ZP.error("Invalid metadata JSON");return}else e.metadata={...e.metadata||{},...(null===(l=e.guardrails)||void 0===l?void 0:l.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(a=e.disabled_callbacks)||void 0===a?void 0:a.length)>0?{litellm_disabled_callbacks:en(e.disabled_callbacks)}:{}};delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let i=await (0,g.keyUpdateCall)(o,e);M(e=>e?{...e,...i}:void 0),h&&h(i),P.ZP.success("Key updated successfully"),b(!1)}catch(e){P.ZP.error("Failed to update key"),console.error("Error updating key:",e)}},V=async()=>{try{if(!o)return;await (0,g.keyDeleteCall)(o,O.token||O.token_id),P.ZP.success("Key deleted successfully"),p&&p(),i()}catch(e){console.error("Error deleting the key:",e),P.ZP.error("Failed to delete key")}},K=async(e,s)=>{await eq(e)&&(L(e=>({...e,[s]:!0})),setTimeout(()=>{L(e=>({...e,[s]:!1}))},2e3))},B=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),l=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(l)};return(0,c.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:i,className:"mb-4",children:"Back to Keys"}),(0,c.jsx)(k.Z,{children:O.key_alias||"API Key"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono text-sm",children:O.token_id||O.token})]}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:A["key-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>K(O.token_id||O.token,"key-id"),className:"ml-2 transition-all duration-200".concat(A["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,c.jsx)(w.Z,{className:"text-sm text-gray-500",children:O.updated_at&&O.updated_at!==O.created_at?"Updated: ".concat(B(O.updated_at)):"Created: ".concat(B(O.created_at))}),R&&(0,c.jsx)(eY.Z,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),D&&(0,c.jsx)(eY.Z,{color:"blue",size:"xs",children:"Regenerated"})]})]}),u&&eL.LQ.includes(u)&&(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(z.Z,{title:j?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,c.jsx)("span",{className:"inline-block",children:(0,c.jsx)(_.Z,{icon:e2.Z,variant:"secondary",onClick:()=>E(!0),className:"flex items-center",disabled:!j,children:"Regenerate Key"})})}),(0,c.jsx)(_.Z,{icon:el.Z,variant:"secondary",onClick:()=>S(!0),className:"flex items-center",children:"Delete Key"})]})]}),(0,c.jsx)(e9,{selectedToken:O,visible:C,onClose:()=>E(!1),accessToken:o,premiumUser:j,setAccessToken:f,onKeyUpdate:e=>{M(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),F(new Date),q(!0),h&&h({...e,created_at:new Date().toLocaleString()})}}),Z&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:V,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>S(!1),children:"Cancel"})]})]})]})}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"}),(0,c.jsx)(eW.Z,{children:"Settings"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Spend"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eR(O.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null!==O.max_budget?"$".concat(eR(O.max_budget)):"Unlimited"]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",null!==O.tpm_limit?O.tpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",null!==O.rpm_limit?O.rpm_limit:"Unlimited"]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:O.models&&O.models.length>0?O.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s)):(0,c.jsx)(w.Z,{children:"No models specified"})})]}),(0,c.jsx)(X.Z,{children:(0,c.jsx)(sa,{objectPermission:O.object_permission,variant:"inline",accessToken:o})}),(0,c.jsx)(sr,{loggingConfigs:e3(O.metadata),disabledCallbacks:Array.isArray(null===(s=O.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?ei(O.metadata.litellm_disabled_callbacks):[],variant:"card"})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Key Settings"}),!y&&u&&eL.LQ.includes(u)&&(0,c.jsx)(_.Z,{variant:"light",onClick:()=>b(!0),children:"Edit Settings"})]}),y?(0,c.jsx)(e7,{keyData:O,onCancel:()=>b(!1),onSubmit:U,teams:x,accessToken:o,userID:m,userRole:u}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Key ID"}),(0,c.jsx)(w.Z,{className:"font-mono",children:O.token_id||O.token})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Key Alias"}),(0,c.jsx)(w.Z,{children:O.key_alias||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Secret Key"}),(0,c.jsx)(w.Z,{className:"font-mono",children:O.key_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)(w.Z,{children:O.team_id||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization"}),(0,c.jsx)(w.Z,{children:O.organization_id||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:B(O.created_at)})]}),D&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Regenerated"}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:B(D)}),(0,c.jsx)(eY.Z,{color:"green",size:"xs",children:"Recent"})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Expires"}),(0,c.jsx)(w.Z,{children:O.expires?B(O.expires):"Never"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Spend"}),(0,c.jsxs)(w.Z,{children:["$",eR(O.spend,4)," USD"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Budget"}),(0,c.jsx)(w.Z,{children:null!==O.max_budget?"$".concat(eR(O.max_budget,2)):"Unlimited"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:O.models&&O.models.length>0?O.models.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,c.jsx)(w.Z,{children:"No models specified"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)(w.Z,{children:["TPM: ",null!==O.tpm_limit?O.tpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",null!==O.rpm_limit?O.rpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Max Parallel Requests:"," ",null!==O.max_parallel_requests?O.max_parallel_requests:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Model TPM Limits:"," ",(null===(t=O.metadata)||void 0===t?void 0:t.model_tpm_limit)?JSON.stringify(O.metadata.model_tpm_limit):"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Model RPM Limits:"," ",(null===(l=O.metadata)||void 0===l?void 0:l.model_rpm_limit)?JSON.stringify(O.metadata.model_rpm_limit):"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:e8(O.metadata)})]}),(0,c.jsx)(sa,{objectPermission:O.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o}),(0,c.jsx)(sr,{loggingConfigs:e3(O.metadata),disabledCallbacks:Array.isArray(null===(a=O.metadata)||void 0===a?void 0:a.litellm_disabled_callbacks)?ei(O.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}var sc=t(2356),sd=e=>{let{options:s,onApplyFilters:t,onResetFilters:l,initialValues:a={},buttonLabel:r="Filters"}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(a),[u,x]=(0,d.useState)({}),[h,p]=(0,d.useState)({}),[g,j]=(0,d.useState)({}),f=(0,d.useCallback)(eT()(async(e,s)=>{if(s.isSearchable&&s.searchFn){p(e=>({...e,[s.name]:!0}));try{let t=await s.searchFn(e);x(e=>({...e,[s.name]:t}))}catch(e){console.error("Error searching:",e),x(e=>({...e,[s.name]:[]}))}finally{p(e=>({...e,[s.name]:!1}))}}},300),[]),v=(e,s)=>{let l={...o,[e]:s};m(l),t(l)};return(0,c.jsxs)("div",{className:"w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(sc.Z,{className:"h-4 w-4"}),onClick:()=>n(!i),className:"flex items-center gap-2",children:r}),(0,c.jsx)(T.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),m(e),l()},children:"Reset Filters"})]}),i&&(0,c.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Key Hash","Model"].map(e=>{let t=s.find(s=>s.label===e||s.name===e);return t?(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsx)("label",{className:"text-sm text-gray-600",children:t.label||t.name}),t.isSearchable?(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(t.label||t.name,"..."),value:o[t.name]||void 0,onChange:e=>v(t.name,e),onSearch:e=>{j(s=>({...s,[t.name]:e})),t.searchFn&&f(e,t)},filterOption:!1,loading:h[t.name],options:u[t.name]||[],allowClear:!0}):t.options?(0,c.jsx)(C.default,{className:"w-full",placeholder:"Select ".concat(t.label||t.name,"..."),value:o[t.name]||void 0,onChange:e=>v(t.name,e),allowClear:!0,children:t.options.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))}):(0,c.jsx)(L.default,{className:"w-full",placeholder:"Enter ".concat(t.label||t.name,"..."),value:o[t.name]||"",onChange:e=>v(t.name,e.target.value),allowClear:!0})]},t.name):null})})]})},sm=t(16593);let su=async e=>{if(!e)return[];try{let s=[],t=1,l=!0;for(;l;){let a=await (0,g.keyListCall)(e,null,"",null,null,null,t,100),r=a.keys.map(e=>e.key_alias).filter(Boolean);s=[...s,...r],t<a.total_pages?t++:l=!1}return Array.from(new Set(s))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},sx=async(e,s)=>{if(!e)return[];try{let t=[],l=1,a=!0;for(;a;){let r=await (0,g.teamListCall)(e,s||null,null);t=[...t,...r],l<r.total_pages?l++:a=!1}return t}catch(e){return console.error("Error fetching all teams:",e),[]}},sh=async e=>{if(!e)return[];try{let s=[],t=1,l=!0;for(;l;){let a=await (0,g.organizationListCall)(e);s=[...s,...a],t<a.total_pages?t++:l=!1}return s}catch(e){return console.error("Error fetching all organizations:",e),[]}},sp=()=>{let[e,s]=(0,d.useState)("http://localhost:4000");return(0,d.useEffect)(()=>{{let{protocol:e,host:t}=window.location;s("".concat(e,"//").concat(t))}},[]),e};var sg=t(71594),sj=t(24525),sf=t(47323),sv=t(21626),s_=t(97214),sy=t(28241),sb=t(58834),sN=t(69552),sZ=t(71876),sw=t(86462),sk=t(47686),sS=t(44633),sC=t(49084);function sI(e){let{keys:s,setKeys:t,isLoading:l=!1,pagination:a,onPageChange:r,pageSize:i=50,teams:n,selectedTeam:o,setSelectedTeam:m,selectedKeyAlias:u,setSelectedKeyAlias:x,accessToken:h,userID:p,userRole:j,organizations:f,setCurrentOrg:v,refresh:y,onSortChange:b,currentSort:N,premiumUser:Z,setAccessToken:k}=e,[S,C]=(0,d.useState)(null),[I,P]=(0,d.useState)([]),[E,A]=d.useState(()=>N?[{id:N.sortBy,desc:"desc"===N.sortOrder}]:[{id:"created_at",desc:!0}]),[T,L]=(0,d.useState)({}),{filters:O,filteredKeys:M,allKeyAliases:D,allTeams:R,allOrganizations:q,handleFilterChange:U,handleFilterReset:V}=function(e){let{keys:s,teams:t,organizations:l,accessToken:a}=e,r={"Team ID":"","Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"},[i,n]=(0,d.useState)(r),[o,c]=(0,d.useState)(t||[]),[m,u]=(0,d.useState)(l||[]),[x,h]=(0,d.useState)(s),p=(0,d.useRef)(0),j=(0,d.useCallback)(eT()(async e=>{if(!a)return;let s=Date.now();p.current=s;try{let t=await (0,g.keyListCall)(a,e["Organization ID"]||null,e["Team ID"]||null,e["Key Alias"]||null,e["User ID"]||null,e["Key Hash"]||null,1,25,e["Sort By"]||null,e["Sort Order"]||null);s===p.current&&t&&(h(t.keys),console.log("called from debouncedSearch filters:",JSON.stringify(e)),console.log("called from debouncedSearch data:",JSON.stringify(t)))}catch(e){console.error("Error searching users:",e)}},300),[a]);(0,d.useEffect)(()=>{if(!s){h([]);return}let e=[...s];i["Team ID"]&&(e=e.filter(e=>e.team_id===i["Team ID"])),i["Organization ID"]&&(e=e.filter(e=>e.organization_id===i["Organization ID"])),h(e)},[s,i]),(0,d.useEffect)(()=>{let e=async()=>{let e=await sx(a);e.length>0&&c(e);let s=await sh(a);s.length>0&&u(s)};a&&e()},[a]);let f=(0,sm.a)({queryKey:["allKeys"],queryFn:async()=>{if(!a)throw Error("Access token required");return await su(a)},enabled:!!a}).data||[];return(0,d.useEffect)(()=>{t&&t.length>0&&c(e=>e.length<t.length?t:e)},[t]),(0,d.useEffect)(()=>{l&&l.length>0&&u(e=>e.length<l.length?l:e)},[l]),{filters:i,filteredKeys:x,allKeyAliases:f,allTeams:o,allOrganizations:m,handleFilterChange:e=>{n({"Team ID":e["Team ID"]||"","Organization ID":e["Organization ID"]||"","Key Alias":e["Key Alias"]||"","User ID":e["User ID"]||"","Sort By":e["Sort By"]||"created_at","Sort Order":e["Sort Order"]||"desc"}),j({...i,...e})},handleFilterReset:()=>{n(r),j(r)}}}({keys:s,teams:n,organizations:f,accessToken:h});(0,d.useEffect)(()=>{if(h){let e=s.map(e=>e.user_id).filter(e=>null!==e);(async()=>{P((await (0,g.userListCall)(h,e,1,100)).users)})()}},[h,s]),(0,d.useEffect)(()=>{if(y){let e=()=>{y()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},[y]);let K=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return s.getCanExpand()?(0,c.jsx)("button",{onClick:s.getToggleExpandedHandler(),style:{cursor:"pointer"},children:s.getIsExpanded()?"▼":"▶"}):null}},{id:"token",accessorKey:"token",header:"Key ID",cell:e=>(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.getValue(),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>C(e.getValue()),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",cell:e=>{let s=e.getValue();return(0,c.jsx)(z.Z,{title:s,children:s?s.length>20?"".concat(s.slice(0,20),"..."):s:"-"})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",cell:e=>(0,c.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"team_alias",accessorKey:"team_id",header:"Team Alias",cell:e=>{let{row:s,getValue:t}=e,l=t(),a=null==n?void 0:n.find(e=>e.team_id===l);return(null==a?void 0:a.team_alias)||"Unknown"}},{id:"team_id",accessorKey:"team_id",header:"Team ID",cell:e=>(0,c.jsx)(z.Z,{title:e.getValue(),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user_id",header:"User Email",cell:e=>{let s=e.getValue(),t=I.find(e=>e.user_id===s);return(null==t?void 0:t.user_email)?(0,c.jsx)(z.Z,{title:null==t?void 0:t.user_email,children:(0,c.jsxs)("span",{children:[null==t?void 0:t.user_email.slice(0,20),"..."]})}):"-"}},{id:"user_id",accessorKey:"user_id",header:"User ID",cell:e=>{let s=e.getValue();return s&&s.length>15?(0,c.jsx)(z.Z,{title:s,children:(0,c.jsxs)("span",{children:[s.slice(0,7),"..."]})}):s||"-"}},{id:"created_at",accessorKey:"created_at",header:"Created At",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",cell:e=>{let s=e.getValue();return s&&s.length>15?(0,c.jsx)(z.Z,{title:s,children:(0,c.jsxs)("span",{children:[s.slice(0,7),"..."]})}):s}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"Never"}},{id:"expires",accessorKey:"expires",header:"Expires",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",cell:e=>eR(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",cell:e=>{let s=e.getValue();return null===s?"Unlimited":"$".concat(eR(s))}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",cell:e=>{let s=e.getValue();return(0,c.jsx)("div",{className:"flex flex-col py-2",children:Array.isArray(s)?(0,c.jsx)("div",{className:"flex flex-col",children:0===s.length?(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[s.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sf.Z,{icon:T[e.row.id]?sw.Z:sk.Z,className:"cursor-pointer",size:"xs",onClick:()=>{L(s=>({...s,[e.row.id]:!s[e.row.id]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),s.length>3&&!T[e.row.id]&&(0,c.jsx)(eY.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",s.length-3," ",s.length-3==1?"more model":"more models"]})}),T[e.row.id]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:s.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:["TPM: ",null!==t.tpm_limit?t.tpm_limit:"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",null!==t.rpm_limit?t.rpm_limit:"Unlimited"]})]})}}];console.log("keys: ".concat(JSON.stringify(s)));let B=(0,sg.b7)({data:M,columns:K.filter(e=>"expander"!==e.id),state:{sorting:E},onSortingChange:e=>{let s="function"==typeof e?e(E):e;if(console.log("newSorting: ".concat(JSON.stringify(s))),A(s),s&&s.length>0){let e=s[0],t=e.id,l=e.desc?"desc":"asc";console.log("sortBy: ".concat(t,", sortOrder: ").concat(l)),U({...O,"Sort By":t,"Sort Order":l}),null==b||b(t,l)}},getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0,manualSorting:!1});return d.useEffect(()=>{N&&A([{id:N.sortBy,desc:"desc"===N.sortOrder}])},[N]),(0,c.jsx)("div",{className:"w-full h-full overflow-hidden",children:S?(0,c.jsx)(so,{keyId:S,onClose:()=>C(null),keyData:M.find(e=>e.token===S),onKeyDataUpdate:e=>{t(s=>s.map(s=>s.token===e.token?eF(s,e):s)),y&&y()},onDelete:()=>{t(e=>e.filter(e=>e.token!==S)),y&&y()},accessToken:h,userID:p,userRole:j,teams:R,premiumUser:Z,setAccessToken:k}):(0,c.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,c.jsx)("div",{className:"w-full mb-6",children:(0,c.jsx)(sd,{options:[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>R&&0!==R.length?R.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Organization ID",label:"Organization ID",isSearchable:!0,searchFn:async e=>q&&0!==q.length?q.filter(s=>{var t,l;return null!==(l=null===(t=s.organization_id)||void 0===t?void 0:t.toLowerCase().includes(e.toLowerCase()))&&void 0!==l&&l}).filter(e=>null!==e.organization_id&&void 0!==e.organization_id).map(e=>({label:"".concat(e.organization_id||"Unknown"," (").concat(e.organization_id,")"),value:e.organization_id})):[]},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>D.filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))},{name:"User ID",label:"User ID",isSearchable:!1},{name:"Key Hash",label:"Key Hash",isSearchable:!1}],onApplyFilters:U,initialValues:O,onResetFilters:V})}),(0,c.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[(0,c.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",l?"...":"".concat((a.currentPage-1)*i+1," - ").concat(Math.min(a.currentPage*i,a.totalCount))," of ",l?"...":a.totalCount," results"]}),(0,c.jsxs)("div",{className:"inline-flex items-center gap-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",l?"...":a.currentPage," of ",l?"...":a.totalPages]}),(0,c.jsx)("button",{onClick:()=>r(a.currentPage-1),disabled:l||1===a.currentPage,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>r(a.currentPage+1),disabled:l||a.currentPage===a.totalPages,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,c.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sv.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sb.Z,{children:B.getHeaderGroups().map(e=>(0,c.jsx)(sZ.Z,{children:e.headers.map(e=>(0,c.jsx)(sN.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(s_.Z,{children:l?(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:K.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"\uD83D\uDE85 Loading keys..."})})})}):M.length>0?B.getRowModel().rows.map(e=>(0,c.jsx)(sZ.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(sy.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("models"===e.column.id&&e.getValue().length>3?"px-0":""),children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:K.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No keys found"})})})})})]})})})})]})})}var sP=e=>{let{userID:s,userRole:t,accessToken:l,selectedTeam:a,setSelectedTeam:r,data:i,setData:n,teams:o,premiumUser:m,currentOrg:u,organizations:x,setCurrentOrg:h,selectedKeyAlias:p,setSelectedKeyAlias:j,createClicked:b,setAccessToken:N}=e,[Z,C]=(0,d.useState)(!1),[A,T]=(0,d.useState)(!1),[L,O]=(0,d.useState)(null),[M,F]=(0,d.useState)(null),[R,U]=(0,d.useState)(null),[z,V]=(0,d.useState)((null==a?void 0:a.team_id)||"");(0,d.useEffect)(()=>{V((null==a?void 0:a.team_id)||"")},[a]);let{keys:K,isLoading:B,error:G,pagination:H,refresh:J,setKeys:Y}=eH({selectedTeam:a||void 0,currentOrg:u,selectedKeyAlias:p,accessToken:l||"",createClicked:b}),[W,$]=(0,d.useState)(!1),[Q,X]=(0,d.useState)(!1),[ee,es]=(0,d.useState)(null),[et,el]=(0,d.useState)([]),ea=new Set,[er,ei]=(0,d.useState)(!1),[en,eo]=(0,d.useState)(!1),[ec,ed]=(0,d.useState)(null),[em,eu]=(0,d.useState)(null),[ex]=I.Z.useForm(),[eh,ep]=(0,d.useState)(null),[eg,ej]=(0,d.useState)(ea),[ef,ev]=(0,d.useState)([]);(0,d.useEffect)(()=>{console.log("in calculateNewExpiryTime for selectedToken",ee),(null==em?void 0:em.duration)?ep((e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,eG.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,eG.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,eG.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}catch(e){return null}})(em.duration)):ep(null),console.log("calculateNewExpiryTime:",eh)},[ee,null==em?void 0:em.duration]),(0,d.useEffect)(()=>{(async()=>{try{if(null===s||null===t||null===l)return;let e=await D(s,t,l);e&&el(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,s,t]),(0,d.useEffect)(()=>{if(o){let e=new Set;o.forEach((s,t)=>{let l=s.team_id;e.add(l)}),ej(e)}},[o]);let e_=async()=>{if(null!=L&&null!=i){try{if(!l)return;await (0,g.keyDeleteCall)(l,L);let e=i.filter(e=>e.token!==L);n(e)}catch(e){console.error("Error deleting the key:",e)}T(!1),O(null)}},ey=(e,s)=>{eu(t=>({...t,[e]:s}))},eb=async()=>{if(!m){P.ZP.error("Regenerate API Key is an Enterprise feature. Please upgrade to use this feature.");return}if(null!=ee)try{let e=await ex.validateFields();if(!l)return;let s=await (0,g.regenerateKeyCall)(l,ee.token||ee.token_id,e);if(ed(s.key),i){let t=i.map(t=>t.token===(null==ee?void 0:ee.token)?{...t,key_name:s.key_name,...e}:t);n(t)}eo(!1),ex.resetFields(),P.ZP.success("API Key regenerated successfully")}catch(e){console.error("Error regenerating key:",e),P.ZP.error("Failed to regenerate API Key")}};return(0,c.jsxs)("div",{children:[(0,c.jsx)(sI,{keys:K,setKeys:Y,isLoading:B,pagination:H,onPageChange:e=>{J({page:e})},pageSize:100,teams:o,selectedTeam:a,setSelectedTeam:r,accessToken:l,userID:s,userRole:t,organizations:x,setCurrentOrg:h,refresh:J,selectedKeyAlias:p,setSelectedKeyAlias:j,premiumUser:m,setAccessToken:N}),A&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key ?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:e_,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{T(!1),O(null)},children:"Cancel"})]})]})]})}),(0,c.jsx)(E.Z,{title:"Regenerate API Key",visible:en,onCancel:()=>{eo(!1),ex.resetFields()},footer:[(0,c.jsx)(_.Z,{onClick:()=>{eo(!1),ex.resetFields()},className:"mr-2",children:"Cancel"},"cancel"),(0,c.jsx)(_.Z,{onClick:eb,disabled:!m,children:m?"Regenerate":"Upgrade to Regenerate"},"regenerate")],children:m?(0,c.jsxs)(I.Z,{form:ex,layout:"vertical",onValuesChange:(e,s)=>{"duration"in e&&ey("duration",e.duration)},children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,c.jsx)(y.Z,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry:"," ",(null==ee?void 0:ee.expires)!=null?new Date(ee.expires).toLocaleString():"Never"]}),eh&&(0,c.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",eh]})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,c.jsx)(_.Z,{variant:"primary",className:"mb-2",children:(0,c.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",children:"Get Free Trial"})})]})}),ec&&(0,c.jsx)(E.Z,{visible:!!ec,onCancel:()=>ed(null),footer:[(0,c.jsx)(_.Z,{onClick:()=>ed(null),children:"Close"},"close")],children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Regenerated Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons, ",(0,c.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,c.jsxs)(f.Z,{numColSpan:1,children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"Key Alias:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:(null==ee?void 0:ee.key_alias)||"No alias set"})}),(0,c.jsx)(w.Z,{className:"mt-3",children:"New API Key:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:ec})}),(0,c.jsx)(S.CopyToClipboard,{text:ec,onCopy:()=>P.ZP.success("API Key copied to clipboard"),children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]})]})})]})},sE=t(12011),sA=t(3914),sT=e=>{let{userID:s,userRole:t,teams:l,keys:a,setUserRole:r,userEmail:i,setUserEmail:n,setTeams:o,setKeys:x,premiumUser:h,organizations:p,addKey:_,createClicked:y}=e,[b,N]=(0,d.useState)(null),[Z,w]=(0,d.useState)(null),k=(0,m.useSearchParams)(),S=function(e){console.log("COOKIES",document.cookie);let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));return s?s.split("=")[1]:null}("token"),C=k.get("invitation_id"),[I,P]=(0,d.useState)(null),[E,A]=(0,d.useState)(null),[T,L]=(0,d.useState)([]),[O,M]=(0,d.useState)(null),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)(null);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,d.useEffect)(()=>{if(S){let e=(0,u.o)(S);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),P(e.key),e.user_role){let s=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";case"internal_user":return"Internal User";case"internal_user_viewer":return"Internal Viewer";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",s),r(s)}else console.log("User role not defined");e.user_email?n(e.user_email):console.log("User Email is not set ".concat(e))}}if(s&&I&&t&&!a&&!b){let e=sessionStorage.getItem("userModels"+s);e?L(JSON.parse(e)):(console.log("currentOrg: ".concat(JSON.stringify(Z))),(async()=>{try{let e=await (0,g.getProxyUISettings)(I);M(e);let l=await (0,g.userInfoCall)(I,s,t,!1,null,null);N(l.user_info),console.log("userSpendData: ".concat(JSON.stringify(b))),(null==l?void 0:l.teams[0].keys)?x(l.keys.concat(l.teams.filter(e=>"Admin"===t||e.user_id===s).flatMap(e=>e.keys))):x(l.keys),sessionStorage.setItem("userData"+s,JSON.stringify(l.keys)),sessionStorage.setItem("userSpendData"+s,JSON.stringify(l.user_info));let a=(await (0,g.modelAvailableCall)(I,s,t)).data.map(e=>e.id);console.log("available_model_names:",a),L(a),console.log("userModels:",T),sessionStorage.setItem("userModels"+s,JSON.stringify(a))}catch(e){console.error("There was an error fetching the data",e),e.message.includes("Invalid proxy server token passed")&&U()}})(),j(I,s,t,Z,o))}},[s,S,I,a,t]),(0,d.useEffect)(()=>{I&&(async()=>{try{let e=await (0,g.keyInfoCall)(I,[I]);console.log("keyInfo: ",e)}catch(e){e.message.includes("Invalid proxy server token passed")&&U()}})()},[I]),(0,d.useEffect)(()=>{console.log("currentOrg: ".concat(JSON.stringify(Z),", accessToken: ").concat(I,", userID: ").concat(s,", userRole: ").concat(t)),I&&(console.log("fetching teams"),j(I,s,t,Z,o))},[Z]),(0,d.useEffect)(()=>{if(null!==a&&null!=D&&null!==D.team_id){let e=0;for(let s of(console.log("keys: ".concat(JSON.stringify(a))),a))D.hasOwnProperty("team_id")&&null!==s.team_id&&s.team_id===D.team_id&&(e+=s.spend);console.log("sum: ".concat(e)),A(e)}else if(null!==a){let e=0;for(let s of a)e+=s.spend;A(e)}},[D]),null!=C)return(0,c.jsx)(sE.default,{});function U(){(0,sA.b)();let e=(0,g.getProxyBaseUrl)();console.log("proxyBaseUrl:",e);let s=e?"".concat(e,"/sso/key/generate"):"/sso/key/generate";return console.log("Full URL:",s),window.location.href=s,null}if(null==S)return console.log("All cookies before redirect:",document.cookie),U(),null;try{let e=(0,u.o)(S);console.log("Decoded token:",e);let s=e.exp,t=Math.floor(Date.now()/1e3);if(s&&t>=s)return console.log("Token expired, redirecting to login"),U(),null}catch(e){return console.error("Error decoding token:",e),(0,sA.b)(),U(),null}if(null==I)return null;if(null==s)return(0,c.jsx)("h1",{children:"User ID is not set"});if(null==t&&r("App Owner"),t&&"Admin Viewer"==t){let{Title:e,Paragraph:s}=eh.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",D),console.log("All cookies after redirect:",document.cookie),(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,c.jsx)(eB,{userID:s,team:D,teams:l,userRole:t,accessToken:I,data:a,addKey:_,premiumUser:h},D?D.team_id:null),(0,c.jsx)(sP,{userID:s,userRole:t,accessToken:I,selectedTeam:D||null,setSelectedTeam:F,selectedKeyAlias:R,setSelectedKeyAlias:q,data:a,setData:x,premiumUser:h,teams:l,currentOrg:Z,setCurrentOrg:w,organizations:p,createClicked:y,setAccessToken:P})]})})})},sL=t(97765),sO=t(42673);let sM=async(e,s,t)=>{try{console.log("handling submit for formValues:",e);let s=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,l=sO.fK[t]+"/*";e.model_name=l,s.push({public_name:l,litellm_model:l}),e.model=l}let t=[];for(let l of s){let s={},a={},r=l.public_name;for(let[t,r]of(s.model=l.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),s.model=l.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==r&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)s.model=r;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",r);let e=sO.fK[r];s.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)a[t]=r;else if("team_id"===t)a.team_id=r;else if("model_access_group"===t)a.access_groups=r;else if("mode"==t)console.log("placing mode in modelInfo"),a.mode=r,delete s.mode;else if("custom_model_name"===t)s.model=r;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw P.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,l]of Object.entries(e))s[t]=l}}else if("model_info_params"==t){console.log("model_info_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw P.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[s,t]of Object.entries(e))a[s]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){r&&(s[t]=Number(r));continue}else s[t]=r}t.push({litellmParamsObj:s,modelInfoObj:a,modelName:r})}return t}catch(e){P.ZP.error("Failed to create model: "+e,10)}},sD=async(e,s,t,l)=>{try{let a=await sM(e,s,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:l,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:l},i=await (0,g.modelCreateCall)(s,r);console.log("response for model create call: ".concat(i.data))}l&&l(),t.resetFields()}catch(e){P.ZP.error("Failed to add model: "+e,10)}};var sF=t(53410),sR=t(47451),sq=t(69410);let{Link:sU}=eh.default,sz={[sO.Cl.OpenAI]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sO.Cl.OpenAI_Text]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sO.Cl.Vertex_AI]:[{key:"vertex_project",label:"Vertex Project",placeholder:"adroit-cadet-1234..",required:!0},{key:"vertex_location",label:"Vertex Location",placeholder:"us-east-1",required:!0},{key:"vertex_credentials",label:"Vertex Credentials",required:!0,type:"upload"}],[sO.Cl.AssemblyAI]:[{key:"api_base",label:"API Base",type:"select",required:!0,options:["https://api.assemblyai.com","https://api.eu.assemblyai.com"]},{key:"api_key",label:"AssemblyAI API Key",type:"password",required:!0}],[sO.Cl.Azure]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_version",label:"API Version",placeholder:"2023-07-01-preview",tooltip:"By default litellm will use the latest version. If you want to use a different version, you can specify it here"},{key:"base_model",label:"Base Model",placeholder:"azure/gpt-3.5-turbo"},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[sO.Cl.Azure_AI_Studio]:[{key:"api_base",label:"API Base",placeholder:"https://<test>.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",tooltip:"Enter your full Target URI from Azure Foundry here. Example: https://litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",required:!0},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[sO.Cl.OpenAI_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sO.Cl.OpenAI_Text_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sO.Cl.Bedrock]:[{key:"aws_access_key_id",label:"AWS Access Key ID",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_secret_access_key",label:"AWS Secret Access Key",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_region_name",label:"AWS Region Name",placeholder:"us-east-1",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."}],[sO.Cl.Ollama]:[{key:"api_base",label:"API Base",placeholder:"http://localhost:11434",defaultValue:"http://localhost:11434",required:!1,tooltip:"The base URL for your Ollama server. Defaults to http://localhost:11434 if not specified."}],[sO.Cl.Anthropic]:[{key:"api_key",label:"API Key",placeholder:"sk-",type:"password",required:!0}],[sO.Cl.Deepgram]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.ElevenLabs]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Google_AI_Studio]:[{key:"api_key",label:"API Key",placeholder:"aig-",type:"password",required:!0}],[sO.Cl.Groq]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.MistralAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Deepseek]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Cohere]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Databricks]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.xAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Cerebras]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Sambanova]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Perplexity]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.TogetherAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Openrouter]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.FireworksAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Triton]:[{key:"api_key",label:"API Key",type:"password",required:!1},{key:"api_base",label:"API Base",placeholder:"http://localhost:8000/generate",required:!1}]};var sV=e=>{let{selectedProvider:s,uploadProps:t}=e,l=sO.Cl[s],a=I.Z.useFormInstance(),r=d.useMemo(()=>sz[l]||[],[l]),i={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let s=new FileReader;s.onload=e=>{if(e.target){let s=e.target.result;console.log("Setting field value from JSON, length: ".concat(s.length)),a.setFieldsValue({vertex_credentials:s}),console.log("Form values after setting:",a.getFieldsValue())}},s.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",a.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,c.jsx)(c.Fragment,{children:r.map(e=>{var s;return(0,c.jsxs)(d.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,c.jsx)(C.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(s=e.options)||void 0===s?void 0:s.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,c.jsx)(eg.default,{...i,onChange:s=>{(null==t?void 0:t.onChange)&&t.onChange(s),setTimeout(()=>{let s=a.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(s))},500)},children:(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(eN.Z,{}),children:"Click to Upload"})}):(0,c.jsx)(y.Z,{placeholder:e.placeholder,type:"password"===e.type?"password":"text"})}),"vertex_credentials"===e.key&&(0,c.jsx)(sR.Z,{children:(0,c.jsx)(sq.Z,{children:(0,c.jsx)(w.Z,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,c.jsxs)(sR.Z,{children:[(0,c.jsx)(sq.Z,{span:10}),(0,c.jsx)(sq.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,c.jsx)(sU,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})})};let{Title:sK,Link:sB}=eh.default;var sG=e=>{let{isVisible:s,onCancel:t,onAddCredential:l,onUpdateCredential:a,uploadProps:r,addOrEdit:i,existingCredential:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(sO.Cl.OpenAI),[x,h]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{n&&(o.setFieldsValue({credential_name:n.credential_name,custom_llm_provider:n.credential_info.custom_llm_provider,api_base:n.credential_values.api_base,api_version:n.credential_values.api_version,base_model:n.credential_values.base_model,api_key:n.credential_values.api_key}),u(n.credential_info.custom_llm_provider))},[n]),(0,c.jsx)(E.Z,{title:"add"===i?"Add New Credential":"Edit Credential",visible:s,onCancel:()=>{t(),o.resetFields()},footer:null,width:600,children:(0,c.jsxs)(I.Z,{form:o,onFinish:e=>{let s=Object.entries(e).reduce((e,s)=>{let[t,l]=s;return""!==l&&null!=l&&(e[t]=l),e},{});"add"===i?l(s):a(s),o.resetFields()},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==n?void 0:n.credential_name,children:(0,c.jsx)(y.Z,{placeholder:"Enter a friendly name for these credentials",disabled:null!=n&&!!n.credential_name})}),(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,c.jsx)(C.default,{showSearch:!0,onChange:e=>{u(e),o.setFieldValue("custom_llm_provider",e)},children:Object.entries(sO.Cl).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sO.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(sV,{selectedProvider:m,uploadProps:r}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(sB,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:()=>{t(),o.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"add"===i?"Add Credential":"Update Credential"})]})]})]})})},sH=e=>{let{accessToken:s,uploadProps:t,credentialList:l,fetchCredentials:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(null),[x]=I.Z.useForm(),h=["credential_name","custom_llm_provider"],p=async e=>{if(!s)return;let t=Object.entries(e).filter(e=>{let[s]=e;return!h.includes(s)}).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:l}},{}),l={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,g.credentialUpdateCall)(s,e.credential_name,l),P.ZP.success("Credential updated successfully"),o(!1),a(s)},j=async e=>{if(!s)return;let t=Object.entries(e).filter(e=>{let[s]=e;return!h.includes(s)}).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:l}},{}),l={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,g.credentialCreateCall)(s,l),P.ZP.success("Credential added successfully"),i(!1),a(s)};(0,d.useEffect)(()=>{s&&a(s)},[s]);let f=e=>{let s={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=s[e.toLowerCase()]||s.default;return(0,c.jsx)(eY.Z,{color:t,size:"xs",children:e})},v=async e=>{s&&(await (0,g.credentialDeleteCall)(s,e),P.ZP.success("Credential deleted successfully"),a(s))};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(w.Z,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,c.jsx)(X.Z,{children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Credential Name"}),(0,c.jsx)(sN.Z,{children:"Provider"}),(0,c.jsx)(sN.Z,{children:"Description"})]})}),(0,c.jsx)(s_.Z,{children:l&&0!==l.length?l.map((e,s)=>{var t,l;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.credential_name}),(0,c.jsx)(sy.Z,{children:f((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,c.jsx)(sy.Z,{children:(null===(l=e.credential_info)||void 0===l?void 0:l.description)||"-"}),(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(_.Z,{icon:sF.Z,variant:"light",size:"sm",onClick:()=>{u(e),o(!0)}}),(0,c.jsx)(_.Z,{icon:el.Z,variant:"light",size:"sm",onClick:()=>v(e.credential_name)})]})]},s)}):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),(0,c.jsx)(_.Z,{onClick:()=>i(!0),className:"mt-4",children:"Add Credential"}),r&&(0,c.jsx)(sG,{onAddCredential:j,isVisible:r,onCancel:()=>i(!1),uploadProps:t,addOrEdit:"add",onUpdateCredential:p,existingCredential:null}),n&&(0,c.jsx)(sG,{onAddCredential:j,isVisible:n,existingCredential:m,onUpdateCredential:p,uploadProps:t,onCancel:()=>o(!1),addOrEdit:"edit"})]})};let sJ=e=>{var s;return(null==e?void 0:null===(s=e.model_info)||void 0===s?void 0:s.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var sY=t(53003),sW=e=>{let{value:s,onValueChange:t,label:l="Select Time Range",className:a="",showTimeRange:r=!0}=e;return(0,c.jsxs)("div",{className:a,children:[l&&(0,c.jsx)(w.Z,{className:"mb-2",children:l}),(0,c.jsx)(sY.Z,{enableSelect:!0,value:s,onValueChange:e=>{if(e.from){let s;let l={...e},a=new Date(e.from);s=new Date(e.to?e.to:e.from),a.toDateString(),s.toDateString(),a.setHours(0,0,0,0),s.setHours(23,59,59,999),l.from=a,l.to=s,t(l)}else t(e)}}),r&&s.from&&s.to&&(0,c.jsx)(w.Z,{className:"mt-1 text-xs text-gray-500",children:((e,s)=>{if(!e||!s)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==s.toDateString())return"".concat(t(e)," - ").concat(t(s));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),l=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(l," - ").concat(a)}})(s.from,s.to)})]})},s$=t(75105),sQ=t(40278),sX=t(14301),s0=t(59664),s1=e=>{let{modelMetrics:s,modelMetricsCategories:t,customTooltip:l,premiumUser:a}=e;return(0,c.jsx)(s0.Z,{title:"Time to First token (s)",className:"h-72",data:s,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:l})},s2=e=>{let{teamData:s,canEditTeam:t,handleMemberDelete:l,setSelectedEditMember:a,setIsEditMemberModalVisible:r,setIsAddMemberModalVisible:i}=e,n=e=>{if(null==e)return"0";if("number"==typeof e){let s=Number(e);return s===Math.floor(s)?s.toString():eR(s,8).replace(/\.?0+$/,"")}return"0"},o=e=>{if(!e)return 0;let t=s.team_memberships.find(s=>s.user_id===e);return(null==t?void 0:t.spend)||0},d=e=>{var t;if(!e)return null;let l=s.team_memberships.find(s=>s.user_id===e);console.log("membership=".concat(l));let a=null==l?void 0:null===(t=l.litellm_budget_table)||void 0===t?void 0:t.max_budget;return null==a?null:n(a)};return(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(X.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"User ID"}),(0,c.jsx)(sN.Z,{children:"User Email"}),(0,c.jsx)(sN.Z,{children:"Role"}),(0,c.jsxs)(sN.Z,{children:["Team Member Spend (USD)"," ",(0,c.jsx)(z.Z,{title:"This is the amount spent by a user in the team.",children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(sN.Z,{children:"Team Member Budget (USD)"}),(0,c.jsx)(sN.Z,{})]})}),(0,c.jsx)(s_.Z,{children:s.team_info.members_with_roles.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_id})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.role})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{className:"font-mono",children:["$",eR(o(e.user_id),4)]})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:d(e.user_id)?"$".concat(eR(Number(d(e.user_id)),4)):"No Limit"})}),(0,c.jsx)(sy.Z,{children:t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{a(e),r(!0)}}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>l(e)})]})})]},s))})]})}),(0,c.jsx)(_.Z,{onClick:()=>i(!0),children:"Add Member"})]})},s4=t(61994),s5=t(85180),s6=t(89245),s3=t(78355);let s8={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team"},s7=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",s9=e=>{let s=s7(e),t=s8[e];if(!t){for(let[s,l]of Object.entries(s8))if(e.includes(s)){t=l;break}}return t||(t="Access ".concat(e)),{method:s,endpoint:e,description:t,route:e}};var te=e=>{let{teamId:s,accessToken:t,canEditTeam:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)([]),[o,m]=(0,d.useState)(!0),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),j=async()=>{try{if(m(!0),!t)return;let e=await (0,g.getTeamPermissionsCall)(t,s),l=e.all_available_permissions||[];r(l);let a=e.team_member_permissions||[];n(a),p(!1)}catch(e){P.ZP.error("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{m(!1)}};(0,d.useEffect)(()=>{j()},[s,t]);let f=(e,s)=>{n(s?[...i,e]:i.filter(s=>s!==e)),p(!0)},v=async()=>{try{if(!t)return;x(!0),await (0,g.teamPermissionsUpdateCall)(t,s,i),P.ZP.success("Permissions updated successfully"),p(!1)}catch(e){P.ZP.error("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(o)return(0,c.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let y=a.length>0;return(0,c.jsxs)(X.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,c.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,c.jsx)(k.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),l&&h&&(0,c.jsxs)("div",{className:"flex gap-3",children:[(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(s6.Z,{}),onClick:()=>{j()},children:"Reset"}),(0,c.jsxs)(_.Z,{onClick:v,loading:u,className:"flex items-center gap-2",children:[(0,c.jsx)(s3.Z,{})," Save Changes"]})]})]}),(0,c.jsx)(w.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),y?(0,c.jsxs)(sv.Z,{className:"mt-4",children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Method"}),(0,c.jsx)(sN.Z,{children:"Endpoint"}),(0,c.jsx)(sN.Z,{children:"Description"}),(0,c.jsx)(sN.Z,{className:"text-right",children:"Access"})]})}),(0,c.jsx)(s_.Z,{children:a.map(e=>{let s=s9(e);return(0,c.jsxs)(sZ.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===s.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:s.method})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)("span",{className:"font-mono text-sm text-gray-800",children:s.endpoint})}),(0,c.jsx)(sy.Z,{className:"text-gray-700",children:s.description}),(0,c.jsx)(sy.Z,{className:"text-right",children:(0,c.jsx)(s4.Z,{checked:i.includes(e),onChange:s=>f(e,s.target.checked),disabled:!l})})]},e)})})]}):(0,c.jsx)("div",{className:"py-12",children:(0,c.jsx)(s5.Z,{description:"No permissions available"})})]})},ts=e=>{var s,t,l;let{visible:a,onCancel:r,onSubmit:i,initialData:n,mode:o,config:m}=e,[u]=I.Z.useForm();console.log("Initial Data:",n),(0,d.useEffect)(()=>{if(a){if("edit"===o&&n)u.setFieldsValue({...n,role:n.role||m.defaultRole});else{var e;u.resetFields(),u.setFieldsValue({role:m.defaultRole||(null===(e=m.roleOptions[0])||void 0===e?void 0:e.value)})}}},[a,n,o,u,m.defaultRole,m.roleOptions]);let x=async e=>{try{let s=Object.entries(e).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:"string"==typeof l?l.trim():l}},{});i(s),u.resetFields()}catch(e){console.error("Form submission error:",e)}},h=e=>{switch(e.type){case"input":return(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",onChange:e=>{e.target.value=e.target.value.trim()}});case"select":var s;return(0,c.jsx)(C.default,{children:null===(s=e.options)||void 0===s?void 0:s.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))});default:return null}};return(0,c.jsx)(E.Z,{title:m.title||("add"===o?"Add Member":"Edit Member"),open:a,width:800,footer:null,onCancel:r,children:(0,c.jsxs)(I.Z,{form:u,onFinish:x,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[m.showEmail&&(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",placeholder:"[email protected]",onChange:e=>{e.target.value=e.target.value.trim()}})}),m.showEmail&&m.showUserId&&(0,c.jsx)("div",{className:"text-center mb-4",children:(0,c.jsx)(w.Z,{children:"OR"})}),m.showUserId&&(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",placeholder:"user_123",onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{children:"Role"}),"edit"===o&&n&&(0,c.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(t=n.role,(null===(l=m.roleOptions.find(e=>e.value===t))||void 0===l?void 0:l.label)||t),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,c.jsx)(C.default,{children:"edit"===o&&n?[...m.roleOptions.filter(e=>e.value===n.role),...m.roleOptions.filter(e=>e.value!==n.role)].map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value)):m.roleOptions.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))})}),null===(s=m.additionalFields)||void 0===s?void 0:s.map(e=>(0,c.jsx)(I.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:h(e)},e.name)),(0,c.jsxs)("div",{className:"text-right mt-6",children:[(0,c.jsx)(T.ZP,{onClick:r,className:"mr-2",children:"Cancel"}),(0,c.jsx)(T.ZP,{type:"default",htmlType:"submit",children:"add"===o?"Add Member":"Save Changes"})]})]})})},tt=e=>{let{isVisible:s,onCancel:t,onSubmit:l,accessToken:a,title:r="Add Team Member",roles:i=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:n="user"}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)("user_email"),f=async(e,s)=>{if(!e){u([]);return}h(!0);try{let t=new URLSearchParams;if(t.append(s,e),null==a)return;let l=(await (0,g.userFilterUICall)(a,t)).map(e=>({label:"user_email"===s?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===s?e.user_email:e.user_id,user:e}));u(l)}catch(e){console.error("Error fetching users:",e)}finally{h(!1)}},v=(0,d.useCallback)(eT()((e,s)=>f(e,s),300),[]),_=(e,s)=>{j(s),v(e,s)},y=(e,s)=>{let t=s.user;o.setFieldsValue({user_email:t.user_email,user_id:t.user_id,role:o.getFieldValue("role")})};return(0,c.jsx)(E.Z,{title:r,open:s,onCancel:()=>{o.resetFields(),u([]),t()},footer:null,width:800,children:(0,c.jsxs)(I.Z,{form:o,onFinish:l,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:n},children:[(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>_(e,"user_email"),onSelect:(e,s)=>y(e,s),options:"user_email"===p?m:[],loading:x,allowClear:!0})}),(0,c.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>_(e,"user_id"),onSelect:(e,s)=>y(e,s),options:"user_id"===p?m:[],loading:x,allowClear:!0})}),(0,c.jsx)(I.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,c.jsx)(C.default,{defaultValue:n,children:i.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:(0,c.jsxs)(z.Z,{title:e.description,children:[(0,c.jsx)("span",{className:"font-medium",children:e.label}),(0,c.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,c.jsx)("div",{className:"text-right mt-4",children:(0,c.jsx)(T.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})},tl=e=>{var s,t,l,a,r,i,n,o,m,u,x;let{teamId:h,onClose:p,accessToken:j,is_team_admin:f,is_proxy_admin:b,userModels:N,editTeam:Z,premiumUser:S=!1,onUpdate:E}=e,[A,O]=(0,d.useState)(null),[D,R]=(0,d.useState)(!0),[q,V]=(0,d.useState)(!1),[K]=I.Z.useForm(),[B,G]=(0,d.useState)(!1),[J,W]=(0,d.useState)(null),[$,Q]=(0,d.useState)(!1),[ee,es]=(0,d.useState)([]),[et,el]=(0,d.useState)(!1),[ea,er]=(0,d.useState)({}),[ei,en]=(0,d.useState)([]);console.log("userModels in team info",N);let eo=f||b,ec=async()=>{try{if(R(!0),!j)return;let e=await (0,g.teamInfoCall)(j,h);O(e)}catch(e){P.ZP.error("Failed to load team information"),console.error("Error fetching team info:",e)}finally{R(!1)}};(0,d.useEffect)(()=>{ec()},[h,j]),(0,d.useEffect)(()=>{(async()=>{try{if(!j)return;let e=(await (0,g.getGuardrailsList)(j)).guardrails.map(e=>e.guardrail_name);en(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[j]);let ed=async e=>{try{if(null==j)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.teamMemberAddCall)(j,h,s),P.ZP.success("Team member added successfully"),V(!1),K.resetFields();let t=await (0,g.teamInfoCall)(j,h);O(t),E(t)}catch(a){var s,t,l;let e="Failed to add team member";(null==a?void 0:null===(l=a.raw)||void 0===l?void 0:null===(t=l.detail)||void 0===t?void 0:null===(s=t.error)||void 0===s?void 0:s.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==a?void 0:a.message)&&(e=a.message),P.ZP.error(e),console.error("Error adding team member:",a)}},em=async e=>{try{if(null==j)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};P.ZP.destroy(),await (0,g.teamMemberUpdateCall)(j,h,s),P.ZP.success("Team member updated successfully"),G(!1);let t=await (0,g.teamInfoCall)(j,h);O(t),E(t)}catch(l){var s,t;let e="Failed to update team member";(null==l?void 0:null===(t=l.raw)||void 0===t?void 0:null===(s=t.detail)||void 0===s?void 0:s.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==l?void 0:l.message)&&(e=l.message),G(!1),P.ZP.destroy(),P.ZP.error(e),console.error("Error updating team member:",l)}},eu=async e=>{try{if(null==j)return;await (0,g.teamMemberDeleteCall)(j,h,e),P.ZP.success("Team member removed successfully");let s=await (0,g.teamInfoCall)(j,h);O(s),E(s)}catch(e){P.ZP.error("Failed to remove team member"),console.error("Error removing team member:",e)}},ex=async e=>{try{if(!j)return;let s={};try{s=e.metadata?JSON.parse(e.metadata):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={team_id:h,team_alias:e.team_alias,models:e.models,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...s,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};void 0!==e.team_member_budget&&(t.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(t.team_member_key_duration=e.team_member_key_duration);let{servers:l,accessGroups:a}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};(l&&l.length>0||a&&a.length>0)&&(t.object_permission={},l&&l.length>0&&(t.object_permission.mcp_servers=l),a&&a.length>0&&(t.object_permission.mcp_access_groups=a)),delete e.mcp_servers_and_groups,await (0,g.teamUpdateCall)(j,t),P.ZP.success("Team settings updated successfully"),Q(!1),ec()}catch(e){console.error("Error updating team:",e)}};if(D)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==A?void 0:A.team_info))return(0,c.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:eh}=A,ep=async(e,s)=>{await eq(e)&&(er(e=>({...e,[s]:!0})),setTimeout(()=>{er(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:p,className:"mb-4",children:"Back to Teams"}),(0,c.jsx)(k.Z,{children:eh.team_alias}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:eh.team_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:ea["team-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>ep(eh.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(ea["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:Z?3:0,children:[(0,c.jsx)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"},"overview"),...eo?[(0,c.jsx)(eW.Z,{children:"Members"},"members"),(0,c.jsx)(eW.Z,{children:"Member Permissions"},"member-permissions"),(0,c.jsx)(eW.Z,{children:"Settings"},"settings")]:[]]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Budget Status"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eR(eh.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null===eh.max_budget?"Unlimited":"$".concat(eR(eh.max_budget,4))]}),eh.budget_duration&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Reset: ",eh.budget_duration]}),(0,c.jsx)("br",{}),eh.team_member_budget_table&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Team Member Budget: $",eR(eh.team_member_budget_table.max_budget,4)]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",eh.tpm_limit||"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",eh.rpm_limit||"Unlimited"]}),eh.max_parallel_requests&&(0,c.jsxs)(w.Z,{children:["Max Parallel Requests: ",eh.max_parallel_requests]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===eh.models.length?(0,c.jsx)(eY.Z,{color:"red",children:"All proxy models"}):eh.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["User Keys: ",A.keys.filter(e=>e.user_id).length]}),(0,c.jsxs)(w.Z,{children:["Service Account Keys: ",A.keys.filter(e=>!e.user_id).length]}),(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Total: ",A.keys.length]})]})]}),(0,c.jsx)(sa,{objectPermission:eh.object_permission,variant:"card",accessToken:j}),(0,c.jsx)(sr,{loggingConfigs:(null===(s=eh.metadata)||void 0===s?void 0:s.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(s2,{teamData:A,canEditTeam:eo,handleMemberDelete:eu,setSelectedEditMember:W,setIsEditMemberModalVisible:G,setIsAddMemberModalVisible:V})}),eo&&(0,c.jsx)(eX.Z,{children:(0,c.jsx)(te,{teamId:h,accessToken:j,canEditTeam:eo})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Team Settings"}),eo&&!$&&(0,c.jsx)(_.Z,{onClick:()=>Q(!0),children:"Edit Settings"})]}),$?(0,c.jsxs)(I.Z,{form:K,onFinish:ex,initialValues:{...eh,team_alias:eh.team_alias,models:eh.models,tpm_limit:eh.tpm_limit,rpm_limit:eh.rpm_limit,max_budget:eh.max_budget,budget_duration:eh.budget_duration,guardrails:(null===(t=eh.metadata)||void 0===t?void 0:t.guardrails)||[],metadata:eh.metadata?JSON.stringify((e=>{let{logging:s,...t}=e;return t})(eh.metadata),null,2):"",logging_settings:(null===(l=eh.metadata)||void 0===l?void 0:l.logging)||[],organization_id:eh.organization_id,vector_stores:(null===(a=eh.object_permission)||void 0===a?void 0:a.vector_stores)||[],mcp_servers:(null===(r=eh.object_permission)||void 0===r?void 0:r.mcp_servers)||[],mcp_access_groups:(null===(i=eh.object_permission)||void 0===i?void 0:i.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(n=eh.object_permission)||void 0===n?void 0:n.mcp_servers)||[],accessGroups:(null===(o=eh.object_permission)||void 0===o?void 0:o.mcp_access_groups)||[]}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,c.jsx)(L.default,{type:""})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Array.from(new Set(N)).map((e,s)=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},s))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Setup your first guardrail",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",placeholder:"Select or enter guardrails",options:ei.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>K.setFieldValue("vector_stores",e),value:K.getFieldValue("vector_stores"),accessToken:j||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(Y,{onChange:e=>K.setFieldValue("mcp_servers_and_groups",e),value:K.getFieldValue("mcp_servers_and_groups"),accessToken:j||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,c.jsx)(L.default,{type:""})}),(0,c.jsx)(I.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,c.jsx)(e4,{value:K.getFieldValue("logging_settings"),onChange:e=>K.setFieldValue("logging_settings",e)})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:10})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{htmlType:"button",onClick:()=>Q(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team Name"}),(0,c.jsx)("div",{children:eh.team_alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)("div",{className:"font-mono",children:eh.team_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:new Date(eh.created_at).toLocaleString()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eh.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)("div",{children:["TPM: ",eh.tpm_limit||"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",eh.rpm_limit||"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team Budget"}),(0,c.jsxs)("div",{children:["Max Budget:"," ",null!==eh.max_budget?"$".concat(eR(eh.max_budget,4)):"No Limit"]}),(0,c.jsxs)("div",{children:["Budget Reset: ",eh.budget_duration||"Never"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Team Member Settings"," ",(0,c.jsx)(z.Z,{title:"These are limits on individual team members",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),(0,c.jsxs)("div",{children:["Max Budget:"," ",(null===(m=eh.team_member_budget_table)||void 0===m?void 0:m.max_budget)||"No Limit"]}),(0,c.jsxs)("div",{children:["Key Duration:"," ",(null===(u=eh.metadata)||void 0===u?void 0:u.team_member_key_duration)||"No Limit"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization ID"}),(0,c.jsx)("div",{children:eh.organization_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Status"}),(0,c.jsx)(eY.Z,{color:eh.blocked?"red":"green",children:eh.blocked?"Blocked":"Active"})]}),(0,c.jsx)(sa,{objectPermission:eh.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:j}),(0,c.jsx)(sr,{loggingConfigs:(null===(x=eh.metadata)||void 0===x?void 0:x.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,c.jsx)(ts,{visible:B,onCancel:()=>G(!1),onSubmit:em,initialData:J,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}]}}),(0,c.jsx)(tt,{isVisible:q,onCancel:()=>V(!1),onSubmit:ed,accessToken:j})]})},ta=t(45589);let{Title:tr,Link:ti}=eh.default;var tn=e=>{let{isVisible:s,onCancel:t,onAddCredential:l,existingCredential:a,setIsCredentialModalOpen:r}=e,[i]=I.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(a))),(0,c.jsx)(E.Z,{title:"Reuse Credentials",visible:s,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,c.jsxs)(I.Z,{form:i,onFinish:e=>{l(e),i.resetFields(),r(!1)},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==a?void 0:a.credential_name,children:(0,c.jsx)(y.Z,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==a?void 0:a.credential_values)||{}).map(e=>{let[s,t]=e;return(0,c.jsx)(I.Z.Item,{label:s,name:s,initialValue:t,children:(0,c.jsx)(y.Z,{placeholder:"Enter ".concat(s),disabled:!0})},s)}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(ti,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})},to=t(63709),tc=t(45246),td=t(96473);let{Text:tm}=eh.default;var tu=e=>{let{form:s,showCacheControl:t,onCacheControlChange:l}=e,a=e=>{let t=s.getFieldValue("litellm_extra_params");try{let l=t?JSON.parse(t):{};e.length>0?l.cache_control_injection_points=e:delete l.cache_control_injection_points,Object.keys(l).length>0?s.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):s.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,c.jsx)(to.Z,{onChange:l,className:"bg-gray-600"})}),t&&(0,c.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,c.jsx)(tm,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,c.jsx)(I.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:l,remove:r}=t;return(0,c.jsxs)(c.Fragment,{children:[e.map((t,l)=>(0,c.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,c.jsx)(I.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,c.jsx)(C.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,c.jsx)(I.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,c.jsx)(C.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{a(s.getFieldValue("cache_control_points"))}})}),(0,c.jsx)(I.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,c.jsx)(M,{type:"number",placeholder:"Optional",step:1,min:0,onChange:()=>{a(s.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,c.jsx)(tc.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{r(t.name),setTimeout(()=>{a(s.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,c.jsx)(I.Z.Item,{children:(0,c.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>l(),children:[(0,c.jsx)(td.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})};let tx=async e=>{try{let s=await (0,g.modelHubCall)(e);if(console.log("model_info:",s),(null==s?void 0:s.data.length)>0){let e=s.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,s)=>e.model_group.localeCompare(s.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};var th=t(44851),tp=t(67960),tg=t(70464);let{TextArea:tj}=L.default,{Panel:tf}=th.default;var tv=e=>{let{modelInfo:s,value:t,onChange:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]);(0,d.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,s)=>({id:e.id||"route-".concat(s,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));r(e),m(e.map(e=>e.id))}else r([]),m([])},[t]);let u=e=>{let s=a.filter(s=>s.id!==e);r(s),h(s),m(s=>s.filter(s=>s!==e))},x=(e,s,t)=>{let l=a.map(l=>l.id===e?{...l,[s]:t}:l);r(l),h(l)},h=e=>{let s={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==l||l(s)},p=s.map(e=>({value:e.model_group,label:e.model_group}));return(0,c.jsxs)("div",{className:"w-full max-w-none",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,c.jsx)(z.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(T.ZP,{type:"primary",icon:(0,c.jsx)(td.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),s=[...a,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];r(s),h(s),m(s=>[...s,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===a.length?(0,c.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,c.jsx)(w.Z,{children:"No routes configured. Click “Add Route” to get started."})}):(0,c.jsx)("div",{className:"space-y-3 mb-6 w-full",children:a.map((e,s)=>(0,c.jsx)(tp.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,c.jsx)(th.default,{ghost:!0,expandIcon:e=>{let{isActive:s}=e;return(0,c.jsx)(tg.Z,{rotate:s?180:0})},activeKey:o,onChange:e=>m(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,c.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,c.jsxs)(w.Z,{className:"font-medium text-base",children:["Route ",s+1,": ",e.model||"Unnamed"]}),(0,c.jsx)(T.ZP,{type:"text",danger:!0,icon:(0,c.jsx)(ey.Z,{}),onClick:s=>{s.stopPropagation(),u(e.id)},className:"mr-2"})]}),children:(0,c.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,c.jsx)(C.default,{value:e.model,onChange:s=>x(e.id,"model",s),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,c.jsx)(tj,{value:e.description,onChange:s=>x(e.id,"description",s.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium",children:"Score Threshold"}),(0,c.jsx)(z.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(q.Z,{value:e.score_threshold,onChange:s=>x(e.id,"score_threshold",s||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,c.jsxs)("div",{className:"w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium",children:"Example Utterances"}),(0,c.jsx)(z.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,c.jsx)(C.default,{mode:"tags",value:e.utterances,onChange:s=>x(e.id,"utterances",s),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,c.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,c.jsx)(T.ZP,{type:"link",onClick:()=>n(!i),className:"text-blue-600 p-0",children:i?"Hide":"Show"})]}),i&&(0,c.jsx)(tp.Z,{className:"bg-gray-50 w-full",children:(0,c.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:a.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})},t_=e=>{let{isVisible:s,onCancel:t,onSuccess:l,modelData:a,accessToken:r,userRole:i}=e,[n]=I.Z.useForm(),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)(!1),[v,_]=(0,d.useState)(!1),[b,N]=(0,d.useState)(null);(0,d.useEffect)(()=>{s&&a&&Z()},[s,a]),(0,d.useEffect)(()=>{let e=async()=>{if(r)try{let e=await (0,g.modelAvailableCall)(r,"","",!1,null,!0,!0);x(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(r)try{let e=await tx(r);p(e)}catch(e){console.error("Error fetching model info:",e)}};s&&(e(),t())},[s,r]);let Z=()=>{try{var e,s,t,l,r,i;let o=null;(null===(e=a.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(o="string"==typeof a.litellm_params.auto_router_config?JSON.parse(a.litellm_params.auto_router_config):a.litellm_params.auto_router_config),N(o),n.setFieldsValue({auto_router_name:a.model_name,auto_router_default_model:(null===(s=a.litellm_params)||void 0===s?void 0:s.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=a.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(l=a.model_info)||void 0===l?void 0:l.access_groups)||[]});let c=new Set(h.map(e=>e.model_group));f(!c.has(null===(r=a.litellm_params)||void 0===r?void 0:r.auto_router_default_model)),_(!c.has(null===(i=a.litellm_params)||void 0===i?void 0:i.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),P.ZP.error("Error loading auto router configuration")}},k=async()=>{try{m(!0);let e=await n.validateFields(),s={...a.litellm_params,auto_router_config:JSON.stringify(b),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},i={...a.model_info,access_groups:e.model_access_group||[]},o={model_name:e.auto_router_name,litellm_params:s,model_info:i};await (0,g.modelPatchUpdateCall)(r,o,a.model_info.id);let c={...a,model_name:e.auto_router_name,litellm_params:s,model_info:i};P.ZP.success("Auto router configuration updated successfully"),l(c),t()}catch(e){console.error("Error updating auto router:",e),P.ZP.error("Failed to update auto router configuration")}finally{m(!1)}},S=h.map(e=>({value:e.model_group,label:e.model_group}));return(0,c.jsx)(E.Z,{title:"Edit Auto Router Configuration",open:s,onCancel:t,footer:[(0,c.jsx)(T.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,c.jsx)(T.ZP,{loading:o,onClick:k,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsx)(w.Z,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,c.jsxs)(I.Z,{form:n,layout:"vertical",className:"space-y-4",children:[(0,c.jsx)(I.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(tv,{modelInfo:h,value:b,onChange:e=>{N(e)}})}),(0,c.jsx)(I.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,c.jsx)(C.default,{placeholder:"Select a default model",onChange:e=>{f("custom"===e)},options:[...S,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,c.jsx)(I.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,c.jsx)(C.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{_("custom"===e)},options:[...S,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===i&&(0,c.jsx)(I.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:u.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};function ty(e){var s,t,l,a,r,i,n,o,m,u,x,h,p,j,f,b,N,Z,S,A,O,D,F,R,q,U;let{modelId:z,onClose:V,modelData:K,accessToken:B,userID:G,userRole:H,editModel:J,setEditModalVisible:Y,setSelectedModel:W,onModelUpdate:$,modelAccessGroups:Q}=e,[ee]=I.Z.useForm(),[es,et]=(0,d.useState)(null),[ea,er]=(0,d.useState)(!1),[ei,en]=(0,d.useState)(!1),[eo,ec]=(0,d.useState)(!1),[ed,em]=(0,d.useState)(!1),[eu,ex]=(0,d.useState)(!1),[eh,ep]=(0,d.useState)(null),[eg,ej]=(0,d.useState)(!1),[ef,ev]=(0,d.useState)({}),[e_,ey]=(0,d.useState)(!1),eb="Admin"===H||(null==K?void 0:null===(s=K.model_info)||void 0===s?void 0:s.created_by)===G,eN=(null==K?void 0:null===(t=K.litellm_params)||void 0===t?void 0:t.auto_router_config)!=null,eZ=(null==K?void 0:null===(l=K.litellm_params)||void 0===l?void 0:l.litellm_credential_name)!=null&&(null==K?void 0:null===(a=K.litellm_params)||void 0===a?void 0:a.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eZ),console.log("modelData.litellm_params.litellm_credential_name, ",null==K?void 0:null===(r=K.litellm_params)||void 0===r?void 0:r.litellm_credential_name),(0,d.useEffect)(()=>{let e=async()=>{var e;if(!B)return;let s=await (0,g.modelInfoV1Call)(B,z);console.log("modelInfoResponse, ",s);let t=s.data[0];et(t),(null==t?void 0:null===(e=t.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&ej(!0)};(async()=>{if(console.log("accessToken, ",B),!B||eZ)return;let e=await (0,g.credentialGetCall)(B,null,z);console.log("existingCredentialResponse, ",e),ep({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e()},[B,z]);let ew=async e=>{var s;if(console.log("values, ",e),!B)return;let t={credential_name:e.credential_name,model_id:z,credential_info:{custom_llm_provider:null===(s=es.litellm_params)||void 0===s?void 0:s.custom_llm_provider}};P.ZP.info("Storing credential.."),console.log("credentialResponse, ",await (0,g.credentialCreateCall)(B,t)),P.ZP.success("Credential stored successfully")},ek=async e=>{try{var s;let t;if(!B)return;em(!0),console.log("values.model_name, ",e.model_name);let l={...es.litellm_params,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6};e.cache_control&&(null===(s=e.cache_control_injection_points)||void 0===s?void 0:s.length)>0?l.cache_control_injection_points=e.cache_control_injection_points:delete l.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):K.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){P.ZP.error("Invalid JSON in Model Info");return}let a={model_name:e.model_name,litellm_params:l,model_info:t};await (0,g.modelPatchUpdateCall)(B,a,z);let r={...es,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:l,model_info:t};et(r),$&&$(r),P.ZP.success("Model settings updated successfully"),ec(!1),ex(!1)}catch(e){console.error("Error updating model:",e),P.ZP.error("Failed to update model settings")}finally{em(!1)}};if(!K)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:V,className:"mb-4",children:"Back to Models"}),(0,c.jsx)(w.Z,{children:"Model not found"})]});let eS=async()=>{try{if(!B)return;await (0,g.modelDeleteCall)(B,z),P.ZP.success("Model deleted successfully"),$&&$({deleted:!0,model_info:{id:z}}),V()}catch(e){console.error("Error deleting the model:",e),P.ZP.error("Failed to delete model")}},eC=async(e,s)=>{await eq(e)&&(ev(e=>({...e,[s]:!0})),setTimeout(()=>{ev(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:V,className:"mb-4",children:"Back to Models"}),(0,c.jsxs)(k.Z,{children:["Public Model Name: ",sJ(K)]}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:K.model_info.id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:ef["model-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>eC(K.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(ef["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{className:"flex gap-2",children:["Admin"===H&&(0,c.jsx)(_.Z,{icon:ta.Z,variant:"secondary",onClick:()=>en(!0),className:"flex items-center",children:"Re-use Credentials"}),eb&&(0,c.jsx)(_.Z,{icon:el.Z,variant:"secondary",onClick:()=>er(!0),className:"flex items-center",children:"Delete Model"})]})]}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-6",children:[(0,c.jsx)(eW.Z,{children:"Overview"}),(0,c.jsx)(eW.Z,{children:"Raw JSON"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Provider"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[K.provider&&(0,c.jsx)("img",{src:(0,sO.dr)(K.provider).logo,alt:"".concat(K.provider," logo"),className:"w-4 h-4",onError:e=>{let s=e.target,t=s.parentElement;if(t){var l;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(l=K.provider)||void 0===l?void 0:l.charAt(0))||"-",t.replaceChild(e,s)}}}),(0,c.jsx)(k.Z,{children:K.provider||"Not Set"})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"LiteLLM Model"}),(0,c.jsx)("pre",{children:(0,c.jsx)(k.Z,{children:K.litellm_model_name||"Not Set"})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Pricing"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["Input: $",K.input_cost,"/1M tokens"]}),(0,c.jsxs)(w.Z,{children:["Output: $",K.output_cost,"/1M tokens"]})]})]})]}),(0,c.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,c.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",K.model_info.created_at?new Date(K.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,c.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",K.model_info.created_by||"Not Set"]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Model Settings"}),(0,c.jsxs)("div",{className:"flex gap-2",children:[eN&&eb&&!eu&&(0,c.jsx)(_.Z,{variant:"primary",onClick:()=>ey(!0),className:"flex items-center",children:"Edit Auto Router"}),eb&&!eu&&(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>ex(!0),className:"flex items-center",children:"Edit Model"})]})]}),es?(0,c.jsx)(I.Z,{form:ee,onFinish:ek,initialValues:{model_name:es.model_name,litellm_model_name:es.litellm_model_name,api_base:es.litellm_params.api_base,custom_llm_provider:es.litellm_params.custom_llm_provider,organization:es.litellm_params.organization,tpm:es.litellm_params.tpm,rpm:es.litellm_params.rpm,max_retries:es.litellm_params.max_retries,timeout:es.litellm_params.timeout,stream_timeout:es.litellm_params.stream_timeout,input_cost:es.litellm_params.input_cost_per_token?1e6*es.litellm_params.input_cost_per_token:(null===(i=es.model_info)||void 0===i?void 0:i.input_cost_per_token)*1e6||null,output_cost:(null===(n=es.litellm_params)||void 0===n?void 0:n.output_cost_per_token)?1e6*es.litellm_params.output_cost_per_token:(null===(o=es.model_info)||void 0===o?void 0:o.output_cost_per_token)*1e6||null,cache_control:null!==(m=es.litellm_params)&&void 0!==m&&!!m.cache_control_injection_points,cache_control_injection_points:(null===(u=es.litellm_params)||void 0===u?void 0:u.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(x=es.model_info)||void 0===x?void 0:x.access_groups)?es.model_info.access_groups:[]},layout:"vertical",onValuesChange:()=>ec(!0),children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Name"}),eu?(0,c.jsx)(I.Z.Item,{name:"model_name",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter model name"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:es.model_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eu?(0,c.jsx)(I.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter LiteLLM model name"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:es.litellm_model_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eu?(0,c.jsx)(I.Z.Item,{name:"input_cost",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter input cost"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==es?void 0:null===(h=es.litellm_params)||void 0===h?void 0:h.input_cost_per_token)?((null===(p=es.litellm_params)||void 0===p?void 0:p.input_cost_per_token)*1e6).toFixed(4):(null==es?void 0:null===(j=es.model_info)||void 0===j?void 0:j.input_cost_per_token)?(1e6*es.model_info.input_cost_per_token).toFixed(4):null})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eu?(0,c.jsx)(I.Z.Item,{name:"output_cost",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter output cost"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==es?void 0:null===(f=es.litellm_params)||void 0===f?void 0:f.output_cost_per_token)?(1e6*es.litellm_params.output_cost_per_token).toFixed(4):(null==es?void 0:null===(b=es.model_info)||void 0===b?void 0:b.output_cost_per_token)?(1e6*es.model_info.output_cost_per_token).toFixed(4):null})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"API Base"}),eu?(0,c.jsx)(I.Z.Item,{name:"api_base",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter API base"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(N=es.litellm_params)||void 0===N?void 0:N.api_base)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Custom LLM Provider"}),eu?(0,c.jsx)(I.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter custom LLM provider"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(Z=es.litellm_params)||void 0===Z?void 0:Z.custom_llm_provider)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization"}),eu?(0,c.jsx)(I.Z.Item,{name:"organization",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter organization"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(S=es.litellm_params)||void 0===S?void 0:S.organization)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eu?(0,c.jsx)(I.Z.Item,{name:"tpm",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter TPM"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(A=es.litellm_params)||void 0===A?void 0:A.tpm)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eu?(0,c.jsx)(I.Z.Item,{name:"rpm",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter RPM"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(O=es.litellm_params)||void 0===O?void 0:O.rpm)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Max Retries"}),eu?(0,c.jsx)(I.Z.Item,{name:"max_retries",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter max retries"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=es.litellm_params)||void 0===D?void 0:D.max_retries)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Timeout (seconds)"}),eu?(0,c.jsx)(I.Z.Item,{name:"timeout",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter timeout"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(F=es.litellm_params)||void 0===F?void 0:F.timeout)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eu?(0,c.jsx)(I.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter stream timeout"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=es.litellm_params)||void 0===R?void 0:R.stream_timeout)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Access Groups"}),eu?(0,c.jsx)(I.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==Q?void 0:Q.map(e=>({value:e,label:e}))})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=es.model_info)||void 0===q?void 0:q.access_groups)?Array.isArray(es.model_info.access_groups)?es.model_info.access_groups.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:es.model_info.access_groups.map((e,s)=>(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},s))}):"No groups assigned":es.model_info.access_groups:"Not Set"})]}),eu?(0,c.jsx)(tu,{form:ee,showCacheControl:eg,onCacheControlChange:e=>ej(e)}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cache Control"}),(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(U=es.litellm_params)||void 0===U?void 0:U.cache_control_injection_points)?(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"Enabled"}),(0,c.jsx)("div",{className:"mt-2",children:es.litellm_params.cache_control_injection_points.map((e,s)=>(0,c.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,c.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,c.jsxs)("span",{children:[" Index: ",e.index]})]},s))})]}):"Disabled"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Info"}),eu?(0,c.jsx)(I.Z.Item,{name:"model_info",className:"mb-0",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify(K.model_info,null,2)})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(es.model_info,null,2)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:K.model_info.team_id||"Not Set"})]})]}),eu&&(0,c.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{ee.resetFields(),ec(!1),ex(!1)},children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",onClick:()=>ee.submit(),loading:ed,children:"Save Changes"})]})]})}):(0,c.jsx)(w.Z,{children:"Loading..."})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(X.Z,{children:(0,c.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify(K,null,2)})})})]})]}),ea&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Model"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this model?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(T.ZP,{onClick:eS,className:"ml-2",danger:!0,children:"Delete"}),(0,c.jsx)(T.ZP,{onClick:()=>er(!1),children:"Cancel"})]})]})]})}),ei&&!eZ?(0,c.jsx)(tn,{isVisible:ei,onCancel:()=>en(!1),onAddCredential:ew,existingCredential:eh,setIsCredentialModalOpen:en}):(0,c.jsx)(E.Z,{open:ei,onCancel:()=>en(!1),title:"Using Existing Credential",children:(0,c.jsx)(w.Z,{children:K.litellm_params.litellm_credential_name})}),(0,c.jsx)(t_,{isVisible:e_,onCancel:()=>ey(!1),onSuccess:e=>{et(e),$&&$(e)},modelData:es||K,accessToken:B||"",userRole:H||""})]})}var tb=e=>{let{selectedProvider:s,providerModels:t,getPlaceholder:l}=e,a=I.Z.useFormInstance(),r=e=>{let s=e.target.value,t=(a.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?{public_name:s,litellm_model:s}:e);a.setFieldsValue({model_mappings:t})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(I.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"Actual model name used for making litellm.completion() / litellm.embedding() call.",className:"mb-0",children:[(0,c.jsx)(I.Z.Item,{name:"model",rules:[{required:!0,message:"Please select at least one model."}],noStyle:!0,children:s===sO.Cl.Azure||s===sO.Cl.OpenAI_Compatible||s===sO.Cl.Ollama?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(y.Z,{placeholder:l(s)})}):t.length>0?(0,c.jsx)(C.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let s=Array.isArray(e)?e:[e];if(s.includes("all-wildcard"))a.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(a.getFieldValue("model"))!==JSON.stringify(s)){let e=s.map(e=>({public_name:e,litellm_model:e}));a.setFieldsValue({model:s,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(s," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,c.jsx)(y.Z,{placeholder:l(s)})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.model!==s.model,children:e=>{let{getFieldValue:s}=e,t=s("model")||[];return(Array.isArray(t)?t:[t]).includes("custom")&&(0,c.jsx)(I.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,c.jsx)(y.Z,{placeholder:"Enter custom model name",onChange:r})})}})]}),(0,c.jsxs)(sR.Z,{children:[(0,c.jsx)(sq.Z,{span:10}),(0,c.jsx)(sq.Z,{span:10,children:(0,c.jsx)(w.Z,{className:"mb-3 mt-1",children:"Actual model name used for making litellm.completion() call. We loadbalance models with the same public name"})})]})]})},tN=()=>{let e=I.Z.useFormInstance(),[s,t]=(0,d.useState)(0),l=I.Z.useWatch("model",e)||[],a=Array.isArray(l)?l:[l],r=I.Z.useWatch("custom_model_name",e),i=!a.includes("all-wildcard");if((0,d.useEffect)(()=>{if(r&&a.includes("custom")){let s=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?{public_name:r,litellm_model:r}:e);e.setFieldValue("model_mappings",s),t(e=>e+1)}},[r,a,e]),(0,d.useEffect)(()=>{if(a.length>0&&!a.includes("all-wildcard")){let s=e.getFieldValue("model_mappings")||[];if(s.length!==a.length||!a.every(e=>s.some(s=>"custom"===e?"custom"===s.litellm_model||s.litellm_model===r:s.litellm_model===e))){let s=a.map(e=>"custom"===e&&r?{public_name:r,litellm_model:r}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",s),t(e=>e+1)}}},[a,r,e]),!i)return null;let n=[{title:"Public Name",dataIndex:"public_name",key:"public_name",render:(s,t,l)=>(0,c.jsx)(y.Z,{value:s,onChange:s=>{let t=[...e.getFieldValue("model_mappings")];t[l].public_name=s.target.value,e.setFieldValue("model_mappings",t)}})},{title:"LiteLLM Model",dataIndex:"litellm_model",key:"litellm_model"}];return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(I.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",required:!0,children:(0,c.jsx)(ej.Z,{dataSource:e.getFieldValue("model_mappings"),columns:n,pagination:!1,size:"small"},s)})})},tZ=t(90464);let{Link:tw}=eh.default;var tk=e=>{let{showAdvancedSettings:s,setShowAdvancedSettings:t,teams:l}=e,[a]=I.Z.useForm(),[r,i]=d.useState(!1),[n,o]=d.useState("per_token"),[m,u]=d.useState(!1),x=(e,s)=>s&&(isNaN(Number(s))||0>Number(s))?Promise.reject("Please enter a valid positive number"):Promise.resolve(),h=(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}};return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(b.Z,{className:"mt-2 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Advanced Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,c.jsx)(I.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,c.jsx)(to.Z,{onChange:e=>{i(e),e||a.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),r&&(0,c.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,c.jsx)(I.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,c.jsx)(C.default,{defaultValue:"per_token",onChange:e=>o(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,c.jsx)(y.Z,{})})]}):(0,c.jsx)(I.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:x}],className:"mb-4",children:(0,c.jsx)(y.Z,{})})]}),(0,c.jsx)(I.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,c.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,c.jsx)(tw,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,c.jsx)(to.Z,{onChange:e=>{let s=a.getFieldValue("litellm_extra_params");try{let t=s?JSON.parse(s):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?a.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):a.setFieldValue("litellm_extra_params","")}catch(s){e?a.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):a.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,c.jsx)(tu,{form:a,showCacheControl:m,onCacheControlChange:e=>{if(u(e),!e){let e=a.getFieldValue("litellm_extra_params");try{let s=e?JSON.parse(e):{};delete s.cache_control_injection_points,Object.keys(s).length>0?a.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):a.setFieldValue("litellm_extra_params","")}catch(e){a.setFieldValue("litellm_extra_params","")}}}}),(0,c.jsx)(I.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:h}],children:(0,c.jsx)(tZ.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,c.jsxs)(sR.Z,{className:"mb-4",children:[(0,c.jsx)(sq.Z,{span:10}),(0,c.jsx)(sq.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,c.jsx)(tw,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,c.jsx)(I.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:h}],children:(0,c.jsx)(tZ.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},tS=t(29),tC=t.n(tS),tI=t(23639);let{Text:tP}=eh.default;var tE=e=>{let{formValues:s,accessToken:t,testMode:l,modelName:a="this model",onClose:r,onTestComplete:i}=e,[n,o]=d.useState(null),[m,u]=d.useState(null),[x,h]=d.useState(null),[p,j]=d.useState(!0),[f,v]=d.useState(!1),[_,y]=d.useState(!1),b=async()=>{j(!0),y(!1),o(null),u(null),h(null),v(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",s);let a=await sM(s,t,null);if(!a){console.log("No result from prepareModelAddRequest"),o("Failed to prepare model data. Please check your form inputs."),v(!1),j(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:i,modelName:n}=a[0],c=await (0,g.testConnectionRequest)(t,r,null==i?void 0:i.mode);if("success"===c.status)P.ZP.success("Connection test successful!"),o(null),v(!0);else{var e,l;let s=(null===(e=c.result)||void 0===e?void 0:e.error)||c.message||"Unknown error";o(s),u(r),h(null===(l=c.result)||void 0===l?void 0:l.raw_request_typed_dict),v(!1)}}catch(e){console.error("Test connection error:",e),o(e instanceof Error?e.message:String(e)),v(!1)}finally{j(!1),i&&i()}};d.useEffect(()=>{let e=setTimeout(()=>{b()},200);return()=>clearTimeout(e)},[]);let N=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",Z="string"==typeof n?N(n):(null==n?void 0:n.message)?N(n.message):"Unknown error",w=x?((e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")})(x.raw_request_api_base,x.raw_request_body,x.raw_request_headers||{}):"";return(0,c.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[p?(0,c.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-776cdcbc0448e4ea",children:[(0,c.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-776cdcbc0448e4ea loading-spinner",children:(0,c.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-776cdcbc0448e4ea"})}),(0,c.jsxs)(tP,{style:{fontSize:"16px"},children:["Testing connection to ",a,"..."]}),(0,c.jsx)(tC(),{id:"776cdcbc0448e4ea",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):f?(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,c.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,c.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,c.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,c.jsxs)(tP,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",a," successful!"]})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,c.jsx)(eb.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,c.jsxs)(tP,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",a," failed"]})]}),(0,c.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,c.jsx)(tP,{strong:!0,style:{display:"block",marginBottom:"8px"},children:"Error: "}),(0,c.jsx)(tP,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:Z}),n&&(0,c.jsx)("div",{style:{marginTop:"12px"},children:(0,c.jsx)(T.ZP,{type:"link",onClick:()=>y(!_),style:{paddingLeft:0,height:"auto"},children:_?"Hide Details":"Show Details"})})]}),_&&(0,c.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,c.jsx)(tP,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,c.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof n?n:JSON.stringify(n,null,2)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(tP,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,c.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:w||"No request data available"}),(0,c.jsx)(T.ZP,{style:{marginTop:"8px"},icon:(0,c.jsx)(tI.Z,{}),onClick:()=>{navigator.clipboard.writeText(w||""),P.ZP.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,c.jsx)(Q.Z,{style:{margin:"24px 0 16px"}}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,c.jsx)(T.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,c.jsx)(U.Z,{}),children:"View Documentation"})})]})};let tA=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"}];var tT=t(92858);let tL=async(e,s,t,l)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",s?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",l?"Present":"Missing");let a={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:s?"Present":"Missing",config:a});let r=await (0,g.modelCreateCall)(s,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),P.ZP.error("Failed to add auto router: "+e,10)}},{Title:tO,Link:tM}=eh.default;var tD=e=>{let{form:s,handleOk:t,accessToken:l,userRole:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)([]),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)(!1),[_,b]=(0,d.useState)(!1),[N,Z]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{h((await (0,g.modelAvailableCall)(l,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[l]),(0,d.useEffect)(()=>{(async()=>{try{let e=await tx(l);console.log("Fetched models for auto router:",e),j(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[l]);let k=eL.ZL.includes(a),S=async()=>{o(!0),u("test-".concat(Date.now())),i(!0)},A=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",N);let e=s.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){P.ZP.error("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){P.ZP.error("Please select a Default Model");return}if(s.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!N||!N.routes||0===N.routes.length){P.ZP.error("Please configure at least one route for the auto router");return}if(N.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){P.ZP.error("Please ensure all routes have a target model, description, and at least one utterance");return}s.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let a={...e,auto_router_config:N};console.log("Final submit values:",a),tL(a,l,s,t)}).catch(e=>{console.error("Validation failed:",e);let s=e.errorFields||[];if(s.length>0){let e=s.map(e=>{let s=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[s]||s});P.ZP.error("Please fill in the following required fields: ".concat(e.join(", ")))}else P.ZP.error("Please fill in all required fields")})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tO,{level:2,children:"Add Auto Router"}),(0,c.jsx)(w.Z,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,c.jsx)(tp.Z,{children:(0,c.jsxs)(I.Z,{form:s,onFinish:A,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(y.Z,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,c.jsx)("div",{className:"w-full mb-4",children:(0,c.jsx)(tv,{modelInfo:p,value:N,onChange:e=>{Z(e),s.setFieldValue("auto_router_config",e)}})}),(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(C.default,{placeholder:"Select a default model",onChange:e=>{v("custom"===e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,c.jsx)(I.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(C.default,{value:s.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{b("custom"===e),s.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),k&&(0,c.jsx)(I.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(eh.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{className:"space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:S,loading:n,children:"Test Connect"}),(0,c.jsx)(T.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",N),console.log("Current form values:",s.getFieldsValue()),A()},children:"Add Auto Router"})]})]})]})}),(0,c.jsx)(E.Z,{title:"Connection Test Results",open:r,onCancel:()=>{i(!1),o(!1)},footer:[(0,c.jsx)(T.ZP,{onClick:()=>{i(!1),o(!1)},children:"Close"},"close")],width:700,children:r&&(0,c.jsx)(tE,{formValues:s.getFieldsValue(),accessToken:l,testMode:"chat",modelName:s.getFieldValue("auto_router_name"),onClose:()=>{i(!1),o(!1)},onTestComplete:()=>o(!1)},m)})]})};let{Title:tF,Link:tR}=eh.default;var tq=e=>{let{form:s,handleOk:t,selectedProvider:l,setSelectedProvider:a,providerModels:r,setProviderModelsFn:i,getPlaceholder:n,uploadProps:o,showAdvancedSettings:m,setShowAdvancedSettings:u,teams:x,credentials:h,accessToken:p,userRole:j,premiumUser:f}=e,[v,_]=(0,d.useState)("chat"),[y,b]=(0,d.useState)(!1),[N,Z]=(0,d.useState)(!1),[k,S]=(0,d.useState)(""),P=async()=>{Z(!0),S("test-".concat(Date.now())),b(!0)},[A,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{M((await (0,g.modelAvailableCall)(p,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[p]);let D=eL.ZL.includes(j);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(e$.Z,{className:"w-full",children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Add Model"}),(0,c.jsx)(eW.Z,{children:"Add Auto Router"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(tF,{level:2,children:"Add Model"}),(0,c.jsx)(tp.Z,{children:(0,c.jsx)(I.Z,{form:s,onFinish:t,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(C.default,{showSearch:!0,value:l,onChange:e=>{a(e),i(e),s.setFieldsValue({model:[],model_name:void 0})},children:Object.entries(sO.Cl).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sO.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(tb,{selectedProvider:l,providerModels:r,getPlaceholder:n}),(0,c.jsx)(tN,{}),(0,c.jsx)(I.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,c.jsx)(C.default,{style:{width:"100%"},value:v,onChange:e=>_(e),options:tA})}),(0,c.jsxs)(sR.Z,{children:[(0,c.jsx)(sq.Z,{span:10}),(0,c.jsx)(sq.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"mb-5 mt-1",children:[(0,c.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model ",(0,c.jsx)(tR,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsx)(eh.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,c.jsx)(I.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...h.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.litellm_credential_name!==s.litellm_credential_name||e.provider!==s.provider,children:e=>{let{getFieldValue:s}=e,t=s("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?(0,c.jsx)("div",{className:"text-gray-500 text-sm text-center",children:"Using existing credentials - no additional provider fields needed"}):(0,c.jsx)(sV,{selectedProvider:l,uploadProps:o})}}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,c.jsx)(z.Z,{title:f?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,c.jsx)(tT.Z,{checked:A,onChange:e=>{L(e),e||s.setFieldValue("team_id",void 0)},disabled:!f})})}),A&&(0,c.jsx)(I.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:A&&!D,message:"Please select a team."}],children:(0,c.jsx)($,{teams:x,disabled:!f})}),D&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(I.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:O.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,c.jsx)(tk,{showAdvancedSettings:m,setShowAdvancedSettings:u,teams:x}),(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(eh.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{className:"space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:P,loading:N,children:"Test Connect"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(tD,{form:s,handleOk:()=>{s.validateFields().then(e=>{tL(e,p,s,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:p,userRole:j})})]})]}),(0,c.jsx)(E.Z,{title:"Connection Test Results",open:y,onCancel:()=>{b(!1),Z(!1)},footer:[(0,c.jsx)(T.ZP,{onClick:()=>{b(!1),Z(!1)},children:"Close"},"close")],width:700,children:y&&(0,c.jsx)(tE,{formValues:s.getFieldsValue(),accessToken:p,testMode:v,modelName:s.getFieldValue("model_name")||s.getFieldValue("model"),onClose:()=>{b(!1),Z(!1)},onTestComplete:()=>Z(!1)},k)})]})},tU=t(8048);let tz=(e,s,t,l,a,r,i,n,o,d,m)=>[{header:"Model ID",accessorKey:"model_info.id",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.model_info.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>l(t.model_info.id),children:t.model_info.id})})}},{header:"Public Model Name",accessorKey:"model_name",cell:e=>{let{row:s}=e,t=r(s.original)||"-";return(0,c.jsx)(z.Z,{title:t,children:(0,c.jsx)("div",{className:"text-xs truncate whitespace-nowrap",children:t})})}},{header:"Provider",accessorKey:"provider",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t.provider&&(0,c.jsx)("img",{src:(0,sO.dr)(t.provider).logo,alt:"".concat(t.provider," logo"),className:"w-4 h-4",onError:e=>{let s=e.target,l=s.parentElement;if(l){var a;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(a=t.provider)||void 0===a?void 0:a.charAt(0))||"-",l.replaceChild(e,s)}}}),(0,c.jsx)("p",{className:"text-xs",children:t.provider||"-"})]})}},{header:"LiteLLM Model Name",accessorKey:"litellm_model_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.litellm_model_name,children:(0,c.jsx)("div",{className:"text-xs truncate whitespace-nowrap",children:t.litellm_model_name||"-"})})}},{header:"Created At",accessorKey:"model_info.created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.created_at?new Date(t.model_info.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:"Created By",accessorKey:"model_info.created_by",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.created_by||"-"})}},{header:()=>(0,c.jsx)(z.Z,{title:"Cost per 1M tokens",children:(0,c.jsx)("span",{children:"Input Cost"})}),accessorKey:"input_cost",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("pre",{className:"text-xs",children:t.input_cost||"-"})}},{header:()=>(0,c.jsx)(z.Z,{title:"Cost per 1M tokens",children:(0,c.jsx)("span",{children:"Output Cost"})}),accessorKey:"output_cost",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("pre",{className:"text-xs",children:t.output_cost||"-"})}},{header:"Team ID",accessorKey:"model_info.team_id",cell:e=>{let{row:s}=e,t=s.original;return t.model_info.team_id?(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:t.model_info.team_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>a(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:"Model Access Group",accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:s}=e,t=s.original,l=t.model_info.access_groups;if(!l||0===l.length)return"-";let a=t.model_info.id,r=d.has(a),i=l.length>1,n=()=>{let e=new Set(d);r?e.delete(a):e.add(a),m(e)};return(0,c.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,c.jsx)(eY.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:l[0]}),(r||!i&&2===l.length)&&l.slice(1).map((e,s)=>(0,c.jsx)(eY.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},s+1)),i&&(0,c.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:r?"−":"+".concat(l.length-1)})]})}},{header:"Credentials",accessorKey:"litellm_credential_name",cell:e=>{let{row:s}=e,t=s.original;return t.litellm_params&&t.litellm_params.litellm_credential_name?(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsxs)(z.Z,{title:t.litellm_params.litellm_credential_name,children:[t.litellm_params.litellm_credential_name.slice(0,7),"..."]})}):(0,c.jsx)("span",{className:"text-gray-400",children:"-"})}},{header:"Status",accessorKey:"model_info.db_model",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:"",cell:t=>{var a;let{row:r}=t,i=r.original,n="Admin"===e||(null===(a=i.model_info)||void 0===a?void 0:a.created_by)===s;return(0,c.jsxs)("div",{className:"flex items-center justify-end gap-2 pr-4",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{n&&(l(i.model_info.id),o(!0))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>{n&&(l(i.model_info.id),o(!1))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"})]})}}];var tV=t(15731),tK=t(91126);let tB=(e,s,t,l,a,r,i,n,o,d,m)=>[{header:()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(s4.Z,{checked:t,indeterminate:s.length>0&&!t,onChange:e=>a(e.target.checked),onClick:e=>e.stopPropagation()}),(0,c.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,a=t.original,r=a.model_name,i=s.includes(r);return(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(s4.Z,{checked:i,onChange:e=>l(r,e.target.checked),onClick:e=>e.stopPropagation()}),(0,c.jsx)(z.Z,{title:a.model_info.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(a.model_info.id),children:a.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,t=s.original,l=n(t)||t.model_name;return(0,c.jsx)("div",{className:"font-medium text-sm",children:(0,c.jsx)(z.Z,{title:l,children:(0,c.jsx)("div",{className:"truncate max-w-[200px]",children:l})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,s,t)=>{var l,a;let r=e.getValue("health_status")||"unknown",i=s.getValue("health_status")||"unknown",n={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(l=n[r])&&void 0!==l?l:4)-(null!==(a=n[i])&&void 0!==a?a:4)},cell:s=>{var t;let{row:l}=s,a=l.original,r={status:a.health_status,loading:a.health_loading,error:a.health_error};if(r.loading)return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:"Checking..."})]});let n=a.model_name,o="healthy"===r.status&&(null===(t=e[n])||void 0===t?void 0:t.successResponse);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[i(r.status),o&&d&&(0,c.jsx)(z.Z,{title:"View response details",placement:"top",children:(0,c.jsx)("button",{onClick:()=>{var s;return d(n,null===(s=e[n])||void 0===s?void 0:s.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,c.jsx)(tV.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:s=>{let{row:t}=s,l=t.original.model_name,a=e[l];if(!(null==a?void 0:a.error))return(0,c.jsx)(w.Z,{className:"text-gray-400 text-sm",children:"No errors"});let r=a.error,i=a.fullError||a.error;return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"max-w-[200px]",children:(0,c.jsx)(z.Z,{title:r,placement:"top",children:(0,c.jsx)(w.Z,{className:"text-red-600 text-sm truncate",children:r})})}),o&&i!==r&&(0,c.jsx)(z.Z,{title:"View full error details",placement:"top",children:(0,c.jsx)("button",{onClick:()=>o(l,r,i),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,c.jsx)(tV.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,s,t)=>{let l=e.getValue("last_check")||"Never checked",a=s.getValue("last_check")||"Never checked";if("Never checked"===l&&"Never checked"===a)return 0;if("Never checked"===l)return 1;if("Never checked"===a)return -1;if("Check in progress..."===l&&"Check in progress..."===a)return 0;if("Check in progress..."===l)return -1;if("Check in progress..."===a)return 1;let r=new Date(l),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,s,t)=>{let l=e.getValue("last_success")||"Never succeeded",a=s.getValue("last_success")||"Never succeeded";if("Never succeeded"===l&&"Never succeeded"===a)return 0;if("Never succeeded"===l)return 1;if("Never succeeded"===a)return -1;if("None"===l&&"None"===a)return 0;if("None"===l)return 1;if("None"===a)return -1;let r=new Date(l),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:s=>{let{row:t}=s,l=e[t.original.model_name],a=(null==l?void 0:l.lastSuccess)||"None";return(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:a})}},{header:"Actions",id:"actions",cell:e=>{let{row:s}=e,t=s.original,l=t.model_name,a=t.health_status&&"none"!==t.health_status,i=t.health_loading?"Checking...":a?"Re-run Health Check":"Run Health Check";return(0,c.jsx)(z.Z,{title:i,placement:"top",children:(0,c.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||r(l)},disabled:t.health_loading,children:t.health_loading?(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):a?(0,c.jsx)(e2.Z,{className:"h-4 w-4"}):(0,c.jsx)(tK.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],tG=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var tH=e=>{let{accessToken:s,modelData:t,all_models_on_proxy:l,getDisplayModelName:a,setSelectedModelId:r}=e,[i,n]=(0,d.useState)({}),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[j,f]=(0,d.useState)(null),[v,y]=(0,d.useState)(!1),[b,N]=(0,d.useState)(null),Z=(0,d.useRef)(null);(0,d.useEffect)(()=>{s&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(s=>{e[s.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let l=await (0,g.latestHealthChecksCall)(s);l&&l.latest_health_checks&&"object"==typeof l.latest_health_checks&&Object.entries(l.latest_health_checks).forEach(s=>{let[l,a]=s;if(!a)return;let r=null,i=t.data.find(e=>e.model_name===l);if(i)r=i.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===l);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let s=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:s?S(s):void 0,fullError:s,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}n(e)})()},[s,t]);let S=e=>{var s;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),l=t.match(/(\w+Error):\s*(\d{3})/i);if(l)return"".concat(l[1],": ").concat(l[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],s={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return s?"".concat(e,": ").concat(s):e}for(let{pattern:e,replacement:s}of tG)if(e.test(t))return s;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let i=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),n=null===(s=i.split(/[.!?]/)[0])||void 0===s?void 0:s.trim();return n&&n.length>0?n.length>100?n.substring(0,97)+"...":n:i.length>100?i.substring(0,97)+"...":i},C=async e=>{if(s){n(s=>({...s,[e]:{...s[e],loading:!0,status:"checking"}}));try{var l,a;let r=await (0,g.individualModelHealthCheckCall)(s,e),i=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let s=(null===(l=r.unhealthy_endpoints[0])||void 0===l?void 0:l.error)||"Health check failed",t=S(s);n(l=>{var a;return{...l,[e]:{status:"unhealthy",lastCheck:i,lastSuccess:(null===(a=l[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:s}}})}else n(s=>({...s,[e]:{status:"healthy",lastCheck:i,lastSuccess:i,loading:!1,successResponse:r}}));try{let l=await (0,g.latestHealthChecksCall)(s),r=t.data.find(s=>s.model_name===e);if(r){let s=r.model_info.id,t=null===(a=l.latest_health_checks)||void 0===a?void 0:a[s];if(t){let s=t.error_message||void 0;n(l=>{var a,r,i,n,o,c,d;return{...l,[e]:{status:t.status||(null===(a=l[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=l[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(i=l[e])||void 0===i?void 0:i.lastSuccess)||"None":(null===(n=l[e])||void 0===n?void 0:n.lastSuccess)||"None",loading:!1,error:s?S(s):null===(o=l[e])||void 0===o?void 0:o.error,fullError:s||(null===(c=l[e])||void 0===c?void 0:c.fullError),successResponse:"healthy"===t.status?t:null===(d=l[e])||void 0===d?void 0:d.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let s=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),l=S(t);n(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:s,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:l,fullError:t}}})}}},I=async()=>{let e=o.length>0?o:l,a=e.reduce((e,s)=>(e[s]={...i[s],loading:!0,status:"checking"},e),{});n(e=>({...e,...a}));let r={},c=e.map(async e=>{if(s)try{let l=await (0,g.individualModelHealthCheckCall)(s,e);r[e]=l;let a=new Date().toLocaleString();if(l.unhealthy_count>0&&l.unhealthy_endpoints&&l.unhealthy_endpoints.length>0){var t;let s=(null===(t=l.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",r=S(s);n(t=>{var l;return{...t,[e]:{status:"unhealthy",lastCheck:a,lastSuccess:(null===(l=t[e])||void 0===l?void 0:l.lastSuccess)||"None",loading:!1,error:r,fullError:s}}})}else n(s=>({...s,[e]:{status:"healthy",lastCheck:a,lastSuccess:a,loading:!1,successResponse:l}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let s=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),l=S(t);n(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:s,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:l,fullError:t}}})}});await Promise.allSettled(c);try{if(!s)return;let l=await (0,g.latestHealthChecksCall)(s);l.latest_health_checks&&Object.entries(l.latest_health_checks).forEach(s=>{let[l,a]=s,r=t.data.find(e=>e.model_info.id===l);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,s=a.error_message||void 0;n(t=>{let l=t[e];return{...t,[e]:{status:a.status||(null==l?void 0:l.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==l?void 0:l.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==l?void 0:l.lastSuccess)||"None",loading:!1,error:s?S(s):null==l?void 0:l.error,fullError:s||(null==l?void 0:l.fullError),successResponse:"healthy"===a.status?a:null==l?void 0:l.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},P=e=>{x(e),e?m(l):m([])},A=()=>{p(!1),f(null)},L=()=>{y(!1),N(null)};return(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"mb-6",children:(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Model Health Status"}),(0,c.jsx)(w.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[o.length>0&&(0,c.jsx)(_.Z,{size:"sm",variant:"light",onClick:()=>P(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,c.jsx)(_.Z,{size:"sm",variant:"secondary",onClick:I,disabled:Object.values(i).some(e=>e.loading),className:"px-3 py-1 text-sm",children:o.length>0&&o.length<l.length?"Run Selected Checks":"Run All Checks"})]})]})}),(0,c.jsx)("div",{children:(0,c.jsx)(tU.C,{columns:tB(i,o,u,(e,s)=>{s?m(s=>[...s,e]):(m(s=>s.filter(s=>s!==e)),x(!1))},P,C,e=>{switch(e){case"healthy":return(0,c.jsx)(eY.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,c.jsx)(eY.Z,{color:"red",children:"unhealthy"});case"checking":return(0,c.jsx)(eY.Z,{color:"blue",children:"checking"});case"none":return(0,c.jsx)(eY.Z,{color:"gray",children:"none"});default:return(0,c.jsx)(eY.Z,{color:"gray",children:"unknown"})}},a,(e,s,t)=>{f({modelName:e,cleanedError:s,fullError:t}),p(!0)},(e,s)=>{N({modelName:e,response:s}),y(!0)},r),data:t.data.map(e=>{let s=i[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:s.status,last_check:s.lastCheck,last_success:s.lastSuccess||"None",health_loading:s.loading,health_error:s.error,health_full_error:s.fullError}}),isLoading:!1,table:Z})}),(0,c.jsx)(E.Z,{title:j?"Health Check Error - ".concat(j.modelName):"Error Details",open:h,onCancel:A,footer:[(0,c.jsx)(T.ZP,{onClick:A,children:"Close"},"close")],width:800,children:j&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Error:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-red-800",children:j.cleanedError})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Full Error Details:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:j.fullError})})]})]})}),(0,c.jsx)(E.Z,{title:b?"Health Check Response - ".concat(b.modelName):"Response Details",open:v,onCancel:L,footer:[(0,c.jsx)(T.ZP,{onClick:L,children:"Close"},"close")],width:800,children:b&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Status:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Response Details:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(b.response,null,2)})})]})]})})]})},tJ=t(61778),tY=t(12660),tW=t(93142),t$=e=>{let{value:s={},onChange:t}=e,[l,a]=(0,d.useState)(Object.entries(s)),r=e=>{let s=l.filter((s,t)=>t!==e);a(s),null==t||t(Object.fromEntries(s))},i=(e,s,r)=>{let i=[...l];i[e]=[s,r],a(i),null==t||t(Object.fromEntries(i))};return(0,c.jsxs)("div",{children:[l.map((e,s)=>{let[t,l]=e;return(0,c.jsxs)(tW.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,c.jsx)(y.Z,{placeholder:"Header Name",value:t,onChange:e=>i(s,e.target.value,l)}),(0,c.jsx)(y.Z,{placeholder:"Header Value",value:l,onChange:e=>i(s,t,e.target.value)}),(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,c.jsx)(tc.Z,{onClick:()=>r(s),style:{cursor:"pointer"}})})]},s)}),(0,c.jsx)(T.ZP,{type:"dashed",onClick:()=>{a([...l,["",""]])},icon:(0,c.jsx)(td.Z,{}),children:"Add Header"})]})},tQ=t(77565),tX=e=>{let{pathValue:s,targetValue:t,includeSubpath:l}=e,a=(0,g.getProxyBaseUrl)();return s&&t?(0,c.jsxs)(X.Z,{className:"p-5",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,c.jsx)(sL.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,c.jsxs)("div",{className:"space-y-5",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,c.jsx)("code",{className:"font-mono text-sm text-gray-900",children:s?"".concat(a).concat(s):""})]}),(0,c.jsx)("div",{className:"text-gray-400",children:(0,c.jsx)(tQ.Z,{className:"text-lg"})}),(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,c.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),l&&(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,c.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[s&&"".concat(a).concat(s),(0,c.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,c.jsx)("div",{className:"text-gray-400",children:(0,c.jsx)(tQ.Z,{className:"text-lg"})}),(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,c.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,c.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,c.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",s," will be appended to the target URL"]})]})}),!l&&(0,c.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(U.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,c.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like ",(0,c.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null};let{Option:t0}=C.default;var t1=e=>{let{accessToken:s,setPassThroughItems:t,passThroughItems:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)(""),[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(!0),b=()=>{a.resetFields(),h(""),j(""),v(!0),i(!1)},N=e=>{let s=e;e&&!e.startsWith("/")&&(s="/"+e),h(s),a.setFieldsValue({path:s})},Z=async e=>{console.log("addPassThrough called with:",e),o(!0);try{console.log("formValues: ".concat(JSON.stringify(e)));let r=(await (0,g.createPassThroughEndpoint)(s,e)).endpoints[0],n=[...l,r];t(n),P.ZP.success("Pass-through endpoint created successfully"),a.resetFields(),h(""),j(""),v(!0),i(!1)}catch(e){P.ZP.error("Error creating pass-through endpoint: "+e,20)}finally{o(!1)}};return(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>i(!0),children:"+ Add Pass-Through Endpoint"}),(0,c.jsx)(E.Z,{title:(0,c.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,c.jsx)(tY.Z,{className:"text-xl text-blue-500"}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:r,width:1e3,onCancel:b,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,c.jsxs)("div",{className:"mt-6",children:[(0,c.jsx)(tJ.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,c.jsxs)(I.Z,{form:a,onFinish:Z,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:x,target:p},children:[(0,c.jsxs)(X.Z,{className:"p-5",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,c.jsx)(sL.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,c.jsxs)("div",{className:"space-y-5",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)(y.Z,{placeholder:"bria",value:x,onChange:e=>N(e.target.value),className:"flex-1"})})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,c.jsx)(y.Z,{placeholder:"https://engine.prod.bria-api.com",value:p,onChange:e=>{j(e.target.value),a.setFieldsValue({target:e.target.value})}})}),(0,c.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,c.jsx)(I.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,c.jsx)(tT.Z,{checked:f,onChange:v})})]})]})]}),(0,c.jsx)(tX,{pathValue:x,targetValue:p,includeSubpath:f}),(0,c.jsxs)(X.Z,{className:"p-6",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,c.jsx)(sL.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,c.jsx)(z.Z,{title:"Authentication and other headers to forward with requests",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,c.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,c.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,c.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,c.jsx)(t$,{})})]}),(0,c.jsxs)(X.Z,{className:"p-6",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,c.jsx)(sL.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,c.jsx)(z.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,c.jsx)(M,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,c.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:b,children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",loading:n,onClick:()=>{console.log("Submit button clicked"),a.submit()},children:n?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},t2=t(87769),t4=t(42208);let t5=e=>{let{value:s}=e,[t,l]=(0,d.useState)(!1),a=JSON.stringify(s,null,2);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?a:"••••••••"}),(0,c.jsx)("button",{onClick:()=>l(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,c.jsx)(t2.Z,{className:"w-4 h-4 text-gray-500"}):(0,c.jsx)(t4.Z,{className:"w-4 h-4 text-gray-500"})})]})};var t6=e=>{let{endpointData:s,onClose:t,accessToken:l,isAdmin:a,onEndpointUpdated:r}=e,[i,n]=(0,d.useState)(s),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)(!1),[h]=I.Z.useForm(),p=async e=>{try{if(!l||!(null==i?void 0:i.id))return;let s={};if(e.headers)try{s="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){P.ZP.error("Invalid JSON format for headers");return}let t={path:i.path,target:e.target,headers:s,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request};await (0,g.updatePassThroughEndpoint)(l,i.id,t),n({...i,...t}),x(!1),r&&r()}catch(e){console.error("Error updating endpoint:",e),P.ZP.error("Failed to update pass through endpoint")}},j=async()=>{try{if(!l||!(null==i?void 0:i.id))return;await (0,g.deletePassThroughEndpointsCall)(l,i.id),P.ZP.success("Pass through endpoint deleted successfully"),t(),r&&r()}catch(e){console.error("Error deleting endpoint:",e),P.ZP.error("Failed to delete pass through endpoint")}};return o?(0,c.jsx)("div",{className:"p-4",children:"Loading..."}):i?(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,c.jsxs)(k.Z,{children:["Pass Through Endpoint: ",i.path]}),(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:i.id})]})}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"},"overview"),a?(0,c.jsx)(eW.Z,{children:"Settings"},"settings"):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Path"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{className:"font-mono",children:i.path})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Target"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{children:i.target})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Configuration"}),(0,c.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,c.jsx)("div",{children:(0,c.jsx)(eY.Z,{color:i.include_subpath?"green":"gray",children:i.include_subpath?"Include Subpath":"Exact Path"})}),void 0!==i.cost_per_request&&(0,c.jsx)("div",{children:(0,c.jsxs)(w.Z,{children:["Cost per request: $",i.cost_per_request]})})]})]})]}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(tX,{pathValue:i.path,targetValue:i.target,includeSubpath:i.include_subpath||!1})}),i.headers&&Object.keys(i.headers).length>0&&(0,c.jsxs)(X.Z,{className:"mt-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Headers"}),(0,c.jsxs)(eY.Z,{color:"blue",children:[Object.keys(i.headers).length," headers configured"]})]}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(t5,{value:i.headers})})]})]}),a&&(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Pass Through Endpoint Settings"}),(0,c.jsx)("div",{className:"space-x-2",children:!u&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_.Z,{onClick:()=>x(!0),children:"Edit Settings"}),(0,c.jsx)(_.Z,{onClick:j,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),u?(0,c.jsxs)(I.Z,{form:h,onFinish:p,initialValues:{target:i.target,headers:i.headers?JSON.stringify(i.headers,null,2):"",include_subpath:i.include_subpath||!1,cost_per_request:i.cost_per_request},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,c.jsx)(y.Z,{placeholder:"https://api.example.com"})}),(0,c.jsx)(I.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,c.jsx)(L.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,c.jsx)(I.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,c.jsx)(to.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,c.jsx)(q.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,c.jsx)(T.ZP,{onClick:()=>x(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{children:"Save Changes"})]})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Path"}),(0,c.jsx)("div",{className:"font-mono",children:i.path})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Target URL"}),(0,c.jsx)("div",{children:i.target})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Include Subpath"}),(0,c.jsx)(eY.Z,{color:i.include_subpath?"green":"gray",children:i.include_subpath?"Yes":"No"})]}),void 0!==i.cost_per_request&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cost per Request"}),(0,c.jsxs)("div",{children:["$",i.cost_per_request]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Headers"}),i.headers&&Object.keys(i.headers).length>0?(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(t5,{value:i.headers})}):(0,c.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,c.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},t3=t(19130);function t8(e){let{data:s=[],columns:t,getRowCanExpand:l,renderSubComponent:a,isLoading:r=!1,loadingMessage:i="\uD83D\uDE85 Loading logs...",noDataMessage:n="No logs found"}=e,o=(0,sg.b7)({data:s,columns:t,getRowCanExpand:l,getRowId:(e,s)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(s)},getCoreRowModel:(0,sj.sC)(),getExpandedRowModel:(0,sj.rV)()});return(0,c.jsx)("div",{className:"rounded-lg custom-border",children:(0,c.jsxs)(t3.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(t3.ss,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(t3.SC,{children:e.headers.map(e=>(0,c.jsx)(t3.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,c.jsx)(t3.RM,{children:r?(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:i})})})}):o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsxs)(d.Fragment,{children:[(0,c.jsx)(t3.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(t3.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:e.getVisibleCells().length,children:a({row:e})})})]},e.id)):(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:n})})})})})]})})}let t7=e=>{let{value:s}=e,[t,l]=(0,d.useState)(!1),a=JSON.stringify(s);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"font-mono text-xs",children:t?a:"••••••••"}),(0,c.jsx)("button",{onClick:()=>l(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,c.jsx)(t2.Z,{className:"w-4 h-4 text-gray-500"}):(0,c.jsx)(t4.Z,{className:"w-4 h-4 text-gray-500"})})]})};var t9=e=>{let{accessToken:s,userRole:t,userID:l,modelData:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{s&&t&&l&&(0,g.getPassThroughEndpointsCall)(s).then(e=>{i(e.endpoints)})},[s,t,l]);let p=async e=>{h(e),u(!0)},j=async()=>{if(null!=x&&s){try{await (0,g.deletePassThroughEndpointsCall)(s,x);let e=r.filter(e=>e.id!==x);i(e),P.ZP.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.ZP.error("Error deleting the endpoint: "+e)}u(!1),h(null)}},f=(e,s)=>{p(e)},v=[{header:"ID",accessorKey:"id",cell:e=>(0,c.jsx)(z.Z,{title:e.row.original.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&o(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,c.jsx)(w.Z,{children:e.getValue()})},{header:"Headers",accessorKey:"headers",cell:e=>(0,c.jsx)(t7,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>s.original.id&&o(s.original.id),title:"Edit"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>f(s.original.id,s.index),title:"Delete"})]})}}];if(!s)return null;if(n){console.log("selectedEndpointId",n),console.log("generalSettings",r);let e=r.find(e=>e.id===n);return e?(0,c.jsx)(t6,{endpointData:e,onClose:()=>o(null),accessToken:s,isAdmin:"Admin"===t||"admin"===t,onEndpointUpdated:()=>{s&&(0,g.getPassThroughEndpointsCall)(s).then(e=>{i(e.endpoints)})}}):(0,c.jsx)("div",{children:"Endpoint not found"})}return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Pass Through Endpoints"}),(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,c.jsx)(t1,{accessToken:s,setPassThroughItems:i,passThroughItems:r}),(0,c.jsx)(t8,{data:r,columns:v,renderSubComponent:()=>(0,c.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),m&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:j,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{u(!1),h(null)},children:"Cancel"})]})]})]})})]})};let le={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var ls=e=>{let{accessToken:s,token:t,userRole:l,userID:a,modelData:r={data:[]},keys:i,setModelData:n,premiumUser:o,teams:m}=e,[u]=I.Z.useForm(),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(""),[y,b]=(0,d.useState)([]),[N,Z]=(0,d.useState)([]),[S,C]=(0,d.useState)(sO.Cl.OpenAI),[E,A]=(0,d.useState)(null),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(!1),[D,F]=(0,d.useState)(null),[R,z]=(0,d.useState)([]),[V,K]=(0,d.useState)([]),[B,G]=(0,d.useState)(null),[H,J]=(0,d.useState)([]),[Y,W]=(0,d.useState)([]),[$,Q]=(0,d.useState)([]),[ee,es]=(0,d.useState)([]),[et,el]=(0,d.useState)([]),[ea,er]=(0,d.useState)([]),[ei,en]=(0,d.useState)([]),[eo,ec]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ed,em]=(0,d.useState)(null),[eu,ep]=(0,d.useState)(0),[eg,ej]=(0,d.useState)({}),[ef,ev]=(0,d.useState)([]),[e_,ey]=(0,d.useState)(!1),[eb,eN]=(0,d.useState)(null),[eZ,ew]=(0,d.useState)(null),[ek,eS]=(0,d.useState)([]),[eC,eI]=(0,d.useState)([]),[eP,eE]=(0,d.useState)(!1),[eA,eT]=(0,d.useState)(null),[eO,eM]=(0,d.useState)(!1),[eD,eF]=(0,d.useState)(null),[eR,eq]=(0,d.useState)(null),[eU,ez]=(0,d.useState)(null),[eV,eK]=(0,d.useState)(null),[eB,eG]=(0,d.useState)("personal"),[eH,eY]=(0,d.useState)("current_team"),[e1,e4]=(0,d.useState)(!1),[e5,e6]=(0,d.useState)(!1),[e3,e8]=(0,d.useState)(new Set),e7=(0,d.useRef)(null),e9=(0,d.useRef)(null),[se,ss]=(0,d.useState)(0),st=async(e,t,r)=>{if(console.log("Updating model metrics for group:",e),!s||!a||!l||!t||!r)return;console.log("inside updateModelMetrics - startTime:",t,"endTime:",r),G(e);let i=null==eb?void 0:eb.token;void 0===i&&(i=null);let n=eZ;void 0===n&&(n=null);try{let o=await (0,g.modelMetricsCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);console.log("Model metrics response:",o),J(o.data),W(o.all_api_bases);let c=await (0,g.streamingModelMetricsCall)(s,e,t.toISOString(),r.toISOString());Q(c.data),es(c.all_api_bases);let d=await (0,g.modelExceptionsCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);console.log("Model exceptions response:",d),el(d.data),er(d.exception_types);let m=await (0,g.modelMetricsSlowResponsesCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);if(console.log("slowResponses:",m),en(m),e){let l=await (0,g.adminGlobalActivityExceptions)(s,null==t?void 0:t.toISOString().split("T")[0],null==r?void 0:r.toISOString().split("T")[0],e);ej(l);let a=await (0,g.adminGlobalActivityExceptionsPerDeployment)(s,null==t?void 0:t.toISOString().split("T")[0],null==r?void 0:r.toISOString().split("T")[0],e);ev(a)}}catch(e){console.error("Failed to fetch model metrics",e)}},sl=async e=>{try{let s=await (0,g.credentialListCall)(e);console.log("credentials: ".concat(JSON.stringify(s))),eI(s.credentials)}catch(e){console.error("Error fetching credentials:",e)}};(0,d.useEffect)(()=>{st(B,eo.from,eo.to)},[eb,eZ,eR]),(0,d.useEffect)(()=>{let e=e=>{e7.current&&!e7.current.contains(e.target)&&e6(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let sa={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let s=new FileReader;s.onload=e=>{if(e.target){let s=e.target.result;console.log("Resetting vertex_credentials to JSON; jsonStr: ".concat(s)),u.setFieldsValue({vertex_credentials:s}),console.log("Form values right after setting:",u.getFieldsValue())}},s.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered with values:",e),console.log("Current form values:",u.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?P.ZP.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&P.ZP.error("".concat(e.file.name," file upload failed."))}},sr=()=>{j(new Date().toLocaleString())},si=async()=>{if(!s){console.error("Access token is missing");return}console.log("new modelGroupRetryPolicy:",ed);try{await (0,g.setCallbacksCall)(s,{router_settings:{model_group_retry_policy:ed}}),P.ZP.success("Retry settings saved successfully")}catch(e){console.error("Failed to save retry settings:",e),P.ZP.error("Failed to save retry settings")}};if((0,d.useEffect)(()=>{if(!s||!t||!l||!a)return;let e=async()=>{try{var e,t,r,i,o,c,d,m,u,x,h,p;let j=await (0,g.modelInfoCall)(s,a,l);console.log("Model data response:",j.data),n(j);let f=await (0,g.modelSettingsCall)(s);f&&Z(f);let v=new Set;for(let e=0;e<j.data.length;e++){let s=j.data[e];v.add(s.model_name)}console.log("all_model_groups:",v);let _=Array.from(v);_=_.sort(),z(_);let y=new Set;for(let e=0;e<j.data.length;e++){let s=j.data[e].model_info;if(s){let e=s.access_groups;if(e)for(let s=0;s<e.length;s++)y.add(e[s])}}K(Array.from(y)),console.log("array_model_groups:",_);let b="all";_.length>0&&(b=_[_.length-1],console.log("_initial_model_group:",b)),console.log("selectedModelGroup:",B);let N=await (0,g.modelMetricsCall)(s,a,l,b,null===(e=eo.from)||void 0===e?void 0:e.toISOString(),null===(t=eo.to)||void 0===t?void 0:t.toISOString(),null==eb?void 0:eb.token,eZ);console.log("Model metrics response:",N),J(N.data),W(N.all_api_bases);let w=await (0,g.streamingModelMetricsCall)(s,b,null===(r=eo.from)||void 0===r?void 0:r.toISOString(),null===(i=eo.to)||void 0===i?void 0:i.toISOString());Q(w.data),es(w.all_api_bases);let k=await (0,g.modelExceptionsCall)(s,a,l,b,null===(o=eo.from)||void 0===o?void 0:o.toISOString(),null===(c=eo.to)||void 0===c?void 0:c.toISOString(),null==eb?void 0:eb.token,eZ);console.log("Model exceptions response:",k),el(k.data),er(k.exception_types);let S=await (0,g.modelMetricsSlowResponsesCall)(s,a,l,b,null===(d=eo.from)||void 0===d?void 0:d.toISOString(),null===(m=eo.to)||void 0===m?void 0:m.toISOString(),null==eb?void 0:eb.token,eZ),C=await (0,g.adminGlobalActivityExceptions)(s,null===(u=eo.from)||void 0===u?void 0:u.toISOString().split("T")[0],null===(x=eo.to)||void 0===x?void 0:x.toISOString().split("T")[0],b);ej(C);let I=await (0,g.adminGlobalActivityExceptionsPerDeployment)(s,null===(h=eo.from)||void 0===h?void 0:h.toISOString().split("T")[0],null===(p=eo.to)||void 0===p?void 0:p.toISOString().split("T")[0],b);ev(I),console.log("dailyExceptions:",C),console.log("dailyExceptionsPerDeplyment:",I),console.log("slowResponses:",S),en(S);let P=await (0,g.allEndUsersCall)(s);eS(null==P?void 0:P.end_users);let E=(await (0,g.getCallbacksCall)(s,a,l)).router_settings;console.log("routerSettingsInfo:",E);let A=E.model_group_retry_policy,T=E.num_retries;console.log("model_group_retry_policy:",A),console.log("default_retries:",T),em(A),ep(T)}catch(e){console.error("There was an error fetching the model data",e)}};s&&t&&l&&a&&e();let r=async()=>{let e=await (0,g.modelCostMap)(s);console.log("received model cost map data: ".concat(Object.keys(e))),h(e)};null==x&&r(),sr()},[s,t,l,a,x,p,eR]),!r||!s||!t||!l||!a)return(0,c.jsx)("div",{children:"Loading..."});let sn=[],so=[];for(let e=0;e<r.data.length;e++){var sd,sm,su;let s=r.data[e],t=null==s?void 0:null===(sd=s.litellm_params)||void 0===sd?void 0:sd.model,l=null==s?void 0:null===(sm=s.litellm_params)||void 0===sm?void 0:sm.custom_llm_provider,a=null==s?void 0:s.model_info,i="",n="Undefined",o="Undefined",c="Undefined",d="Undefined",m={},u=e=>(console.log("GET PROVIDER CALLED! - ".concat(x)),null!=x&&"object"==typeof x&&e in x)?x[e].litellm_provider:"openai";if(t){let e=t.split("/"),s=e[0];(i=l)||(i=1===e.length?u(t):s)}else i="-";a&&(n=null==a?void 0:a.input_cost_per_token,o=null==a?void 0:a.output_cost_per_token,c=null==a?void 0:a.max_tokens,d=null==a?void 0:a.max_input_tokens),(null==s?void 0:s.litellm_params)&&(m=Object.fromEntries(Object.entries(null==s?void 0:s.litellm_params).filter(e=>{let[s]=e;return"model"!==s&&"api_base"!==s}))),r.data[e].provider=i,r.data[e].input_cost=n,r.data[e].output_cost=o,r.data[e].litellm_model_name=t,so.push(i),r.data[e].input_cost&&(r.data[e].input_cost=(1e6*Number(r.data[e].input_cost)).toFixed(2)),r.data[e].output_cost&&(r.data[e].output_cost=(1e6*Number(r.data[e].output_cost)).toFixed(2)),r.data[e].max_tokens=c,r.data[e].max_input_tokens=d,r.data[e].api_base=null==s?void 0:null===(su=s.litellm_params)||void 0===su?void 0:su.api_base,r.data[e].cleanedLitellmParams=m,sn.push(s.model_name),console.log(r.data[e])}if(l&&"Admin Viewer"==l){let{Title:e,Paragraph:s}=eh.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to view all models"})]})}let sx=(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mb-1",children:"Select API Key Name"}),o?(0,c.jsxs)("div",{children:[(0,c.jsxs)(eJ.Z,{defaultValue:"all-keys",children:[(0,c.jsx)(ex.Z,{value:"all-keys",onClick:()=>{eN(null)},children:"All Keys"},"all-keys"),null==i?void 0:i.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,c.jsx)(ex.Z,{value:String(s),onClick:()=>{eN(e)},children:e.key_alias},s):null)]}),(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Customer Name"}),(0,c.jsxs)(eJ.Z,{defaultValue:"all-customers",children:[(0,c.jsx)(ex.Z,{value:"all-customers",onClick:()=>{ew(null)},children:"All Customers"},"all-customers"),null==ek?void 0:ek.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,onClick:()=>{ew(e)},children:e},s))]}),(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Team"}),(0,c.jsxs)(eJ.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=eU?eU:"all",onValueChange:e=>ez("all"===e?null:e),children:[(0,c.jsx)(ex.Z,{value:"all",children:"All Teams"}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ex.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Team"}),(0,c.jsxs)(eJ.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=eU?eU:"all",onValueChange:e=>ez("all"===e?null:e),children:[(0,c.jsx)(ex.Z,{value:"all",children:"All Teams"}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ex.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]}),sh=e=>{var s,t;let{payload:l,active:a}=e;if(!a||!l)return null;let r=null===(t=l[0])||void 0===t?void 0:null===(s=t.payload)||void 0===s?void 0:s.date,i=l.sort((e,s)=>s.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:l.slice(5).reduce((e,s)=>e+s.value,0),color:"gray"})}return(0,c.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,c.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",r]}),i.map((e,s)=>{let t=parseFloat(e.value.toFixed(5)),l=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,c.jsxs)("div",{className:"flex justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,c.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,c.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:l})]},s)})]})};console.log("selectedProvider: ".concat(S)),console.log("providerModels.length: ".concat(y.length));let sp=Object.keys(sO.Cl).find(e=>sO.Cl[e]===S);return(sp&&N&&N.find(e=>e.name===sO.fK[sp]),eD)?(0,c.jsx)("div",{className:"w-full h-full",children:(0,c.jsx)(tl,{teamId:eD,onClose:()=>eF(null),accessToken:s,is_team_admin:"Admin"===l,is_proxy_admin:"Proxy Admin"===l,userModels:sn,editTeam:!1,onUpdate:sr})}):(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:eA?(0,c.jsx)(ty,{modelId:eA,editModel:!0,onClose:()=>{eT(null),eM(!1)},modelData:r.data.find(e=>e.model_info.id===eA),accessToken:s,userID:a,userRole:l,setEditModalVisible:M,setSelectedModel:F,onModelUpdate:e=>{n({...r,data:r.data.map(s=>s.model_info.id===e.model_info.id?e:s)}),sr()},modelAccessGroups:V}):(0,c.jsxs)(e$.Z,{index:se,onIndexChange:ss,className:"gap-2 h-[75vh] w-full ",children:[(0,c.jsxs)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[eL.ZL.includes(l)?(0,c.jsx)(eW.Z,{children:"All Models"}):(0,c.jsx)(eW.Z,{children:"Your Models"}),(0,c.jsx)(eW.Z,{children:"Add Model"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"LLM Credentials"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"Pass-Through Endpoints"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"Health Status"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"Model Analytics"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"Model Retry Settings"})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[p&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",p]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center",onClick:sr})]})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsx)(v.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Model Management"}),eL.ZL.includes(l)?(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Add and manage models for the proxy"}):(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Add models for teams you are an admin for."})]})}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,c.jsxs)(eJ.Z,{className:"w-80",defaultValue:"personal",value:eB,onValueChange:e=>eG(e),children:[(0,c.jsx)(ex.Z,{value:"personal",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ex.Z,{value:e.team_id,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),"current_team"===eH&&(0,c.jsxs)("div",{className:"flex items-start gap-2 mt-2 bg-gray-50 rounded",children:[(0,c.jsx)(U.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===eB?(0,c.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,c.jsx)("a",{href:"/?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,c.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',eB,'" on the'," ",(0,c.jsx)("a",{href:"/?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,c.jsxs)(eJ.Z,{className:"w-64",defaultValue:"current_team",value:eH,onValueChange:e=>eY(e),children:[(0,c.jsx)(ex.Z,{value:"current_team",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,c.jsx)(ex.Z,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),(0,c.jsx)("div",{className:"flex items-center justify-between",children:(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:"Filter by Public Model Name:"}),(0,c.jsxs)(eJ.Z,{className:"w-64",defaultValue:null!=B?B:"all",onValueChange:e=>G("all"===e?"all":e),value:null!=B?B:"all",children:[(0,c.jsx)(ex.Z,{value:"all",children:"All Models"}),(0,c.jsx)(ex.Z,{value:"wildcard",children:"Wildcard Models (*)"}),R.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,children:e},s))]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:"Filter by Model Access Group:"}),(0,c.jsxs)(eJ.Z,{className:"w-64",defaultValue:"all",value:null!=eV?eV:"all",onValueChange:e=>eK("all"===e?null:e),children:[(0,c.jsx)(ex.Z,{value:"all",children:"All Model Access Groups"}),V.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,children:e},s))]})]})]})}),(0,c.jsx)("div",{className:"flex justify-between items-center",children:(0,c.jsxs)(w.Z,{className:"text-sm text-gray-700",children:["Showing"," ",r&&r.data.length>0?r.data.filter(e=>{var s,t,l,a;let r="all"===B||e.model_name===B||!B,i="all"===eV||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(eV))||!eV,n=!0;return"current_team"===eH&&(n="personal"===eB?(null===(t=e.model_info)||void 0===t?void 0:t.direct_access)===!0:(null===(a=e.model_info)||void 0===a?void 0:null===(l=a.access_via_team_ids)||void 0===l?void 0:l.includes(eB))===!0),r&&i&&n}).length:0," ","results"]})})]})}),(0,c.jsx)(tU.C,{columns:tz(l,a,o,eT,eF,sJ,e=>{F(e),M(!0)},sr,eM,e3,e8),data:r.data.filter(e=>{var s,t,l,a;let r="all"===B||e.model_name===B||!B||"wildcard"===B&&e.model_name.includes("*"),i="all"===eV||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(eV))||!eV,n=!0;return"current_team"===eH&&(n="personal"===eB?(null===(t=e.model_info)||void 0===t?void 0:t.direct_access)===!0:(null===(a=e.model_info)||void 0===a?void 0:null===(l=a.access_via_team_ids)||void 0===l?void 0:l.includes(eB))===!0),r&&i&&n}),isLoading:!1,table:e9})]})]})})}),(0,c.jsx)(eX.Z,{className:"h-full",children:(0,c.jsx)(tq,{form:u,handleOk:()=>{u.validateFields().then(e=>{sD(e,s,u,sr)}).catch(e=>{console.error("Validation failed:",e)})},selectedProvider:S,setSelectedProvider:C,providerModels:y,setProviderModelsFn:e=>{let s=(0,sO.bK)(e,x);b(s),console.log("providerModels: ".concat(s))},getPlaceholder:sO.ph,uploadProps:sa,showAdvancedSettings:eP,setShowAdvancedSettings:eE,teams:m,credentials:eC,accessToken:s,userRole:l,premiumUser:o})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(sH,{accessToken:s,uploadProps:sa,credentialList:eC,fetchCredentials:sl})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(t9,{accessToken:s,userRole:l,userID:a,modelData:r})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(tH,{accessToken:s,modelData:r,all_models_on_proxy:sn,getDisplayModelName:sJ,setSelectedModelId:eT})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:eo,className:"mr-2",onValueChange:e=>{ec(e),st(B,e.from,e.to)}})}),(0,c.jsxs)(f.Z,{className:"ml-2",children:[(0,c.jsx)(w.Z,{children:"Select Model Group"}),(0,c.jsx)(eJ.Z,{defaultValue:B||R[0],value:B||R[0],children:R.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,onClick:()=>st(e,eo.from,eo.to),children:e},s))})]}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(sX.Z,{trigger:"click",content:sx,overlayStyle:{width:"20vw"},children:(0,c.jsx)(_.Z,{icon:sc.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>ey(!0)})})})]}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(X.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eW.Z,{value:"1",children:"Avg. Latency per Token"}),(0,c.jsx)(eW.Z,{value:"2",children:"Time to first token"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)("p",{className:"text-gray-500 italic",children:[" ","(seconds/token)"]}),(0,c.jsx)(w.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),H&&Y&&(0,c.jsx)(s$.Z,{title:"Model Latency",className:"h-72",data:H,showLegend:!1,index:"date",categories:Y,connectNulls:!0,customTooltip:sh})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(s1,{modelMetrics:$,modelMetricsCategories:ee,customTooltip:sh,premiumUser:o})})]})]})})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(X.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Deployment"}),(0,c.jsx)(sN.Z,{children:"Success Responses"}),(0,c.jsxs)(sN.Z,{children:["Slow Responses"," ",(0,c.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,c.jsx)(s_.Z,{children:ei.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.api_base}),(0,c.jsx)(sy.Z,{children:e.total_count}),(0,c.jsx)(sy.Z,{children:e.slow_count})]},s))})]})})})]}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(k.Z,{children:["All Exceptions for ",B]}),(0,c.jsx)(sQ.Z,{className:"h-60",data:et,index:"model",categories:ea,stack:!0,yAxisWidth:30})]})}),(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(k.Z,{children:["All Up Rate Limit Errors (429) for ",B]}),(0,c.jsxs)(v.Z,{numItems:1,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors"," ",eg.sum_num_rate_limit_exceptions]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:eg.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,c.jsx)(f.Z,{})]})]}),o?(0,c.jsx)(c.Fragment,{children:ef.map((e,s)=>(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429)"," ",e.sum_num_rate_limit_exceptions]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},s))}):(0,c.jsx)(c.Fragment,{children:ef&&ef.length>0&&ef.slice(0,1).map((e,s)=>(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,c.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,c.jsx)(_.Z,{variant:"primary",className:"mb-2",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:e.api_base}),(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors"," ",e.sum_num_rate_limit_exceptions]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},s))})]})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{children:"Filter by Public Model Name"}),(0,c.jsx)(eJ.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:B||R[0],value:B||R[0],onValueChange:e=>G(e),children:R.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,onClick:()=>G(e),children:e},s))})]}),(0,c.jsxs)(k.Z,{children:["Retry Policy for ",B]}),(0,c.jsx)(w.Z,{className:"mb-6",children:"How many retries should be attempted based on the Exception"}),le&&(0,c.jsx)("table",{children:(0,c.jsx)("tbody",{children:Object.entries(le).map((e,s)=>{var t;let[l,a]=e,r=null==ed?void 0:null===(t=ed[B])||void 0===t?void 0:t[a];return null==r&&(r=eu),(0,c.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,c.jsx)("td",{children:(0,c.jsx)(w.Z,{children:l})}),(0,c.jsx)("td",{children:(0,c.jsx)(q.Z,{className:"ml-5",value:r,min:0,step:1,onChange:e=>{em(s=>{var t;let l=null!==(t=null==s?void 0:s[B])&&void 0!==t?t:{};return{...null!=s?s:{},[B]:{...l,[a]:e}}})}})})]},s)})})}),(0,c.jsx)(_.Z,{className:"mt-6 mr-8",onClick:si,children:"Save"})]})]})]})})})})},lt=e=>{let{visible:s,possibleUIRoles:t,onCancel:l,user:a,onSubmit:r}=e,[i,n]=(0,d.useState)(a),[o]=I.Z.useForm();(0,d.useEffect)(()=>{o.resetFields()},[a]);let m=async()=>{o.resetFields(),l()},u=async e=>{r(e),o.resetFields(),l()};return a?(0,c.jsx)(E.Z,{visible:s,onCancel:m,footer:null,title:"Edit User "+a.user_id,width:1e3,children:(0,c.jsx)(I.Z,{form:o,onFinish:u,initialValues:a,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"User Role",name:"user_role",children:(0,c.jsx)(C.default,{children:t&&Object.entries(t).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ex.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,c.jsx)(q.Z,{min:0,step:.01})}),(0,c.jsx)(I.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,c.jsx)(M,{min:0,step:.01})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},ll=t(16853);function la(e){let{userData:s,onCancel:t,onSubmit:l,teams:a,accessToken:r,userID:i,userRole:n,userModels:o,possibleUIRoles:m,isBulkEdit:u=!1}=e,[x]=I.Z.useForm();return d.useEffect(()=>{var e,t,l,a,r;x.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_role:null===(t=s.user_info)||void 0===t?void 0:t.user_role,models:(null===(l=s.user_info)||void 0===l?void 0:l.models)||[],max_budget:null===(a=s.user_info)||void 0===a?void 0:a.max_budget,metadata:(null===(r=s.user_info)||void 0===r?void 0:r.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,x]),(0,c.jsxs)(I.Z,{form:x,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}l(e)},layout:"vertical",children:[!u&&(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",children:(0,c.jsx)(y.Z,{disabled:!0})}),!u&&(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Global Proxy Role"," ",(0,c.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,c.jsx)(U.Z,{})})]}),name:"user_role",children:(0,c.jsx)(C.default,{children:m&&Object.entries(m).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ex.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Personal Models"," ",(0,c.jsx)(z.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!eL.ZL.includes(n||""),children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),o.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(ll.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:t,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})]})}let{Text:lr,Title:li}=eh.default;var ln=e=>{let{visible:s,onCancel:t,selectedUsers:l,possibleUIRoles:a,accessToken:r,onSuccess:i,teams:n,userRole:o,userModels:m}=e,[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)(null),[v,_]=(0,d.useState)(!1),y=()=>{p([]),f(null),_(!1),t()},b=async e=>{if(!r){P.ZP.error("Access token not found");return}x(!0);try{let s=l.map(e=>e.user_id),a={};e.user_role&&""!==e.user_role&&(a.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(a.max_budget=e.max_budget),e.models&&e.models.length>0&&(a.models=e.models),e.metadata&&Object.keys(e.metadata).length>0&&(a.metadata=e.metadata);let n=Object.keys(a).length>0,o=v&&h.length>0;if(!n&&!o){P.ZP.error("Please modify at least one field or select teams to add users to");return}let c=[];if(n&&(await (0,g.userBulkUpdateUserCall)(r,a,s),c.push("Updated ".concat(s.length," user(s)"))),o){let e=[];for(let s of h)try{let t=l.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null})),a=await (0,g.teamBulkMemberAddCall)(r,s,t,j||void 0);e.push({teamId:s,success:!0,successfulAdditions:a.successful_additions,failedAdditions:a.failed_additions})}catch(t){console.error("Failed to add users to team ".concat(s,":"),t),e.push({teamId:s,success:!1,error:t})}let s=e.filter(e=>e.success),t=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);c.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}t.length>0&&P.ZP.warning("Failed to add users to ".concat(t.length," team(s)"))}c.length>0&&P.ZP.success(c.join(". ")),p([]),f(null),_(!1),i(),t()}catch(e){console.error("Bulk operation failed:",e),P.ZP.error("Failed to perform bulk operations")}finally{x(!1)}};return(0,c.jsxs)(E.Z,{visible:s,onCancel:y,footer:null,title:"Bulk Edit ".concat(l.length," User(s)"),width:800,children:[(0,c.jsxs)("div",{className:"mb-4",children:[(0,c.jsxs)(li,{level:5,children:["Selected Users (",l.length,"):"]}),(0,c.jsx)(ej.Z,{size:"small",bordered:!0,dataSource:l,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,c.jsx)(lr,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,c.jsx)(lr,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,c.jsx)(lr,{style:{fontSize:"12px"},children:(null==a?void 0:null===(s=a[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,c.jsx)(lr,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,c.jsx)(Q.Z,{}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsxs)(lr,{children:[(0,c.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,c.jsx)(tp.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,c.jsxs)(tW.Z,{direction:"vertical",style:{width:"100%"},children:[(0,c.jsx)(s4.Z,{checked:v,onChange:e=>_(e.target.checked),children:"Add selected users to teams"}),v&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(lr,{strong:!0,children:"Select Teams:"}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select teams to add users to",value:h,onChange:p,style:{width:"100%",marginTop:8},options:(null==n?void 0:n.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(lr,{strong:!0,children:"Team Budget (Optional):"}),(0,c.jsx)(q.Z,{placeholder:"Max budget per user in team",value:j,onChange:e=>f(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,c.jsx)(lr,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,c.jsx)(lr,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,c.jsx)(la,{userData:{user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:n||[]},onCancel:y,onSubmit:b,teams:n,accessToken:r,userID:"bulk_edit",userRole:o,userModels:m,possibleUIRoles:a,isBulkEdit:!0}),u&&(0,c.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,c.jsxs)(lr,{children:["Updating ",l.length," user(s)..."]})})]})};let lo=(e,s,t,l,a,r)=>{let i=[{header:"User ID",accessorKey:"user_id",cell:e=>{let{row:s}=e;return(0,c.jsx)(z.Z,{title:s.original.user_id,children:(0,c.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"User Email",accessorKey:"user_email",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",cell:s=>{var t;let{row:l}=s;return(0,c.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(t=e[l.original.user_role])||void 0===t?void 0:t.ui_label)||"-"})}},{header:"User Spend ($ USD)",accessorKey:"spend",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.spend?eR(s.original.spend,4):"-"})}},{header:"User Max Budget ($ USD)",accessorKey:"max_budget",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{children:"SSO ID"}),(0,c.jsx)(z.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,c.jsx)(tV.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"API Keys",accessorKey:"key_count",cell:e=>{let{row:s}=e;return(0,c.jsx)(v.Z,{numItems:2,children:s.original.key_count>0?(0,c.jsxs)(eY.Z,{size:"xs",color:"indigo",children:[s.original.key_count," Keys"]}):(0,c.jsx)(eY.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(z.Z,{title:"Edit user details",zIndex:9999,children:(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>a(s.original.user_id,!0)})}),(0,c.jsx)(z.Z,{title:"Delete user",zIndex:9999,children:(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>t(s.original.user_id)})}),(0,c.jsx)(z.Z,{title:"Reset Password",zIndex:9999,children:(0,c.jsx)(sf.Z,{icon:e2.Z,size:"sm",onClick:()=>l(s.original.user_id)})})]})}}];if(r){let{onSelectUser:e,onSelectAll:s,isUserSelected:t,isAllSelected:l,isIndeterminate:a}=r;return[{id:"select",header:()=>(0,c.jsx)(s4.Z,{indeterminate:a,checked:l,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:l}=s;return(0,c.jsx)(s4.Z,{checked:t(l.original),onChange:s=>e(l.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...i]}return i};function lc(e){var s,t,l,a,r,i,n,o,m,u,x,h,p,j,f,y,b,N,Z,S,C,I,E,A,L,O,M;let{userId:D,onClose:F,accessToken:R,userRole:q,onDelete:U,possibleUIRoles:z,initialTab:V=0,startInEditMode:K=!1}=e,[B,G]=(0,d.useState)(null),[H,J]=(0,d.useState)(!1),[Y,W]=(0,d.useState)(!0),[$,Q]=(0,d.useState)(K),[ee,es]=(0,d.useState)([]),[et,ea]=(0,d.useState)(!1),[er,ei]=(0,d.useState)(null),[en,eo]=(0,d.useState)(null),[ec,ed]=(0,d.useState)(V),[em,eu]=(0,d.useState)({});d.useEffect(()=>{eo((0,g.getProxyBaseUrl)())},[]),d.useEffect(()=>{console.log("userId: ".concat(D,", userRole: ").concat(q,", accessToken: ").concat(R)),(async()=>{try{if(!R)return;let e=await (0,g.userInfoCall)(R,D,q||"",!1,null,null,!0);G(e);let s=(await (0,g.modelAvailableCall)(R,D,q||"")).data.map(e=>e.id);es(s)}catch(e){console.error("Error fetching user data:",e),P.ZP.error("Failed to fetch user data")}finally{W(!1)}})()},[R,D,q]);let ex=async()=>{if(!R){P.ZP.error("Access token not found");return}try{P.ZP.success("Generating password reset link...");let e=await (0,g.invitationCreateCall)(R,D);ei(e),ea(!0)}catch(e){P.ZP.error("Failed to generate password reset link")}},eh=async()=>{try{if(!R)return;await (0,g.userDeleteCall)(R,[D]),P.ZP.success("User deleted successfully"),U&&U(),F()}catch(e){console.error("Error deleting user:",e),P.ZP.error("Failed to delete user")}},eg=async e=>{try{if(!R||!B)return;await (0,g.userUpdateUserCall)(R,e,null),G({...B,user_info:{...B.user_info,user_email:e.user_email,models:e.models,max_budget:e.max_budget,metadata:e.metadata}}),P.ZP.success("User updated successfully"),Q(!1)}catch(e){console.error("Error updating user:",e),P.ZP.error("Failed to update user")}};if(Y)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(w.Z,{children:"Loading user data..."})]});if(!B)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(w.Z,{children:"User not found"})]});let ej=async(e,s)=>{await eq(e)&&(eu(e=>({...e,[s]:!0})),setTimeout(()=>{eu(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(k.Z,{children:(null===(s=B.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:B.user_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:em["user-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>ej(B.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(em["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),q&&eL.LQ.includes(q)&&(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(_.Z,{icon:e2.Z,variant:"secondary",onClick:ex,className:"flex items-center",children:"Reset Password"}),(0,c.jsx)(_.Z,{icon:el.Z,variant:"secondary",onClick:()=>J(!0),className:"flex items-center",children:"Delete User"})]})]}),H&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:eh,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>J(!1),children:"Cancel"})]})]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:ec,onIndexChange:ed,children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"}),(0,c.jsx)(eW.Z,{children:"Details"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Spend"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eR((null===(t=B.user_info)||void 0===t?void 0:t.spend)||0,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",(null===(l=B.user_info)||void 0===l?void 0:l.max_budget)!==null?"$".concat(eR(B.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Teams"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(w.Z,{children:[(null===(a=B.teams)||void 0===a?void 0:a.length)||0," teams"]})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"API Keys"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(w.Z,{children:[(null===(r=B.keys)||void 0===r?void 0:r.length)||0," keys"]})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Personal Models"}),(0,c.jsx)("div",{className:"mt-2",children:(null===(n=B.user_info)||void 0===n?void 0:null===(i=n.models)||void 0===i?void 0:i.length)&&(null===(m=B.user_info)||void 0===m?void 0:null===(o=m.models)||void 0===o?void 0:o.length)>0?null===(x=B.user_info)||void 0===x?void 0:null===(u=x.models)||void 0===u?void 0:u.map((e,s)=>(0,c.jsx)(w.Z,{children:e},s)):(0,c.jsx)(w.Z,{children:"All proxy models"})})]})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"User Settings"}),!$&&q&&eL.LQ.includes(q)&&(0,c.jsx)(_.Z,{variant:"light",onClick:()=>Q(!0),children:"Edit Settings"})]}),$&&B?(0,c.jsx)(la,{userData:B,onCancel:()=>Q(!1),onSubmit:eg,teams:B.teams,accessToken:R,userID:D,userRole:q,userModels:ee,possibleUIRoles:z}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"User ID"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"font-mono",children:B.user_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:em["user-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>ej(B.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(em["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Email"}),(0,c.jsx)(w.Z,{children:(null===(h=B.user_info)||void 0===h?void 0:h.user_email)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Role"}),(0,c.jsx)(w.Z,{children:(null===(p=B.user_info)||void 0===p?void 0:p.user_role)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:(null===(j=B.user_info)||void 0===j?void 0:j.created_at)?new Date(B.user_info.created_at).toLocaleString():"Unknown"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(w.Z,{children:(null===(f=B.user_info)||void 0===f?void 0:f.updated_at)?new Date(B.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Teams"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(y=B.teams)||void 0===y?void 0:y.length)&&(null===(b=B.teams)||void 0===b?void 0:b.length)>0?null===(N=B.teams)||void 0===N?void 0:N.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e.team_alias||e.team_id},s)):(0,c.jsx)(w.Z,{children:"No teams"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(S=B.user_info)||void 0===S?void 0:null===(Z=S.models)||void 0===Z?void 0:Z.length)&&(null===(I=B.user_info)||void 0===I?void 0:null===(C=I.models)||void 0===C?void 0:C.length)>0?null===(A=B.user_info)||void 0===A?void 0:null===(E=A.models)||void 0===E?void 0:E.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,c.jsx)(w.Z,{children:"All proxy models"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"API Keys"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(L=B.keys)||void 0===L?void 0:L.length)&&(null===(O=B.keys)||void 0===O?void 0:O.length)>0?B.keys.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,c.jsx)(w.Z,{children:"No API keys"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(M=B.user_info)||void 0===M?void 0:M.metadata)||{},null,2)})]})]})]})})]})]}),(0,c.jsx)(ep,{isInvitationLinkModalVisible:et,setIsInvitationLinkModalVisible:ea,baseUrl:en||"",invitationLinkData:er,modalType:"resetPassword"})]})}function ld(e){let{data:s=[],columns:t,isLoading:l=!1,onSortChange:a,currentSort:r,accessToken:i,userRole:n,possibleUIRoles:o,handleEdit:m,handleDelete:u,handleResetPassword:x,selectedUsers:h=[],onSelectionChange:p,enableSelection:g=!1}=e,[j,f]=d.useState([{id:(null==r?void 0:r.sortBy)||"created_at",desc:(null==r?void 0:r.sortOrder)==="desc"}]),[v,_]=d.useState(null),[y,b]=d.useState(!1),N=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_(e),b(s)},Z=(e,s)=>{p&&(s?p([...h,e]):p(h.filter(s=>s.user_id!==e.user_id)))},w=e=>{p&&(e?p(s):p([]))},k=e=>h.some(s=>s.user_id===e.user_id),S=s.length>0&&h.length===s.length,C=h.length>0&&h.length<s.length,I=d.useMemo(()=>o?lo(o,m,u,x,N,g?{selectedUsers:h,onSelectUser:Z,onSelectAll:w,isUserSelected:k,isAllSelected:S,isIndeterminate:C}:void 0):t,[o,m,u,x,N,t,g,h,S,C]),P=(0,sg.b7)({data:s,columns:I,state:{sorting:j},onSortingChange:e=>{if(f(e),e.length>0){let s=e[0],t=s.id,l=s.desc?"desc":"asc";null==a||a(t,l)}},getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0});return(d.useEffect(()=>{r&&f([{id:r.sortBy,desc:"desc"===r.sortOrder}])},[r]),v)?(0,c.jsx)(lc,{userId:v,onClose:()=>{_(null),b(!1)},accessToken:i,userRole:n,possibleUIRoles:o,initialTab:y?1:0,startInEditMode:y}):(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(t3.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(t3.ss,{children:P.getHeaderGroups().map(e=>(0,c.jsx)(t3.SC,{children:e.headers.map(e=>(0,c.jsx)(t3.xs,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(t3.RM,{children:l?(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:I.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?P.getRowModel().rows.map(e=>(0,c.jsx)(t3.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(t3.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&N(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:I.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No users found"})})})})})]})})})}var lm=t(67982),lu=t(87908),lx=e=>{var s;let{accessToken:t,possibleUIRoles:l,userID:a,userRole:r}=e,[i,n]=(0,d.useState)(!0),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)({}),[j,f]=(0,d.useState)(!1),[v,b]=(0,d.useState)([]),{Paragraph:N}=eh.default,{Option:Z}=C.default;(0,d.useEffect)(()=>{(async()=>{if(!t){n(!1);return}try{let e=await (0,g.getInternalUserSettings)(t);if(m(e),p(e.values||{}),t)try{let e=await (0,g.modelAvailableCall)(t,a,r);if(e&&e.data){let s=e.data.map(e=>e.id);b(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),P.ZP.error("Failed to fetch SSO settings")}finally{n(!1)}})()},[t]);let S=async()=>{if(t){f(!0);try{let e=Object.entries(h).reduce((e,s)=>{let[t,l]=s;return e[t]=""===l?null:l,e},{}),s=await (0,g.updateInternalUserSettings)(t,e);m({...o,values:s.settings}),x(!1)}catch(e){console.error("Error updating SSO settings:",e),P.ZP.error("Failed to update settings: "+e)}finally{f(!1)}}},I=(e,s)=>{p(t=>({...t,[e]:s}))},E=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],A=e=>{let s=E(e),t=(e,t,l)=>{let a=[...s];a[e]={...a[e],[t]:l},I("teams",a)},l=e=>{I("teams",s.filter((s,t)=>t!==e))};return(0,c.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,c.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Team ",s+1]}),(0,c.jsx)(_.Z,{size:"sm",variant:"secondary",icon:ey.Z,onClick:()=>l(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,c.jsx)(y.Z,{value:e.team_id,onChange:e=>t(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,c.jsx)(q.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>t(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,c.jsxs)(C.default,{style:{width:"100%"},value:e.user_role,onChange:e=>t(s,"user_role",e),children:[(0,c.jsx)(Z,{value:"user",children:"User"}),(0,c.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,c.jsx)(_.Z,{variant:"secondary",icon:td.Z,onClick:()=>{I("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},T=(e,s,t)=>{var a;let r=s.type;if("teams"===e)return(0,c.jsx)("div",{className:"mt-2",children:A(h[e]||[])});if("user_role"===e&&l)return(0,c.jsx)(C.default,{style:{width:"100%"},value:h[e]||"",onChange:s=>I(e,s),className:"mt-2",children:Object.entries(l).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(Z,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{children:t}),(0,c.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:l})]})},s)})});if("budget_duration"===e)return(0,c.jsx)(eD,{value:h[e]||null,onChange:s=>I(e,s),className:"mt-2"});if("boolean"===r)return(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(to.Z,{checked:!!h[e],onChange:s=>I(e,s)})});if("array"===r&&(null===(a=s.items)||void 0===a?void 0:a.enum))return(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:h[e]||[],onChange:s=>I(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,c.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,c.jsxs)(C.default,{mode:"multiple",style:{width:"100%"},value:h[e]||[],onChange:s=>I(e,s),className:"mt-2",children:[(0,c.jsx)(Z,{value:"no-default-models",children:"No Default Models"}),v.map(e=>(0,c.jsx)(Z,{value:e,children:F(e)},e))]});if("string"===r&&s.enum)return(0,c.jsx)(C.default,{style:{width:"100%"},value:h[e]||"",onChange:s=>I(e,s),className:"mt-2",children:s.enum.map(e=>(0,c.jsx)(Z,{value:e,children:e},e))});else return(0,c.jsx)(y.Z,{value:void 0!==h[e]?String(h[e]):"",onChange:s=>I(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},L=(e,s)=>{if(null==s)return(0,c.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,c.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=E(s);return(0,c.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,c.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,c.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,c.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat(eR(e.max_budget_in_team,4)):"No limit"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,c.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&l&&l[s]){let{ui_label:e,description:t}=l[s];return(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium",children:e}),t&&(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:t})]})}return"budget_duration"===e?(0,c.jsx)("span",{children:eM(s)}):"boolean"==typeof s?(0,c.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:F(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,c.jsx)("span",{children:String(s)})};return i?(0,c.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,c.jsx)(lu.Z,{size:"large"})}):o?(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Default User Settings"}),!i&&o&&(u?(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{x(!1),p(o.values||{})},disabled:j,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:S,loading:j,children:"Save Changes"})]}):(0,c.jsx)(_.Z,{onClick:()=>x(!0),children:"Edit Settings"}))]}),(null==o?void 0:null===(s=o.field_schema)||void 0===s?void 0:s.description)&&(0,c.jsx)(N,{className:"mb-4",children:o.field_schema.description}),(0,c.jsx)(lm.Z,{}),(0,c.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=o;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,l]=s,a=e[t],r=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,c.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,c.jsx)(w.Z,{className:"font-medium text-lg",children:r}),(0,c.jsx)(N,{className:"text-sm text-gray-500 mt-1",children:l.description||"No description available"}),u?(0,c.jsx)("div",{className:"mt-2",children:T(t,l,a)}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:L(t,a)})]},t)}):(0,c.jsx)(w.Z,{children:"No schema information available"})})()})]}):(0,c.jsx)(X.Z,{children:(0,c.jsx)(w.Z,{children:"No settings available or you do not have permission to view them."})})},lh=t(19616);let lp={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var lg=e=>{var s;let{accessToken:t,token:l,userRole:a,userID:r,teams:i}=e,n=(0,h.NL)(),[o,m]=(0,d.useState)(1),[u,x]=(0,d.useState)(!1),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)(!1),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)("users"),[w,k]=(0,d.useState)(lp),[S,C,I]=(0,lh.G)(w,{wait:300}),[E,A]=(0,d.useState)(!1),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(null),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)([]),[U,z]=(0,d.useState)(!1),[V,K]=(0,d.useState)(!1),[B,G]=(0,d.useState)([]),H=e=>{b(e),v(!0)};(0,d.useEffect)(()=>()=>{I.cancel()},[I]),(0,d.useEffect)(()=>{F((0,g.getProxyBaseUrl)())},[]),(0,d.useEffect)(()=>{(async()=>{try{if(!r||!a||!t)return;let e=(await (0,g.modelAvailableCall)(t,r,a)).data.map(e=>e.id);console.log("available_model_names:",e),G(e)}catch(e){console.error("Error fetching user models:",e)}})()},[t,r,a]);let J=e=>{k(s=>{let t={...s,...e};return C(t),t})},Y=async e=>{if(!t){P.ZP.error("Access token not found");return}try{P.ZP.success("Generating password reset link...");let s=await (0,g.invitationCreateCall)(t,e);M(s),L(!0)}catch(e){P.ZP.error("Failed to generate password reset link")}},W=async()=>{if(y&&t)try{await (0,g.userDeleteCall)(t,[y]),n.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==y);return{...e,users:s}}),P.ZP.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),P.ZP.error("Failed to delete user")}v(!1),b(null)},$=async()=>{j(null),x(!1)},Q=async e=>{if(console.log("inside handleEditSubmit:",e),t&&l&&a&&r){try{let s=await (0,g.userUpdateUserCall)(t,e,null);n.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let t=e.users.map(e=>e.user_id===s.data.user_id?eF(e,s.data):e);return{...e,users:t}}),P.ZP.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}j(null),x(!1)}},X=async e=>{m(e)},ee=(0,sm.a)({queryKey:["userList",{debouncedFilter:S,currentPage:o}],queryFn:async()=>{if(!t)throw Error("Access token required");return await (0,g.userListCall)(t,S.user_id?[S.user_id]:null,o,25,S.email||null,S.user_role||null,S.team||null,S.sso_user_id||null,S.sort_by,S.sort_order)},enabled:!!(t&&l&&a&&r),placeholderData:e=>e}),es=ee.data,et=(0,sm.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!t)throw Error("Access token required");return await (0,g.getPossibleUserRoles)(t)},enabled:!!(t&&l&&a&&r)}).data;if(ee.isLoading||!t||!l||!a||!r)return(0,c.jsx)("div",{children:"Loading..."});let el=lo(et,e=>{j(e),x(!0)},H,Y,()=>{});return(0,c.jsxs)("div",{className:"w-full p-6",children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)(eE,{userID:r,accessToken:t,teams:i,possibleUIRoles:et}),(0,c.jsx)(_.Z,{onClick:()=>{K(!V),q([])},variant:V?"primary":"secondary",className:"flex items-center",children:V?"Cancel Selection":"Select Users"}),V&&(0,c.jsxs)(_.Z,{onClick:()=>{if(0===R.length){P.ZP.error("Please select users to edit");return}z(!0)},disabled:0===R.length,className:"flex items-center",children:["Bulk Edit (",R.length," selected)"]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:0,onIndexChange:e=>Z(0===e?"users":"settings"),children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Users"}),(0,c.jsx)(eW.Z,{children:"Default User Settings"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by email...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.email,onChange:e=>J({email:e.target.value})}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(E?"bg-gray-100":""),onClick:()=>A(!E),children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(w.user_id||w.user_role||w.team)&&(0,c.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{J(lp)},children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),E&&(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Filter by User ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.user_id,onChange:e=>J({user_id:e.target.value})}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eJ.Z,{value:w.user_role,onValueChange:e=>J({user_role:e}),placeholder:"Select Role",children:Object.entries(et).map(e=>{let[s,t]=e;return(0,c.jsx)(ex.Z,{value:s,children:t.ui_label},s)})})}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eJ.Z,{value:w.team,onValueChange:e=>J({team:e}),placeholder:"Select Team",children:null==i?void 0:i.map(e=>(0,c.jsx)(ex.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,c.jsx)("div",{className:"relative w-64",children:(0,c.jsx)("input",{type:"text",placeholder:"Filter by SSO ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.sso_user_id,onChange:e=>J({sso_user_id:e.target.value})})})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",es&&es.users&&es.users.length>0?(es.page-1)*es.page_size+1:0," ","-"," ",es&&es.users?Math.min(es.page*es.page_size,es.total):0," ","of ",es?es.total:0," results"]}),(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{onClick:()=>X(o-1),disabled:1===o,className:"px-3 py-1 text-sm border rounded-md ".concat(1===o?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,c.jsx)("button",{onClick:()=>X(o+1),disabled:!es||o>=es.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!es||o>=es.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,c.jsx)(ld,{data:(null===(s=ee.data)||void 0===s?void 0:s.users)||[],columns:el,isLoading:ee.isLoading,accessToken:t,userRole:a,onSortChange:(e,s)=>{J({sort_by:e,sort_order:s})},currentSort:{sortBy:w.sort_by,sortOrder:w.sort_order},possibleUIRoles:et,handleEdit:e=>{j(e),x(!0)},handleDelete:H,handleResetPassword:Y,enableSelection:V,selectedUsers:R,onSelectionChange:e=>{q(e)}})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lx,{accessToken:t,possibleUIRoles:et,userID:r,userRole:a})})]})]}),(0,c.jsx)(lt,{visible:u,possibleUIRoles:et,onCancel:$,user:p,onSubmit:Q}),f&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"}),(0,c.jsxs)("p",{className:"text-sm font-medium text-gray-900 mt-2",children:["User ID: ",y]})]})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:W,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{v(!1),b(null)},children:"Cancel"})]})]})]})}),(0,c.jsx)(ep,{isInvitationLinkModalVisible:T,setIsInvitationLinkModalVisible:L,baseUrl:D||"",invitationLinkData:O,modalType:"resetPassword"}),(0,c.jsx)(ln,{visible:U,onCancel:()=>z(!1),selectedUsers:R,possibleUIRoles:et,accessToken:t,onSuccess:()=>{n.invalidateQueries({queryKey:["userList"]}),q([]),K(!1)},teams:i,userRole:a,userModels:B})]})},lj=e=>{var s;let{accessToken:t,userID:l,userRole:a}=e,[r,i]=(0,d.useState)(!0),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)({}),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)([]),{Paragraph:b}=eh.default,{Option:N}=C.default;(0,d.useEffect)(()=>{(async()=>{if(!t){i(!1);return}try{let e=await (0,g.getDefaultTeamSettings)(t);if(o(e),h(e.values||{}),t)try{let e=await (0,g.modelAvailableCall)(t,l,a);if(e&&e.data){let s=e.data.map(e=>e.id);v(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),P.ZP.error("Failed to fetch team settings")}finally{i(!1)}})()},[t]);let Z=async()=>{if(t){j(!0);try{let e=await (0,g.updateDefaultTeamSettings)(t,x);o({...n,values:e.settings}),u(!1),P.ZP.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),P.ZP.error("Failed to update team settings")}finally{j(!1)}}},S=(e,s)=>{h(t=>({...t,[e]:s}))},I=(e,s,t)=>{var l;let a=s.type;return"budget_duration"===e?(0,c.jsx)(eD,{value:x[e]||null,onChange:s=>S(e,s),className:"mt-2"}):"boolean"===a?(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(to.Z,{checked:!!x[e],onChange:s=>S(e,s)})}):"array"===a&&(null===(l=s.items)||void 0===l?void 0:l.enum)?(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:x[e]||[],onChange:s=>S(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,c.jsx)(N,{value:e,children:e},e))}):"models"===e?(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:x[e]||[],onChange:s=>S(e,s),className:"mt-2",children:f.map(e=>(0,c.jsx)(N,{value:e,children:F(e)},e))}):"string"===a&&s.enum?(0,c.jsx)(C.default,{style:{width:"100%"},value:x[e]||"",onChange:s=>S(e,s),className:"mt-2",children:s.enum.map(e=>(0,c.jsx)(N,{value:e,children:e},e))}):(0,c.jsx)(y.Z,{value:void 0!==x[e]?String(x[e]):"",onChange:s=>S(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},E=(e,s)=>null==s?(0,c.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,c.jsx)("span",{children:eM(s)}):"boolean"==typeof s?(0,c.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:F(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,c.jsx)("span",{children:String(s)});return r?(0,c.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,c.jsx)(lu.Z,{size:"large"})}):n?(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{className:"text-xl",children:"Default Team Settings"}),!r&&n&&(m?(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{u(!1),h(n.values||{})},disabled:p,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:Z,loading:p,children:"Save Changes"})]}):(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Settings"}))]}),(0,c.jsx)(w.Z,{children:"These settings will be applied by default when creating new teams."}),(null==n?void 0:null===(s=n.field_schema)||void 0===s?void 0:s.description)&&(0,c.jsx)(b,{className:"mb-4 mt-2",children:n.field_schema.description}),(0,c.jsx)(lm.Z,{}),(0,c.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=n;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,l]=s,a=e[t],r=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,c.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,c.jsx)(w.Z,{className:"font-medium text-lg",children:r}),(0,c.jsx)(b,{className:"text-sm text-gray-500 mt-1",children:l.description||"No description available"}),m?(0,c.jsx)("div",{className:"mt-2",children:I(t,l,a)}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:E(t,a)})]},t)}):(0,c.jsx)(w.Z,{children:"No schema information available"})})()})]}):(0,c.jsx)(X.Z,{children:(0,c.jsx)(w.Z,{children:"No team settings available or you do not have permission to view them."})})},lf=e=>{let{accessToken:s,userID:t}=e,[l,a]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(s&&t)try{let e=await (0,g.availableTeamListCall)(s);a(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,t]);let r=async e=>{if(s&&t)try{await (0,g.teamMemberAddCall)(s,e,{user_id:t,role:"user"}),P.ZP.success("Successfully joined team"),a(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),P.ZP.error("Failed to join team")}};return(0,c.jsx)(X.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Team Name"}),(0,c.jsx)(sN.Z,{children:"Description"}),(0,c.jsx)(sN.Z,{children:"Members"}),(0,c.jsx)(sN.Z,{children:"Models"}),(0,c.jsx)(sN.Z,{children:"Actions"})]})}),(0,c.jsxs)(s_.Z,{children:[l.map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:e.team_alias})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:e.description||"No description available"})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{children:[e.members_with_roles.length," members"]})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})})})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(_.Z,{size:"xs",variant:"secondary",onClick:()=>r(e.team_id),children:"Join Team"})})]},e.team_id)),0===l.length&&(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:5,className:"text-center",children:(0,c.jsx)(w.Z,{children:"No available teams to join"})})})]})]})})};let lv=(e,s)=>{let t=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),t=e.models):t=s,R(t,s)};var l_=e=>{let{teams:s,searchParams:t,accessToken:l,setTeams:a,userID:r,userRole:i,organizations:n,premiumUser:o=!1}=e,[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)(null),[p,k]=(0,d.useState)(null),[S,A]=(0,d.useState)(!1),[O,R]=(0,d.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"});(0,d.useEffect)(()=>{console.log("inside useeffect - ".concat(m)),l&&j(l,r,i,x,a),ez()},[m]);let[q]=I.Z.useForm(),[V]=I.Z.useForm(),{Title:K,Paragraph:B}=eh.default,[G,H]=(0,d.useState)(""),[Y,$]=(0,d.useState)(!1),[Q,ee]=(0,d.useState)(null),[es,et]=(0,d.useState)(null),[ea,er]=(0,d.useState)(!1),[ei,en]=(0,d.useState)(!1),[eo,ec]=(0,d.useState)(!1),[ed,em]=(0,d.useState)(!1),[ep,eg]=(0,d.useState)([]),[ej,ef]=(0,d.useState)(!1),[ev,e_]=(0,d.useState)(null),[ey,eb]=(0,d.useState)([]),[eN,eZ]=(0,d.useState)({}),[ew,ek]=(0,d.useState)([]),[eS,eC]=(0,d.useState)({}),[eI,eP]=(0,d.useState)([]),[eE,eA]=(0,d.useState)([]),[eT,eO]=(0,d.useState)(!1);(0,d.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(p));let e=lv(p,ep);console.log("models: ".concat(e)),eb(e),q.setFieldValue("models",[])},[p,ep]),(0,d.useEffect)(()=>{(async()=>{try{if(null==l)return;let e=(await (0,g.getGuardrailsList)(l)).guardrails.map(e=>e.guardrail_name);ek(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[l]);let eM=async()=>{try{if(null==l)return;let e=await (0,g.fetchMCPAccessGroups)(l);eA(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,d.useEffect)(()=>{eM()},[l]),(0,d.useEffect)(()=>{s&&eZ(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let eD=async e=>{e_(e),ef(!0)},eq=async()=>{if(null!=ev&&null!=s&&null!=l){try{await (0,g.teamDeleteCall)(l,ev),j(l,r,i,x,a)}catch(e){console.error("Error deleting the team:",e)}ef(!1),e_(null)}};(0,d.useEffect)(()=>{(async()=>{try{if(null===r||null===i||null===l)return;let e=await D(r,i,l);e&&eg(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,r,i,s]);let eU=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=l){var t,r,i;let n=null==e?void 0:e.team_alias,o=null!==(i=null==s?void 0:s.map(e=>e.team_alias))&&void 0!==i?i:[],c=(null==e?void 0:e.organization_id)||(null==x?void 0:x.organization_id);if(""===c||"string"!=typeof c?e.organization_id=null:e.organization_id=c.trim(),o.includes(n))throw Error("Team alias ".concat(n," already exists, please pick another alias"));if(P.ZP.info("Creating Team"),eI.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:eI.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if((e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(r=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===r?void 0:r.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups)){let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups);let d=await (0,g.teamCreateCall)(l,e);null!==s?a([...s,d]):a([d]),console.log("response for team create call: ".concat(d)),P.ZP.success("Team created"),q.resetFields(),eP([]),en(!1)}}catch(e){console.error("Error creating the team:",e),P.ZP.error("Error creating the team: "+e,20)}},ez=()=>{u(new Date().toLocaleString())},eV=(e,s)=>{let t={...O,[e]:s};R(t),l&&(0,g.v2TeamListCall)(l,t.organization_id||null,null,t.team_id||null,t.team_alias||null).then(e=>{e&&e.teams&&a(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})};return(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==i||"Org Admin"==i)&&(0,c.jsx)(_.Z,{className:"w-fit",onClick:()=>en(!0),children:"+ Create New Team"}),es?(0,c.jsx)(tl,{teamId:es,onUpdate:e=>{a(s=>{if(null==s)return s;let t=s.map(s=>e.team_id===s.team_id?eF(s,e):s);return l&&j(l,r,i,x,a),t})},onClose:()=>{et(null),er(!1)},accessToken:l,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;s<e.members_with_roles.length;s++){let t=e.members_with_roles[s];if(t.user_id==r&&"admin"==t.role)return!0}return!1})(null==s?void 0:s.find(e=>e.team_id===es)),is_proxy_admin:"Admin"==i,userModels:ep,editTeam:ea}):(0,c.jsxs)(e$.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eW.Z,{children:"Your Teams"}),(0,c.jsx)(eW.Z,{children:"Available Teams"}),(0,eL.tY)(i||"")&&(0,c.jsx)(eW.Z,{children:"Default Team Settings"})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",m]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center",onClick:ez})]})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(w.Z,{children:["Click on “Team ID” to view team details"," ",(0,c.jsx)("b",{children:"and"})," manage team members."]}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:O.team_alias,onChange:e=>eV("team_alias",e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(S?"bg-gray-100":""),onClick:()=>A(!S),children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(O.team_id||O.team_alias||O.organization_id)&&(0,c.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{R({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),l&&(0,g.v2TeamListCall)(l,null,r||null,null,null).then(e=>{e&&e.teams&&a(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),S&&(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:O.team_id,onChange:e=>eV("team_id",e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eJ.Z,{value:O.organization_id||"",onValueChange:e=>eV("organization_id",e),placeholder:"Select Organization",children:null==n?void 0:n.map(e=>(0,c.jsx)(ex.Z,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})}),(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Team Name"}),(0,c.jsx)(sN.Z,{children:"Team ID"}),(0,c.jsx)(sN.Z,{children:"Created"}),(0,c.jsx)(sN.Z,{children:"Spend (USD)"}),(0,c.jsx)(sN.Z,{children:"Budget (USD)"}),(0,c.jsx)(sN.Z,{children:"Models"}),(0,c.jsx)(sN.Z,{children:"Organization"}),(0,c.jsx)(sN.Z,{children:"Info"})]})}),(0,c.jsx)(s_.Z,{children:s&&s.length>0?s.filter(e=>!x||e.organization_id===x.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.team_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{et(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,c.jsx)(sy.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,c.jsx)(sy.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:eR(e.spend,4)}),(0,c.jsx)(sy.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,c.jsx)(sy.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,c.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,c.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sf.Z,{icon:eS[e.team_id]?sw.Z:sk.Z,className:"cursor-pointer",size:"xs",onClick:()=>{eC(s=>({...s,[e.team_id]:!s[e.team_id]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),e.models.length>3&&!eS[e.team_id]&&(0,c.jsx)(eY.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),eS[e.team_id]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}),(0,c.jsx)(sy.Z,{children:e.organization_id}),(0,c.jsxs)(sy.Z,{children:[(0,c.jsxs)(w.Z,{children:[eN&&e.team_id&&eN[e.team_id]&&eN[e.team_id].keys&&eN[e.team_id].keys.length," ","Keys"]}),(0,c.jsxs)(w.Z,{children:[eN&&e.team_id&&eN[e.team_id]&&eN[e.team_id].team_info&&eN[e.team_id].team_info.members_with_roles&&eN[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,c.jsx)(sy.Z,{children:"Admin"==i?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{et(e.team_id),er(!0)}}),(0,c.jsx)(sf.Z,{onClick:()=>eD(e.team_id),icon:el.Z,size:"sm"})]}):null})]},e.team_id)):null})]}),ej&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Team"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this team ?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:eq,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{ef(!1),e_(null)},children:"Cancel"})]})]})]})})]})})})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lf,{accessToken:l,userID:r})}),(0,eL.tY)(i||"")&&(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lj,{accessToken:l,userID:r||"",userRole:i||""})})]})]}),("Admin"==i||"Org Admin"==i)&&(0,c.jsx)(E.Z,{title:"Create Team",visible:ei,width:1e3,footer:null,onOk:()=>{en(!1),q.resetFields(),eP([])},onCancel:()=>{en(!1),q.resetFields(),eP([])},children:(0,c.jsxs)(I.Z,{form:q,onFinish:eU,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Organization"," ",(0,c.jsx)(z.Z,{title:(0,c.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:x?x.organization_id:null,className:"mt-8",children:(0,c.jsx)(C.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{q.setFieldValue("organization_id",e),k((null==n?void 0:n.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var t;return!!s&&((null===(t=s.children)||void 0===t?void 0:t.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==n?void 0:n.map(e=>(0,c.jsxs)(C.default.Option,{value:e.organization_id,children:[(0,c.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,c.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"These are the models that your selected team has access to",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),ey.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",onClick:()=>{eT||(eM(),eO(!0))},children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Additional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,c.jsx)(y.Z,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Setup your first guardrail",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:ew.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,c.jsx)(J,{onChange:e=>q.setFieldValue("allowed_vector_store_ids",e),value:q.getFieldValue("allowed_vector_store_ids"),accessToken:l||"",placeholder:"Select vector stores (optional)",premiumUser:o})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers or access groups this team can access by default. ",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-8",help:"Select MCP servers or access groups this team can access. ",children:(0,c.jsx)(W,{onChange:e=>q.setFieldValue("allowed_mcp_servers_and_groups",e),value:q.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:l||"",placeholder:"Select MCP servers or access groups (optional)",premiumUser:o})})]})]}),(0,c.jsxs)(b.Z,{className:"mt-8 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Logging Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(eu,{value:eI,onChange:eP,premiumUser:o})})})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create Team"})})]})})]})})})},ly=e=>{var s,t,l,a,r;let{organizationId:i,onClose:n,accessToken:o,is_org_admin:m,is_proxy_admin:u,userModels:x,editOrg:h}=e,[p,j]=(0,d.useState)(null),[f,b]=(0,d.useState)(!0),[N]=I.Z.useForm(),[Z,S]=(0,d.useState)(!1),[E,A]=(0,d.useState)(!1),[O,D]=(0,d.useState)(!1),[R,q]=(0,d.useState)(null),[U,z]=(0,d.useState)({}),V=m||u,K=async()=>{try{if(b(!0),!o)return;let e=await (0,g.organizationInfoCall)(o,i);j(e)}catch(e){P.ZP.error("Failed to load organization information"),console.error("Error fetching organization info:",e)}finally{b(!1)}};(0,d.useEffect)(()=>{K()},[i,o]);let B=async e=>{try{if(null==o)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.organizationMemberAddCall)(o,i,s),P.ZP.success("Organization member added successfully"),A(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to add organization member"),console.error("Error adding organization member:",e)}},G=async e=>{try{if(!o)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.organizationMemberUpdateCall)(o,i,s),P.ZP.success("Organization member updated successfully"),D(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to update organization member"),console.error("Error updating organization member:",e)}},J=async e=>{try{if(!o)return;await (0,g.organizationMemberDeleteCall)(o,i,e.user_id),P.ZP.success("Organization member deleted successfully"),D(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to delete organization member"),console.error("Error deleting organization member:",e)}},W=async e=>{try{if(!o)return;let s={organization_id:i,organization_alias:e.organization_alias,models:e.models,litellm_budget_table:{tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration},metadata:e.metadata?JSON.parse(e.metadata):null};if((void 0!==e.vector_stores||void 0!==e.mcp_servers_and_groups)&&(s.object_permission={...null==p?void 0:p.object_permission,vector_stores:e.vector_stores||[]},void 0!==e.mcp_servers_and_groups)){let{servers:t,accessGroups:l}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};t&&t.length>0&&(s.object_permission.mcp_servers=t),l&&l.length>0&&(s.object_permission.mcp_access_groups=l)}await (0,g.organizationUpdateCall)(o,s),P.ZP.success("Organization settings updated successfully"),S(!1),K()}catch(e){P.ZP.error("Failed to update organization settings"),console.error("Error updating organization:",e)}};if(f)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!p)return(0,c.jsx)("div",{className:"p-4",children:"Organization not found"});let $=async(e,s)=>{await eq(e)&&(z(e=>({...e,[s]:!0})),setTimeout(()=>{z(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,onClick:n,variant:"light",className:"mb-4",children:"Back to Organizations"}),(0,c.jsx)(k.Z,{children:p.organization_alias}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:p.organization_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:U["org-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>$(p.organization_id,"org-id"),className:"left-2 z-10 transition-all duration-200 ".concat(U["org-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:h?2:0,children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"}),(0,c.jsx)(eW.Z,{children:"Members"}),(0,c.jsx)(eW.Z,{children:"Settings"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Organization Details"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["Created: ",new Date(p.created_at).toLocaleDateString()]}),(0,c.jsxs)(w.Z,{children:["Updated: ",new Date(p.updated_at).toLocaleDateString()]}),(0,c.jsxs)(w.Z,{children:["Created By: ",p.created_by]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Budget Status"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eR(p.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null===p.litellm_budget_table.max_budget?"Unlimited":"$".concat(eR(p.litellm_budget_table.max_budget,4))]}),p.litellm_budget_table.budget_duration&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Reset: ",p.litellm_budget_table.budget_duration]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",p.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",p.litellm_budget_table.rpm_limit||"Unlimited"]}),p.litellm_budget_table.max_parallel_requests&&(0,c.jsxs)(w.Z,{children:["Max Parallel Requests: ",p.litellm_budget_table.max_parallel_requests]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===p.models.length?(0,c.jsx)(eY.Z,{color:"red",children:"All proxy models"}):p.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Teams"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:null===(s=p.teams)||void 0===s?void 0:s.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e.team_id},s))})]}),(0,c.jsx)(sa,{objectPermission:p.object_permission,variant:"card",accessToken:o})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(X.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[75vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"User ID"}),(0,c.jsx)(sN.Z,{children:"Role"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{children:"Created At"}),(0,c.jsx)(sN.Z,{})]})}),(0,c.jsx)(s_.Z,{children:null===(t=p.members)||void 0===t?void 0:t.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_id})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_role})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{children:["$",eR(e.spend,4)]})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:new Date(e.created_at).toLocaleString()})}),(0,c.jsx)(sy.Z,{children:V&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{q({role:e.user_role,user_email:e.user_email,user_id:e.user_id}),D(!0)}}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>{J(e)}})]})})]},s))})]})}),V&&(0,c.jsx)(_.Z,{onClick:()=>{A(!0)},children:"Add Member"})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Organization Settings"}),V&&!Z&&(0,c.jsx)(_.Z,{onClick:()=>S(!0),children:"Edit Settings"})]}),Z?(0,c.jsxs)(I.Z,{form:N,onFinish:W,initialValues:{organization_alias:p.organization_alias,models:p.models,tpm_limit:p.litellm_budget_table.tpm_limit,rpm_limit:p.litellm_budget_table.rpm_limit,max_budget:p.litellm_budget_table.max_budget,budget_duration:p.litellm_budget_table.budget_duration,metadata:p.metadata?JSON.stringify(p.metadata,null,2):"",vector_stores:(null===(l=p.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=p.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(r=p.object_permission)||void 0===r?void 0:r.mcp_access_groups)||[]}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),x.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>N.setFieldValue("vector_stores",e),value:N.getFieldValue("vector_stores"),accessToken:o||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers & Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(Y,{onChange:e=>N.setFieldValue("mcp_servers_and_groups",e),value:N.getFieldValue("mcp_servers_and_groups"),accessToken:o||"",placeholder:"Select MCP servers and access groups"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{onClick:()=>S(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization Name"}),(0,c.jsx)("div",{children:p.organization_alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization ID"}),(0,c.jsx)("div",{className:"font-mono",children:p.organization_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:new Date(p.created_at).toLocaleString()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:p.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)("div",{children:["TPM: ",p.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",p.litellm_budget_table.rpm_limit||"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Budget"}),(0,c.jsxs)("div",{children:["Max:"," ",null!==p.litellm_budget_table.max_budget?"$".concat(eR(p.litellm_budget_table.max_budget,4)):"No Limit"]}),(0,c.jsxs)("div",{children:["Reset: ",p.litellm_budget_table.budget_duration||"Never"]})]}),(0,c.jsx)(sa,{objectPermission:p.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o})]})]})})]})]}),(0,c.jsx)(tt,{isVisible:E,onCancel:()=>A(!1),onSubmit:B,accessToken:o,title:"Add Organization Member",roles:[{label:"org_admin",value:"org_admin",description:"Can add and remove members, and change their roles."},{label:"internal_user",value:"internal_user",description:"Can view/create keys for themselves within organization."},{label:"internal_user_viewer",value:"internal_user_viewer",description:"Can only view their keys within organization."}],defaultRole:"internal_user"}),(0,c.jsx)(ts,{visible:O,onCancel:()=>D(!1),onSubmit:G,initialData:R,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Org Admin",value:"org_admin"},{label:"Internal User",value:"internal_user"},{label:"Internal User Viewer",value:"internal_user_viewer"}]}})]})};let lb=async(e,s)=>{s(await (0,g.organizationListCall)(e))};var lN=e=>{let{organizations:s,userRole:t,userModels:l,accessToken:a,lastRefreshed:r,handleRefreshClick:i,currentOrg:n,guardrailsList:o=[],setOrganizations:m,premiumUser:u}=e,[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(!1),[b,N]=(0,d.useState)(!1),[Z,k]=(0,d.useState)(null),[S,A]=(0,d.useState)(!1),[T]=I.Z.useForm(),[O,D]=(0,d.useState)({});(0,d.useEffect)(()=>{a&&lb(a,m)},[a]);let R=e=>{e&&(k(e),N(!0))},q=async()=>{if(Z&&a)try{await (0,g.organizationDeleteCall)(a,Z),P.ZP.success("Organization deleted successfully"),N(!1),k(null),lb(a,m)}catch(e){console.error("Error deleting organization:",e)}},V=async e=>{try{var s,t,l,r;if(!a)return;console.log("values in organizations new create call: ".concat(JSON.stringify(e))),(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(s=e.allowed_mcp_servers_and_groups.servers)||void 0===s?void 0:s.length)>0||(null===(t=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===t?void 0:t.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(l=e.allowed_mcp_servers_and_groups.servers)||void 0===l?void 0:l.length)>0&&(e.object_permission.mcp_servers=e.allowed_mcp_servers_and_groups.servers),(null===(r=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===r?void 0:r.length)>0&&(e.object_permission.mcp_access_groups=e.allowed_mcp_servers_and_groups.accessGroups),delete e.allowed_mcp_servers_and_groups)),await (0,g.organizationCreateCall)(a,e),A(!1),T.resetFields(),lb(a,m)}catch(e){console.error("Error creating organization:",e)}};return u?(0,c.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"===t||"Org Admin"===t)&&(0,c.jsx)(_.Z,{className:"w-fit",onClick:()=>A(!0),children:"+ Create New Organization"}),x?(0,c.jsx)(ly,{organizationId:x,onClose:()=>{h(null),j(!1)},accessToken:a,is_org_admin:!0,is_proxy_admin:"Admin"===t,userModels:l,editOrg:p}):(0,c.jsxs)(e$.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsx)("div",{className:"flex",children:(0,c.jsx)(eW.Z,{children:"Your Organizations"})}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",r]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center",onClick:i})]})]}),(0,c.jsx)(e0.Z,{children:(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(w.Z,{children:"Click on “Organization ID” to view organization details."}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(X.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Organization ID"}),(0,c.jsx)(sN.Z,{children:"Organization Name"}),(0,c.jsx)(sN.Z,{children:"Created"}),(0,c.jsx)(sN.Z,{children:"Spend (USD)"}),(0,c.jsx)(sN.Z,{children:"Budget (USD)"}),(0,c.jsx)(sN.Z,{children:"Models"}),(0,c.jsx)(sN.Z,{children:"TPM / RPM Limits"}),(0,c.jsx)(sN.Z,{children:"Info"}),(0,c.jsx)(sN.Z,{children:"Actions"})]})}),(0,c.jsx)(s_.Z,{children:s&&s.length>0?s.sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>{var s,l,a,r,i,n,o,d,m;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.organization_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>h(e.organization_id),children:[null===(s=e.organization_id)||void 0===s?void 0:s.slice(0,7),"..."]})})})}),(0,c.jsx)(sy.Z,{children:e.organization_alias}),(0,c.jsx)(sy.Z,{children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,c.jsx)(sy.Z,{children:eR(e.spend,4)}),(0,c.jsx)(sy.Z,{children:(null===(l=e.litellm_budget_table)||void 0===l?void 0:l.max_budget)!==null&&(null===(a=e.litellm_budget_table)||void 0===a?void 0:a.max_budget)!==void 0?null===(r=e.litellm_budget_table)||void 0===r?void 0:r.max_budget:"No limit"}),(0,c.jsx)(sy.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,c.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,c.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sf.Z,{icon:O[e.organization_id||""]?sw.Z:sk.Z,className:"cursor-pointer",size:"xs",onClick:()=>{D(s=>({...s,[e.organization_id||""]:!s[e.organization_id||""]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),e.models.length>3&&!O[e.organization_id||""]&&(0,c.jsx)(eY.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),O[e.organization_id||""]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{children:["TPM:"," ",(null===(i=e.litellm_budget_table)||void 0===i?void 0:i.tpm_limit)?null===(n=e.litellm_budget_table)||void 0===n?void 0:n.tpm_limit:"Unlimited",(0,c.jsx)("br",{}),"RPM:"," ",(null===(o=e.litellm_budget_table)||void 0===o?void 0:o.rpm_limit)?null===(d=e.litellm_budget_table)||void 0===d?void 0:d.rpm_limit:"Unlimited"]})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{children:[(null===(m=e.members)||void 0===m?void 0:m.length)||0," Members"]})}),(0,c.jsx)(sy.Z,{children:"Admin"===t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{h(e.organization_id),j(!0)}}),(0,c.jsx)(sf.Z,{onClick:()=>R(e.organization_id),icon:el.Z,size:"sm"})]})})]},e.organization_id)}):null})]})})})})]})})]})]})}),(0,c.jsx)(E.Z,{title:"Create Organization",visible:S,width:800,footer:null,onCancel:()=>{A(!1),T.resetFields()},children:(0,c.jsxs)(I.Z,{form:T,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),l&&l.length>0&&l.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this organization can access by default. Leave empty for access to all vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this organization can access. Leave empty for access to all vector stores",children:(0,c.jsx)(H,{onChange:e=>T.setFieldValue("allowed_vector_store_ids",e),value:T.getFieldValue("allowed_vector_store_ids"),accessToken:a||"",placeholder:"Select vector stores (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers and access groups this organization can access by default.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers and access groups this organization can access.",children:(0,c.jsx)(Y,{onChange:e=>T.setFieldValue("allowed_mcp_servers_and_groups",e),value:T.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:a||"",placeholder:"Select MCP servers and access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(_.Z,{type:"submit",children:"Create Organization"})})]})}),b?(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Organization"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this organization?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:q,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{N(!1),k(null)},children:"Cancel"})]})]})]})}):(0,c.jsx)(c.Fragment,{})]}):(0,c.jsx)("div",{children:(0,c.jsxs)(w.Z,{children:["This is a LiteLLM Enterprise feature, and requires a valid key to use. Get a trial key"," ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})},lZ=t(94789);let lw={google:"https://artificialanalysis.ai/img/logos/google_small.svg",microsoft:"https://upload.wikimedia.org/wikipedia/commons/a/a8/Microsoft_Azure_Logo.svg",okta:"https://www.okta.com/sites/default/files/Okta_Logo_BrightBlue_Medium.png",generic:""},lk={google:{envVarMap:{google_client_id:"GOOGLE_CLIENT_ID",google_client_secret:"GOOGLE_CLIENT_SECRET"},fields:[{label:"GOOGLE CLIENT ID",name:"google_client_id"},{label:"GOOGLE CLIENT SECRET",name:"google_client_secret"}]},microsoft:{envVarMap:{microsoft_client_id:"MICROSOFT_CLIENT_ID",microsoft_client_secret:"MICROSOFT_CLIENT_SECRET",microsoft_tenant:"MICROSOFT_TENANT"},fields:[{label:"MICROSOFT CLIENT ID",name:"microsoft_client_id"},{label:"MICROSOFT CLIENT SECRET",name:"microsoft_client_secret"},{label:"MICROSOFT TENANT",name:"microsoft_tenant"}]},okta:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"GENERIC CLIENT ID",name:"generic_client_id"},{label:"GENERIC CLIENT SECRET",name:"generic_client_secret"},{label:"AUTHORIZATION ENDPOINT",name:"generic_authorization_endpoint",placeholder:"https://your-okta-domain/authorize"},{label:"TOKEN ENDPOINT",name:"generic_token_endpoint",placeholder:"https://your-okta-domain/token"},{label:"USERINFO ENDPOINT",name:"generic_userinfo_endpoint",placeholder:"https://your-okta-domain/userinfo"}]},generic:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"GENERIC CLIENT ID",name:"generic_client_id"},{label:"GENERIC CLIENT SECRET",name:"generic_client_secret"},{label:"AUTHORIZATION ENDPOINT",name:"generic_authorization_endpoint"},{label:"TOKEN ENDPOINT",name:"generic_token_endpoint"},{label:"USERINFO ENDPOINT",name:"generic_userinfo_endpoint"}]}};var lS=e=>{let{isAddSSOModalVisible:s,isInstructionsModalVisible:t,handleAddSSOOk:l,handleAddSSOCancel:a,handleShowInstructions:r,handleInstructionsOk:i,handleInstructionsCancel:n,form:o,accessToken:m,ssoConfigured:u=!1}=e,[x,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(s&&m)try{let s=await (0,g.getSSOSettings)(m);if(console.log("Raw SSO data received:",s),s&&s.values){console.log("SSO values:",s.values),console.log("user_email from API:",s.values.user_email);let l=null;if(s.values.google_client_id)l="google";else if(s.values.microsoft_client_id)l="microsoft";else if(s.values.generic_client_id){var e,t;l=(null===(e=s.values.generic_authorization_endpoint)||void 0===e?void 0:e.includes("okta"))||(null===(t=s.values.generic_authorization_endpoint)||void 0===t?void 0:t.includes("auth0"))?"okta":"generic"}let a={sso_provider:l,proxy_base_url:s.values.proxy_base_url,user_email:s.values.user_email,...s.values};console.log("Setting form values:",a),o.resetFields(),setTimeout(()=>{o.setFieldsValue(a),console.log("Form values set, current form values:",o.getFieldsValue())},100)}}catch(e){console.error("Failed to load SSO settings:",e)}})()},[s,m,o]);let p=async e=>{if(!m){P.ZP.error("No access token available");return}try{await (0,g.updateSSOSettings)(m,e),r(e)}catch(e){console.error("Failed to save SSO settings:",e),P.ZP.error("Failed to save SSO settings")}},j=async()=>{if(!m){P.ZP.error("No access token available");return}try{await (0,g.updateSSOSettings)(m,{google_client_id:"",google_client_secret:"",microsoft_client_id:"",microsoft_client_secret:"",microsoft_tenant:"",generic_client_id:"",generic_client_secret:"",generic_authorization_endpoint:"",generic_token_endpoint:"",generic_userinfo_endpoint:"",proxy_base_url:"",user_email:"",sso_provider:""}),o.resetFields(),h(!1),l(),P.ZP.success("SSO settings cleared successfully")}catch(e){console.error("Failed to clear SSO settings:",e),P.ZP.error("Failed to clear SSO settings")}},f=e=>{let s=lk[e];return s?s.fields.map(e=>(0,c.jsx)(I.Z.Item,{label:e.label,name:e.name,rules:[{required:!0,message:"Please enter the ".concat(e.label.toLowerCase())}],children:e.name.includes("client")?(0,c.jsx)(L.default.Password,{}):(0,c.jsx)(y.Z,{placeholder:e.placeholder})},e.name)):null};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(E.Z,{title:u?"Edit SSO Settings":"Add SSO",visible:s,width:800,footer:null,onOk:l,onCancel:a,children:(0,c.jsxs)(I.Z,{form:o,onFinish:p,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"SSO Provider",name:"sso_provider",rules:[{required:!0,message:"Please select an SSO provider"}],children:(0,c.jsx)(C.default,{children:Object.entries(lw).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0"},children:[t&&(0,c.jsx)("img",{src:t,alt:s,style:{height:24,width:24,marginRight:12,objectFit:"contain"}}),(0,c.jsxs)("span",{children:[s.charAt(0).toUpperCase()+s.slice(1)," SSO"]})]})},s)})})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.sso_provider!==s.sso_provider,children:e=>{let{getFieldValue:s}=e,t=s("sso_provider");return t?f(t):null}}),(0,c.jsx)(I.Z.Item,{label:"Proxy Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"PROXY BASE URL",name:"proxy_base_url",rules:[{required:!0,message:"Please enter the proxy base url"}],children:(0,c.jsx)(y.Z,{})})]}),(0,c.jsxs)("div",{style:{textAlign:"right",marginTop:"10px",display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px"},children:[u&&(0,c.jsx)(T.ZP,{onClick:()=>h(!0),style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#5558eb",e.currentTarget.style.borderColor="#5558eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1",e.currentTarget.style.borderColor="#6366f1"},children:"Clear"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})]})]})}),(0,c.jsxs)(E.Z,{title:"Confirm Clear SSO Settings",visible:x,onOk:j,onCancel:()=>h(!1),okText:"Yes, Clear",cancelText:"Cancel",okButtonProps:{danger:!0,style:{backgroundColor:"#dc2626",borderColor:"#dc2626"}},children:[(0,c.jsx)("p",{children:"Are you sure you want to clear all SSO settings? This action cannot be undone."}),(0,c.jsx)("p",{children:"Users will no longer be able to login using SSO after this change."})]}),(0,c.jsxs)(E.Z,{title:"SSO Setup Instructions",visible:t,width:800,footer:null,onOk:i,onCancel:n,children:[(0,c.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{onClick:i,children:"Done"})})]})]})},lC=t(62272),lI=t(92403),lP=t(29271),lE=t(34419);let lA=e=>{if(!e)return"An unknown error occurred";if("string"==typeof e)return e;if(e.message)try{let s=JSON.parse(e.message);if(s.error&&s.error.message)return s.error.message;return"string"==typeof s?s:JSON.stringify(s,null,2)}catch(s){return e.message}if(e.response&&e.response.data){if("string"==typeof e.response.data)return e.response.data;if(e.response.data.message)return e.response.data.message;if(e.response.data.error)return"string"==typeof e.response.data.error?e.response.data.error:e.response.data.error.message||JSON.stringify(e.response.data.error)}return String(e)};var lT=e=>{let{accessToken:s,userID:t,proxySettings:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)("<your_proxy_base_url>");(0,d.useEffect)(()=>{let e="<your_proxy_base_url>";u(l&&l.PROXY_BASE_URL&&void 0!==l.PROXY_BASE_URL?l.PROXY_BASE_URL:window.location.origin)},[l]);let x="".concat(m,"/scim/v2"),h=async e=>{if(!s||!t){P.ZP.error("You need to be logged in to create a SCIM token");return}try{i(!0);let l={key_alias:e.key_alias||"SCIM Access Token",team_id:null,models:[],allowed_routes:["/scim/*"]},a=await (0,g.keyCreateCall)(s,t,l);o(a),P.ZP.success("SCIM token created successfully")}catch(e){console.error("Error creating SCIM token:",e),P.ZP.error("Failed to create SCIM token: "+lA(e))}finally{i(!1)}};return(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)("div",{className:"flex items-center mb-4",children:(0,c.jsx)(k.Z,{children:"SCIM Configuration"})}),(0,c.jsx)(w.Z,{className:"text-gray-600",children:"System for Cross-domain Identity Management (SCIM) allows you to automatically provision and manage users and groups in LiteLLM."}),(0,c.jsx)(lm.Z,{}),(0,c.jsxs)("div",{className:"space-y-8",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"1"}),(0,c.jsxs)(k.Z,{className:"text-lg flex items-center",children:[(0,c.jsx)(lC.Z,{className:"h-5 w-5 mr-2"}),"SCIM Tenant URL"]})]}),(0,c.jsx)(w.Z,{className:"text-gray-600 mb-3",children:"Use this URL in your identity provider SCIM integration settings."}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(y.Z,{value:x,disabled:!0,className:"flex-grow"}),(0,c.jsx)(S.CopyToClipboard,{text:x,onCopy:()=>P.ZP.success("URL copied to clipboard"),children:(0,c.jsxs)(_.Z,{variant:"primary",className:"ml-2 flex items-center",children:[(0,c.jsx)(tI.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"2"}),(0,c.jsxs)(k.Z,{className:"text-lg flex items-center",children:[(0,c.jsx)(lI.Z,{className:"h-5 w-5 mr-2"}),"Authentication Token"]})]}),(0,c.jsx)(lZ.Z,{title:"Using SCIM",color:"blue",className:"mb-4",children:"You need a SCIM token to authenticate with the SCIM API. Create one below and use it in your SCIM provider configuration."}),n?(0,c.jsxs)(X.Z,{className:"border border-yellow-300 bg-yellow-50",children:[(0,c.jsxs)("div",{className:"flex items-center mb-2 text-yellow-800",children:[(0,c.jsx)(lP.Z,{className:"h-5 w-5 mr-2"}),(0,c.jsx)(k.Z,{className:"text-lg text-yellow-800",children:"Your SCIM Token"})]}),(0,c.jsx)(w.Z,{className:"text-yellow-800 mb-4 font-medium",children:"Make sure to copy this token now. You will not be able to see it again."}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(y.Z,{value:n.key,className:"flex-grow mr-2 bg-white",type:"password",disabled:!0}),(0,c.jsx)(S.CopyToClipboard,{text:n.key,onCopy:()=>P.ZP.success("Token copied to clipboard"),children:(0,c.jsxs)(_.Z,{variant:"primary",className:"flex items-center",children:[(0,c.jsx)(tI.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,c.jsxs)(_.Z,{className:"mt-4 flex items-center",variant:"secondary",onClick:()=>o(null),children:[(0,c.jsx)(lE.Z,{className:"h-4 w-4 mr-1"}),"Create Another Token"]})]}):(0,c.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,c.jsxs)(I.Z,{form:a,onFinish:h,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Token Name",rules:[{required:!0,message:"Please enter a name for your token"}],children:(0,c.jsx)(y.Z,{placeholder:"SCIM Access Token"})}),(0,c.jsx)(I.Z.Item,{children:(0,c.jsxs)(_.Z,{variant:"primary",type:"submit",loading:r,className:"flex items-center",children:[(0,c.jsx)(lI.Z,{className:"h-4 w-4 mr-1"}),"Create SCIM Token"]})})]})})]})]})]})})},lL=e=>{let{accessToken:s,onSuccess:t}=e,[l]=I.Z.useForm(),[a,r]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(s)try{let e=await (0,g.getSSOSettings)(s);if(e&&e.values){let s=e.values.ui_access_mode,t={};s&&"object"==typeof s?t={ui_access_mode_type:s.type,restricted_sso_group:s.restricted_sso_group,sso_group_jwt_field:s.sso_group_jwt_field}:"string"==typeof s&&(t={ui_access_mode_type:s,restricted_sso_group:e.values.restricted_sso_group,sso_group_jwt_field:e.values.team_ids_jwt_field||e.values.sso_group_jwt_field}),l.setFieldsValue(t)}}catch(e){console.error("Failed to load UI access settings:",e)}})()},[s,l]);let i=async e=>{if(!s){P.ZP.error("No access token available");return}r(!0);try{let l={ui_access_mode:{type:e.ui_access_mode_type,restricted_sso_group:e.restricted_sso_group,sso_group_jwt_field:e.sso_group_jwt_field}};await (0,g.updateSSOSettings)(s,l),t()}catch(e){console.error("Failed to save UI access settings:",e),P.ZP.error("Failed to save UI access settings")}finally{r(!1)}};return(0,c.jsxs)("div",{style:{padding:"16px"},children:[(0,c.jsx)("div",{style:{marginBottom:"16px"},children:(0,c.jsx)(w.Z,{style:{fontSize:"14px",color:"#6b7280"},children:"Configure who can access the UI interface and how group information is extracted from JWT tokens."})}),(0,c.jsxs)(I.Z,{form:l,onFinish:i,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"UI Access Mode",name:"ui_access_mode_type",tooltip:"Controls who can access the UI interface",children:(0,c.jsxs)(C.default,{placeholder:"Select access mode",children:[(0,c.jsx)(C.default.Option,{value:"all_authenticated_users",children:"All Authenticated Users"}),(0,c.jsx)(C.default.Option,{value:"restricted_sso_group",children:"Restricted SSO Group"})]})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.ui_access_mode_type!==s.ui_access_mode_type,children:e=>{let{getFieldValue:s}=e;return"restricted_sso_group"===s("ui_access_mode_type")?(0,c.jsx)(I.Z.Item,{label:"Restricted SSO Group",name:"restricted_sso_group",rules:[{required:!0,message:"Please enter the restricted SSO group"}],children:(0,c.jsx)(y.Z,{placeholder:"ui-access-group"})}):null}}),(0,c.jsx)(I.Z.Item,{label:"SSO Group JWT Field",name:"sso_group_jwt_field",tooltip:"JWT field name that contains team/group information. Use dot notation to access nested fields.",children:(0,c.jsx)(y.Z,{placeholder:"groups"})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"16px"},children:(0,c.jsx)(T.ZP,{type:"primary",htmlType:"submit",loading:a,style:{backgroundColor:"#6366f1",borderColor:"#6366f1"},children:"Update UI Access Control"})})]})]})},lO=t(382),lM=e=>{let{searchParams:s,accessToken:t,userID:l,showSSOBanner:a,premiumUser:r,proxySettings:i,userRole:n}=e,[o]=I.Z.useForm(),[u]=I.Z.useForm(),{Title:x,Paragraph:h}=eh.default,[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(!1),[w,k]=(0,d.useState)(!1),[S,C]=(0,d.useState)(!1),[A,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(!1),[F,R]=(0,d.useState)(!1),[q,U]=(0,d.useState)(!1),[z,V]=(0,d.useState)(!1),[K,B]=(0,d.useState)(!1),[G,H]=(0,d.useState)(!1),[J,Y]=(0,d.useState)([]),[W,$]=(0,d.useState)(null),[Q,ee]=(0,d.useState)(!1);(0,m.useRouter)();let[es,et]=(0,d.useState)(null);console.log=function(){};let el=sp(),ea="All IP Addresses Allowed",er=el;er+="/fallback/login";let ei=async()=>{if(t&&r)try{let e=await (0,g.getSSOSettings)(t);if(console.log("SSO data:",e),e&&e.values){let s=e.values.google_client_id&&e.values.google_client_secret,t=e.values.microsoft_client_id&&e.values.microsoft_client_secret,l=e.values.generic_client_id&&e.values.generic_client_secret;ee(s||t||l)}else ee(!1)}catch(e){console.error("Error checking SSO configuration:",e),ee(!1)}},en=async()=>{try{if(!0!==r){P.ZP.error("This feature is only available for premium users. Please upgrade your account.");return}if(t){let e=await (0,g.getAllowedIPs)(t);Y(e&&e.length>0?e:[ea])}else Y([ea])}catch(e){console.error("Error fetching allowed IPs:",e),P.ZP.error("Failed to fetch allowed IPs ".concat(e)),Y([ea])}finally{!0===r&&U(!0)}},eo=async e=>{try{if(t){await (0,g.addAllowedIP)(t,e.ip);let s=await (0,g.getAllowedIPs)(t);Y(s),P.ZP.success("IP address added successfully")}}catch(e){console.error("Error adding IP:",e),P.ZP.error("Failed to add IP address ".concat(e))}finally{V(!1)}},ec=async e=>{$(e),B(!0)},ed=async()=>{if(W&&t)try{await (0,g.deleteAllowedIP)(t,W);let e=await (0,g.getAllowedIPs)(t);Y(e.length>0?e:[ea]),P.ZP.success("IP address deleted successfully")}catch(e){console.error("Error deleting IP:",e),P.ZP.error("Failed to delete IP address ".concat(e))}finally{B(!1),$(null)}};(0,d.useEffect)(()=>{(async()=>{if(null!=t){let e=[],s=await (0,g.userGetAllUsersCall)(t,"proxy_admin_viewer");console.log("proxy admin viewer response: ",s);let l=s.users;console.log("proxy viewers response: ".concat(l)),l.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy viewers: ".concat(l));let a=(await (0,g.userGetAllUsersCall)(t,"proxy_admin")).users;a.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy admins: ".concat(a)),console.log("combinedList: ".concat(e)),v(e),et(await (0,g.getPossibleUserRoles)(t))}})()},[t]),(0,d.useEffect)(()=>{ei()},[t,r]);let em=()=>{H(!1)};return console.log("admins: ".concat(null==f?void 0:f.length)),(0,c.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,c.jsx)(x,{level:4,children:"Admin Access "}),(0,c.jsx)(h,{children:"Go to 'Internal Users' page to add other admins."}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(eW.Z,{children:"Security Settings"}),(0,c.jsx)(eW.Z,{children:"SCIM"}),(0,c.jsx)(eW.Z,{children:"Useful Links"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(x,{level:4,children:" ✨ Security Settings"}),(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",marginTop:"1rem",marginLeft:"0.5rem"},children:[(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:()=>!0===r?D(!0):P.ZP.error("Only premium users can add SSO"),children:Q?"Edit SSO Settings":"Add SSO"})}),(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:en,children:"Allowed IPs"})}),(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:()=>!0===r?H(!0):P.ZP.error("Only premium users can configure UI access control"),children:"UI Access Control"})})]})]}),(0,c.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,c.jsx)(lS,{isAddSSOModalVisible:M,isInstructionsModalVisible:F,handleAddSSOOk:()=>{D(!1),o.resetFields(),t&&r&&ei()},handleAddSSOCancel:()=>{D(!1),o.resetFields()},handleShowInstructions:e=>{D(!1),R(!0)},handleInstructionsOk:()=>{R(!1),t&&r&&ei()},handleInstructionsCancel:()=>{R(!1),t&&r&&ei()},form:o,accessToken:t,ssoConfigured:Q}),(0,c.jsx)(E.Z,{title:"Manage Allowed IP Addresses",width:800,visible:q,onCancel:()=>U(!1),footer:[(0,c.jsx)(_.Z,{className:"mx-1",onClick:()=>V(!0),children:"Add IP Address"},"add"),(0,c.jsx)(_.Z,{onClick:()=>U(!1),children:"Close"},"close")],children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"IP Address"}),(0,c.jsx)(sN.Z,{className:"text-right",children:"Action"})]})}),(0,c.jsx)(s_.Z,{children:J.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e}),(0,c.jsx)(sy.Z,{className:"text-right",children:e!==ea&&(0,c.jsx)(_.Z,{onClick:()=>ec(e),color:"red",size:"xs",children:"Delete"})})]},s))})]})}),(0,c.jsx)(E.Z,{title:"Add Allowed IP Address",visible:z,onCancel:()=>V(!1),footer:null,children:(0,c.jsxs)(I.Z,{onFinish:eo,children:[(0,c.jsx)(I.Z.Item,{name:"ip",rules:[{required:!0,message:"Please enter an IP address"}],children:(0,c.jsx)(L.default,{placeholder:"Enter IP address"})}),(0,c.jsx)(I.Z.Item,{children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add IP Address"})})]})}),(0,c.jsx)(E.Z,{title:"Confirm Delete",visible:K,onCancel:()=>B(!1),onOk:ed,footer:[(0,c.jsx)(_.Z,{className:"mx-1",onClick:()=>ed(),children:"Yes"},"delete"),(0,c.jsx)(_.Z,{onClick:()=>B(!1),children:"Close"},"close")],children:(0,c.jsxs)("p",{children:["Are you sure you want to delete the IP address: ",W,"?"]})}),(0,c.jsx)(E.Z,{title:"UI Access Control Settings",visible:G,width:600,footer:null,onOk:em,onCancel:()=>{H(!1)},children:(0,c.jsx)(lL,{accessToken:t,onSuccess:()=>{em(),P.ZP.success("UI Access Control settings updated successfully")}})})]}),(0,c.jsxs)(lZ.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access"," ",(0,c.jsxs)("a",{href:er,target:"_blank",children:[(0,c.jsx)("b",{children:er})," "]})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lT,{accessToken:t,userID:l,proxySettings:i})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lO.Z,{accessToken:t,userRole:n||null})})]})]})]})};let{Title:lD}=eh.default;var lF=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)([]);(0,d.useEffect)(()=>{i()},[s]);let i=async()=>{if(s){l(!0);try{let e=await (0,g.getEmailEventSettings)(s);r(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),P.ZP.error("Failed to fetch email event settings")}finally{l(!1)}}},n=(e,s)=>{r(a.map(t=>t.event===e?{...t,enabled:s}:t))},o=async()=>{if(s)try{await (0,g.updateEmailEventSettings)(s,{settings:a}),P.ZP.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),P.ZP.error("Failed to update email event settings")}},m=async()=>{if(s)try{await (0,g.resetEmailEventSettings)(s),P.ZP.success("Email event settings reset to defaults"),i()}catch(e){console.error("Failed to reset email event settings:",e),P.ZP.error("Failed to reset email event settings")}},u=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let s=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(s)}};return(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(lD,{level:4,children:"Email Notifications"}),(0,c.jsx)(w.Z,{children:"Select which events should trigger email notifications."}),(0,c.jsx)(Q.Z,{}),t?(0,c.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,c.jsx)(lu.Z,{size:"large"})}):(0,c.jsx)("div",{className:"space-y-4",children:a.map(e=>(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(s4.Z,{checked:e.enabled,onChange:s=>n(e.event,s.target.checked)}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)(w.Z,{children:e.event}),(0,c.jsx)("div",{className:"text-sm text-gray-500 block",children:u(e.event)})]})]},e.event))}),(0,c.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,c.jsx)(_.Z,{onClick:o,disabled:t,children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:m,variant:"secondary",disabled:t,children:"Reset to Defaults"})]})]})};let{Title:lR}=eh.default;var lq=e=>{let{accessToken:s,premiumUser:t,alerts:l}=e,a=()=>{if(!s)return;let e={};l.filter(e=>"email"===e.name).forEach(s=>{var t;Object.entries(null!==(t=s.variables)&&void 0!==t?t:{}).forEach(s=>{let[t,l]=s,a=document.querySelector('input[name="'.concat(t,'"]'));a&&a.value&&(e[t]=null==a?void 0:a.value)})}),console.log("updatedVariables",e);try{(0,g.setCallbacksCall)(s,{general_settings:{alerting:["email"]},environment_variables:e})}catch(e){P.ZP.error("Failed to update alerts: "+e,20)}P.ZP.success("Email settings updated successfully")};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 mb-6",children:(0,c.jsx)(lF,{accessToken:s})}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(lR,{level:4,children:"Email Server Settings"}),(0,c.jsxs)(w.Z,{children:[(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:" LiteLLM Docs: email alerts"})," ",(0,c.jsx)("br",{})]}),(0,c.jsx)("div",{className:"flex w-full",children:l.filter(e=>"email"===e.name).map((e,s)=>{var l;return(0,c.jsx)(sy.Z,{children:(0,c.jsx)("ul",{children:(0,c.jsx)(v.Z,{numItems:2,children:Object.entries(null!==(l=e.variables)&&void 0!==l?l:{}).map(e=>{let[s,l]=e;return(0,c.jsxs)("li",{className:"mx-2 my-2",children:[!0!=t&&("EMAIL_LOGO_URL"===s||"EMAIL_SUPPORT_CONTACT"===s)?(0,c.jsxs)("div",{children:[(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,c.jsxs)(w.Z,{className:"mt-2",children:[" ","✨ ",s]})}),(0,c.jsx)(y.Z,{name:s,defaultValue:l,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-2",children:s}),(0,c.jsx)(y.Z,{name:s,defaultValue:l,type:"password",style:{width:"400px"}})]}),(0,c.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===s&&(0,c.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `[email protected]`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `[email protected]`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===s&&(0,c.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===s&&(0,c.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is [email protected]"})]})]},s)})})})},s)})}),(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>a(),children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:()=>s&&(0,g.serviceHealthCheck)(s,"email"),className:"mx-2",children:"Test Email Alerts"})]})]})},lU=e=>{let{alertingSettings:s,handleInputChange:t,handleResetField:l,handleSubmit:a,premiumUser:r}=e,[i]=I.Z.useForm();return(0,c.jsxs)(I.Z,{form:i,onFinish:()=>{console.log("INSIDE ONFINISH");let e=i.getFieldsValue(),s=Object.entries(e).every(e=>{let[s,t]=e;return"boolean"!=typeof t&&(""===t||null==t)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(s)),s?console.log("Some form fields are empty."):a(e)},labelAlign:"left",children:[s.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsxs)(sy.Z,{align:"center",children:[(0,c.jsx)(w.Z,{children:e.field_name}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?r?(0,c.jsx)(I.Z.Item,{name:e.field_name,children:(0,c.jsx)(sy.Z,{children:"Integer"===e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>t(e.field_name,s)}):"Boolean"===e.field_type?(0,c.jsx)(tT.Z,{checked:e.field_value,onChange:s=>t(e.field_name,s)}):(0,c.jsx)(L.default,{value:e.field_value,onChange:s=>t(e.field_name,s)})})}):(0,c.jsx)(sy.Z,{children:(0,c.jsx)(_.Z,{className:"flex items-center justify-center",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,c.jsx)(I.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,c.jsx)(sy.Z,{children:"Integer"===e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>t(e.field_name,s),className:"p-0"}):"Boolean"===e.field_type?(0,c.jsx)(tT.Z,{checked:e.field_value,onChange:s=>{t(e.field_name,s),i.setFieldsValue({[e.field_name]:s})}}):(0,c.jsx)(L.default,{value:e.field_value,onChange:s=>t(e.field_name,s)})})}),(0,c.jsx)(sy.Z,{children:!0==e.stored_in_db?(0,c.jsx)(eY.Z,{icon:eS.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,c.jsx)(eY.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,c.jsx)(eY.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(sf.Z,{icon:el.Z,color:"red",onClick:()=>l(e.field_name,s),children:"Reset"})})]},s)),(0,c.jsx)("div",{children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Update Settings"})})]})},lz=e=>{let{accessToken:s,premiumUser:t}=e,[l,a]=(0,d.useState)([]);return(0,d.useEffect)(()=>{s&&(0,g.alertingSettingsCall)(s).then(e=>{a(e)})},[s]),(0,c.jsx)(lU,{alertingSettings:l,handleInputChange:(e,s)=>{let t=l.map(t=>t.field_name===e?{...t,field_value:s}:t);console.log("updatedSettings: ".concat(JSON.stringify(t))),a(t)},handleResetField:(e,t)=>{if(s)try{let s=l.map(s=>s.field_name===e?{...s,stored_in_db:null,field_value:s.field_default_value}:s);a(s)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!s||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let t={};l.forEach(e=>{t[e.field_name]=e.field_value});let a={...e,...t};console.log("mergedFormValues: ".concat(JSON.stringify(a)));let{slack_alerting:r,...i}=a;console.log("slack_alerting: ".concat(r,", alertingArgs: ").concat(JSON.stringify(i)));try{(0,g.updateConfigFieldSetting)(s,"alerting_args",i),"boolean"==typeof r&&(!0==r?(0,g.updateConfigFieldSetting)(s,"alerting",["slack"]):(0,g.updateConfigFieldSetting)(s,"alerting",[])),P.ZP.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:t})},lV=t(38994);let{Title:lK,Paragraph:lB}=eh.default;var lG=e=>{let{accessToken:s,userRole:t,userID:l,premiumUser:a}=e,[r,n]=(0,d.useState)([]),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(!1),[h]=I.Z.useForm(),[p,j]=(0,d.useState)(null),[f,b]=(0,d.useState)(""),[N,Z]=(0,d.useState)({}),[k,S]=(0,d.useState)([]),[A,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)([]),[D,F]=(0,d.useState)([]),[R,q]=(0,d.useState)(!1),[U,z]=(0,d.useState)(null),[V,K]=(0,d.useState)(!1),[B,G]=(0,d.useState)(null),H=e=>{k.includes(e)?S(k.filter(s=>s!==e)):S([...k,e])},J={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,d.useEffect)(()=>{s&&t&&l&&(0,g.getCallbacksCall)(s,l,t).then(e=>{n(e.callbacks),M(e.available_callbacks);let s=e.alerts;if(s&&s.length>0){let e=s[0],t=e.variables.SLACK_WEBHOOK_URL;S(e.active_alerts),b(t),Z(e.alerts_to_webhook)}m(s)})},[s,t,l]);let Y=e=>k&&k.includes(e),W=async e=>{if(!s)return;let t={};Object.entries(e).forEach(e=>{let[s,l]=e;"callback"!==s&&(t[s]=l)});try{await (0,g.setCallbacksCall)(s,{environment_variables:t}),P.ZP.success("Callback added successfully"),x(!1),h.resetFields(),j(null)}catch(e){P.ZP.error("Failed to add callback: "+e,20)}},$=async e=>{if(!s)return;let t=null==e?void 0:e.callback,l={};Object.entries(e).forEach(e=>{let[s,t]=e;"callback"!==s&&(l[s]=t)});try{await (0,g.setCallbacksCall)(s,{environment_variables:l,litellm_settings:{success_callback:[t]}}),P.ZP.success("Callback ".concat(t," added successfully")),x(!1),h.resetFields(),j(null)}catch(e){P.ZP.error("Failed to add callback: "+e,20)}},Q=e=>{j(e.litellm_callback_name),e&&e.litellm_callback_params?F(e.litellm_callback_params):F([])},ee=e=>{G(e),K(!0)},es=async()=>{if(B&&s)try{if(await (0,g.deleteCallback)(s,B),P.ZP.success("Callback ".concat(B," deleted successfully")),l&&t){let e=await (0,g.getCallbacksCall)(s,l,t);n(e.callbacks)}K(!1),G(null)}catch(e){console.error("Failed to delete callback:",e),P.ZP.error("Failed to delete callback: ".concat(e))}};return s?(0,c.jsxs)("div",{className:"w-full mx-4",children:[(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eW.Z,{value:"1",children:"Logging Callbacks"}),(0,c.jsx)(eW.Z,{value:"2",children:"Alerting Types"}),(0,c.jsx)(eW.Z,{value:"3",children:"Alerting Settings"}),(0,c.jsx)(eW.Z,{value:"4",children:"Email Alerts"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(lK,{level:4,children:"Active Logging Callbacks"}),(0,c.jsx)(v.Z,{numItems:2,children:(0,c.jsx)(X.Z,{className:"max-h-[50vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sN.Z,{children:"Callback Name"})})}),(0,c.jsx)(s_.Z,{children:r.map((e,t)=>(0,c.jsxs)(sZ.Z,{className:"flex justify-between",children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:e.name})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"flex justify-between",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{z(e),q(!0)}}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>ee(e.name),className:"text-red-500 hover:text-red-700 cursor-pointer"}),(0,c.jsx)(_.Z,{onClick:()=>(0,g.serviceHealthCheck)(s,e.name),className:"ml-2",variant:"secondary",children:"Test Callback"})]})})]},t))})]})})}),(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>L(!0),children:"Add Callback"})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(w.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,c.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{}),(0,c.jsx)(sN.Z,{}),(0,c.jsx)(sN.Z,{children:"Slack Webhook URL"})]})}),(0,c.jsx)(s_.Z,{children:Object.entries(J).map((e,s)=>{let[t,l]=e;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:"region_outage_alerts"==t?a?(0,c.jsx)(tT.Z,{id:"switch",name:"switch",checked:Y(t),onChange:()=>H(t)}):(0,c.jsx)(_.Z,{className:"flex items-center justify-center",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,c.jsx)(tT.Z,{id:"switch",name:"switch",checked:Y(t),onChange:()=>H(t)})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:l})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(y.Z,{name:t,type:"password",defaultValue:N&&N[t]?N[t]:f})})]},s)})})]}),(0,c.jsx)(_.Z,{size:"xs",className:"mt-2",onClick:()=>{if(!s)return;let e={};Object.entries(J).forEach(s=>{let[t,l]=s,a=document.querySelector('input[name="'.concat(t,'"]')),r=(null==a?void 0:a.value)||"";e[t]=r});try{(0,g.setCallbacksCall)(s,{general_settings:{alert_to_webhook_url:e,alert_types:k}})}catch(e){P.ZP.error("Failed to update alerts: "+e,20)}P.ZP.success("Alerts updated successfully")},children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:()=>(0,g.serviceHealthCheck)(s,"slack"),className:"mx-2",children:"Test Alerts"})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lz,{accessToken:s,premiumUser:a})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lq,{accessToken:s,premiumUser:a,alerts:o})})]})]})}),(0,c.jsxs)(E.Z,{title:"Add Logging Callback",visible:A,width:800,onCancel:()=>L(!1),footer:null,children:[(0,c.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,c.jsx)(I.Z,{form:h,onFinish:$,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(lV.Z,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,c.jsx)(C.default,{onChange:e=>{let s=O[e];s&&Q(s)},children:Object.entries(i).map(e=>{var s;let[t,l]=e;return(0,c.jsx)(ex.Z,{value:ea[t],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(null===(s=ec[l])||void 0===s?void 0:s.logo)?(0,c.jsx)("div",{className:"w-5 h-5 flex items-center justify-center",children:(0,c.jsx)("img",{src:ec[l].logo,alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{e.currentTarget.style.display="none"}})}):(0,c.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:l.charAt(0).toUpperCase()}),(0,c.jsx)("span",{children:l})]})},l)})})}),D&&D.map(e=>(0,c.jsx)(lV.Z,{label:e,name:e,rules:[{required:!0,message:"Please enter the value for "+e}],children:(0,c.jsx)(y.Z,{type:"password"})},e)),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})]}),(0,c.jsx)(E.Z,{visible:R,width:800,title:"Edit ".concat(null==U?void 0:U.name," Settings"),onCancel:()=>q(!1),footer:null,children:(0,c.jsxs)(I.Z,{form:h,onFinish:W,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(c.Fragment,{children:U&&U.variables&&Object.entries(U.variables).map(e=>{let[s,t]=e;return(0,c.jsx)(lV.Z,{label:s,name:s,children:(0,c.jsx)(y.Z,{type:"password",defaultValue:t})},s)})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,c.jsx)(E.Z,{title:"Confirm Delete",visible:V,onOk:es,onCancel:()=>{K(!1),G(null)},okText:"Delete",cancelText:"Cancel",okButtonProps:{danger:!0},children:(0,c.jsxs)("p",{children:["Are you sure you want to delete the callback - ",B,"? This action cannot be undone."]})})]}):null},lH=t(92414),lJ=t(46030);let{Option:lY}=C.default;var lW=e=>{let{models:s,accessToken:t,routerSettings:l,setRouterSettings:a}=e,[r]=I.Z.useForm(),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)("");return(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{className:"mx-auto",onClick:()=>n(!0),children:"+ Add Fallbacks"}),(0,c.jsx)(E.Z,{title:"Add Fallbacks",visible:i,width:800,footer:null,onOk:()=>{n(!1),r.resetFields()},onCancel:()=>{n(!1),r.resetFields()},children:(0,c.jsxs)(I.Z,{form:r,onFinish:e=>{console.log(e);let{model_name:s,models:i}=e,o=[...l.fallbacks||[],{[s]:i}],c={...l,fallbacks:o};console.log(c);try{(0,g.setCallbacksCall)(t,{router_settings:c}),a(c)}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}P.ZP.success("router settings updated successfully"),n(!1),r.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Public Model Name",name:"model_name",rules:[{required:!0,message:"Set the model to fallback for"}],help:"required",children:(0,c.jsx)(eJ.Z,{defaultValue:o,children:s&&s.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,onClick:()=>m(e),children:e},s))})}),(0,c.jsx)(I.Z.Item,{label:"Fallback Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,c.jsx)(lH.Z,{value:s,children:s&&s.filter(e=>e!=o).map(e=>(0,c.jsx)(lJ.Z,{value:e,children:e},e))})})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add Fallbacks"})})]})})]})},l$=t(26433);async function lQ(e,s){console.log=function(){},console.log("isLocal:",!1);let t=window.location.origin,l=new l$.ZP.OpenAI({apiKey:s,baseURL:t,dangerouslyAllowBrowser:!0});try{let s=await l.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});P.ZP.success((0,c.jsxs)("span",{children:["Test model=",(0,c.jsx)("strong",{children:e}),", received model=",(0,c.jsx)("strong",{children:s.model}),". See"," ",(0,c.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}let lX={ttl:3600,lowest_latency_buffer:0},l0=e=>{let{selectedStrategy:s,strategyArgs:t,paramExplanation:l}=e;return(0,c.jsxs)(b.Z,{children:[(0,c.jsx)(Z.Z,{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Routing Strategy Specific Args"}),(0,c.jsx)(N.Z,{children:"latency-based-routing"==s?(0,c.jsx)(X.Z,{children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Setting"}),(0,c.jsx)(sN.Z,{children:"Value"})]})}),(0,c.jsx)(s_.Z,{children:Object.entries(t).map(e=>{let[s,t]=e;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(w.Z,{children:s}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:l[s]})]}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(y.Z,{name:s,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t.toString()})})]},s)})})]})}):(0,c.jsx)(w.Z,{children:"No specific settings"})})]})};var l1=e=>{let{accessToken:s,userRole:t,userID:l,modelData:a}=e,[r,i]=(0,d.useState)({}),[n,o]=(0,d.useState)({}),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p]=I.Z.useForm(),[j,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),E={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,d.useEffect)(()=>{s&&t&&l&&((0,g.getCallbacksCall)(s,l,t).then(e=>{console.log("callbacks",e);let s=e.router_settings;"model_group_retry_policy"in s&&delete s.model_group_retry_policy,i(s)}),(0,g.getGeneralSettingsCall)(s).then(e=>{u(e)}))},[s,t,l]);let A=async e=>{if(!s)return;console.log("received key: ".concat(e)),console.log("routerSettings['fallbacks']: ".concat(r.fallbacks));let t=r.fallbacks.map(s=>(e in s&&delete s[e],s)).filter(e=>Object.keys(e).length>0),l={...r,fallbacks:t};try{await (0,g.setCallbacksCall)(s,{router_settings:l}),i(l),P.ZP.success("Router settings updated successfully")}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}},T=(e,s)=>{u(m.map(t=>t.field_name===e?{...t,field_value:s}:t))},L=(e,t)=>{if(!s)return;let l=m[t].field_value;if(null!=l&&void 0!=l)try{(0,g.updateConfigFieldSetting)(s,e,l);let t=m.map(s=>s.field_name===e?{...s,stored_in_db:!0}:s);u(t)}catch(e){}},O=(e,t)=>{if(s)try{(0,g.deleteConfigFieldSetting)(s,e);let t=m.map(s=>s.field_name===e?{...s,stored_in_db:null,field_value:null}:s);u(t)}catch(e){}},M=e=>{if(!s)return;console.log("router_settings",e);let t=Object.fromEntries(Object.entries(e).map(e=>{let[s,t]=e;if("routing_strategy_args"!==s&&"routing_strategy"!==s){var l;return[s,(null===(l=document.querySelector('input[name="'.concat(s,'"]')))||void 0===l?void 0:l.value)||t]}if("routing_strategy"==s)return[s,N];if("routing_strategy_args"==s&&"latency-based-routing"==N){let e={},s=document.querySelector('input[name="lowest_latency_buffer"]'),t=document.querySelector('input[name="ttl"]');return(null==s?void 0:s.value)&&(e.lowest_latency_buffer=Number(s.value)),(null==t?void 0:t.value)&&(e.ttl=Number(t.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",t);try{(0,g.setCallbacksCall)(s,{router_settings:t})}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}P.ZP.success("router settings updated successfully")};return s?(0,c.jsx)("div",{className:"w-full mx-4",children:(0,c.jsxs)(e$.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)(eQ.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eW.Z,{value:"1",children:"Loadbalancing"}),(0,c.jsx)(eW.Z,{value:"2",children:"Fallbacks"}),(0,c.jsx)(eW.Z,{value:"3",children:"General"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,c.jsx)(k.Z,{children:"Router Settings"}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Setting"}),(0,c.jsx)(sN.Z,{children:"Value"})]})}),(0,c.jsx)(s_.Z,{children:Object.entries(r).filter(e=>{let[s,t]=e;return"fallbacks"!=s&&"context_window_fallbacks"!=s&&"routing_strategy_args"!=s}).map(e=>{let[s,t]=e;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(w.Z,{children:s}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:E[s]})]}),(0,c.jsx)(sy.Z,{children:"routing_strategy"==s?(0,c.jsxs)(eJ.Z,{defaultValue:t,className:"w-full max-w-md",onValueChange:Z,children:[(0,c.jsx)(ex.Z,{value:"usage-based-routing",children:"usage-based-routing"}),(0,c.jsx)(ex.Z,{value:"latency-based-routing",children:"latency-based-routing"}),(0,c.jsx)(ex.Z,{value:"simple-shuffle",children:"simple-shuffle"})]}):(0,c.jsx)(y.Z,{name:s,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t.toString()})})]},s)})})]}),(0,c.jsx)(l0,{selectedStrategy:N,strategyArgs:r&&r.routing_strategy_args&&Object.keys(r.routing_strategy_args).length>0?r.routing_strategy_args:lX,paramExplanation:E})]}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>M(r),children:"Save Changes"})})]})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Model Name"}),(0,c.jsx)(sN.Z,{children:"Fallbacks"})]})}),(0,c.jsx)(s_.Z,{children:r.fallbacks&&r.fallbacks.map((e,t)=>Object.entries(e).map(e=>{let[l,a]=e;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:l}),(0,c.jsx)(sy.Z,{children:Array.isArray(a)?a.join(", "):a}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(_.Z,{onClick:()=>lQ(l,s),children:"Test Fallback"})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>A(l)})})]},t.toString()+l)}))})]}),(0,c.jsx)(lW,{models:(null==a?void 0:a.data)?a.data.map(e=>e.model_name):[],accessToken:s,routerSettings:r,setRouterSettings:i})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(X.Z,{children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Setting"}),(0,c.jsx)(sN.Z,{children:"Value"}),(0,c.jsx)(sN.Z,{children:"Status"}),(0,c.jsx)(sN.Z,{children:"Action"})]})}),(0,c.jsx)(s_.Z,{children:m.filter(e=>"TypedDictionary"!==e.field_type).map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(w.Z,{children:e.field_name}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,c.jsx)(sy.Z,{children:"Integer"==e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>T(e.field_name,s)}):null}),(0,c.jsx)(sy.Z,{children:!0==e.stored_in_db?(0,c.jsx)(eY.Z,{icon:eS.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,c.jsx)(eY.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,c.jsx)(eY.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(_.Z,{onClick:()=>L(e.field_name,s),children:"Update"}),(0,c.jsx)(sf.Z,{icon:el.Z,color:"red",onClick:()=>O(e.field_name,s),children:"Reset"})]})]},s))})]})})})]})]})}):null},l2=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:l,setBudgetList:a}=e,[r]=I.Z.useForm(),i=async e=>{if(null!=t&&void 0!=t)try{P.ZP.info("Making API Call");let s=await (0,g.budgetCreateCall)(t,e);console.log("key create Response:",s),a(e=>e?[...e,s]:[s]),P.ZP.success("Budget Created"),r.resetFields()}catch(e){console.error("Error creating the key:",e),P.ZP.error("Error creating the key: ".concat(e),20)}};return(0,c.jsx)(E.Z,{title:"Create Budget",visible:s,width:800,footer:null,onOk:()=>{l(!1),r.resetFields()},onCancel:()=>{l(!1),r.resetFields()},children:(0,c.jsxs)(I.Z,{form:r,onFinish:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},l4=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:l,setBudgetList:a,existingBudget:r,handleUpdateCall:i}=e;console.log("existingBudget",r);let[n]=I.Z.useForm();(0,d.useEffect)(()=>{n.setFieldsValue(r)},[r,n]);let o=async e=>{if(null!=t&&void 0!=t)try{P.ZP.info("Making API Call"),l(!0);let s=await (0,g.budgetUpdateCall)(t,e);a(e=>e?[...e,s]:[s]),P.ZP.success("Budget Updated"),n.resetFields(),i()}catch(e){console.error("Error creating the key:",e),P.ZP.error("Error creating the key: ".concat(e),20)}};return(0,c.jsx)(E.Z,{title:"Edit Budget",visible:s,width:800,footer:null,onOk:()=>{l(!1),n.resetFields()},onCancel:()=>{l(!1),n.resetFields()},children:(0,c.jsxs)(I.Z,{form:n,onFinish:o,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:r,children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})},l5=t(17906),l6=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)(!1),[a,r]=(0,d.useState)(!1),[i,n]=(0,d.useState)(null),[o,m]=(0,d.useState)([]);(0,d.useEffect)(()=>{s&&(0,g.getBudgetList)(s).then(e=>{m(e)})},[s]);let u=async(e,t)=>{console.log("budget_id",e),null!=s&&(n(o.find(s=>s.budget_id===e)||null),r(!0))},x=async(e,t)=>{if(null==s)return;P.ZP.info("Request made"),await (0,g.budgetDeleteCall)(s,e);let l=[...o];l.splice(t,1),m(l),P.ZP.success("Budget Deleted.")},h=async()=>{null!=s&&(0,g.getBudgetList)(s).then(e=>{m(e)})};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)(_.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>l(!0),children:"+ Create Budget"}),(0,c.jsx)(l2,{accessToken:s,isModalVisible:t,setIsModalVisible:l,setBudgetList:m}),i&&(0,c.jsx)(l4,{accessToken:s,isModalVisible:a,setIsModalVisible:r,setBudgetList:m,existingBudget:i,handleUpdateCall:h}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Create a budget to assign to customers."}),(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Budget ID"}),(0,c.jsx)(sN.Z,{children:"Max Budget"}),(0,c.jsx)(sN.Z,{children:"TPM"}),(0,c.jsx)(sN.Z,{children:"RPM"})]})}),(0,c.jsx)(s_.Z,{children:o.slice().sort((e,s)=>new Date(s.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.budget_id}),(0,c.jsx)(sy.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,c.jsx)(sy.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,c.jsx)(sy.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>u(e.budget_id,s)}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>x(e.budget_id,s)})]},s))})]})]}),(0,c.jsxs)("div",{className:"mt-5",children:[(0,c.jsx)(w.Z,{className:"text-base",children:"How to use budget id"}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(eW.Z,{children:"Assign Budget to Customer"}),(0,c.jsx)(eW.Z,{children:"Test it (Curl)"}),(0,c.jsx)(eW.Z,{children:"Test it (OpenAI SDK)"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.Z,{language:"bash",children:"\ncurl -X POST --location '<your_proxy_base_url>/end_user/new' \n-H 'Authorization: Bearer <your-master-key>' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"<BUDGET_ID>\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.Z,{language:"bash",children:'\ncurl -X POST --location \'<your_proxy_base_url>/chat/completions\' \n-H \'Authorization: Bearer <your-master-key>\' \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,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="<your_proxy_base_url>",\n api_key="<your_proxy_key>"\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})},l3=t(77398),l8=t.n(l3);let l7=e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}},l9=e=>{let{utcTime:s}=e;return(0,c.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:l7(s)})},ae=(e,s)=>{var t,l;return(null===(l=e.metadata)||void 0===l?void 0:null===(t=l.mcp_tool_call_metadata)||void 0===t?void 0:t.mcp_server_logo_url)?e.metadata.mcp_tool_call_metadata.mcp_server_logo_url:s?(0,sO.dr)(s).logo:""},as=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,c.jsx)(()=>{let[e,t]=d.useState(s.getIsExpanded()),l=d.useCallback(()=>{t(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,c.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,c.jsx)("svg",{className:"w-4 h-4 transform transition-transform duration-75 ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,c.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Time",accessorKey:"startTime",cell:e=>(0,c.jsx)(l9,{utcTime:e.getValue()})},{header:"Status",accessorKey:"metadata.status",cell:e=>{let s="failure"!==(e.getValue()||"Success").toLowerCase();return(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat(s?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let s=String(e.getValue()||""),t=e.row.original.onSessionClick;return(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>null==t?void 0:t(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:"Cost",accessorKey:"spend",cell:e=>(0,c.jsxs)("span",{children:["$",eR(e.getValue()||0,6)]})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let s=String(e.getValue()||"-"),t=e.row.original.onKeyHashClick;return(0,c.jsx)(z.Z,{title:s,children:(0,c.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>null==t?void 0:t(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Model",accessorKey:"model",cell:e=>{let s=e.row.original,t=s.custom_llm_provider,l=String(e.getValue()||"");return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:ae(s,t),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)(z.Z,{title:l,children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:l})})]})}},{header:"Tokens",accessorKey:"total_tokens",cell:e=>{let s=e.row.original;return(0,c.jsxs)("span",{className:"text-sm",children:[String(s.total_tokens||"0"),(0,c.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(s.prompt_tokens||"0"),"+",String(s.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let s=e.getValue();if(!s||0===Object.keys(s).length)return"-";let t=Object.entries(s),l=t[0],a=t.slice(1);return(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,c.jsx)(z.Z,{title:(0,c.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{children:[s,": ",String(t)]},s)})}),children:(0,c.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[l[0],": ",String(l[1]),a.length>0&&" +".concat(a.length)]})})})}}],at=e=>(0,c.jsx)(eY.Z,{color:"gray",className:"flex items-center gap-1",children:(0,c.jsx)("span",{className:"whitespace-nowrap text-xs",children:e})}),al=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,c.jsx)(()=>{let[e,t]=d.useState(s.getIsExpanded()),l=d.useCallback(()=>{t(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,c.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,c.jsx)("svg",{className:"w-4 h-4 transform transition-transform ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,c.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Timestamp",accessorKey:"updated_at",cell:e=>(0,c.jsx)(l9,{utcTime:e.getValue()})},{header:"Table Name",accessorKey:"table_name",cell:e=>{let s=e.getValue(),t=s;switch(s){case"LiteLLM_VerificationToken":t="Keys";break;case"LiteLLM_TeamTable":t="Teams";break;case"LiteLLM_OrganizationTable":t="Organizations";break;case"LiteLLM_UserTable":t="Users";break;case"LiteLLM_ProxyModelTable":t="Models";break;default:t=s}return(0,c.jsx)("span",{children:t})}},{header:"Action",accessorKey:"action",cell:e=>(0,c.jsx)("span",{children:at(e.getValue())})},{header:"Changed By",accessorKey:"changed_by",cell:e=>{let s=e.row.original.changed_by,t=e.row.original.changed_by_api_key;return(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsx)("div",{className:"font-medium",children:s}),t&&(0,c.jsx)(z.Z,{title:t,children:(0,c.jsxs)("div",{className:"text-xs text-muted-foreground max-w-[15ch] truncate",children:[" ",t]})})]})}},{header:"Affected Item ID",accessorKey:"object_id",cell:e=>(0,c.jsx)(()=>{let s=e.getValue(),[t,l]=(0,d.useState)(!1);if(!s)return(0,c.jsx)(c.Fragment,{children:"-"});let a=async()=>{try{await navigator.clipboard.writeText(String(s)),l(!0),setTimeout(()=>l(!1),1500)}catch(e){console.error("Failed to copy object ID: ",e)}};return(0,c.jsx)(z.Z,{title:t?"Copied!":String(s),children:(0,c.jsx)("span",{className:"max-w-[20ch] truncate block cursor-pointer hover:text-blue-600",onClick:a,children:String(s)})})},{})}],aa=async(e,s,t,l)=>{console.log("prefetchLogDetails called with",e.length,"logs");let a=e.map(e=>{if(e.request_id)return console.log("Prefetching details for request_id:",e.request_id),l.prefetchQuery({queryKey:["logDetails",e.request_id,s],queryFn:async()=>{console.log("Fetching details for",e.request_id);let l=await (0,g.uiSpendLogDetailsCall)(t,e.request_id,s);return console.log("Received details for",e.request_id,":",l?"success":"failed"),l},staleTime:6e5,gcTime:6e5})});try{let e=await Promise.all(a);return console.log("All prefetch promises completed:",e.length),e}catch(e){throw console.error("Error in prefetchLogDetails:",e),e}};function ar(e){let{row:s,hasMessages:t,hasResponse:l,hasError:a,errorInfo:r,getRawRequest:i,formattedResponse:n}=e,o=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let t=document.execCommand("copy");if(document.body.removeChild(s),!t)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},d=async()=>{await o(JSON.stringify(i(),null,2))?P.ZP.success("Request copied to clipboard"):P.ZP.error("Failed to copy request")},m=async()=>{await o(JSON.stringify(n(),null,2))?P.ZP.success("Response copied to clipboard"):P.ZP.error("Failed to copy response")};return(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request"}),(0,c.jsx)("button",{onClick:d,className:"p-1 hover:bg-gray-200 rounded",title:"Copy request",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-96",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(i(),null,2)})})]}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsxs)("h3",{className:"text-lg font-medium",children:["Response",a&&(0,c.jsxs)("span",{className:"ml-2 text-sm text-red-600",children:["• HTTP code ",(null==r?void 0:r.error_code)||400]})]}),(0,c.jsx)("button",{onClick:m,className:"p-1 hover:bg-gray-200 rounded",title:"Copy response",disabled:!l,children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-96 bg-gray-50",children:l?(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(n(),null,2)}):(0,c.jsx)("div",{className:"text-gray-500 text-sm italic text-center py-4",children:"Response data not available"})})]})]})}let ai=e=>{var s;let{errorInfo:t}=e,[l,a]=d.useState({}),[r,i]=d.useState(!1),n=e=>{a(s=>({...s,[e]:!s[e]}))},o=t.traceback&&(s=t.traceback)?Array.from(s.matchAll(/File "([^"]+)", line (\d+)/g)).map(e=>{let t=e[1],l=e[2],a=t.split("/").pop()||t,r=e.index||0,i=s.indexOf('File "',r+1),n=i>-1?s.substring(r,i).trim():s.substring(r).trim(),o=n.split("\n"),c="";return o.length>1&&(c=o[o.length-1].trim()),{filePath:t,fileName:a,lineNumber:l,code:c,inFunction:n.includes(" in ")?n.split(" in ")[1].split("\n")[0]:""}}):[];return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"p-4 border-b",children:(0,c.jsxs)("h3",{className:"text-lg font-medium flex items-center text-red-600",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Error Details"]})}),(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"bg-red-50 rounded-md p-4 mb-4",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"text-red-800 font-medium w-20",children:"Type:"}),(0,c.jsx)("span",{className:"text-red-700",children:t.error_class||"Unknown Error"})]}),(0,c.jsxs)("div",{className:"flex mt-2",children:[(0,c.jsx)("span",{className:"text-red-800 font-medium w-20 flex-shrink-0",children:"Message:"}),(0,c.jsx)("span",{className:"text-red-700 break-words whitespace-pre-wrap",children:t.error_message||"Unknown error occurred"})]})]}),t.traceback&&(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,c.jsx)("h4",{className:"font-medium",children:"Traceback"}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsx)("button",{onClick:()=>{let e=!r;if(i(e),o.length>0){let s={};o.forEach((t,l)=>{s[l]=e}),a(s)}},className:"text-gray-500 hover:text-gray-700 flex items-center text-sm",children:r?"Collapse All":"Expand All"}),(0,c.jsxs)("button",{onClick:()=>navigator.clipboard.writeText(t.traceback||""),className:"text-gray-500 hover:text-gray-700 flex items-center",title:"Copy traceback",children:[(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,c.jsx)("span",{className:"ml-1",children:"Copy"})]})]})]}),(0,c.jsx)("div",{className:"bg-white rounded-md border border-gray-200 overflow-hidden shadow-sm",children:o.map((e,s)=>(0,c.jsxs)("div",{className:"border-b border-gray-200 last:border-b-0",children:[(0,c.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between cursor-pointer hover:bg-gray-50",onClick:()=>n(s),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{className:"text-gray-400 mr-2 w-12 text-right",children:e.lineNumber}),(0,c.jsx)("span",{className:"text-gray-600 font-medium",children:e.fileName}),(0,c.jsx)("span",{className:"text-gray-500 mx-1",children:"in"}),(0,c.jsx)("span",{className:"text-indigo-600 font-medium",children:e.inFunction||e.fileName})]}),(0,c.jsx)("svg",{className:"w-5 h-5 text-gray-500 transition-transform ".concat(l[s]?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(l[s]||!1)&&e.code&&(0,c.jsx)("div",{className:"px-12 py-2 font-mono text-sm text-gray-800 bg-gray-50 overflow-x-auto border-t border-gray-100",children:e.code})]},s))})]})]})]})},an=e=>{let{show:s}=e;return s?(0,c.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start",children:[(0,c.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Request/Response Data Not Available"}),(0,c.jsxs)("p",{className:"text-sm text-blue-700 mt-1",children:["To view request and response details, enable prompt storage in your LiteLLM configuration by adding the following to your ",(0,c.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded",children:"proxy_config.yaml"})," file:"]}),(0,c.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"general_settings:\n store_model_in_db: true\n store_prompts_in_spend_logs: true"}),(0,c.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change."})]})]}):null};var ao=t(35829);let ac=e=>{let{sessionId:s,logs:t,onBack:l}=e,[a,r]=(0,d.useState)(null),[i,n]=(0,d.useState)({}),o=t.reduce((e,s)=>e+(s.spend||0),0),m=t.reduce((e,s)=>e+(s.total_tokens||0),0),u=t.length>0?new Date(t[0].startTime):new Date;(((t.length>0?new Date(t[t.length-1].endTime):new Date).getTime()-u.getTime())/1e3).toFixed(2),t.map(e=>({time:new Date(e.startTime).toISOString(),tokens:e.total_tokens||0,cost:e.spend||0}));let x=async(e,s)=>{await eq(e)&&(n(e=>({...e,[s]:!0})),setTimeout(()=>{n(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:l,className:"mb-4",children:"Back to All Logs"}),(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsx)("h1",{className:"text-2xl font-semibold text-gray-900",children:"Session Details"}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)("p",{className:"text-sm text-gray-500 font-mono",children:s}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:i["session-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>x(s,"session-id"),className:"left-2 z-10 transition-all duration-200 ".concat(i["session-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/ui_logs_sessions",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 flex items-center gap-1",children:["Get started with session management here",(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(ao.Z,{children:t.length})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Cost"}),(0,c.jsxs)(ao.Z,{children:["$",eR(o,6)]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(ao.Z,{children:m})]})]}),(0,c.jsx)(k.Z,{children:"Session Logs"}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(t8,{columns:as,data:t,renderSubComponent:aj,getRowCanExpand:()=>!0,loadingMessage:"Loading logs...",noDataMessage:"No logs found"})})]})};function ad(e){let{data:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)({});if(!s||0===s.length)return null;let i=e=>new Date(1e3*e).toLocaleString(),n=(e,s)=>"".concat(((s-e)*1e3).toFixed(2),"ms"),o=(e,s)=>{let t="".concat(e,"-").concat(s);r(e=>({...e,[t]:!e[t]}))};return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Vector Store Requests"})]}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:t?"Click to collapse":"Click to expand"})]}),t&&(0,c.jsx)("div",{className:"p-4",children:s.map((e,s)=>(0,c.jsxs)("div",{className:"mb-6 last:mb-0",children:[(0,c.jsx)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Query:"}),(0,c.jsx)("span",{className:"font-mono",children:e.query})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Vector Store ID:"}),(0,c.jsx)("span",{className:"font-mono",children:e.vector_store_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,c.jsx)("span",{className:"flex items-center",children:(()=>{let{logo:s,displayName:t}=(0,sO.dr)(e.custom_llm_provider);return(0,c.jsxs)(c.Fragment,{children:[s&&(0,c.jsx)("img",{src:s,alt:"".concat(t," logo"),className:"h-5 w-5 mr-2"}),t]})})()})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:i(e.start_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:i(e.end_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsx)("span",{children:n(e.start_time,e.end_time)})]})]})]})}),(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Search Results"}),(0,c.jsx)("div",{className:"space-y-2",children:e.vector_store_search_response.data.map((e,t)=>{let l=a["".concat(s,"-").concat(t)]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,c.jsxs)("div",{className:"flex items-center p-3 bg-gray-50 cursor-pointer",onClick:()=>o(s,t),children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(l?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsxs)("span",{className:"font-medium mr-2",children:["Result ",t+1]}),(0,c.jsxs)("span",{className:"text-gray-500 text-sm",children:["Score: ",(0,c.jsx)("span",{className:"font-mono",children:e.score.toFixed(4)})]})]})]}),l&&(0,c.jsx)("div",{className:"p-3 border-t bg-white",children:e.content.map((e,s)=>(0,c.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,c.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:e.type}),(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all bg-gray-50 p-2 rounded",children:e.text})]},s))})]},t)})})]},s))})]})}function am(e){let{data:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)(!0),[i,n]=(0,d.useState)({});if(!s)return null;let o=s.masked_entity_count?Object.values(s.masked_entity_count).reduce((e,s)=>e+s,0):0,m=e=>new Date(1e3*e).toLocaleString(),u=e=>{n(s=>({...s,[e]:!s[e]}))},x=e=>e>=.8?"text-green-600":"text-yellow-600";return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Guardrail Information"}),(0,c.jsx)("span",{className:"ml-3 px-2 py-1 rounded-md text-xs font-medium inline-block ".concat("success"===s.guardrail_status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.guardrail_status}),o>0&&(0,c.jsxs)("span",{className:"ml-3 px-2 py-1 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[o," masked ",1===o?"entity":"entities"]})]}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:t?"Click to collapse":"Click to expand"})]}),t&&(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:[(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail Name:"}),(0,c.jsx)("span",{className:"font-mono",children:s.guardrail_name})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Mode:"}),(0,c.jsx)("span",{className:"font-mono",children:s.guardrail_mode})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat("success"===s.guardrail_status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.guardrail_status})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:m(s.start_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:m(s.end_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsxs)("span",{children:[s.duration.toFixed(4),"s"]})]})]})]}),s.masked_entity_count&&Object.keys(s.masked_entity_count).length>0&&(0,c.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Masked Entity Summary"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(s.masked_entity_count).map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{className:"px-3 py-1.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[s,": ",t]},s)})})]})]}),s.guardrail_response&&s.guardrail_response.length>0&&(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>r(!a),children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsxs)("h4",{className:"font-medium",children:["Detected Entities (",s.guardrail_response.length,")"]})]}),a&&(0,c.jsx)("div",{className:"space-y-2",children:s.guardrail_response.map((e,s)=>{let t=i[s]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>u(s),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("span",{className:"font-medium mr-2",children:e.entity_type}),(0,c.jsxs)("span",{className:"font-mono ".concat(x(e.score)),children:["Score: ",e.score.toFixed(2)]})]}),(0,c.jsxs)("span",{className:"text-xs text-gray-500",children:["Position: ",e.start,"-",e.end]})]}),t&&(0,c.jsx)("div",{className:"p-3 border-t bg-white",children:(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-2",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Entity Type:"}),(0,c.jsx)("span",{children:e.entity_type})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Position:"}),(0,c.jsxs)("span",{children:["Characters ",e.start,"-",e.end]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Confidence:"}),(0,c.jsx)("span",{className:x(e.score),children:e.score.toFixed(2)})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[e.recognition_metadata&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Recognizer:"}),(0,c.jsx)("span",{children:e.recognition_metadata.recognizer_name})]}),(0,c.jsxs)("div",{className:"flex overflow-hidden",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Identifier:"}),(0,c.jsx)("span",{className:"truncate text-xs font-mono",children:e.recognition_metadata.recognizer_identifier})]})]}),e.analysis_explanation&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Explanation:"}),(0,c.jsx)("span",{children:e.analysis_explanation})]})]})]})})]},s)})})]})]})]})}let au={TEAM_ID:"Team ID",KEY_HASH:"Key Hash",REQUEST_ID:"Request ID",MODEL:"Model",USER_ID:"User ID",END_USER:"End User",STATUS:"Status",KEY_ALIAS:"Key Alias"},ax="".concat("../ui/assets/","audit-logs-preview.png");function ah(e){let{userID:s,userRole:t,token:l,accessToken:a,isActive:r,premiumUser:i,allTeams:n}=e,[o,m]=(0,d.useState)(l8()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),u=(0,d.useRef)(null),x=(0,d.useRef)(null),[h,p]=(0,d.useState)(1),[j]=(0,d.useState)(50),[f,v]=(0,d.useState)({}),[_,y]=(0,d.useState)(""),[b,N]=(0,d.useState)(""),[Z,k]=(0,d.useState)(""),[S,C]=(0,d.useState)("all"),[I,P]=(0,d.useState)("all"),[E,A]=(0,d.useState)(!1),[T,L]=(0,d.useState)(!1),O=(0,sm.a)({queryKey:["all_audit_logs",a,l,t,s,o],queryFn:async()=>{if(!a||!l||!t||!s)return[];let e=l8()(o).utc().format("YYYY-MM-DD HH:mm:ss"),r=l8()().utc().format("YYYY-MM-DD HH:mm:ss"),i=[],n=1,c=1;do{let s=await (0,g.uiAuditLogsCall)(a,e,r,n,50);i=i.concat(s.audit_logs),c=s.total_pages,n++}while(n<=c);return i},enabled:!!a&&!!l&&!!t&&!!s&&r,refetchInterval:5e3,refetchIntervalInBackground:!0}),M=(0,d.useCallback)(async e=>{if(a)try{let s=(await (0,g.keyListCall)(a,null,null,e,null,null,1,10)).keys.find(s=>s.key_alias===e);s?N(s.token):N("")}catch(e){console.error("Error fetching key hash for alias:",e),N("")}},[a]);(0,d.useEffect)(()=>{if(!a)return;let e=!1,s=!1;f["Team ID"]?_!==f["Team ID"]&&(y(f["Team ID"]),e=!0):""!==_&&(y(""),e=!0),f["Key Hash"]?b!==f["Key Hash"]&&(N(f["Key Hash"]),s=!0):f["Key Alias"]?M(f["Key Alias"]):""!==b&&(N(""),s=!0),(e||s)&&p(1)},[f,a,M,_,b]),(0,d.useEffect)(()=>{p(1)},[_,b,o,Z,S,I]),(0,d.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&A(!1),x.current&&!x.current.contains(e.target)&&L(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let D=(0,d.useMemo)(()=>O.data?O.data.filter(e=>{var s,t,l,a,r,i,n;let o=!0,c=!0,d=!0,m=!0,u=!0;if(_){let r="string"==typeof e.before_value?null===(s=JSON.parse(e.before_value))||void 0===s?void 0:s.team_id:null===(t=e.before_value)||void 0===t?void 0:t.team_id,i="string"==typeof e.updated_values?null===(l=JSON.parse(e.updated_values))||void 0===l?void 0:l.team_id:null===(a=e.updated_values)||void 0===a?void 0:a.team_id;o=r===_||i===_}if(b)try{let s="string"==typeof e.before_value?JSON.parse(e.before_value):e.before_value,t="string"==typeof e.updated_values?JSON.parse(e.updated_values):e.updated_values,l=null==s?void 0:s.token,a=null==t?void 0:t.token;c="string"==typeof l&&l.includes(b)||"string"==typeof a&&a.includes(b)}catch(e){c=!1}if(Z&&(d=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(Z.toLowerCase())),"all"!==S&&(m=(null===(i=e.action)||void 0===i?void 0:i.toLowerCase())===S.toLowerCase()),"all"!==I){let s="";switch(I){case"keys":s="litellm_verificationtoken";break;case"teams":s="litellm_teamtable";break;case"users":s="litellm_usertable";break;default:s=I}u=(null===(n=e.table_name)||void 0===n?void 0:n.toLowerCase())===s}return o&&c&&d&&m&&u}):[],[O.data,_,b,Z,S,I]),F=D.length,R=Math.ceil(F/j)||1,q=(0,d.useMemo)(()=>{let e=(h-1)*j,s=e+j;return D.slice(e,s)},[D,h,j]),U=!O.data||0===O.data.length,z=(0,d.useCallback)(e=>{let{row:s}=e;return(0,c.jsx)(e=>{let{rowData:s}=e,{before_value:t,updated_values:l,table_name:a,action:r}=s,i=(e,s)=>{if(!e||0===Object.keys(e).length)return(0,c.jsx)(w.Z,{children:"N/A"});if(s){let s=Object.keys(e),t=["token","spend","max_budget"];if(s.every(e=>t.includes(e))&&s.length>0)return(0,c.jsxs)("div",{children:[s.includes("token")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Token:"})," ",e.token||"N/A"]}),s.includes("spend")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Spend:"})," ",void 0!==e.spend?"$".concat(eR(e.spend,6)):"N/A"]}),s.includes("max_budget")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Max Budget:"})," ",void 0!==e.max_budget?"$".concat(eR(e.max_budget,6)):"N/A"]})]});if(e["No differing fields detected in 'before' state"]||e["No differing fields detected in 'updated' state"]||e["No fields changed"])return(0,c.jsx)(w.Z,{children:e[Object.keys(e)[0]]})}return(0,c.jsx)("pre",{className:"p-2 bg-gray-50 border rounded text-xs overflow-auto max-h-60",children:JSON.stringify(e,null,2)})},n=t,o=l;if(("updated"===r||"rotated"===r)&&t&&l&&("LiteLLM_TeamTable"===a||"LiteLLM_UserTable"===a||"LiteLLM_VerificationToken"===a)){let e={},s={};new Set([...Object.keys(t),...Object.keys(l)]).forEach(a=>{JSON.stringify(t[a])!==JSON.stringify(l[a])&&(t.hasOwnProperty(a)&&(e[a]=t[a]),l.hasOwnProperty(a)&&(s[a]=l[a]))}),Object.keys(t).forEach(a=>{l.hasOwnProperty(a)||e.hasOwnProperty(a)||(e[a]=t[a],s[a]=void 0)}),Object.keys(l).forEach(a=>{t.hasOwnProperty(a)||s.hasOwnProperty(a)||(s[a]=l[a],e[a]=void 0)}),n=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},o=Object.keys(s).length>0?s:{"No differing fields detected in 'updated' state":"N/A"},0===Object.keys(e).length&&0===Object.keys(s).length&&(n={"No fields changed":"N/A"},o={"No fields changed":"N/A"})}return(0,c.jsxs)("div",{className:"-mx-4 p-4 bg-slate-100 border-y border-slate-300 grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Before Value:"}),i(n,"LiteLLM_VerificationToken"===a)]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Updated Value:"}),i(o,"LiteLLM_VerificationToken"===a)]})]})},{rowData:s.original})},[]);if(!i)return(0,c.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,c.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,c.jsx)(w.Z,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,c.jsx)(w.Z,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,c.jsx)("img",{src:ax,alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{console.error("Failed to load audit logs preview image"),e.target.style.display="none"}})]});let V=F>0?(h-1)*j+1:0,K=Math.min(h*j,F);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4"}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,c.jsx)("h1",{className:"text-xl font-semibold py-4",children:"Audit Logs"}),(0,c.jsx)(e=>{let{show:s}=e;return s?(0,c.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start mb-6",children:[(0,c.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Audit Logs Not Available"}),(0,c.jsx)("p",{className:"text-sm text-blue-700 mt-1",children:"To enable audit logging, add the following configuration to your LiteLLM proxy configuration file:"}),(0,c.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"litellm_settings:\n store_audit_logs: true"}),(0,c.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change and proxy restart."})]})]}):null},{show:U}),(0,c.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,c.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)("input",{type:"text",placeholder:"Search by Object ID...",value:Z,onChange:e=>k(e.target.value),className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,c.jsxs)("button",{onClick:()=>{O.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,c.jsx)("svg",{className:"w-4 h-4 ".concat(O.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,c.jsx)("span",{children:"Refresh"})]})]})}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsxs)("div",{className:"relative",ref:u,children:[(0,c.jsx)("label",{htmlFor:"actionFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Action:"}),(0,c.jsxs)("button",{id:"actionFilterDisplay",onClick:()=>A(!E),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,c.jsxs)("span",{children:["all"===S&&"All Actions","created"===S&&"Created","updated"===S&&"Updated","deleted"===S&&"Deleted","rotated"===S&&"Rotated"]}),(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),E&&(0,c.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,c.jsx)("div",{className:"space-y-1",children:[{label:"All Actions",value:"all"},{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}].map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(S===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{C(e.value),A(!1)},children:e.label},e.value))})})]}),(0,c.jsxs)("div",{className:"relative",ref:x,children:[(0,c.jsx)("label",{htmlFor:"tableFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Table:"}),(0,c.jsxs)("button",{id:"tableFilterDisplay",onClick:()=>L(!T),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,c.jsxs)("span",{children:["all"===I&&"All Tables","keys"===I&&"Keys","teams"===I&&"Teams","users"===I&&"Users"]}),(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),T&&(0,c.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,c.jsx)("div",{className:"space-y-1",children:[{label:"All Tables",value:"all"},{label:"Keys",value:"keys"},{label:"Teams",value:"teams"},{label:"Users",value:"users"}].map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(I===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{P(e.value),L(!1)},children:e.label},e.value))})})]}),(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",O.isLoading?"...":V," ","-"," ",O.isLoading?"...":K," ","of"," ",O.isLoading?"...":F," ","results"]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",O.isLoading?"...":h," of"," ",O.isLoading?"...":R]}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.max(1,e-1)),disabled:O.isLoading||1===h,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.min(R,e+1)),disabled:O.isLoading||h===R,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),(0,c.jsx)(t8,{columns:al,data:q,renderSubComponent:z,getRowCanExpand:()=>!0})]})]})}let ap=(e,s,t)=>{if(e)return"".concat(l8()(s).format("MMM D, h:mm A")," - ").concat(l8()(t).format("MMM D, h:mm A"));let l=l8()(),a=l8()(s),r=l.diff(a,"minutes");if(r>=0&&r<2)return"Last 1 Minute";if(r>=2&&r<16)return"Last 15 Minutes";if(r>=16&&r<61)return"Last Hour";let i=l.diff(a,"hours");return i>=1&&i<5?"Last 4 Hours":i>=5&&i<25?"Last 24 Hours":i>=25&&i<169?"Last 7 Days":"".concat(a.format("MMM D")," - ").concat(l.format("MMM D"))};function ag(e){var s,t,l;let{accessToken:a,token:r,userRole:i,userID:n,allTeams:o,premiumUser:m}=e,[u,x]=(0,d.useState)(""),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)(!1),[_,y]=(0,d.useState)(1),[b]=(0,d.useState)(50),N=(0,d.useRef)(null),Z=(0,d.useRef)(null),w=(0,d.useRef)(null),[k,S]=(0,d.useState)(l8()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[C,I]=(0,d.useState)(l8()().format("YYYY-MM-DDTHH:mm")),[P,E]=(0,d.useState)(!1),[A,T]=(0,d.useState)(!1),[L,O]=(0,d.useState)(""),[M,D]=(0,d.useState)(""),[F,R]=(0,d.useState)(""),[q,U]=(0,d.useState)(""),[z,V]=(0,d.useState)(""),[K,B]=(0,d.useState)(null),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)(""),[W,$]=(0,d.useState)(i&&eL.lo.includes(i)),[Q,X]=(0,d.useState)("request logs"),[ee,es]=(0,d.useState)(null),[et,el]=(0,d.useState)(null),ea=(0,h.NL)(),[er,ei]=(0,d.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,d.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(er))},[er]);let[en,eo]=(0,d.useState)({value:24,unit:"hours"});(0,d.useEffect)(()=>{(async()=>{G&&a&&B({...(await (0,g.keyInfoV1Call)(a,G)).info,token:G,api_key:G})})()},[G,a]),(0,d.useEffect)(()=>{function e(e){N.current&&!N.current.contains(e.target)&&v(!1),Z.current&&!Z.current.contains(e.target)&&j(!1),w.current&&!w.current.contains(e.target)&&T(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,d.useEffect)(()=>{i&&eL.lo.includes(i)&&$(!0)},[i]);let ec=(0,sm.a)({queryKey:["logs","table",_,b,k,C,F,q,W?n:null,J,z],queryFn:async()=>{if(!a||!r||!i||!n)return{data:[],total:0,page:1,page_size:b,total_pages:0};let e=l8()(k).utc().format("YYYY-MM-DD HH:mm:ss"),s=P?l8()(C).utc().format("YYYY-MM-DD HH:mm:ss"):l8()().utc().format("YYYY-MM-DD HH:mm:ss"),t=await (0,g.uiSpendLogsCall)(a,q||void 0,F||void 0,void 0,e,s,_,b,W?n:void 0,J,z);return await aa(t.data,e,a,ea),t.data=t.data.map(s=>{let t=ea.getQueryData(["logDetails",s.request_id,e]);return(null==t?void 0:t.messages)&&(null==t?void 0:t.response)&&(s.messages=t.messages,s.response=t.response),s}),t},enabled:!!a&&!!r&&!!i&&!!n&&"request logs"===Q,refetchInterval:!!er&&1===_&&15e3,refetchIntervalInBackground:!0}),{filters:ed,filteredLogs:em,allTeams:eu,allKeyAliases:ex,handleFilterChange:eh,handleFilterReset:ep}=function(e){let{logs:s,accessToken:t,startTime:l,endTime:a,pageSize:r=25,isCustomDate:i,setCurrentPage:n,userID:o,userRole:c}=e,m=(0,d.useMemo)(()=>({[au.TEAM_ID]:"",[au.KEY_HASH]:"",[au.REQUEST_ID]:"",[au.MODEL]:"",[au.USER_ID]:"",[au.END_USER]:"",[au.STATUS]:"",[au.KEY_ALIAS]:""}),[]),[u,x]=(0,d.useState)(m),[h,p]=(0,d.useState)(s),j=(0,d.useRef)(0),f=(0,d.useCallback)(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t)return;let n=Date.now();j.current=n;let o=l8()(l).utc().format("YYYY-MM-DD HH:mm:ss"),c=i?l8()(a).utc().format("YYYY-MM-DD HH:mm:ss"):l8()().utc().format("YYYY-MM-DD HH:mm:ss");try{let l=await (0,g.uiSpendLogsCall)(t,e[au.KEY_HASH]||void 0,e[au.TEAM_ID]||void 0,e[au.REQUEST_ID]||void 0,o,c,s,r,e[au.USER_ID]||void 0,e[au.END_USER]||void 0,e[au.STATUS]||void 0,e[au.MODEL]||void 0);n===j.current&&l.data&&p(l)}catch(e){console.error("Error searching users:",e)}},[t,l,a,i,r]),v=(0,d.useMemo)(()=>eT()((e,s)=>f(e,s),300),[f]);(0,d.useEffect)(()=>()=>v.cancel(),[v]);let _=(0,sm.a)({queryKey:["allKeys"],queryFn:async()=>{if(!t)throw Error("Access token required");return await su(t)},enabled:!!t}).data||[];(0,d.useEffect)(()=>{if(!s||!s.data){p({data:[],total:0,page:1,page_size:50,total_pages:0});return}let e=[...s.data];if(u[au.TEAM_ID]&&(e=e.filter(e=>e.team_id===u[au.TEAM_ID])),u[au.STATUS]&&(e=e.filter(e=>"success"===u[au.STATUS]?!e.status||"success"===e.status:e.status===u[au.STATUS])),u[au.MODEL]&&(e=e.filter(e=>e.model===u[au.MODEL])),u[au.KEY_HASH]&&(e=e.filter(e=>e.api_key===u[au.KEY_HASH])),u[au.END_USER]&&(e=e.filter(e=>e.end_user===u[au.END_USER])),u[au.KEY_ALIAS])try{let s=u[au.KEY_ALIAS];s&&(e=e.filter(e=>{var t;return(null===(t=e.metadata)||void 0===t?void 0:t.user_api_key_alias)===s}))}catch(e){console.error("Error fetching key info for alias:",e)}let t={data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages};JSON.stringify(t)!==JSON.stringify(h)&&p(t)},[s,u,h,t]);let{data:y}=(0,sm.a)({queryKey:["allTeamsForLogFilters",t],queryFn:async()=>t&&await sx(t)||[],enabled:!!t});return{filters:u,filteredLogs:h,allKeyAliases:_,allTeams:y,handleFilterChange:e=>{x(s=>{let t={...s,...e};for(let e of Object.keys(m))e in t||(t[e]=m[e]);return JSON.stringify(t)!==JSON.stringify(s)&&(n(1),v(t,1)),t})},handleFilterReset:()=>{x(m),v(m,1)}}}({logs:ec.data||{data:[],total:0,page:1,page_size:b||10,total_pages:1},accessToken:a,startTime:k,endTime:C,pageSize:b,isCustomDate:P,setCurrentPage:y,userID:n,userRole:i}),eg=(0,d.useCallback)(async e=>{if(a)try{let s=(await (0,g.keyListCall)(a,null,null,e,null,null,_,b)).keys.find(s=>s.key_alias===e);s&&U(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[a,_,b]);(0,d.useEffect)(()=>{a&&(ed["Team ID"]?R(ed["Team ID"]):R(""),Y(ed.Status||""),V(ed.Model||""),ed["Key Hash"]?U(ed["Key Hash"]):ed["Key Alias"]?eg(ed["Key Alias"]):U(""))},[ed,a,eg]);let ej=(0,sm.a)({queryKey:["sessionLogs",et],queryFn:async()=>{if(!a||!et)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,g.sessionSpendLogsCall)(a,et);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!a&&!!et});if((0,d.useEffect)(()=>{var e;(null===(e=ec.data)||void 0===e?void 0:e.data)&&ee&&!ec.data.data.some(e=>e.request_id===ee)&&es(null)},[null===(s=ec.data)||void 0===s?void 0:s.data,ee]),!a||!r||!i||!n)return null;let ef=em.data.filter(e=>!u||e.request_id.includes(u)||e.model.includes(u)||e.user&&e.user.includes(u)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>H(e),onSessionClick:e=>{e&&el(e)}}))||[],ev=(null===(l=ej.data)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.map(e=>({...e,onKeyHashClick:e=>H(e),onSessionClick:e=>{}})))||[],e_=[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>o&&0!==o.length?o.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",isSearchable:!1},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>a?(await su(a)).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e})):[]},{name:"End User",label:"End User",isSearchable:!0,searchFn:async e=>{if(!a)return[];let s=await (0,g.allEndUsersCall)(a);return((null==s?void 0:s.end_users)||[]).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Key Hash",label:"Key Hash",isSearchable:!1}];if(et&&ej.data)return(0,c.jsx)("div",{className:"w-full p-6",children:(0,c.jsx)(ac,{sessionId:et,logs:ej.data.data,onBack:()=>el(null)})});let ey=[{label:"Last 15 Minutes",value:15,unit:"minutes"},{label:"Last Hour",value:1,unit:"hours"},{label:"Last 4 Hours",value:4,unit:"hours"},{label:"Last 24 Hours",value:24,unit:"hours"},{label:"Last 7 Days",value:7,unit:"days"}],eb=ey.find(e=>e.value===en.value&&e.unit===en.unit),eN=P?ap(P,k,C):null==eb?void 0:eb.label;return(0,c.jsx)("div",{className:"w-full p-6",children:(0,c.jsxs)(e$.Z,{defaultIndex:0,onIndexChange:e=>X(0===e?"request logs":"audit logs"),children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(eW.Z,{children:"Request Logs"}),(0,c.jsx)(eW.Z,{children:"Audit Logs"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,c.jsx)("h1",{className:"text-xl font-semibold",children:et?(0,c.jsxs)(c.Fragment,{children:["Session: ",(0,c.jsx)("span",{className:"font-mono",children:et}),(0,c.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>el(null),children:"← Back to All Logs"})]}):"Request Logs"})}),K&&G&&K.api_key===G?(0,c.jsx)(so,{keyId:G,keyData:K,accessToken:a,userID:n,userRole:i,teams:o,onClose:()=>H(null),premiumUser:m}):et?(0,c.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,c.jsx)(t8,{columns:as,data:ev,renderSubComponent:aj,getRowCanExpand:()=>!0})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sd,{options:e_,onApplyFilters:eh,onResetFilters:ep}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:u,onChange:e=>x(e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsxs)("div",{className:"relative",ref:w,children:[(0,c.jsxs)("button",{onClick:()=>T(!A),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),eN]}),A&&(0,c.jsx)("div",{className:"absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,c.jsxs)("div",{className:"space-y-1",children:[ey.map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eN===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{I(l8()().format("YYYY-MM-DDTHH:mm")),S(l8()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eo({value:e.value,unit:e.unit}),E(!1),T(!1)},children:e.label},e.label)),(0,c.jsx)("div",{className:"border-t my-2"}),(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(P?"bg-blue-50 text-blue-600":""),onClick:()=>E(!P),children:"Custom Range"})]})})]}),(0,c.jsx)(()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,c.jsx)(tT.Z,{color:"green",checked:er,defaultChecked:!0,onChange:ei})]}),{}),(0,c.jsxs)("button",{onClick:()=>{ec.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,c.jsx)("svg",{className:"w-4 h-4 ".concat(ec.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,c.jsx)("span",{children:"Refresh"})]})]}),P&&(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{children:(0,c.jsx)("input",{type:"datetime-local",value:k,onChange:e=>{S(e.target.value),y(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,c.jsx)("span",{className:"text-gray-500",children:"to"}),(0,c.jsx)("div",{children:(0,c.jsx)("input",{type:"datetime-local",value:C,onChange:e=>{I(e.target.value),y(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",ec.isLoading?"...":em?(_-1)*b+1:0," ","-"," ",ec.isLoading?"...":em?Math.min(_*b,em.total):0," ","of"," ",ec.isLoading?"...":em?em.total:0," ","results"]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",ec.isLoading?"...":_," of"," ",ec.isLoading?"...":em?em.total_pages:1]}),(0,c.jsx)("button",{onClick:()=>y(e=>Math.max(1,e-1)),disabled:ec.isLoading||1===_,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>y(e=>Math.min(em.total_pages||1,e+1)),disabled:ec.isLoading||_===(em.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),er&&1===_&&(0,c.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-greem-200 rounded-md flex items-center justify-between",children:[(0,c.jsx)("div",{className:"flex items-center gap-2",children:(0,c.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,c.jsx)("button",{onClick:()=>ei(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,c.jsx)(t8,{columns:as,data:ef,renderSubComponent:aj,getRowCanExpand:()=>!0})]})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(ah,{userID:n,userRole:i,token:r,accessToken:a,isActive:"audit logs"===Q,premiumUser:m,allTeams:o})})]})]})})}function aj(e){var s,t,l,a,r;let{row:i}=e,n=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},o=i.original.metadata||{},d="failure"===o.status,m=d?o.error_information:null,u=i.original.messages&&(Array.isArray(i.original.messages)?i.original.messages.length>0:Object.keys(i.original.messages).length>0),x=i.original.response&&Object.keys(n(i.original.response)).length>0,h=o.vector_store_request_metadata&&Array.isArray(o.vector_store_request_metadata)&&o.vector_store_request_metadata.length>0,p=i.original.metadata&&i.original.metadata.guardrail_information,g=p&&(null===(r=i.original.metadata)||void 0===r?void 0:r.guardrail_information.masked_entity_count)?Object.values(i.original.metadata.guardrail_information.masked_entity_count).reduce((e,s)=>e+("number"==typeof s?s:0),0):0;return(0,c.jsxs)("div",{className:"p-6 bg-gray-50 space-y-6",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"p-4 border-b",children:(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request Details"})}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 p-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Request ID:"}),(0,c.jsx)("span",{className:"font-mono text-sm",children:i.original.request_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Model:"}),(0,c.jsx)("span",{children:i.original.model})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Model ID:"}),(0,c.jsx)("span",{children:i.original.model_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Call Type:"}),(0,c.jsx)("span",{children:i.original.call_type})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,c.jsx)("span",{children:i.original.custom_llm_provider||"-"})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"API Base:"}),(0,c.jsx)(z.Z,{title:i.original.api_base||"-",children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:i.original.api_base||"-"})})]}),(null==i?void 0:null===(s=i.original)||void 0===s?void 0:s.requester_ip_address)&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"IP Address:"}),(0,c.jsx)("span",{children:null==i?void 0:null===(t=i.original)||void 0===t?void 0:t.requester_ip_address})]}),p&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail:"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-mono",children:i.original.metadata.guardrail_information.guardrail_name}),g>0&&(0,c.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[g," masked"]})]})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Tokens:"}),(0,c.jsxs)("span",{children:[i.original.total_tokens," (",i.original.prompt_tokens,"+",i.original.completion_tokens,")"]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Cost:"}),(0,c.jsxs)("span",{children:["$",eR(i.original.spend||0,6)]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Cache Hit:"}),(0,c.jsx)("span",{children:i.original.cache_hit})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat("failure"!==((null===(l=i.original.metadata)||void 0===l?void 0:l.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(a=i.original.metadata)||void 0===a?void 0:a.status)||"Success").toLowerCase()?"Success":"Failure"})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:i.original.startTime})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:i.original.endTime})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsxs)("span",{children:[i.original.duration," s."]})]})]})]})]}),(0,c.jsx)(an,{show:!u&&!x}),(0,c.jsx)(ar,{row:i,hasMessages:u,hasResponse:x,hasError:d,errorInfo:m,getRawRequest:()=>{var e;return(null===(e=i.original)||void 0===e?void 0:e.proxy_server_request)?n(i.original.proxy_server_request):n(i.original.messages)},formattedResponse:()=>d&&m?{error:{message:m.error_message||"An error occurred",type:m.error_class||"error",code:m.error_code||"unknown",param:null}}:n(i.original.response)}),p&&(0,c.jsx)(am,{data:i.original.metadata.guardrail_information}),h&&(0,c.jsx)(ad,{data:o.vector_store_request_metadata}),d&&m&&(0,c.jsx)(ai,{errorInfo:m}),i.original.request_tags&&Object.keys(i.original.request_tags).length>0&&(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"flex justify-between items-center p-4 border-b",children:(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request Tags"})}),(0,c.jsx)("div",{className:"p-4",children:(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(i.original.request_tags).map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[s,": ",String(t)]},s)})})})]}),i.original.metadata&&Object.keys(i.original.metadata).length>0&&(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Metadata"}),(0,c.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(i.original.metadata,null,2))},className:"p-1 hover:bg-gray-200 rounded",title:"Copy metadata",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-64",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(i.original.metadata,null,2)})})]})]})}var af=t(36172),av=t(14042),a_=e=>{let{userID:s,userRole:t,accessToken:l,userSpend:a,userMaxBudget:r,selectedTeam:i}=e;console.log("userSpend: ".concat(a));let[n,o]=(0,d.useState)(null!==a?a:0),[m,u]=(0,d.useState)(i?Number(eR(i.max_budget,4)):null);(0,d.useEffect)(()=>{if(i){if("Default Team"===i.team_alias)u(r);else{let e=!1;if(i.team_memberships)for(let t of i.team_memberships)t.user_id===s&&"max_budget"in t.litellm_budget_table&&null!==t.litellm_budget_table.max_budget&&(u(t.litellm_budget_table.max_budget),e=!0);e||u(i.max_budget)}}},[i,r]);let[x,h]=(0,d.useState)([]);(0,d.useEffect)(()=>{let e=async()=>{if(!l||!s||!t)return};(async()=>{try{if(null===s||null===t)return;if(null!==l){let e=(await (0,g.modelAvailableCall)(l,s,t)).data.map(e=>e.id);console.log("available_model_names:",e),h(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[t,l,s]),(0,d.useEffect)(()=>{null!==a&&o(a)},[a]);let p=[];i&&i.models&&(p=i.models),p&&p.includes("all-proxy-models")?(console.log("user models:",x),p=x):p&&p.includes("all-team-models")?p=i.models:p&&0===p.length&&(p=x);let j=null!==m?"$".concat(eR(Number(m),4)," limit"):"No limit",f=void 0!==n?eR(n,4):null;return console.log("spend in view user spend: ".concat(n)),(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,c.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",f]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,c.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:j})]})]})})};let ay=e=>{let{key:s,info:t}=e;return{token:s,...t}};var ab=e=>{let{topKeys:s,accessToken:t,userID:l,userRole:a,teams:r,premiumUser:i}=e,[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(null),[x,h]=(0,d.useState)(void 0),[p,j]=(0,d.useState)("table"),f=async e=>{if(t)try{let s=await (0,g.keyInfoV1Call)(t,e.api_key),l=ay(s);h(l),u(e.api_key),o(!0)}catch(e){console.error("Error fetching key info:",e)}},v=()=>{o(!1),u(null),h(void 0)};d.useEffect(()=>{let e=e=>{"Escape"===e.key&&n&&v()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n]);let y=s.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{onClick:()=>j("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===p?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,c.jsx)("button",{onClick:()=>j("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===p?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===p?(0,c.jsx)("div",{className:"relative",children:(0,c.jsx)(sQ.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:y,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat(eR(e,2)):"No Key Alias",onValueChange:e=>f(e),showTooltip:!0,customTooltip:e=>{var s,t;let l=null===(t=e.payload)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.payload;return(0,c.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,c.jsxs)("div",{className:"space-y-1.5",children:[(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,c.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==l?void 0:l.key_alias})]}),(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,c.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==l?void 0:l.api_key})]}),(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,c.jsxs)("span",{className:"text-white font-medium",children:["$",eR(null==l?void 0:l.spend,2)]})]})]})})}})}):(0,c.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,c.jsx)(t8,{columns:[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.getValue(),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>f(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>"$".concat(eR(e.getValue(),2))}],data:s,renderSubComponent:()=>(0,c.jsx)(c.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),n&&m&&x&&(console.log("Rendering modal with:",{isModalOpen:n,selectedKey:m,keyData:x}),(0,c.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&v()},children:(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,c.jsx)("button",{onClick:v,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,c.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,c.jsx)("div",{className:"p-6 h-full",children:(0,c.jsx)(so,{keyId:m,onClose:v,keyData:x,accessToken:t,userID:l,userRole:a,teams:r,premiumUser:i})})]})}))]})};function aN(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function aZ(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let aw={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6"},ak=e=>{let{active:s,payload:t,label:l}=e;if(s&&t&&t.length){let e=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),s=(e,s)=>{let t=s.substring(s.indexOf(".")+1);if(e.metrics&&t in e.metrics)return e.metrics[t]};return(0,c.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,c.jsx)("p",{className:"text-tremor-content-strong",children:l}),t.map(t=>{var l;let a=null===(l=t.dataKey)||void 0===l?void 0:l.toString();if(!a||!t.payload)return null;let r=s(t.payload,a),i=a.includes("spend"),n=void 0!==r?i?"$".concat(r.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})):r.toLocaleString():"N/A",o=aw[t.color]||t.color;return(0,c.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:o}}),(0,c.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:e(a)})]}),(0,c.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:n})]},a)})]})}return null},aS=e=>{let{categories:s,colors:t}=e,l=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return(0,c.jsx)("div",{className:"flex items-center justify-end space-x-4",children:s.map((e,s)=>{let a=aw[t[s]]||t[s];return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:a}}),(0,c.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:l(e)})]},e)})})},aC=e=>{var s,t;let{modelName:l,metrics:a}=e;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)(v.Z,{numItems:4,className:"gap-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(k.Z,{children:a.total_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Successful Requests"}),(0,c.jsx)(k.Z,{children:a.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(k.Z,{children:a.total_tokens.toLocaleString()}),(0,c.jsxs)(w.Z,{children:[Math.round(a.total_tokens/a.total_successful_requests)," ","avg per successful request"]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Spend"}),(0,c.jsxs)(k.Z,{children:["$",eR(a.total_spend,2)]}),(0,c.jsxs)(w.Z,{children:["$",eR(a.total_spend/a.total_successful_requests,3)," ","per successful request"]})]})]}),a.top_api_keys&&a.top_api_keys.length>0&&(0,c.jsxs)(X.Z,{className:"mt-4",children:[(0,c.jsx)(k.Z,{children:"Top API Keys by Spend"}),(0,c.jsx)("div",{className:"mt-3",children:(0,c.jsx)("div",{className:"grid grid-cols-1 gap-2",children:a.top_api_keys.map((e,s)=>(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:e.key_alias||"".concat(e.api_key.substring(0,10),"...")}),e.team_id&&(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,c.jsxs)("div",{className:"text-right",children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["$",eR(e.spend,2)]}),(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(aS,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:aN,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Requests per day"}),(0,c.jsx)(aS,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,c.jsx)(sQ.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:aN,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Spend per day"}),(0,c.jsx)(aS,{categories:["metrics.spend"],colors:["green"]})]}),(0,c.jsx)(sQ.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:aZ,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Success vs Failed Requests"}),(0,c.jsx)(aS,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:aN,stack:!0,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Prompt Caching Metrics"}),(0,c.jsx)(aS,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,c.jsxs)("div",{className:"mb-2",children:[(0,c.jsxs)(w.Z,{children:["Cache Read:"," ",(null===(s=a.total_cache_read_input_tokens)||void 0===s?void 0:s.toLocaleString())||0," ","tokens"]}),(0,c.jsxs)(w.Z,{children:["Cache Creation:"," ",(null===(t=a.total_cache_creation_input_tokens)||void 0===t?void 0:t.toLocaleString())||0," ","tokens"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:aN,customTooltip:ak,showLegend:!1})]})]})]})},aI=e=>{let{modelMetrics:s}=e,t=Object.keys(s).sort((e,t)=>""===e?1:""===t?-1:s[t].total_spend-s[e].total_spend),l={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(s).forEach(e=>{l.total_requests+=e.total_requests,l.total_successful_requests+=e.total_successful_requests,l.total_tokens+=e.total_tokens,l.total_spend+=e.total_spend,l.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,l.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{l.daily_data[e.date]||(l.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),l.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,l.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,l.daily_data[e.date].total_tokens+=e.metrics.total_tokens,l.daily_data[e.date].api_requests+=e.metrics.api_requests,l.daily_data[e.date].spend+=e.metrics.spend,l.daily_data[e.date].successful_requests+=e.metrics.successful_requests,l.daily_data[e.date].failed_requests+=e.metrics.failed_requests,l.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,l.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let a=Object.entries(l.daily_data).map(e=>{let[s,t]=e;return{date:s,metrics:t}}).sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime());return(0,c.jsxs)("div",{className:"space-y-8",children:[(0,c.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,c.jsx)(k.Z,{children:"Overall Usage"}),(0,c.jsxs)(v.Z,{numItems:4,className:"gap-4 mb-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(k.Z,{children:l.total_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Successful Requests"}),(0,c.jsx)(k.Z,{children:l.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(k.Z,{children:l.total_tokens.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Spend"}),(0,c.jsxs)(k.Z,{children:["$",eR(l.total_spend,2)]})]})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Tokens Over Time"}),(0,c.jsx)(aS,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:aN,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Requests Over Time"}),(0,c.jsx)(aS,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:aN,stack:!0,customTooltip:ak,showLegend:!1})]})]})]}),(0,c.jsx)(th.default,{defaultActiveKey:t[0],children:t.map(e=>(0,c.jsx)(th.default.Panel,{header:(0,c.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,c.jsx)(k.Z,{children:s[e].label||"Unknown Item"}),(0,c.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,c.jsxs)("span",{children:["$",eR(s[e].total_spend,2)]}),(0,c.jsxs)("span",{children:[s[e].total_requests.toLocaleString()," ","requests"]})]})]}),children:(0,c.jsx)(aC,{modelName:e||"Unknown Model",metrics:s[e]})},e))})]})},aP=(e,s)=>{let t=e.metadata.key_alias||"key-hash-".concat(s),l=e.metadata.team_id;return l?"".concat(t," (team_id: ").concat(l,")"):t},aE=(e,s)=>{let t={};return e.results.forEach(e=>{Object.entries(e.breakdown[s]||{}).forEach(l=>{let[a,r]=l;t[a]||(t[a]={label:"api_keys"===s?aP(r,a):a,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],daily_data:[]}),t[a].total_requests+=r.metrics.api_requests,t[a].prompt_tokens+=r.metrics.prompt_tokens,t[a].completion_tokens+=r.metrics.completion_tokens,t[a].total_tokens+=r.metrics.total_tokens,t[a].total_spend+=r.metrics.spend,t[a].total_successful_requests+=r.metrics.successful_requests,t[a].total_failed_requests+=r.metrics.failed_requests,t[a].total_cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,t[a].total_cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0,t[a].daily_data.push({date:e.date,metrics:{prompt_tokens:r.metrics.prompt_tokens,completion_tokens:r.metrics.completion_tokens,total_tokens:r.metrics.total_tokens,api_requests:r.metrics.api_requests,spend:r.metrics.spend,successful_requests:r.metrics.successful_requests,failed_requests:r.metrics.failed_requests,cache_read_input_tokens:r.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:r.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==s&&Object.entries(t).forEach(l=>{let[a,r]=l,i={};e.results.forEach(e=>{var t;let l=null===(t=e.breakdown[s])||void 0===t?void 0:t[a];l&&"api_key_breakdown"in l&&Object.entries(l.api_key_breakdown||{}).forEach(e=>{let[s,t]=e;i[s]||(i[s]={api_key:s,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),i[s].spend+=t.metrics.spend,i[s].requests+=t.metrics.api_requests,i[s].tokens+=t.metrics.total_tokens})}),t[a].top_api_keys=Object.values(i).sort((e,s)=>s.spend-e.spend).slice(0,5)}),Object.values(t).forEach(e=>{e.daily_data.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime())}),t};var aA=e=>{let{accessToken:s,entityType:t,entityId:l,userID:a,userRole:r,entityList:i,premiumUser:n}=e,[o,m]=(0,d.useState)({results:[],metadata:{total_spend:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0}}),u=aE(o,"models"),x=aE(o,"api_keys"),[h,p]=(0,d.useState)([]),[j,_]=(0,d.useState)({from:new Date(Date.now()-24192e5),to:new Date}),y=async()=>{if(!s||!j.from||!j.to)return;let e=new Date(j.from),l=new Date(j.to);if("tag"===t)m(await (0,g.tagDailyActivityCall)(s,e,l,1,h.length>0?h:null));else if("team"===t)m(await (0,g.teamDailyActivityCall)(s,e,l,1,h.length>0?h:null));else throw Error("Invalid entity type")};(0,d.useEffect)(()=>{y()},[s,j,l,h]);let b=()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=l.metrics.spend,e[t].requests+=l.metrics.api_requests,e[t].successful_requests+=l.metrics.successful_requests,e[t].failed_requests+=l.metrics.failed_requests,e[t].tokens+=l.metrics.total_tokens}catch(e){console.error("Error processing provider ".concat(t,": ").concat(e))}})}),Object.values(e).filter(e=>e.spend>0).sort((e,s)=>s.spend-e.spend)},N=e=>0===h.length?e:e.filter(e=>h.includes(e.metadata.id)),Z=()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.entities||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:l.metadata.team_alias||t,id:t}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.total_tokens+=l.metrics.total_tokens})}),N(Object.values(e).sort((e,s)=>s.metrics.spend-e.metrics.spend))};return(0,c.jsxs)("div",{style:{width:"100%"},children:[(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full mb-4",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:j,onValueChange:_})}),i&&i.length>0&&(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(w.Z,{children:["Filter by ","tag"===t?"Tags":"Teams"]}),(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select ".concat("tag"===t?"tags":"teams"," to filter..."),value:h,onChange:p,options:(()=>{if(i)return i})(),className:"mt-2",allowClear:!0})]})]}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eW.Z,{children:"Cost"}),(0,c.jsx)(eW.Z,{children:"Model Activity"}),(0,c.jsx)(eW.Z,{children:"Key Activity"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full",children:[(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(k.Z,{children:["tag"===t?"Tag":"Team"," Spend Overview"]}),(0,c.jsxs)(v.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Spend"}),(0,c.jsxs)(w.Z,{className:"text-2xl font-bold mt-2",children:["$",eR(o.metadata.total_spend,2)]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:o.metadata.total_api_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Successful Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:o.metadata.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Failed Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:o.metadata.total_failed_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:o.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend"}),(0,c.jsx)(sQ.Z,{data:[...o.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aZ,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:l}=e;if(!l||!(null==s?void 0:s[0]))return null;let a=s[0].payload,r=Object.keys(a.breakdown.entities||{}).length;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:a.date}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",eR(a.metrics.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",a.metrics.api_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Successful: ",a.metrics.successful_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Failed: ",a.metrics.failed_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",a.metrics.total_tokens]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["tag"===t?"Total Tags":"Total Teams",": ",r]}),(0,c.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,c.jsxs)("p",{className:"font-semibold",children:["Spend by ","tag"===t?"Tag":"Team",":"]}),Object.entries(a.breakdown.entities||{}).sort((e,s)=>{let[,t]=e,[,l]=s,a=t.metrics.spend;return l.metrics.spend-a}).slice(0,5).map(e=>{let[s,t]=e;return(0,c.jsxs)("p",{className:"text-sm text-gray-600",children:[t.metadata.team_alias||s,": $",eR(t.metrics.spend,2)]},s)}),r>5&&(0,c.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",r-5," more"]})]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,c.jsxs)(k.Z,{children:["Spend Per ","tag"===t?"Tag":"Team"]}),(0,c.jsx)(sL.Z,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,c.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,c.jsxs)("span",{children:["Get Started by Tracking cost per ",t," "]}),(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-6",children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(sQ.Z,{className:"mt-4 h-52",data:Z().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?"".concat(e.metadata.alias.slice(0,15),"..."):e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aZ,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.metadata.alias}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eR(l.metrics.spend,4)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Requests:"," ",l.metrics.api_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-green-600",children:["Successful:"," ",l.metrics.successful_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-red-600",children:["Failed:"," ",l.metrics.failed_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens:"," ",l.metrics.total_tokens.toLocaleString()]})]})}})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"tag"===t?"Tag":"Team"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sN.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sN.Z,{children:"Tokens"})]})}),(0,c.jsx)(s_.Z,{children:Z().filter(e=>e.metrics.spend>0).map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.metadata.alias}),(0,c.jsxs)(sy.Z,{children:["$",eR(e.metrics.spend,4)]}),(0,c.jsx)(sy.Z,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ab,{topKeys:(()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:l.metadata.key_alias,team_id:l.metadata.team_id||null}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:s,userID:a,userRole:r,teams:null,premiumUser:n})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Top Models"}),(0,c.jsx)(sQ.Z,{className:"mt-4 h-40",data:(()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=l.metrics.spend}catch(e){console.error("Error adding spend for ".concat(t,": ").concat(e,", got metrics: ").concat(JSON.stringify(l)))}e[t].requests+=l.metrics.api_requests,e[t].successful_requests+=l.metrics.successful_requests,e[t].failed_requests+=l.metrics.failed_requests,e[t].tokens+=l.metrics.total_tokens})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,...t}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"display_key",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$".concat(eR(e,2)),layout:"vertical",yAxisWidth:200,showLegend:!1})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsx)(k.Z,{children:"Provider Usage"}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(av.Z,{className:"mt-4 h-40",data:b(),index:"provider",category:"spend",valueFormatter:e=>"$".concat(eR(e,2)),colors:["cyan","blue","indigo","violet","purple"]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Provider"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sN.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sN.Z,{children:"Tokens"})]})}),(0,c.jsx)(s_.Z,{children:b().map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.provider}),(0,c.jsxs)(sy.Z,{children:["$",eR(e.spend,2)]}),(0,c.jsx)(sy.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:u})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:x})})]})]})]})},aT=e=>{let{isOpen:s,onClose:t,accessToken:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)("cloudzero"),[p,g]=(0,d.useState)(!1);(0,d.useEffect)(()=>{s&&l&&j()},[s,l]);let j=async()=>{u(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"}});if(e.ok){let s=await e.json();o(s),a.setFieldsValue({connection_id:s.connection_id})}else if(404!==e.status){let s=await e.json();P.ZP.error("Failed to load existing settings: ".concat(s.error||"Unknown error"))}}catch(e){console.error("Error loading CloudZero settings:",e),P.ZP.error("Failed to load existing settings")}finally{u(!1)}},f=async e=>{if(!l){P.ZP.error("No access token available");return}i(!0);try{let s={...e,timezone:"UTC"},t=await fetch(n?"/cloudzero/settings":"/cloudzero/init",{method:n?"PUT":"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(t.ok)return P.ZP.success(a.message||"CloudZero settings saved successfully"),o({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return P.ZP.error(a.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),P.ZP.error("Failed to save CloudZero settings"),!1}finally{i(!1)}},v=async()=>{if(!l){P.ZP.error("No access token available");return}g(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),s=await e.json();e.ok?(P.ZP.success(s.message||"Export to CloudZero completed successfully"),t()):P.ZP.error(s.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),P.ZP.error("Failed to export to CloudZero")}finally{g(!1)}},b=async()=>{g(!0);try{P.ZP.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),P.ZP.error("Failed to export CSV")}finally{g(!1)}},N=async()=>{if("cloudzero"===x){if(!n){let e=await a.validateFields();if(!await f(e))return}await v()}else await b()},Z=()=>{a.resetFields(),h("cloudzero"),o(null),t()},k=[{value:"cloudzero",label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,c.jsx)("span",{children:"Export to CSV"})]})}];return(0,c.jsx)(E.Z,{title:"Export Data",open:s,onCancel:Z,footer:null,width:600,destroyOnClose:!0,children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,c.jsx)(C.default,{value:x,onChange:h,options:k,className:"w-full",size:"large"})]}),"cloudzero"===x&&(0,c.jsx)("div",{children:m?(0,c.jsx)("div",{className:"flex justify-center py-8",children:(0,c.jsx)(lu.Z,{size:"large"})}):(0,c.jsxs)(c.Fragment,{children:[n&&(0,c.jsx)(lZ.Z,{title:"Existing CloudZero Configuration",icon:()=>(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,c.jsxs)(w.Z,{children:["API Key: ",n.api_key_masked,(0,c.jsx)("br",{}),"Connection ID: ",n.connection_id]})}),!n&&(0,c.jsxs)(I.Z,{form:a,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,c.jsx)(y.Z,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,c.jsx)(I.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===x&&(0,c.jsx)(lZ.Z,{title:"CSV Export",icon:()=>(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,c.jsx)(w.Z,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:Z,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:N,loading:r||p,disabled:r||p,children:"cloudzero"===x?"Export to CloudZero":"Export CSV"})]})]})})},aL=e=>{var s,t,l,a,r,i,n,o,m,u;let{accessToken:x,userRole:h,userID:p,teams:j,premiumUser:_}=e,[y,b]=(0,d.useState)({results:[],metadata:{}}),[N,Z]=(0,d.useState)({from:new Date(Date.now()-24192e5),to:new Date}),[S,C]=(0,d.useState)([]),[I,P]=(0,d.useState)("groups"),[E,A]=(0,d.useState)(!1),T=async()=>{x&&C(Object.values(await (0,g.tagListCall)(x)).map(e=>({label:e.name,value:e.name})))};(0,d.useEffect)(()=>{T()},[x]);let L=(null===(s=y.metadata)||void 0===s?void 0:s.total_spend)||0,O=()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{provider:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}})},M=async()=>{if(!x||!N.from||!N.to)return;let e=new Date(N.from),s=new Date(N.to);try{let t=await (0,g.userDailyActivityCall)(x,e,s);if(t.metadata.total_pages>10)throw Error("Too many pages of data (>10). Please select a smaller date range.");if(t.metadata.total_pages<=1){b(t);return}let l=[...t.results],a={...t.metadata};for(let r=2;r<=t.metadata.total_pages;r++){let t=await (0,g.userDailyActivityCall)(x,e,s,r);l.push(...t.results),t.metadata&&(a.total_spend+=t.metadata.total_spend||0,a.total_api_requests+=t.metadata.total_api_requests||0,a.total_successful_requests+=t.metadata.total_successful_requests||0,a.total_failed_requests+=t.metadata.total_failed_requests||0,a.total_tokens+=t.metadata.total_tokens||0)}b({results:l,metadata:a})}catch(e){throw console.error("Error fetching user spend data:",e),e}};(0,d.useEffect)(()=>{M()},[x,N]);let D=aE(y,"models"),F=aE(y,"api_keys"),R=aE(y,"mcp_servers");return(0,c.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"solid",className:"mt-1",children:[eL.ZL.includes(h||"")?(0,c.jsx)(eW.Z,{children:"Global Usage"}):(0,c.jsx)(eW.Z,{children:"Your Usage"}),(0,c.jsx)(eW.Z,{children:"Team Usage"}),eL.ZL.includes(h||"")?(0,c.jsx)(eW.Z,{children:"Tag Usage"}):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(v.Z,{numItems:2,className:"gap-2 w-full mb-4",children:(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:N,onValueChange:e=>{Z(e)}})})}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eW.Z,{children:"Cost"}),(0,c.jsx)(eW.Z,{children:"Model Activity"}),(0,c.jsx)(eW.Z,{children:"Key Activity"}),(0,c.jsx)(eW.Z,{children:"MCP Server Activity"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(w.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend"," ",new Date().toLocaleString("default",{month:"long"})," ","1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,c.jsx)(a_,{userID:p,userRole:h,accessToken:x,userSpend:L,selectedTeam:null,userMaxBudget:null})]}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Usage Metrics"}),(0,c.jsxs)(v.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:(null===(l=y.metadata)||void 0===l?void 0:null===(t=l.total_api_requests)||void 0===t?void 0:t.toLocaleString())||0})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Successful Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:(null===(r=y.metadata)||void 0===r?void 0:null===(a=r.total_successful_requests)||void 0===a?void 0:a.toLocaleString())||0})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Failed Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:(null===(n=y.metadata)||void 0===n?void 0:null===(i=n.total_failed_requests)||void 0===i?void 0:i.toLocaleString())||0})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:(null===(m=y.metadata)||void 0===m?void 0:null===(o=m.total_tokens)||void 0===o?void 0:o.toLocaleString())||0})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Average Cost per Request"}),(0,c.jsxs)(w.Z,{className:"text-2xl font-bold mt-2",children:["$",eR((L||0)/((null===(u=y.metadata)||void 0===u?void 0:u.total_api_requests)||1),4)]})]})]})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend"}),(0,c.jsx)(sQ.Z,{data:[...y.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aZ,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.date}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eR(l.metrics.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Requests: ",l.metrics.api_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Successful: ",l.metrics.successful_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Failed: ",l.metrics.failed_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",l.metrics.total_tokens]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ab,{topKeys:(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:l.metadata.key_alias,team_id:null}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:x,userID:p,userRole:h,teams:null,premiumUser:_})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"groups"===I?"Top Public Model Names":"Top Litellm Models"}),(0,c.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,c.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("groups"===I?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>P("groups"),children:"Public Model Name"}),(0,c.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("individual"===I?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>P("individual"),children:"Litellm Model Name"})]})]}),(0,c.jsx)(sQ.Z,{className:"mt-4 h-40",data:"groups"===I?(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.model_groups||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})():(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:aZ,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.key}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eR(l.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Requests:"," ",l.requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-green-600",children:["Successful:"," ",l.successful_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-red-600",children:["Failed:"," ",l.failed_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",l.tokens.toLocaleString()]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(k.Z,{children:"Spend by Provider"})}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(av.Z,{className:"mt-4 h-40",data:O(),index:"provider",category:"spend",valueFormatter:e=>"$".concat(eR(e,2)),colors:["cyan"]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Provider"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sN.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sN.Z,{children:"Tokens"})]})}),(0,c.jsx)(s_.Z,{children:O().filter(e=>e.spend>0).map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.provider}),(0,c.jsxs)(sy.Z,{children:["$",eR(e.spend,2)]}),(0,c.jsx)(sy.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:D})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:F})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:R})})]})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aA,{accessToken:x,entityType:"team",userID:p,userRole:h,entityList:(null==j?void 0:j.map(e=>({label:e.team_alias,value:e.team_id})))||null,premiumUser:_})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aA,{accessToken:x,entityType:"tag",userID:p,userRole:h,entityList:S,premiumUser:_})})]})]}),(0,c.jsx)(aT,{isOpen:E,onClose:()=>A(!1),accessToken:x})]})},aO=e=>{let{proxySettings:s}=e,t="<your_proxy_base_url>";return s&&s.PROXY_BASE_URL&&void 0!==s.PROXY_BASE_URL&&(t=s.PROXY_BASE_URL),(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(v.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,c.jsxs)("div",{className:"mb-5",children:[(0,c.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,c.jsx)(w.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,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(eW.Z,{children:"OpenAI Python SDK"}),(0,c.jsx)(eW.Z,{children:"LlamaIndex"}),(0,c.jsx)(eW.Z,{children:"Langchain Py"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(t,'" # 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,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.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="'.concat(t,'", # 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="').concat(t,'",\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,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.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="'.concat(t,'",\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 ')})})]})]})]})})})},aM=t(243),aD=t(93837);async function aF(e,s,t,l,a,r,i,n,o,c,d,m,u){console.log=function(){},console.log("isLocal:",!1);let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new l$.ZP.OpenAI({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a;let h=Date.now(),g=!1,w=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0;for await(let l of(await p.chat.completions.create({model:t,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:c,messages:e,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...w?{tools:w,tool_choice:"auto"}:{}},{signal:r}))){var j,f,v,_,y,b,N,Z;console.log("Stream chunk:",l);let e=null===(j=l.choices[0])||void 0===j?void 0:j.delta;if(console.log("Delta content:",null===(v=l.choices[0])||void 0===v?void 0:null===(f=v.delta)||void 0===f?void 0:f.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!g&&((null===(y=l.choices[0])||void 0===y?void 0:null===(_=y.delta)||void 0===_?void 0:_.content)||e&&e.reasoning_content)&&(g=!0,a=Date.now()-h,console.log("First token received! Time:",a,"ms"),n?(console.log("Calling onTimingData with:",a),n(a)):console.log("onTimingData callback is not defined!")),null===(N=l.choices[0])||void 0===N?void 0:null===(b=N.delta)||void 0===b?void 0:b.content){let e=l.choices[0].delta.content;s(e,l.model)}if(e&&e.reasoning_content){let s=e.reasoning_content;i&&i(s)}if(l.usage&&o){console.log("Usage data found:",l.usage);let e={completionTokens:l.usage.completion_tokens,promptTokens:l.usage.prompt_tokens,totalTokens:l.usage.total_tokens};(null===(Z=l.usage.completion_tokens_details)||void 0===Z?void 0:Z.reasoning_tokens)&&(e.reasoningTokens=l.usage.completion_tokens_details.reasoning_tokens),o(e)}}}catch(e){throw(null==r?void 0:r.aborted)&&console.log("Chat completion request was cancelled"),e}}async function aR(e,s,t,l,a,r){console.log=function(){},console.log("isLocal:",!1);let i=(0,g.getProxyBaseUrl)(),n=new l$.ZP.OpenAI({apiKey:l,baseURL:i,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let l=await n.images.generate({model:t,prompt:e},{signal:r});if(console.log(l.data),l.data&&l.data[0]){if(l.data[0].url)s(l.data[0].url,t);else if(l.data[0].b64_json){let e=l.data[0].b64_json;s("data:image/png;base64,".concat(e),t)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==r?void 0:r.aborted)?console.log("Image generation request was cancelled"):P.ZP.error("Error occurred while generating image. Please try again. Error: ".concat(e),20),e}}async function aq(e,s,t,l,a,r,i){console.log=function(){},console.log("isLocal:",!1);let n=(0,g.getProxyBaseUrl)(),o=new l$.ZP.OpenAI({apiKey:a,baseURL:n,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{let a=await o.images.edit({model:l,image:e,prompt:s},{signal:i});if(console.log(a.data),a.data&&a.data[0]){if(a.data[0].url)t(a.data[0].url,l);else if(a.data[0].b64_json){let e=a.data[0].b64_json;t("data:image/png;base64,".concat(e),l)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==i?void 0:i.aborted)?console.log("Image edits request was cancelled"):P.ZP.error("Error occurred while editing image. Please try again. Error: ".concat(e),20),e}}async function aU(e,s,t,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,n=arguments.length>7?arguments[7]:void 0,o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!l)throw Error("API key is required");console.log=function(){};let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new l$.ZP.OpenAI({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a=Date.now(),h=!1,g=e.map(e=>({role:e.role,content:e.content,type:"message"})),_=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0,y=await p.responses.create({model:t,input:g,stream:!0,litellm_trace_id:c,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},..._?{tools:_,tool_choice:"required"}:{}},{signal:r}),b="";for await(let e of y)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var j,f,v;if("response.output_item.done"===e.type&&(null===(j=e.item)||void 0===j?void 0:j.type)==="mcp_call"&&(null===(f=e.item)||void 0===f?void 0:f.name)&&(b=e.item.name,console.log("MCP tool used:",b)),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let l=e.delta;if(console.log("Text delta",l),l.trim().length>0&&(s("assistant",l,t),!h)){h=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),n&&n(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let s=e.delta;"string"==typeof s&&i&&i(s)}if("response.completed"===e.type&&"response"in e){let s=e.response.usage;if(console.log("Usage data:",s),s&&o){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(v=s.completion_tokens_details)||void 0===v?void 0:v.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),o(e,b)}}}return y}catch(e){throw(null==r?void 0:r.aborted)?console.log("Responses API request was cancelled"):P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20),e}}var az=t(85498);async function aV(e,s,t,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,n=arguments.length>7?arguments[7]:void 0,o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!l)throw Error("API key is required");console.log=function(){};let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new az.ZP({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a=Date.now(),h=!1,g=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0,j={model:t,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(j.vector_store_ids=d),m&&(j.guardrails=m),g&&(j.tools=g,j.tool_choice="auto"),p.messages.stream(j,{signal:r}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let l=e.delta;if(!h){h=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),n&&n(e)}"text_delta"===l.type?s("assistant",l.text,t):"reasoning_delta"===l.type&&i&&i(l.text)}if("message_delta"===e.type&&e.usage&&o){let s=e.usage;console.log("Usage data found:",s);let t={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.input_tokens+s.output_tokens};o(t)}}}catch(e){throw(null==r?void 0:r.aborted)?console.log("Anthropic messages request was cancelled"):P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20),e}}async function aK(e){try{return(await (0,g.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),P.ZP.error("Failed to fetch MCP tools"),[]}}var aB=t(49817),aG=t(94263),aH=e=>{let{endpointType:s,onEndpointChange:t,className:l}=e,a=[{value:aB.KP.CHAT,label:"/v1/chat/completions"},{value:aB.KP.RESPONSES,label:"/v1/responses"},{value:aB.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:aB.KP.IMAGE,label:"/v1/images/generations"},{value:aB.KP.IMAGE_EDITS,label:"/v1/images/edits"}];return(0,c.jsxs)("div",{className:l,children:[(0,c.jsx)(w.Z,{children:"Endpoint Type:"}),(0,c.jsx)(C.default,{showSearch:!0,value:s,style:{width:"100%"},onChange:t,options:a,className:"rounded-md"})]})},aJ=e=>{let{onChange:s,value:t,className:l,accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a)try{let e=await (0,g.tagListCall)(a);console.log("List tags response:",e),i(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}})()},[]),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select tags",onChange:s,value:t,loading:n,className:l,options:r.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})},aY=e=>{let{onChange:s,value:t,className:l,accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a){o(!0);try{let e=await (0,g.getGuardrailsList)(a);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),i(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{o(!1)}}})()},[a]),(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:t,loading:n,className:l,options:r.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})},aW=t(88658),a$=t(83322),aQ=e=>{let{reasoningContent:s}=e,[t,l]=(0,d.useState)(!0);return s?(0,c.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,c.jsxs)(T.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>l(!t),icon:(0,c.jsx)(a$.Z,{}),children:[t?"Hide reasoning":"Show reasoning",t?(0,c.jsx)(tg.Z,{className:"ml-1"}):(0,c.jsx)(tQ.Z,{className:"ml-1"})]}),t&&(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,c.jsx)(aM.U,{components:{code(e){let{node:s,inline:t,className:l,children:a,...r}=e,i=/language-(\w+)/.exec(l||"");return!t&&i?(0,c.jsx)(l5.Z,{style:aG.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(a).replace(/\n$/,"")}):(0,c.jsx)("code",{className:"".concat(l," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...r,children:a})}},children:s})})]}):null},aX=t(5540),a0=t(71282),a1=t(11741),a2=t(16601),a4=t(58630),a5=e=>{let{timeToFirstToken:s,usage:t,toolName:l}=e;return s||t?(0,c.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==s&&(0,c.jsx)(z.Z,{title:"Time to first token",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(aX.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:[(s/1e3).toFixed(2),"s"]})]})}),(null==t?void 0:t.promptTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Prompt tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a0.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["In: ",t.promptTokens]})]})}),(null==t?void 0:t.completionTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Completion tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a1.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Out: ",t.completionTokens]})]})}),(null==t?void 0:t.reasoningTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Reasoning tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a$.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Reasoning: ",t.reasoningTokens]})]})}),(null==t?void 0:t.totalTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Total tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Total: ",t.totalTokens]})]})}),l&&(0,c.jsx)(z.Z,{title:"Tool used",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Tool: ",l]})]})})]}):null},a6=t(61935),a3=t(69993),a8=t(71891),a7=t(44625),a9=t(57400),re=t(26430),rs=t(11894),rt=t(15883),rl=t(99890),ra=t(23907);let{TextArea:rr}=L.default,{Dragger:ri}=eg.default;var rn=e=>{let{accessToken:s,token:t,userRole:l,userID:a,disabledPersonalKeyCreation:r}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let s=e?JSON.parse(e):[];return Array.isArray(s)?s[0]||"":s}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),""}}),[h,p]=(0,d.useState)(!1),[g,j]=(0,d.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return r?"custom":"session"}),[f,v]=(0,d.useState)(()=>sessionStorage.getItem("apiKey")||""),[b,N]=(0,d.useState)(""),[Z,S]=(0,d.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[I,A]=(0,d.useState)(()=>sessionStorage.getItem("selectedModel")||void 0),[L,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)([]),F=(0,d.useRef)(null),[R,q]=(0,d.useState)(()=>sessionStorage.getItem("endpointType")||aB.KP.CHAT),[V,K]=(0,d.useState)(!1),B=(0,d.useRef)(null),[G,J]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[Y,W]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[$,Q]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[ee,es]=(0,d.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[et,el]=(0,d.useState)(null),[ea,er]=(0,d.useState)(null),[ei,en]=(0,d.useState)(!1),[eo,ec]=(0,d.useState)(""),[ed,em]=(0,d.useState)("openai"),eu=(0,d.useRef)(null),ex=async()=>{let e="session"===g?s:f;if(e){p(!0);try{let s=await aK(e);m(s)}catch(e){console.error("Error fetching MCP tools:",e)}finally{p(!1)}}};(0,d.useEffect)(()=>{i&&ex()},[i,s,f,g]),(0,d.useEffect)(()=>{ei&&ec((0,aW.L)({apiKeySource:g,accessToken:s,apiKey:f,inputMessage:b,chatHistory:Z,selectedTags:G,selectedVectorStores:Y,selectedGuardrails:$,endpointType:R,selectedModel:I,selectedSdk:ed}))},[ei,ed,g,s,f,b,Z,G,Y,$,R,I]),(0,d.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(Z))},500);return()=>{clearTimeout(e)}},[Z]),(0,d.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(g)),sessionStorage.setItem("apiKey",f),sessionStorage.setItem("endpointType",R),sessionStorage.setItem("selectedTags",JSON.stringify(G)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(Y)),sessionStorage.setItem("selectedGuardrails",JSON.stringify($)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(u)),I?sessionStorage.setItem("selectedModel",I):sessionStorage.removeItem("selectedModel"),ee?sessionStorage.setItem("messageTraceId",ee):sessionStorage.removeItem("messageTraceId")},[g,f,I,R,G,Y,$,ee,u]),(0,d.useEffect)(()=>{let e="session"===g?s:f;if(!e||!t||!l||!a){console.log("userApiKey or token or userRole or userID is missing = ",e,t,l,a);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let s=await tx(e);console.log("Fetched models:",s),s.length>0&&(D(s),I||A(s[0].model_group))}catch(e){console.error("Error fetching model info:",e)}})(),ex()},[s,a,l,g,f,t]),(0,d.useEffect)(()=>{eu.current&&setTimeout(()=>{var e;null===(e=eu.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[Z]);let ep=(e,s,t)=>{console.log("updateTextUI called with:",e,s,t),S(l=>{let a=l[l.length-1];if(!a||a.role!==e||a.isImage)return[...l,{role:e,content:s,model:t}];{var r;let e={...a,content:a.content+s,model:null!==(r=a.model)&&void 0!==r?r:t};return[...l.slice(0,-1),e]}})},eg=e=>{S(s=>{let t=s[s.length-1];return t&&"assistant"===t.role&&!t.isImage?[...s.slice(0,s.length-1),{...t,reasoningContent:(t.reasoningContent||"")+e}]:s.length>0&&"user"===s[s.length-1].role?[...s,{role:"assistant",content:"",reasoningContent:e}]:s})},ej=e=>{console.log("updateTimingData called with:",e),S(s=>{let t=s[s.length-1];if(console.log("Current last message:",t),t&&"assistant"===t.role){console.log("Updating assistant message with timeToFirstToken:",e);let l=[...s.slice(0,s.length-1),{...t,timeToFirstToken:e}];return console.log("Updated chat history:",l),l}return t&&"user"===t.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...s,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),s)})},ef=(e,s)=>{console.log("Received usage data:",e),S(t=>{let l=t[t.length-1];if(l&&"assistant"===l.role){console.log("Updating message with usage data:",e);let a={...l,usage:e,toolName:s};return console.log("Updated message:",a),[...t.slice(0,t.length-1),a]}return t})},ev=(e,s)=>{S(t=>[...t,{role:"assistant",content:e,model:s,isImage:!0}])},e_=()=>{ea&&URL.revokeObjectURL(ea),el(null),er(null)},eb=async()=>{if(""===b.trim())return;if(R===aB.KP.IMAGE_EDITS&&!et){P.ZP.error("Please upload an image for editing");return}if(!t||!l||!a)return;let e="session"===g?s:f;if(!e){P.ZP.error("Please provide an API key or select Current UI Session");return}B.current=new AbortController;let r=B.current.signal,i={role:"user",content:b},n=ee||(0,aD.Z)();ee||es(n),S([...Z,i]),K(!0);try{if(I){if(R===aB.KP.CHAT){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aF(s,(e,s)=>ep("assistant",e,s),I,e,G,r,eg,ej,ef,n,Y.length>0?Y:void 0,$.length>0?$:void 0,u)}else if(R===aB.KP.IMAGE)await aR(b,(e,s)=>ev(e,s),I,e,G,r);else if(R===aB.KP.IMAGE_EDITS)et&&await aq(et,b,(e,s)=>ev(e,s),I,e,G,r);else if(R===aB.KP.RESPONSES){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aU(s,(e,s,t)=>ep(e,s,t),I,e,G,r,eg,ej,ef,n,Y.length>0?Y:void 0,$.length>0?$:void 0,u)}else if(R===aB.KP.ANTHROPIC_MESSAGES){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aV(s,(e,s,t)=>ep(e,s,t),I,e,G,r,eg,ej,ef,n,Y.length>0?Y:void 0,$.length>0?$:void 0,u)}}}catch(e){r.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),ep("assistant","Error fetching response:"+e))}finally{K(!1),B.current=null,R===aB.KP.IMAGE_EDITS&&e_()}N("")};if(l&&"Admin Viewer"===l){let{Title:e,Paragraph:s}=eh.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to test models"})]})}let eN=(0,c.jsx)(a6.Z,{style:{fontSize:24},spin:!0});return(0,c.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,c.jsx)(X.Z,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,c.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,c.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,c.jsx)(k.Z,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(lI.Z,{className:"mr-2"})," API Key Source"]}),(0,c.jsx)(C.default,{disabled:r,value:g,style:{width:"100%"},onChange:e=>{j(e),x("")},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===g&&(0,c.jsx)(y.Z,{className:"mt-2",placeholder:"Enter custom API key",type:"password",onValueChange:v,value:f,icon:lI.Z})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a3.Z,{className:"mr-2"})," Select Model"]}),(0,c.jsx)(C.default,{value:I,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),A(e),O("custom"===e)},options:[...Array.from(new Set(M.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),L&&(0,c.jsx)(y.Z,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{A(e)},500)}})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(tY.Z,{className:"mr-2"})," Endpoint Type"]}),(0,c.jsx)(aH,{endpointType:R,onEndpointChange:e=>{q(e),e!==aB.KP.RESPONSES&&x("")},className:"mb-4"})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a8.Z,{className:"mr-2"})," Tags"]}),(0,c.jsx)(aJ,{value:G,onChange:J,className:"mb-4",accessToken:s||""})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-2"})," MCP Tool",(0,c.jsx)(z.Z,{className:"ml-1",title:"Select an MCP tool to use in your conversation, only available for virtual keys and /v1/responses endpoint",children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(C.default,{style:{width:"100%"},placeholder:"Select MCP tool",value:u,onChange:e=>x(e),loading:h,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:!("custom"===g&&R===aB.KP.RESPONSES),children:Array.isArray(o)&&o.map(e=>(0,c.jsx)(C.default.Option,{value:e.name,label:(0,c.jsx)("div",{className:"font-medium",children:e.name}),children:(0,c.jsxs)("div",{className:"flex flex-col py-1",children:[(0,c.jsx)("span",{className:"font-medium",children:e.name}),(0,c.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a7.Z,{className:"mr-2"})," Vector Store",(0,c.jsx)(z.Z,{className:"ml-1",title:(0,c.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store ",(0,c.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(H,{value:Y,onChange:W,className:"mb-4",accessToken:s||""})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a9.Z,{className:"mr-2"})," Guardrails",(0,c.jsx)(z.Z,{className:"ml-1",title:(0,c.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails ",(0,c.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(aY,{value:$,onChange:Q,className:"mb-4",accessToken:s||""})]}),(0,c.jsx)("div",{className:"space-y-2 mt-4",children:(0,c.jsx)(_.Z,{onClick:()=>{S([]),es(null),e_(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),P.ZP.success("Chat history cleared.")},className:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:re.Z,children:"Clear Chat"})})]})]}),(0,c.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,c.jsx)(k.Z,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,c.jsx)("div",{className:"flex gap-2",children:(0,c.jsx)(_.Z,{onClick:()=>en(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:rs.Z,children:"Get Code"})})]}),(0,c.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===Z.length&&(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a3.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(w.Z,{children:"Start a conversation or generate an image"})]}),Z.map((e,s)=>(0,c.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,c.jsx)(rt.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,c.jsx)(a3.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,c.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,c.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,c.jsx)(aQ,{reasoningContent:e.reasoningContent}),(0,c.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,c.jsx)("img",{src:e.content,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):(0,c.jsx)(aM.U,{components:{code(e){let{node:s,inline:t,className:l,children:a,...r}=e,i=/language-(\w+)/.exec(l||"");return!t&&i?(0,c.jsx)(l5.Z,{style:aG.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...r,children:String(a).replace(/\n$/,"")}):(0,c.jsx)("code",{className:"".concat(l," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...r,children:a})},pre:e=>{let{node:s,...t}=e;return(0,c.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...t})}},children:e.content}),"assistant"===e.role&&(e.timeToFirstToken||e.usage)&&(0,c.jsx)(a5,{timeToFirstToken:e.timeToFirstToken,usage:e.usage,toolName:e.toolName})]})]})},s)),V&&(0,c.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,c.jsx)(lu.Z,{indicator:eN})}),(0,c.jsx)("div",{ref:eu,style:{height:"1px"}})]}),(0,c.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[R===aB.KP.IMAGE_EDITS&&(0,c.jsx)("div",{className:"mb-4",children:et?(0,c.jsxs)("div",{className:"relative inline-block",children:[(0,c.jsx)("img",{src:ea||"",alt:"Upload preview",className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,c.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:e_,children:(0,c.jsx)(ey.Z,{})})]}):(0,c.jsxs)(ri,{beforeUpload:e=>(el(e),er(URL.createObjectURL(e)),!1),accept:"image/*",showUploadList:!1,className:"border-dashed border-2 border-gray-300 rounded-lg p-4",children:[(0,c.jsx)("p",{className:"ant-upload-drag-icon",children:(0,c.jsx)(rl.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,c.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag image to upload"}),(0,c.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats"})]})}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(rr,{value:b,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eb())},placeholder:R===aB.KP.CHAT||R===aB.KP.RESPONSES||R===aB.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":R===aB.KP.IMAGE_EDITS?"Describe how you want to edit the image...":"Describe the image you want to generate...",disabled:V,className:"flex-1",autoSize:{minRows:1,maxRows:6},style:{resize:"none",paddingRight:"10px",paddingLeft:"10px"}}),V?(0,c.jsx)(_.Z,{onClick:()=>{B.current&&(B.current.abort(),B.current=null,K(!1),P.ZP.info("Request cancelled"))},className:"ml-2 bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:ey.Z,children:"Cancel"}):(0,c.jsx)(_.Z,{onClick:eb,className:"ml-2 text-white",icon:R===aB.KP.CHAT||R===aB.KP.RESPONSES||R===aB.KP.ANTHROPIC_MESSAGES?ra.Z:a3.Z,children:R===aB.KP.CHAT||R===aB.KP.RESPONSES||R===aB.KP.ANTHROPIC_MESSAGES?"Send":R===aB.KP.IMAGE_EDITS?"Edit":"Generate"})]})]})]})]})}),(0,c.jsxs)(E.Z,{title:"Generated Code",visible:ei,onCancel:()=>en(!1),footer:null,width:800,children:[(0,c.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,c.jsx)(C.default,{value:ed,onChange:e=>em(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,c.jsx)(T.ZP,{onClick:()=>{navigator.clipboard.writeText(eo),P.ZP.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,c.jsx)(l5.Z,{language:"python",style:aG.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:eo})]}),"custom"===g&&(0,c.jsx)(E.Z,{title:"Select MCP Tool",visible:i,onCancel:()=>n(!1),onOk:()=>{n(!1),P.ZP.success("MCP tool selection updated")},width:800,children:h?(0,c.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,c.jsx)(lu.Z,{indicator:(0,c.jsx)(a6.Z,{style:{fontSize:24},spin:!0})})}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(w.Z,{className:"text-gray-600 block mb-4",children:"Select the MCP tool you want to use in your conversation."}),(0,c.jsx)(C.default,{style:{width:"100%"},placeholder:"Select MCP tool",value:u,onChange:e=>x(e),optionLabelProp:"label",allowClear:!0,children:o.map(e=>(0,c.jsx)(C.default.Option,{value:e.name,label:(0,c.jsx)("div",{className:"font-medium",children:e.name}),children:(0,c.jsxs)("div",{className:"flex flex-col py-1",children:[(0,c.jsx)("span",{className:"font-medium",children:e.name}),(0,c.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})},ro=t(19226),rc=t(45937),rd=t(28595),rm=t(68208),ru=t(9775),rx=t(41361),rh=t(37527),rp=t(88009),rg=t(48231),rj=t(41169),rf=t(55322),rv=t(76865),r_=t(70525),ry=t(95805),rb=t(51817),rN=t(21047);t(22135),t(40875);var rZ=t(49663);let rw=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter(Boolean).join(" ")};function rk(e){let{accessToken:s,width:t=220}=e,[l,a]=(0,d.useState)(!1),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{if(s){u(!0),h(null);try{let e=await (0,g.getRemainingUsers)(s);o(e)}catch(e){console.error("Failed to fetch usage data:",e),h("Failed to load usage data")}finally{u(!1)}}})()},[s]);let{isOverLimit:p,isNearLimit:j,usagePercentage:f,userMetrics:v,teamMetrics:_}=(e=>{if(!e)return{isOverLimit:!1,isNearLimit:!1,usagePercentage:0,userMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0},teamMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0}};let s=!!e.total_users_remaining&&e.total_users_remaining<=0,t=!!e.total_users_remaining&&e.total_users_remaining<=5&&e.total_users_remaining>0,l=e.total_users?e.total_users_used/e.total_users*100:0,a=!!e.total_teams_remaining&&e.total_teams_remaining<=0,r=!!e.total_teams_remaining&&e.total_teams_remaining<=5&&e.total_teams_remaining>0,i=e.total_teams?e.total_teams_used/e.total_teams*100:0,n=s||a;return{isOverLimit:n,isNearLimit:(t||r)&&!n,usagePercentage:Math.max(l,i),userMetrics:{isOverLimit:s,isNearLimit:t,usagePercentage:l},teamMetrics:{isOverLimit:a,isNearLimit:r,usagePercentage:i}}})(n),y=()=>p?"red":j?"yellow":"green",b=()=>p?"Over Limit":j?"Near Limit":"Active",N=()=>p?(0,c.jsx)(rv.Z,{className:"h-3 w-3"}):j?(0,c.jsx)(r_.Z,{className:"h-3 w-3"}):null;return s&&((null==n?void 0:n.total_users)!==null||(null==n?void 0:n.total_teams)!==null)?(0,c.jsx)("div",{className:"fixed bottom-4 left-4 z-50",style:{width:"".concat(Math.min(t,220),"px")},children:(0,c.jsx)(()=>{if(r){let e=p||j;return(0,c.jsx)("button",{onClick:()=>i(!1),className:rw("bg-white border border-gray-200 rounded-lg shadow-sm p-3 hover:shadow-md transition-all w-full",e&&p&&"border-red-200 bg-red-50",e&&j&&"border-yellow-200 bg-yellow-50"),title:"Show usage details",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(ry.Z,{className:"h-4 w-4 flex-shrink-0"}),e&&(0,c.jsx)("span",{className:"flex-shrink-0",children:N()}),(0,c.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium truncate",children:[n&&null!==n.total_users&&(0,c.jsxs)("span",{className:"flex-shrink-0",children:["U: ",n.total_users_used,"/",n.total_users]}),n&&null!==n.total_teams&&(0,c.jsxs)("span",{className:"flex-shrink-0",children:["T: ",n.total_teams_used,"/",n.total_teams]}),!n||null===n.total_users&&null===n.total_teams&&(0,c.jsx)("span",{className:"truncate",children:"Usage"})]})]})})}return m?(0,c.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 w-full",children:(0,c.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,c.jsx)(rb.Z,{className:"h-4 w-4 animate-spin"}),(0,c.jsx)("span",{className:"text-sm text-gray-500 truncate",children:"Loading..."})]})}):x||!n?(0,c.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 group w-full",children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex-1 min-w-0",children:(0,c.jsx)("span",{className:"text-sm text-gray-500 truncate block",children:x||"No data"})}),(0,c.jsx)("button",{onClick:()=>i(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,c.jsx)(rN.Z,{className:"h-3 w-3 text-gray-400"})})]})}):(0,c.jsxs)("div",{className:rw("bg-white border rounded-lg shadow-sm p-3 transition-all duration-200 group w-full",p&&"border-red-200 bg-red-50",j&&"border-yellow-200 bg-yellow-50"),children:[(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,c.jsx)(ry.Z,{className:"h-4 w-4 flex-shrink-0"}),(0,c.jsx)("span",{className:"font-medium text-sm truncate",children:"Usage"}),(p||j)&&(0,c.jsx)(eY.Z,{color:y(),className:"text-xs px-1.5 py-0.5 flex-shrink-0",children:b()})]}),(0,c.jsx)("button",{onClick:()=>i(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,c.jsx)(rN.Z,{className:"h-3 w-3 text-gray-400"})})]}),(0,c.jsxs)("div",{className:"space-y-3 text-sm",children:[null!==n.total_users&&(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-600 mb-1",children:[(0,c.jsx)(ry.Z,{className:"h-3 w-3"}),(0,c.jsx)("span",{className:"font-medium",children:"Users"})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[n.total_users_used,"/",n.total_users]})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,c.jsx)("span",{className:rw("font-medium text-right",v.isOverLimit&&"text-red-600",v.isNearLimit&&"text-yellow-600"),children:n.total_users_remaining})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[Math.round(v.usagePercentage),"%"]})]}),(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,c.jsx)("div",{className:rw("h-2 rounded-full transition-all duration-300",v.isOverLimit&&"bg-red-500",v.isNearLimit&&"bg-yellow-500",!v.isOverLimit&&!v.isNearLimit&&"bg-green-500"),style:{width:"".concat(Math.min(v.usagePercentage,100),"%")}})})]}),null!==n.total_teams&&(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-600 mb-1",children:[(0,c.jsx)(rZ.Z,{className:"h-3 w-3"}),(0,c.jsx)("span",{className:"font-medium",children:"Teams"})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[n.total_teams_used,"/",n.total_teams]})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,c.jsx)("span",{className:rw("font-medium text-right",_.isOverLimit&&"text-red-600",_.isNearLimit&&"text-yellow-600"),children:n.total_teams_remaining})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[Math.round(_.usagePercentage),"%"]})]}),(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,c.jsx)("div",{className:rw("h-2 rounded-full transition-all duration-300",_.isOverLimit&&"bg-red-500",_.isNearLimit&&"bg-yellow-500",!_.isOverLimit&&!_.isNearLimit&&"bg-green-500"),style:{width:"".concat(Math.min(_.usagePercentage,100),"%")}})})]})]})]})},{})}):null}let{Sider:rS}=ro.default;var rC=e=>{let{accessToken:s,setPage:t,userRole:l,defaultSelectedKey:a}=e,r=[{key:"1",page:"api-keys",label:"Virtual Keys",icon:(0,c.jsx)(lI.Z,{})},{key:"3",page:"llm-playground",label:"Test Key",icon:(0,c.jsx)(rd.Z,{}),roles:eL.LQ},{key:"2",page:"models",label:"Models + Endpoints",icon:(0,c.jsx)(rm.Z,{}),roles:eL.LQ},{key:"12",page:"new_usage",label:"Usage",icon:(0,c.jsx)(ru.Z,{}),roles:[...eL.ZL,...eL.lo]},{key:"6",page:"teams",label:"Teams",icon:(0,c.jsx)(rx.Z,{})},{key:"17",page:"organizations",label:"Organizations",icon:(0,c.jsx)(rh.Z,{}),roles:eL.ZL},{key:"5",page:"users",label:"Internal Users",icon:(0,c.jsx)(rt.Z,{}),roles:eL.ZL},{key:"14",page:"api_ref",label:"API Reference",icon:(0,c.jsx)(tY.Z,{})},{key:"16",page:"model-hub-table",label:"Model Hub",icon:(0,c.jsx)(rp.Z,{})},{key:"15",page:"logs",label:"Logs",icon:(0,c.jsx)(rg.Z,{})},{key:"11",page:"guardrails",label:"Guardrails",icon:(0,c.jsx)(a9.Z,{}),roles:eL.ZL},{key:"26",page:"tools",label:"Tools",icon:(0,c.jsx)(a4.Z,{}),children:[{key:"18",page:"mcp-servers",label:"MCP Servers",icon:(0,c.jsx)(a4.Z,{})},{key:"21",page:"vector-stores",label:"Vector Stores",icon:(0,c.jsx)(a7.Z,{}),roles:eL.ZL}]},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,c.jsx)(rj.Z,{}),children:[{key:"9",page:"caching",label:"Caching",icon:(0,c.jsx)(a7.Z,{}),roles:eL.ZL},{key:"10",page:"budgets",label:"Budgets",icon:(0,c.jsx)(rh.Z,{}),roles:eL.ZL},{key:"20",page:"transform-request",label:"API Playground",icon:(0,c.jsx)(tY.Z,{}),roles:[...eL.ZL,...eL.lo]},{key:"19",page:"tag-management",label:"Tag Management",icon:(0,c.jsx)(a8.Z,{}),roles:eL.ZL},{key:"4",page:"usage",label:"Old Usage",icon:(0,c.jsx)(ru.Z,{})}]},{key:"settings",page:"settings",label:"Settings",icon:(0,c.jsx)(rf.Z,{}),roles:eL.ZL,children:[{key:"11",page:"general-settings",label:"Router Settings",icon:(0,c.jsx)(rf.Z,{}),roles:eL.ZL},{key:"8",page:"settings",label:"Logging & Alerts",icon:(0,c.jsx)(rf.Z,{}),roles:eL.ZL},{key:"13",page:"admin-panel",label:"Admin Settings",icon:(0,c.jsx)(rf.Z,{}),roles:eL.ZL}]}],i=(e=>{let s=r.find(s=>s.page===e);if(s)return s.key;for(let s of r)if(s.children){let t=s.children.find(s=>s.page===e);if(t)return t.key}return"1"})(a),n=r.filter(e=>{let s=!e.roles||e.roles.includes(l);return console.log("Menu item ".concat(e.label,": roles=").concat(e.roles,", userRole=").concat(l,", hasAccess=").concat(s)),!!s&&(e.children&&(e.children=e.children.filter(e=>!e.roles||e.roles.includes(l))),!0)});return(0,c.jsx)(ro.default,{style:{minHeight:"100vh"},children:(0,c.jsxs)(rS,{theme:"light",width:220,children:[(0,c.jsx)(rc.Z,{mode:"inline",selectedKeys:[i],defaultOpenKeys:["llm-tools"],style:{borderRight:0,backgroundColor:"transparent",fontSize:"14px"},items:n.map(e=>{var s;return{key:e.key,icon:e.icon,label:e.label,children:null===(s=e.children)||void 0===s?void 0:s.map(e=>({key:e.key,icon:e.icon,label:e.label,onClick:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}})),onClick:e.children?void 0:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}}})}),(0,eL.tY)(l)&&(0,c.jsx)(rk,{accessToken:s,width:220})]})})},rI=t(96889);console.log("process.env.NODE_ENV","production");let rP=e=>null!==e&&("Admin"===e||"Admin Viewer"===e);var rE=e=>{let{accessToken:s,token:t,userRole:l,userID:a,keys:r,premiumUser:i}=e,n=new Date,[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,y]=(0,d.useState)([]),[b,N]=(0,d.useState)([]),[Z,S]=(0,d.useState)([]),[C,I]=(0,d.useState)([]),[P,E]=(0,d.useState)([]),[A,T]=(0,d.useState)([]),[L,O]=(0,d.useState)([]),[M,D]=(0,d.useState)({}),[F,R]=(0,d.useState)([]),[q,U]=(0,d.useState)(""),[z,V]=(0,d.useState)(["all-tags"]),[K,B]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)(0),W=new Date(n.getFullYear(),n.getMonth(),1),$=new Date(n.getFullYear(),n.getMonth()+1,0),Q=er(W),ee=er($);function es(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",r),console.log("premium user in usage",i);let et=async()=>{if(s)try{let e=await (0,g.getProxyUISettings)(s);return console.log("usage tab: proxy_settings",e),e}catch(e){console.error("Error fetching proxy settings:",e)}};(0,d.useEffect)(()=>{ea(K.from,K.to)},[K,z]);let el=async(e,t,l)=>{if(!e||!t||!s)return;console.log("uiSelectedKey",l);let a=await (0,g.adminTopEndUsersCall)(s,l,e.toISOString(),t.toISOString());console.log("End user data updated successfully",a),y(a)},ea=async(e,t)=>{if(!e||!t||!s)return;let l=await et();null!=l&&l.DISABLE_EXPENSIVE_DB_QUERIES||(S((await (0,g.tagsSpendLogsCall)(s,e.toISOString(),t.toISOString(),0===z.length?void 0:z)).spend_per_tag),console.log("Tag spend data updated successfully"))};function er(e){let s=e.getFullYear(),t=e.getMonth()+1,l=e.getDate();return"".concat(s,"-").concat(t<10?"0"+t:t,"-").concat(l<10?"0"+l:l)}console.log("Start date is ".concat(Q)),console.log("End date is ".concat(ee));let ei=async(e,s,t)=>{try{let t=await e();s(t)}catch(e){console.error(t,e)}},en=(e,s,t,l)=>{let a=[],r=new Date(s),i=e=>{if(e.includes("-"))return e;{let[s,t]=e.split(" ");return new Date(new Date().getFullYear(),new Date("".concat(s," 01 2024")).getMonth(),parseInt(t)).toISOString().split("T")[0]}},n=new Map(e.map(e=>{let s=i(e.date);return[s,{...e,date:s}]}));for(;r<=t;){let e=r.toISOString().split("T")[0];if(n.has(e))a.push(n.get(e));else{let s={date:e,api_requests:0,total_tokens:0};l.forEach(e=>{s[e]||(s[e]=0)}),a.push(s)}r.setDate(r.getDate()+1)}return a},eo=async()=>{if(s)try{let e=await (0,g.adminSpendLogsCall)(s),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=en(e,l,a,[]),i=Number(r.reduce((e,s)=>e+(s.spend||0),0).toFixed(2));Y(i),m(r)}catch(e){console.error("Error fetching overall spend:",e)}},ec=()=>ei(()=>s&&t?(0,g.adminspendByProvider)(s,t,Q,ee):Promise.reject("No access token or token"),O,"Error fetching provider spend"),ed=async()=>{s&&await ei(async()=>(await (0,g.adminTopKeysCall)(s)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),x,"Error fetching top keys")},em=async()=>{s&&await ei(async()=>(await (0,g.adminTopModelsCall)(s)).map(e=>({key:e.model,spend:eR(e.total_spend,2)})),p,"Error fetching top models")},eu=async()=>{s&&await ei(async()=>{let e=await (0,g.teamSpendLogsCall)(s),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0);return N(en(e.daily_spend,l,a,e.teams)),E(e.teams),e.total_spend_per_team.map(e=>({name:e.team_id||"",value:eR(e.total_spend||0,2)}))},T,"Error fetching team spend")},eh=()=>{s&&ei(async()=>(await (0,g.allTagNamesCall)(s)).tag_names,I,"Error fetching tag names")},ep=()=>{s&&ei(()=>{var e,t;return(0,g.tagsSpendLogsCall)(s,null===(e=K.from)||void 0===e?void 0:e.toISOString(),null===(t=K.to)||void 0===t?void 0:t.toISOString(),void 0)},e=>S(e.spend_per_tag),"Error fetching top tags")},eg=()=>{s&&ei(()=>(0,g.adminTopEndUsersCall)(s,null,void 0,void 0),y,"Error fetching top end users")},ej=async()=>{if(s)try{let e=await (0,g.adminGlobalActivity)(s,Q,ee),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=en(e.daily_data||[],l,a,["api_requests","total_tokens"]);D({...e,daily_data:r})}catch(e){console.error("Error fetching global activity:",e)}},ef=async()=>{if(s)try{let e=await (0,g.adminGlobalActivityPerModel)(s,Q,ee),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=e.map(e=>({...e,daily_data:en(e.daily_data||[],l,a,["api_requests","total_tokens"])}));R(r)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,d.useEffect)(()=>{(async()=>{if(s&&t&&l&&a){let e=await et();e&&(H(e),null!=e&&e.DISABLE_EXPENSIVE_DB_QUERIES)||(console.log("fetching data - valiue of proxySettings",G),eo(),ec(),ed(),em(),ej(),ef(),rP(l)&&(eu(),eh(),ep(),eg()))}})()},[s,t,l,a,Q,ee]),null==G?void 0:G.DISABLE_EXPENSIVE_DB_QUERIES)?(0,c.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Database Query Limit Reached"}),(0,c.jsxs)(w.Z,{className:"mt-4",children:["SpendLogs in DB has ",G.NUM_SPEND_LOGS_ROWS," rows.",(0,c.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,c.jsx)(_.Z,{className:"mt-4",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,c.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mt-2",children:[(0,c.jsx)(eW.Z,{children:"All Up"}),rP(l)?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(eW.Z,{children:"Team Based Usage"}),(0,c.jsx)(eW.Z,{children:"Customer Usage"}),(0,c.jsx)(eW.Z,{children:"Tag Based Usage"})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{})})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eW.Z,{children:"Cost"}),(0,c.jsx)(eW.Z,{children:"Activity"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(w.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 - ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,c.jsx)(a_,{userID:a,userRole:l,accessToken:s,userSpend:J,selectedTeam:null,userMaxBudget:null})]}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Monthly Spend"}),(0,c.jsx)(sQ.Z,{data:o,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$ ".concat(eR(e,2)),yAxisWidth:100,tickGap:5})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ab,{topKeys:u,accessToken:s,userID:a,userRole:l,teams:null,premiumUser:i})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top Models"}),(0,c.jsx)(sQ.Z,{className:"mt-4 h-40",data:h,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>"$".concat(eR(e,2))})]})}),(0,c.jsx)(f.Z,{numColSpan:1}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{className:"mb-2",children:[(0,c.jsx)(k.Z,{children:"Spend by Provider"}),(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(av.Z,{className:"mt-4 h-40",variant:"pie",data:L,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>"$".concat(eR(e,2))})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Provider"}),(0,c.jsx)(sN.Z,{children:"Spend"})]})}),(0,c.jsx)(s_.Z,{children:L.map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.provider}),(0,c.jsx)(sy.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":eR(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"All Up"}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",es(M.sum_api_requests)]}),(0,c.jsx)(s$.Z,{className:"h-40",data:M.daily_data,valueFormatter:es,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",es(M.sum_total_tokens)]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:M.daily_data,valueFormatter:es,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,c.jsx)(c.Fragment,{children:F.map((e,s)=>(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:e.model}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",es(e.sum_api_requests)]}),(0,c.jsx)(s$.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:es,onValueChange:e=>console.log(e)})]}),(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",es(e.sum_total_tokens)]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:es,onValueChange:e=>console.log(e)})]})]})]},s))})]})})]})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(X.Z,{className:"mb-2",children:[(0,c.jsx)(k.Z,{children:"Total Spend Per Team"}),(0,c.jsx)(rI.Z,{data:A})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend Per Team"}),(0,c.jsx)(sQ.Z,{className:"h-72",data:b,showLegend:!0,index:"date",categories:P,yAxisWidth:80,stack:!0})]})]}),(0,c.jsx)(f.Z,{numColSpan:2})]})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls ",(0,c.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:K,onValueChange:e=>{B(e),el(e.from,e.to,null)}})}),(0,c.jsxs)(f.Z,{children:[(0,c.jsx)(w.Z,{children:"Select Key"}),(0,c.jsxs)(eJ.Z,{defaultValue:"all-keys",children:[(0,c.jsx)(ex.Z,{value:"all-keys",onClick:()=>{el(K.from,K.to,null)},children:"All Keys"},"all-keys"),null==r?void 0:r.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,c.jsx)(ex.Z,{value:String(s),onClick:()=>{el(K.from,K.to,e.token)},children:e.key_alias},s):null)]})]})]}),(0,c.jsx)(X.Z,{className:"mt-4",children:(0,c.jsxs)(sv.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Customer"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{children:"Total Events"})]})}),(0,c.jsx)(s_.Z,{children:null==j?void 0:j.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.end_user}),(0,c.jsx)(sy.Z,{children:eR(e.total_spend,2)}),(0,c.jsx)(sy.Z,{children:e.total_count})]},s))})]})})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(sW,{className:"mb-4",value:K,onValueChange:e=>{B(e),ea(e.from,e.to)}})}),(0,c.jsx)(f.Z,{children:i?(0,c.jsx)("div",{children:(0,c.jsxs)(lH.Z,{value:z,onValueChange:e=>V(e),children:[(0,c.jsx)(lJ.Z,{value:"all-tags",onClick:()=>V(["all-tags"]),children:"All Tags"},"all-tags"),C&&C.filter(e=>"all-tags"!==e).map((e,s)=>(0,c.jsx)(lJ.Z,{value:String(e),children:e},e))]})}):(0,c.jsx)("div",{children:(0,c.jsxs)(lH.Z,{value:z,onValueChange:e=>V(e),children:[(0,c.jsx)(lJ.Z,{value:"all-tags",onClick:()=>V(["all-tags"]),children:"All Tags"},"all-tags"),C&&C.filter(e=>"all-tags"!==e).map((e,s)=>(0,c.jsxs)(ex.Z,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Spend Per Tag"}),(0,c.jsxs)(w.Z,{children:["Get Started by Tracking cost per tag ",(0,c.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,c.jsx)(sQ.Z,{className:"h-72",data:Z,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,c.jsx)(f.Z,{numColSpan:2})]})]})]})]})})},rA=t(51853);let rT=e=>{let{responseTimeMs:s}=e;return null==s?null:(0,c.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-500 font-mono",children:[(0,c.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{d:"M12 6V12L16 14M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,c.jsxs)("span",{children:[s.toFixed(0),"ms"]})]})},rL=e=>{let s=e;if("string"==typeof s)try{s=JSON.parse(s)}catch(e){}return s},rO=e=>{let{label:s,value:t}=e,[l,a]=d.useState(!1),[r,i]=d.useState(!1),n=(null==t?void 0:t.toString())||"N/A",o=n.length>50?n.substring(0,50)+"...":n;return(0,c.jsx)("tr",{className:"hover:bg-gray-50",children:(0,c.jsx)("td",{className:"px-4 py-2 align-top",colSpan:2,children:(0,c.jsxs)("div",{className:"flex items-center justify-between group",children:[(0,c.jsxs)("div",{className:"flex items-center flex-1",children:[(0,c.jsx)("button",{onClick:()=>a(!l),className:"text-gray-400 hover:text-gray-600 mr-2",children:l?"▼":"▶"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-sm text-gray-600",children:s}),(0,c.jsx)("pre",{className:"mt-1 text-sm font-mono text-gray-800 whitespace-pre-wrap",children:l?n:o})]})]}),(0,c.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2e3)},className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-gray-600",children:(0,c.jsx)(rA.Z,{className:"h-4 w-4"})})]})})})},rM=e=>{var s,t,l,a,r,i,n,o,d,m,u,x,h,p;let{response:g}=e,j=null,f={},v={};try{if(null==g?void 0:g.error)try{let e="string"==typeof g.error.message?JSON.parse(g.error.message):g.error.message;j={message:(null==e?void 0:e.message)||"Unknown error",traceback:(null==e?void 0:e.traceback)||"No traceback available",litellm_params:(null==e?void 0:e.litellm_cache_params)||{},health_check_cache_params:(null==e?void 0:e.health_check_cache_params)||{}},f=rL(j.litellm_params)||{},v=rL(j.health_check_cache_params)||{}}catch(e){console.warn("Error parsing error details:",e),j={message:String(g.error.message||"Unknown error"),traceback:"Error parsing details",litellm_params:{},health_check_cache_params:{}}}else f=rL(null==g?void 0:g.litellm_cache_params)||{},v=rL(null==g?void 0:g.health_check_cache_params)||{}}catch(e){console.warn("Error in response parsing:",e),f={},v={}}let _={redis_host:(null==v?void 0:null===(l=v.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==v?void 0:null===(i=v.redis_async_client)||void 0===i?void 0:null===(r=i.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host)||(null==v?void 0:null===(n=v.connection_kwargs)||void 0===n?void 0:n.host)||(null==v?void 0:v.host)||"N/A",redis_port:(null==v?void 0:null===(m=v.redis_client)||void 0===m?void 0:null===(d=m.connection_pool)||void 0===d?void 0:null===(o=d.connection_kwargs)||void 0===o?void 0:o.port)||(null==v?void 0:null===(h=v.redis_async_client)||void 0===h?void 0:null===(x=h.connection_pool)||void 0===x?void 0:null===(u=x.connection_kwargs)||void 0===u?void 0:u.port)||(null==v?void 0:null===(p=v.connection_kwargs)||void 0===p?void 0:p.port)||(null==v?void 0:v.port)||"N/A",redis_version:(null==v?void 0:v.redis_version)||"N/A",startup_nodes:(()=>{try{var e,s,t,l,a,r,i,n,o,c,d,m,u;if(null==v?void 0:null===(e=v.redis_kwargs)||void 0===e?void 0:e.startup_nodes)return JSON.stringify(v.redis_kwargs.startup_nodes);let x=(null==v?void 0:null===(l=v.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==v?void 0:null===(i=v.redis_async_client)||void 0===i?void 0:null===(r=i.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host),h=(null==v?void 0:null===(c=v.redis_client)||void 0===c?void 0:null===(o=c.connection_pool)||void 0===o?void 0:null===(n=o.connection_kwargs)||void 0===n?void 0:n.port)||(null==v?void 0:null===(u=v.redis_async_client)||void 0===u?void 0:null===(m=u.connection_pool)||void 0===m?void 0:null===(d=m.connection_kwargs)||void 0===d?void 0:d.port);return x&&h?JSON.stringify([{host:x,port:h}]):"N/A"}catch(e){return"N/A"}})(),namespace:(null==v?void 0:v.namespace)||"N/A"};return(0,c.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"border-b border-gray-200 px-4",children:[(0,c.jsx)(eW.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Summary"}),(0,c.jsx)(eW.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Raw Response"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{className:"p-4",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-6",children:[(null==g?void 0:g.status)==="healthy"?(0,c.jsx)(eS.Z,{className:"h-5 w-5 text-green-500 mr-2"}):(0,c.jsx)(ek.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsxs)(w.Z,{className:"text-sm font-medium ".concat((null==g?void 0:g.status)==="healthy"?"text-green-500":"text-red-500"),children:["Cache Status: ",(null==g?void 0:g.status)||"unhealthy"]})]}),(0,c.jsx)("table",{className:"w-full border-collapse",children:(0,c.jsxs)("tbody",{children:[j&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold text-red-600",children:"Error Details"})}),(0,c.jsx)(rO,{label:"Error Message",value:j.message}),(0,c.jsx)(rO,{label:"Traceback",value:j.traceback})]}),(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Cache Details"})}),(0,c.jsx)(rO,{label:"Cache Configuration",value:String(null==f?void 0:f.type)}),(0,c.jsx)(rO,{label:"Ping Response",value:String(g.ping_response)}),(0,c.jsx)(rO,{label:"Set Cache Response",value:g.set_cache_response||"N/A"}),(0,c.jsx)(rO,{label:"litellm_settings.cache_params",value:JSON.stringify(f,null,2)}),(null==f?void 0:f.type)==="redis"&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Redis Details"})}),(0,c.jsx)(rO,{label:"Redis Host",value:_.redis_host||"N/A"}),(0,c.jsx)(rO,{label:"Redis Port",value:_.redis_port||"N/A"}),(0,c.jsx)(rO,{label:"Redis Version",value:_.redis_version||"N/A"}),(0,c.jsx)(rO,{label:"Startup Nodes",value:_.startup_nodes||"N/A"}),(0,c.jsx)(rO,{label:"Namespace",value:_.namespace||"N/A"})]})]})})]})}),(0,c.jsx)(eX.Z,{className:"p-4",children:(0,c.jsx)("div",{className:"bg-gray-50 rounded-md p-4 font-mono text-sm",children:(0,c.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto max-h-[500px]",children:(()=>{try{let e={...g,litellm_cache_params:f,health_check_cache_params:v},s=JSON.parse(JSON.stringify(e,(e,s)=>{if("string"==typeof s)try{return JSON.parse(s)}catch(e){}return s}));return JSON.stringify(s,null,2)}catch(e){return"Error formatting JSON: "+e.message}})()})})})]})]})})},rD=e=>{let{accessToken:s,healthCheckResponse:t,runCachingHealthCheck:l,responseTimeMs:a}=e,[r,i]=d.useState(null),[n,o]=d.useState(!1),m=async()=>{o(!0);let e=performance.now();await l(),i(performance.now()-e),o(!1)};return(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)(_.Z,{onClick:m,disabled:n,className:"bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 text-white text-sm px-4 py-2 rounded-md",children:n?"Running Health Check...":"Run Health Check"}),(0,c.jsx)(rT,{responseTimeMs:r})]}),t&&(0,c.jsx)(rM,{response:t})]})},rF=e=>{if(e)return e.toISOString().split("T")[0]};function rR(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}var rq=e=>{let{accessToken:s,token:t,userRole:l,userID:a,premiumUser:r}=e,[i,n]=(0,d.useState)([]),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,_]=(0,d.useState)("0"),[y,b]=(0,d.useState)("0"),[N,Z]=(0,d.useState)("0"),[k,S]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[C,I]=(0,d.useState)(""),[E,A]=(0,d.useState)("");(0,d.useEffect)(()=>{s&&k&&((async()=>{p(await (0,g.adminGlobalCacheActivity)(s,rF(k.from),rF(k.to)))})(),I(new Date().toLocaleString()))},[s]);let T=Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.api_key)&&void 0!==s?s:""}))),L=Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.model)&&void 0!==s?s:""})));Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.call_type)&&void 0!==s?s:""})));let O=async(e,t)=>{e&&t&&s&&p(await (0,g.adminGlobalCacheActivity)(s,rF(e),rF(t)))};(0,d.useEffect)(()=>{console.log("DATA IN CACHE DASHBOARD",h);let e=h;o.length>0&&(e=e.filter(e=>o.includes(e.api_key))),u.length>0&&(e=e.filter(e=>u.includes(e.model))),console.log("before processed data in cache dashboard",e);let s=0,t=0,l=0,a=e.reduce((e,a)=>{console.log("Processing item:",a),a.call_type||(console.log("Item has no call_type:",a),a.call_type="Unknown"),s+=(a.total_rows||0)-(a.cache_hit_true_rows||0),t+=a.cache_hit_true_rows||0,l+=a.cached_completion_tokens||0;let r=e.find(e=>e.name===a.call_type);return r?(r["LLM API requests"]+=(a.total_rows||0)-(a.cache_hit_true_rows||0),r["Cache hit"]+=a.cache_hit_true_rows||0,r["Cached Completion Tokens"]+=a.cached_completion_tokens||0,r["Generated Completion Tokens"]+=a.generated_completion_tokens||0):e.push({name:a.call_type,"LLM API requests":(a.total_rows||0)-(a.cache_hit_true_rows||0),"Cache hit":a.cache_hit_true_rows||0,"Cached Completion Tokens":a.cached_completion_tokens||0,"Generated Completion Tokens":a.generated_completion_tokens||0}),e},[]);_(rR(t)),b(rR(l));let r=t+s;r>0?Z((t/r*100).toFixed(2)):Z("0"),n(a),console.log("PROCESSED DATA IN CACHE DASHBOARD",a)},[o,u,k,h]);let M=async()=>{try{P.ZP.info("Running cache health check..."),A("");let e=await (0,g.cachingHealthCheckCall)(null!==s?s:"");console.log("CACHING HEALTH CHECK RESPONSE",e),A(e)}catch(s){let e;if(console.error("Error running health check:",s),s&&s.message)try{let t=JSON.parse(s.message);t.error&&(t=t.error),e=t}catch(t){e={message:s.message}}else e={message:"Unknown error occurred"};A({error:e})}};return(0,c.jsxs)(e$.Z,{className:"gap-2 p-8 h-full w-full mt-2 mb-8",children:[(0,c.jsxs)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eW.Z,{children:"Cache Analytics"}),(0,c.jsx)(eW.Z,{children:(0,c.jsx)("pre",{children:"Cache Health"})})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[C&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",C]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center",onClick:()=>{I(new Date().toLocaleString())}})]})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(v.Z,{numItems:3,className:"gap-4 mt-4",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(lH.Z,{placeholder:"Select API Keys",value:o,onValueChange:m,children:T.map(e=>(0,c.jsx)(lJ.Z,{value:e,children:e},e))})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(lH.Z,{placeholder:"Select Models",value:u,onValueChange:x,children:L.map(e=>(0,c.jsx)(lJ.Z,{value:e,children:e},e))})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:k,onValueChange:e=>{S(e),O(e.from,e.to)}})})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hit Ratio"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsxs)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[N,"%"]})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hits"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:j})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cached Tokens"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:y})})]})]}),(0,c.jsx)(sL.Z,{className:"mt-4",children:"Cache Hits vs API Requests"}),(0,c.jsx)(sQ.Z,{title:"Cache Hits vs API Requests",data:i,stack:!0,index:"name",valueFormatter:rR,categories:["LLM API requests","Cache hit"],colors:["sky","teal"],yAxisWidth:48}),(0,c.jsx)(sL.Z,{className:"mt-4",children:"Cached Completion Tokens vs Generated Completion Tokens"}),(0,c.jsx)(sQ.Z,{className:"mt-6",data:i,stack:!0,index:"name",valueFormatter:rR,categories:["Generated Completion Tokens","Cached Completion Tokens"],colors:["sky","teal"],yAxisWidth:48})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(rD,{accessToken:s,healthCheckResponse:E,runCachingHealthCheck:M})})]})]})},rU=t(91810),rz=t(3810);(a=n||(n={})).PresidioPII="Presidio PII",a.Bedrock="Bedrock Guardrail",a.Lakera="Lakera";let rV={},rK=e=>{let s={};return s.PresidioPII="Presidio PII",s.Bedrock="Bedrock Guardrail",s.Lakera="Lakera",Object.entries(e).forEach(e=>{let[t,l]=e;l&&"object"==typeof l&&"ui_friendly_name"in l&&(s[t.split("_").map((e,s)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l.ui_friendly_name)}),rV=s,s},rB=()=>Object.keys(rV).length>0?rV:n,rG={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2"},rH=e=>{Object.entries(e).forEach(e=>{let[s,t]=e;t&&"object"==typeof t&&"ui_friendly_name"in t&&(rG[s.split("_").map((e,s)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=s)})},rJ=e=>!!e&&"Presidio PII"===rB()[e],rY="../ui/assets/logos/",rW={"Presidio PII":"".concat(rY,"presidio.png"),"Bedrock Guardrail":"".concat(rY,"bedrock.svg"),Lakera:"".concat(rY,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(rY,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(rY,"presidio.png")},r$=e=>{if(!e)return{logo:"",displayName:"-"};let s=Object.keys(rG).find(s=>rG[s].toLowerCase()===e.toLowerCase());if(!s)return{logo:"",displayName:e};let t=rB()[s];return{logo:rW[t]||"",displayName:t||e}};var rQ=t(33866),rX=t(97416),r0=t(8881),r1=t(10798),r2=t(49638);let{Text:r4}=eh.default,{Option:r5}=C.default,r6=e=>e.replace(/_/g," "),r3=e=>{switch(e){case"MASK":return(0,c.jsx)(rX.Z,{style:{marginRight:4}});case"BLOCK":return(0,c.jsx)(r0.Z,{style:{marginRight:4}});default:return null}},r8=e=>{let{categories:s,selectedCategories:t,onChange:l}=e;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)(r1.Z,{className:"text-gray-500 mr-1"}),(0,c.jsx)(r4,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:l,value:t,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,c.jsx)(rz.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:s.map(e=>(0,c.jsx)(r5,{value:e.category,children:e.category},e.category))})]})},r7=e=>{let{onSelectAll:s,onUnselectAll:t,hasSelectedEntities:l}=e;return(0,c.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(r4,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,c.jsx)(z.Z,{title:"Apply action to all PII types at once",children:(0,c.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,c.jsx)(T.ZP,{type:"default",onClick:t,disabled:!l,icon:(0,c.jsx)(r2.Z,{}),className:"border-gray-300 hover:text-red-600 hover:border-red-300",children:"Unselect All"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsx)(T.ZP,{type:"default",onClick:()=>s("MASK"),className:"flex items-center justify-center h-10 border-blue-200 hover:border-blue-300 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 text-blue-600",block:!0,icon:(0,c.jsx)(rX.Z,{}),children:"Select All & Mask"}),(0,c.jsx)(T.ZP,{type:"default",onClick:()=>s("BLOCK"),className:"flex items-center justify-center h-10 border-red-200 hover:border-red-300 hover:text-red-700 bg-red-50 hover:bg-red-100 text-red-600",block:!0,icon:(0,c.jsx)(r0.Z,{}),children:"Select All & Block"})]})]})},r9=e=>{let{entities:s,selectedEntities:t,selectedActions:l,actions:a,onEntitySelect:r,onActionSelect:i,entityToCategoryMap:n}=e;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,c.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,c.jsx)(r4,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,c.jsx)(r4,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,c.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===s.length?(0,c.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):s.map(e=>(0,c.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(t.includes(e)?"bg-blue-50":""),children:[(0,c.jsxs)("div",{className:"flex items-center flex-1",children:[(0,c.jsx)(s4.Z,{checked:t.includes(e),onChange:()=>r(e),className:"mr-3"}),(0,c.jsx)(r4,{className:t.includes(e)?"font-medium text-gray-900":"text-gray-700",children:r6(e)}),n.get(e)&&(0,c.jsx)(rz.Z,{className:"ml-2 text-xs",color:"blue",children:n.get(e)})]}),(0,c.jsx)("div",{className:"w-32",children:(0,c.jsx)(C.default,{value:t.includes(e)&&l[e]||"MASK",onChange:s=>i(e,s),style:{width:120},disabled:!t.includes(e),className:"".concat(t.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:a.map(e=>(0,c.jsx)(r5,{value:e,children:(0,c.jsxs)("div",{className:"flex items-center",children:[r3(e),e]})},e))})})]},e))})]})},{Title:ie,Text:is}=eh.default;var it=e=>{let{entities:s,actions:t,selectedEntities:l,selectedActions:a,onEntitySelect:r,onActionSelect:i,entityCategories:n=[]}=e,[o,m]=(0,d.useState)([]),u=new Map;n.forEach(e=>{e.entities.forEach(s=>{u.set(s,e.category)})});let x=s.filter(e=>0===o.length||o.includes(u.get(e)||""));return(0,c.jsxs)("div",{className:"pii-configuration",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)(ie,{level:4,className:"mb-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,c.jsx)(rQ.Z,{count:l.length,showZero:!0,style:{backgroundColor:l.length>0?"#4f46e5":"#d9d9d9"},overflowCount:999,children:(0,c.jsxs)(is,{className:"text-gray-500",children:[l.length," items selected"]})})]}),(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsx)(r8,{categories:n,selectedCategories:o,onChange:m}),(0,c.jsx)(r7,{onSelectAll:e=>{s.forEach(s=>{l.includes(s)||r(s),i(s,e)})},onUnselectAll:()=>{l.forEach(e=>{r(e)})},hasSelectedEntities:l.length>0})]}),(0,c.jsx)(r9,{entities:x,selectedEntities:l,selectedActions:a,actions:t,onEntitySelect:r,onActionSelect:i,entityToCategoryMap:u})]})},il=e=>{var s;let{selectedProvider:t,accessToken:l,providerParams:a=null,value:r=null}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(a),[u,x]=(0,d.useState)(null);if((0,d.useEffect)(()=>{if(a){m(a);return}let e=async()=>{if(l){n(!0),x(null);try{let e=await (0,g.getGuardrailProviderSpecificParams)(l);console.log("Provider params API response:",e),m(e),rK(e),rH(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{n(!1)}}};a||e()},[l,a]),!t)return null;if(i)return(0,c.jsx)(lu.Z,{tip:"Loading provider parameters..."});if(u)return(0,c.jsx)("div",{className:"text-red-500",children:u});let h=null===(s=rG[t])||void 0===s?void 0:s.toLowerCase(),p=o&&o[h];if(console.log("Provider key:",h),console.log("Provider fields:",p),!p||0===Object.keys(p).length)return(0,c.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",r);let j=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[l,a]=e,i=s?"".concat(s,".").concat(l):l,n=t?t[l]:null==r?void 0:r[l];return(console.log("Field value:",n),"ui_friendly_name"===l||"optional_params"===l&&"nested"===a.type&&a.fields)?null:"nested"===a.type&&a.fields?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"mb-2 font-medium",children:l}),(0,c.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:j(a.fields,i,n)})]},i):(0,c.jsx)(I.Z.Item,{name:i,label:l,tooltip:a.description,rules:a.required?[{required:!0,message:"".concat(l," is required")}]:void 0,children:"select"===a.type&&a.options?(0,c.jsx)(C.default,{placeholder:a.description,defaultValue:n||a.default_value,children:a.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"multiselect"===a.type&&a.options?(0,c.jsx)(C.default,{mode:"multiple",placeholder:a.description,defaultValue:n||a.default_value,children:a.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"bool"===a.type||"boolean"===a.type?(0,c.jsxs)(C.default,{placeholder:a.description,defaultValue:void 0!==n?String(n):a.default_value,children:[(0,c.jsx)(C.default.Option,{value:"true",children:"True"}),(0,c.jsx)(C.default.Option,{value:"false",children:"False"})]}):"number"===a.type?(0,c.jsx)(M,{step:1,width:400,placeholder:a.description,defaultValue:void 0!==n?Number(n):void 0}):l.includes("password")||l.includes("secret")||l.includes("key")?(0,c.jsx)(y.Z,{placeholder:a.description,type:"password",defaultValue:n||""}):(0,c.jsx)(y.Z,{placeholder:a.description,type:"text",defaultValue:n||""})},i)})};return(0,c.jsx)(c.Fragment,{children:j(p)})};let{Title:ia}=eh.default,ir=e=>{let{field:s,fieldKey:t,fullFieldKey:l,value:a}=e,[r,i]=d.useState([]),[n,o]=d.useState(s.dict_key_options||[]);d.useEffect(()=>{if(a&&"object"==typeof a){let e=Object.keys(a);i(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),o((s.dict_key_options||[]).filter(s=>!e.includes(s)))}},[a,s.dict_key_options]);let m=e=>{e&&(i([...r,{key:e,id:"".concat(e,"_").concat(Date.now())}]),o(n.filter(s=>s!==e)))},u=(e,s)=>{i(r.filter(s=>s.id!==e)),o([...n,s].sort())};return(0,c.jsxs)("div",{className:"space-y-3",children:[r.map(e=>(0,c.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,c.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,c.jsx)("div",{className:"flex-1",children:(0,c.jsx)(I.Z.Item,{name:Array.isArray(l)?[...l,e.key]:[l,e.key],style:{marginBottom:0},initialValue:a&&"object"==typeof a?a[e.key]:void 0,normalize:"number"===s.dict_value_type?e=>{if(null==e||""===e)return;let s=Number(e);return isNaN(s)?e:s}:void 0,children:"number"===s.dict_value_type?(0,c.jsx)(M,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===s.dict_value_type?(0,c.jsxs)(C.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,c.jsx)(C.default.Option,{value:!0,children:"True"}),(0,c.jsx)(C.default.Option,{value:!1,children:"False"})]}):(0,c.jsx)(y.Z,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,c.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>u(e.id,e.key),children:"Remove"})]},e.id)),n.length>0&&(0,c.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,c.jsx)(C.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&m(e),value:void 0,children:n.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var ii=e=>{let{optionalParams:s,parentFieldKey:t,values:l}=e,a=(e,s)=>{let a="".concat(t,".").concat(e),r=null==l?void 0:l[e];return(console.log("value",r),"dict"===s.type&&s.dict_key_options)?(0,c.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,c.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,c.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,c.jsx)(ir,{field:s,fieldKey:e,fullFieldKey:[t,e],value:r})]},a):(0,c.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,c.jsx)(I.Z.Item,{name:[t,e],label:(0,c.jsxs)("div",{className:"mb-2",children:[(0,c.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,c.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),rules:s.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==r?r:s.default_value,normalize:"number"===s.type?e=>{if(null==e||""===e)return;let s=Number(e);return isNaN(s)?e:s}:void 0,children:"select"===s.type&&s.options?(0,c.jsx)(C.default,{placeholder:s.description,children:s.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"multiselect"===s.type&&s.options?(0,c.jsx)(C.default,{mode:"multiple",placeholder:s.description,children:s.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"bool"===s.type||"boolean"===s.type?(0,c.jsxs)(C.default,{placeholder:s.description,children:[(0,c.jsx)(C.default.Option,{value:"true",children:"True"}),(0,c.jsx)(C.default.Option,{value:"false",children:"False"})]}):"number"===s.type?(0,c.jsx)(M,{step:1,width:400,placeholder:s.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,c.jsx)(y.Z,{placeholder:s.description,type:"password"}):(0,c.jsx)(y.Z,{placeholder:s.description,type:"text"})})},a)};return s.fields&&0!==Object.keys(s.fields).length?(0,c.jsxs)("div",{className:"guardrail-optional-params",children:[(0,c.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,c.jsx)(ia,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,c.jsx)("p",{className:"text-gray-600 text-sm",children:s.description||"Configure additional settings for this guardrail provider"})]}),(0,c.jsx)("div",{className:"space-y-8",children:Object.entries(s.fields).map(e=>{let[s,t]=e;return a(s,t)})})]}):null};let{Title:io,Text:ic,Link:id}=eh.default,{Option:im}=C.default,{Step:iu}=rU.default,ix={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call"};var ih=e=>{let{visible:s,onClose:t,accessToken:l,onSuccess:a}=e,[r]=I.Z.useForm(),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)({}),[v,b]=(0,d.useState)(0),[N,Z]=(0,d.useState)(null),[w,k]=(0,d.useState)([]),[S,A]=(0,d.useState)(2),[T,L]=(0,d.useState)({});(0,d.useEffect)(()=>{l&&(async()=>{try{let[e,s]=await Promise.all([(0,g.getGuardrailUISettings)(l),(0,g.getGuardrailProviderSpecificParams)(l)]);x(e),Z(s),rK(s),rH(s)}catch(e){console.error("Error fetching guardrail data:",e),P.ZP.error("Failed to load guardrail configuration")}})()},[l]);let O=e=>{m(e),r.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),p([]),f({}),k([]),A(2),L({})},M=e=>{p(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},D=(e,s)=>{f(t=>({...t,[e]:s}))},F=async()=>{try{if(0===v&&(await r.validateFields(["guardrail_name","provider","mode","default_on"]),o)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===o&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await r.validateFields(e)}if(1===v&&rJ(o)&&0===h.length){P.ZP.error("Please select at least one PII entity to continue");return}b(v+1)}catch(e){console.error("Form validation failed:",e)}},R=()=>{r.resetFields(),m(null),p([]),f({}),k([]),A(2),L({}),b(0)},q=()=>{R(),t()},U=async()=>{try{n(!0),await r.validateFields();let s=r.getFieldsValue(!0),i=rG[s.provider],c={guardrail_name:s.guardrail_name,litellm_params:{guardrail:i,mode:s.mode,default_on:s.default_on},guardrail_info:{}};if("PresidioPII"===s.provider&&h.length>0){let e={};h.forEach(s=>{e[s]=j[s]||"MASK"}),c.litellm_params.pii_entities_config=e,s.presidio_analyzer_api_base&&(c.litellm_params.presidio_analyzer_api_base=s.presidio_analyzer_api_base),s.presidio_anonymizer_api_base&&(c.litellm_params.presidio_anonymizer_api_base=s.presidio_anonymizer_api_base)}else if(s.config)try{let e=JSON.parse(s.config);c.guardrail_info=e}catch(e){P.ZP.error("Invalid JSON in configuration"),n(!1);return}if(console.log("values: ",JSON.stringify(s)),N&&o){var e;let t=null===(e=rG[o])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",t);let l=N[t]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(e=>{let t=s[e];if(null==t||""===t){var l;t=null===(l=s.optional_params)||void 0===l?void 0:l[e]}null!=t&&""!==t&&(c.litellm_params[e]=t)})}if(!l)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(c)),await (0,g.createGuardrailCall)(l,c),P.ZP.success("Guardrail created successfully"),R(),a(),t()}catch(e){console.error("Failed to create guardrail:",e),P.ZP.error("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{n(!1)}},z=()=>{var e;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter a name for this guardrail"})}),(0,c.jsx)(I.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{placeholder:"Select a guardrail provider",onChange:O,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(rB()).map(e=>{let[s,t]=e;return(0,c.jsx)(im,{value:s,label:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rW[t]&&(0,c.jsx)("img",{src:rW[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]}),children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rW[t]&&(0,c.jsx)("img",{src:rW[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(I.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,c.jsx)(C.default,{optionLabelProp:"label",mode:"multiple",children:(null==u?void 0:null===(e=u.supported_modes)||void 0===e?void 0:e.map(e=>(0,c.jsx)(im,{value:e,label:e,children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:e}),"pre_call"===e&&(0,c.jsx)(rz.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix[e]})]})},e)))||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(im,{value:"pre_call",label:"pre_call",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:"pre_call"})," ",(0,c.jsx)(rz.Z,{color:"green",children:"Recommended"})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix.pre_call})]})}),(0,c.jsx)(im,{value:"during_call",label:"during_call",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"during_call"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix.during_call})]})}),(0,c.jsx)(im,{value:"post_call",label:"post_call",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"post_call"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix.post_call})]})}),(0,c.jsx)(im,{value:"logging_only",label:"logging_only",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"logging_only"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix.logging_only})]})})]})})}),(0,c.jsx)(I.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:!0,children:"Yes"}),(0,c.jsx)(C.default.Option,{value:!1,children:"No"})]})}),(0,c.jsx)(il,{selectedProvider:o,accessToken:l,providerParams:N})]})},V=()=>u&&"PresidioPII"===o?(0,c.jsx)(it,{entities:u.supported_entities,actions:u.supported_actions,selectedEntities:h,selectedActions:j,onEntitySelect:M,onActionSelect:D,entityCategories:u.pii_entity_categories}):null,K=()=>{var e;if(!o||!N)return null;console.log("guardrail_provider_map: ",rG),console.log("selectedProvider: ",o);let s=null===(e=rG[o])||void 0===e?void 0:e.toLowerCase(),t=N&&N[s];return t&&t.optional_params?(0,c.jsx)(ii,{optionalParams:t.optional_params,parentFieldKey:"optional_params"}):null};return(0,c.jsx)(E.Z,{title:"Add Guardrail",open:s,onCancel:q,footer:null,width:700,children:(0,c.jsxs)(I.Z,{form:r,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,c.jsxs)(rU.default,{current:v,className:"mb-6",children:[(0,c.jsx)(iu,{title:"Basic Info"}),(0,c.jsx)(iu,{title:rJ(o)?"PII Configuration":"Provider Configuration"})]}),(()=>{switch(v){case 0:return z();case 1:if(rJ(o))return V();return K();default:return null}})(),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[v>0&&(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{b(v-1)},children:"Previous"}),v<2&&(0,c.jsx)(_.Z,{onClick:F,children:"Next"}),2===v&&(0,c.jsx)(_.Z,{onClick:U,loading:i,children:"Create Guardrail"}),(0,c.jsx)(_.Z,{variant:"secondary",onClick:q,children:"Cancel"})]})]})})};let{Title:ip,Text:ig}=eh.default,{Option:ij}=C.default;var iv=e=>{var s;let{visible:t,onClose:l,accessToken:a,onSuccess:r,guardrailId:i,initialValues:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)((null==n?void 0:n.provider)||null),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)([]),[b,N]=(0,d.useState)({});(0,d.useEffect)(()=>{(async()=>{try{if(!a)return;let e=await (0,g.getGuardrailUISettings)(a);j(e)}catch(e){console.error("Error fetching guardrail settings:",e),P.ZP.error("Failed to load guardrail settings")}})()},[a]),(0,d.useEffect)(()=>{(null==n?void 0:n.pii_entities_config)&&Object.keys(n.pii_entities_config).length>0&&(v(Object.keys(n.pii_entities_config)),N(n.pii_entities_config))},[n]);let Z=e=>{v(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},w=(e,s)=>{N(t=>({...t,[e]:s}))},k=async()=>{try{u(!0);let e=await o.validateFields(),s=rG[e.provider],t={guardrail_id:i,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:s,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&f.length>0){let e={};f.forEach(s=>{e[s]=b[s]||"MASK"}),t.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let s=JSON.parse(e.config);"Bedrock"===e.provider&&s?(s.guardrail_id&&(t.guardrail.litellm_params.guardrailIdentifier=s.guardrail_id),s.guardrail_version&&(t.guardrail.litellm_params.guardrailVersion=s.guardrail_version)):t.guardrail.guardrail_info=s}catch(e){P.ZP.error("Invalid JSON in configuration"),u(!1);return}if(!a)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(t));let n=await fetch("/guardrails/".concat(i),{method:"PUT",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw Error(e||"Failed to update guardrail")}P.ZP.success("Guardrail updated successfully"),r(),l()}catch(e){console.error("Failed to update guardrail:",e),P.ZP.error("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{u(!1)}},S=()=>p&&x&&"PresidioPII"===x?(0,c.jsx)(it,{entities:p.supported_entities,actions:p.supported_actions,selectedEntities:f,selectedActions:b,onEntitySelect:Z,onActionSelect:w,entityCategories:p.pii_entity_categories}):null;return(0,c.jsx)(E.Z,{title:"Edit Guardrail",open:t,onCancel:l,footer:null,width:700,children:(0,c.jsxs)(I.Z,{form:o,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter a name for this guardrail"})}),(0,c.jsx)(I.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{placeholder:"Select a guardrail provider",onChange:e=>{h(e),o.setFieldsValue({config:void 0}),v([]),N({})},disabled:!0,optionLabelProp:"label",children:Object.entries(rB()).map(e=>{let[s,t]=e;return(0,c.jsx)(ij,{value:s,label:t,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rW[t]&&(0,c.jsx)("img",{src:rW[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(I.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,c.jsx)(C.default,{children:(null==p?void 0:null===(s=p.supported_modes)||void 0===s?void 0:s.map(e=>(0,c.jsx)(ij,{value:e,children:e},e)))||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ij,{value:"pre_call",children:"pre_call"}),(0,c.jsx)(ij,{value:"post_call",children:"post_call"})]})})}),(0,c.jsx)(I.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,c.jsx)(to.Z,{})}),(()=>{if(!x)return null;if("PresidioPII"===x)return S();switch(x){case"Aporia":return(0,c.jsx)(I.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,c.jsx)(I.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,c.jsx)(I.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,c.jsx)(I.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,c.jsx)(I.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,c.jsx)(I.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,c.jsx)(I.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:k,loading:m,children:"Update Guardrail"})]})]})})},i_=e=>{let{guardrailsList:s,isLoading:t,onDeleteClick:l,accessToken:a,onGuardrailUpdated:r,isAdmin:i=!1,onGuardrailClick:n}=e,[o,m]=(0,d.useState)([{id:"created_at",desc:!0}]),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(null),g=e=>e?new Date(e).toLocaleString():"-",j=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&n(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.guardrail_name,children:(0,c.jsx)("span",{className:"text-xs font-medium",children:t.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:s}=e,{logo:t,displayName:l}=r$(s.original.litellm_params.guardrail);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:"".concat(l," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)("span",{className:"text-xs",children:l})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var s,t;let{row:l}=e,a=l.original;return(0,c.jsx)(eY.Z,{color:(null===(s=a.litellm_params)||void 0===s?void 0:s.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(t=a.litellm_params)||void 0===t?void 0:t.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.created_at,children:(0,c.jsx)("span",{className:"text-xs",children:g(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.updated_at,children:(0,c.jsx)("span",{className:"text-xs",children:g(t.updated_at)})})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"flex space-x-2",children:(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>t.guardrail_id&&l(t.guardrail_id,t.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500",tooltip:"Delete guardrail"})})}}],f=(0,sg.b7)({data:s,columns:j,state:{sorting:o},onSortingChange:m,getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0});return(0,c.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sv.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sb.Z,{children:f.getHeaderGroups().map(e=>(0,c.jsx)(sZ.Z,{children:e.headers.map(e=>(0,c.jsx)(sN.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(s_.Z,{children:t?(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:j.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"Loading..."})})})}):s.length>0?f.getRowModel().rows.map(e=>(0,c.jsx)(sZ.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(sy.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:j.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No guardrails found"})})})})})]})}),h&&(0,c.jsx)(iv,{visible:u,onClose:()=>x(!1),accessToken:a,onSuccess:()=>{x(!1),p(null),r()},guardrailId:h.guardrail_id||"",initialValues:{guardrail_name:h.guardrail_name||"",provider:Object.keys(rG).find(e=>rG[e]===(null==h?void 0:h.litellm_params.guardrail))||"",mode:h.litellm_params.mode,default_on:h.litellm_params.default_on,pii_entities_config:h.litellm_params.pii_entities_config,...h.guardrail_info}})]})},iy=e=>{var s,t,l,a,r,i,n,o,m,u,x;let{guardrailId:h,onClose:p,accessToken:j,isAdmin:f}=e,[b,N]=(0,d.useState)(null),[Z,S]=(0,d.useState)(null),[E,A]=(0,d.useState)(!0),[O,M]=(0,d.useState)(!1),[D]=I.Z.useForm(),[F,R]=(0,d.useState)([]),[q,U]=(0,d.useState)({}),[z,V]=(0,d.useState)(null),[K,B]=(0,d.useState)({}),G=async()=>{try{var e;if(A(!0),!j)return;let s=await (0,g.getGuardrailInfo)(j,h);if(N(s),null===(e=s.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=s.litellm_params.pii_entities_config;if(R([]),U({}),Object.keys(e).length>0){let s=[],t={};Object.entries(e).forEach(e=>{let[l,a]=e;s.push(l),t[l]="string"==typeof a?a:"MASK"}),R(s),U(t)}}else R([]),U({})}catch(e){P.ZP.error("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{A(!1)}},H=async()=>{try{if(!j)return;let e=await (0,g.getGuardrailProviderSpecificParams)(j);S(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},J=async()=>{try{if(!j)return;let e=await (0,g.getGuardrailUISettings)(j);V(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,d.useEffect)(()=>{H()},[j]),(0,d.useEffect)(()=>{G(),J()},[h,j]),(0,d.useEffect)(()=>{if(b&&D){var e;D.setFieldsValue({guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(e=b.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:b.litellm_params.optional_params}})}},[b,Z,D]);let Y=async e=>{try{var s,t,l;if(!j)return;let a={litellm_params:{}};e.guardrail_name!==b.guardrail_name&&(a.guardrail_name=e.guardrail_name),e.default_on!==(null===(s=b.litellm_params)||void 0===s?void 0:s.default_on)&&(a.litellm_params.default_on=e.default_on);let r=b.guardrail_info,i=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(r)!==JSON.stringify(i)&&(a.guardrail_info=i);let n=(null===(t=b.litellm_params)||void 0===t?void 0:t.pii_entities_config)||{},o={};F.forEach(e=>{o[e]=q[e]||"MASK"}),JSON.stringify(n)!==JSON.stringify(o)&&(a.litellm_params.pii_entities_config=o);let c=Object.keys(rG).find(e=>{var s;return rG[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)});if(console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",c),Z&&c){let s=Z[null===(l=rG[c])||void 0===l?void 0:l.toLowerCase()]||{},t=new Set;console.log("providerSpecificParams: ",JSON.stringify(s)),Object.keys(s).forEach(e=>{"optional_params"!==e&&t.add(e)}),s.optional_params&&s.optional_params.fields&&Object.keys(s.optional_params.fields).forEach(e=>{t.add(e)}),console.log("allowedParams: ",t),t.forEach(s=>{var t,l;let r=e[s];(null==r||""===r)&&(r=null===(l=e.optional_params)||void 0===l?void 0:l[s]);let i=null===(t=b.litellm_params)||void 0===t?void 0:t[s];JSON.stringify(r)!==JSON.stringify(i)&&(null!=r&&""!==r?a.litellm_params[s]=r:null!=i&&""!==i&&(a.litellm_params[s]=null))})}if(0===Object.keys(a.litellm_params).length&&delete a.litellm_params,0===Object.keys(a).length){P.ZP.info("No changes detected"),M(!1);return}await (0,g.updateGuardrailCall)(j,h,a),P.ZP.success("Guardrail updated successfully"),G(),M(!1)}catch(e){console.error("Error updating guardrail:",e),P.ZP.error("Failed to update guardrail")}};if(E)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!b)return(0,c.jsx)("div",{className:"p-4",children:"Guardrail not found"});let W=e=>e?new Date(e).toLocaleString():"-",{logo:$,displayName:ee}=r$((null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)||""),es=async(e,s)=>{await eq(e)&&(B(e=>({...e,[s]:!0})),setTimeout(()=>{B(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:p,className:"mb-4",children:"Back to Guardrails"}),(0,c.jsx)(k.Z,{children:b.guardrail_name||"Unnamed Guardrail"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:b.guardrail_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:K["guardrail-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>es(b.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(K["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"},"overview"),f?(0,c.jsx)(eW.Z,{children:"Settings"},"settings"):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Provider"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[$&&(0,c.jsx)("img",{src:$,alt:"".concat(ee," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)(k.Z,{children:ee})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Mode"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:(null===(t=b.litellm_params)||void 0===t?void 0:t.mode)||"-"}),(0,c.jsx)(eY.Z,{color:(null===(l=b.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",children:(null===(a=b.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Created At"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:W(b.created_at)}),(0,c.jsxs)(w.Z,{children:["Last Updated: ",W(b.updated_at)]})]})]})]}),(null===(r=b.litellm_params)||void 0===r?void 0:r.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,c.jsx)(X.Z,{className:"mt-6",children:(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"PII Protection"}),(0,c.jsxs)(eY.Z,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),b.guardrail_info&&Object.keys(b.guardrail_info).length>0&&(0,c.jsxs)(X.Z,{className:"mt-6",children:[(0,c.jsx)(w.Z,{children:"Guardrail Info"}),(0,c.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(b.guardrail_info).map(e=>{let[s,t]=e;return(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(w.Z,{className:"font-medium w-1/3",children:s}),(0,c.jsx)(w.Z,{className:"w-2/3",children:"object"==typeof t?JSON.stringify(t,null,2):String(t)})]},s)})})]})]}),f&&(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Guardrail Settings"}),!O&&(0,c.jsx)(_.Z,{onClick:()=>M(!0),children:"Edit Settings"})]}),O?(0,c.jsxs)(I.Z,{form:D,onFinish:Y,initialValues:{guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(i=b.litellm_params)||void 0===i?void 0:i.optional_params)&&{optional_params:b.litellm_params.optional_params}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Default On",name:"default_on",children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:!0,children:"Yes"}),(0,c.jsx)(C.default.Option,{value:!1,children:"No"})]})}),(null===(n=b.litellm_params)||void 0===n?void 0:n.guardrail)==="presidio"&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Q.Z,{orientation:"left",children:"PII Protection"}),(0,c.jsx)("div",{className:"mb-6",children:z&&(0,c.jsx)(it,{entities:z.supported_entities,actions:z.supported_actions,selectedEntities:F,selectedActions:q,onEntitySelect:e=>{R(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},onActionSelect:(e,s)=>{U(t=>({...t,[e]:s}))},entityCategories:z.pii_entity_categories})})]}),(0,c.jsx)(Q.Z,{orientation:"left",children:"Provider Settings"}),(0,c.jsx)(il,{selectedProvider:Object.keys(rG).find(e=>{var s;return rG[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)})||null,accessToken:j,providerParams:Z,value:b.litellm_params}),Z&&(()=>{var e;let s=Object.keys(rG).find(e=>{var s;return rG[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)});if(!s)return null;let t=Z[null===(e=rG[s])||void 0===e?void 0:e.toLowerCase()];return t&&t.optional_params?(0,c.jsx)(ii,{optionalParams:t.optional_params,parentFieldKey:"optional_params",values:b.litellm_params}):null})(),(0,c.jsx)(Q.Z,{orientation:"left",children:"Advanced Settings"}),(0,c.jsx)(I.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,c.jsx)(L.default.TextArea,{rows:5})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,c.jsx)(T.ZP,{onClick:()=>M(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{children:"Save Changes"})]})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Guardrail ID"}),(0,c.jsx)("div",{className:"font-mono",children:b.guardrail_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Guardrail Name"}),(0,c.jsx)("div",{children:b.guardrail_name||"Unnamed Guardrail"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Provider"}),(0,c.jsx)("div",{children:ee})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Mode"}),(0,c.jsx)("div",{children:(null===(o=b.litellm_params)||void 0===o?void 0:o.mode)||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Default On"}),(0,c.jsx)(eY.Z,{color:(null===(m=b.litellm_params)||void 0===m?void 0:m.default_on)?"green":"gray",children:(null===(u=b.litellm_params)||void 0===u?void 0:u.default_on)?"Yes":"No"})]}),(null===(x=b.litellm_params)||void 0===x?void 0:x.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"PII Protection"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(eY.Z,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:W(b.created_at)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)("div",{children:W(b.updated_at)})]})]})]})})]})]})]})},ib=e=>{let{accessToken:s,userRole:t}=e,[l,a]=(0,d.useState)([]),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),f=!!t&&(0,eL.tY)(t),v=async()=>{if(s){o(!0);try{let e=await (0,g.getGuardrailsList)(s);console.log("guardrails: ".concat(JSON.stringify(e))),a(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{o(!1)}}};(0,d.useEffect)(()=>{v()},[s]);let y=async()=>{if(x&&s){u(!0);try{await (0,g.deleteGuardrailCall)(s,x.id),P.ZP.success('Guardrail "'.concat(x.name,'" deleted successfully')),v()}catch(e){console.error("Error deleting guardrail:",e),P.ZP.error("Failed to delete guardrail")}finally{u(!1),h(null)}}};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(_.Z,{onClick:()=>{p&&j(null),i(!0)},disabled:!s,children:"+ Add New Guardrail"})}),p?(0,c.jsx)(iy,{guardrailId:p,onClose:()=>j(null),accessToken:s,isAdmin:f}):(0,c.jsx)(i_,{guardrailsList:l,isLoading:n,onDeleteClick:(e,s)=>{h({id:e,name:s})},accessToken:s,onGuardrailUpdated:v,isAdmin:f,onGuardrailClick:e=>j(e)}),(0,c.jsx)(ih,{visible:r,onClose:()=>{i(!1)},accessToken:s,onSuccess:()=>{v()}}),x&&(0,c.jsxs)(E.Z,{title:"Delete Guardrail",open:null!==x,onOk:y,onCancel:()=>{h(null)},confirmLoading:m,okText:"Delete",okButtonProps:{danger:!0},children:[(0,c.jsxs)("p",{children:["Are you sure you want to delete guardrail: ",x.name," ?"]}),(0,c.jsx)("p",{children:"This action cannot be undone."})]})]})},iN=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[a,r]=(0,d.useState)(""),[i,n]=(0,d.useState)(!1),o=(e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")},m=async()=>{n(!0);try{let e;try{e=JSON.parse(t)}catch(e){P.ZP.error("Invalid JSON in request body"),n(!1);return}let l={call_type:"completion",request_body:e};if(!s){P.ZP.error("No access token found"),n(!1);return}let a=await (0,g.transformRequestCall)(s,l);if(a.raw_request_api_base&&a.raw_request_body){let e=o(a.raw_request_api_base,a.raw_request_body,a.raw_request_headers||{});r(e),P.ZP.success("Request transformed successfully")}else{let e="string"==typeof a?a:JSON.stringify(a);r(e),P.ZP.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),P.ZP.error("Failed to transform request")}finally{n(!1)}};return(0,c.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,c.jsx)(k.Z,{children:"Playground"}),(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,c.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,c.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,c.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,c.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,c.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,c.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>l(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),m())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,c.jsxs)(T.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:m,loading:i,children:[(0,c.jsx)("span",{children:"Transform"}),(0,c.jsx)("span",{children:"→"})]})})]}),(0,c.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,c.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,c.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,c.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,c.jsx)("br",{}),(0,c.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,c.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,c.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:a||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,c.jsx)(T.ZP,{type:"text",icon:(0,c.jsx)(tI.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(a||""),P.ZP.success("Copied to clipboard")}})]})]})]}),(0,c.jsx)("div",{className:"mt-4 text-right w-full",children:(0,c.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue ",(0,c.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})};let iZ=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let t=e.split("/mcp/");if(2!==t.length)return{token:null,baseUrl:e};let l=t[0]+"/mcp/",a=t[1];if(!a)return{token:null,baseUrl:e};return{token:a,baseUrl:l}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},iw=e=>{let{token:s,baseUrl:t}=iZ(e);return s?t+"...":e},ik=e=>{let{token:s}=iZ(e);return{maskedUrl:iw(e),hasToken:!!s}},iS=(e,s,t,l)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:t}=e;return(0,c.jsxs)("button",{onClick:()=>s(t.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[t.original.server_id.slice(0,7),"..."]})}},{accessorKey:"alias",header:"Name"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:t}=ik(s.original.url);return(0,c.jsx)("span",{className:"font-mono text-sm",children:t})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,c.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,c.jsx)("span",{children:s()||"none"})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,t=s.original.mcp_access_groups;if(Array.isArray(t)&&t.length>0&&"string"==typeof t[0]){let e=t.join(", ");return(0,c.jsx)(z.Z,{title:e,children:(0,c.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,c.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.created_at?new Date(t.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.updated_at?new Date(t.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>t(s.original.server_id),className:"cursor-pointer"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>l(s.original.server_id),className:"cursor-pointer"})]})}}];var iC=t(82376),iI=t(71437);let iP={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic"},iE={SSE:"sse"},iA=e=>(console.log(e),null==e)?iE.SSE:e,iT=e=>null==e?iP.NONE:e,iL=e=>iT(e)!==iP.NONE;var iO=t(62670),iM=e=>{let{value:s={},onChange:t,tools:l=[],disabled:a=!1}=e,r=(e,l)=>{let a={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:l}};null==t||t(a)};return(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,c.jsx)(iO.Z,{className:"text-green-600"}),(0,c.jsx)(k.Z,{children:"Cost Configuration"}),(0,c.jsx)(z.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,c.jsx)(z.Z,{title:"Default cost charged for each tool call to this server.",children:(0,c.jsx)(U.Z,{className:"ml-1 text-gray-400"})})]}),(0,c.jsx)(q.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let l={...s,default_cost_per_query:e};null==t||t(l)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,c.jsx)(w.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),l.length>0&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,c.jsx)(z.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,c.jsx)(U.Z,{className:"ml-1 text-gray-400"})})]}),(0,c.jsx)(th.default,{items:[{key:"1",label:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-2 text-blue-500"}),(0,c.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,c.jsx)(rQ.Z,{count:l.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,c.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:l.map((e,t)=>{var l;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,c.jsx)("div",{className:"ml-4",children:(0,c.jsx)(q.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(l=s.tool_name_to_cost_per_query)||void 0===l?void 0:l[e.name],onChange:s=>r(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},t)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,c.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,c.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,t]=e;return null!=t&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• ",s,": $",t.toFixed(4)," per query"]},s)})]})]})]})})},iD=e=>{let{mcpServer:s,accessToken:t,onCancel:l,onSuccess:a,availableAccessGroups:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)({}),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)("");(0,d.useEffect)(()=>{var e;(null===(e=s.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&o(s.mcp_info.mcp_server_cost_info)},[s]),(0,d.useEffect)(()=>{if(s.mcp_access_groups){let e=s.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));i.setFieldValue("mcp_access_groups",e)}},[s]),(0,d.useEffect)(()=>{f()},[s,t]);let f=async()=>{if(t&&s.url){h(!0);try{let e={server_id:s.server_id,alias:s.alias,url:s.url,transport:s.transport,spec_version:s.spec_version,auth_type:s.auth_type,mcp_info:s.mcp_info},l=await (0,g.testMCPToolsListRequest)(t,e);l.tools&&!l.error?u(l.tools):(console.error("Failed to fetch tools:",l.message),u([]))}catch(e){console.error("Tools fetch error:",e),u([])}finally{h(!1)}}},v=async e=>{if(t)try{let l=(e.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),r={...e,server_id:s.server_id,mcp_info:{server_name:e.alias||e.url,description:e.description,mcp_server_cost_info:Object.keys(n).length>0?n:null},mcp_access_groups:l},i=await (0,g.updateMCPServer)(t,r);P.ZP.success("MCP Server updated successfully"),a(i)}catch(e){P.ZP.error("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"grid w-full grid-cols-2",children:[(0,c.jsx)(eW.Z,{children:"Server Configuration"}),(0,c.jsx)(eW.Z,{children:"Cost Configuration"})]}),(0,c.jsxs)(e0.Z,{className:"mt-6",children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:v,initialValues:s,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"MCP Server Name",name:"alias",rules:[{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,c.jsx)(C.default.Option,{value:"http",children:"HTTP"})]})}),(0,c.jsx)(I.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"none",children:"None"}),(0,c.jsx)(C.default.Option,{value:"api_key",children:"API Key"}),(0,c.jsx)(C.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,c.jsx)(C.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,c.jsx)(I.Z.Item,{label:"MCP Version",name:"spec_version",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"2025-03-26",children:"2025-03-26 (Latest)"}),(0,c.jsx)(C.default.Option,{value:"2024-11-05",children:"2024-11-05"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,c.jsx)(z.Z,{title:"Define access groups for this MCP server. Each group represents a set of permissions.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",getValueFromEvent:e=>e,children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},showSearch:!0,placeholder:"Add or select access groups",tokenSeparators:[","],optionFilterProp:"value",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.value)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>j(e),options:(()=>{let e=r.map(e=>({value:e,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})}));return p&&!r.some(e=>e.toLowerCase().includes(p.toLowerCase()))&&e.push({value:p,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:p}),(0,c.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e})(),getPopupContainer:e=>e.parentNode})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,c.jsx)(T.ZP,{onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsx)(iM,{value:n,onChange:o,tools:m,disabled:x}),(0,c.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,c.jsx)(T.ZP,{onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:()=>i.submit(),children:"Save Changes"})]})]})})]})]})},iF=e=>{let{costConfig:s}=e,t=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,l=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return t||l?(0,c.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,c.jsxs)("div",{className:"space-y-4",children:[t&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Default Cost per Query"}),(0,c.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Tool-Specific Costs"}),(0,c.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,t]=e;return null!=t&&(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:s}),(0,c.jsxs)(w.Z,{className:"text-green-600 font-mono",children:["$",t.toFixed(4)," per query"]})]},s)})})]}),(0,c.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,c.jsxs)("div",{className:"mt-2 space-y-1",children:[t&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,c.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,c.jsx)("div",{className:"space-y-4",children:(0,c.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,c.jsx)(w.Z,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})};let iR=e=>{var s,t,l,a;let{mcpServer:r,onBack:i,isEditing:n,isProxyAdmin:o,accessToken:m,userRole:u,userID:x,availableAccessGroups:h}=e,[p,g]=(0,d.useState)(n),[j,f]=(0,d.useState)(!1),[y,b]=(0,d.useState)({}),{maskedUrl:N,hasToken:Z}=ik(r.url),S=(e,s)=>Z?s?e:N:e,C=async(e,s)=>{await eq(e)&&(b(e=>({...e,[s]:!0})),setTimeout(()=>{b(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4 max-w-full",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",className:"mb-4",onClick:i,children:"Back to All Servers"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(k.Z,{children:r.alias}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-alias"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>C(r.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:r.server_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-server-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>C(r.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:p?2:0,children:[(0,c.jsx)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"},"overview"),(0,c.jsx)(eW.Z,{children:"MCP Tools"},"tools"),...o?[(0,c.jsx)(eW.Z,{children:"Settings"},"settings")]:[]]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Transport"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{children:iA(null!==(l=r.transport)&&void 0!==l?l:void 0)})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Auth Type"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(w.Z,{children:iT(null!==(a=r.auth_type)&&void 0!==a?a:void 0)})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Host Url"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,c.jsx)(w.Z,{className:"break-all overflow-wrap-anywhere",children:S(r.url,j)}),Z&&(0,c.jsx)("button",{onClick:()=>f(!j),className:"p-1 hover:bg-gray-100 rounded",children:(0,c.jsx)(sf.Z,{icon:j?iC.Z:iI.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,c.jsxs)(X.Z,{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:"Cost Configuration"}),(0,c.jsx)(iF,{costConfig:null===(s=r.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(nl,{serverId:r.server_id,accessToken:m,auth_type:r.auth_type,userRole:u,userID:x})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"MCP Server Settings"}),p?null:(0,c.jsx)(_.Z,{variant:"light",onClick:()=>g(!0),children:"Edit Settings"})]}),p?(0,c.jsx)(iD,{mcpServer:r,accessToken:m,onCancel:()=>g(!1),onSuccess:e=>{g(!1),i()},availableAccessGroups:h}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Server Name"}),(0,c.jsx)("div",{children:r.alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Description"}),(0,c.jsx)("div",{children:r.description})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"URL"}),(0,c.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[S(r.url,j),Z&&(0,c.jsx)("button",{onClick:()=>f(!j),className:"p-1 hover:bg-gray-100 rounded",children:(0,c.jsx)(sf.Z,{icon:j?iC.Z:iI.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Transport"}),(0,c.jsx)("div",{children:iA(r.transport)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Auth Type"}),(0,c.jsx)("div",{children:iT(r.auth_type)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Spec Version"}),(0,c.jsx)("div",{children:r.spec_version})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Access Groups"}),(0,c.jsx)("div",{children:r.mcp_access_groups&&r.mcp_access_groups.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:r.mcp_access_groups.map((e,s)=>{var t;return(0,c.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:""},s)})}):(0,c.jsx)(w.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cost Configuration"}),(0,c.jsx)(iF,{costConfig:null===(t=r.mcp_info)||void 0===t?void 0:t.mcp_server_cost_info})]})]})]})})]})]})]})};var iq=t(83669);let{Panel:iU}=th.default;var iz=e=>{let{accessToken:s,formValues:t,onToolsLoaded:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),h=t.url&&t.transport&&t.auth_type&&s,p=async()=>{if(s&&t.url){n(!0),m(null);try{let e={server_id:t.server_id||"",alias:t.alias||"",url:t.url,transport:t.transport,spec_version:t.spec_version,auth_type:t.auth_type,mcp_info:t.mcp_info},a=await (0,g.testMCPToolsListRequest)(s,e);if(a.tools&&!a.error)r(a.tools),m(null),null==l||l(a.tools),a.tools.length>0&&!u&&x(!0);else{let e=a.message||"Failed to retrieve tools list";m(e),r([]),null==l||l([]),x(!1)}}catch(e){console.error("Tools fetch error:",e),m(e instanceof Error?e.message:String(e)),r([]),null==l||l([]),x(!1)}finally{n(!1)}}};return((0,d.useEffect)(()=>{h?p():(r([]),m(null),x(!1),null==l||l([]))},[t.url,t.transport,t.auth_type,t.spec_version,s]),h||t.url)?(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(iq.Z,{className:"text-blue-600"}),(0,c.jsx)(k.Z,{children:"Connection Status"})]}),!h&&t.url&&(0,c.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,c.jsx)(a4.Z,{className:"text-2xl mb-2"}),(0,c.jsx)(w.Z,{children:"Complete required fields to test connection"}),(0,c.jsx)("br",{}),(0,c.jsx)(w.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),h&&(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":a.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,c.jsx)("br",{}),(0,c.jsxs)(w.Z,{className:"text-gray-500 text-sm",children:["Server: ",t.url]})]}),i&&(0,c.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,c.jsx)(lu.Z,{size:"small",className:"mr-2"}),(0,c.jsx)(w.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&a.length>0&&(0,c.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,c.jsx)(iq.Z,{className:"mr-1"}),(0,c.jsx)(w.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,c.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,c.jsx)(lP.Z,{className:"mr-1"}),(0,c.jsx)(w.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,c.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,c.jsx)(lu.Z,{size:"large"}),(0,c.jsx)(w.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,c.jsx)(tJ.Z,{message:"Connection Failed",description:o,type:"error",showIcon:!0,action:(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(s6.Z,{}),onClick:p,size:"small",children:"Retry"})}),!i&&a.length>0&&(0,c.jsx)(th.default,{items:[{key:"1",label:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-2 text-green-500"}),(0,c.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,c.jsx)(rQ.Z,{count:a.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,c.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:a.map((e,s)=>(0,c.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]},s))})}]}),!i&&0===a.length&&!o&&(0,c.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,c.jsx)(iq.Z,{className:"text-2xl mb-2 text-green-500"}),(0,c.jsx)(w.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,c.jsx)("br",{}),(0,c.jsx)(w.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},iV=e=>{let{isVisible:s}=e;return s?(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,c.jsx)(z.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,c.jsx)(L.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null};let iK="".concat("../ui/assets/logos/","mcp_logo.png");var iB=e=>{let{userRole:s,accessToken:t,onCreateSuccess:l,isModalVisible:a,setModalVisible:r,availableAccessGroups:i}=e,[n]=I.Z.useForm(),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)({}),[h,p]=(0,d.useState)({}),[j,f]=(0,d.useState)([]),[v,b]=(0,d.useState)("sse"),[N,Z]=(0,d.useState)(""),w=async e=>{m(!0);try{let s=e.mcp_access_groups,a={};if(e.stdio_config&&"stdio"===v)try{let s=JSON.parse(e.stdio_config),t=s;if(s.mcpServers&&"object"==typeof s.mcpServers){let l=Object.keys(s.mcpServers);if(l.length>0){let a=l[0];t=s.mcpServers[a],e.alias||(e.alias=a.replace(/-/g,"_"))}}a={command:t.command,args:t.args,env:t.env},console.log("Parsed stdio config:",a)}catch(e){P.ZP.error("Invalid JSON in stdio configuration");return}let i={...e,...a,stdio_config:void 0,mcp_info:{server_name:e.alias||e.url,description:e.description,mcp_server_cost_info:Object.keys(u).length>0?u:null},mcp_access_groups:s};if(console.log("Payload: ".concat(JSON.stringify(i))),null!=t){let e=await (0,g.createMCPServer)(t,i);P.ZP.success("MCP Server created successfully"),n.resetFields(),x({}),f([]),r(!1),l(e)}}catch(e){P.ZP.error("Error creating MCP Server: "+e,20)}finally{m(!1)}},k=()=>{n.resetFields(),x({}),f([]),r(!1)};return(0,eL.tY)(s)?(0,c.jsx)(E.Z,{title:(0,c.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,c.jsx)("img",{src:iK,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:a,width:1e3,onCancel:k,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsxs)(I.Z,{form:n,onFinish:w,onValuesChange:(e,s)=>p(s),layout:"vertical",className:"space-y-6",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,c.jsx)(z.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description"}],children:(0,c.jsx)(y.Z,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,c.jsxs)(C.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{b(e),"stdio"===e?n.setFieldsValue({url:void 0,auth_type:void 0}):n.setFieldsValue({command:void 0,args:void 0,env:void 0})},value:v,children:[(0,c.jsx)(C.default.Option,{value:"http",children:"HTTP"}),(0,c.jsx)(C.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,c.jsx)(C.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==v&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{type:"url",message:"Please enter a valid URL"}],children:(0,c.jsx)(y.Z,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==v&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,c.jsxs)(C.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,c.jsx)(C.default.Option,{value:"none",children:"None"}),(0,c.jsx)(C.default.Option,{value:"api_key",children:"API Key"}),(0,c.jsx)(C.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,c.jsx)(C.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,c.jsx)(iV,{isVisible:"stdio"===v}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Version",(0,c.jsx)(z.Z,{title:"Select the MCP specification version your server supports",children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"spec_version",rules:[{required:!0,message:"Please select a spec version"}],children:(0,c.jsxs)(C.default,{placeholder:"Select MCP version",className:"rounded-lg",size:"large",children:[(0,c.jsx)(C.default.Option,{value:"2025-03-26",children:"2025-03-26 (Latest)"}),(0,c.jsx)(C.default.Option,{value:"2024-11-05",children:"2024-11-05"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,c.jsx)(z.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.value)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>Z(e),tokenSeparators:[","],options:(()=>{let e=i.map(e=>({value:e,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})}));return N&&!i.some(e=>e.toLowerCase().includes(N.toLowerCase()))&&e.push({value:N,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:N}),(0,c.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e})(),maxTagCount:"responsive",allowClear:!0})})]}),(0,c.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,c.jsx)(iz,{accessToken:t,formValues:h,onToolsLoaded:f})}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(iM,{value:u,onChange:x,tools:j,disabled:!1})}),(0,c.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:k,children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",loading:o,children:o?"Creating...":"Add MCP Server"})]})]})})}):null},iG=t(64935),iH=t(11239),iJ=t(54001),iY=t(96137),iW=t(96362),i$=t(80221),iQ=t(29202);let{Title:iX,Text:i0}=eh.default,{Panel:i1}=th.default,i2=e=>{let{icon:s,title:t,description:l,children:a,serverName:r,accessGroups:i=["dev"]}=e,[n,o]=(0,d.useState)(!1),m=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(n&&r){let s=[r.replace(/\s+/g,"_"),...i].join(",");e["x-mcp-servers"]=[s]}return e};return(0,c.jsxs)(tp.Z,{className:"border border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,c.jsxs)("div",{children:[(0,c.jsx)(iX,{level:5,className:"mb-0",children:t}),(0,c.jsx)(i0,{className:"text-gray-600",children:l})]})]}),r&&("Implementation Example"===t||"Configuration"===t)&&(0,c.jsxs)(I.Z.Item,{className:"mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(to.Z,{size:"small",checked:n,onChange:o}),(0,c.jsxs)(i0,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,c.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),n&&(0,c.jsx)(tJ.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,c.jsxs)("div",{children:[(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,c.jsxs)("code",{children:['["',r.replace(/\s+/g,"_"),'"]']})]}),(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,c.jsx)("code",{children:'["dev-group"]'})]}),(0,c.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,c.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),d.Children.map(a,e=>{if(d.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return d.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(m(),null,8)))})}return e})]})};var i4=e=>{let{currentServerAccessGroups:s=[]}=e,t=(0,g.getProxyBaseUrl)(),[l,a]=(0,d.useState)({}),[r,i]=(0,d.useState)({openai:[],litellm:[],cursor:[],http:[]}),[n]=(0,d.useState)("Zapier_MCP"),o=async(e,s)=>{await eq(e)&&(a(e=>({...e,[s]:!0})),setTimeout(()=>{a(e=>({...e,[s]:!1}))},2e3))},m=e=>{let{code:s,copyKey:t,title:a,className:r=""}=e;return(0,c.jsxs)("div",{className:"relative group",children:[a&&(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(iG.Z,{size:16,className:"text-blue-600"}),(0,c.jsx)(i0,{strong:!0,className:"text-gray-700",children:a})]}),(0,c.jsxs)(tp.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(r),children:[(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:l[t]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>o(s,t),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(l[t]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,c.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},u=e=>{let{step:s,title:t,children:l}=e;return(0,c.jsxs)("div",{className:"flex gap-4",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsx)(i0,{strong:!0,className:"text-gray-800 block mb-2",children:t}),l]})]})};return(0,c.jsx)("div",{children:(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,c.jsx)(w.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,c.jsxs)(e$.Z,{className:"w-full",children:[(0,c.jsx)(eQ.Z,{className:"flex justify-start mt-8 mb-6",children:(0,c.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,c.jsx)(eW.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iG.Z,{size:18}),"OpenAI API"]})}),(0,c.jsx)(eW.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iH.Z,{size:18}),"LiteLLM Proxy"]})}),(0,c.jsx)(eW.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(i$.Z,{size:18}),"Cursor"]})}),(0,c.jsx)(eW.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iQ.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iG.Z,{className:"text-blue-600",size:24}),(0,c.jsx)(iX,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,c.jsx)(i0,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(i2,{icon:(0,c.jsx)(iJ.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,c.jsxs)(tW.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsxs)(i0,{children:["Get your API key from the"," ",(0,c.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,c.jsx)(iW.Z,{size:12})]})]})}),(0,c.jsx)(m,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iY.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"openai-server-url"})}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iG.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,c.jsx)(m,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(t,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,c.jsx)(eX.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iH.Z,{className:"text-emerald-600",size:24}),(0,c.jsx)(iX,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,c.jsx)(i0,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(i2,{icon:(0,c.jsx)(iJ.Z,{className:"text-emerald-600",size:16}),title:"API Key Setup",description:"Configure your LiteLLM Proxy API key for authentication",children:(0,c.jsxs)(tW.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsx)(i0,{children:"Get your API key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,c.jsx)(m,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iY.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"litellm-server-url"})}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iG.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:n,accessGroups:["dev"],children:(0,c.jsx)(m,{code:"curl --location '".concat(t,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_API_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(t,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,c.jsx)(eX.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(i$.Z,{className:"text-purple-600",size:24}),(0,c.jsx)(iX,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,c.jsx)(i0,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,c.jsxs)(tp.Z,{className:"border border-gray-200",children:[(0,c.jsx)(iX,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(u,{step:1,title:"Open Cursor Settings",children:(0,c.jsxs)(i0,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,c.jsx)(u,{step:2,title:"Navigate to MCP Tools",children:(0,c.jsx)(i0,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,c.jsxs)(u,{step:3,title:"Add Configuration",children:[(0,c.jsxs)(i0,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iG.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,c.jsx)(m,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "server_url": "'.concat(t,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,c.jsx)(eX.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iQ.Z,{className:"text-green-600",size:24}),(0,c.jsx)(iX,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,c.jsx)(i0,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iQ.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,c.jsxs)(tW.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsx)(i0,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"http-server-url"}),(0,c.jsx)(m,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(T.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,c.jsx)(iW.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},i5=t(67187);let{Option:i6}=C.default,i3=e=>{let{isModalOpen:s,title:t,confirmDelete:l,cancelDelete:a}=e;return s?(0,c.jsx)(E.Z,{open:s,onOk:l,okType:"danger",onCancel:a,children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:t}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)("p",{children:"Are you sure you want to delete this MCP Server?"})})]})}):null};var i8=e=>{let{accessToken:s,userRole:t,userID:l}=e,{data:a,isLoading:r,refetch:i}=(0,sm.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,g.fetchMCPServers)(s)},enabled:!!s}),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)("all"),[y,b]=(0,d.useState)("all"),[N,Z]=(0,d.useState)([]),[S,I]=(0,d.useState)(!1),E="Internal User"===t,A=d.useMemo(()=>{if(!a)return[];let e=new Set,s=[];return a.forEach(t=>{t.teams&&t.teams.forEach(t=>{let l=t.team_id;e.has(l)||(e.add(l),s.push(t))})}),s},[a]),T=d.useMemo(()=>a?Array.from(new Set(a.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[a]),L=e=>{v(e),M(e,y)},O=e=>{b(e),M(f,e)},M=(e,s)=>{if(!a)return Z([]);let t=a;if("personal"===e){Z([]);return}"all"!==e&&(t=t.filter(s=>{var t;return null===(t=s.teams)||void 0===t?void 0:t.some(s=>s.team_id===e)})),"all"!==s&&(t=t.filter(e=>{var t;return null===(t=e.mcp_access_groups)||void 0===t?void 0:t.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),Z(t)};(0,d.useEffect)(()=>{M(f,y)},[a]);let D=d.useMemo(()=>iS(null!=t?t:"",e=>{h(e),j(!1)},e=>{h(e),j(!0)},F),[t]);function F(e){o(e),u(!0)}let R=async()=>{if(null!=n&&null!=s){try{await (0,g.deleteMCPServer)(s,n),P.ZP.success("Deleted MCP Server successfully"),i()}catch(e){console.error("Error deleting the mcp server:",e)}u(!1),o(null)}};return s&&t&&l?(0,c.jsxs)("div",{className:"w-full h-full p-6",children:[(0,c.jsx)(i3,{isModalOpen:m,title:"Delete MCP Server",confirmDelete:R,cancelDelete:()=>{u(!1),o(null)}}),(0,c.jsx)(iB,{userRole:t,accessToken:s,onCreateSuccess:e=>{Z(s=>[...s,e]),I(!1)},isModalVisible:S,setModalVisible:I,availableAccessGroups:T}),(0,c.jsx)(k.Z,{children:"MCP Servers"}),(0,c.jsx)(w.Z,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,eL.tY)(t)&&(0,c.jsx)(_.Z,{className:"mt-4 mb-4",onClick:()=>I(!0),children:"+ Add New MCP Server"}),(0,c.jsxs)(e$.Z,{className:"w-full h-full",children:[(0,c.jsx)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eW.Z,{children:"All Servers"}),(0,c.jsx)(eW.Z,{children:"Connect"})]})}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsx)(()=>x?(0,c.jsx)(iR,{mcpServer:N.find(e=>e.server_id===x)||{server_id:"",alias:"",url:"",transport:"",spec_version:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{j(!1),h(null),i()},isProxyAdmin:(0,eL.tY)(t),isEditing:p,accessToken:s,userID:l,userRole:t,availableAccessGroups:T}):(0,c.jsxs)("div",{className:"w-full h-full",children:[(0,c.jsx)("div",{className:"w-full px-6",children:(0,c.jsx)("div",{className:"flex flex-col space-y-4",children:(0,c.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,c.jsxs)(C.default,{value:f,onChange:L,style:{width:300},children:[(0,c.jsx)(i6,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:E?"All Available Servers":"All Servers"})]})}),(0,c.jsx)(i6,{value:"personal",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Personal"})]})}),A.map(e=>(0,c.jsx)(i6,{value:e.team_id,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,c.jsxs)(w.Z,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,c.jsx)(z.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,c.jsx)(i5.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,c.jsxs)(C.default,{value:y,onChange:O,style:{width:300},children:[(0,c.jsx)(i6,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),T.map(e=>(0,c.jsx)(i6,{value:e,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,c.jsx)("div",{className:"w-full px-6 mt-6",children:(0,c.jsx)(t8,{data:N,columns:D,renderSubComponent:()=>(0,c.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:r,noDataMessage:"No MCP servers configured"})})]}),{})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(i4,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:t,userID:l}),(0,c.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},i7=t(21770);function i9(e){let{tool:s,needsAuth:t,authValue:l,onSubmit:a,isLoading:r,result:i,error:n,onClose:o}=e,[m]=I.Z.useForm(),[u,x]=d.useState("formatted"),[h,p]=d.useState(null),[g,j]=d.useState(null),f=d.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),v=d.useMemo(()=>f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{type:"object",properties:f.properties.params.properties,required:f.properties.params.required||[]}:f,[f]);d.useEffect(()=>{h&&(i||n)&&j(Date.now()-h)},[i,n,h]);let b=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let t=document.execCommand("copy");if(document.body.removeChild(s),!t)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},N=async()=>{await b(JSON.stringify(i,null,2))?P.ZP.success("Result copied to clipboard"):P.ZP.error("Failed to copy result")},Z=async()=>{await b(s.name)?P.ZP.success("Tool name copied to clipboard"):P.ZP.error("Failed to copy tool name")};return(0,c.jsxs)("div",{className:"space-y-4 h-full",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,c.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,c.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,c.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:Z,title:"Click to copy tool name",children:[(0,c.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,c.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,c.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,c.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,c.jsx)(_.Z,{onClick:o,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,c.jsx)(z.Z,{title:"Configure the input parameters for this tool call",children:(0,c.jsx)(U.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,c.jsx)("div",{className:"p-4",children:(0,c.jsxs)(I.Z,{form:m,onFinish:e=>{p(Date.now()),j(null);let s={};Object.entries(e).forEach(e=>{var t;let[l,a]=e,r=null===(t=v.properties)||void 0===t?void 0:t[l];if(r&&null!=a&&""!==a)switch(r.type){case"boolean":s[l]="true"===a||!0===a;break;case"number":s[l]=Number(a);break;case"string":s[l]=String(a);break;default:s[l]=a}else null!=a&&""!==a&&(s[l]=a)}),a(f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,c.jsx)("div",{className:"space-y-3",children:(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,c.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,c.jsx)(y.Z,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===v.properties?(0,c.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,c.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,c.jsx)("div",{className:"space-y-3",children:Object.entries(v.properties).map(e=>{var s,t,l,a,r;let[i,n]=e;return(0,c.jsxs)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=v.required)||void 0===s?void 0:s.includes(i))&&(0,c.jsx)("span",{className:"text-red-500",children:"*"}),n.description&&(0,c.jsx)(z.Z,{title:n.description,children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(t=v.required)||void 0===t?void 0:t.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===n.type&&n.enum&&(0,c.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:n.default,children:[!(null===(l=v.required)||void 0===l?void 0:l.includes(i))&&(0,c.jsxs)("option",{value:"",children:["Select ",i]}),n.enum.map(e=>(0,c.jsx)("option",{value:e,children:e},e))]}),"string"===n.type&&!n.enum&&(0,c.jsx)(y.Z,{placeholder:n.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===n.type&&(0,c.jsx)("input",{type:"number",placeholder:n.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===n.type&&(0,c.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=n.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(r=v.required)||void 0===r?void 0:r.includes(i))&&(0,c.jsxs)("option",{value:"",children:["Select ",i]}),(0,c.jsx)("option",{value:"true",children:"True"}),(0,c.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,c.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,c.jsx)(_.Z,{onClick:()=>m.submit(),disabled:r,variant:"primary",className:"w-full",loading:r,children:r?"Calling Tool...":i||n?"Call Again":"Call Tool"})})]})})]}),(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,c.jsx)("div",{className:"p-4",children:i||n||r?(0,c.jsxs)("div",{className:"space-y-3",children:[i&&!r&&!n&&(0,c.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,c.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,c.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,c.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,c.jsx)("button",{onClick:()=>x("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,c.jsx)("button",{onClick:()=>x("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,c.jsx)("button",{onClick:N,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,c.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[r&&(0,c.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,c.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,c.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,c.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),n&&(0,c.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,c.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,c.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,c.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,c.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:n.message})})]})]})}),i&&!r&&!n&&(0,c.jsx)("div",{className:"space-y-3",children:"formatted"===u?i.map((e,s)=>(0,c.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,c.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let t=e.replace(/^#+\s/,"");return(0,c.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:t})},s)}let t=/(https?:\/\/[^\s\)]+)/g;if(t.test(e)){let l=e.split(t);return(0,c.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,c.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:l.map((e,s)=>t.test(e)?(0,c.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,c.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,c.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,c.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,c.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,c.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,c.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,c.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,c.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,c.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,c.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,c.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(i,null,2)})})})})]})]}):(0,c.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,c.jsxs)("div",{className:"text-center max-w-sm",children:[(0,c.jsx)("div",{className:"mb-3",children:(0,c.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,c.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,c.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var ne=t(36724);let ns=e=>{let s,{visible:t,onOk:l,onCancel:a,authType:r}=e,[i]=I.Z.useForm();if(r===iP.API_KEY||r===iP.BEARER_TOKEN){let e=r===iP.API_KEY?"API Key":"Bearer Token";s=(0,c.jsx)(I.Z.Item,{name:"authValue",label:e,rules:[{required:!0,message:"Please input your ".concat(e)}],children:(0,c.jsx)(L.default.Password,{})})}else r===iP.BASIC&&(s=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{name:"username",label:"Username",rules:[{required:!0,message:"Please input your username"}],children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{name:"password",label:"Password",rules:[{required:!0,message:"Please input your password"}],children:(0,c.jsx)(L.default.Password,{})})]}));return(0,c.jsx)(E.Z,{open:t,title:"Authentication",onOk:()=>{i.validateFields().then(e=>{r===iP.BASIC?l("".concat(e.username.trim(),":").concat(e.password.trim())):l(e.authValue.trim())})},onCancel:a,destroyOnClose:!0,children:(0,c.jsx)(I.Z,{form:i,layout:"vertical",children:s})})},nt=e=>{let{authType:s,onAuthSubmit:t,hasAuth:l}=e,[a,r]=(0,d.useState)(!1);return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)(ne.xv,{className:"text-sm font-medium text-gray-700",children:["Authentication ",l?"✓":""]}),(0,c.jsx)(ne.zx,{onClick:()=>r(!0),size:"sm",variant:"secondary",className:"text-xs",children:l?"Update":"Add Auth"})]}),(0,c.jsx)(ne.xv,{className:"text-xs text-gray-500",children:l?"Authentication configured":"Some tools may require authentication"}),(0,c.jsx)(ns,{visible:a,onOk:e=>{t(e),r(!1)},onCancel:()=>r(!1),authType:s})]})};var nl=e=>{let{serverId:s,accessToken:t,auth_type:l,userRole:a,userID:r}=e,[i,n]=(0,d.useState)(""),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)(null),{data:j,isLoading:f,error:v}=(0,sm.a)({queryKey:["mcpTools"],queryFn:()=>{if(!t)throw Error("Access Token required");return(0,g.listMCPTools)(t,s)},enabled:!!t}),{mutate:_,isPending:y}=(0,i7.D)({mutationFn:e=>{if(!t)throw Error("Access Token required");return(0,g.callMCPTool)(t,e.tool.name,e.arguments,e.authValue)},onSuccess:e=>{x(e),p(null)},onError:e=>{p(e),x(null)}}),b=(null==j?void 0:j.tools)||[],N=""!==i;return(0,c.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,c.jsx)(ne.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,c.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,c.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,c.jsx)(ne.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,c.jsxs)("div",{className:"flex flex-col flex-1 space-y-6",children:[(0,c.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,c.jsxs)(ne.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-2"})," Available Tools",b.length>0&&(0,c.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:b.length})]}),f&&(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,c.jsxs)("div",{className:"relative mb-3",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,c.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,c.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==j?void 0:j.error)&&(0,c.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,c.jsxs)("p",{className:"font-medium",children:["Error: ",j.message]})}),!f&&!(null==j?void 0:j.error)&&(!b||0===b.length)&&(0,c.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,c.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!f&&!(null==j?void 0:j.error)&&b.length>0&&(0,c.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:b.map(e=>(0,c.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==o?void 0:o.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{m(e),x(null),p(null)},children:[(0,c.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,c.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,c.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,c.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==o?void 0:o.name)===e.name&&(0,c.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,c.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,c.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]}),iL(l)&&(0,c.jsxs)("div",{className:"pt-4 border-t border-gray-200 flex-shrink-0",children:[(0,c.jsxs)(ne.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,c.jsx)(a9.Z,{className:"mr-2"})," Authentication"]}),(0,c.jsx)(nt,{authType:l,onAuthSubmit:e=>n(e),hasAuth:N})]})]})]}),(0,c.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,c.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,c.jsx)(ne.Dx,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,c.jsx)("div",{className:"flex-1 overflow-auto p-4",children:o?(0,c.jsx)("div",{className:"h-full",children:(0,c.jsx)(i9,{tool:o,needsAuth:iL(l),authValue:i,onSubmit:e=>{_({tool:o,arguments:e,authValue:i})},result:u,error:h,isLoading:y,onClose:()=>m(null)})}):(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a3.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(ne.xv,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,c.jsx)(ne.xv,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})},na=t(57018),nr=e=>{let{tagId:s,onClose:t,accessToken:l,is_admin:a,editTag:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(r),[x,h]=(0,d.useState)([]),p=async()=>{if(l)try{let e=(await (0,g.tagInfoCall)(l,[s]))[s];e&&(o(e),r&&i.setFieldsValue({name:e.name,description:e.description,models:e.models}))}catch(e){console.error("Error fetching tag details:",e),P.ZP.error("Error fetching tag details: "+e)}};(0,d.useEffect)(()=>{p()},[s,l]),(0,d.useEffect)(()=>{l&&eK("dummy-user","Admin",l,h)},[l]);let j=async e=>{if(l)try{await (0,g.tagUpdateCall)(l,{name:e.name,description:e.description,models:e.models}),P.ZP.success("Tag updated successfully"),u(!1),p()}catch(e){console.error("Error updating tag:",e),P.ZP.error("Error updating tag: "+e)}};return n?(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(na.zx,{onClick:t,className:"mb-4",children:"← Back to Tags"}),(0,c.jsxs)(na.Dx,{children:["Tag Name: ",n.name]}),(0,c.jsx)(na.xv,{className:"text-gray-500",children:n.description||"No description"})]}),a&&!m&&(0,c.jsx)(na.zx,{onClick:()=>u(!0),children:"Edit Tag"})]}),m?(0,c.jsx)(na.Zb,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:j,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{label:"Tag Name",name:"name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed LLMs"," ",(0,c.jsx)(z.Z,{title:"Select which LLMs are allowed to process this type of data",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select LLMs",children:x.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(na.zx,{onClick:()=>u(!1),children:"Cancel"}),(0,c.jsx)(na.zx,{type:"submit",children:"Save Changes"})]})]})}):(0,c.jsx)("div",{className:"space-y-6",children:(0,c.jsxs)(na.Zb,{children:[(0,c.jsx)(na.Dx,{children:"Tag Details"}),(0,c.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Name"}),(0,c.jsx)(na.xv,{children:n.name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Description"}),(0,c.jsx)(na.xv,{children:n.description||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Allowed LLMs"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:0===n.models.length?(0,c.jsx)(na.Ct,{color:"red",children:"All Models"}):n.models.map(e=>{var s;return(0,c.jsx)(na.Ct,{color:"blue",children:(0,c.jsx)(z.Z,{title:"ID: ".concat(e),children:(null===(s=n.model_info)||void 0===s?void 0:s[e])||e})},e)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Created"}),(0,c.jsx)(na.xv,{children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(na.xv,{children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]})]})]})})]}):(0,c.jsx)("div",{children:"Loading..."})},ni=e=>{let{data:s,onEdit:t,onDelete:l,onSelectTag:a}=e,[r,i]=d.useState([{id:"created_at",desc:!0}]),n=[{header:"Tag Name",accessorKey:"name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:t.name,children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5",onClick:()=>a(t.name),children:t.name})})})}},{header:"Description",accessorKey:"description",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.description,children:(0,c.jsx)("span",{className:"text-xs",children:t.description||"-"})})}},{header:"Allowed LLMs",accessorKey:"models",cell:e=>{var s,t;let{row:l}=e,a=l.original;return(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:(null==a?void 0:null===(s=a.models)||void 0===s?void 0:s.length)===0?(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"red",children:"All Models"}):null==a?void 0:null===(t=a.models)||void 0===t?void 0:t.map(e=>{var s;return(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,c.jsx)(z.Z,{title:"ID: ".concat(e),children:(0,c.jsx)(w.Z,{children:(null===(s=a.model_info)||void 0===s?void 0:s[e])||e})})},e)})})}},{header:"Created",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,a=s.original;return(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>t(a),className:"cursor-pointer"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>l(a.name),className:"cursor-pointer"})]})}}],o=(0,sg.b7)({data:s,columns:n,state:{sorting:r},onSortingChange:i,getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0});return(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sv.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sb.Z,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(sZ.Z,{children:e.headers.map(e=>(0,c.jsx)(sN.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(s_.Z,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsx)(sZ.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(sy.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:n.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No tags found"})})})})})]})})})},nn=e=>{let{accessToken:s,userID:t,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[j,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(""),[k]=I.Z.useForm(),[S,A]=(0,d.useState)([]),T=async()=>{if(s)try{let e=await (0,g.tagListCall)(s);console.log("List tags response:",e),r(Object.values(e))}catch(e){console.error("Error fetching tags:",e),P.ZP.error("Error fetching tags: "+e)}},O=async e=>{if(s)try{await (0,g.tagCreateCall)(s,{name:e.tag_name,description:e.description,models:e.allowed_llms}),P.ZP.success("Tag created successfully"),n(!1),k.resetFields(),T()}catch(e){console.error("Error creating tag:",e),P.ZP.error("Error creating tag: "+e)}},M=async e=>{b(e),p(!0)},D=async()=>{if(s&&j){try{await (0,g.tagDeleteCall)(s,j),P.ZP.success("Tag deleted successfully"),T()}catch(e){console.error("Error deleting tag:",e),P.ZP.error("Error deleting tag: "+e)}p(!1),b(null)}};return(0,d.useEffect)(()=>{t&&l&&s&&(async()=>{try{let e=await (0,g.modelInfoCall)(s,t,l);e&&e.data&&A(e.data)}catch(e){console.error("Error fetching models:",e),P.ZP.error("Error fetching models: "+e)}})()},[s,t,l]),(0,d.useEffect)(()=>{T()},[s]),(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:o?(0,c.jsx)(nr,{tagId:o,onClose:()=>{m(null),x(!1)},accessToken:s,is_admin:"Admin"===l,editTag:u}):(0,c.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,c.jsx)("h1",{children:"Tag Management"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[N&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",N]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{T(),Z(new Date().toLocaleString())}})]})]}),(0,c.jsxs)(w.Z,{className:"mb-4",children:["Click on a tag name to view and edit its details.",(0,c.jsxs)("p",{children:["You can use tags to restrict the usage of certain LLMs based on tags passed in the request. Read more about tag routing ",(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/tag_routing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})]}),(0,c.jsx)(_.Z,{className:"mb-4",onClick:()=>n(!0),children:"+ Create New Tag"}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(ni,{data:a,onEdit:e=>{m(e.name),x(!0)},onDelete:M,onSelectTag:m})})}),(0,c.jsx)(E.Z,{title:"Create New Tag",visible:i,width:800,footer:null,onCancel:()=>{n(!1),k.resetFields()},children:(0,c.jsxs)(I.Z,{form:k,onFinish:O,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"Tag Name",name:"tag_name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Models"," ",(0,c.jsx)(z.Z,{title:"Select which LLMs are allowed to process requests from this tag",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_llms",children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select LLMs",children:S.map(e=>(0,c.jsx)(C.default.Option,{value:e.model_info.id,children:(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{children:e.model_name}),(0,c.jsxs)("span",{className:"text-gray-400 ml-2",children:["(",e.model_info.id,")"]})]})},e.model_info.id))})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(_.Z,{type:"submit",children:"Create Tag"})})]})}),h&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Tag"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this tag?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:D,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{p(!1),b(null)},children:"Cancel"})]})]})]})})]})})},no=e=>{let{data:s,onView:t,onEdit:l,onDelete:a}=e,[r,i]=d.useState([{id:"created_at",desc:!0}]),n=[{header:"Vector Store ID",accessorKey:"vector_store_id",cell:e=>{let{row:s}=e,l=s.original;return(0,c.jsx)("button",{onClick:()=>t(l.vector_store_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:l.vector_store_id.length>15?"".concat(l.vector_store_id.slice(0,15),"..."):l.vector_store_id})}},{header:"Name",accessorKey:"vector_store_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.vector_store_name,children:(0,c.jsx)("span",{className:"text-xs",children:t.vector_store_name||"-"})})}},{header:"Description",accessorKey:"vector_store_description",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.vector_store_description,children:(0,c.jsx)("span",{className:"text-xs",children:t.vector_store_description||"-"})})}},{header:"Provider",accessorKey:"custom_llm_provider",cell:e=>{let{row:s}=e,t=s.original,{displayName:l,logo:a}=(0,sO.dr)(t.custom_llm_provider);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,c.jsx)("img",{src:a,alt:l,className:"h-4 w-4"}),(0,c.jsx)("span",{className:"text-xs",children:l})]})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.updated_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>l(t.vector_store_id),className:"cursor-pointer"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>a(t.vector_store_id),className:"cursor-pointer"})]})}}],o=(0,sg.b7)({data:s,columns:n,state:{sorting:r},onSortingChange:i,getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0});return(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sv.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sb.Z,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(sZ.Z,{children:e.headers.map(e=>(0,c.jsx)(sN.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(s_.Z,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsx)(sZ.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(sy.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:n.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No vector stores found"})})})})})]})})})};(r=o||(o={})).Bedrock="Amazon Bedrock",r.PgVector="PostgreSQL pgvector (LiteLLM Connector)",r.VertexRagEngine="Vertex AI RAG Engine",r.OpenAI="OpenAI",r.Azure="Azure OpenAI";let nc={Bedrock:"bedrock",PgVector:"pg_vector",VertexRagEngine:"vertex_ai",OpenAI:"openai",Azure:"azure"},nd="/ui/assets/logos/",nm={"Amazon Bedrock":"".concat(nd,"bedrock.svg"),"PostgreSQL pgvector (LiteLLM Connector)":"".concat(nd,"postgresql.svg"),"Vertex AI RAG Engine":"".concat(nd,"google.svg"),OpenAI:"".concat(nd,"openai_small.svg"),"Azure OpenAI":"".concat(nd,"microsoft_azure.svg")},nu={bedrock:[],pg_vector:[{name:"api_base",label:"API Base",tooltip:"Enter the base URL of your deployed litellm-pgvector server (e.g., http://your-server:8000)",placeholder:"http://your-deployed-server:8000",required:!0,type:"text"},{name:"api_key",label:"API Key",tooltip:"Enter the API key from your deployed litellm-pgvector server",placeholder:"your-deployed-api-key",required:!0,type:"password"}],vertex_rag_engine:[],openai:[{name:"api_key",label:"API Key",tooltip:"Enter your OpenAI API key",placeholder:"sk-...",required:!0,type:"password"}],azure:[{name:"api_key",label:"API Key",tooltip:"Enter your Azure OpenAI API key",placeholder:"your-azure-api-key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Azure OpenAI endpoint (e.g., https://your-resource.openai.azure.com/)",placeholder:"https://your-resource.openai.azure.com/",required:!0,type:"text"}]},nx=e=>nu[e]||[];var nh=e=>{let{isVisible:s,onCancel:t,onSuccess:l,accessToken:a,credentials:r}=e,[i]=I.Z.useForm(),[n,m]=(0,d.useState)("{}"),[u,x]=(0,d.useState)("bedrock"),h=async e=>{if(a)try{let s={};try{s=n.trim()?JSON.parse(n):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:s,litellm_credential_name:e.litellm_credential_name},r=nx(e.custom_llm_provider).reduce((s,t)=>(s[t.name]=e[t.name],s),{});t.litellm_params=r,await (0,g.vectorStoreCreateCall)(a,t),P.ZP.success("Vector store created successfully"),i.resetFields(),m("{}"),l()}catch(e){console.error("Error creating vector store:",e),P.ZP.error("Error creating vector store: "+e)}},p=()=>{i.resetFields(),m("{}"),x("bedrock"),t()};return(0,c.jsx)(E.Z,{title:"Add New Vector Store",visible:s,width:1e3,footer:null,onCancel:p,children:(0,c.jsxs)(I.Z,{form:i,onFinish:h,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Provider"," ",(0,c.jsx)(z.Z,{title:"Select the provider for this vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],initialValue:"bedrock",children:(0,c.jsx)(C.default,{onChange:e=>x(e),children:Object.entries(o).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:nc[s],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:nm[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),"pg_vector"===u&&(0,c.jsx)(tJ.Z,{message:"PG Vector Setup Required",description:(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"LiteLLM provides a server to connect to PG Vector. To use this provider:"}),(0,c.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,c.jsxs)("li",{children:["Deploy the litellm-pgvector server from: ",(0,c.jsx)("a",{href:"https://github.com/BerriAI/litellm-pgvector",target:"_blank",rel:"noopener noreferrer",children:"https://github.com/BerriAI/litellm-pgvector"})]}),(0,c.jsx)("li",{children:"Configure your PostgreSQL database with pgvector extension"}),(0,c.jsx)("li",{children:"Start the server and note the API base URL and API key"}),(0,c.jsx)("li",{children:"Enter those details in the fields below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_rag_engine"===u&&(0,c.jsx)(tJ.Z,{message:"Vertex AI RAG Engine Setup",description:(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"To use Vertex AI RAG Engine:"}),(0,c.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,c.jsxs)("li",{children:["Set up your Vertex AI RAG Engine corpus following the guide: ",(0,c.jsx)("a",{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-overview",target:"_blank",rel:"noopener noreferrer",children:"Vertex AI RAG Engine Overview"})]}),(0,c.jsx)("li",{children:"Create a corpus in your Google Cloud project"}),(0,c.jsx)("li",{children:"Note the corpus ID from the Vertex AI console"}),(0,c.jsx)("li",{children:"Enter the corpus ID in the Vector Store ID field below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Vector Store ID"," ",(0,c.jsx)(z.Z,{title:"Enter the vector store ID from your api provider",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_id",rules:[{required:!0,message:"Please input the vector store ID from your api provider"}],children:(0,c.jsx)(y.Z,{placeholder:"vertex_rag_engine"===u?"6917529027641081856 (Get corpus ID from Vertex AI console)":"Enter vector store ID from your provider"})}),nx(u).map(e=>(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:[e.label," ",(0,c.jsx)(z.Z,{title:e.tooltip,children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:e.name,rules:e.required?[{required:!0,message:"Please input the ".concat(e.label.toLowerCase())}]:[],children:(0,c.jsx)(y.Z,{type:e.type||"text",placeholder:e.placeholder})},e.name)),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Vector Store Name"," ",(0,c.jsx)(z.Z,{title:"Custom name you want to give to the vector store, this name will be rendered on the LiteLLM UI",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_name",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"vector_store_description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Existing Credentials"," ",(0,c.jsx)(z.Z,{title:"Optionally select API provider credentials for this vector store eg. Bedrock API KEY",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...r.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON metadata for the vector store (optional)",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),children:(0,c.jsx)(L.default.TextArea,{rows:4,value:n,onChange:e=>m(e.target.value),placeholder:'{"key": "value"}'})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,c.jsx)(_.Z,{onClick:p,variant:"secondary",children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",type:"submit",children:"Create"})]})]})})},np=e=>{let{isVisible:s,onCancel:t,onConfirm:l}=e;return(0,c.jsxs)(E.Z,{title:"Delete Vector Store",visible:s,footer:null,onCancel:t,children:[(0,c.jsx)("p",{children:"Are you sure you want to delete this vector store? This action cannot be undone."}),(0,c.jsxs)("div",{className:"px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:l,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:t,variant:"primary",children:"Cancel"})]})]})};let{TextArea:ng}=L.default,{Text:nj,Title:nf}=eh.default;var nv=e=>{let{vectorStoreId:s,accessToken:t,className:l=""}=e,[a,r]=(0,d.useState)(""),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)({}),h=async()=>{if(!a.trim()){P.ZP.warning("Please enter a search query");return}n(!0);try{let e=await (0,g.vectorStoreSearchCall)(t,s,a),l={query:a,response:e,timestamp:Date.now()};m(e=>[l,...e]),r("")}catch(e){console.error("Error searching vector store:",e),P.ZP.error("Failed to search vector store")}finally{n(!1)}},p=e=>new Date(e).toLocaleString(),j=(e,s)=>{let t="".concat(e,"-").concat(s);x(e=>({...e,[t]:!e[t]}))};return(0,c.jsx)(tp.Z,{className:"w-full rounded-xl shadow-md",children:(0,c.jsxs)("div",{className:"flex flex-col h-[600px]",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a7.Z,{className:"mr-2 text-blue-500"}),(0,c.jsx)(nf,{level:4,className:"mb-0",children:"Test Vector Store"})]}),o.length>0&&(0,c.jsx)(T.ZP,{onClick:()=>{m([]),x({}),P.ZP.success("Search history cleared")},size:"small",children:"Clear History"})]}),(0,c.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===o.length?(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a7.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(nj,{children:"Test your vector store by entering a search query below"})]}):(0,c.jsx)("div",{className:"space-y-4",children:o.map((e,s)=>{var t;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("div",{className:"text-right",children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-blue-50 border border-blue-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,c.jsx)("strong",{className:"text-sm",children:"Query"}),(0,c.jsx)("span",{className:"text-xs text-gray-500",children:p(e.timestamp)})]}),(0,c.jsx)("div",{className:"text-left",children:e.query})]})}),(0,c.jsx)("div",{className:"text-left",children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-white border border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(a7.Z,{className:"text-green-500"}),(0,c.jsx)("strong",{className:"text-sm",children:"Vector Store Results"}),e.response&&(0,c.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600",children:[(null===(t=e.response.data)||void 0===t?void 0:t.length)||0," results"]})]}),e.response&&e.response.data&&e.response.data.length>0?(0,c.jsx)("div",{className:"space-y-3",children:e.response.data.map((e,t)=>{let l=u["".concat(s,"-").concat(t)]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden bg-gray-50",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>j(s,t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[l?(0,c.jsx)(tg.Z,{className:"text-gray-500 mr-2"}):(0,c.jsx)(tQ.Z,{className:"text-gray-500 mr-2"}),(0,c.jsxs)("span",{className:"font-medium text-sm",children:["Result ",t+1]}),!l&&e.content&&e.content[0]&&(0,c.jsxs)("span",{className:"ml-2 text-xs text-gray-500 truncate max-w-md",children:["- ",e.content[0].text.substring(0,100),"..."]})]}),(0,c.jsxs)("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:["Score: ",e.score.toFixed(4)]})]}),l&&(0,c.jsxs)("div",{className:"border-t bg-white p-3",children:[e.content&&e.content.map((e,s)=>(0,c.jsxs)("div",{className:"mb-3",children:[(0,c.jsxs)("div",{className:"text-xs text-gray-500 mb-1",children:["Content (",e.type,")"]}),(0,c.jsx)("div",{className:"text-sm bg-gray-50 p-3 rounded border text-gray-800 max-h-40 overflow-y-auto",children:e.text})]},s)),(e.file_id||e.filename||e.attributes)&&(0,c.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[(0,c.jsx)("div",{className:"text-xs text-gray-500 mb-2 font-medium",children:"Metadata"}),(0,c.jsxs)("div",{className:"space-y-2 text-xs",children:[e.file_id&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium",children:"File ID:"})," ",e.file_id]}),e.filename&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium",children:"Filename:"})," ",e.filename]}),e.attributes&&Object.keys(e.attributes).length>0&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium block mb-1",children:"Attributes:"}),(0,c.jsx)("pre",{className:"text-xs bg-white p-2 rounded border overflow-x-auto",children:JSON.stringify(e.attributes,null,2)})]})]})]})]})]},t)})}):(0,c.jsx)("div",{className:"text-gray-500 text-sm",children:"No results found"})]})}),s<o.length-1&&(0,c.jsx)(Q.Z,{})]},s)})}),i&&(0,c.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,c.jsx)(lu.Z,{indicator:(0,c.jsx)(a6.Z,{style:{fontSize:24},spin:!0})})})]}),(0,c.jsx)("div",{className:"p-4 border-t border-gray-200 bg-white",children:(0,c.jsxs)("div",{className:"flex items-end space-x-2",children:[(0,c.jsx)("div",{className:"flex-1",children:(0,c.jsx)(ng,{value:a,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),h())},placeholder:"Enter your search query... (Shift+Enter for new line)",disabled:i,autoSize:{minRows:1,maxRows:4},style:{resize:"none"}})}),(0,c.jsx)(T.ZP,{type:"primary",onClick:h,disabled:i||!a.trim(),icon:(0,c.jsx)(ra.Z,{}),loading:i,children:"Search"})]})})]})})},n_=e=>{let{vectorStoreId:s,onClose:t,accessToken:l,is_admin:a,editVectorStore:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(r),[x,h]=(0,d.useState)("{}"),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)("details"),y=async()=>{if(l)try{let e=await (0,g.vectorStoreInfoCall)(l,s);if(e&&e.vector_store){if(o(e.vector_store),e.vector_store.vector_store_metadata){let s="string"==typeof e.vector_store.vector_store_metadata?JSON.parse(e.vector_store.vector_store_metadata):e.vector_store.vector_store_metadata;h(JSON.stringify(s,null,2))}r&&i.setFieldsValue({vector_store_id:e.vector_store.vector_store_id,custom_llm_provider:e.vector_store.custom_llm_provider,vector_store_name:e.vector_store.vector_store_name,vector_store_description:e.vector_store.vector_store_description})}}catch(e){console.error("Error fetching vector store details:",e),P.ZP.error("Error fetching vector store details: "+e)}},b=async()=>{if(l)try{let e=await (0,g.credentialListCall)(l);console.log("List credentials response:",e),j(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e)}};(0,d.useEffect)(()=>{y(),b()},[s,l]);let N=async e=>{if(l)try{let s={};try{s=x?JSON.parse(x):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:s};await (0,g.vectorStoreUpdateCall)(l,t),P.ZP.success("Vector store updated successfully"),u(!1),y()}catch(e){console.error("Error updating vector store:",e),P.ZP.error("Error updating vector store: "+e)}};return n?(0,c.jsxs)("div",{className:"p-4 max-w-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",className:"mb-4",onClick:t,children:"Back to Vector Stores"}),(0,c.jsxs)(k.Z,{children:["Vector Store ID: ",n.vector_store_id]}),(0,c.jsx)(w.Z,{className:"text-gray-500",children:n.vector_store_description||"No description"})]}),a&&!m&&(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Vector Store"})]}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-6",children:[(0,c.jsx)(eW.Z,{children:"Details"}),(0,c.jsx)(eW.Z,{children:"Test Vector Store"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:m?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(k.Z,{children:"Edit Vector Store"})}),(0,c.jsx)(X.Z,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:N,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{label:"Vector Store ID",name:"vector_store_id",rules:[{required:!0,message:"Please input a vector store ID"}],children:(0,c.jsx)(L.default,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{label:"Vector Store Name",name:"vector_store_name",children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"vector_store_description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Provider"," ",(0,c.jsx)(z.Z,{title:"Select the provider for this vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{children:Object.entries(sO.Cl).map(e=>{let[s,t]=e;return"Bedrock"===s?(0,c.jsx)(C.default.Option,{value:sO.fK[s],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sO.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s):null})})}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsx)(w.Z,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter provider credentials below"})}),(0,c.jsx)(I.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...p.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON metadata for the vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),children:(0,c.jsx)(L.default.TextArea,{rows:4,value:x,onChange:e=>h(e.target.value),placeholder:'{"key": "value"}'})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:()=>u(!1),children:"Cancel"}),(0,c.jsx)(T.ZP,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]})})]}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Vector Store Details"}),a&&(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Vector Store"})]}),(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"ID"}),(0,c.jsx)(w.Z,{children:n.vector_store_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Name"}),(0,c.jsx)(w.Z,{children:n.vector_store_name||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Description"}),(0,c.jsx)(w.Z,{children:n.vector_store_description||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Provider"}),(0,c.jsx)("div",{className:"flex items-center space-x-2 mt-1",children:(()=>{let e=n.custom_llm_provider||"bedrock",{displayName:s,logo:t}=(()=>{let s=Object.keys(sO.fK).find(s=>sO.fK[s].toLowerCase()===e.toLowerCase());if(!s)return{displayName:e,logo:""};let t=sO.Cl[s],l=sO.cd[t];return{displayName:t,logo:l}})();return(0,c.jsxs)(c.Fragment,{children:[t&&(0,c.jsx)("img",{src:t,alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let t=e.target,l=t.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=s.charAt(0),l.replaceChild(e,t)}}}),(0,c.jsx)(eY.Z,{color:"blue",children:s})]})})()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("div",{className:"bg-gray-50 p-3 rounded mt-2 font-mono text-xs overflow-auto max-h-48",children:(0,c.jsx)("pre",{children:x})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(w.Z,{children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]})]})})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(nv,{vectorStoreId:n.vector_store_id,accessToken:l||""})})]})]})]}):(0,c.jsx)("div",{children:"Loading..."})},ny=e=>{let{accessToken:s,userID:t,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)(""),[j,y]=(0,d.useState)([]),[b,N]=(0,d.useState)(null),[Z,k]=(0,d.useState)(!1),S=async()=>{if(s)try{let e=await (0,g.vectorStoreListCall)(s);console.log("List vector stores response:",e),r(e.data||[])}catch(e){console.error("Error fetching vector stores:",e),P.ZP.error("Error fetching vector stores: "+e)}},C=async()=>{if(s)try{let e=await (0,g.credentialListCall)(s);console.log("List credentials response:",e),y(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e),P.ZP.error("Error fetching credentials: "+e)}},I=async e=>{x(e),m(!0)},E=async()=>{if(s&&u){try{await (0,g.vectorStoreDeleteCall)(s,u),P.ZP.success("Vector store deleted successfully"),S()}catch(e){console.error("Error deleting vector store:",e),P.ZP.error("Error deleting vector store: "+e)}m(!1),x(null)}};return(0,d.useEffect)(()=>{S(),C()},[s]),b?(0,c.jsx)("div",{className:"w-full h-full",children:(0,c.jsx)(n_,{vectorStoreId:b,onClose:()=>{N(null),k(!1),S()},accessToken:s,is_admin:(0,eL.tY)(l||""),editVectorStore:Z})}):(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,c.jsx)("h1",{children:"Vector Store Management"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[h&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",h]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{S(),C(),p(new Date().toLocaleString())}})]})]}),(0,c.jsx)(w.Z,{className:"mb-4",children:(0,c.jsx)("p",{children:"You can use vector stores to store and retrieve LLM embeddings.."})}),(0,c.jsx)(_.Z,{className:"mb-4",onClick:()=>n(!0),children:"+ Add Vector Store"}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(no,{data:a,onView:e=>{N(e),k(!1)},onEdit:e=>{N(e),k(!0)},onDelete:I})})}),(0,c.jsx)(nh,{isVisible:i,onCancel:()=>n(!1),onSuccess:()=>{n(!1),S()},accessToken:s,credentials:j}),(0,c.jsx)(np,{isVisible:o,onCancel:()=>m(!1),onConfirm:E})]})})},nb=t(49096),nN=t(53335);let{cva:nZ,cx:nw,compose:nk}=(0,nb.ZD)({hooks:{onComplete:e=>(0,nN.m6)(e)}});function nS(e){var s,t;let{className:l="",...a}=e,r=(0,d.useId)();return s=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),s=e.find(e=>{var s;return(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))===r}),t=e.find(e=>{var s;return e.effect instanceof KeyframeEffect&&(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))!==r});s&&t&&(s.currentTime=t.currentTime)},t=[r],(0,d.useLayoutEffect)(s,t),(0,c.jsxs)("svg",{"data-spinner-id":r,className:nw("pointer-events-none size-12 animate-spin text-current",l),fill:"none",viewBox:"0 0 24 24",...a,children:[(0,c.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,c.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}let nC=new x.S;function nI(){return(0,c.jsxs)("div",{className:nw("h-screen","flex items-center justify-center gap-4"),children:[(0,c.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"\uD83D\uDE85 LiteLLM"}),(0,c.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,c.jsx)(nS,{className:"size-4"}),(0,c.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}function nP(){let[e,s]=(0,d.useState)(""),[t,l]=(0,d.useState)(!1),[a,r]=(0,d.useState)(!1),[i,n]=(0,d.useState)(null),[o,x]=(0,d.useState)(null),[f,v]=(0,d.useState)([]),[_,y]=(0,d.useState)([]),[b,N]=(0,d.useState)([]),[Z,w]=(0,d.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),[k,S]=(0,d.useState)(!0),C=(0,m.useSearchParams)(),[I,P]=(0,d.useState)({data:[]}),[E,A]=(0,d.useState)(null),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(!0),[D,F]=(0,d.useState)(null),R=C.get("invitation_id"),[q,U]=(0,d.useState)(()=>C.get("page")||"api-keys"),[z,V]=(0,d.useState)(null),K=e=>{v(s=>s?[...s,e]:[e]),L(()=>!T)},B=!1===O&&null===E&&null===R;return((0,d.useEffect)(()=>{let e=function(e){let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));return s?s.split("=")[1]:null}("token");(0,g.getUiConfig)().then(s=>{A(e),M(!1)})},[]),(0,d.useEffect)(()=>{B&&(window.location.href=(g.proxyBaseUrl||"")+"/sso/key/generate")},[B]),(0,d.useEffect)(()=>{if(!E)return;let e=(0,u.o)(E);if(e){if(V(e.key),r(e.disabled_non_admin_personal_key_creation),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);s(t),"Admin Viewer"==t&&U("usage")}e.user_email&&n(e.user_email),e.login_method&&S("username_password"==e.login_method),e.premium_user&&l(e.premium_user),e.auth_header_name&&(0,g.setGlobalLitellmHeaderName)(e.auth_header_name),e.user_id&&F(e.user_id)}},[E]),(0,d.useEffect)(()=>{z&&D&&e&&eK(D,e,z,N),z&&D&&e&&j(z,D,e,null,x),z&&lb(z,y)},[z,D,e]),O||B)?(0,c.jsx)(nI,{}):(0,c.jsx)(d.Suspense,{fallback:(0,c.jsx)(nI,{}),children:(0,c.jsx)(h.aH,{client:nC,children:R?(0,c.jsx)(sT,{userID:D,userRole:e,premiumUser:t,teams:o,keys:f,setUserRole:s,userEmail:i,setUserEmail:n,setTeams:x,setKeys:v,organizations:_,addKey:K,createClicked:T}):(0,c.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,c.jsx)(p.Z,{userID:D,userRole:e,premiumUser:t,userEmail:i,setProxySettings:w,proxySettings:Z,accessToken:z,isPublicPage:!1}),(0,c.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,c.jsx)("div",{className:"mt-8",children:(0,c.jsx)(rC,{accessToken:z,setPage:e=>{let s=new URLSearchParams(C);s.set("page",e),window.history.pushState(null,"","?".concat(s.toString())),U(e)},userRole:e,defaultSelectedKey:q})}),"api-keys"==q?(0,c.jsx)(sT,{userID:D,userRole:e,premiumUser:t,teams:o,keys:f,setUserRole:s,userEmail:i,setUserEmail:n,setTeams:x,setKeys:v,organizations:_,addKey:K,createClicked:T}):"models"==q?(0,c.jsx)(ls,{userID:D,userRole:e,token:E,keys:f,accessToken:z,modelData:I,setModelData:P,premiumUser:t,teams:o}):"llm-playground"==q?(0,c.jsx)(rn,{userID:D,userRole:e,token:E,accessToken:z,disabledPersonalKeyCreation:a}):"users"==q?(0,c.jsx)(lg,{userID:D,userRole:e,token:E,keys:f,teams:o,accessToken:z,setKeys:v}):"teams"==q?(0,c.jsx)(l_,{teams:o,setTeams:x,searchParams:C,accessToken:z,userID:D,userRole:e,organizations:_,premiumUser:t}):"organizations"==q?(0,c.jsx)(lN,{organizations:_,setOrganizations:y,userModels:b,accessToken:z,userRole:e,premiumUser:t}):"admin-panel"==q?(0,c.jsx)(lM,{setTeams:x,searchParams:C,accessToken:z,userID:D,showSSOBanner:k,premiumUser:t,proxySettings:Z}):"api_ref"==q?(0,c.jsx)(aO,{proxySettings:Z}):"settings"==q?(0,c.jsx)(lG,{userID:D,userRole:e,accessToken:z,premiumUser:t}):"budgets"==q?(0,c.jsx)(l6,{accessToken:z}):"guardrails"==q?(0,c.jsx)(ib,{accessToken:z,userRole:e}):"transform-request"==q?(0,c.jsx)(iN,{accessToken:z}):"general-settings"==q?(0,c.jsx)(l1,{userID:D,userRole:e,accessToken:z,modelData:I}):"model-hub-table"==q?(0,c.jsx)(af.Z,{accessToken:z,publicPage:!1,premiumUser:t,userRole:e}):"caching"==q?(0,c.jsx)(rq,{userID:D,userRole:e,token:E,accessToken:z,premiumUser:t}):"pass-through-settings"==q?(0,c.jsx)(t9,{userID:D,userRole:e,accessToken:z,modelData:I}):"logs"==q?(0,c.jsx)(ag,{userID:D,userRole:e,token:E,accessToken:z,allTeams:null!=o?o:[],premiumUser:t}):"mcp-servers"==q?(0,c.jsx)(i8,{accessToken:z,userRole:e,userID:D}):"tag-management"==q?(0,c.jsx)(nn,{accessToken:z,userRole:e,userID:D}):"vector-stores"==q?(0,c.jsx)(ny,{accessToken:z,userRole:e,userID:D}):"new_usage"==q?(0,c.jsx)(aL,{userID:D,userRole:e,accessToken:z,teams:null!=o?o:[],premiumUser:t}):(0,c.jsx)(rE,{userID:D,userRole:e,token:E,accessToken:z,keys:f,premiumUser:t})]})]})})})}}},function(e){e.O(0,[665,990,445,152,634,475,199,338,162,172,971,117,744],function(){return e(e.s=1900)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/main-app-475d6efe4080647d.js b/litellm/proxy/_experimental/out/_next/static/chunks/main-app-4f7318ae681a6d94.jssimilarity index 54%rename from litellm/proxy/_experimental/out/_next/static/chunks/main-app-475d6efe4080647d.jsrename to litellm/proxy/_experimental/out/_next/static/chunks/main-app-4f7318ae681a6d94.jsindex 47508fc7a01..04cf9b11058 100644--- a/litellm/proxy/_experimental/out/_next/static/chunks/main-app-475d6efe4080647d.js+++ b/litellm/proxy/_experimental/out/_next/static/chunks/main-app-4f7318ae681a6d94.js@@ -1 +1 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{20169:function(e,n,t){Promise.resolve().then(t.t.bind(t,12846,23)),Promise.resolve().then(t.t.bind(t,19107,23)),Promise.resolve().then(t.t.bind(t,61060,23)),Promise.resolve().then(t.t.bind(t,4707,23)),Promise.resolve().then(t.t.bind(t,80,23)),Promise.resolve().then(t.t.bind(t,36423,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,117],function(){return n(54278),n(20169)}),_N_E=e.O()}]);\ No newline at end of file+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{10264:function(e,n,t){Promise.resolve().then(t.t.bind(t,12846,23)),Promise.resolve().then(t.t.bind(t,19107,23)),Promise.resolve().then(t.t.bind(t,61060,23)),Promise.resolve().then(t.t.bind(t,4707,23)),Promise.resolve().then(t.t.bind(t,80,23)),Promise.resolve().then(t.t.bind(t,36423,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,117],function(){return n(54278),n(10264)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/index.html b/litellm/proxy/_experimental/out/index.htmlindex be86f2e9933..2cf3668e29b 100644--- a/litellm/proxy/_experimental/out/index.html+++ b/litellm/proxy/_experimental/out/index.html@@ -1 +1 @@-<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-475d6efe4080647d.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[45976,[\"665\",\"static/chunks/3014691f-b7b79b78e27792f3.js\",\"990\",\"static/chunks/13b76428-ebdf3012af0e4489.js\",\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"475\",\"static/chunks/475-4e66b9c01db4c006.js\",\"199\",\"static/chunks/199-9064d94cb58e5474.js\",\"338\",\"static/chunks/338-58247f2bc5fc3b51.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"172\",\"static/chunks/172-b2d8ff2740510f56.js\",\"931\",\"static/chunks/app/page-f64fe7b1998a3ca8.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-NrHJ0b9HqrHBQ9wRZS8v\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of file+<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-4f7318ae681a6d94.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[58193,[\"665\",\"static/chunks/3014691f-b7b79b78e27792f3.js\",\"990\",\"static/chunks/13b76428-ebdf3012af0e4489.js\",\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"475\",\"static/chunks/475-4e66b9c01db4c006.js\",\"199\",\"static/chunks/199-7d06fdac37bed3ff.js\",\"338\",\"static/chunks/338-5db4fbaf3c5da53d.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"172\",\"static/chunks/172-b2d8ff2740510f56.js\",\"931\",\"static/chunks/app/page-ae1e298d739b09ba.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-EIomgntDHk-HrU9rbKNY\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/index.txt b/litellm/proxy/_experimental/out/index.txtindex 004e44084ba..3f5f9cb0682 100644--- a/litellm/proxy/_experimental/out/index.txt+++ b/litellm/proxy/_experimental/out/index.txt@@ -1,7 +1,7 @@2:I[19107,[],"ClientPageRoot"]-3:I[45976,["665","static/chunks/3014691f-b7b79b78e27792f3.js","990","static/chunks/13b76428-ebdf3012af0e4489.js","445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","634","static/chunks/634-74ee1cee62277068.js","475","static/chunks/475-4e66b9c01db4c006.js","199","static/chunks/199-9064d94cb58e5474.js","338","static/chunks/338-58247f2bc5fc3b51.js","162","static/chunks/162-e1f42f86a1eb3286.js","172","static/chunks/172-b2d8ff2740510f56.js","931","static/chunks/app/page-f64fe7b1998a3ca8.js"],"default",1]+3:I[58193,["665","static/chunks/3014691f-b7b79b78e27792f3.js","990","static/chunks/13b76428-ebdf3012af0e4489.js","445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","634","static/chunks/634-74ee1cee62277068.js","475","static/chunks/475-4e66b9c01db4c006.js","199","static/chunks/199-7d06fdac37bed3ff.js","338","static/chunks/338-5db4fbaf3c5da53d.js","162","static/chunks/162-e1f42f86a1eb3286.js","172","static/chunks/172-b2d8ff2740510f56.js","931","static/chunks/app/page-ae1e298d739b09ba.js"],"default",1]4:I[4707,[],""]5:I[36423,[],""]-0:["-NrHJ0b9HqrHBQ9wRZS8v",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]+0:["-EIomgntDHk-HrU9rbKNY",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]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":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]]1:nulldiff --git a/litellm/proxy/_experimental/out/model_hub.txt b/litellm/proxy/_experimental/out/model_hub.txtindex 835cab5bb8d..7c87a5ebc0c 100644--- a/litellm/proxy/_experimental/out/model_hub.txt+++ b/litellm/proxy/_experimental/out/model_hub.txt@@ -1,7 +1,7 @@2:I[19107,[],"ClientPageRoot"]-3:I[52829,["445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","338","static/chunks/338-58247f2bc5fc3b51.js","162","static/chunks/162-e1f42f86a1eb3286.js","418","static/chunks/app/model_hub/page-43595a95e1b23546.js"],"default",1]+3:I[52829,["445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","338","static/chunks/338-5db4fbaf3c5da53d.js","162","static/chunks/162-e1f42f86a1eb3286.js","418","static/chunks/app/model_hub/page-1808d9da6d48b76d.js"],"default",1]4:I[4707,[],""]5:I[36423,[],""]-0:["-NrHJ0b9HqrHBQ9wRZS8v",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]+0:["-EIomgntDHk-HrU9rbKNY",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]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":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]]1:nulldiff --git a/litellm/proxy/_experimental/out/model_hub_table.txt b/litellm/proxy/_experimental/out/model_hub_table.txtindex b14881aa5cf..6172d3f0ed3 100644--- a/litellm/proxy/_experimental/out/model_hub_table.txt+++ b/litellm/proxy/_experimental/out/model_hub_table.txt@@ -1,7 +1,7 @@2:I[19107,[],"ClientPageRoot"]-3:I[22775,["445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","634","static/chunks/634-74ee1cee62277068.js","475","static/chunks/475-4e66b9c01db4c006.js","338","static/chunks/338-58247f2bc5fc3b51.js","162","static/chunks/162-e1f42f86a1eb3286.js","172","static/chunks/172-b2d8ff2740510f56.js","25","static/chunks/app/model_hub_table/page-f3fc1d21cad686db.js"],"default",1]+3:I[22775,["445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","634","static/chunks/634-74ee1cee62277068.js","475","static/chunks/475-4e66b9c01db4c006.js","338","static/chunks/338-5db4fbaf3c5da53d.js","162","static/chunks/162-e1f42f86a1eb3286.js","172","static/chunks/172-b2d8ff2740510f56.js","25","static/chunks/app/model_hub_table/page-6750ac8910a46248.js"],"default",1]4:I[4707,[],""]5:I[36423,[],""]-0:["-NrHJ0b9HqrHBQ9wRZS8v",[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub_table",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub_table","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]+0:["-EIomgntDHk-HrU9rbKNY",[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub_table",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub_table","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]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":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]]1:nulldiff --git a/litellm/proxy/_experimental/out/model_hub_table/index.html b/litellm/proxy/_experimental/out/model_hub_table/index.htmlindex 155cf9b802a..8952f372168 100644--- a/litellm/proxy/_experimental/out/model_hub_table/index.html+++ b/litellm/proxy/_experimental/out/model_hub_table/index.html@@ -1 +1 @@-<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-475d6efe4080647d.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[22775,[\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"475\",\"static/chunks/475-4e66b9c01db4c006.js\",\"338\",\"static/chunks/338-58247f2bc5fc3b51.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"172\",\"static/chunks/172-b2d8ff2740510f56.js\",\"25\",\"static/chunks/app/model_hub_table/page-f3fc1d21cad686db.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-NrHJ0b9HqrHBQ9wRZS8v\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"model_hub_table\"],\"initialTree\":[\"\",{\"children\":[\"model_hub_table\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"model_hub_table\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"model_hub_table\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of file+<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-4f7318ae681a6d94.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[22775,[\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"475\",\"static/chunks/475-4e66b9c01db4c006.js\",\"338\",\"static/chunks/338-5db4fbaf3c5da53d.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"172\",\"static/chunks/172-b2d8ff2740510f56.js\",\"25\",\"static/chunks/app/model_hub_table/page-6750ac8910a46248.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-EIomgntDHk-HrU9rbKNY\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"model_hub_table\"],\"initialTree\":[\"\",{\"children\":[\"model_hub_table\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"model_hub_table\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"model_hub_table\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/onboarding.txt b/litellm/proxy/_experimental/out/onboarding.txtindex 033c7f018fd..4130dd53426 100644--- a/litellm/proxy/_experimental/out/onboarding.txt+++ b/litellm/proxy/_experimental/out/onboarding.txt@@ -1,7 +1,7 @@2:I[19107,[],"ClientPageRoot"]-3:I[12011,["665","static/chunks/3014691f-b7b79b78e27792f3.js","445","static/chunks/445-e14a4d059f7305d5.js","634","static/chunks/634-74ee1cee62277068.js","338","static/chunks/338-58247f2bc5fc3b51.js","461","static/chunks/app/onboarding/page-73a77fc5d4952c09.js"],"default",1]+3:I[12011,["665","static/chunks/3014691f-b7b79b78e27792f3.js","445","static/chunks/445-e14a4d059f7305d5.js","634","static/chunks/634-74ee1cee62277068.js","338","static/chunks/338-5db4fbaf3c5da53d.js","461","static/chunks/app/onboarding/page-acdf578c06ba6714.js"],"default",1]4:I[4707,[],""]5:I[36423,[],""]-0:["-NrHJ0b9HqrHBQ9wRZS8v",[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["onboarding",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","onboarding","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]+0:["-EIomgntDHk-HrU9rbKNY",[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["onboarding",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","onboarding","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]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":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]]1:nulldiff --git a/ui/litellm-dashboard/out/404.html b/ui/litellm-dashboard/out/404.htmlindex 01a1febdd17..eaee737f777 100644--- a/ui/litellm-dashboard/out/404.html+++ b/ui/litellm-dashboard/out/404.html@@ -1 +1 @@-<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css" data-precedence="next"/><link rel="stylesheet" href="/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-475d6efe4080647d.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__className_b0dd8a"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[4707,[],\"\"]\n7:I[36423,[],\"\"]\nd:I[61060,[],\"\"]\n8:{\"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\"}\n9:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\na:{\"display\":\"inline-block\"}\nb:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\ne:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-NrHJ0b9HqrHBQ9wRZS8v\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[[\"$\",\"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.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"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\":\"$9\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$a\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$b\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lc\"],\"globalErrorComponent\":\"$d\",\"missingSlots\":\"$We\"}]\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"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\":\"./favicon.ico\"}],[\"$\",\"meta\",\"5\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of file+<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css" data-precedence="next"/><link rel="stylesheet" href="/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-4f7318ae681a6d94.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__className_b0dd8a"><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>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)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[4707,[],\"\"]\n7:I[36423,[],\"\"]\nd:I[61060,[],\"\"]\n8:{\"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\"}\n9:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\na:{\"display\":\"inline-block\"}\nb:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\ne:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-EIomgntDHk-HrU9rbKNY\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[[\"$\",\"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.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"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\":\"$9\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$a\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$b\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lc\"],\"globalErrorComponent\":\"$d\",\"missingSlots\":\"$We\"}]\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"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\":\"./favicon.ico\"}],[\"$\",\"meta\",\"5\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/-NrHJ0b9HqrHBQ9wRZS8v/_buildManifest.js b/ui/litellm-dashboard/out/_next/static/-EIomgntDHk-HrU9rbKNY/_buildManifest.jssimilarity index 100%rename from ui/litellm-dashboard/out/_next/static/-NrHJ0b9HqrHBQ9wRZS8v/_buildManifest.jsrename to ui/litellm-dashboard/out/_next/static/-EIomgntDHk-HrU9rbKNY/_buildManifest.jsdiff --git a/ui/litellm-dashboard/out/_next/static/-NrHJ0b9HqrHBQ9wRZS8v/_ssgManifest.js b/ui/litellm-dashboard/out/_next/static/-EIomgntDHk-HrU9rbKNY/_ssgManifest.jssimilarity index 100%rename from ui/litellm-dashboard/out/_next/static/-NrHJ0b9HqrHBQ9wRZS8v/_ssgManifest.jsrename to ui/litellm-dashboard/out/_next/static/-EIomgntDHk-HrU9rbKNY/_ssgManifest.jsdiff --git a/ui/litellm-dashboard/out/_next/static/chunks/199-9064d94cb58e5474.js b/ui/litellm-dashboard/out/_next/static/chunks/199-7d06fdac37bed3ff.jssimilarity index 70%rename from ui/litellm-dashboard/out/_next/static/chunks/199-9064d94cb58e5474.jsrename to ui/litellm-dashboard/out/_next/static/chunks/199-7d06fdac37bed3ff.jsindex 570da128591..4cfc11ce022 100644--- a/ui/litellm-dashboard/out/_next/static/chunks/199-9064d94cb58e5474.js+++ b/ui/litellm-dashboard/out/_next/static/chunks/199-7d06fdac37bed3ff.js@@ -1,11 +1,11 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199],{12660:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},88009:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},37527:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]},name:"bank",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},9775:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},68208:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83669:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26430:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},5540:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11894:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},44625:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26349:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62670:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},73879:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},29271:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41169:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11741:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},97416:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},6520:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34310:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM472 744a40 40 0 1080 0 40 40 0 10-80 0zm16-104h48c4.4 0 8-3.6 8-8V448c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8z"}}]},name:"file-exclamation",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},38434:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},10798:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71282:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},92403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},48231:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62272:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},45246:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},16601:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},99890:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},28595:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},96473:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},89245:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},69993:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},78355:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},23907:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},55322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},8881:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71891:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41361:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"}}]},name:"team",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58630:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},3632:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},35291:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58747:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}},75105:function(e,t,n){"use strict";n.d(t,{Z:function(){return et}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(87602),s=n(59221),c=n(86757),u=n.n(c),d=n(95645),f=n.n(d),p=n(77571),h=n.n(p),m=n(82559),g=n.n(m),v=n(21652),y=n.n(v),b=n(57165),x=n(81889),w=n(9841),k=n(58772),S=n(34067),E=n(16630),O=n(85355),C=n(82944),j=["layout","type","stroke","connectNulls","isRange","ref"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(i,e);var t,n,r,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=R(i);return e=t?Reflect.construct(n,arguments,R(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return I(e)}(this,e)});function i(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return D(I(e=a.call.apply(a,[this].concat(n))),"state",{isAnimationFinished:!0}),D(I(e),"id",(0,E.EL)("recharts-area-")),D(I(e),"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),u()(t)&&t()}),D(I(e),"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),u()(t)&&t()}),e}return n=[{key:"renderDots",value:function(e,t,n){var r=this.props.isAnimationActive,a=this.state.isAnimationFinished;if(r&&!a)return null;var l=this.props,s=l.dot,c=l.points,u=l.dataKey,d=(0,C.L6)(this.props,!1),f=(0,C.L6)(s,!0),p=c.map(function(e,t){var n=T(T(T({key:"dot-".concat(t),r:3},d),f),{},{dataKey:u,cx:e.x,cy:e.y,index:t,value:e.value,payload:e.payload});return i.renderDotItem(s,n)}),h={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return o.createElement(w.m,P({className:"recharts-area-dots"},h),p)}},{key:"renderHorizontalRect",value:function(e){var t=this.props,n=t.baseLine,r=t.points,a=t.strokeWidth,i=r[0].x,l=r[r.length-1].x,s=e*Math.abs(i-l),c=f()(r.map(function(e){return e.y||0}));return((0,E.hj)(n)&&"number"==typeof n?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(f()(n.map(function(e){return e.y||0})),c)),(0,E.hj)(c))?o.createElement("rect",{x:i<l?i:i-s,y:0,width:s,height:Math.floor(c+(a?parseInt("".concat(a),10):1))}):null}},{key:"renderVerticalRect",value:function(e){var t=this.props,n=t.baseLine,r=t.points,a=t.strokeWidth,i=r[0].y,l=r[r.length-1].y,s=e*Math.abs(i-l),c=f()(r.map(function(e){return e.x||0}));return((0,E.hj)(n)&&"number"==typeof n?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(f()(n.map(function(e){return e.x||0})),c)),(0,E.hj)(c))?o.createElement("rect",{x:0,y:i<l?i:i-s,width:c+(a?parseInt("".concat(a),10):1),height:Math.floor(s)}):null}},{key:"renderClipRect",value:function(e){return"vertical"===this.props.layout?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:"renderAreaStatically",value:function(e,t,n,r){var a=this.props,i=a.layout,l=a.type,s=a.stroke,c=a.connectNulls,u=a.isRange,d=(a.ref,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,j));return o.createElement(w.m,{clipPath:n?"url(#clipPath-".concat(r,")"):null},o.createElement(b.H,P({},(0,C.L6)(d,!0),{points:e,connectNulls:c,type:l,baseLine:t,layout:i,stroke:"none",className:"recharts-area-area"})),"none"!==s&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:e})),"none"!==s&&u&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var n=this,r=this.props,a=r.points,i=r.baseLine,l=r.isAnimationActive,c=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationId,p=this.state,m=p.prevPoints,v=p.prevBaseLine;return o.createElement(s.ZP,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"area-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var l=r.t;if(m){var s,c=m.length/a.length,u=a.map(function(e,t){var n=Math.floor(t*c);if(m[n]){var r=m[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e});return s=(0,E.hj)(i)&&"number"==typeof i?(0,E.k4)(v,i)(l):h()(i)||g()(i)?(0,E.k4)(v,0)(l):i.map(function(e,t){var n=Math.floor(t*c);if(v[n]){var r=v[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e}),n.renderAreaStatically(u,s,e,t)}return o.createElement(w.m,null,o.createElement("defs",null,o.createElement("clipPath",{id:"animationClipPath-".concat(t)},n.renderClipRect(l))),o.createElement(w.m,{clipPath:"url(#animationClipPath-".concat(t,")")},n.renderAreaStatically(a,i,e,t)))})}},{key:"renderArea",value:function(e,t){var n=this.props,r=n.points,o=n.baseLine,a=n.isAnimationActive,i=this.state,l=i.prevPoints,s=i.prevBaseLine,c=i.totalLength;return a&&r&&r.length&&(!l&&c>0||!y()(l,r)||!y()(s,o))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,o,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,a=t.points,i=t.className,s=t.top,c=t.left,u=t.xAxis,d=t.yAxis,f=t.width,p=t.height,m=t.isAnimationActive,g=t.id;if(n||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=1===a.length,b=(0,l.Z)("recharts-area",i),x=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,E=x||S,O=h()(g)?this.id:g,j=null!==(e=(0,C.L6)(r,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,C.$k)(r)?r:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return o.createElement(w.m,{className:b},x||S?o.createElement("defs",null,o.createElement("clipPath",{id:"clipPath-".concat(O)},o.createElement("rect",{x:x?c:c-f/2,y:S?s:s-p/2,width:x?f:2*f,height:S?p:2*p})),!T&&o.createElement("clipPath",{id:"clipPath-dots-".concat(O)},o.createElement("rect",{x:c-A/2,y:s-A/2,width:f+A,height:p+A}))):null,y?null:this.renderArea(E,O),(r||y)&&this.renderDots(E,T,O),(!m||v)&&k.e.renderCallByParent(this.props,a))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],n&&A(i.prototype,n),r&&A(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}(o.PureComponent);D(Z,"displayName","Area"),D(Z,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!S.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),D(Z,"getBaseValue",function(e,t,n,r){var o=e.layout,a=e.baseValue,i=t.props.baseValue,l=null!=i?i:a;if((0,E.hj)(l)&&"number"==typeof l)return l;var s="horizontal"===o?r:n,c=s.scale.domain();if("number"===s.type){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return"dataMin"===l?d:"dataMax"===l?u:u<0?u:Math.max(Math.min(c[0],c[1]),0)}return"dataMin"===l?c[0]:"dataMax"===l?c[1]:c[0]}),D(Z,"getComposedData",function(e){var t,n=e.props,r=e.item,o=e.xAxis,a=e.yAxis,i=e.xAxisTicks,l=e.yAxisTicks,s=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,p=e.offset,h=n.layout,m=u&&u.length,g=Z.getBaseValue(n,r,o,a),v="horizontal"===h,y=!1,b=f.map(function(e,t){m?n=u[d+t]:Array.isArray(n=(0,O.F$)(e,c))?y=!0:n=[g,n];var n,r=null==n[1]||m&&null==(0,O.F$)(e,c);return v?{x:(0,O.Hv)({axis:o,ticks:i,bandSize:s,entry:e,index:t}),y:r?null:a.scale(n[1]),value:n,payload:e}:{x:r?null:o.scale(n[1]),y:(0,O.Hv)({axis:a,ticks:l,bandSize:s,entry:e,index:t}),value:n,payload:e}});return t=m||y?b.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?a.scale(t):null}:{x:null!=t?o.scale(t):null,y:e.y}}):v?a.scale(g):o.scale(g),T({points:b,baseLine:t,layout:h,isRange:y},p)}),D(Z,"renderDotItem",function(e,t){return o.isValidElement(e)?o.cloneElement(e,t):u()(e)?e(t):o.createElement(x.o,P({},t,{className:"recharts-area-dot"}))});var z=n(97059),B=n(62994),F=n(25311),H=(0,i.z)({chartName:"AreaChart",GraphicalChild:Z,axisComponents:[{axisType:"xAxis",AxisComp:z.K},{axisType:"yAxis",AxisComp:B.B}],formatAxisMap:F.t9}),q=n(56940),W=n(8147),U=n(22190),K=n(54061),$=n(65278),V=n(98593),X=n(69448),G=n(32644),Y=n(7084),Q=n(26898),J=n(97324),ee=n(1153);let et=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:l,stack:s=!1,colors:c=Q.s,valueFormatter:u=ee.Cj,startEndOnly:d=!1,showXAxis:f=!0,showYAxis:p=!0,yAxisWidth:h=56,intervalType:m="equidistantPreserveStart",showAnimation:g=!1,animationDuration:v=900,showTooltip:y=!0,showLegend:b=!0,showGridLines:w=!0,showGradient:k=!0,autoMinValue:S=!1,curveType:E="linear",minValue:O,maxValue:C,connectNulls:j=!1,allowDecimals:_=!0,noDataText:P,className:N,onValueChange:T,enableLegendSlider:A=!1,customTooltip:M,rotateLabelX:I,tickGap:R=5}=e,D=(0,r._T)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),L=(f||p)&&(!d||p)?20:0,[F,et]=(0,o.useState)(60),[en,er]=(0,o.useState)(void 0),[eo,ea]=(0,o.useState)(void 0),ei=(0,G.me)(i,c),el=(0,G.i4)(S,O,C),es=!!T;function ec(e){es&&(e===eo&&!en||(0,G.FB)(n,e)&&en&&en.dataKey===e?(ea(void 0),null==T||T(null)):(ea(e),null==T||T({eventType:"category",categoryClicked:e})),er(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,J.q)("w-full h-80",N)},D),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(H,{data:n,onClick:es&&(eo||en)?()=>{er(void 0),ea(void 0),null==T||T(null)}:void 0},w?o.createElement(q.q,{className:(0,J.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(z.K,{padding:{left:L,right:L},hide:!f,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:d?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:d?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:R,angle:null==I?void 0:I.angle,dy:null==I?void 0:I.verticalShift,height:null==I?void 0:I.xAxisHeight}),o.createElement(B.B,{width:h,hide:!p,axisLine:!1,tickLine:!1,type:"number",domain:el,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:_}),o.createElement(W.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:y?e=>{let{active:t,payload:n,label:r}=e;return M?o.createElement(M,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:Y.fr.Gray})}),active:t,label:r}):o.createElement(V.ZP,{active:t,payload:n,label:r,valueFormatter:u,categoryColors:ei})}:o.createElement(o.Fragment,null),position:{y:0}}),b?o.createElement(U.D,{verticalAlign:"top",height:F,content:e=>{let{payload:t}=e;return(0,$.Z)({payload:t},ei,et,eo,es?e=>ec(e):void 0,A)}}):null,i.map(e=>{var t,n;return o.createElement("defs",{key:e},k?o.createElement("linearGradient",{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.15:.4}),o.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):o.createElement("linearGradient",{className:(0,ee.bM)(null!==(n=ei.get(e))&&void 0!==n?n:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.1:.3})))}),i.map(e=>{var t;return o.createElement(Z,{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).strokeColor,strokeOpacity:en||eo&&eo!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(x.o,{className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(t=ei.get(u))&&void 0!==t?t:Y.fr.Gray,Q.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),es&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,G.FB)(n,e.dataKey)&&eo&&eo===e.dataKey?(ea(void 0),er(void 0),null==T||T(null)):(ea(e.dataKey),er({index:e.index,dataKey:e.dataKey}),null==T||T(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,G.FB)(n,e)&&!(en||eo&&eo!==e)||(null==en?void 0:en.index)===f&&(null==en?void 0:en.dataKey)===e?o.createElement(x.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(r=ei.get(d))&&void 0!==r?r:Y.fr.Gray,Q.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:E,dataKey:e,stroke:"",fill:"url(#".concat(ei.get(e),")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:g,animationDuration:v,stackId:s?"a":void 0,connectNulls:j})}),T?i.map(e=>o.createElement(K.x,{className:(0,J.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:E,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:j,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ec(n)}})):null):o.createElement(X.Z,{noDataText:P})))});et.displayName="AreaChart"},40278:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(47625),u=n(93765),d=n(31699),f=n(97059),p=n(62994),h=n(25311),m=(0,u.z)({chartName:"BarChart",GraphicalChild:d.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:f.K},{axisType:"yAxis",AxisComp:p.B}],formatAxisMap:h.t9}),g=n(56940),v=n(8147),y=n(22190),b=n(65278),x=n(98593),w=n(69448),k=n(32644);let S=s.forwardRef((e,t)=>{let{data:n=[],categories:u=[],index:h,colors:S=a.s,valueFormatter:E=l.Cj,layout:O="horizontal",stack:C=!1,relative:j=!1,startEndOnly:_=!1,animationDuration:P=900,showAnimation:N=!1,showXAxis:T=!0,showYAxis:A=!0,yAxisWidth:M=56,intervalType:I="equidistantPreserveStart",showTooltip:R=!0,showLegend:D=!0,showGridLines:L=!0,autoMinValue:Z=!1,minValue:z,maxValue:B,allowDecimals:F=!0,noDataText:H,onValueChange:q,enableLegendSlider:W=!1,customTooltip:U,rotateLabelX:K,tickGap:$=5,className:V}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),G=T||A?20:0,[Y,Q]=(0,s.useState)(60),J=(0,k.me)(u,S),[ee,et]=s.useState(void 0),[en,er]=(0,s.useState)(void 0),eo=!!q;function ea(e,t,n){var r,o,a,i;n.stopPropagation(),q&&((0,k.vZ)(ee,Object.assign(Object.assign({},e.payload),{value:e.value}))?(er(void 0),et(void 0),null==q||q(null)):(er(null===(o=null===(r=e.tooltipPayload)||void 0===r?void 0:r[0])||void 0===o?void 0:o.dataKey),et(Object.assign(Object.assign({},e.payload),{value:e.value})),null==q||q(Object.assign({eventType:"bar",categoryClicked:null===(i=null===(a=e.tooltipPayload)||void 0===a?void 0:a[0])||void 0===i?void 0:i.dataKey},e.payload))))}let ei=(0,k.i4)(Z,z,B);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-80",V)},X),s.createElement(c.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(m,{data:n,stackOffset:C?"sign":j?"expand":"none",layout:"vertical"===O?"vertical":"horizontal",onClick:eo&&(en||ee)?()=>{et(void 0),er(void 0),null==q||q(null)}:void 0},L?s.createElement(g.q,{className:(0,i.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==O,vertical:"vertical"===O}):null,"vertical"!==O?s.createElement(f.K,{padding:{left:G,right:G},hide:!T,dataKey:h,interval:_?"preserveStartEnd":I,tick:{transform:"translate(0, 6)"},ticks:_?[n[0][h],n[n.length-1][h]]:void 0,fill:"",stroke:"",className:(0,i.q)("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight,minTickGap:$}):s.createElement(f.K,{hide:!T,type:"number",tick:{transform:"translate(-3, 0)"},domain:ei,fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:E,minTickGap:$,allowDecimals:F,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight}),"vertical"!==O?s.createElement(p.B,{width:M,hide:!A,axisLine:!1,tickLine:!1,type:"number",domain:ei,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:j?e=>"".concat((100*e).toString()," %"):E,allowDecimals:F}):s.createElement(p.B,{width:M,hide:!A,dataKey:h,axisLine:!1,tickLine:!1,ticks:_?[n[0][h],n[n.length-1][h]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),s.createElement(v.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:R?e=>{let{active:t,payload:n,label:r}=e;return U?s.createElement(U,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=J.get(e.dataKey))&&void 0!==t?t:o.fr.Gray})}),active:t,label:r}):s.createElement(x.ZP,{active:t,payload:n,label:r,valueFormatter:E,categoryColors:J})}:s.createElement(s.Fragment,null),position:{y:0}}),D?s.createElement(y.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,b.Z)({payload:t},J,Q,en,eo?e=>{eo&&(e!==en||ee?(er(e),null==q||q({eventType:"category",categoryClicked:e})):(er(void 0),null==q||q(null)),et(void 0))}:void 0,W)}}):null,u.map(e=>{var t;return s.createElement(d.$,{className:(0,i.q)((0,l.bM)(null!==(t=J.get(e))&&void 0!==t?t:o.fr.Gray,a.K.background).fillColor,q?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:C||j?"a":void 0,dataKey:e,fill:"",isAnimationActive:N,animationDuration:P,shape:e=>((e,t,n,r)=>{let{fillOpacity:o,name:a,payload:i,value:l}=e,{x:c,width:u,y:d,height:f}=e;return"horizontal"===r&&f<0?(d+=f,f=Math.abs(f)):"vertical"===r&&u<0&&(c+=u,u=Math.abs(u)),s.createElement("rect",{x:c,y:d,width:u,height:f,opacity:t||n&&n!==a?(0,k.vZ)(t,Object.assign(Object.assign({},i),{value:l}))?o:.3:o})})(e,ee,en,O),onClick:ea})})):s.createElement(w.Z,{noDataText:H})))});S.displayName="BarChart"},14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return ez}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(60474),u=n(47625),d=n(93765),f=n(86757),p=n.n(f),h=n(9841),m=n(81889),g=n(87602),v=n(82944),y=["points","className","baseLinePoints","connectNulls"];function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return w(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var k=function(e){return e&&e.x===+e.x&&e.y===+e.y},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){k(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),k(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},E=function(e,t){var n=S(e);t&&(n=[n.reduce(function(e,t){return[].concat(x(e),x(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},O=function(e,t,n){var r=E(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(E(t.reverse(),n).slice(1))},C=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,y);if(!t||!t.length)return null;var i=(0,g.Z)("recharts-polygon",n);if(r&&r.length){var l=a.stroke&&"none"!==a.stroke,c=O(t,r,o);return s.createElement("g",{className:i},s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===c.slice(-1)?a.fill:"none",stroke:"none",d:c})),l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(t,o)})):null,l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(r,o)})):null)}var u=E(t,o);return s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===u.slice(-1)?a.fill:"none",className:i,d:u}))},j=n(58811),_=n(41637),P=n(39206);function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(){return(T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(t){L(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z(r.key),r)}}function R(e,t){return(R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t,n){return(t=Z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){var t=function(e,t){if("object"!==N(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==N(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===N(t)?t:String(t)}var z=Math.PI/180,B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=D(a);return e=t?Reflect.construct(n,arguments,D(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===N(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"getTickLineCoord",value:function(e){var t=this.props,n=t.cx,r=t.cy,o=t.radius,a=t.orientation,i=t.tickSize,l=(0,P.op)(n,r,o,e.coordinate),s=(0,P.op)(n,r,o+("inner"===a?-1:1)*(i||8),e.coordinate);return{x1:l.x,y1:l.y,x2:s.x,y2:s.y}}},{key:"getTickTextAnchor",value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*z);return n>1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,a=e.axisLineType,i=M(M({},(0,v.L6)(this.props,!1)),{},{fill:"none"},(0,v.L6)(o,!1));if("circle"===a)return s.createElement(m.o,T({className:"recharts-polar-angle-axis-line"},i,{cx:t,cy:n,r:r}));var l=this.props.ticks.map(function(e){return(0,P.op)(t,n,r,e.coordinate)});return s.createElement(C,T({className:"recharts-polar-angle-axis-line"},i,{points:l}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,i=t.tickFormatter,l=t.stroke,c=(0,v.L6)(this.props,!1),u=(0,v.L6)(r,!1),d=M(M({},c),{},{fill:"none"},(0,v.L6)(o,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),p=M(M(M({textAnchor:e.getTickTextAnchor(t)},c),{},{stroke:"none",fill:l},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return s.createElement(h.m,T({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),o&&s.createElement("line",T({className:"recharts-polar-angle-axis-tick-line"},d,f)),r&&a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?s.createElement(h.m,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,T({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],n&&I(a.prototype,n),r&&I(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);L(B,"displayName","PolarAngleAxis"),L(B,"axisType","angleAxis"),L(B,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var F=n(35802),H=n.n(F),q=n(37891),W=n.n(q),U=n(26680),K=["cx","cy","angle","ticks","axisLine"],$=["ticks","tick","angle","tickFormatter","stroke"];function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(){return(X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach(function(t){en(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,er(r.key),r)}}function ee(e,t){return(ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function et(e){return(et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function en(e,t,n){return(t=er(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(e){var t=function(e,t){if("object"!==V(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==V(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===V(t)?t:String(t)}var eo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=et(a);return e=t?Reflect.construct(n,arguments,et(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===V(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"getTickValueCoord",value:function(e){var t=e.coordinate,n=this.props,r=n.angle,o=n.cx,a=n.cy;return(0,P.op)(o,a,t,r)}},{key:"getTickTextAnchor",value:function(){var e;switch(this.props.orientation){case"left":e="end";break;case"right":e="start";break;default:e="middle"}return e}},{key:"getViewBox",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,o=e.ticks,a=H()(o,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:W()(o,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,o=e.ticks,a=e.axisLine,i=Q(e,K),l=o.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=(0,P.op)(t,n,l[0],r),u=(0,P.op)(t,n,l[1],r),d=Y(Y(Y({},(0,v.L6)(i,!1)),{},{fill:"none"},(0,v.L6)(a,!1)),{},{x1:c.x,y1:c.y,x2:u.x,y2:u.y});return s.createElement("line",X({className:"recharts-polar-radius-axis-line"},d))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.angle,i=t.tickFormatter,l=t.stroke,c=Q(t,$),u=this.getTickTextAnchor(),d=(0,v.L6)(c,!1),f=(0,v.L6)(r,!1),p=n.map(function(t,n){var c=e.getTickValueCoord(t),p=Y(Y(Y(Y({textAnchor:u,transform:"rotate(".concat(90-o,", ").concat(c.x,", ").concat(c.y,")")},d),{},{stroke:"none",fill:l},f),{},{index:n},c),{},{payload:t});return s.createElement(h.m,X({className:"recharts-polar-radius-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return t&&t.length?s.createElement(h.m,{className:"recharts-polar-radius-axis"},n&&this.renderAxisLine(),r&&this.renderTicks(),U._.renderCallByParent(this.props,this.getViewBox())):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,X({},t,{className:"recharts-polar-radius-axis-tick-value"}),n)}}],n&&J(a.prototype,n),r&&J(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);en(eo,"displayName","PolarRadiusAxis"),en(eo,"axisType","radiusAxis"),en(eo,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});var ea=n(59221),ei=n(13735),el=n.n(ei),es=n(21652),ec=n.n(es),eu=n(77571),ed=n.n(eu),ef=n(57165),ep=n(58772),eh=n(20407),em=n(34067),eg=n(16630),ev=n(85355),ey=n(1175),eb=n(11638);function ex(e){return(ex="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(){return(ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(t){e_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eP(r.key),r)}}function eO(e,t){return(eO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eC(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ej(e){return(ej=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e_(e,t,n){return(t=eP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eP(e){var t=function(e,t){if("object"!==ex(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ex(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ex(t)?t:String(t)}var eN=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eO(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=ej(a);return e=t?Reflect.construct(n,arguments,ej(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===ex(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eC(e)}(this,e)});function a(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),e_(eC(t=o.call(this,e)),"pieRef",null),e_(eC(t),"sectorRefs",[]),e_(eC(t),"id",(0,eg.EL)("recharts-pie-")),e_(eC(t),"handleAnimationEnd",function(){var e=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),p()(e)&&e()}),e_(eC(t),"handleAnimationStart",function(){var e=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),p()(e)&&e()}),t.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},t}return n=[{key:"isActiveIndex",value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?-1!==t.indexOf(e):e===t}},{key:"hasActiveIndex",value:function(){var e=this.props.activeIndex;return Array.isArray(e)?0!==e.length:e||0===e}},{key:"renderLabels",value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var t=this.props,n=t.label,r=t.labelLine,o=t.dataKey,i=t.valueKey,l=(0,v.L6)(this.props,!1),c=(0,v.L6)(n,!1),u=(0,v.L6)(r,!1),d=n&&n.offsetRadius||20,f=e.map(function(e,t){var f=(e.startAngle+e.endAngle)/2,p=(0,P.op)(e.cx,e.cy,e.outerRadius+d,f),m=eS(eS(eS(eS({},l),e),{},{stroke:"none"},c),{},{index:t,textAnchor:a.getTextAnchor(p.x,e.cx)},p),g=eS(eS(eS(eS({},l),e),{},{fill:"none",stroke:e.fill},u),{},{index:t,points:[(0,P.op)(e.cx,e.cy,e.outerRadius,f),p],key:"line"}),v=o;return ed()(o)&&ed()(i)?v="value":ed()(o)&&(v=i),s.createElement(h.m,{key:"label-".concat(e.startAngle,"-").concat(e.endAngle)},r&&a.renderLabelLineItem(r,g),a.renderLabelItem(n,m,(0,ev.F$)(e,v)))});return s.createElement(h.m,{className:"recharts-pie-labels"},f)}},{key:"renderSectorsStatically",value:function(e){var t=this,n=this.props,r=n.activeShape,o=n.blendStroke,a=n.inactiveShape;return e.map(function(n,i){if((null==n?void 0:n.startAngle)===0&&(null==n?void 0:n.endAngle)===0&&1!==e.length)return null;var l=t.isActiveIndex(i),c=a&&t.hasActiveIndex()?a:null,u=eS(eS({},n),{},{stroke:o?n.fill:n.stroke,tabIndex:-1});return s.createElement(h.m,ew({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:"recharts-pie-sector"},(0,_.bw)(t.props,n,i),{key:"sector-".concat(null==n?void 0:n.startAngle,"-").concat(null==n?void 0:n.endAngle,"-").concat(n.midAngle)}),s.createElement(eb.bn,ew({option:l?r:c,isActive:l,shapeType:"sector"},u)))})}},{key:"renderSectorsWithAnimation",value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,i=t.animationEasing,l=t.animationId,c=this.state,u=c.prevSectors,d=c.prevIsAnimationActive;return s.createElement(ea.ZP,{begin:o,duration:a,isActive:r,easing:i,from:{t:0},to:{t:1},key:"pie-".concat(l,"-").concat(d),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,o=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=u&&u[t],i=t>0?el()(e,"paddingAngle",0):0;if(n){var l=(0,eg.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),s=eS(eS({},e),{},{startAngle:a+i,endAngle:a+l(r)+i});o.push(s),a=s.endAngle}else{var c=e.endAngle,d=e.startAngle,f=(0,eg.k4)(0,c-d)(r),p=eS(eS({},e),{},{startAngle:a+i,endAngle:a+f+i});o.push(p),a=p.endAngle}}),s.createElement(h.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!ec()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,a=t.label,i=t.cx,l=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eg.hj)(i)||!(0,eg.hj)(l)||!(0,eg.hj)(c)||!(0,eg.hj)(u))return null;var p=(0,g.Z)("recharts-pie",o);return s.createElement(h.m,{tabIndex:this.props.rootTabIndex,className:p,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),U._.renderCallByParent(this.props,null,!1),(!d||f)&&ep.e.renderCallByParent(this.props,r,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e<t?"end":"middle"}},{key:"renderLabelLineItem",value:function(e,t){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(ef.H,ew({},t,{type:"linear",className:"recharts-pie-label-line"}))}},{key:"renderLabelItem",value:function(e,t,n){if(s.isValidElement(e))return s.cloneElement(e,t);var r=n;return p()(e)&&(r=e(t),s.isValidElement(r))?r:s.createElement(j.x,ew({},t,{alignmentBaseline:"middle",className:"recharts-pie-label-text"}),r)}}],n&&eE(a.prototype,n),r&&eE(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);e_(eN,"displayName","Pie"),e_(eN,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!em.x.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0}),e_(eN,"parseDeltaAngle",function(e,t){return(0,eg.uY)(t-e)*Math.min(Math.abs(t-e),360)}),e_(eN,"getRealPieData",function(e){var t=e.props,n=t.data,r=t.children,o=(0,v.L6)(e.props,!1),a=(0,v.NN)(r,eh.b);return n&&n.length?n.map(function(e,t){return eS(eS(eS({payload:e},o),e),a&&a[t]&&a[t].props)}):a&&a.length?a.map(function(e){return eS(eS({},o),e.props)}):[]}),e_(eN,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,o=t.width,a=t.height,i=(0,P.$4)(o,a);return{cx:r+(0,eg.h1)(e.props.cx,o,o/2),cy:n+(0,eg.h1)(e.props.cy,a,a/2),innerRadius:(0,eg.h1)(e.props.innerRadius,i,0),outerRadius:(0,eg.h1)(e.props.outerRadius,i,.8*i),maxRadius:e.props.maxRadius||Math.sqrt(o*o+a*a)/2}}),e_(eN,"getComposedData",function(e){var t,n,r=e.item,o=e.offset,a=eN.getRealPieData(r);if(!a||!a.length)return null;var i=r.props,l=i.cornerRadius,s=i.startAngle,c=i.endAngle,u=i.paddingAngle,d=i.dataKey,f=i.nameKey,p=i.valueKey,h=i.tooltipType,m=Math.abs(r.props.minAngle),g=eN.parseCoordinateOfPie(r,o),v=eN.parseDeltaAngle(s,c),y=Math.abs(v),b=d;ed()(d)&&ed()(p)?((0,ey.Z)(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b="value"):ed()(d)&&((0,ey.Z)(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b=p);var x=a.filter(function(e){return 0!==(0,ev.F$)(e,b,0)}).length,w=y-x*m-(y>=360?x:x-1)*u,k=a.reduce(function(e,t){var n=(0,ev.F$)(t,b,0);return e+((0,eg.hj)(n)?n:0)},0);return k>0&&(t=a.map(function(e,t){var r,o=(0,ev.F$)(e,b,0),a=(0,ev.F$)(e,f,t),i=((0,eg.hj)(o)?o:0)/k,c=(r=t?n.endAngle+(0,eg.uY)(v)*u*(0!==o?1:0):s)+(0,eg.uY)(v)*((0!==o?m:0)+i*w),d=(r+c)/2,p=(g.innerRadius+g.outerRadius)/2,y=[{name:a,value:o,payload:e,dataKey:b,type:h}],x=(0,P.op)(g.cx,g.cy,p,d);return n=eS(eS(eS({percent:i,cornerRadius:l,name:a,tooltipPayload:y,midAngle:d,middleRadius:p,tooltipPosition:x},e),g),{},{value:(0,ev.F$)(e,b),startAngle:r,endAngle:c,payload:e,paddingAngle:(0,eg.uY)(v)*u})})),eS(eS({},g),{},{sectors:t,data:a})});var eT=(0,d.z)({chartName:"PieChart",GraphicalChild:eN,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:B},{axisType:"radiusAxis",AxisComp:eo}],formatAxisMap:P.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eA=n(8147),eM=n(69448),eI=n(98593);let eR=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return s.createElement(eI.$B,null,s.createElement("div",{className:(0,i.q)("px-4 py-2")},s.createElement(eI.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eD=(e,t)=>e.map((e,n)=>{let r=n<t.length?t[n]:o.fr.Gray;return Object.assign(Object.assign({},e),{color:r,className:(0,l.bM)(null!=r?r:o.fr.Gray,a.K.background).fillColor,fill:""})}),eL=(e,t,n,r)=>e||t((0,l.vP)(n.map(e=>e[r]))),eZ=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l}=e;return s.createElement("g",null,s.createElement(c.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l,fill:"",opacity:.3,style:{outline:"none"}}))},ez=s.forwardRef((e,t)=>{let{data:n=[],category:c="value",index:d="name",colors:f=a.s,variant:p="donut",valueFormatter:h=l.Cj,label:m,showLabel:g=!0,animationDuration:v=900,showAnimation:y=!1,showTooltip:b=!0,noDataText:x,onValueChange:w,customTooltip:k,className:S}=e,E=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),O="donut"==p,C=eL(m,h,n,c),[j,_]=s.useState(void 0),P=!!w;return(0,s.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[j]),s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-40",S)},E),s.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(eT,{onClick:P&&j?()=>{_(void 0),null==w||w(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},g&&O?s.createElement("text",{className:(0,i.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},C):null,s.createElement(eN,{className:(0,i.q)("stroke-tremor-background dark:stroke-dark-tremor-background",w?"cursor-pointer":"cursor-default"),data:eD(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:O?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:c,nameKey:d,isAnimationActive:y,animationDuration:v,onClick:function(e,t,n){n.stopPropagation(),P&&(j===t?(_(void 0),null==w||w(null)):(_(t),null==w||w(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:j,inactiveShape:eZ,style:{outline:"none"}}),s.createElement(eA.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:b?e=>{var t;let{active:n,payload:r}=e;return k?s.createElement(k,{payload:null==r?void 0:r.map(e=>{var t,n,a;return Object.assign(Object.assign({},e),{color:null!==(a=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==a?a:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):s.createElement(eR,{active:n,payload:r,valueFormatter:h})}:s.createElement(s.Fragment,null)})):s.createElement(eM.Z,{noDataText:x})))});ez.displayName="DonutChart"},59664:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(54061),s=n(97059),c=n(62994),u=n(25311),d=(0,i.z)({chartName:"LineChart",GraphicalChild:l.x,axisComponents:[{axisType:"xAxis",AxisComp:s.K},{axisType:"yAxis",AxisComp:c.B}],formatAxisMap:u.t9}),f=n(56940),p=n(8147),h=n(22190),m=n(81889),g=n(65278),v=n(98593),y=n(69448),b=n(32644),x=n(7084),w=n(26898),k=n(97324),S=n(1153);let E=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:u,colors:E=w.s,valueFormatter:O=S.Cj,startEndOnly:C=!1,showXAxis:j=!0,showYAxis:_=!0,yAxisWidth:P=56,intervalType:N="equidistantPreserveStart",animationDuration:T=900,showAnimation:A=!1,showTooltip:M=!0,showLegend:I=!0,showGridLines:R=!0,autoMinValue:D=!1,curveType:L="linear",minValue:Z,maxValue:z,connectNulls:B=!1,allowDecimals:F=!0,noDataText:H,className:q,onValueChange:W,enableLegendSlider:U=!1,customTooltip:K,rotateLabelX:$,tickGap:V=5}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),G=j||_?20:0,[Y,Q]=(0,o.useState)(60),[J,ee]=(0,o.useState)(void 0),[et,en]=(0,o.useState)(void 0),er=(0,b.me)(i,E),eo=(0,b.i4)(D,Z,z),ea=!!W;function ei(e){ea&&(e===et&&!J||(0,b.FB)(n,e)&&J&&J.dataKey===e?(en(void 0),null==W||W(null)):(en(e),null==W||W({eventType:"category",categoryClicked:e})),ee(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,k.q)("w-full h-80",q)},X),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(d,{data:n,onClick:ea&&(et||J)?()=>{ee(void 0),en(void 0),null==W||W(null)}:void 0},R?o.createElement(f.q,{className:(0,k.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(s.K,{padding:{left:G,right:G},hide:!j,dataKey:u,interval:C?"preserveStartEnd":N,tick:{transform:"translate(0, 6)"},ticks:C?[n[0][u],n[n.length-1][u]]:void 0,fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:V,angle:null==$?void 0:$.angle,dy:null==$?void 0:$.verticalShift,height:null==$?void 0:$.xAxisHeight}),o.createElement(c.B,{width:P,hide:!_,axisLine:!1,tickLine:!1,type:"number",domain:eo,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:O,allowDecimals:F}),o.createElement(p.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:r}=e;return K?o.createElement(K,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=er.get(e.dataKey))&&void 0!==t?t:x.fr.Gray})}),active:t,label:r}):o.createElement(v.ZP,{active:t,payload:n,label:r,valueFormatter:O,categoryColors:er})}:o.createElement(o.Fragment,null),position:{y:0}}),I?o.createElement(h.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,g.Z)({payload:t},er,Q,et,ea?e=>ei(e):void 0,U)}}):null,i.map(e=>{var t;return o.createElement(l.x,{className:(0,k.q)((0,S.bM)(null!==(t=er.get(e))&&void 0!==t?t:x.fr.Gray,w.K.text).strokeColor),strokeOpacity:J||et&&et!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(m.o,{className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(t=er.get(u))&&void 0!==t?t:x.fr.Gray,w.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),ea&&(e.index===(null==J?void 0:J.index)&&e.dataKey===(null==J?void 0:J.dataKey)||(0,b.FB)(n,e.dataKey)&&et&&et===e.dataKey?(en(void 0),ee(void 0),null==W||W(null)):(en(e.dataKey),ee({index:e.index,dataKey:e.dataKey}),null==W||W(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,b.FB)(n,e)&&!(J||et&&et!==e)||(null==J?void 0:J.index)===f&&(null==J?void 0:J.dataKey)===e?o.createElement(m.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(r=er.get(d))&&void 0!==r?r:x.fr.Gray,w.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:L,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:A,animationDuration:T,connectNulls:B})}),W?i.map(e=>o.createElement(l.x,{className:(0,k.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:L,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:B,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ei(n)}})):null):o.createElement(y.Z,{noDataText:H})))});E.displayName="LineChart"},65278:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(2265);let o=(e,t)=>{let[n,o]=(0,r.useState)(t);(0,r.useEffect)(()=>{let t=()=>{o(window.innerWidth),e()};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e,n])};var a=n(5853),i=n(26898),l=n(97324),s=n(1153);let c=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},u=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},d=(0,s.fn)("Legend"),f=e=>{let{name:t,color:n,onClick:o,activeLegend:a}=e,c=!!o;return r.createElement("li",{className:(0,l.q)(d("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",c?"cursor-pointer":"cursor-default","text-tremor-content",c?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",c?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:e=>{e.stopPropagation(),null==o||o(t,n)}},r.createElement("svg",{className:(0,l.q)("flex-none h-2 w-2 mr-1.5",(0,s.bM)(n,i.K.text).textColor,a&&a!==t?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},r.createElement("circle",{cx:4,cy:4,r:4})),r.createElement("p",{className:(0,l.q)("whitespace-nowrap truncate text-tremor-default","text-tremor-content",c?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",a&&a!==t?"opacity-40":"opacity-100",c?"dark:group-hover:text-dark-tremor-content-emphasis":"")},t))},p=e=>{let{icon:t,onClick:n,disabled:o}=e,[a,i]=r.useState(!1),s=r.useRef(null);return r.useEffect(()=>(a?s.current=setInterval(()=>{null==n||n()},300):clearInterval(s.current),()=>clearInterval(s.current)),[a,n]),(0,r.useEffect)(()=>{o&&(clearInterval(s.current),i(!1))},[o]),r.createElement("button",{type:"button",className:(0,l.q)(d("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:e=>{e.stopPropagation(),null==n||n()},onMouseDown:e=>{e.stopPropagation(),i(!0)},onMouseUp:e=>{e.stopPropagation(),i(!1)}},r.createElement(t,{className:"w-full"}))},h=r.forwardRef((e,t)=>{var n,o;let{categories:s,colors:h=i.s,className:m,onClickLegendItem:g,activeLegend:v,enableLegendSlider:y=!1}=e,b=(0,a._T)(e,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=r.useRef(null),[w,k]=r.useState(null),[S,E]=r.useState(null),O=r.useRef(null),C=(0,r.useCallback)(()=>{let e=null==x?void 0:x.current;e&&k({left:e.scrollLeft>0,right:e.scrollWidth-e.clientWidth>e.scrollLeft})},[k]),j=(0,r.useCallback)(e=>{var t;let n=null==x?void 0:x.current,r=null!==(t=null==n?void 0:n.clientWidth)&&void 0!==t?t:0;n&&y&&(n.scrollTo({left:"left"===e?n.scrollLeft-r:n.scrollLeft+r,behavior:"smooth"}),setTimeout(()=>{C()},400))},[y,C]);r.useEffect(()=>{let e=e=>{"ArrowLeft"===e?j("left"):"ArrowRight"===e&&j("right")};return S?(e(S),O.current=setInterval(()=>{e(S)},300)):clearInterval(O.current),()=>clearInterval(O.current)},[S,j]);let _=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),E(e.key))},P=e=>{e.stopPropagation(),E(null)};return r.useEffect(()=>{let e=null==x?void 0:x.current;return y&&(C(),null==e||e.addEventListener("keydown",_),null==e||e.addEventListener("keyup",P)),()=>{null==e||e.removeEventListener("keydown",_),null==e||e.removeEventListener("keyup",P)}},[C,y]),r.createElement("ol",Object.assign({ref:t,className:(0,l.q)(d("root"),"relative overflow-hidden",m)},b),r.createElement("div",{ref:x,tabIndex:0,className:(0,l.q)("h-full flex",y?(null==w?void 0:w.right)||(null==w?void 0:w.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},s.map((e,t)=>r.createElement(f,{key:"item-".concat(t),name:e,color:h[t],onClick:g,activeLegend:v}))),y&&((null==w?void 0:w.right)||(null==w?void 0:w.left))?r.createElement(r.Fragment,null,r.createElement("div",{className:(0,l.q)("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},r.createElement(p,{icon:c,onClick:()=>{E(null),j("left")},disabled:!(null==w?void 0:w.left)}),r.createElement(p,{icon:u,onClick:()=>{E(null),j("right")},disabled:!(null==w?void 0:w.right)}))):null)});h.displayName="Legend";let m=(e,t,n,a,i,l)=>{let{payload:s}=e,c=(0,r.useRef)(null);o(()=>{var e,t;n((t=null===(e=c.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)});let u=s.filter(e=>"none"!==e.type);return r.createElement("div",{ref:c,className:"flex items-center justify-end"},r.createElement(h,{categories:u.map(e=>e.value),colors:u.map(e=>t.get(e.value)),onClickLegendItem:i,activeLegend:a,enableLegendSlider:l}))}},98593:function(e,t,n){"use strict";n.d(t,{$B:function(){return s},ZP:function(){return u},zX:function(){return c}});var r=n(2265),o=n(7084),a=n(26898),i=n(97324),l=n(1153);let s=e=>{let{children:t}=e;return r.createElement("div",{className:(0,i.q)("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},t)},c=e=>{let{value:t,name:n,color:o}=e;return r.createElement("div",{className:"flex items-center justify-between space-x-8"},r.createElement("div",{className:"flex items-center space-x-2"},r.createElement("span",{className:(0,i.q)("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",(0,l.bM)(o,a.K.background).bgColor)}),r.createElement("p",{className:(0,i.q)("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},n)),r.createElement("p",{className:(0,i.q)("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},t))},u=e=>{let{active:t,payload:n,label:a,categoryColors:l,valueFormatter:u}=e;if(t&&n){let e=n.filter(e=>"none"!==e.type);return r.createElement(s,null,r.createElement("div",{className:(0,i.q)("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},r.createElement("p",{className:(0,i.q)("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},a)),r.createElement("div",{className:(0,i.q)("px-4 py-2 space-y-1")},e.map((e,t)=>{var n;let{value:a,name:i}=e;return r.createElement(c,{key:"id-".concat(t),value:u(a),name:i,color:null!==(n=l.get(i))&&void 0!==n?n:o.fr.Blue})})))}return null}},69448:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(97324),o=n(2265),a=n(5853);let i=(0,n(1153).fn)("Flex"),l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},c={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},u=o.forwardRef((e,t)=>{let{flexDirection:n="row",justifyContent:u="between",alignItems:d="center",children:f,className:p}=e,h=(0,a._T)(e,["flexDirection","justifyContent","alignItems","children","className"]);return o.createElement("div",Object.assign({ref:t,className:(0,r.q)(i("root"),"flex w-full",c[n],l[u],s[d],p)},h),f)});u.displayName="Flex";var d=n(84264);let f=e=>{let{noDataText:t="No data"}=e;return o.createElement(u,{alignItems:"center",justifyContent:"center",className:(0,r.q)("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},o.createElement(d.Z,{className:(0,r.q)("text-tremor-content","dark:text-dark-tremor-content")},t))}},32644:function(e,t,n){"use strict";n.d(t,{FB:function(){return a},i4:function(){return o},me:function(){return r},vZ:function(){return function e(t,n){if(t===n)return!0;if("object"!=typeof t||"object"!=typeof n||null===t||null===n)return!1;let r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(let a of r)if(!o.includes(a)||!e(t[a],n[a]))return!1;return!0}}});let r=(e,t)=>{let n=new Map;return e.forEach((e,r)=>{n.set(e,t[r])}),n},o=(e,t,n)=>[e?"auto":null!=t?t:0,null!=n?n:"auto"];function a(e,t){let n=[];for(let r of e)if(Object.prototype.hasOwnProperty.call(r,t)&&(n.push(r[t]),n.length>1))return!1;return!0}},47323:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(5853),o=n(2265),a=n(1526),i=n(7084),l=n(97324),s=n(1153),c=n(26898);let u={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},d={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},f={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,s.bM)(t,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,l.q)((0,s.bM)(t,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,s.fn)("Icon"),m=o.forwardRef((e,t)=>{let{icon:n,variant:c="simple",tooltip:m,size:g=i.u8.SM,color:v,className:y}=e,b=(0,r._T)(e,["icon","variant","tooltip","size","color","className"]),x=p(c,v),{tooltipProps:w,getReferenceProps:k}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,s.lq)([t,w.refs.setReference]),className:(0,l.q)(h("root"),"inline-flex flex-shrink-0 items-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,f[c].rounded,f[c].border,f[c].shadow,f[c].ring,u[g].paddingX,u[g].paddingY,y)},k,b),o.createElement(a.Z,Object.assign({text:m},w)),o.createElement(n,{className:(0,l.q)(h("icon"),"shrink-0",d[g].height,d[g].width)}))});m.displayName="Icon"},69262:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},l=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var s=n(96398),c=n(97324),u=n(1153);let d=o.forwardRef((e,t)=>{let{value:n,defaultValue:d,type:f,placeholder:p="Type...",icon:h,error:m=!1,errorMessage:g,disabled:v=!1,stepper:y,makeInputClassName:b,className:x,onChange:w,onValueChange:k,autoFocus:S}=e,E=(0,r._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[O,C]=(0,o.useState)(S||!1),[j,_]=(0,o.useState)(!1),P=(0,o.useCallback)(()=>_(!j),[j,_]),N=(0,o.useRef)(null),T=(0,s.Uh)(n||d);return o.useEffect(()=>{let e=()=>C(!0),t=()=>C(!1),n=N.current;return n&&(n.addEventListener("focus",e),n.addEventListener("blur",t),S&&n.focus()),()=>{n&&(n.removeEventListener("focus",e),n.removeEventListener("blur",t))}},[S]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,c.q)(b("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,s.um)(T,v,m),O&&(0,c.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),x)},h?o.createElement(h,{className:(0,c.q)(b("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,u.lq)([N,t]),defaultValue:d,value:n,type:j?"text":f,className:(0,c.q)(b("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",h?"pl-2":"pl-3",m?"pr-3":"pr-4",v?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:v,"data-testid":"base-input",onChange:e=>{null==w||w(e),null==k||k(e.target.value)}},E)),"password"!==f||v?null:o.createElement("button",{className:(0,c.q)(b("toggleButton"),"mr-2"),type:"button",onClick:()=>P(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(l,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(i,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),m?o.createElement(a,{className:(0,c.q)(b("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=y?y:null),m&&g?o.createElement("p",{className:(0,c.q)(b("errorMessage"),"text-sm text-red-500 mt-1")},g):null)});d.displayName="BaseInput"},53003:function(e,t,n){"use strict";let r,o,a;n.d(t,{Z:function(){return nF}});var i,l,s,c,u=n(5853),d=n(2265),f=n(54887),p=n(13323),h=n(64518),m=n(96822),g=n(40293);function v(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,d.useMemo)(()=>(0,g.r)(...t),[...t])}var y=n(72238),b=n(93689);let x=(0,d.createContext)(!1);var w=n(61424),k=n(27847);let S=d.Fragment,E=d.Fragment,O=(0,d.createContext)(null),C=(0,d.createContext)(null);Object.assign((0,k.yV)(function(e,t){var n;let r,o,a=(0,d.useRef)(null),i=(0,b.T)((0,b.h)(e=>{a.current=e}),t),l=v(a),s=function(e){let t=(0,d.useContext)(x),n=(0,d.useContext)(O),r=v(e),[o,a]=(0,d.useState)(()=>{if(!t&&null!==n||w.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return(0,d.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),(0,d.useEffect)(()=>{t||null!==n&&a(n.current)},[n,a,t]),o}(a),[c]=(0,d.useState)(()=>{var e;return w.O.isServer?null:null!=(e=null==l?void 0:l.createElement("div"))?e:null}),u=(0,d.useContext)(C),g=(0,y.H)();return(0,h.e)(()=>{!s||!c||s.contains(c)||(c.setAttribute("data-headlessui-portal",""),s.appendChild(c))},[s,c]),(0,h.e)(()=>{if(c&&u)return u.register(c)},[u,c]),n=()=>{var e;s&&c&&(c instanceof Node&&s.contains(c)&&s.removeChild(c),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))},r=(0,p.z)(n),o=(0,d.useRef)(!1),(0,d.useEffect)(()=>(o.current=!1,()=>{o.current=!0,(0,m.Y)(()=>{o.current&&r()})}),[r]),g&&s&&c?(0,f.createPortal)((0,k.sY)({ourProps:{ref:i},theirProps:e,defaultTag:S,name:"Portal"}),c):null}),{Group:(0,k.yV)(function(e,t){let{target:n,...r}=e,o={ref:(0,b.T)(t)};return d.createElement(O.Provider,{value:n},(0,k.sY)({ourProps:o,theirProps:r,defaultTag:E,name:"Popover.Group"}))})});var j=n(31948),_=n(17684),P=n(98505),N=n(80004),T=n(38198),A=n(3141),M=((r=M||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function I(){let e=(0,d.useRef)(0);return(0,A.s)("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}var R=n(37863),D=n(47634),L=n(37105),Z=n(24536),z=n(37388),B=((o=B||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),F=((a=F||{})[a.TogglePopover=0]="TogglePopover",a[a.ClosePopover=1]="ClosePopover",a[a.SetButton=2]="SetButton",a[a.SetButtonId=3]="SetButtonId",a[a.SetPanel=4]="SetPanel",a[a.SetPanelId=5]="SetPanelId",a);let H={0:e=>{let t={...e,popoverState:(0,Z.E)(e.popoverState,{0:1,1:0})};return 0===t.popoverState&&(t.__demoMode=!1),t},1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},q=(0,d.createContext)(null);function W(e){let t=(0,d.useContext)(q);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Popover /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,W),t}return t}q.displayName="PopoverContext";let U=(0,d.createContext)(null);function K(e){let t=(0,d.useContext)(U);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Popover /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return t}U.displayName="PopoverAPIContext";let $=(0,d.createContext)(null);function V(){return(0,d.useContext)($)}$.displayName="PopoverGroupContext";let X=(0,d.createContext)(null);function G(e,t){return(0,Z.E)(t.type,H,e,t)}X.displayName="PopoverPanelContext";let Y=k.AN.RenderStrategy|k.AN.Static,Q=k.AN.RenderStrategy|k.AN.Static,J=Object.assign((0,k.yV)(function(e,t){var n,r,o,a;let i,l,s,c,u,f;let{__demoMode:h=!1,...m}=e,g=(0,d.useRef)(null),y=(0,b.T)(t,(0,b.h)(e=>{g.current=e})),x=(0,d.useRef)([]),w=(0,d.useReducer)(G,{__demoMode:h,popoverState:h?0:1,buttons:x,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:(0,d.createRef)(),afterPanelSentinel:(0,d.createRef)()}),[{popoverState:S,button:E,buttonId:O,panel:_,panelId:N,beforePanelSentinel:A,afterPanelSentinel:M},I]=w,D=v(null!=(n=g.current)?n:E),z=(0,d.useMemo)(()=>{if(!E||!_)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(E))^Number(null==e?void 0:e.contains(_)))return!0;let e=(0,L.GO)(),t=e.indexOf(E),n=(t+e.length-1)%e.length,r=(t+1)%e.length,o=e[n],a=e[r];return!_.contains(o)&&!_.contains(a)},[E,_]),B=(0,j.E)(O),F=(0,j.E)(N),H=(0,d.useMemo)(()=>({buttonId:B,panelId:F,close:()=>I({type:1})}),[B,F,I]),W=V(),K=null==W?void 0:W.registerPopover,$=(0,p.z)(()=>{var e;return null!=(e=null==W?void 0:W.isFocusWithinPopoverGroup())?e:(null==D?void 0:D.activeElement)&&((null==E?void 0:E.contains(D.activeElement))||(null==_?void 0:_.contains(D.activeElement)))});(0,d.useEffect)(()=>null==K?void 0:K(H),[K,H]);let[Y,Q]=(i=(0,d.useContext)(C),l=(0,d.useRef)([]),s=(0,p.z)(e=>(l.current.push(e),i&&i.register(e),()=>c(e))),c=(0,p.z)(e=>{let t=l.current.indexOf(e);-1!==t&&l.current.splice(t,1),i&&i.unregister(e)}),u=(0,d.useMemo)(()=>({register:s,unregister:c,portals:l}),[s,c,l]),[l,(0,d.useMemo)(()=>function(e){let{children:t}=e;return d.createElement(C.Provider,{value:u},t)},[u])]),J=function(){var e;let{defaultContainers:t=[],portals:n,mainTreeNodeRef:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(0,d.useRef)(null!=(e=null==r?void 0:r.current)?e:null),a=v(o),i=(0,p.z)(()=>{var e,r,i;let l=[];for(let e of t)null!==e&&(e instanceof HTMLElement?l.push(e):"current"in e&&e.current instanceof HTMLElement&&l.push(e.current));if(null!=n&&n.current)for(let e of n.current)l.push(e);for(let t of null!=(e=null==a?void 0:a.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||t.contains(null==(i=null==(r=o.current)?void 0:r.getRootNode())?void 0:i.host)||l.some(e=>t.contains(e))||l.push(t));return l});return{resolveContainers:i,contains:(0,p.z)(e=>i().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,d.useMemo)(()=>function(){return null!=r?null:d.createElement(T._,{features:T.A.Hidden,ref:o})},[o,r])}}({mainTreeNodeRef:null==W?void 0:W.mainTreeNodeRef,portals:Y,defaultContainers:[E,_]});r=null==D?void 0:D.defaultView,o="focus",a=e=>{var t,n,r,o;e.target!==window&&e.target instanceof HTMLElement&&0===S&&($()||E&&_&&(J.contains(e.target)||null!=(n=null==(t=A.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(o=null==(r=M.current)?void 0:r.contains)&&o.call(r,e.target)||I({type:1})))},f=(0,j.E)(a),(0,d.useEffect)(()=>{function e(e){f.current(e)}return(r=null!=r?r:window).addEventListener(o,e,!0),()=>r.removeEventListener(o,e,!0)},[r,o,!0]),(0,P.O)(J.resolveContainers,(e,t)=>{I({type:1}),(0,L.sP)(t,L.tJ.Loose)||(e.preventDefault(),null==E||E.focus())},0===S);let ee=(0,p.z)(e=>{I({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:E:E;null==t||t.focus()}),et=(0,d.useMemo)(()=>({close:ee,isPortalled:z}),[ee,z]),en=(0,d.useMemo)(()=>({open:0===S,close:ee}),[S,ee]);return d.createElement(X.Provider,{value:null},d.createElement(q.Provider,{value:w},d.createElement(U.Provider,{value:et},d.createElement(R.up,{value:(0,Z.E)(S,{0:R.ZM.Open,1:R.ZM.Closed})},d.createElement(Q,null,(0,k.sY)({ourProps:{ref:y},theirProps:m,slot:en,defaultTag:"div",name:"Popover"}),d.createElement(J.MainTreeNode,null))))))}),{Button:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-button-".concat(n),...o}=e,[a,i]=W("Popover.Button"),{isPortalled:l}=K("Popover.Button"),s=(0,d.useRef)(null),c="headlessui-focus-sentinel-".concat((0,_.M)()),u=V(),f=null==u?void 0:u.closeOthers,h=null!==(0,d.useContext)(X);(0,d.useEffect)(()=>{if(!h)return i({type:3,buttonId:r}),()=>{i({type:3,buttonId:null})}},[h,r,i]);let[m]=(0,d.useState)(()=>Symbol()),g=(0,b.T)(s,t,h?null:e=>{if(e)a.buttons.current.push(m);else{let e=a.buttons.current.indexOf(m);-1!==e&&a.buttons.current.splice(e,1)}a.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),e&&i({type:2,button:e})}),y=(0,b.T)(s,t),x=v(s),w=(0,p.z)(e=>{var t,n,r;if(h){if(1===a.popoverState)return;switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),i({type:1}),null==(r=a.button)||r.focus()}}else switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0});break;case z.R.Escape:if(0!==a.popoverState)return null==f?void 0:f(a.buttonId);if(!s.current||null!=x&&x.activeElement&&!s.current.contains(x.activeElement))return;e.preventDefault(),e.stopPropagation(),i({type:1})}}),S=(0,p.z)(e=>{h||e.key===z.R.Space&&e.preventDefault()}),E=(0,p.z)(t=>{var n,r;(0,D.P)(t.currentTarget)||e.disabled||(h?(i({type:1}),null==(n=a.button)||n.focus()):(t.preventDefault(),t.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0}),null==(r=a.button)||r.focus()))}),O=(0,p.z)(e=>{e.preventDefault(),e.stopPropagation()}),C=0===a.popoverState,j=(0,d.useMemo)(()=>({open:C}),[C]),P=(0,N.f)(e,s),A=h?{ref:y,type:P,onKeyDown:w,onClick:E}:{ref:g,id:a.buttonId,type:P,"aria-expanded":0===a.popoverState,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:w,onKeyUp:S,onClick:E,onMouseDown:O},R=I(),B=(0,p.z)(()=>{let e=a.panel;e&&(0,Z.E)(R.current,{[M.Forwards]:()=>(0,L.jA)(e,L.TO.First),[M.Backwards]:()=>(0,L.jA)(e,L.TO.Last)})===L.fE.Error&&(0,L.jA)((0,L.GO)().filter(e=>"true"!==e.dataset.headlessuiFocusGuard),(0,Z.E)(R.current,{[M.Forwards]:L.TO.Next,[M.Backwards]:L.TO.Previous}),{relativeTo:a.button})});return d.createElement(d.Fragment,null,(0,k.sY)({ourProps:A,theirProps:o,slot:j,defaultTag:"button",name:"Popover.Button"}),C&&!h&&l&&d.createElement(T._,{id:c,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:B}))}),Overlay:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-overlay-".concat(n),...o}=e,[{popoverState:a},i]=W("Popover.Overlay"),l=(0,b.T)(t),s=(0,R.oJ)(),c=null!==s?(s&R.ZM.Open)===R.ZM.Open:0===a,u=(0,p.z)(e=>{if((0,D.P)(e.currentTarget))return e.preventDefault();i({type:1})}),f=(0,d.useMemo)(()=>({open:0===a}),[a]);return(0,k.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:u},theirProps:o,slot:f,defaultTag:"div",features:Y,visible:c,name:"Popover.Overlay"})}),Panel:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-panel-".concat(n),focus:o=!1,...a}=e,[i,l]=W("Popover.Panel"),{close:s,isPortalled:c}=K("Popover.Panel"),u="headlessui-focus-sentinel-before-".concat((0,_.M)()),f="headlessui-focus-sentinel-after-".concat((0,_.M)()),m=(0,d.useRef)(null),g=(0,b.T)(m,t,e=>{l({type:4,panel:e})}),y=v(m),x=(0,k.Y2)();(0,h.e)(()=>(l({type:5,panelId:r}),()=>{l({type:5,panelId:null})}),[r,l]);let w=(0,R.oJ)(),S=null!==w?(w&R.ZM.Open)===R.ZM.Open:0===i.popoverState,E=(0,p.z)(e=>{var t;if(e.key===z.R.Escape){if(0!==i.popoverState||!m.current||null!=y&&y.activeElement&&!m.current.contains(y.activeElement))return;e.preventDefault(),e.stopPropagation(),l({type:1}),null==(t=i.button)||t.focus()}});(0,d.useEffect)(()=>{var t;e.static||1===i.popoverState&&(null==(t=e.unmount)||t)&&l({type:4,panel:null})},[i.popoverState,e.unmount,e.static,l]),(0,d.useEffect)(()=>{if(i.__demoMode||!o||0!==i.popoverState||!m.current)return;let e=null==y?void 0:y.activeElement;m.current.contains(e)||(0,L.jA)(m.current,L.TO.First)},[i.__demoMode,o,m,i.popoverState]);let O=(0,d.useMemo)(()=>({open:0===i.popoverState,close:s}),[i,s]),C={ref:g,id:r,onKeyDown:E,onBlur:o&&0===i.popoverState?e=>{var t,n,r,o,a;let s=e.relatedTarget;s&&m.current&&(null!=(t=m.current)&&t.contains(s)||(l({type:1}),(null!=(r=null==(n=i.beforePanelSentinel.current)?void 0:n.contains)&&r.call(n,s)||null!=(a=null==(o=i.afterPanelSentinel.current)?void 0:o.contains)&&a.call(o,s))&&s.focus({preventScroll:!0})))}:void 0,tabIndex:-1},j=I(),P=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var t;(0,L.jA)(e,L.TO.First)===L.fE.Error&&(null==(t=i.afterPanelSentinel.current)||t.focus())},[M.Backwards]:()=>{var e;null==(e=i.button)||e.focus({preventScroll:!0})}})}),N=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var e;if(!i.button)return;let t=(0,L.GO)(),n=t.indexOf(i.button),r=t.slice(0,n+1),o=[...t.slice(n+1),...r];for(let t of o.slice())if("true"===t.dataset.headlessuiFocusGuard||null!=(e=i.panel)&&e.contains(t)){let e=o.indexOf(t);-1!==e&&o.splice(e,1)}(0,L.jA)(o,L.TO.First,{sorted:!1})},[M.Backwards]:()=>{var t;(0,L.jA)(e,L.TO.Previous)===L.fE.Error&&(null==(t=i.button)||t.focus())}})});return d.createElement(X.Provider,{value:r},S&&c&&d.createElement(T._,{id:u,ref:i.beforePanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:P}),(0,k.sY)({mergeRefs:x,ourProps:C,theirProps:a,slot:O,defaultTag:"div",features:Q,visible:S,name:"Popover.Panel"}),S&&c&&d.createElement(T._,{id:f,ref:i.afterPanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:N}))}),Group:(0,k.yV)(function(e,t){let n;let r=(0,d.useRef)(null),o=(0,b.T)(r,t),[a,i]=(0,d.useState)([]),l={mainTreeNodeRef:n=(0,d.useRef)(null),MainTreeNode:(0,d.useMemo)(()=>function(){return d.createElement(T._,{features:T.A.Hidden,ref:n})},[n])},s=(0,p.z)(e=>{i(t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t})}),c=(0,p.z)(e=>(i(t=>[...t,e]),()=>s(e))),u=(0,p.z)(()=>{var e;let t=(0,g.r)(r);if(!t)return!1;let n=t.activeElement;return!!(null!=(e=r.current)&&e.contains(n))||a.some(e=>{var r,o;return(null==(r=t.getElementById(e.buttonId.current))?void 0:r.contains(n))||(null==(o=t.getElementById(e.panelId.current))?void 0:o.contains(n))})}),f=(0,p.z)(e=>{for(let t of a)t.buttonId.current!==e&&t.close()}),h=(0,d.useMemo)(()=>({registerPopover:c,unregisterPopover:s,isFocusWithinPopoverGroup:u,closeOthers:f,mainTreeNodeRef:l.mainTreeNodeRef}),[c,s,u,f,l.mainTreeNodeRef]),m=(0,d.useMemo)(()=>({}),[]);return d.createElement($.Provider,{value:h},(0,k.sY)({ourProps:{ref:o},theirProps:e,slot:m,defaultTag:"div",name:"Popover.Group"}),d.createElement(l.MainTreeNode,null))})});var ee=n(33044),et=n(28517);let en=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};var er=n(4537),eo=n(99735),ea=n(7656);function ei(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setHours(0,0,0,0),t}function el(){return ei(Date.now())}function es(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setDate(1),t.setHours(0,0,0,0),t}var ec=n(97324),eu=n(96398),ed=n(41154);function ef(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)}),n||new Date(NaN)}function ep(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)}),n||new Date(NaN)}var eh=n(25721),em=n(47869);function eg(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,-n)}var ev=n(55463);function ey(e,t){if((0,ea.Z)(2,arguments),!t||"object"!==(0,ed.Z)(t))return new Date(NaN);var n=t.years?(0,em.Z)(t.years):0,r=t.months?(0,em.Z)(t.months):0,o=t.weeks?(0,em.Z)(t.weeks):0,a=t.days?(0,em.Z)(t.days):0,i=t.hours?(0,em.Z)(t.hours):0,l=t.minutes?(0,em.Z)(t.minutes):0,s=t.seconds?(0,em.Z)(t.seconds):0;return new Date(eg(function(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,-n)}(e,r+12*n),a+7*o).getTime()-1e3*(s+60*(l+60*i)))}function eb(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ex(e){return(0,ea.Z)(1,arguments),e instanceof Date||"object"===(0,ed.Z)(e)&&"[object Date]"===Object.prototype.toString.call(e)}function ew(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCDay();return t.setUTCDate(t.getUTCDate()-((n<1?7:0)+n-1)),t.setUTCHours(0,0,0,0),t}function ek(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=ew(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=ew(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}var eS={};function eE(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getUTCDay();return d.setUTCDate(d.getUTCDate()-((f<u?7:0)+f-u)),d.setUTCHours(0,0,0,0),d}function eO(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getUTCFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var h=eE(p,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var g=eE(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}function eC(e,t){for(var n=Math.abs(e).toString();n.length<t;)n="0"+n;return(e<0?"-":"")+n}var ej={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return eC("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):eC(n+1,2)},d:function(e,t){return eC(e.getUTCDate(),t.length)},h:function(e,t){return eC(e.getUTCHours()%12||12,t.length)},H:function(e,t){return eC(e.getUTCHours(),t.length)},m:function(e,t){return eC(e.getUTCMinutes(),t.length)},s:function(e,t){return eC(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length;return eC(Math.floor(e.getUTCMilliseconds()*Math.pow(10,n-3)),t.length)}},e_={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function eP(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+(t||"")+eC(a,2)}function eN(e,t){return e%60==0?(e>0?"-":"+")+eC(Math.abs(e)/60,2):eT(e,t)}function eT(e,t){var n=Math.abs(e);return(e>0?"-":"+")+eC(Math.floor(n/60),2)+(t||"")+eC(n%60,2)}var eA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return ej.y(e,t)},Y:function(e,t,n,r){var o=eO(e,r),a=o>0?o:1-o;return"YY"===t?eC(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):eC(a,t.length)},R:function(e,t){return eC(ek(e),t.length)},u:function(e,t){return eC(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return eC(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return eC(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return ej.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return eC(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((eE(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=eO(e,t),f=new Date(0);return f.setUTCFullYear(d,0,u),f.setUTCHours(0,0,0,0),eE(f,t)})(n,t).getTime())/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):eC(o,t.length)},I:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((ew(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=ek(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),ew(n)})(t).getTime())/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):eC(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):ej.d(e,t)},D:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getTime();return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),Math.floor((n-t.getTime())/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):eC(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return eC(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return eC(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return eC(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?e_.noon:0===o?e_.midnight:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?e_.evening:o>=12?e_.afternoon:o>=4?e_.morning:e_.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ej.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ej.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):ej.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):ej.s(e,t)},S:function(e,t){return ej.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return eN(o);case"XXXX":case"XX":return eT(o);default:return eT(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return eN(o);case"xxxx":case"xx":return eT(o);default:return eT(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},t:function(e,t,n,r){return eC(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return eC((r._originalDate||e).getTime(),t.length)}},eM=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},eI=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},eR={p:eI,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],a=r[2];if(!a)return eM(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",eM(o,t)).replace("{{time}}",eI(a,t))}};function eD(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var eL=["D","DD"],eZ=["YY","YYYY"];function ez(e,t,n){if("YYYY"===e)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var eB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function eF(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var eH={date:eF({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:eF({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:eF({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},eq={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function eW(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!=n&&n.width?String(n.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var i=e.defaultWidth,l=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[i]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function eU(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var l=i[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(s,function(e){return e.test(l)}):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(s,function(e){return e.test(l)});return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(l.length)}}}var eK={code:"en-US",formatDistance:function(e,t,n){var r,o=eB[e];return(r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix)?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:eH,formatRelative:function(e,t,n,r){return eq[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:eW({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:eW({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:eW({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:eW({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:eW({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(i={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(i.matchPattern);if(!n)return null;var r=n[0],o=e.match(i.parsePattern);if(!o)return null;var a=i.valueCallback?i.valueCallback(o[0]):o[0];return{value:a=t.valueCallback?t.valueCallback(a):a,rest:e.slice(r.length)}}),era:eU({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:eU({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:eU({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:eU({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:eU({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},e$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eX=/^'([^]*?)'?$/,eG=/''/g,eY=/[a-zA-Z]/;function eQ(e,t,n){(0,ea.Z)(2,arguments);var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w=String(t),k=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:eS.locale)&&void 0!==r?r:eK,S=(0,em.Z)(null!==(a=null!==(i=null!==(l=null!==(s=null==n?void 0:n.firstWeekContainsDate)&&void 0!==s?s:null==n?void 0:null===(c=n.locale)||void 0===c?void 0:null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==l?l:eS.firstWeekContainsDate)&&void 0!==i?i:null===(d=eS.locale)||void 0===d?void 0:null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==a?a:1);if(!(S>=1&&S<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=(0,em.Z)(null!==(p=null!==(h=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n?void 0:null===(v=n.locale)||void 0===v?void 0:null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:eS.weekStartsOn)&&void 0!==h?h:null===(b=eS.locale)||void 0===b?void 0:null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(E>=0&&E<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw RangeError("locale must contain localize property");if(!k.formatLong)throw RangeError("locale must contain formatLong property");var O=(0,eo.Z)(e);if(!function(e){return(0,ea.Z)(1,arguments),(!!ex(e)||"number"==typeof e)&&!isNaN(Number((0,eo.Z)(e)))}(O))throw RangeError("Invalid time value");var C=eD(O),j=function(e,t){return(0,ea.Z)(2,arguments),function(e,t){return(0,ea.Z)(2,arguments),new Date((0,eo.Z)(e).getTime()+(0,em.Z)(t))}(e,-(0,em.Z)(t))}(O,C),_={firstWeekContainsDate:S,weekStartsOn:E,locale:k,_originalDate:O};return w.match(eV).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,eR[t])(e,k.formatLong):e}).join("").match(e$).map(function(r){if("''"===r)return"'";var o,a=r[0];if("'"===a)return(o=r.match(eX))?o[1].replace(eG,"'"):r;var i=eA[a];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===eZ.indexOf(r)||ez(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||-1===eL.indexOf(r)||ez(r,t,String(e)),i(j,r,k.localize,_);if(a.match(eY))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r}).join("")}var eJ=n(1153);let e0=(0,eJ.fn)("DateRangePicker"),e1=(e,t,n,r)=>{var o;if(n&&(e=null===(o=r.get(n))||void 0===o?void 0:o.from),e)return ei(e&&!t?e:ef([e,t]))},e2=(e,t,n,r)=>{var o,a;if(n&&(e=ei(null!==(a=null===(o=r.get(n))||void 0===o?void 0:o.to)&&void 0!==a?a:el())),e)return ei(e&&!t?e:ep([e,t]))},e6=[{value:"tdy",text:"Today",from:el()},{value:"w",text:"Last 7 days",from:ey(el(),{days:7})},{value:"t",text:"Last 30 days",from:ey(el(),{days:30})},{value:"m",text:"Month to Date",from:es(el())},{value:"y",text:"Year to Date",from:eb(el())}],e4=(e,t,n,r)=>{let o=(null==n?void 0:n.code)||"en-US";if(!e&&!t)return"";if(e&&!t)return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e&&t){if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()===r.getTime()}(e,t))return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())return r?"".concat(eQ(e,r)," - ").concat(eQ(t,r)):"".concat(e.toLocaleDateString(o,{month:"short",day:"numeric"})," - \n ").concat(t.getDate(),", ").concat(t.getFullYear());{if(r)return"".concat(eQ(e,r)," - ").concat(eQ(t,r));let n={year:"numeric",month:"short",day:"numeric"};return"".concat(e.toLocaleDateString(o,n)," - \n ").concat(t.toLocaleDateString(o,n))}}return""};function e3(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function e5(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t),o=n.getFullYear(),a=n.getDate(),i=new Date(0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);var l=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(i);return n.setMonth(r,Math.min(a,l)),n}function e8(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function e7(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function e9(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function te(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()<r.getTime()}function tt(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()-((f<u?7:0)+f-u)),d.setHours(0,0,0,0),d}function tn(e){return(0,ea.Z)(1,arguments),tt(e,{weekStartsOn:1})}function tr(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return n.getTime()===r.getTime()}function to(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()>r.getTime()}function ta(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return Math.round((n.getTime()-eD(n)-(r.getTime()-eD(r)))/864e5)}function ti(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,7*n)}function tl(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,12*n)}function ts(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()+((f<u?-7:0)+6-(f-u))),d.setHours(23,59,59,999),d}function tc(e){return(0,ea.Z)(1,arguments),ts(e,{weekStartsOn:1})}var tu=function(){return(tu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function td(e,t,n){if(n||2==arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tf={exports:{}},tp={};tf.exports=function(){if(s)return tp;s=1;var e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(t,a,i){var l,s={},c=null,u=null;for(l in void 0!==i&&(c=""+i),void 0!==a.key&&(c=""+a.key),void 0!==a.ref&&(u=a.ref),a)n.call(a,l)&&!o.hasOwnProperty(l)&&(s[l]=a[l]);if(t&&t.defaultProps)for(l in a=t.defaultProps)void 0===s[l]&&(s[l]=a[l]);return{$$typeof:e,type:t,key:c,ref:u,props:s,_owner:r.current}}return tp.Fragment=t,tp.jsx=a,tp.jsxs=a,tp}();var th=tf.exports;function tm(e){return"multiple"===e.mode}function tg(e){return"range"===e.mode}function tv(e){return"single"===e.mode}var ty={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"},tb=Object.freeze({__proto__:null,formatCaption:function(e,t){return eQ(e,"LLLL y",t)},formatDay:function(e,t){return eQ(e,"d",t)},formatMonthCaption:function(e,t){return eQ(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return eQ(e,"cccccc",t)},formatYearCaption:function(e,t){return eQ(e,"yyyy",t)}}),tx=Object.freeze({__proto__:null,labelDay:function(e,t,n){return eQ(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return eQ(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}}),tw=(0,d.createContext)(void 0);function tk(e){var t,n,r,o,a,i,l,s,c=e.initialProps,u={captionLayout:"buttons",classNames:ty,formatters:tb,labels:tx,locale:eK,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},d=(t=c.fromYear,n=c.toYear,r=c.fromMonth,o=c.toMonth,a=c.fromDate,i=c.toDate,r?a=es(r):t&&(a=new Date(t,0,1)),o?i=e3(o):n&&(i=new Date(n,11,31)),{fromDate:a?ei(a):void 0,toDate:i?ei(i):void 0}),f=d.fromDate,p=d.toDate,h=null!==(l=c.captionLayout)&&void 0!==l?l:u.captionLayout;"buttons"===h||f&&p||(h="buttons"),(tv(c)||tm(c)||tg(c))&&(s=c.onSelect);var m=tu(tu(tu({},u),c),{captionLayout:h,classNames:tu(tu({},u.classNames),c.classNames),components:tu({},c.components),formatters:tu(tu({},u.formatters),c.formatters),fromDate:f,labels:tu(tu({},u.labels),c.labels),mode:c.mode||u.mode,modifiers:tu(tu({},u.modifiers),c.modifiers),modifiersClassNames:tu(tu({},u.modifiersClassNames),c.modifiersClassNames),onSelect:s,styles:tu(tu({},u.styles),c.styles),toDate:p});return th.jsx(tw.Provider,{value:m,children:e.children})}function tS(){var e=(0,d.useContext)(tw);if(!e)throw Error("useDayPicker must be used within a DayPickerProvider.");return e}function tE(e){var t=tS(),n=t.locale,r=t.classNames,o=t.styles,a=t.formatters.formatCaption;return th.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:n})})}function tO(e){return th.jsx("svg",tu({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:th.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tC(e){var t,n,r=e.onChange,o=e.value,a=e.children,i=e.caption,l=e.className,s=e.style,c=tS(),u=null!==(n=null===(t=c.components)||void 0===t?void 0:t.IconDropdown)&&void 0!==n?n:tO;return th.jsxs("div",{className:l,style:s,children:[th.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),th.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:a}),th.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[i,th.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function tj(e){var t,n=tS(),r=n.fromDate,o=n.toDate,a=n.styles,i=n.locale,l=n.formatters.formatMonthCaption,s=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r||!o)return th.jsx(th.Fragment,{});var d=[];if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()}(r,o))for(var f=es(r),p=r.getMonth();p<=o.getMonth();p++)d.push(e5(f,p));else for(var f=es(new Date),p=0;p<=11;p++)d.push(e5(f,p));var h=null!==(t=null==c?void 0:c.Dropdown)&&void 0!==t?t:tC;return th.jsx(h,{name:"months","aria-label":u(),className:s.dropdown_month,style:a.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=e5(es(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:i}),children:d.map(function(e){return th.jsx("option",{value:e.getMonth(),children:l(e,{locale:i})},e.getMonth())})})}function t_(e){var t,n=e.displayMonth,r=tS(),o=r.fromDate,a=r.toDate,i=r.locale,l=r.styles,s=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!o||!a)return th.jsx(th.Fragment,{});for(var p=o.getFullYear(),h=a.getFullYear(),m=p;m<=h;m++)f.push(e8(eb(new Date),m));var g=null!==(t=null==c?void 0:c.Dropdown)&&void 0!==t?t:tC;return th.jsx(g,{name:"years","aria-label":d(),className:s.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=e8(es(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:u(n,{locale:i}),children:f.map(function(e){return th.jsx("option",{value:e.getFullYear(),children:u(e,{locale:i})},e.getFullYear())})})}var tP=(0,d.createContext)(void 0);function tN(e){var t,n,r,o,a,i,l,s,c,u,f,p,h,m,g,v,y=tS(),b=(g=(r=(n=t=tS()).month,o=n.defaultMonth,a=n.today,i=r||o||a||new Date,l=n.toDate,s=n.fromDate,c=n.numberOfMonths,l&&0>e7(l,i)&&(i=(0,ev.Z)(l,-1*((void 0===c?1:c)-1))),s&&0>e7(i,s)&&(i=s),u=es(i),f=t.month,h=(p=(0,d.useState)(u))[0],m=[void 0===f?h:f,p[1]])[0],v=m[1],[g,function(e){if(!t.disableNavigation){var n,r=es(e);v(r),null===(n=t.onMonthChange)||void 0===n||n.call(t,r)}}]),x=b[0],w=b[1],k=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=es(e),a=e7(es((0,ev.Z)(o,r)),o),i=[],l=0;l<a;l++){var s=(0,ev.Z)(o,l);i.push(s)}return n&&(i=i.reverse()),i}(x,y),S=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=es(e);if(!n||!(e7(n,e)<a))return(0,ev.Z)(i,r?a:1)}}(x,y),E=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,a=es(e);if(!n||!(0>=e7(a,n)))return(0,ev.Z)(a,-(r?void 0===o?1:o:1))}}(x,y),O=function(e){return k.some(function(t){return e9(e,t)})};return th.jsx(tP.Provider,{value:{currentMonth:x,displayMonths:k,goToMonth:w,goToDate:function(e,t){O(e)||(t&&te(e,t)?w((0,ev.Z)(e,1+-1*y.numberOfMonths)):w(e))},previousMonth:E,nextMonth:S,isDateDisplayed:O},children:e.children})}function tT(){var e=(0,d.useContext)(tP);if(!e)throw Error("useNavigation must be used within a NavigationProvider");return e}function tA(e){var t,n=tS(),r=n.classNames,o=n.styles,a=n.components,i=tT().goToMonth,l=function(t){i((0,ev.Z)(t,e.displayIndex?-e.displayIndex:0))},s=null!==(t=null==a?void 0:a.CaptionLabel)&&void 0!==t?t:tE,c=th.jsx(s,{id:e.id,displayMonth:e.displayMonth});return th.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[th.jsx("div",{className:r.vhidden,children:c}),th.jsx(tj,{onChange:l,displayMonth:e.displayMonth}),th.jsx(t_,{onChange:l,displayMonth:e.displayMonth})]})}function tM(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tI(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var tR=(0,d.forwardRef)(function(e,t){var n=tS(),r=n.classNames,o=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var i=a.join(" "),l=tu(tu({},o.button_reset),o.button);return e.style&&Object.assign(l,e.style),th.jsx("button",tu({},e,{ref:t,type:"button",className:i,style:l}))});function tD(e){var t,n,r=tS(),o=r.dir,a=r.locale,i=r.classNames,l=r.styles,s=r.labels,c=s.labelPrevious,u=s.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return th.jsx(th.Fragment,{});var f=c(e.previousMonth,{locale:a}),p=[i.nav_button,i.nav_button_previous].join(" "),h=u(e.nextMonth,{locale:a}),m=[i.nav_button,i.nav_button_next].join(" "),g=null!==(t=null==d?void 0:d.IconRight)&&void 0!==t?t:tI,v=null!==(n=null==d?void 0:d.IconLeft)&&void 0!==n?n:tM;return th.jsxs("div",{className:i.nav,style:l.nav,children:[!e.hidePrevious&&th.jsx(tR,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===o?th.jsx(g,{className:i.nav_icon,style:l.nav_icon}):th.jsx(v,{className:i.nav_icon,style:l.nav_icon})}),!e.hideNext&&th.jsx(tR,{name:"next-month","aria-label":h,className:m,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===o?th.jsx(v,{className:i.nav_icon,style:l.nav_icon}):th.jsx(g,{className:i.nav_icon,style:l.nav_icon})})]})}function tL(e){var t=tS().numberOfMonths,n=tT(),r=n.previousMonth,o=n.nextMonth,a=n.goToMonth,i=n.displayMonths,l=i.findIndex(function(t){return e9(e.displayMonth,t)}),s=0===l,c=l===i.length-1;return th.jsx(tD,{displayMonth:e.displayMonth,hideNext:t>1&&(s||!c),hidePrevious:t>1&&(c||!s),nextMonth:o,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){o&&a(o)}})}function tZ(e){var t,n,r=tS(),o=r.classNames,a=r.disableNavigation,i=r.styles,l=r.captionLayout,s=r.components,c=null!==(t=null==s?void 0:s.CaptionLabel)&&void 0!==t?t:tE;return n=a?th.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?th.jsx(tA,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?th.jsxs(th.Fragment,{children:[th.jsx(tA,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),th.jsx(tL,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):th.jsxs(th.Fragment,{children:[th.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(tL,{displayMonth:e.displayMonth,id:e.id})]}),th.jsx("div",{className:o.caption,style:i.caption,children:n})}function tz(e){var t=tS(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?th.jsx("tfoot",{className:o,style:r.tfoot,children:th.jsx("tr",{children:th.jsx("td",{colSpan:8,children:n})})}):th.jsx(th.Fragment,{})}function tB(){var e=tS(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,a=e.weekStartsOn,i=e.ISOWeek,l=e.formatters.formatWeekdayName,s=e.labels.labelWeekday,c=function(e,t,n){for(var r=n?tn(new Date):tt(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=(0,eh.Z)(r,a);o.push(i)}return o}(o,a,i);return th.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&th.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(e,r){return th.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":s(e,{locale:o}),children:l(e,{locale:o})},r)})]})}function tF(){var e,t=tS(),n=t.classNames,r=t.styles,o=t.components,a=null!==(e=null==o?void 0:o.HeadRow)&&void 0!==e?e:tB;return th.jsx("thead",{style:r.head,className:n.head,children:th.jsx(a,{})})}function tH(e){var t=tS(),n=t.locale,r=t.formatters.formatDay;return th.jsx(th.Fragment,{children:r(e.date,{locale:n})})}var tq=(0,d.createContext)(void 0);function tW(e){return tm(e.initialProps)?th.jsx(tU,{initialProps:e.initialProps,children:e.children}):th.jsx(tq.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function tU(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,a=t.max,i={disabled:[]};return r&&i.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return tr(t,e)});return!!(t&&!n)}),th.jsx(tq.Provider,{value:{selected:r,onDayClick:function(e,n,i){if(null===(l=t.onDayClick)||void 0===l||l.call(t,e,n,i),(!n.selected||!o||(null==r?void 0:r.length)!==o)&&(n.selected||!a||(null==r?void 0:r.length)!==a)){var l,s,c=r?td([],r,!0):[];if(n.selected){var u=c.findIndex(function(t){return tr(e,t)});c.splice(u,1)}else c.push(e);null===(s=t.onSelect)||void 0===s||s.call(t,c,e,n,i)}},modifiers:i},children:n})}function tK(){var e=(0,d.useContext)(tq);if(!e)throw Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var t$=(0,d.createContext)(void 0);function tV(e){return tg(e.initialProps)?th.jsx(tX,{initialProps:e.initialProps,children:e.children}):th.jsx(t$.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function tX(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},a=o.from,i=o.to,l=t.min,s=t.max,c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(c.range_start=[a],i?(c.range_end=[i],tr(a,i)||(c.range_middle=[{after:a,before:i}])):c.range_end=[a]):i&&(c.range_start=[i],c.range_end=[i]),l&&(a&&!i&&c.disabled.push({after:eg(a,l-1),before:(0,eh.Z)(a,l-1)}),a&&i&&c.disabled.push({after:a,before:(0,eh.Z)(a,l-1)}),!a&&i&&c.disabled.push({after:eg(i,l-1),before:(0,eh.Z)(i,l-1)})),s){if(a&&!i&&(c.disabled.push({before:(0,eh.Z)(a,-s+1)}),c.disabled.push({after:(0,eh.Z)(a,s-1)})),a&&i){var u=s-(ta(i,a)+1);c.disabled.push({before:eg(a,u)}),c.disabled.push({after:(0,eh.Z)(i,u)})}!a&&i&&(c.disabled.push({before:(0,eh.Z)(i,-s+1)}),c.disabled.push({after:(0,eh.Z)(i,s-1)}))}return th.jsx(t$.Provider,{value:{selected:r,onDayClick:function(e,n,o){null===(s=t.onDayClick)||void 0===s||s.call(t,e,n,o);var a,i,l,s,c,u=(i=(a=r||{}).from,l=a.to,i&&l?tr(l,e)&&tr(i,e)?void 0:tr(l,e)?{from:l,to:void 0}:tr(i,e)?void 0:to(i,e)?{from:e,to:l}:{from:i,to:e}:l?to(e,l)?{from:l,to:e}:{from:e,to:l}:i?te(e,i)?{from:e,to:i}:{from:i,to:e}:{from:e,to:void 0});null===(c=t.onSelect)||void 0===c||c.call(t,u,e,n,o)},modifiers:c},children:n})}function tG(){var e=(0,d.useContext)(t$);if(!e)throw Error("useSelectRange must be used within a SelectRangeProvider");return e}function tY(e){return Array.isArray(e)?td([],e,!0):void 0!==e?[e]:[]}(l=c||(c={})).Outside="outside",l.Disabled="disabled",l.Selected="selected",l.Hidden="hidden",l.Today="today",l.RangeStart="range_start",l.RangeEnd="range_end",l.RangeMiddle="range_middle";var tQ=c.Selected,tJ=c.Disabled,t0=c.Hidden,t1=c.Today,t2=c.RangeEnd,t6=c.RangeMiddle,t4=c.RangeStart,t3=c.Outside,t5=(0,d.createContext)(void 0);function t8(e){var t,n,r,o=tS(),a=tK(),i=tG(),l=((t={})[tQ]=tY(o.selected),t[tJ]=tY(o.disabled),t[t0]=tY(o.hidden),t[t1]=[o.today],t[t2]=[],t[t6]=[],t[t4]=[],t[t3]=[],o.fromDate&&t[tJ].push({before:o.fromDate}),o.toDate&&t[tJ].push({after:o.toDate}),tm(o)?t[tJ]=t[tJ].concat(a.modifiers[tJ]):tg(o)&&(t[tJ]=t[tJ].concat(i.modifiers[tJ]),t[t4]=i.modifiers[t4],t[t6]=i.modifiers[t6],t[t2]=i.modifiers[t2]),t),s=(n=o.modifiers,r={},Object.entries(n).forEach(function(e){var t=e[0],n=e[1];r[t]=tY(n)}),r),c=tu(tu({},l),s);return th.jsx(t5.Provider,{value:c,children:e.children})}function t7(){var e=(0,d.useContext)(t5);if(!e)throw Error("useModifiers must be used within a ModifiersProvider");return e}function t9(e,t,n){var r=Object.keys(t).reduce(function(n,r){return t[r].some(function(t){if("boolean"==typeof t)return t;if(ex(t))return tr(e,t);if(Array.isArray(t)&&t.every(ex))return t.includes(e);if(t&&"object"==typeof t&&"from"in t)return r=t.from,o=t.to,r&&o?(0>ta(o,r)&&(r=(n=[o,r])[0],o=n[1]),ta(e,r)>=0&&ta(o,e)>=0):o?tr(o,e):!!r&&tr(r,e);if(t&&"object"==typeof t&&"dayOfWeek"in t)return t.dayOfWeek.includes(e.getDay());if(t&&"object"==typeof t&&"before"in t&&"after"in t){var n,r,o,a=ta(t.before,e),i=ta(t.after,e),l=a>0,s=i<0;return to(t.before,t.after)?s&&l:l||s}return t&&"object"==typeof t&&"after"in t?ta(e,t.after)>0:t&&"object"==typeof t&&"before"in t?ta(t.before,e)>0:"function"==typeof t&&t(e)})&&n.push(r),n},[]),o={};return r.forEach(function(e){return o[e]=!0}),n&&!e9(e,n)&&(o.outside=!0),o}var ne=(0,d.createContext)(void 0);function nt(e){var t=tT(),n=t7(),r=(0,d.useState)(),o=r[0],a=r[1],i=(0,d.useState)(),l=i[0],s=i[1],c=function(e,t){for(var n,r,o=es(e[0]),a=e3(e[e.length-1]),i=o;i<=a;){var l=t9(i,t);if(!(!l.disabled&&!l.hidden)){i=(0,eh.Z)(i,1);continue}if(l.selected)return i;l.today&&!r&&(r=i),n||(n=i),i=(0,eh.Z)(i,1)}return r||n}(t.displayMonths,n),u=(null!=o?o:l&&t.isDateDisplayed(l))?l:c,f=function(e){a(e)},p=tS(),h=function(e,r){if(o){var a=function e(t,n){var r=n.moveBy,o=n.direction,a=n.context,i=n.modifiers,l=n.retry,s=void 0===l?{count:0,lastFocused:t}:l,c=a.weekStartsOn,u=a.fromDate,d=a.toDate,f=a.locale,p=({day:eh.Z,week:ti,month:ev.Z,year:tl,startOfWeek:function(e){return a.ISOWeek?tn(e):tt(e,{locale:f,weekStartsOn:c})},endOfWeek:function(e){return a.ISOWeek?tc(e):ts(e,{locale:f,weekStartsOn:c})}})[r](t,"after"===o?1:-1);"before"===o&&u?p=ef([u,p]):"after"===o&&d&&(p=ep([d,p]));var h=!0;if(i){var m=t9(p,i);h=!m.disabled&&!m.hidden}return h?p:s.count>365?s.lastFocused:e(p,{moveBy:r,direction:o,context:a,modifiers:i,retry:tu(tu({},s),{count:s.count+1})})}(o,{moveBy:e,direction:r,context:p,modifiers:n});tr(o,a)||(t.goToDate(a,o),f(a))}};return th.jsx(ne.Provider,{value:{focusedDay:o,focusTarget:u,blur:function(){s(o),a(void 0)},focus:f,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}},children:e.children})}function nn(){var e=(0,d.useContext)(ne);if(!e)throw Error("useFocusContext must be used within a FocusProvider");return e}var nr=(0,d.createContext)(void 0);function no(e){return tv(e.initialProps)?th.jsx(na,{initialProps:e.initialProps,children:e.children}):th.jsx(nr.Provider,{value:{selected:void 0},children:e.children})}function na(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var o,a,i;if(null===(o=t.onDayClick)||void 0===o||o.call(t,e,n,r),n.selected&&!t.required){null===(a=t.onSelect)||void 0===a||a.call(t,void 0,e,n,r);return}null===(i=t.onSelect)||void 0===i||i.call(t,e,e,n,r)}};return th.jsx(nr.Provider,{value:r,children:n})}function ni(){var e=(0,d.useContext)(nr);if(!e)throw Error("useSelectSingle must be used within a SelectSingleProvider");return e}function nl(e){var t,n,r,o,a,i,l,s,u,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U=(0,d.useRef)(null),K=(t=e.date,n=e.displayMonth,i=tS(),l=nn(),s=t9(t,t7(),n),u=tS(),f=ni(),p=tK(),h=tG(),g=(m=nn()).focusDayAfter,v=m.focusDayBefore,y=m.focusWeekAfter,b=m.focusWeekBefore,x=m.blur,w=m.focus,k=m.focusMonthBefore,S=m.focusMonthAfter,E=m.focusYearBefore,O=m.focusYearAfter,C=m.focusStartOfWeek,j=m.focusEndOfWeek,_={onClick:function(e){var n,r,o,a;tv(u)?null===(n=f.onDayClick)||void 0===n||n.call(f,t,s,e):tm(u)?null===(r=p.onDayClick)||void 0===r||r.call(p,t,s,e):tg(u)?null===(o=h.onDayClick)||void 0===o||o.call(h,t,s,e):null===(a=u.onDayClick)||void 0===a||a.call(u,t,s,e)},onFocus:function(e){var n;w(t),null===(n=u.onDayFocus)||void 0===n||n.call(u,t,s,e)},onBlur:function(e){var n;x(),null===(n=u.onDayBlur)||void 0===n||n.call(u,t,s,e)},onKeyDown:function(e){var n;switch(e.key){case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?g():v();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?v():g();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),y();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),b();break;case"PageUp":e.preventDefault(),e.stopPropagation(),e.shiftKey?E():k();break;case"PageDown":e.preventDefault(),e.stopPropagation(),e.shiftKey?O():S();break;case"Home":e.preventDefault(),e.stopPropagation(),C();break;case"End":e.preventDefault(),e.stopPropagation(),j()}null===(n=u.onDayKeyDown)||void 0===n||n.call(u,t,s,e)},onKeyUp:function(e){var n;null===(n=u.onDayKeyUp)||void 0===n||n.call(u,t,s,e)},onMouseEnter:function(e){var n;null===(n=u.onDayMouseEnter)||void 0===n||n.call(u,t,s,e)},onMouseLeave:function(e){var n;null===(n=u.onDayMouseLeave)||void 0===n||n.call(u,t,s,e)},onPointerEnter:function(e){var n;null===(n=u.onDayPointerEnter)||void 0===n||n.call(u,t,s,e)},onPointerLeave:function(e){var n;null===(n=u.onDayPointerLeave)||void 0===n||n.call(u,t,s,e)},onTouchCancel:function(e){var n;null===(n=u.onDayTouchCancel)||void 0===n||n.call(u,t,s,e)},onTouchEnd:function(e){var n;null===(n=u.onDayTouchEnd)||void 0===n||n.call(u,t,s,e)},onTouchMove:function(e){var n;null===(n=u.onDayTouchMove)||void 0===n||n.call(u,t,s,e)},onTouchStart:function(e){var n;null===(n=u.onDayTouchStart)||void 0===n||n.call(u,t,s,e)}},P=tS(),N=ni(),T=tK(),A=tG(),M=tv(P)?N.selected:tm(P)?T.selected:tg(P)?A.selected:void 0,I=!!(i.onDayClick||"default"!==i.mode),(0,d.useEffect)(function(){var e;!s.outside&&l.focusedDay&&I&&tr(l.focusedDay,t)&&(null===(e=U.current)||void 0===e||e.focus())},[l.focusedDay,t,U,I,s.outside]),D=(R=[i.classNames.day],Object.keys(s).forEach(function(e){var t=i.modifiersClassNames[e];if(t)R.push(t);else if(Object.values(c).includes(e)){var n=i.classNames["day_".concat(e)];n&&R.push(n)}}),R).join(" "),L=tu({},i.styles.day),Object.keys(s).forEach(function(e){var t;L=tu(tu({},L),null===(t=i.modifiersStyles)||void 0===t?void 0:t[e])}),Z=L,z=!!(s.outside&&!i.showOutsideDays||s.hidden),B=null!==(a=null===(o=i.components)||void 0===o?void 0:o.DayContent)&&void 0!==a?a:tH,F={style:Z,className:D,children:th.jsx(B,{date:t,displayMonth:n,activeModifiers:s}),role:"gridcell"},H=l.focusTarget&&tr(l.focusTarget,t)&&!s.outside,q=l.focusedDay&&tr(l.focusedDay,t),W=tu(tu(tu({},F),((r={disabled:s.disabled,role:"gridcell"})["aria-selected"]=s.selected,r.tabIndex=q||H?0:-1,r)),_),{isButton:I,isHidden:z,activeModifiers:s,selectedDays:M,buttonProps:W,divProps:F});return K.isHidden?th.jsx("div",{role:"gridcell"}):K.isButton?th.jsx(tR,tu({name:"day",ref:U},K.buttonProps)):th.jsx("div",tu({},K.divProps))}function ns(e){var t=e.number,n=e.dates,r=tS(),o=r.onWeekNumberClick,a=r.styles,i=r.classNames,l=r.locale,s=r.labels.labelWeekNumber,c=(0,r.formatters.formatWeekNumber)(Number(t),{locale:l});if(!o)return th.jsx("span",{className:i.weeknumber,style:a.weeknumber,children:c});var u=s(Number(t),{locale:l});return th.jsx(tR,{name:"week-number","aria-label":u,className:i.weeknumber,style:a.weeknumber,onClick:function(e){o(t,n,e)},children:c})}function nc(e){var t,n,r,o=tS(),a=o.styles,i=o.classNames,l=o.showWeekNumber,s=o.components,c=null!==(t=null==s?void 0:s.Day)&&void 0!==t?t:nl,u=null!==(n=null==s?void 0:s.WeekNumber)&&void 0!==n?n:ns;return l&&(r=th.jsx("td",{className:i.cell,style:a.cell,children:th.jsx(u,{number:e.weekNumber,dates:e.dates})})),th.jsxs("tr",{className:i.row,style:a.row,children:[r,e.dates.map(function(t){return th.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:th.jsx(c,{displayMonth:e.displayMonth,date:t})},function(e){return(0,ea.Z)(1,arguments),Math.floor(function(e){return(0,ea.Z)(1,arguments),(0,eo.Z)(e).getTime()}(e)/1e3)}(t))})]})}function nu(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?tc(t):ts(t,n),o=(null==n?void 0:n.ISOWeek)?tn(e):tt(e,n),a=ta(r,o),i=[],l=0;l<=a;l++)i.push((0,eh.Z)(o,l));return i.reduce(function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((tn(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=tn(r),a=new Date(0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);var i=tn(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),tn(n)})(t).getTime())/6048e5)+1}(t):function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((tt(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var h=tt(p,t),m=new Date(0);m.setFullYear(d,0,f),m.setHours(0,0,0,0);var g=tt(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(d,0,u),f.setHours(0,0,0,0),tt(f,t)})(n,t).getTime())/6048e5)+1}(t,n),o=e.find(function(e){return e.weekNumber===r});return o?o.dates.push(t):e.push({weekNumber:r,dates:[t]}),e},[])}function nd(e){var t,n,r,o=tS(),a=o.locale,i=o.classNames,l=o.styles,s=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,p=o.ISOWeek,h=function(e,t){var n=nu(es(e),e3(e),t);if(null==t?void 0:t.useFixedWeeks){var r=function(e,t){return(0,ea.Z)(1,arguments),function(e,t,n){(0,ea.Z)(2,arguments);var r=tt(e,n),o=tt(t,n);return Math.round((r.getTime()-eD(r)-(o.getTime()-eD(o)))/6048e5)}(function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),es(e),t)+1}(e,t);if(r<6){var o=n[n.length-1],a=o.dates[o.dates.length-1],i=ti(a,6-r),l=nu(ti(a,1),i,t);n.push.apply(n,l)}}return n}(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:a,weekStartsOn:d,firstWeekContainsDate:f}),m=null!==(t=null==u?void 0:u.Head)&&void 0!==t?t:tF,g=null!==(n=null==u?void 0:u.Row)&&void 0!==n?n:nc,v=null!==(r=null==u?void 0:u.Footer)&&void 0!==r?r:tz;return th.jsxs("table",{id:e.id,className:i.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!s&&th.jsx(m,{}),th.jsx("tbody",{className:i.tbody,style:l.tbody,children:h.map(function(t){return th.jsx(g,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),th.jsx(v,{displayMonth:e.displayMonth})]})}var nf="undefined"!=typeof window&&window.document&&window.document.createElement?d.useLayoutEffect:d.useEffect,np=!1,nh=0;function nm(){return"react-day-picker-".concat(++nh)}function ng(e){var t,n,r,o,a,i,l,s,c=tS(),u=c.dir,f=c.classNames,p=c.styles,h=c.components,m=tT().displayMonths,g=(r=null!=(t=c.id?"".concat(c.id,"-").concat(e.displayIndex):void 0)?t:np?nm():null,a=(o=(0,d.useState)(r))[0],i=o[1],nf(function(){null===a&&i(nm())},[]),(0,d.useEffect)(function(){!1===np&&(np=!0)},[]),null!==(n=null!=t?t:a)&&void 0!==n?n:void 0),v=c.id?"".concat(c.id,"-grid-").concat(e.displayIndex):void 0,y=[f.month],b=p.month,x=0===e.displayIndex,w=e.displayIndex===m.length-1,k=!x&&!w;"rtl"===u&&(w=(l=[x,w])[0],x=l[1]),x&&(y.push(f.caption_start),b=tu(tu({},b),p.caption_start)),w&&(y.push(f.caption_end),b=tu(tu({},b),p.caption_end)),k&&(y.push(f.caption_between),b=tu(tu({},b),p.caption_between));var S=null!==(s=null==h?void 0:h.Caption)&&void 0!==s?s:tZ;return th.jsxs("div",{className:y.join(" "),style:b,children:[th.jsx(S,{id:g,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(nd,{id:v,"aria-labelledby":g,displayMonth:e.displayMonth})]},e.displayIndex)}function nv(e){var t=tS(),n=t.classNames,r=t.styles;return th.jsx("div",{className:n.months,style:r.months,children:e.children})}function ny(e){var t,n,r=e.initialProps,o=tS(),a=nn(),i=tT(),l=(0,d.useState)(!1),s=l[0],c=l[1];(0,d.useEffect)(function(){o.initialFocus&&a.focusTarget&&(s||(a.focus(a.focusTarget),c(!0)))},[o.initialFocus,s,a.focus,a.focusTarget,a]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=tu(tu({},o.styles.root),o.style),p=Object.keys(r).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var n;return tu(tu({},e),((n={})[t]=r[t],n))},{}),h=null!==(n=null===(t=r.components)||void 0===t?void 0:t.Months)&&void 0!==n?n:nv;return th.jsx("div",tu({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:th.jsx(h,{children:i.displayMonths.map(function(e,t){return th.jsx(ng,{displayIndex:t,displayMonth:e},t)})})}))}function nb(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}(e,["children"]);return th.jsx(tk,{initialProps:n,children:th.jsx(tN,{children:th.jsx(no,{initialProps:n,children:th.jsx(tW,{initialProps:n,children:th.jsx(tV,{initialProps:n,children:th.jsx(t8,{children:th.jsx(nt,{children:t})})})})})})})}function nx(e){return th.jsx(nb,tu({},e,{children:th.jsx(ny,{initialProps:e})}))}let nw=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))},nk=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))},nS=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))},nE=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))};var nO=n(84264);n(41649);var nC=n(1526),nj=n(7084),n_=n(26898);let nP={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},nN={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},nT={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},nA={[nj.wu.Increase]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.ModerateIncrease]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.Decrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.ModerateDecrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.Unchanged]:{bgColor:(0,eJ.bM)(nj.fr.Orange,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Orange,n_.K.text).textColor}},nM={[nj.wu.Increase]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))},[nj.wu.ModerateIncrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))},[nj.wu.Decrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))},[nj.wu.ModerateDecrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))},[nj.wu.Unchanged]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))}},nI=(0,eJ.fn)("BadgeDelta");d.forwardRef((e,t)=>{let{deltaType:n=nj.wu.Increase,isIncreasePositive:r=!0,size:o=nj.u8.SM,tooltip:a,children:i,className:l}=e,s=(0,u._T)(e,["deltaType","isIncreasePositive","size","tooltip","children","className"]),c=nM[n],f=(0,eJ.Fo)(n,r),p=i?nN:nP,{tooltipProps:h,getReferenceProps:m}=(0,nC.l)();return d.createElement("span",Object.assign({ref:(0,eJ.lq)([t,h.refs.setReference]),className:(0,ec.q)(nI("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full bg-opacity-20 dark:bg-opacity-25",nA[f].bgColor,nA[f].textColor,p[o].paddingX,p[o].paddingY,p[o].fontSize,l)},m,s),d.createElement(nC.Z,Object.assign({text:a},h)),d.createElement(c,{className:(0,ec.q)(nI("icon"),"shrink-0",i?(0,ec.q)("-ml-1 mr-1.5"):nT[o].height,nT[o].width)}),i?d.createElement("p",{className:(0,ec.q)(nI("text"),"text-sm whitespace-nowrap")},i):null)}).displayName="BadgeDelta";var nR=n(47323);let nD=e=>{var{onClick:t,icon:n}=e,r=(0,u._T)(e,["onClick","icon"]);return d.createElement("button",Object.assign({type:"button",className:(0,ec.q)("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},r),d.createElement(nR.Z,{onClick:t,icon:n,variant:"simple",color:"slate",size:"sm"}))};function nL(e){var{mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,enableYearNavigation:l,classNames:s,weekStartsOn:c=0}=e,f=(0,u._T)(e,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return d.createElement(nx,Object.assign({showOutsideDays:!0,mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,weekStartsOn:c,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},s),components:{IconLeft:e=>{var t=(0,u._T)(e,[]);return d.createElement(nw,Object.assign({className:"h-4 w-4"},t))},IconRight:e=>{var t=(0,u._T)(e,[]);return d.createElement(nk,Object.assign({className:"h-4 w-4"},t))},Caption:e=>{var t=(0,u._T)(e,[]);let{goToMonth:n,nextMonth:r,previousMonth:o,currentMonth:i}=tT();return d.createElement("div",{className:"flex justify-between items-center"},d.createElement("div",{className:"flex items-center space-x-1"},l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,-1)),icon:nS}),d.createElement(nD,{onClick:()=>o&&n(o),icon:nw})),d.createElement(nO.Z,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},eQ(t.displayMonth,"LLLL yyy",{locale:a})),d.createElement("div",{className:"flex items-center space-x-1"},d.createElement(nD,{onClick:()=>r&&n(r),icon:nk}),l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,1)),icon:nE})))}}},f))}nL.displayName="DateRangePicker",n(27281);var nZ=n(57365),nz=n(44140);let nB=el(),nF=d.forwardRef((e,t)=>{var n,r;let{value:o,defaultValue:a,onValueChange:i,enableSelect:l=!0,minDate:s,maxDate:c,placeholder:f="Select range",selectPlaceholder:p="Select range",disabled:h=!1,locale:m=eK,enableClear:g=!0,displayFormat:v,children:y,className:b,enableYearNavigation:x=!1,weekStartsOn:w=0,disabledDates:k}=e,S=(0,u._T)(e,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[E,O]=(0,nz.Z)(a,o),[C,j]=(0,d.useState)(!1),[_,P]=(0,d.useState)(!1),N=(0,d.useMemo)(()=>{let e=[];return s&&e.push({before:s}),c&&e.push({after:c}),[...e,...null!=k?k:[]]},[s,c,k]),T=(0,d.useMemo)(()=>{let e=new Map;return y?d.Children.forEach(y,t=>{var n;e.set(t.props.value,{text:null!==(n=(0,eu.qg)(t))&&void 0!==n?n:t.props.value,from:t.props.from,to:t.props.to})}):e6.forEach(t=>{e.set(t.value,{text:t.text,from:t.from,to:nB})}),e},[y]),A=(0,d.useMemo)(()=>{if(y)return(0,eu.sl)(y);let e=new Map;return e6.forEach(t=>e.set(t.value,t.text)),e},[y]),M=(null==E?void 0:E.selectValue)||"",I=e1(null==E?void 0:E.from,s,M,T),R=e2(null==E?void 0:E.to,c,M,T),D=I||R?e4(I,R,m,v):f,L=es(null!==(r=null!==(n=null!=R?R:I)&&void 0!==n?n:c)&&void 0!==r?r:nB),Z=g&&!h;return d.createElement("div",Object.assign({ref:t,className:(0,ec.q)("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",b)},S),d.createElement(J,{as:"div",className:(0,ec.q)("w-full",l?"rounded-l-tremor-default":"rounded-tremor-default",C&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},d.createElement("div",{className:"relative w-full"},d.createElement(J.Button,{onFocus:()=>j(!0),onBlur:()=>j(!1),disabled:h,className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",l?"rounded-l-tremor-default":"rounded-tremor-default",Z?"pr-8":"pr-4",(0,eu.um)((0,eu.Uh)(I||R),h))},d.createElement(en,{className:(0,ec.q)(e0("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),d.createElement("p",{className:"truncate"},D)),Z&&I?d.createElement("button",{type:"button",className:(0,ec.q)("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==i||i({}),O({})}},d.createElement(er.Z,{className:(0,ec.q)(e0("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),d.createElement(ee.u,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(J.Panel,{focus:!0,className:(0,ec.q)("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},d.createElement(nL,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:L,selected:{from:I,to:R},onSelect:e=>{null==i||i({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),O({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:m,disabled:N,enableYearNavigation:x,classNames:{day_range_middle:(0,ec.q)("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:w},e))))),l&&d.createElement(et.R,{as:"div",className:(0,ec.q)("w-48 -ml-px rounded-r-tremor-default",_&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:M,onChange:e=>{let{from:t,to:n}=T.get(e),r=null!=n?n:nB;null==i||i({from:t,to:r,selectValue:e}),O({from:t,to:r,selectValue:e})},disabled:h},e=>{var t;let{value:n}=e;return d.createElement(d.Fragment,null,d.createElement(et.R.Button,{onFocus:()=>P(!0),onBlur:()=>P(!1),className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",(0,eu.um)((0,eu.Uh)(n),h))},n&&null!==(t=A.get(n))&&void 0!==t?t:p),d.createElement(ee.u,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(et.R.Options,{className:(0,ec.q)("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=y?y:e6.map(e=>d.createElement(nZ.Z,{key:e.value,value:e.value},e.text)))))}))});nF.displayName="DateRangePicker"},92414:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(5853),o=n(2265);n(42698),n(64016),n(8710);var a=n(33232),i=n(44140),l=n(58747);let s=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var c=n(4537),u=n(28517),d=n(33044);let f=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),o.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var p=n(97324),h=n(1153),m=n(96398);let g=(0,h.fn)("MultiSelect"),v=o.forwardRef((e,t)=>{let{defaultValue:n,value:h,onValueChange:v,placeholder:y="Select...",placeholderSearch:b="Search",disabled:x=!1,icon:w,children:k,className:S}=e,E=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[O,C]=(0,i.Z)(n,h),{reactElementChildren:j,optionsAvailable:_}=(0,o.useMemo)(()=>{let e=o.Children.toArray(k).filter(o.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,m.n0)("",e)}},[k]),[P,N]=(0,o.useState)(""),T=(null!=O?O:[]).length>0,A=(0,o.useMemo)(()=>P?(0,m.n0)(P,j):_,[P,j,_]),M=()=>{N("")};return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:O,value:O,onChange:e=>{null==v||v(e),C(e)},disabled:x,className:(0,p.q)("w-full min-w-[10rem] relative text-tremor-default",S)},E,{multiple:!0}),e=>{let{value:t}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,p.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,m.um)(t.length>0,x))},w&&o.createElement("span",{className:(0,p.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(w,{className:(0,p.q)(g("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("div",{className:"h-6 flex items-center"},t.length>0?o.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,n)=>{var r;return o.createElement("div",{key:n,className:(0,p.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},o.createElement("div",{className:"text-xs truncate "},null!==(r=e.props.children)&&void 0!==r?r:e.props.value),o.createElement("div",{onClick:n=>{n.preventDefault();let r=t.filter(t=>t!==e.props.value);null==v||v(r),C(r)}},o.createElement(f,{className:(0,p.q)(g("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):o.createElement("span",null,y)),o.createElement("span",{className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},o.createElement(l.Z,{className:(0,p.q)(g("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),T&&!x?o.createElement("button",{type:"button",className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),C([]),null==v||v([])}},o.createElement(c.Z,{className:(0,p.q)(g("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,p.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},o.createElement("div",{className:(0,p.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},o.createElement("span",null,o.createElement(s,{className:(0,p.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:b,className:(0,p.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>N(e.target.value),value:P})),o.createElement(a.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:M}},{value:{selectedValue:t}}),A))))})});v.displayName="MultiSelect"},46030:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698),n(64016),n(8710);var o=n(33232),a=n(2265),i=n(97324),l=n(1153),s=n(28517);let c=(0,l.fn)("MultiSelectItem"),u=a.forwardRef((e,t)=>{let{value:n,className:u,children:d}=e,f=(0,r._T)(e,["value","className","children"]),{selectedValue:p}=(0,a.useContext)(o.Z),h=(0,l.NZ)(n,p);return a.createElement(s.R.Option,Object.assign({className:(0,i.q)(c("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",u),ref:t,key:n,value:n},f),a.createElement("input",{type:"checkbox",className:(0,i.q)(c("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),a.createElement("span",{className:"whitespace-nowrap truncate"},null!=d?d:n))});u.displayName="MultiSelectItem"},30150:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var l=n(97324),s=n(1153),c=n(69262);let u="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",f=o.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:f=!0,disabled:p,onValueChange:h,onChange:m}=e,g=(0,r._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),v=(0,o.useRef)(null),[y,b]=o.useState(!1),x=o.useCallback(()=>{b(!0)},[]),w=o.useCallback(()=>{b(!1)},[]),[k,S]=o.useState(!1),E=o.useCallback(()=>{S(!0)},[]),O=o.useCallback(()=>{S(!1)},[]);return o.createElement(c.Z,Object.assign({type:"number",ref:(0,s.lq)([v,t]),disabled:p,makeInputClassName:(0,s.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=v.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&O()},onChange:e=>{p||(null==h||h(parseFloat(e.target.value)),null==m||m(e))},stepper:f?o.createElement("div",{className:(0,l.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepDown(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(i,{"data-testid":"step-down",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepUp(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-up",className:(k?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},g))});f.displayName="NumberInput"},27281:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(5853),o=n(2265),a=n(58747),i=n(4537),l=n(97324),s=n(1153),c=n(96398),u=n(28517),d=n(33044),f=n(44140);let p=(0,s.fn)("Select"),h=o.forwardRef((e,t)=>{let{defaultValue:n,value:s,onValueChange:h,placeholder:m="Select...",disabled:g=!1,icon:v,enableClear:y=!0,children:b,className:x}=e,w=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","children","className"]),[k,S]=(0,f.Z)(n,s),E=(0,o.useMemo)(()=>{let e=o.Children.toArray(b).filter(o.isValidElement);return(0,c.sl)(e)},[b]);return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:k,value:k,onChange:e=>{null==h||h(e),S(e)},disabled:g,className:(0,l.q)("w-full min-w-[10rem] relative text-tremor-default",x)},w),e=>{var t;let{value:n}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,l.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",v?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(n),g))},v&&o.createElement("span",{className:(0,l.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(v,{className:(0,l.q)(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},n&&null!==(t=E.get(n))&&void 0!==t?t:m),o.createElement("span",{className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,l.q)(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),y&&k?o.createElement("button",{type:"button",className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),S(""),null==h||h("")}},o.createElement(i.Z,{className:(0,l.q)(p("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,l.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},b)))})});h.displayName="Select"},57365:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(28517),i=n(97324);let l=(0,n(1153).fn)("SelectItem"),s=o.forwardRef((e,t)=>{let{value:n,icon:s,className:c,children:u}=e,d=(0,r._T)(e,["value","icon","className","children"]);return o.createElement(a.R.Option,Object.assign({className:(0,i.q)(l("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:n,value:n},d),s&&o.createElement(s,{className:(0,i.q)(l("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),o.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:n))});s.displayName="SelectItem"},92858:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var r=n(5853),o=n(2265),a=n(62963),i=n(90945),l=n(13323),s=n(17684),c=n(80004),u=n(93689),d=n(38198),f=n(47634),p=n(56314),h=n(27847),m=n(64518);let g=(0,o.createContext)(null),v=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-description-".concat(n),...a}=e,i=function e(){let t=(0,o.useContext)(g);if(null===t){let t=Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),l=(0,u.T)(t);(0,m.e)(()=>i.register(r),[r,i.register]);let c={ref:l,...i.props,id:r};return(0,h.sY)({ourProps:c,theirProps:a,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})}),{});var y=n(37388);let b=(0,o.createContext)(null),x=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-label-".concat(n),passive:a=!1,...i}=e,l=function e(){let t=(0,o.useContext)(b);if(null===t){let t=Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),c=(0,u.T)(t);(0,m.e)(()=>l.register(r),[r,l.register]);let d={ref:c,...l.props,id:r};return a&&("onClick"in d&&(delete d.htmlFor,delete d.onClick),"onClick"in i&&delete i.onClick),(0,h.sY)({ourProps:d,theirProps:i,slot:l.slot||{},defaultTag:"label",name:l.name||"Label"})}),{}),w=(0,o.createContext)(null);w.displayName="GroupContext";let k=o.Fragment,S=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-switch-".concat(n),checked:m,defaultChecked:g=!1,onChange:v,name:b,value:x,form:k,...S}=e,E=(0,o.useContext)(w),O=(0,o.useRef)(null),C=(0,u.T)(O,t,null===E?null:E.setSwitch),[j,_]=(0,a.q)(m,v,g),P=(0,l.z)(()=>null==_?void 0:_(!j)),N=(0,l.z)(e=>{if((0,f.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),P()}),T=(0,l.z)(e=>{e.key===y.R.Space?(e.preventDefault(),P()):e.key===y.R.Enter&&(0,p.g)(e.currentTarget)}),A=(0,l.z)(e=>e.preventDefault()),M=(0,o.useMemo)(()=>({checked:j}),[j]),I={id:r,ref:C,role:"switch",type:(0,c.f)(e,O),tabIndex:0,"aria-checked":j,"aria-labelledby":null==E?void 0:E.labelledby,"aria-describedby":null==E?void 0:E.describedby,onClick:N,onKeyUp:T,onKeyPress:A},R=(0,i.G)();return(0,o.useEffect)(()=>{var e;let t=null==(e=O.current)?void 0:e.closest("form");t&&void 0!==g&&R.addEventListener(t,"reset",()=>{_(g)})},[O,_]),o.createElement(o.Fragment,null,null!=b&&j&&o.createElement(d._,{features:d.A.Hidden,...(0,h.oA)({as:"input",type:"checkbox",hidden:!0,readOnly:!0,form:k,checked:j,name:b,value:x})}),(0,h.sY)({ourProps:I,theirProps:S,slot:M,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[n,r]=(0,o.useState)(null),[a,i]=function(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(b.Provider,{value:r},e.children)},[t])]}(),[s,c]=function(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(g.Provider,{value:r},e.children)},[t])]}(),u=(0,o.useMemo)(()=>({switch:n,setSwitch:r,labelledby:a,describedby:s}),[n,r,a,s]);return o.createElement(c,{name:"Switch.Description"},o.createElement(i,{name:"Switch.Label",props:{htmlFor:null==(t=u.switch)?void 0:t.id,onClick(e){n&&("LABEL"===e.currentTarget.tagName&&e.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},o.createElement(w.Provider,{value:u},(0,h.sY)({ourProps:{},theirProps:e,defaultTag:k,name:"Switch.Group"}))))},Label:x,Description:v});var E=n(44140),O=n(26898),C=n(97324),j=n(1153),_=n(1526);let P=(0,j.fn)("Switch"),N=o.forwardRef((e,t)=>{let{checked:n,defaultChecked:a=!1,onChange:i,color:l,name:s,error:c,errorMessage:u,disabled:d,required:f,tooltip:p,id:h}=e,m=(0,r._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:l?(0,j.bM)(l,O.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:l?(0,j.bM)(l,O.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,y]=(0,E.Z)(a,n),[b,x]=(0,o.useState)(!1),{tooltipProps:w,getReferenceProps:k}=(0,_.l)(300);return o.createElement("div",{className:"flex flex-row items-center justify-start"},o.createElement(_.Z,Object.assign({text:p},w)),o.createElement("div",Object.assign({ref:(0,j.lq)([t,w.refs.setReference]),className:(0,C.q)(P("root"),"flex flex-row relative h-5")},m,k),o.createElement("input",{type:"checkbox",className:(0,C.q)(P("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:s,required:f,checked:v,onChange:e=>{e.preventDefault()}}),o.createElement(S,{checked:v,onChange:e=>{y(e),null==i||i(e)},disabled:d,className:(0,C.q)(P("switch"),"w-10 h-5 group relative inline-flex flex-shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>x(!0),onBlur:()=>x(!1),id:h},o.createElement("span",{className:(0,C.q)(P("sr-only"),"sr-only")},"Switch ",v?"on":"off"),o.createElement("span",{"aria-hidden":"true",className:(0,C.q)(P("background"),v?g.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),o.createElement("span",{"aria-hidden":"true",className:(0,C.q)(P("round"),v?(0,C.q)(g.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",b?(0,C.q)("ring-2",g.ringColor):"")}))),c&&u?o.createElement("p",{className:(0,C.q)(P("errorMessage"),"text-sm text-red-500 mt-1 ")},u):null)});N.displayName="Switch"},12485:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(31492),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(35242),u=n(42698);n(64016),n(8710),n(33232);let d=(0,l.fn)("Tab"),f=s.forwardRef((e,t)=>{let{icon:n,className:f,children:p}=e,h=(0,r._T)(e,["icon","className","children"]),m=(0,s.useContext)(c.O),g=(0,s.useContext)(u.Z);return s.createElement(o.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",g?(0,l.bM)(g,a.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,l.bM)(t,a.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,l.bM)(t,a.K.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}(m,g),f)},h),n?s.createElement(n,{className:(0,i.q)(d("icon"),"flex-none h-5 w-5",p?"mr-2":"")}):null,p?s.createElement("span",null,p):null)});f.displayName="Tab"},18135:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(31492),a=n(97324),i=n(1153),l=n(2265);let s=(0,i.fn)("TabGroup"),c=l.forwardRef((e,t)=>{let{defaultIndex:n,index:i,onIndexChange:c,children:u,className:d}=e,f=(0,r._T)(e,["defaultIndex","index","onIndexChange","children","className"]);return l.createElement(o.O.Group,Object.assign({as:"div",ref:t,defaultIndex:n,selectedIndex:i,onChange:c,className:(0,a.q)(s("root"),"w-full",d)},f),u)});c.displayName="TabGroup"},35242:function(e,t,n){"use strict";n.d(t,{O:function(){return c},Z:function(){return d}});var r=n(5853),o=n(2265),a=n(42698);n(64016),n(8710),n(33232);var i=n(31492),l=n(97324);let s=(0,n(1153).fn)("TabList"),c=(0,o.createContext)("line"),u={line:(0,l.q)("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:(0,l.q)("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},d=o.forwardRef((e,t)=>{let{color:n,variant:d="line",children:f,className:p}=e,h=(0,r._T)(e,["color","variant","children","className"]);return o.createElement(i.O.List,Object.assign({ref:t,className:(0,l.q)(s("root"),"justify-start overflow-x-clip",u[d],p)},h),o.createElement(c.Provider,{value:d},o.createElement(a.Z.Provider,{value:n},f)))});d.displayName="TabList"},29706:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698);var o=n(64016);n(8710);var a=n(33232),i=n(97324),l=n(1153),s=n(2265);let c=(0,l.fn)("TabPanel"),u=s.forwardRef((e,t)=>{let{children:n,className:l}=e,u=(0,r._T)(e,["children","className"]),{selectedValue:d}=(0,s.useContext)(a.Z),f=d===(0,s.useContext)(o.Z);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)(c("root"),"w-full mt-2",f?"":"hidden",l),"aria-selected":f?"true":"false"},u),n)});u.displayName="TabPanel"},77991:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(31492);n(42698);var a=n(64016);n(8710);var i=n(33232),l=n(97324),s=n(1153),c=n(2265);let u=(0,s.fn)("TabPanels"),d=c.forwardRef((e,t)=>{let{children:n,className:s}=e,d=(0,r._T)(e,["children","className"]);return c.createElement(o.O.Panels,Object.assign({as:"div",ref:t,className:(0,l.q)(u("root"),"w-full",s)},d),e=>{let{selectedIndex:t}=e;return c.createElement(i.Z.Provider,{value:{selectedValue:t}},c.Children.map(n,(e,t)=>c.createElement(a.Z.Provider,{value:t},e)))})});d.displayName="TabPanels"},49566:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265);n(97324);var a=n(1153),i=n(69262);let l=(0,a.fn)("TextInput"),s=o.forwardRef((e,t)=>{let{type:n="text"}=e,a=(0,r._T)(e,["type"]);return o.createElement(i.Z,Object.assign({ref:t,type:n,makeInputClassName:l},a))});s.displayName="TextInput"},16853:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(96398),a=n(44140),i=n(2265),l=n(97324),s=n(1153);let c=(0,s.fn)("Textarea"),u=i.forwardRef((e,t)=>{let{value:n,defaultValue:u="",placeholder:d="Type...",error:f=!1,errorMessage:p,disabled:h=!1,className:m,onChange:g,onValueChange:v}=e,y=(0,r._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[b,x]=(0,a.Z)(u,n),w=(0,i.useRef)(null),k=(0,o.Uh)(b);return i.createElement(i.Fragment,null,i.createElement("textarea",Object.assign({ref:(0,s.lq)([w,t]),value:b,placeholder:d,disabled:h,className:(0,l.q)(c("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,o.um)(k,h,f),h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",m),"data-testid":"text-area",onChange:e=>{null==g||g(e),x(e.target.value),null==v||v(e.target.value)}},y)),f&&p?i.createElement("p",{className:(0,l.q)(c("errorMessage"),"text-sm text-red-500 mt-1")},p):null)});u.displayName="Textarea"},96398:function(e,t,n){"use strict";n.d(t,{Uh:function(){return c},n0:function(){return l},qg:function(){return a},sl:function(){return i},um:function(){return s}});var r=n(97324),o=n(2265);let a=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(a).join(""):"object"==typeof e&&e?a(e.props.children):void 0;function i(e){let t=new Map;return o.Children.map(e,e=>{var n;t.set(e.props.value,null!==(n=a(e))&&void 0!==n?n:e.props.value)}),t}function l(e,t){return o.Children.map(t,t=>{var n;if((null!==(n=a(t))&&void 0!==n?n:t.props.value).toLowerCase().includes(e.toLowerCase()))return t})}let s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.q)(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",n&&"text-red-500",n?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function c(e){return null!=e&&""!==e}},87452:function(e,t,n){"use strict";n.d(t,{Z:function(){return d},r:function(){return u}});var r=n(5853),o=n(21886);n(42698),n(64016);var a=n(8710);n(33232);var i=n(97324),l=n(1153),s=n(2265);let c=(0,l.fn)("Accordion"),u=(0,s.createContext)({isOpen:!1}),d=s.forwardRef((e,t)=>{var n;let{defaultOpen:l=!1,children:d,className:f}=e,p=(0,r._T)(e,["defaultOpen","children","className"]),h=null!==(n=(0,s.useContext)(a.Z))&&void 0!==n?n:(0,i.q)("rounded-tremor-default border");return s.createElement(o.p,Object.assign({as:"div",ref:t,className:(0,i.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",h,f),defaultOpen:l},p),e=>{let{open:t}=e;return s.createElement(u.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(21886),i=n(97324);let l=(0,n(1153).fn)("AccordionBody"),s=o.forwardRef((e,t)=>{let{children:n,className:s}=e,c=(0,r._T)(e,["children","className"]);return o.createElement(a.p.Panel,Object.assign({ref:t,className:(0,i.q)(l("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",s)},c),n)});s.displayName="AccordionBody"},72208:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(2265),a=n(21886);let i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var l=n(87452),s=n(97324);let c=(0,n(1153).fn)("AccordionHeader"),u=o.forwardRef((e,t)=>{let{children:n,className:u}=e,d=(0,r._T)(e,["children","className"]),{isOpen:f}=(0,o.useContext)(l.r);return o.createElement(a.p.Button,Object.assign({ref:t,className:(0,s.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),o.createElement("div",{className:(0,s.q)(c("children"),"flex flex-1 text-inherit mr-4")},n),o.createElement("div",null,o.createElement(i,{className:(0,s.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",f?"transition-all":"transition-all -rotate-180")})))});u.displayName="AccordionHeader"},67982:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265);let l=(0,a.fn)("Divider"),s=i.forwardRef((e,t)=>{let{className:n,children:a}=e,s=(0,r._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(l("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",n)},s),a?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,o.q)("text-inherit whitespace-nowrap")},a),i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});s.displayName="Divider"},49804:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265),l=n(9496);let s=(0,a.fn)("Col"),c=i.forwardRef((e,t)=>{let{numColSpan:n=1,numColSpanSm:a,numColSpanMd:c,numColSpanLg:u,children:d,className:f}=e,p=(0,r._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),h=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),(()=>{let e=h(n,l.PT),t=h(a,l.SP),r=h(c,l.VS),i=h(u,l._w);return(0,o.q)(e,t,r,i)})(),f)},p),d)});c.displayName="Col"},67101:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265),l=n(9496);let s=(0,a.fn)("Grid"),c=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",u=i.forwardRef((e,t)=>{let{numItems:n=1,numItemsSm:a,numItemsMd:u,numItemsLg:d,children:f,className:p}=e,h=(0,r._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),m=c(n,l._m),g=c(a,l.LH),v=c(u,l.l5),y=c(d,l.N4),b=(0,o.q)(m,g,v,y);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),"grid",b,p)},h),f)});u.displayName="Grid"},9496:function(e,t,n){"use strict";n.d(t,{LH:function(){return o},N4:function(){return i},PT:function(){return l},SP:function(){return s},VS:function(){return c},_m:function(){return r},_w:function(){return u},l5:function(){return a}});let r={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},o={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},a={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},i={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},l={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},s={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},c={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},u={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},94789:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(2265),a=n(26898),i=n(97324),l=n(1153);let s=(0,l.fn)("Callout"),c=o.forwardRef((e,t)=>{let{title:n,icon:c,color:u,className:d,children:f}=e,p=(0,r._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",u?(0,i.q)((0,l.bM)(u,a.K.background).bgColor,(0,l.bM)(u,a.K.darkBorder).borderColor,(0,l.bM)(u,a.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,i.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),d)},p),o.createElement("div",{className:(0,i.q)(s("header"),"flex items-start")},c?o.createElement(c,{className:(0,i.q)(s("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,i.q)(s("title"),"font-semibold")},n)),o.createElement("p",{className:(0,i.q)(s("body"),"overflow-y-auto",f?"mt-2":"")},f))});c.displayName="Callout"},35829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(26898),a=n(97324),i=n(1153),l=n(2265);let s=l.forwardRef((e,t)=>{let{color:n,children:s,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)("font-semibold text-tremor-metric",n?(0,i.bM)(n,o.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},u),s)});s.displayName="Metric"},97765:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(26898),a=n(97324),i=n(1153),l=n(2265);let s=l.forwardRef((e,t)=>{let{color:n,children:s,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)(n?(0,i.bM)(n,o.K.lightText).textColor:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c)},u),s)});s.displayName="Subtitle"},96889:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(2265),a=n(26898),i=n(97324),l=n(1153);let s=(0,l.fn)("BarList"),c=o.forwardRef((e,t)=>{var n;let c;let{data:u=[],color:d,valueFormatter:f=l.Cj,showAnimation:p=!1,className:h}=e,m=(0,r._T)(e,["data","color","valueFormatter","showAnimation","className"]),g=(n=u.map(e=>e.value),c=-1/0,n.forEach(e=>{c=Math.max(c,e)}),n.map(e=>0===e?0:Math.max(e/c*100,1)));return o.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex justify-between space-x-6",h)},m),o.createElement("div",{className:(0,i.q)(s("bars"),"relative w-full")},u.map((e,t)=>{var n,r,c;let f=e.icon;return o.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:(0,i.q)(s("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||d?(0,l.bM)(null!==(r=e.color)&&void 0!==r?r:d,a.K.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===u.length-1?"mb-0":"mb-2"),style:{width:"".concat(g[t],"%"),transition:p?"all 1s":""}},o.createElement("div",{className:(0,i.q)("absolute max-w-full flex left-2")},f?o.createElement(f,{className:(0,i.q)(s("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?o.createElement("a",{href:e.href,target:null!==(c=e.target)&&void 0!==c?c:"_blank",rel:"noreferrer",className:(0,i.q)(s("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name):o.createElement("p",{className:(0,i.q)(s("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name)))})),o.createElement("div",{className:"text-right min-w-min"},u.map((e,t)=>{var n;return o.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:(0,i.q)(s("labelWrapper"),"flex justify-end items-center","h-9",t===u.length-1?"mb-0":"mb-2")},o.createElement("p",{className:(0,i.q)(s("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},f(e.value)))})))});c.displayName="BarList"},42698:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2265),o=n(7084);n(97324);let a=(0,r.createContext)(o.fr.Blue)},64016:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)(0)},8710:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)(void 0)},33232:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)({selectedValue:void 0,handleValueChange:void 0})},44140:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);let o=(e,t)=>{let n=void 0!==t,[o,a]=(0,r.useState)(e);return[n?t:o,e=>{n||a(e)}]}},61778:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}});var r=n(2265),o=n(8900),a=n(39725),i=n(49638),l=n(54537),s=n(55726),c=n(36760),u=n.n(c),d=n(47970),f=n(18242),p=n(19722),h=n(71744),m=n(352),g=n(12918),v=n(80669);let y=(e,t,n,r,o)=>({background:e,border:"".concat((0,m.bf)(r.lineWidth)," ").concat(r.lineType," ").concat(t),["".concat(o,"-icon")]:{color:n}}),b=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:o,fontSize:a,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:u,colorText:d,colorTextHeading:f,withDescriptionPadding:p,defaultPadding:h}=e;return{[t]:Object.assign(Object.assign({},(0,g.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:s,["&".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-content")]:{flex:1,minWidth:0},["".concat(t,"-icon")]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-message":{color:f},["&".concat(t,"-motion-leave")]:{overflow:"hidden",opacity:1,transition:"max-height ".concat(n," ").concat(c,", opacity ").concat(n," ").concat(c,",\n padding-top ").concat(n," ").concat(c,", padding-bottom ").concat(n," ").concat(c,",\n margin-bottom ").concat(n," ").concat(c)},["&".concat(t,"-motion-leave-active")]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),["".concat(t,"-with-description")]:{alignItems:"flex-start",padding:p,["".concat(t,"-icon")]:{marginInlineEnd:o,fontSize:u,lineHeight:0},["".concat(t,"-message")]:{display:"block",marginBottom:r,color:f,fontSize:i},["".concat(t,"-description")]:{display:"block",color:d}},["".concat(t,"-banner")]:{marginBottom:0,border:"0 !important",borderRadius:0}}},x=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:o,colorWarning:a,colorWarningBorder:i,colorWarningBg:l,colorError:s,colorErrorBorder:c,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":y(o,r,n,e,t),"&-info":y(p,f,d,e,t),"&-warning":y(l,i,a,e,t),"&-error":Object.assign(Object.assign({},y(u,c,s,e,t)),{["".concat(t,"-description > pre")]:{margin:0,padding:0}})}}},w=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:o,fontSizeIcon:a,colorIcon:i,colorIconHover:l}=e;return{[t]:{"&-action":{marginInlineStart:o},["".concat(t,"-close-icon")]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,m.bf)(a),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",["".concat(n,"-close")]:{color:i,transition:"color ".concat(r),"&:hover":{color:l}}},"&-close-text":{color:i,transition:"color ".concat(r),"&:hover":{color:l}}}}};var k=(0,v.I$)("Alert",e=>[b(e),x(e),w(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:"".concat(e.paddingContentVerticalSM,"px ").concat(12,"px"),withDescriptionPadding:"".concat(e.paddingMD,"px ").concat(e.paddingContentHorizontalLG,"px")})),S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let E={success:o.Z,info:s.Z,error:a.Z,warning:l.Z},O=e=>{let{icon:t,prefixCls:n,type:o}=e,a=E[o]||null;return t?(0,p.wm)(t,r.createElement("span",{className:"".concat(n,"-icon")},t),()=>({className:u()("".concat(n,"-icon"),{[t.props.className]:t.props.className})})):r.createElement(a,{className:"".concat(n,"-icon")})},C=e=>{let{isClosable:t,prefixCls:n,closeIcon:o,handleClose:a}=e,l=!0===o||void 0===o?r.createElement(i.Z,null):o;return t?r.createElement("button",{type:"button",onClick:a,className:"".concat(n,"-close-icon"),tabIndex:0},l):null};var j=e=>{let{description:t,prefixCls:n,message:o,banner:a,className:i,rootClassName:l,style:s,onMouseEnter:c,onMouseLeave:p,onClick:m,afterClose:g,showIcon:v,closable:y,closeText:b,closeIcon:x,action:w}=e,E=S(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action"]),[j,_]=r.useState(!1),P=r.useRef(null),{getPrefixCls:N,direction:T,alert:A}=r.useContext(h.E_),M=N("alert",n),[I,R,D]=k(M),L=t=>{var n;_(!0),null===(n=e.onClose)||void 0===n||n.call(e,t)},Z=r.useMemo(()=>void 0!==e.type?e.type:a?"warning":"info",[e.type,a]),z=r.useMemo(()=>!!b||("boolean"==typeof y?y:!1!==x&&null!=x),[b,x,y]),B=!!a&&void 0===v||v,F=u()(M,"".concat(M,"-").concat(Z),{["".concat(M,"-with-description")]:!!t,["".concat(M,"-no-icon")]:!B,["".concat(M,"-banner")]:!!a,["".concat(M,"-rtl")]:"rtl"===T},null==A?void 0:A.className,i,l,D,R),H=(0,f.Z)(E,{aria:!0,data:!0});return I(r.createElement(d.ZP,{visible:!j,motionName:"".concat(M,"-motion"),motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:g},n=>{let{className:a,style:i}=n;return r.createElement("div",Object.assign({ref:P,"data-show":!j,className:u()(F,a),style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.style),s),i),onMouseEnter:c,onMouseLeave:p,onClick:m,role:"alert"},H),B?r.createElement(O,{description:t,icon:e.icon,prefixCls:M,type:Z}):null,r.createElement("div",{className:"".concat(M,"-content")},o?r.createElement("div",{className:"".concat(M,"-message")},o):null,t?r.createElement("div",{className:"".concat(M,"-description")},t):null),w?r.createElement("div",{className:"".concat(M,"-action")},w):null,r.createElement(C,{isClosable:z,prefixCls:M,closeIcon:b||x,handleClose:L}))}))},_=n(76405),P=n(25049),N=n(37977),T=n(63929),A=n(24995),M=n(15354);let I=function(e){function t(){var e,n,r;return(0,_.Z)(this,t),n=t,r=arguments,n=(0,A.Z)(n),(e=(0,N.Z)(this,(0,T.Z)()?Reflect.construct(n,r||[],(0,A.Z)(this).constructor):n.apply(this,r))).state={error:void 0,info:{componentStack:""}},e}return(0,M.Z)(t,e),(0,P.Z)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:t,children:n}=this.props,{error:o,info:a}=this.state,i=a&&a.componentStack?a.componentStack:null,l=void 0===e?(o||"").toString():e;return o?r.createElement(j,{type:"error",message:l,description:r.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===t?i:t)}):n}}]),t}(r.Component);j.ErrorBoundary=I;var R=j},33866:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var r=n(2265),o=n(36760),a=n.n(o),i=n(47970),l=n(93350),s=n(19722),c=n(71744),u=n(352),d=n(12918),f=n(18536),p=n(3104),h=n(80669);let m=new u.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=new u.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),v=new u.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),y=new u.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),b=new u.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),x=new u.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),w=e=>{let{componentCls:t,iconCls:n,antCls:r,badgeShadowSize:o,motionDurationSlow:a,textFontSize:i,textFontSizeSM:l,statusSize:s,dotSize:c,textFontWeight:p,indicatorHeight:h,indicatorHeightSM:w,marginXS:k,calc:S}=e,E="".concat(r,"-scroll-number"),O=(0,f.Z)(e,(e,n)=>{let{darkColor:r}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:r,["&:not(".concat(t,"-count)")]:{color:r}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{zIndex:e.indicatorZIndex,minWidth:h,height:h,color:e.badgeTextColor,fontWeight:p,fontSize:i,lineHeight:(0,u.bf)(h),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:S(h).div(2).equal(),boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor),transition:"background ".concat(e.motionDurationMid),a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},["".concat(t,"-count-sm")]:{minWidth:w,height:w,fontSize:l,lineHeight:(0,u.bf)(w),borderRadius:S(w).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,u.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:c,minWidth:c,height:c,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor)},["".concat(t,"-dot").concat(E)]:{transition:"background ".concat(a)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(E,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(t,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(t,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},["".concat(t,"-status-success")]:{backgroundColor:e.colorSuccess},["".concat(t,"-status-processing")]:{overflow:"visible",color:e.colorPrimary,backgroundColor:e.colorPrimary,"&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:m,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(t,"-status-default")]:{backgroundColor:e.colorTextPlaceholder},["".concat(t,"-status-error")]:{backgroundColor:e.colorError},["".concat(t,"-status-warning")]:{backgroundColor:e.colorWarning},["".concat(t,"-status-text")]:{marginInlineStart:k,color:e.colorText,fontSize:e.fontSize}}}),O),{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:g,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["".concat(t,"-zoom-leave")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:b,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(E,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(E,"-custom-component, ").concat(E)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},["".concat(E)]:{overflow:"hidden",["".concat(E,"-only")]:{position:"relative",display:"inline-block",height:h,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(E,"-only-unit")]:{height:h,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(E,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(E,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},k=e=>{let{fontHeight:t,lineWidth:n,marginXS:r,colorBorderBg:o}=e,a=e.colorBgContainer,i=e.colorError,l=e.colorErrorHover;return(0,p.TS)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:a,badgeColor:i,badgeColorHover:l,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:r,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},S=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:r,lineWidth:o}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*o,indicatorHeightSM:t,dotSize:r/2,textFontSize:r,textFontSizeSM:r,textFontWeight:"normal",statusSize:r/2}};var E=(0,h.I$)("Badge",e=>w(k(e)),S);let O=e=>{let{antCls:t,badgeFontHeight:n,marginXS:r,badgeRibbonOffset:o,calc:a}=e,i="".concat(t,"-ribbon"),l=(0,f.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(i,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat("".concat(t,"-ribbon-wrapper"))]:{position:"relative"},["".concat(i)]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:r,padding:"0 ".concat((0,u.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,u.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(i,"-text")]:{color:e.colorTextLightSolid},["".concat(i,"-corner")]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:"".concat((0,u.bf)(a(o).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),l),{["&".concat(i,"-placement-end")]:{insetInlineEnd:a(o).mul(-1).equal(),borderEndEndRadius:0,["".concat(i,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(i,"-placement-start")]:{insetInlineStart:a(o).mul(-1).equal(),borderEndStartRadius:0,["".concat(i,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var C=(0,h.I$)(["Badge","Ribbon"],e=>O(k(e)),S);function j(e){let t,{prefixCls:n,value:o,current:i,offset:l=0}=e;return l&&(t={position:"absolute",top:"".concat(l,"00%"),left:0}),r.createElement("span",{style:t,className:a()("".concat(n,"-only-unit"),{current:i})},o)}function _(e){let t,n;let{prefixCls:o,count:a,value:i}=e,l=Number(i),s=Math.abs(a),[c,u]=r.useState(l),[d,f]=r.useState(s),p=()=>{u(l),f(s)};if(r.useEffect(()=>{let e=setTimeout(()=>{p()},1e3);return()=>{clearTimeout(e)}},[l]),c===l||Number.isNaN(l)||Number.isNaN(c))t=[r.createElement(j,Object.assign({},e,{key:l,current:!0}))],n={transition:"none"};else{t=[];let o=l+10,a=[];for(let e=l;e<=o;e+=1)a.push(e);let i=a.findIndex(e=>e%10===c);t=a.map((t,n)=>r.createElement(j,Object.assign({},e,{key:t,value:t%10,offset:n-i,current:n===i}))),n={transform:"translateY(".concat(-function(e,t,n){let r=e,o=0;for(;(r+10)%10!==t;)r+=n,o+=n;return o}(c,l,d<s?1:-1),"00%)")}}return r.createElement("span",{className:"".concat(o,"-only"),style:n,onTransitionEnd:p},t)}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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=r.forwardRef((e,t)=>{let{prefixCls:n,count:o,className:i,motionClassName:l,style:u,title:d,show:f,component:p="sup",children:h}=e,m=P(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:g}=r.useContext(c.E_),v=g("scroll-number",n),y=Object.assign(Object.assign({},m),{"data-show":f,style:u,className:a()(v,i,l),title:d}),b=o;if(o&&Number(o)%1==0){let e=String(o).split("");b=r.createElement("bdi",null,e.map((t,n)=>r.createElement(_,{prefixCls:v,count:Number(o),value:t,key:e.length-n})))}return(u&&u.borderColor&&(y.style=Object.assign(Object.assign({},u),{boxShadow:"0 0 0 1px ".concat(u.borderColor," inset")})),h)?(0,s.Tm)(h,e=>({className:a()("".concat(v,"-custom-component"),null==e?void 0:e.className,l)})):r.createElement(p,Object.assign({},y,{ref:t}),b)});var T=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let A=r.forwardRef((e,t)=>{var n,o,u,d,f;let{prefixCls:p,scrollNumberPrefixCls:h,children:m,status:g,text:v,color:y,count:b=null,overflowCount:x=99,dot:w=!1,size:k="default",title:S,offset:O,style:C,className:j,rootClassName:_,classNames:P,styles:A,showZero:M=!1}=e,I=T(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:R,direction:D,badge:L}=r.useContext(c.E_),Z=R("badge",p),[z,B,F]=E(Z),H=b>x?"".concat(x,"+"):b,q="0"===H||0===H,W=(null!=g||null!=y)&&(null===b||q&&!M),U=w&&!q,K=U?"":H,$=(0,r.useMemo)(()=>(null==K||""===K||q&&!M)&&!U,[K,q,M,U]),V=(0,r.useRef)(b);$||(V.current=b);let X=V.current,G=(0,r.useRef)(K);$||(G.current=K);let Y=G.current,Q=(0,r.useRef)(U);$||(Q.current=U);let J=(0,r.useMemo)(()=>{if(!O)return Object.assign(Object.assign({},null==L?void 0:L.style),C);let e={marginTop:O[1]};return"rtl"===D?e.left=parseInt(O[0],10):e.right=-parseInt(O[0],10),Object.assign(Object.assign(Object.assign({},e),null==L?void 0:L.style),C)},[D,O,C,null==L?void 0:L.style]),ee=null!=S?S:"string"==typeof X||"number"==typeof X?X:void 0,et=$||!v?null:r.createElement("span",{className:"".concat(Z,"-status-text")},v),en=X&&"object"==typeof X?(0,s.Tm)(X,e=>({style:Object.assign(Object.assign({},J),e.style)})):void 0,er=(0,l.o2)(y,!1),eo=a()(null==P?void 0:P.indicator,null===(n=null==L?void 0:L.classNames)||void 0===n?void 0:n.indicator,{["".concat(Z,"-status-dot")]:W,["".concat(Z,"-status-").concat(g)]:!!g,["".concat(Z,"-color-").concat(y)]:er}),ea={};y&&!er&&(ea.color=y,ea.background=y);let ei=a()(Z,{["".concat(Z,"-status")]:W,["".concat(Z,"-not-a-wrapper")]:!m,["".concat(Z,"-rtl")]:"rtl"===D},j,_,null==L?void 0:L.className,null===(o=null==L?void 0:L.classNames)||void 0===o?void 0:o.root,null==P?void 0:P.root,B,F);if(!m&&W){let e=J.color;return z(r.createElement("span",Object.assign({},I,{className:ei,style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.root),null===(u=null==L?void 0:L.styles)||void 0===u?void 0:u.root),J)}),r.createElement("span",{className:eo,style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.indicator),null===(d=null==L?void 0:L.styles)||void 0===d?void 0:d.indicator),ea)}),v&&r.createElement("span",{style:{color:e},className:"".concat(Z,"-status-text")},v)))}return z(r.createElement("span",Object.assign({ref:t},I,{className:ei,style:Object.assign(Object.assign({},null===(f=null==L?void 0:L.styles)||void 0===f?void 0:f.root),null==A?void 0:A.root)}),m,r.createElement(i.ZP,{visible:!$,motionName:"".concat(Z,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:o,ref:i}=e,l=R("scroll-number",h),s=Q.current,c=a()(null==P?void 0:P.indicator,null===(t=null==L?void 0:L.classNames)||void 0===t?void 0:t.indicator,{["".concat(Z,"-dot")]:s,["".concat(Z,"-count")]:!s,["".concat(Z,"-count-sm")]:"small"===k,["".concat(Z,"-multiple-words")]:!s&&Y&&Y.toString().length>1,["".concat(Z,"-status-").concat(g)]:!!g,["".concat(Z,"-color-").concat(y)]:er}),u=Object.assign(Object.assign(Object.assign({},null==A?void 0:A.indicator),null===(n=null==L?void 0:L.styles)||void 0===n?void 0:n.indicator),J);return y&&!er&&((u=u||{}).background=y),r.createElement(N,{prefixCls:l,show:!$,motionClassName:o,className:c,count:Y,title:ee,style:u,key:"scrollNumber",ref:i},en)}),et))});A.Ribbon=e=>{let{className:t,prefixCls:n,style:o,color:i,children:s,text:u,placement:d="end",rootClassName:f}=e,{getPrefixCls:p,direction:h}=r.useContext(c.E_),m=p("ribbon",n),g="".concat(m,"-wrapper"),[v,y,b]=C(m,g),x=(0,l.o2)(i,!1),w=a()(m,"".concat(m,"-placement-").concat(d),{["".concat(m,"-rtl")]:"rtl"===h,["".concat(m,"-color-").concat(i)]:x},t),k={},S={};return i&&!x&&(k.background=i,S.color=i),v(r.createElement("div",{className:a()(g,f,y,b)},s,r.createElement("div",{className:a()(w,y),style:Object.assign(Object.assign({},k),o)},r.createElement("span",{className:"".concat(m,"-text")},u),r.createElement("div",{className:"".concat(m,"-corner"),style:S}))))};var M=A},67960:function(e,t,n){"use strict";n.d(t,{Z:function(){return e8}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),l=n(71744),s=n(33759),c=e=>{let{prefixCls:t,className:n,style:o,size:i,shape:l}=e,s=a()({["".concat(t,"-lg")]:"large"===i,["".concat(t,"-sm")]:"small"===i}),c=a()({["".concat(t,"-circle")]:"circle"===l,["".concat(t,"-square")]:"square"===l,["".concat(t,"-round")]:"round"===l}),u=r.useMemo(()=>"number"==typeof i?{width:i,height:i,lineHeight:"".concat(i,"px")}:{},[i]);return r.createElement("span",{className:a()(t,s,c,n),style:Object.assign(Object.assign({},u),o)})},u=n(352),d=n(80669),f=n(3104);let p=new u.E4("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),h=e=>({height:e,lineHeight:(0,u.bf)(e)}),m=e=>Object.assign({width:e},h(e)),g=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:p,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),v=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},h(e)),y=e=>{let{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:o,controlHeightSM:a}=e;return{["".concat(t)]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},m(r)),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"},["".concat(t).concat(t,"-lg")]:Object.assign({},m(o)),["".concat(t).concat(t,"-sm")]:Object.assign({},m(a))}},b=e=>{let{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:o,controlHeightSM:a,gradientFromColor:i,calc:l}=e;return{["".concat(r)]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:n},v(t,l)),["".concat(r,"-lg")]:Object.assign({},v(o,l)),["".concat(r,"-sm")]:Object.assign({},v(a,l))}},x=e=>Object.assign({width:e},h(e)),w=e=>{let{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:o,calc:a}=e;return{["".concat(t)]:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:r,borderRadius:o},x(a(n).mul(2).equal())),{["".concat(t,"-path")]:{fill:"#bfbfbf"},["".concat(t,"-svg")]:Object.assign(Object.assign({},x(n)),{maxWidth:a(n).mul(4).equal(),maxHeight:a(n).mul(4).equal()}),["".concat(t,"-svg").concat(t,"-svg-circle")]:{borderRadius:"50%"}}),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"}}},k=(e,t,n)=>{let{skeletonButtonCls:r}=e;return{["".concat(n).concat(r,"-circle")]:{width:t,minWidth:t,borderRadius:"50%"},["".concat(n).concat(r,"-round")]:{borderRadius:t}}},S=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},h(e)),E=e=>{let{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:o,controlHeightSM:a,gradientFromColor:i,calc:l}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:l(r).mul(2).equal(),minWidth:l(r).mul(2).equal()},S(r,l))},k(e,r,n)),{["".concat(n,"-lg")]:Object.assign({},S(o,l))}),k(e,o,"".concat(n,"-lg"))),{["".concat(n,"-sm")]:Object.assign({},S(a,l))}),k(e,a,"".concat(n,"-sm")))},O=e=>{let{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:o,skeletonButtonCls:a,skeletonInputCls:i,skeletonImageCls:l,controlHeight:s,controlHeightLG:c,controlHeightSM:u,gradientFromColor:d,padding:f,marginSM:p,borderRadius:h,titleHeight:v,blockRadius:x,paragraphLiHeight:k,controlHeightXS:S,paragraphMarginTop:O}=e;return{["".concat(t)]:{display:"table",width:"100%",["".concat(t,"-header")]:{display:"table-cell",paddingInlineEnd:f,verticalAlign:"top",["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:d},m(s)),["".concat(n,"-circle")]:{borderRadius:"50%"},["".concat(n,"-lg")]:Object.assign({},m(c)),["".concat(n,"-sm")]:Object.assign({},m(u))},["".concat(t,"-content")]:{display:"table-cell",width:"100%",verticalAlign:"top",["".concat(r)]:{width:"100%",height:v,background:d,borderRadius:x,["+ ".concat(o)]:{marginBlockStart:u}},["".concat(o)]:{padding:0,"> li":{width:"100%",height:k,listStyle:"none",background:d,borderRadius:x,"+ li":{marginBlockStart:S}}},["".concat(o,"> li:last-child:not(:first-child):not(:nth-child(2))")]:{width:"61%"}},["&-round ".concat(t,"-content")]:{["".concat(r,", ").concat(o," > li")]:{borderRadius:h}}},["".concat(t,"-with-avatar ").concat(t,"-content")]:{["".concat(r)]:{marginBlockStart:p,["+ ".concat(o)]:{marginBlockStart:O}}},["".concat(t).concat(t,"-element")]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},E(e)),y(e)),b(e)),w(e)),["".concat(t).concat(t,"-block")]:{width:"100%",["".concat(a)]:{width:"100%"},["".concat(i)]:{width:"100%"}},["".concat(t).concat(t,"-active")]:{["\n ".concat(r,",\n ").concat(o," > li,\n ").concat(n,",\n ").concat(a,",\n ").concat(i,",\n ").concat(l,"\n ")]:Object.assign({},g(e))}}};var C=(0,d.I$)("Skeleton",e=>{let{componentCls:t,calc:n}=e;return[O((0,f.TS)(e,{skeletonAvatarCls:"".concat(t,"-avatar"),skeletonTitleCls:"".concat(t,"-title"),skeletonParagraphCls:"".concat(t,"-paragraph"),skeletonButtonCls:"".concat(t,"-button"),skeletonInputCls:"".concat(t,"-input"),skeletonImageCls:"".concat(t,"-image"),imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:"linear-gradient(90deg, ".concat(e.gradientFromColor," 25%, ").concat(e.gradientToColor," 37%, ").concat(e.gradientFromColor," 63%)"),skeletonLoadingMotionDuration:"1.4s"}))]},e=>{let{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n,gradientFromColor:t,gradientToColor:n,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),j=n(1119),_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},P=n(55015),N=r.forwardRef(function(e,t){return r.createElement(P.Z,(0,j.Z)({},e,{ref:t,icon:_}))}),T=n(83145),A=e=>{let t=t=>{let{width:n,rows:r=2}=e;return Array.isArray(n)?n[t]:r-1===t?n:void 0},{prefixCls:n,className:o,style:i,rows:l}=e,s=(0,T.Z)(Array(l)).map((e,n)=>r.createElement("li",{key:n,style:{width:t(n)}}));return r.createElement("ul",{className:a()(n,o),style:i},s)},M=e=>{let{prefixCls:t,className:n,width:o,style:i}=e;return r.createElement("h3",{className:a()(t,n),style:Object.assign({width:o},i)})};function I(e){return e&&"object"==typeof e?e:{}}let R=e=>{let{prefixCls:t,loading:n,className:o,rootClassName:i,style:s,children:u,avatar:d=!1,title:f=!0,paragraph:p=!0,active:h,round:m}=e,{getPrefixCls:g,direction:v,skeleton:y}=r.useContext(l.E_),b=g("skeleton",t),[x,w,k]=C(b);if(n||!("loading"in e)){let e,t;let n=!!d,l=!!f,u=!!p;if(n){let t=Object.assign(Object.assign({prefixCls:"".concat(b,"-avatar")},l&&!u?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),I(d));e=r.createElement("div",{className:"".concat(b,"-header")},r.createElement(c,Object.assign({},t)))}if(l||u){let e,o;if(l){let t=Object.assign(Object.assign({prefixCls:"".concat(b,"-title")},!n&&u?{width:"38%"}:n&&u?{width:"50%"}:{}),I(f));e=r.createElement(M,Object.assign({},t))}if(u){let e=Object.assign(Object.assign({prefixCls:"".concat(b,"-paragraph")},function(e,t){let n={};return e&&t||(n.width="61%"),!e&&t?n.rows=3:n.rows=2,n}(n,l)),I(p));o=r.createElement(A,Object.assign({},e))}t=r.createElement("div",{className:"".concat(b,"-content")},e,o)}let g=a()(b,{["".concat(b,"-with-avatar")]:n,["".concat(b,"-active")]:h,["".concat(b,"-rtl")]:"rtl"===v,["".concat(b,"-round")]:m},null==y?void 0:y.className,o,i,w,k);return x(r.createElement("div",{className:g,style:Object.assign(Object.assign({},null==y?void 0:y.style),s)},e,t))}return void 0!==u?u:null};R.Button=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,block:u=!1,size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s,["".concat(p,"-block")]:u},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-button"),size:d},v))))},R.Avatar=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,shape:u="circle",size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls","className"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-avatar"),shape:u,size:d},v))))},R.Input=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,block:u,size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s,["".concat(p,"-block")]:u},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-input"),size:d},v))))},R.Image=e=>{let{prefixCls:t,className:n,rootClassName:o,style:i,active:s}=e,{getPrefixCls:c}=r.useContext(l.E_),u=c("skeleton",t),[d,f,p]=C(u),h=a()(u,"".concat(u,"-element"),{["".concat(u,"-active")]:s},n,o,f,p);return d(r.createElement("div",{className:h},r.createElement("div",{className:a()("".concat(u,"-image"),n),style:i},r.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(u,"-image-svg")},r.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(u,"-image-path")})))))},R.Node=e=>{let{prefixCls:t,className:n,rootClassName:o,style:i,active:s,children:c}=e,{getPrefixCls:u}=r.useContext(l.E_),d=u("skeleton",t),[f,p,h]=C(d),m=a()(d,"".concat(d,"-element"),{["".concat(d,"-active")]:s},p,n,o,h),g=null!=c?c:r.createElement(N,null);return f(r.createElement("div",{className:m},r.createElement("div",{className:a()("".concat(d,"-image"),n),style:i},g)))};var D=n(49638),L=n(39760),Z=n(96473),z=n(11993),B=n(31686),F=n(26365),H=n(41154),q=n(6989),W=n(50506),U=n(79267),K=(0,r.createContext)(null),$=n(31474),V=n(58525),X=n(28791),G=n(53346),Y=function(e){var t=e.activeTabOffset,n=e.horizontal,o=e.rtl,a=e.indicator,i=void 0===a?{}:a,l=i.size,s=i.align,c=void 0===s?"center":s,u=(0,r.useState)(),d=(0,F.Z)(u,2),f=d[0],p=d[1],h=(0,r.useRef)(),m=r.useCallback(function(e){return"function"==typeof l?l(e):"number"==typeof l?l:e},[l]);function g(){G.Z.cancel(h.current)}return(0,r.useEffect)(function(){var e={};if(t){if(n){e.width=m(t.width);var r=o?"right":"left";"start"===c&&(e[r]=t[r]),"center"===c&&(e[r]=t[r]+t.width/2,e.transform=o?"translateX(50%)":"translateX(-50%)"),"end"===c&&(e[r]=t[r]+t.width,e.transform="translateX(-100%)")}else e.height=m(t.height),"start"===c&&(e.top=t.top),"center"===c&&(e.top=t.top+t.height/2,e.transform="translateY(-50%)"),"end"===c&&(e.top=t.top+t.height,e.transform="translateY(-100%)")}return g(),h.current=(0,G.Z)(function(){p(e)}),g},[t,n,o,c,m]),{style:f}},Q={width:0,height:0,left:0,top:0};function J(e,t){var n=r.useRef(e),o=r.useState({}),a=(0,F.Z)(o,2)[1];return[n.current,function(e){var r="function"==typeof e?e(n.current):e;r!==n.current&&t(r,n.current),n.current=r,a({})}]}var ee=n(27380);function et(e){var t=(0,r.useState)(0),n=(0,F.Z)(t,2),o=n[0],a=n[1],i=(0,r.useRef)(0),l=(0,r.useRef)();return l.current=e,(0,ee.o)(function(){var e;null===(e=l.current)||void 0===e||e.call(l)},[o]),function(){i.current===o&&(i.current+=1,a(i.current))}}var en={width:0,height:0,left:0,top:0,right:0};function er(e){var t;return e instanceof Map?(t={},e.forEach(function(e,n){t[n]=e})):t=e,JSON.stringify(t)}function eo(e){return String(e).replace(/"/g,"TABS_DQ")}function ea(e,t,n,r){return!!n&&!r&&!1!==e&&(void 0!==e||!1!==t&&null!==t)}var ei=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.editable,a=e.locale,i=e.style;return o&&!1!==o.showAdd?r.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(null==a?void 0:a.addAriaLabel)||"Add tab",onClick:function(e){o.onEdit("add",{event:e})}},o.addIcon||"+"):null}),el=r.forwardRef(function(e,t){var n,o=e.position,a=e.prefixCls,i=e.extra;if(!i)return null;var l={};return"object"!==(0,H.Z)(i)||r.isValidElement(i)?l.right=i:l=i,"right"===o&&(n=l.right),"left"===o&&(n=l.left),n?r.createElement("div",{className:"".concat(a,"-extra-content"),ref:t},n):null}),es=n(71030),ec=n(33082),eu=n(95814),ed=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.id,i=e.tabs,l=e.locale,s=e.mobile,c=e.moreIcon,u=e.moreTransitionName,d=e.style,f=e.className,p=e.editable,h=e.tabBarGutter,m=e.rtl,g=e.removeAriaLabel,v=e.onTabClick,y=e.getPopupContainer,b=e.popupClassName,x=(0,r.useState)(!1),w=(0,F.Z)(x,2),k=w[0],S=w[1],E=(0,r.useState)(null),O=(0,F.Z)(E,2),C=O[0],j=O[1],_="".concat(o,"-more-popup"),P="".concat(n,"-dropdown"),N=null!==C?"".concat(_,"-").concat(C):null,T=null==l?void 0:l.dropdownAriaLabel,A=r.createElement(ec.ZP,{onClick:function(e){v(e.key,e.domEvent),S(!1)},prefixCls:"".concat(P,"-menu"),id:_,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[C],"aria-label":void 0!==T?T:"expanded dropdown"},i.map(function(e){var t=e.closable,n=e.disabled,a=e.closeIcon,i=e.key,l=e.label,s=ea(t,a,p,n);return r.createElement(ec.sN,{key:i,id:"".concat(_,"-").concat(i),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(i),disabled:n},r.createElement("span",null,l),s&&r.createElement("button",{type:"button","aria-label":g||"remove",tabIndex:0,className:"".concat(P,"-menu-item-remove"),onClick:function(e){e.stopPropagation(),e.preventDefault(),e.stopPropagation(),p.onEdit("remove",{key:i,event:e})}},a||p.removeIcon||"\xd7"))}));function M(e){for(var t=i.filter(function(e){return!e.disabled}),n=t.findIndex(function(e){return e.key===C})||0,r=t.length,o=0;o<r;o+=1){var a=t[n=(n+e+r)%r];if(!a.disabled){j(a.key);return}}}(0,r.useEffect)(function(){var e=document.getElementById(N);e&&e.scrollIntoView&&e.scrollIntoView(!1)},[C]),(0,r.useEffect)(function(){k||j(null)},[k]);var I=(0,z.Z)({},m?"marginRight":"marginLeft",h);i.length||(I.visibility="hidden",I.order=1);var R=a()((0,z.Z)({},"".concat(P,"-rtl"),m)),D=s?null:r.createElement(es.Z,{prefixCls:P,overlay:A,trigger:["hover"],visible:!!i.length&&k,transitionName:u,onVisibleChange:S,overlayClassName:a()(R,b),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:y},r.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:I,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":_,id:"".concat(o,"-more"),"aria-expanded":k,onKeyDown:function(e){var t=e.which;if(!k){[eu.Z.DOWN,eu.Z.SPACE,eu.Z.ENTER].includes(t)&&(S(!0),e.preventDefault());return}switch(t){case eu.Z.UP:M(-1),e.preventDefault();break;case eu.Z.DOWN:M(1),e.preventDefault();break;case eu.Z.ESC:S(!1);break;case eu.Z.SPACE:case eu.Z.ENTER:null!==C&&v(C,e)}}},void 0===c?"More":c));return r.createElement("div",{className:a()("".concat(n,"-nav-operations"),f),style:d,ref:t},D,r.createElement(ei,{prefixCls:n,locale:l,editable:p}))}),ef=r.memo(ed,function(e,t){return t.tabMoving}),ep=function(e){var t=e.prefixCls,n=e.id,o=e.active,i=e.tab,l=i.key,s=i.label,c=i.disabled,u=i.closeIcon,d=i.icon,f=e.closable,p=e.renderWrapper,h=e.removeAriaLabel,m=e.editable,g=e.onClick,v=e.onFocus,y=e.style,b="".concat(t,"-tab"),x=ea(f,u,m,c);function w(e){c||g(e)}var k=r.useMemo(function(){return d&&"string"==typeof s?r.createElement("span",null,s):s},[s,d]),S=r.createElement("div",{key:l,"data-node-key":eo(l),className:a()(b,(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(b,"-with-remove"),x),"".concat(b,"-active"),o),"".concat(b,"-disabled"),c)),style:y,onClick:w},r.createElement("div",{role:"tab","aria-selected":o,id:n&&"".concat(n,"-tab-").concat(l),className:"".concat(b,"-btn"),"aria-controls":n&&"".concat(n,"-panel-").concat(l),"aria-disabled":c,tabIndex:c?null:0,onClick:function(e){e.stopPropagation(),w(e)},onKeyDown:function(e){[eu.Z.SPACE,eu.Z.ENTER].includes(e.which)&&(e.preventDefault(),w(e))},onFocus:v},d&&r.createElement("span",{className:"".concat(b,"-icon")},d),s&&k),x&&r.createElement("button",{type:"button","aria-label":h||"remove",tabIndex:0,className:"".concat(b,"-remove"),onClick:function(e){e.stopPropagation(),e.preventDefault(),e.stopPropagation(),m.onEdit("remove",{key:l,event:e})}},u||m.removeIcon||"\xd7"));return p?p(S):S},eh=function(e,t){var n=e.offsetWidth,r=e.offsetHeight,o=e.offsetTop,a=e.offsetLeft,i=e.getBoundingClientRect(),l=i.width,s=i.height,c=i.x,u=i.y;return 1>Math.abs(l-n)?[l,s,c-t.x,u-t.y]:[n,r,a,o]},em=function(e){var t=e.current||{},n=t.offsetWidth,r=void 0===n?0:n,o=t.offsetHeight;if(e.current){var a=e.current.getBoundingClientRect(),i=a.width,l=a.height;if(1>Math.abs(i-r))return[i,l]}return[r,void 0===o?0:o]},eg=function(e,t){return e[t?0:1]},ev=r.forwardRef(function(e,t){var n,o,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,_,P,N,A,M,I,R,D,L,Z,H,q,W,U,G,ee,ea=e.className,es=e.style,ec=e.id,eu=e.animated,ed=e.activeKey,ev=e.rtl,ey=e.extra,eb=e.editable,ex=e.locale,ew=e.tabPosition,ek=e.tabBarGutter,eS=e.children,eE=e.onTabClick,eO=e.onTabScroll,eC=e.indicator,ej=r.useContext(K),e_=ej.prefixCls,eP=ej.tabs,eN=(0,r.useRef)(null),eT=(0,r.useRef)(null),eA=(0,r.useRef)(null),eM=(0,r.useRef)(null),eI=(0,r.useRef)(null),eR=(0,r.useRef)(null),eD=(0,r.useRef)(null),eL="top"===ew||"bottom"===ew,eZ=J(0,function(e,t){eL&&eO&&eO({direction:e>t?"left":"right"})}),ez=(0,F.Z)(eZ,2),eB=ez[0],eF=ez[1],eH=J(0,function(e,t){!eL&&eO&&eO({direction:e>t?"top":"bottom"})}),eq=(0,F.Z)(eH,2),eW=eq[0],eU=eq[1],eK=(0,r.useState)([0,0]),e$=(0,F.Z)(eK,2),eV=e$[0],eX=e$[1],eG=(0,r.useState)([0,0]),eY=(0,F.Z)(eG,2),eQ=eY[0],eJ=eY[1],e0=(0,r.useState)([0,0]),e1=(0,F.Z)(e0,2),e2=e1[0],e6=e1[1],e4=(0,r.useState)([0,0]),e3=(0,F.Z)(e4,2),e5=e3[0],e8=e3[1],e7=(n=new Map,o=(0,r.useRef)([]),i=(0,r.useState)({}),l=(0,F.Z)(i,2)[1],s=(0,r.useRef)("function"==typeof n?n():n),c=et(function(){var e=s.current;o.current.forEach(function(t){e=t(e)}),o.current=[],s.current=e,l({})}),[s.current,function(e){o.current.push(e),c()}]),e9=(0,F.Z)(e7,2),te=e9[0],tt=e9[1],tn=(u=eQ[0],(0,r.useMemo)(function(){for(var e=new Map,t=te.get(null===(o=eP[0])||void 0===o?void 0:o.key)||Q,n=t.left+t.width,r=0;r<eP.length;r+=1){var o,a,i=eP[r].key,l=te.get(i);l||(l=te.get(null===(a=eP[r-1])||void 0===a?void 0:a.key)||Q);var s=e.get(i)||(0,B.Z)({},l);s.right=n-s.left-s.width,e.set(i,s)}return e},[eP.map(function(e){return e.key}).join("_"),te,u])),tr=eg(eV,eL),to=eg(eQ,eL),ta=eg(e2,eL),ti=eg(e5,eL),tl=tr<to+ta,ts=tl?tr-ti:tr-ta,tc="".concat(e_,"-nav-operations-hidden"),tu=0,td=0;function tf(e){return e<tu?tu:e>td?td:e}eL&&ev?(tu=0,td=Math.max(0,to-ts)):(tu=Math.min(0,ts-to),td=0);var tp=(0,r.useRef)(null),th=(0,r.useState)(),tm=(0,F.Z)(th,2),tg=tm[0],tv=tm[1];function ty(){tv(Date.now())}function tb(){tp.current&&clearTimeout(tp.current)}d=function(e,t){function n(e,t){e(function(e){return tf(e+t)})}return!!tl&&(eL?n(eF,e):n(eU,t),tb(),ty(),!0)},f=(0,r.useState)(),h=(p=(0,F.Z)(f,2))[0],m=p[1],g=(0,r.useState)(0),y=(v=(0,F.Z)(g,2))[0],b=v[1],x=(0,r.useState)(0),k=(w=(0,F.Z)(x,2))[0],S=w[1],E=(0,r.useState)(),C=(O=(0,F.Z)(E,2))[0],_=O[1],P=(0,r.useRef)(),N=(0,r.useRef)(),(A=(0,r.useRef)(null)).current={onTouchStart:function(e){var t=e.touches[0];m({x:t.screenX,y:t.screenY}),window.clearInterval(P.current)},onTouchMove:function(e){if(h){e.preventDefault();var t=e.touches[0],n=t.screenX,r=t.screenY;m({x:n,y:r});var o=n-h.x,a=r-h.y;d(o,a);var i=Date.now();b(i),S(i-y),_({x:o,y:a})}},onTouchEnd:function(){if(h&&(m(null),_(null),C)){var e=C.x/k,t=C.y/k;if(!(.1>Math.max(Math.abs(e),Math.abs(t)))){var n=e,r=t;P.current=window.setInterval(function(){if(.01>Math.abs(n)&&.01>Math.abs(r)){window.clearInterval(P.current);return}n*=.9046104802746175,r*=.9046104802746175,d(20*n,20*r)},20)}}},onWheel:function(e){var t=e.deltaX,n=e.deltaY,r=0,o=Math.abs(t),a=Math.abs(n);o===a?r="x"===N.current?t:n:o>a?(r=t,N.current="x"):(r=n,N.current="y"),d(-r,-r)&&e.preventDefault()}},r.useEffect(function(){function e(e){A.current.onTouchMove(e)}function t(e){A.current.onTouchEnd(e)}return document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",t,{passive:!1}),eM.current.addEventListener("touchstart",function(e){A.current.onTouchStart(e)},{passive:!1}),eM.current.addEventListener("wheel",function(e){A.current.onWheel(e)}),function(){document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)}},[]),(0,r.useEffect)(function(){return tb(),tg&&(tp.current=setTimeout(function(){tv(0)},100)),tb},[tg]);var tx=(M=eL?eB:eW,Z=(I=(0,B.Z)((0,B.Z)({},e),{},{tabs:eP})).tabs,H=I.tabPosition,q=I.rtl,["top","bottom"].includes(H)?(R="width",D=q?"right":"left",L=Math.abs(M)):(R="height",D="top",L=-M),(0,r.useMemo)(function(){if(!Z.length)return[0,0];for(var e=Z.length,t=e,n=0;n<e;n+=1){var r=tn.get(Z[n].key)||en;if(r[D]+r[R]>L+ts){t=n-1;break}}for(var o=0,a=e-1;a>=0;a-=1)if((tn.get(Z[a].key)||en)[D]<L){o=a+1;break}return o>=t?[0,0]:[o,t]},[tn,ts,to,ta,ti,L,H,Z.map(function(e){return e.key}).join("_"),q])),tw=(0,F.Z)(tx,2),tk=tw[0],tS=tw[1],tE=(0,V.Z)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ed,t=tn.get(e)||{width:0,height:0,left:0,right:0,top:0};if(eL){var n=eB;ev?t.right<eB?n=t.right:t.right+t.width>eB+ts&&(n=t.right+t.width-ts):t.left<-eB?n=-t.left:t.left+t.width>-eB+ts&&(n=-(t.left+t.width-ts)),eU(0),eF(tf(n))}else{var r=eW;t.top<-eW?r=-t.top:t.top+t.height>-eW+ts&&(r=-(t.top+t.height-ts)),eF(0),eU(tf(r))}}),tO={};"top"===ew||"bottom"===ew?tO[ev?"marginRight":"marginLeft"]=ek:tO.marginTop=ek;var tC=eP.map(function(e,t){var n=e.key;return r.createElement(ep,{id:ec,prefixCls:e_,key:n,tab:e,style:0===t?void 0:tO,closable:e.closable,editable:eb,active:n===ed,renderWrapper:eS,removeAriaLabel:null==ex?void 0:ex.removeAriaLabel,onClick:function(e){eE(n,e)},onFocus:function(){tE(n),ty(),eM.current&&(ev||(eM.current.scrollLeft=0),eM.current.scrollTop=0)}})}),tj=function(){return tt(function(){var e,t=new Map,n=null===(e=eI.current)||void 0===e?void 0:e.getBoundingClientRect();return eP.forEach(function(e){var r,o=e.key,a=null===(r=eI.current)||void 0===r?void 0:r.querySelector('[data-node-key="'.concat(eo(o),'"]'));if(a){var i=eh(a,n),l=(0,F.Z)(i,4),s=l[0],c=l[1],u=l[2],d=l[3];t.set(o,{width:s,height:c,left:u,top:d})}}),t})};(0,r.useEffect)(function(){tj()},[eP.map(function(e){return e.key}).join("_")]);var t_=et(function(){var e=em(eN),t=em(eT),n=em(eA);eX([e[0]-t[0]-n[0],e[1]-t[1]-n[1]]);var r=em(eD);e6(r),e8(em(eR));var o=em(eI);eJ([o[0]-r[0],o[1]-r[1]]),tj()}),tP=eP.slice(0,tk),tN=eP.slice(tS+1),tT=[].concat((0,T.Z)(tP),(0,T.Z)(tN)),tA=tn.get(ed),tM=Y({activeTabOffset:tA,horizontal:eL,indicator:eC,rtl:ev}).style;(0,r.useEffect)(function(){tE()},[ed,tu,td,er(tA),er(tn),eL]),(0,r.useEffect)(function(){t_()},[ev]);var tI=!!tT.length,tR="".concat(e_,"-nav-wrap");return eL?ev?(U=eB>0,W=eB!==td):(W=eB<0,U=eB!==tu):(G=eW<0,ee=eW!==tu),r.createElement($.Z,{onResize:t_},r.createElement("div",{ref:(0,X.x1)(t,eN),role:"tablist",className:a()("".concat(e_,"-nav"),ea),style:es,onKeyDown:function(){ty()}},r.createElement(el,{ref:eT,position:"left",extra:ey,prefixCls:e_}),r.createElement($.Z,{onResize:t_},r.createElement("div",{className:a()(tR,(0,z.Z)((0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(tR,"-ping-left"),W),"".concat(tR,"-ping-right"),U),"".concat(tR,"-ping-top"),G),"".concat(tR,"-ping-bottom"),ee)),ref:eM},r.createElement($.Z,{onResize:t_},r.createElement("div",{ref:eI,className:"".concat(e_,"-nav-list"),style:{transform:"translate(".concat(eB,"px, ").concat(eW,"px)"),transition:tg?"none":void 0}},tC,r.createElement(ei,{ref:eD,prefixCls:e_,locale:ex,editable:eb,style:(0,B.Z)((0,B.Z)({},0===tC.length?void 0:tO),{},{visibility:tI?"hidden":null})}),r.createElement("div",{className:a()("".concat(e_,"-ink-bar"),(0,z.Z)({},"".concat(e_,"-ink-bar-animated"),eu.inkBar)),style:tM}))))),r.createElement(ef,(0,j.Z)({},e,{removeAriaLabel:null==ex?void 0:ex.removeAriaLabel,ref:eR,prefixCls:e_,tabs:tT,className:!tI&&tc,tabMoving:!!tg})),r.createElement(el,{ref:eA,position:"right",extra:ey,prefixCls:e_})))}),ey=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.className,i=e.style,l=e.id,s=e.active,c=e.tabKey,u=e.children;return r.createElement("div",{id:l&&"".concat(l,"-panel-").concat(c),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":l&&"".concat(l,"-tab-").concat(c),"aria-hidden":!s,style:i,className:a()(n,s&&"".concat(n,"-active"),o),ref:t},u)}),eb=["renderTabBar"],ex=["label","key"],ew=function(e){var t=e.renderTabBar,n=(0,q.Z)(e,eb),o=r.useContext(K).tabs;return t?t((0,B.Z)((0,B.Z)({},n),{},{panes:o.map(function(e){var t=e.label,n=e.key,o=(0,q.Z)(e,ex);return r.createElement(ey,(0,j.Z)({tab:t,key:n,tabKey:n},o))})}),ev):r.createElement(ev,n)},ek=n(47970),eS=["key","forceRender","style","className","destroyInactiveTabPane"],eE=function(e){var t=e.id,n=e.activeKey,o=e.animated,i=e.tabPosition,l=e.destroyInactiveTabPane,s=r.useContext(K),c=s.prefixCls,u=s.tabs,d=o.tabPane,f="".concat(c,"-tabpane");return r.createElement("div",{className:a()("".concat(c,"-content-holder"))},r.createElement("div",{className:a()("".concat(c,"-content"),"".concat(c,"-content-").concat(i),(0,z.Z)({},"".concat(c,"-content-animated"),d))},u.map(function(e){var i=e.key,s=e.forceRender,c=e.style,u=e.className,p=e.destroyInactiveTabPane,h=(0,q.Z)(e,eS),m=i===n;return r.createElement(ek.ZP,(0,j.Z)({key:i,visible:m,forceRender:s,removeOnLeave:!!(l||p),leavedClassName:"".concat(f,"-hidden")},o.tabPaneMotion),function(e,n){var o=e.style,l=e.className;return r.createElement(ey,(0,j.Z)({},h,{prefixCls:f,id:t,tabKey:i,animated:d,active:m,style:(0,B.Z)((0,B.Z)({},c),o),className:a()(u,l),ref:n}))})})))};n(32559);var eO=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],eC=0,ej=r.forwardRef(function(e,t){var n=e.id,o=e.prefixCls,i=void 0===o?"rc-tabs":o,l=e.className,s=e.items,c=e.direction,u=e.activeKey,d=e.defaultActiveKey,f=e.editable,p=e.animated,h=e.tabPosition,m=void 0===h?"top":h,g=e.tabBarGutter,v=e.tabBarStyle,y=e.tabBarExtraContent,b=e.locale,x=e.moreIcon,w=e.moreTransitionName,k=e.destroyInactiveTabPane,S=e.renderTabBar,E=e.onChange,O=e.onTabClick,C=e.onTabScroll,_=e.getPopupContainer,P=e.popupClassName,N=e.indicator,T=(0,q.Z)(e,eO),A=r.useMemo(function(){return(s||[]).filter(function(e){return e&&"object"===(0,H.Z)(e)&&"key"in e})},[s]),M="rtl"===c,I=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(e=!1===t?{inkBar:!1,tabPane:!1}:!0===t?{inkBar:!0,tabPane:!1}:(0,B.Z)({inkBar:!0},"object"===(0,H.Z)(t)?t:{})).tabPaneMotion&&void 0===e.tabPane&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}(p),R=(0,r.useState)(!1),D=(0,F.Z)(R,2),L=D[0],Z=D[1];(0,r.useEffect)(function(){Z((0,U.Z)())},[]);var $=(0,W.Z)(function(){var e;return null===(e=A[0])||void 0===e?void 0:e.key},{value:u,defaultValue:d}),V=(0,F.Z)($,2),X=V[0],G=V[1],Y=(0,r.useState)(function(){return A.findIndex(function(e){return e.key===X})}),Q=(0,F.Z)(Y,2),J=Q[0],ee=Q[1];(0,r.useEffect)(function(){var e,t=A.findIndex(function(e){return e.key===X});-1===t&&(t=Math.max(0,Math.min(J,A.length-1)),G(null===(e=A[t])||void 0===e?void 0:e.key)),ee(t)},[A.map(function(e){return e.key}).join("_"),X,J]);var et=(0,W.Z)(null,{value:n}),en=(0,F.Z)(et,2),er=en[0],eo=en[1];(0,r.useEffect)(function(){n||(eo("rc-tabs-".concat(eC)),eC+=1)},[]);var ea={id:er,activeKey:X,animated:I,tabPosition:m,rtl:M,mobile:L},ei=(0,B.Z)((0,B.Z)({},ea),{},{editable:f,locale:b,moreIcon:x,moreTransitionName:w,tabBarGutter:g,onTabClick:function(e,t){null==O||O(e,t);var n=e!==X;G(e),n&&(null==E||E(e))},onTabScroll:C,extra:y,style:v,panes:null,getPopupContainer:_,popupClassName:P,indicator:N});return r.createElement(K.Provider,{value:{tabs:A,prefixCls:i}},r.createElement("div",(0,j.Z)({ref:t,id:n,className:a()(i,"".concat(i,"-").concat(m),(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(i,"-mobile"),L),"".concat(i,"-editable"),f),"".concat(i,"-rtl"),M),l)},T),r.createElement(ew,(0,j.Z)({},ei,{renderTabBar:S})),r.createElement(eE,(0,j.Z)({destroyInactiveTabPane:k},ea,{animated:I}))))}),e_=n(64024),eP=n(68710);let eN={motionAppear:!1,motionEnter:!0,motionLeave:!0};var eT=n(45287),eA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},eM=n(12918),eI=n(18544),eR=e=>{let{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{["".concat(t,"-switch")]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:"opacity ".concat(n)}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:"opacity ".concat(n)}}}}},[(0,eI.oN)(e,"slide-up"),(0,eI.oN)(e,"slide-down")]]};let eD=e=>{let{componentCls:t,tabsCardPadding:n,cardBg:r,cardGutter:o,colorBorderSecondary:a,itemSelectedColor:i}=e;return{["".concat(t,"-card")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{margin:0,padding:n,background:r,border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut)},["".concat(t,"-tab-active")]:{color:i,background:e.colorBgContainer},["".concat(t,"-ink-bar")]:{visibility:"hidden"}},["&".concat(t,"-top, &").concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginLeft:{_skip_check_:!0,value:(0,u.bf)(o)}}}},["&".concat(t,"-top")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")},["".concat(t,"-tab-active")]:{borderBottomColor:e.colorBgContainer}}},["&".concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},["".concat(t,"-tab-active")]:{borderTopColor:e.colorBgContainer}}},["&".concat(t,"-left, &").concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginTop:(0,u.bf)(o)}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,u.bf)(e.borderRadiusLG)," 0 0 ").concat((0,u.bf)(e.borderRadiusLG))}},["".concat(t,"-tab-active")]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0")}},["".concat(t,"-tab-active")]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},eL=e=>{let{componentCls:t,itemHoverColor:n,dropdownEdgeChildVerticalPadding:r}=e;return{["".concat(t,"-dropdown")]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},["".concat(t,"-dropdown-menu")]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:"".concat((0,u.bf)(r)," 0"),overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},eM.vS),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:"".concat((0,u.bf)(e.paddingXXS)," ").concat((0,u.bf)(e.paddingSM)),color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},eZ=e=>{let{componentCls:t,margin:n,colorBorderSecondary:r,horizontalMargin:o,verticalItemPadding:a,verticalItemMargin:i,calc:l}=e;return{["".concat(t,"-top, ").concat(t,"-bottom")]:{flexDirection:"column",["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r),content:"''"},["".concat(t,"-ink-bar")]:{height:e.lineWidthBold,"&-animated":{transition:"width ".concat(e.motionDurationSlow,", left ").concat(e.motionDurationSlow,",\n right ").concat(e.motionDurationSlow)}},["".concat(t,"-nav-wrap")]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},["&".concat(t,"-nav-wrap-ping-left::before")]:{opacity:1},["&".concat(t,"-nav-wrap-ping-right::after")]:{opacity:1}}}},["".concat(t,"-top")]:{["> ".concat(t,"-nav,\n > div > ").concat(t,"-nav")]:{"&::before":{bottom:0},["".concat(t,"-ink-bar")]:{bottom:0}}},["".concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},["".concat(t,"-ink-bar")]:{top:0}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{order:0}},["".concat(t,"-left, ").concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{flexDirection:"column",minWidth:l(e.controlHeight).mul(1.25).equal(),["".concat(t,"-tab")]:{padding:a,textAlign:"center"},["".concat(t,"-tab + ").concat(t,"-tab")]:{margin:i},["".concat(t,"-nav-wrap")]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},["&".concat(t,"-nav-wrap-ping-top::before")]:{opacity:1},["&".concat(t,"-nav-wrap-ping-bottom::after")]:{opacity:1}},["".concat(t,"-ink-bar")]:{width:e.lineWidthBold,"&-animated":{transition:"height ".concat(e.motionDurationSlow,", top ").concat(e.motionDurationSlow)}},["".concat(t,"-nav-list, ").concat(t,"-nav-operations")]:{flex:"1 0 auto",flexDirection:"column"}}},["".concat(t,"-left")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-ink-bar")]:{right:{_skip_check_:!0,value:0}}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{marginLeft:{_skip_check_:!0,value:(0,u.bf)(l(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},["> ".concat(t,"-content > ").concat(t,"-tabpane")]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},["".concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{order:1,["".concat(t,"-ink-bar")]:{left:{_skip_check_:!0,value:0}}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{order:0,marginRight:{_skip_check_:!0,value:l(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},["> ".concat(t,"-content > ").concat(t,"-tabpane")]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},ez=e=>{let{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,horizontalItemPaddingSM:o,horizontalItemPaddingLG:a}=e;return{[t]:{"&-small":{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:o,fontSize:e.titleFontSizeSM}}},"&-large":{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:a,fontSize:e.titleFontSizeLG}}}},["".concat(t,"-card")]:{["&".concat(t,"-small")]:{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:n}},["&".concat(t,"-bottom")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius))}},["&".concat(t,"-top")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:"".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius)," 0 0")}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius)," 0")}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,u.bf)(e.borderRadius)," 0 0 ").concat((0,u.bf)(e.borderRadius))}}}},["&".concat(t,"-large")]:{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:r}}}}}},eB=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:o,tabsHorizontalItemMargin:a,horizontalItemPadding:i,itemSelectedColor:l,itemColor:s}=e,c="".concat(t,"-tab");return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:i,fontSize:e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:s,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},(0,eM.Qy)(e)),"&-btn":{outline:"none",transition:"all 0.3s",["".concat(c,"-icon:not(:last-child)")]:{marginInlineEnd:e.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextHeading}},"&:hover":{color:r},["&".concat(c,"-active ").concat(c,"-btn")]:{color:l,textShadow:e.tabsActiveTextShadow},["&".concat(c,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed"},["&".concat(c,"-disabled ").concat(c,"-btn, &").concat(c,"-disabled ").concat(t,"-remove")]:{"&:focus, &:active":{color:e.colorTextDisabled}},["& ".concat(c,"-remove ").concat(o)]:{margin:0},["".concat(o,":not(:last-child)")]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},["".concat(c," + ").concat(c)]:{margin:{_skip_check_:!0,value:a}}}},eF=e=>{let{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:o,calc:a}=e;return{["".concat(t,"-rtl")]:{direction:"rtl",["".concat(t,"-nav")]:{["".concat(t,"-tab")]:{margin:{_skip_check_:!0,value:n},["".concat(t,"-tab:last-of-type")]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,u.bf)(e.marginSM)}},["".concat(t,"-tab-remove")]:{marginRight:{_skip_check_:!0,value:(0,u.bf)(e.marginXS)},marginLeft:{_skip_check_:!0,value:(0,u.bf)(a(e.marginXXS).mul(-1).equal())},[r]:{margin:0}}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav")]:{order:1},["> ".concat(t,"-content-holder")]:{order:0}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav")]:{order:0},["> ".concat(t,"-content-holder")]:{order:1}},["&".concat(t,"-card").concat(t,"-top, &").concat(t,"-card").concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},["".concat(t,"-dropdown-rtl")]:{direction:"rtl"},["".concat(t,"-menu-item")]:{["".concat(t,"-dropdown-rtl")]:{textAlign:{_skip_check_:!0,value:"right"}}}}},eH=e=>{let{componentCls:t,tabsCardPadding:n,cardHeight:r,cardGutter:o,itemHoverColor:a,itemActiveColor:i,colorBorderSecondary:l}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,eM.Wf)(e)),{display:"flex",["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{position:"relative",display:"flex",flex:"none",alignItems:"center",["".concat(t,"-nav-wrap")]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:"opacity ".concat(e.motionDurationSlow),content:"''",pointerEvents:"none"}},["".concat(t,"-nav-list")]:{position:"relative",display:"flex",transition:"opacity ".concat(e.motionDurationSlow)},["".concat(t,"-nav-operations")]:{display:"flex",alignSelf:"stretch"},["".concat(t,"-nav-operations-hidden")]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},["".concat(t,"-nav-more")]:{position:"relative",padding:n,background:"transparent",border:0,color:e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},["".concat(t,"-nav-add")]:Object.assign({minWidth:r,minHeight:r,marginLeft:{_skip_check_:!0,value:o},padding:"0 ".concat((0,u.bf)(e.paddingXS)),background:"transparent",border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(l),borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0"),outline:"none",cursor:"pointer",color:e.colorText,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut),"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:i}},(0,eM.Qy)(e))},["".concat(t,"-extra-content")]:{flex:"none"},["".concat(t,"-ink-bar")]:{position:"absolute",background:e.inkBarColor,pointerEvents:"none"}}),eB(e)),{["".concat(t,"-content")]:{position:"relative",width:"100%"},["".concat(t,"-content-holder")]:{flex:"auto",minWidth:0,minHeight:0},["".concat(t,"-tabpane")]:{outline:"none","&-hidden":{display:"none"}}}),["".concat(t,"-centered")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-nav-wrap")]:{["&:not([class*='".concat(t,"-nav-wrap-ping'])")]:{justifyContent:"center"}}}}}};var eq=(0,d.I$)("Tabs",e=>{let t=(0,f.TS)(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:"0 0 0 ".concat((0,u.bf)(e.horizontalItemGutter)),tabsHorizontalItemMarginRTL:"0 0 0 ".concat((0,u.bf)(e.horizontalItemGutter))});return[ez(t),eF(t),eZ(t),eL(t),eD(t),eH(t),eR(t)]},e=>{let t=e.controlHeightLG;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:t,cardPadding:"".concat((t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth,"px ").concat(e.padding,"px"),cardPaddingSM:"".concat(1.5*e.paddingXXS,"px ").concat(e.padding,"px"),cardPaddingLG:"".concat(e.paddingXS,"px ").concat(e.padding,"px ").concat(1.5*e.paddingXXS,"px"),titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:"0 0 ".concat(e.margin,"px 0"),horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:"".concat(e.paddingSM,"px 0"),horizontalItemPaddingSM:"".concat(e.paddingXS,"px 0"),horizontalItemPaddingLG:"".concat(e.padding,"px 0"),verticalItemPadding:"".concat(e.paddingXS,"px ").concat(e.paddingLG,"px"),verticalItemMargin:"".concat(e.margin,"px 0 0 0"),itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}}),eW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eU=e=>{var t,n,o,i,c,u;let d;let{type:f,className:p,rootClassName:h,size:m,onEdit:g,hideAdd:v,centered:y,addIcon:b,popupClassName:x,children:w,items:k,animated:S,style:E,indicatorSize:O,indicator:C}=e,j=eW(e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:_,moreIcon:P=r.createElement(L.Z,null)}=j,{direction:N,tabs:T,getPrefixCls:A,getPopupContainer:M}=r.useContext(l.E_),I=A("tabs",_),R=(0,e_.Z)(I),[z,B,F]=eq(I,R);"editable-card"===f&&(d={onEdit:(e,t)=>{let{key:n,event:r}=t;null==g||g("add"===e?r:n,e)},removeIcon:r.createElement(D.Z,null),addIcon:b||r.createElement(Z.Z,null),showAdd:!0!==v});let H=A(),q=(0,s.Z)(m),W=k||(0,eT.Z)(w).map(e=>{if(r.isValidElement(e)){let{key:t,props:n}=e,r=n||{},{tab:o}=r,a=eA(r,["tab"]);return Object.assign(Object.assign({key:String(t)},a),{label:o})}return null}).filter(e=>e),U=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return(t=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{})).tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},eN),{motionName:(0,eP.m)(e,"switch")})),t}(I,S),K=Object.assign(Object.assign({},null==T?void 0:T.style),E),$={align:null!==(t=null==C?void 0:C.align)&&void 0!==t?t:null===(n=null==T?void 0:T.indicator)||void 0===n?void 0:n.align,size:null!==(u=null!==(i=null!==(o=null==C?void 0:C.size)&&void 0!==o?o:O)&&void 0!==i?i:null===(c=null==T?void 0:T.indicator)||void 0===c?void 0:c.size)&&void 0!==u?u:null==T?void 0:T.indicatorSize};return z(r.createElement(ej,Object.assign({direction:N,getPopupContainer:M,moreTransitionName:"".concat(H,"-slide-up")},j,{items:W,className:a()({["".concat(I,"-").concat(q)]:q,["".concat(I,"-card")]:["card","editable-card"].includes(f),["".concat(I,"-editable-card")]:"editable-card"===f,["".concat(I,"-centered")]:y},null==T?void 0:T.className,p,h,B,F,R),popupClassName:a()(x,B,F,R),style:K,editable:d,moreIcon:P,prefixCls:I,animated:U,indicator:$})))};eU.TabPane=()=>null;var eK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},e$=e=>{var{prefixCls:t,className:n,hoverable:o=!0}=e,i=eK(e,["prefixCls","className","hoverable"]);let{getPrefixCls:s}=r.useContext(l.E_),c=s("card",t),u=a()("".concat(c,"-grid"),n,{["".concat(c,"-grid-hoverable")]:o});return r.createElement("div",Object.assign({},i,{className:u}))};let eV=e=>{let{antCls:t,componentCls:n,headerHeight:r,cardPaddingBase:o,tabsMarginBottom:a}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:r,marginBottom:-1,padding:"0 ".concat((0,u.bf)(o)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")},(0,eM.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},eM.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:a,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},eX=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:o}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,u.bf)(o)," 0 0 0 ").concat(n,",\n 0 ").concat((0,u.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,u.bf)(o)," ").concat((0,u.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,u.bf)(o)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,u.bf)(o)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:r}}},eG=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:r,cardActionsIconSize:o,colorBorderSecondary:a,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),display:"flex",borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},(0,eM.dF)()),{"& > li":{margin:r,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:"color ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:e.colorTextDescription,lineHeight:(0,u.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(n)]:{fontSize:o,lineHeight:(0,u.bf)(e.calc(o).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a)}}})},eY=e=>Object.assign(Object.assign({margin:"".concat((0,u.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,eM.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},eM.vS),"&-description":{color:e.colorTextDescription}}),eQ=e=>{let{componentCls:t,cardPaddingBase:n,colorFillAlter:r}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,u.bf)(n)),background:r,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,u.bf)(e.padding)," ").concat((0,u.bf)(n))}}},eJ=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},e0=e=>{let{antCls:t,componentCls:n,cardShadow:r,cardHeadPadding:o,colorBorderSecondary:a,boxShadowTertiary:i,cardPaddingBase:l,extraColor:s}=e;return{[n]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(n,"-bordered)")]:{boxShadow:i},["".concat(n,"-head")]:eV(e),["".concat(n,"-extra")]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},["".concat(n,"-body")]:Object.assign({padding:l,borderRadius:" 0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},(0,eM.dF)()),["".concat(n,"-grid")]:eX(e),["".concat(n,"-cover")]:{"> *":{display:"block",width:"100%"},["img, img + ".concat(t,"-image-mask")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")}},["".concat(n,"-actions")]:eG(e),["".concat(n,"-meta")]:eY(e)}),["".concat(n,"-bordered")]:{border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(n,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(n,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:r}},["".concat(n,"-contain-grid")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0 "),["".concat(n,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(n,"-loading) ").concat(n,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(n,"-contain-tabs")]:{["> ".concat(n,"-head")]:{minHeight:0,["".concat(n,"-head-title, ").concat(n,"-extra")]:{paddingTop:o}}},["".concat(n,"-type-inner")]:eQ(e),["".concat(n,"-loading")]:eJ(e),["".concat(n,"-rtl")]:{direction:"rtl"}}},e1=e=>{let{componentCls:t,cardPaddingSM:n,headerHeightSM:r,headerFontSizeSM:o}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:r,padding:"0 ".concat((0,u.bf)(n)),fontSize:o,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:n}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var e2=(0,d.I$)("Card",e=>{let t=(0,f.TS)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[e0(t),e1(t)]},e=>({headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText})),e6=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let e4=e=>{let{prefixCls:t,actions:n=[]}=e;return r.createElement("ul",{className:"".concat(t,"-actions")},n.map((e,t)=>r.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(t)},r.createElement("span",null,e))))},e3=r.forwardRef((e,t)=>{let n;let{prefixCls:o,className:c,rootClassName:u,style:d,extra:f,headStyle:p={},bodyStyle:h={},title:m,loading:g,bordered:v=!0,size:y,type:b,cover:x,actions:w,tabList:k,children:S,activeTabKey:E,defaultActiveTabKey:O,tabBarExtraContent:C,hoverable:j,tabProps:_={}}=e,P=e6(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:N,direction:T,card:A}=r.useContext(l.E_),M=r.useMemo(()=>{let e=!1;return r.Children.forEach(S,t=>{t&&t.type&&t.type===e$&&(e=!0)}),e},[S]),I=N("card",o),[D,L,Z]=e2(I),z=r.createElement(R,{loading:!0,active:!0,paragraph:{rows:4},title:!1},S),B=void 0!==E,F=Object.assign(Object.assign({},_),{[B?"activeKey":"defaultActiveKey"]:B?E:O,tabBarExtraContent:C}),H=(0,s.Z)(y),q=H&&"default"!==H?H:"large",W=k?r.createElement(eU,Object.assign({size:q},F,{className:"".concat(I,"-head-tabs"),onChange:t=>{var n;null===(n=e.onTabChange)||void 0===n||n.call(e,t)},items:k.map(e=>{var{tab:t}=e;return Object.assign({label:t},e6(e,["tab"]))})})):null;(m||f||W)&&(n=r.createElement("div",{className:"".concat(I,"-head"),style:p},r.createElement("div",{className:"".concat(I,"-head-wrapper")},m&&r.createElement("div",{className:"".concat(I,"-head-title")},m),f&&r.createElement("div",{className:"".concat(I,"-extra")},f)),W));let U=x?r.createElement("div",{className:"".concat(I,"-cover")},x):null,K=r.createElement("div",{className:"".concat(I,"-body"),style:h},g?z:S),$=w&&w.length?r.createElement(e4,{prefixCls:I,actions:w}):null,V=(0,i.Z)(P,["onTabChange"]),X=a()(I,null==A?void 0:A.className,{["".concat(I,"-loading")]:g,["".concat(I,"-bordered")]:v,["".concat(I,"-hoverable")]:j,["".concat(I,"-contain-grid")]:M,["".concat(I,"-contain-tabs")]:k&&k.length,["".concat(I,"-").concat(H)]:H,["".concat(I,"-type-").concat(b)]:!!b,["".concat(I,"-rtl")]:"rtl"===T},c,u,L,Z),G=Object.assign(Object.assign({},null==A?void 0:A.style),d);return D(r.createElement("div",Object.assign({ref:t},V,{className:X,style:G}),n,U,K,$))});var e5=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};e3.Grid=e$,e3.Meta=e=>{let{prefixCls:t,className:n,avatar:o,title:i,description:s}=e,c=e5(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=r.useContext(l.E_),d=u("card",t),f=a()("".concat(d,"-meta"),n),p=o?r.createElement("div",{className:"".concat(d,"-meta-avatar")},o):null,h=i?r.createElement("div",{className:"".concat(d,"-meta-title")},i):null,m=s?r.createElement("div",{className:"".concat(d,"-meta-description")},s):null,g=h||m?r.createElement("div",{className:"".concat(d,"-meta-detail")},h,m):null;return r.createElement("div",Object.assign({},c,{className:f}),p,g)};var e8=e3},69410:function(e,t,n){"use strict";var r=n(54998);t.Z=r.Z},44851:function(e,t,n){"use strict";n.d(t,{default:function(){return H}});var r=n(2265),o=n(77565),a=n(36760),i=n.n(a),l=n(83145),s=n(26365),c=n(41154),u=n(50506),d=n(32559),f=n(1119),p=n(6989),h=n(45287),m=n(11993),g=n(47970),v=n(95814),y=r.forwardRef(function(e,t){var n,o=e.prefixCls,a=e.forceRender,l=e.className,c=e.style,u=e.children,d=e.isActive,f=e.role,p=r.useState(d||a),h=(0,s.Z)(p,2),g=h[0],v=h[1];return(r.useEffect(function(){(a||d)&&v(!0)},[a,d]),g)?r.createElement("div",{ref:t,className:i()("".concat(o,"-content"),(n={},(0,m.Z)(n,"".concat(o,"-content-active"),d),(0,m.Z)(n,"".concat(o,"-content-inactive"),!d),n),l),style:c,role:f},r.createElement("div",{className:"".concat(o,"-content-box")},u)):null});y.displayName="PanelContent";var b=["showArrow","headerClass","isActive","onItemClick","forceRender","className","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],x=r.forwardRef(function(e,t){var n,o,a=e.showArrow,l=e.headerClass,s=e.isActive,c=e.onItemClick,u=e.forceRender,d=e.className,h=e.prefixCls,x=e.collapsible,w=e.accordion,k=e.panelKey,S=e.extra,E=e.header,O=e.expandIcon,C=e.openMotion,j=e.destroyInactivePanel,_=e.children,P=(0,p.Z)(e,b),N="disabled"===x,T="header"===x,A="icon"===x,M=function(){null==c||c(k)},I="function"==typeof O?O(e):r.createElement("i",{className:"arrow"});I&&(I=r.createElement("div",{className:"".concat(h,"-expand-icon"),onClick:["header","icon"].includes(x)?M:void 0},I));var R=i()((n={},(0,m.Z)(n,"".concat(h,"-item"),!0),(0,m.Z)(n,"".concat(h,"-item-active"),s),(0,m.Z)(n,"".concat(h,"-item-disabled"),N),n),d),D={className:i()(l,(o={},(0,m.Z)(o,"".concat(h,"-header"),!0),(0,m.Z)(o,"".concat(h,"-header-collapsible-only"),T),(0,m.Z)(o,"".concat(h,"-icon-collapsible-only"),A),o)),"aria-expanded":s,"aria-disabled":N,onKeyDown:function(e){("Enter"===e.key||e.keyCode===v.Z.ENTER||e.which===v.Z.ENTER)&&M()}};return T||A||(D.onClick=M,D.role=w?"tab":"button",D.tabIndex=N?-1:0),r.createElement("div",(0,f.Z)({},P,{ref:t,className:R}),r.createElement("div",D,(void 0===a||a)&&I,r.createElement("span",{className:"".concat(h,"-header-text"),onClick:"header"===x?M:void 0},E),null!=S&&"boolean"!=typeof S&&r.createElement("div",{className:"".concat(h,"-extra")},S)),r.createElement(g.ZP,(0,f.Z)({visible:s,leavedClassName:"".concat(h,"-content-hidden")},C,{forceRender:u,removeOnLeave:j}),function(e,t){var n=e.className,o=e.style;return r.createElement(y,{ref:t,prefixCls:h,className:n,style:o,isActive:s,forceRender:u,role:w?"tabpanel":void 0},_)}))}),w=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],k=function(e,t){var n=t.prefixCls,o=t.accordion,a=t.collapsible,i=t.destroyInactivePanel,l=t.onItemClick,s=t.activeKey,c=t.openMotion,u=t.expandIcon;return e.map(function(e,t){var d=e.children,h=e.label,m=e.key,g=e.collapsible,v=e.onItemClick,y=e.destroyInactivePanel,b=(0,p.Z)(e,w),k=String(null!=m?m:t),S=null!=g?g:a,E=!1;return E=o?s[0]===k:s.indexOf(k)>-1,r.createElement(x,(0,f.Z)({},b,{prefixCls:n,key:k,panelKey:k,isActive:E,accordion:o,openMotion:c,expandIcon:u,header:h,collapsible:S,onItemClick:function(e){"disabled"!==S&&(l(e),null==v||v(e))},destroyInactivePanel:null!=y?y:i}),d)})},S=function(e,t,n){if(!e)return null;var o=n.prefixCls,a=n.accordion,i=n.collapsible,l=n.destroyInactivePanel,s=n.onItemClick,c=n.activeKey,u=n.openMotion,d=n.expandIcon,f=e.key||String(t),p=e.props,h=p.header,m=p.headerClass,g=p.destroyInactivePanel,v=p.collapsible,y=p.onItemClick,b=!1;b=a?c[0]===f:c.indexOf(f)>-1;var x=null!=v?v:i,w={key:f,panelKey:f,header:h,headerClass:m,isActive:b,prefixCls:o,destroyInactivePanel:null!=g?g:l,openMotion:u,accordion:a,children:e.props.children,onItemClick:function(e){"disabled"!==x&&(s(e),null==y||y(e))},expandIcon:d,collapsible:x};return"string"==typeof e.type?e:(Object.keys(w).forEach(function(e){void 0===w[e]&&delete w[e]}),r.cloneElement(e,w))};function E(e){var t=e;if(!Array.isArray(t)){var n=(0,c.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var O=Object.assign(r.forwardRef(function(e,t){var n,o=e.prefixCls,a=void 0===o?"rc-collapse":o,c=e.destroyInactivePanel,f=e.style,p=e.accordion,m=e.className,g=e.children,v=e.collapsible,y=e.openMotion,b=e.expandIcon,x=e.activeKey,w=e.defaultActiveKey,O=e.onChange,C=e.items,j=i()(a,m),_=(0,u.Z)([],{value:x,onChange:function(e){return null==O?void 0:O(e)},defaultValue:w,postState:E}),P=(0,s.Z)(_,2),N=P[0],T=P[1];(0,d.ZP)(!g,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var A=(n={prefixCls:a,accordion:p,openMotion:y,expandIcon:b,collapsible:v,destroyInactivePanel:void 0!==c&&c,onItemClick:function(e){return T(function(){return p?N[0]===e?[]:[e]:N.indexOf(e)>-1?N.filter(function(t){return t!==e}):[].concat((0,l.Z)(N),[e])})},activeKey:N},Array.isArray(C)?k(C,n):(0,h.Z)(g).map(function(e,t){return S(e,t,n)}));return r.createElement("div",{ref:t,className:j,style:f,role:p?"tablist":void 0},A)}),{Panel:x});O.Panel;var C=n(18694),j=n(68710),_=n(19722),P=n(71744),N=n(33759);let T=r.forwardRef((e,t)=>{let{getPrefixCls:n}=r.useContext(P.E_),{prefixCls:o,className:a,showArrow:l=!0}=e,s=n("collapse",o),c=i()({["".concat(s,"-no-arrow")]:!l},a);return r.createElement(O.Panel,Object.assign({ref:t},e,{prefixCls:s,className:c}))});var A=n(352),M=n(12918),I=n(63074),R=n(80669),D=n(3104);let L=e=>{let{componentCls:t,contentBg:n,padding:r,headerBg:o,headerPadding:a,collapseHeaderPaddingSM:i,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:s,lineWidth:c,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:h,fontSizeLG:m,lineHeight:g,lineHeightLG:v,marginSM:y,paddingSM:b,paddingLG:x,paddingXS:w,motionDurationSlow:k,fontSizeIcon:S,contentPadding:E,fontHeight:O,fontHeightLG:C}=e,j="".concat((0,A.bf)(c)," ").concat(u," ").concat(d);return{[t]:Object.assign(Object.assign({},(0,M.Wf)(e)),{backgroundColor:o,border:j,borderBottom:0,borderRadius:s,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:j,"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["> ".concat(t,"-header")]:{position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:a,color:p,lineHeight:g,cursor:"pointer",transition:"all ".concat(k,", visibility 0s"),["> ".concat(t,"-header-text")]:{flex:"auto"},"&:focus":{outline:"none"},["".concat(t,"-expand-icon")]:{height:O,display:"flex",alignItems:"center",paddingInlineEnd:y},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,M.Ro)()),{fontSize:S,svg:{transition:"transform ".concat(k)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}},["".concat(t,"-icon-collapsible-only")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:f,backgroundColor:n,borderTop:j,["& > ".concat(t,"-content-box")]:{padding:E},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:i,paddingInlineStart:w,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(b).sub(w).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:b}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:m,lineHeight:v,["> ".concat(t,"-header")]:{padding:l,paddingInlineStart:r,["> ".concat(t,"-expand-icon")]:{height:C,marginInlineStart:e.calc(x).sub(r).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:x}}},["".concat(t,"-item:last-child")]:{["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:h,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:y}}}}})}},Z=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow svg");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},z=e=>{let{componentCls:t,headerBg:n,paddingXXS:r,colorBorder:o}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(o)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:"transparent",borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{paddingTop:r}}}},B=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var F=(0,R.I$)("Collapse",e=>{let t=(0,D.TS)(e,{collapseHeaderPaddingSM:"".concat((0,A.bf)(e.paddingXS)," ").concat((0,A.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,A.bf)(e.padding)," ").concat((0,A.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[L(t),z(t),B(t),Z(t),(0,I.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer})),H=Object.assign(r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a,collapse:l}=r.useContext(P.E_),{prefixCls:s,className:c,rootClassName:u,style:d,bordered:f=!0,ghost:p,size:m,expandIconPosition:g="start",children:v,expandIcon:y}=e,b=(0,N.Z)(e=>{var t;return null!==(t=null!=m?m:e)&&void 0!==t?t:"middle"}),x=n("collapse",s),w=n(),[k,S,E]=F(x),T=r.useMemo(()=>"left"===g?"start":"right"===g?"end":g,[g]),A=i()("".concat(x,"-icon-position-").concat(T),{["".concat(x,"-borderless")]:!f,["".concat(x,"-rtl")]:"rtl"===a,["".concat(x,"-ghost")]:!!p,["".concat(x,"-").concat(b)]:"middle"!==b},null==l?void 0:l.className,c,u,S,E),M=Object.assign(Object.assign({},(0,j.Z)(w)),{motionAppear:!1,leavedClassName:"".concat(x,"-content-hidden")}),I=r.useMemo(()=>v?(0,h.Z)(v).map((e,t)=>{var n,r;if(null===(n=e.props)||void 0===n?void 0:n.disabled){let n=null!==(r=e.key)&&void 0!==r?r:String(t),{disabled:o,collapsible:a}=e.props,i=Object.assign(Object.assign({},(0,C.Z)(e.props,["disabled"])),{key:n,collapsible:null!=a?a:o?"disabled":void 0});return(0,_.Tm)(e,i)}return e}):null,[v]);return k(r.createElement(O,Object.assign({ref:t,openMotion:M},(0,C.Z)(e,["rootClassName"]),{expandIcon:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=y?y(e):r.createElement(o.Z,{rotate:e.isActive?90:void 0});return(0,_.Tm)(t,()=>({className:i()(t.props.className,"".concat(x,"-arrow"))}))},prefixCls:x,className:A,style:Object.assign(Object.assign({},null==l?void 0:l.style),d)}),I))}),{Panel:T})},23496:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),l=n(352),s=n(12918),c=n(80669),u=n(3104);let d=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:o,textPaddingInline:a,orientationMargin:i,verticalMarginInline:c}=e;return{[t]:Object.assign(Object.assign({},(0,s.Wf)(e)),{borderBlockStart:"".concat((0,l.bf)(o)," solid ").concat(r),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:c,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat((0,l.bf)(o)," solid ").concat(r)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat((0,l.bf)(e.dividerHorizontalGutterMargin)," 0")},["&-horizontal".concat(t,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat((0,l.bf)(e.dividerHorizontalWithTextGutterMargin)," 0"),color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(r),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat((0,l.bf)(o)," solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(t,"-with-text-left")]:{"&::before":{width:"calc(".concat(i," * 100%)")},"&::after":{width:"calc(100% - ".concat(i," * 100%)")}},["&-horizontal".concat(t,"-with-text-right")]:{"&::before":{width:"calc(100% - ".concat(i," * 100%)")},"&::after":{width:"calc(".concat(i," * 100%)")}},["".concat(t,"-inner-text")]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:"".concat((0,l.bf)(o)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(t,"-dashed")]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(t,"-with-text")]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},["&-horizontal".concat(t,"-with-text-left").concat(t,"-no-default-orientation-margin-left")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(t,"-inner-text")]:{paddingInlineStart:n}},["&-horizontal".concat(t,"-with-text-right").concat(t,"-no-default-orientation-margin-right")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(t,"-inner-text")]:{paddingInlineEnd:n}}})}};var f=(0,c.I$)("Divider",e=>[d((0,u.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0}))],e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},h=e=>{let{getPrefixCls:t,direction:n,divider:o}=r.useContext(i.E_),{prefixCls:l,type:s="horizontal",orientation:c="center",orientationMargin:u,className:d,rootClassName:h,children:m,dashed:g,plain:v,style:y}=e,b=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),x=t("divider",l),[w,k,S]=f(x),E=c.length>0?"-".concat(c):c,O=!!m,C="left"===c&&null!=u,j="right"===c&&null!=u,_=a()(x,null==o?void 0:o.className,k,S,"".concat(x,"-").concat(s),{["".concat(x,"-with-text")]:O,["".concat(x,"-with-text").concat(E)]:O,["".concat(x,"-dashed")]:!!g,["".concat(x,"-plain")]:!!v,["".concat(x,"-rtl")]:"rtl"===n,["".concat(x,"-no-default-orientation-margin-left")]:C,["".concat(x,"-no-default-orientation-margin-right")]:j},d,h),P=r.useMemo(()=>"number"==typeof u?u:/^\d+$/.test(u)?Number(u):u,[u]),N=Object.assign(Object.assign({},C&&{marginLeft:P}),j&&{marginRight:P});return w(r.createElement("div",Object.assign({className:_,style:Object.assign(Object.assign({},null==o?void 0:o.style),y)},b,{role:"separator"}),m&&"vertical"!==s&&r.createElement("span",{className:"".concat(x,"-inner-text"),style:N},m)))}},20577:function(e,t,n){"use strict";n.d(t,{Z:function(){return em}});var r=n(2265),o=n(70464),a=n(1119),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},l=n(55015),s=r.forwardRef(function(e,t){return r.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:i}))}),c=n(36760),u=n.n(c),d=n(11993),f=n(41154),p=n(26365),h=n(6989),m=n(76405),g=n(25049);function v(){return"function"==typeof BigInt}function y(e){return!e&&0!==e&&!Number.isNaN(e)||!String(e).trim()}function b(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var r=t||"0",o=r.split("."),a=o[0]||"0",i=o[1]||"0";"0"===a&&"0"===i&&(n=!1);var l=n?"-":"";return{negative:n,negativeStr:l,trimStr:r,integerStr:a,decimalStr:i,fullStr:"".concat(l).concat(r)}}function x(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function w(e){var t=String(e);if(x(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&S(t)?t.length-t.indexOf(".")-1:0}function k(e){var t=String(e);if(x(e)){if(e>Number.MAX_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);t=e.toFixed(w(t))}return b(t).fullStr}function S(e){return"number"==typeof e?!Number.isNaN(e):!!e&&(/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e))}var E=function(){function e(t){if((0,m.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"negative",void 0),(0,d.Z)(this,"integer",void 0),(0,d.Z)(this,"decimal",void 0),(0,d.Z)(this,"decimalLen",void 0),(0,d.Z)(this,"empty",void 0),(0,d.Z)(this,"nan",void 0),y(t)){this.empty=!0;return}if(this.origin=String(t),"-"===t||Number.isNaN(t)){this.nan=!0;return}var n=t;if(x(n)&&(n=Number(n)),S(n="string"==typeof n?n:k(n))){var r=b(n);this.negative=r.negative;var o=r.trimStr.split(".");this.integer=BigInt(o[0]);var a=o[1]||"0";this.decimal=BigInt(a),this.decimalLen=a.length}else this.nan=!0}return(0,g.Z)(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(e){return BigInt("".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(e,"0")))}},{key:"negate",value:function(){var t=new e(this.toString());return t.negative=!t.negative,t}},{key:"cal",value:function(t,n,r){var o=Math.max(this.getDecimalStr().length,t.getDecimalStr().length),a=n(this.alignDecimal(o),t.alignDecimal(o)).toString(),i=r(o),l=b(a),s=l.negativeStr,c=l.trimStr,u="".concat(s).concat(c.padStart(i+1,"0"));return new e("".concat(u.slice(0,-i),".").concat(u.slice(-i)))}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=new e(t);return n.isInvalidate()?this:this.cal(n,function(e,t){return e+t},function(e){return e})}},{key:"multi",value:function(t){var n=new e(t);return this.isInvalidate()||n.isInvalidate()?new e(NaN):this.cal(n,function(e,t){return e*t},function(e){return 2*e})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toString()===(null==e?void 0:e.toString())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":b("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}(),O=function(){function e(t){if((0,m.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"number",void 0),(0,d.Z)(this,"empty",void 0),y(t)){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return(0,g.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(w(this.number),w(n));return new e(r.toFixed(o))}},{key:"multi",value:function(t){var n=Number(t);if(this.isInvalidate()||Number.isNaN(n))return new e(NaN);var r=this.number*n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(w(this.number),w(n));return new e(r.toFixed(o))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toNumber()===(null==e?void 0:e.toNumber())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":k(this.number):this.origin}}]),e}();function C(e){return v()?new E(e):new O(e)}function j(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var o=b(e),a=o.negativeStr,i=o.integerStr,l=o.decimalStr,s="".concat(t).concat(l),c="".concat(a).concat(i);if(n>=0){var u=Number(l[n]);return u>=5&&!r?j(C(e).add("".concat(a,"0.").concat("0".repeat(n)).concat(10-u)).toString(),t,n,r):0===n?c:"".concat(c).concat(t).concat(l.padEnd(n,"0").slice(0,n))}return".0"===s?c:"".concat(c).concat(s)}var _=n(2027),P=n(27380),N=n(28791),T=n(32559),A=n(79267),M=function(){var e=(0,r.useState)(!1),t=(0,p.Z)(e,2),n=t[0],o=t[1];return(0,P.Z)(function(){o((0,A.Z)())},[]),n},I=n(53346);function R(e){var t=e.prefixCls,n=e.upNode,o=e.downNode,i=e.upDisabled,l=e.downDisabled,s=e.onStep,c=r.useRef(),f=r.useRef([]),p=r.useRef();p.current=s;var h=function(){clearTimeout(c.current)},m=function(e,t){e.preventDefault(),h(),p.current(t),c.current=setTimeout(function e(){p.current(t),c.current=setTimeout(e,200)},600)};if(r.useEffect(function(){return function(){h(),f.current.forEach(function(e){return I.Z.cancel(e)})}},[]),M())return null;var g="".concat(t,"-handler"),v=u()(g,"".concat(g,"-up"),(0,d.Z)({},"".concat(g,"-up-disabled"),i)),y=u()(g,"".concat(g,"-down"),(0,d.Z)({},"".concat(g,"-down-disabled"),l)),b=function(){return f.current.push((0,I.Z)(h))},x={unselectable:"on",role:"button",onMouseUp:b,onMouseLeave:b};return r.createElement("div",{className:"".concat(g,"-wrap")},r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){m(e,!0)},"aria-label":"Increase Value","aria-disabled":i,className:v}),n||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){m(e,!1)},"aria-label":"Decrease Value","aria-disabled":l,className:y}),o||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function D(e){var t="number"==typeof e?k(e):b(e).fullStr;return t.includes(".")?b(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var L=n(55041),Z=function(){var e=(0,r.useRef)(0),t=function(){I.Z.cancel(e.current)};return(0,r.useEffect)(function(){return t},[]),function(n){t(),e.current=(0,I.Z)(function(){n()})}},z=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","wheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur"],B=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],F=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},H=function(e){var t=C(e);return t.isInvalidate()?null:t},q=r.forwardRef(function(e,t){var n,o,i,l=e.prefixCls,s=void 0===l?"rc-input-number":l,c=e.className,m=e.style,g=e.min,v=e.max,y=e.step,b=void 0===y?1:y,x=e.defaultValue,E=e.value,O=e.disabled,_=e.readOnly,A=e.upHandler,M=e.downHandler,I=e.keyboard,L=e.wheel,B=e.controls,q=(e.classNames,e.stringMode),W=e.parser,U=e.formatter,K=e.precision,$=e.decimalSeparator,V=e.onChange,X=e.onInput,G=e.onPressEnter,Y=e.onStep,Q=e.changeOnBlur,J=void 0===Q||Q,ee=(0,h.Z)(e,z),et="".concat(s,"-input"),en=r.useRef(null),er=r.useState(!1),eo=(0,p.Z)(er,2),ea=eo[0],ei=eo[1],el=r.useRef(!1),es=r.useRef(!1),ec=r.useRef(!1),eu=r.useState(function(){return C(null!=E?E:x)}),ed=(0,p.Z)(eu,2),ef=ed[0],ep=ed[1],eh=r.useCallback(function(e,t){return t?void 0:K>=0?K:Math.max(w(e),w(b))},[K,b]),em=r.useCallback(function(e){var t=String(e);if(W)return W(t);var n=t;return $&&(n=n.replace($,".")),n.replace(/[^\w.-]+/g,"")},[W,$]),eg=r.useRef(""),ev=r.useCallback(function(e,t){if(U)return U(e,{userTyping:t,input:String(eg.current)});var n="number"==typeof e?k(e):e;if(!t){var r=eh(n,t);S(n)&&($||r>=0)&&(n=j(n,$||".",r))}return n},[U,eh,$]),ey=r.useState(function(){var e=null!=x?x:E;return ef.isInvalidate()&&["string","number"].includes((0,f.Z)(e))?Number.isNaN(e)?"":e:ev(ef.toString(),!1)}),eb=(0,p.Z)(ey,2),ex=eb[0],ew=eb[1];function ek(e,t){ew(ev(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}eg.current=ex;var eS=r.useMemo(function(){return H(v)},[v,K]),eE=r.useMemo(function(){return H(g)},[g,K]),eO=r.useMemo(function(){return!(!eS||!ef||ef.isInvalidate())&&eS.lessEquals(ef)},[eS,ef]),eC=r.useMemo(function(){return!(!eE||!ef||ef.isInvalidate())&&ef.lessEquals(eE)},[eE,ef]),ej=(n=en.current,o=(0,r.useRef)(null),[function(){try{var e=n.selectionStart,t=n.selectionEnd,r=n.value,a=r.substring(0,e),i=r.substring(t);o.current={start:e,end:t,value:r,beforeTxt:a,afterTxt:i}}catch(e){}},function(){if(n&&o.current&&ea)try{var e=n.value,t=o.current,r=t.beforeTxt,a=t.afterTxt,i=t.start,l=e.length;if(e.endsWith(a))l=e.length-o.current.afterTxt.length;else if(e.startsWith(r))l=r.length;else{var s=r[i-1],c=e.indexOf(s,i-1);-1!==c&&(l=c+1)}n.setSelectionRange(l,l)}catch(e){(0,T.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),e_=(0,p.Z)(ej,2),eP=e_[0],eN=e_[1],eT=function(e){return eS&&!e.lessEquals(eS)?eS:eE&&!eE.lessEquals(e)?eE:null},eA=function(e){return!eT(e)},eM=function(e,t){var n=e,r=eA(n)||n.isEmpty();if(n.isEmpty()||t||(n=eT(n)||n,r=!0),!_&&!O&&r){var o,a=n.toString(),i=eh(a,t);return i>=0&&!eA(n=C(j(a,".",i)))&&(n=C(j(a,".",i,!0))),n.equals(ef)||(o=n,void 0===E&&ep(o),null==V||V(n.isEmpty()?null:F(q,n)),void 0===E&&ek(n,t)),n}return ef},eI=Z(),eR=function e(t){if(eP(),eg.current=t,ew(t),!es.current){var n=C(em(t));n.isNaN()||eM(n,!0)}null==X||X(t),eI(function(){var n=t;W||(n=t.replace(/。/g,".")),n!==t&&e(n)})},eD=function(e){if((!e||!eO)&&(e||!eC)){el.current=!1;var t,n=C(ec.current?D(b):b);e||(n=n.negate());var r=eM((ef||C(0)).add(n.toString()),!1);null==Y||Y(F(q,r),{offset:ec.current?D(b):b,type:e?"up":"down"}),null===(t=en.current)||void 0===t||t.focus()}},eL=function(e){var t=C(em(ex)),n=t;n=t.isNaN()?eM(ef,e):eM(t,e),void 0!==E?ek(ef,!1):n.isNaN()||ek(n,!1)};return r.useEffect(function(){var e=function(e){!1!==L&&(eD(e.deltaY<0),e.preventDefault())},t=en.current;if(t)return t.addEventListener("wheel",e),function(){return t.removeEventListener("wheel",e)}},[eD]),(0,P.o)(function(){ef.isInvalidate()||ek(ef,!1)},[K,U]),(0,P.o)(function(){var e=C(E);ep(e);var t=C(em(ex));e.equals(t)&&el.current&&!U||ek(e,el.current)},[E]),(0,P.o)(function(){U&&eN()},[ex]),r.createElement("div",{className:u()(s,c,(i={},(0,d.Z)(i,"".concat(s,"-focused"),ea),(0,d.Z)(i,"".concat(s,"-disabled"),O),(0,d.Z)(i,"".concat(s,"-readonly"),_),(0,d.Z)(i,"".concat(s,"-not-a-number"),ef.isNaN()),(0,d.Z)(i,"".concat(s,"-out-of-range"),!ef.isInvalidate()&&!eA(ef)),i)),style:m,onFocus:function(){ei(!0)},onBlur:function(){J&&eL(!1),ei(!1),el.current=!1},onKeyDown:function(e){var t=e.key,n=e.shiftKey;el.current=!0,ec.current=n,"Enter"===t&&(es.current||(el.current=!1),eL(!1),null==G||G(e)),!1!==I&&!es.current&&["Up","ArrowUp","Down","ArrowDown"].includes(t)&&(eD("Up"===t||"ArrowUp"===t),e.preventDefault())},onKeyUp:function(){el.current=!1,ec.current=!1},onCompositionStart:function(){es.current=!0},onCompositionEnd:function(){es.current=!1,eR(en.current.value)},onBeforeInput:function(){el.current=!0}},(void 0===B||B)&&r.createElement(R,{prefixCls:s,upNode:A,downNode:M,upDisabled:eO,downDisabled:eC,onStep:eD}),r.createElement("div",{className:"".concat(et,"-wrap")},r.createElement("input",(0,a.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":g,"aria-valuemax":v,"aria-valuenow":ef.isInvalidate()?null:ef.toString(),step:b},ee,{ref:(0,N.sQ)(en,t),className:et,value:ex,onChange:function(e){eR(e.target.value)},disabled:O,readOnly:_}))))}),W=r.forwardRef(function(e,t){var n=e.disabled,o=e.style,i=e.prefixCls,l=e.value,s=e.prefix,c=e.suffix,u=e.addonBefore,d=e.addonAfter,f=e.className,p=e.classNames,m=(0,h.Z)(e,B),g=r.useRef(null);return r.createElement(_.Q,{className:f,triggerFocus:function(e){g.current&&(0,L.nH)(g.current,e)},prefixCls:i,value:l,disabled:n,style:o,prefix:s,suffix:c,addonAfter:d,addonBefore:u,classNames:p,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}},r.createElement(q,(0,a.Z)({prefixCls:i,disabled:n,ref:(0,N.sQ)(g,t),className:null==p?void 0:p.input},m)))});W.displayName="InputNumber";var U=n(12757),K=n(71744),$=n(13959),V=n(86586),X=n(64024),G=n(33759),Y=n(39109),Q=n(56250),J=n(65658),ee=n(352),et=n(31282),en=n(37433),er=n(65265),eo=n(12918),ea=n(17691),ei=n(80669),el=n(3104),es=n(36360);let ec=(e,t)=>{let{componentCls:n,borderRadiusSM:r,borderRadiusLG:o}=e,a="lg"===t?o:r;return{["&-".concat(t)]:{["".concat(n,"-handler-wrap")]:{borderStartEndRadius:a,borderEndEndRadius:a},["".concat(n,"-handler-up")]:{borderStartEndRadius:a},["".concat(n,"-handler-down")]:{borderEndEndRadius:a}}}},eu=e=>{let{componentCls:t,lineWidth:n,lineType:r,borderRadius:o,fontSizeLG:a,controlHeightLG:i,controlHeightSM:l,colorError:s,paddingInlineSM:c,paddingBlockSM:u,paddingBlockLG:d,paddingInlineLG:f,colorTextDescription:p,motionDurationMid:h,handleHoverColor:m,paddingInline:g,paddingBlock:v,handleBg:y,handleActiveBg:b,colorTextDisabled:x,borderRadiusSM:w,borderRadiusLG:k,controlWidth:S,handleOpacity:E,handleBorderColor:O,filledHandleBg:C,lineHeightLG:j,calc:_}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.ik)(e)),{display:"inline-block",width:S,margin:0,padding:0,borderRadius:o}),(0,er.qG)(e,{["".concat(t,"-handler-wrap")]:{background:y,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O)}}})),(0,er.H8)(e,{["".concat(t,"-handler-wrap")]:{background:C,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O)}},"&:focus-within":{["".concat(t,"-handler-wrap")]:{background:y}}})),(0,er.Mu)(e)),{"&-rtl":{direction:"rtl",["".concat(t,"-input")]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:a,lineHeight:j,borderRadius:k,["input".concat(t,"-input")]:{height:_(i).sub(_(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(d)," ").concat((0,ee.bf)(f))}},"&-sm":{padding:0,borderRadius:w,["input".concat(t,"-input")]:{height:_(l).sub(_(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(u)," ").concat((0,ee.bf)(c))}},"&-out-of-range":{["".concat(t,"-input-wrap")]:{input:{color:s}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.s7)(e)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",["".concat(t,"-affix-wrapper")]:{width:"100%"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:k,fontSize:e.fontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:w}}},(0,er.ir)(e)),(0,er.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),["&-disabled ".concat(t,"-input")]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),{width:"100%",padding:"".concat((0,ee.bf)(v)," ").concat((0,ee.bf)(g)),textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:"all ".concat(h," linear"),appearance:"textfield",fontSize:"inherit"}),(0,et.nz)(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[t]:Object.assign(Object.assign(Object.assign({["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{opacity:1},["".concat(t,"-handler-wrap")]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:"100%",borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:E,display:"flex",flexDirection:"column",alignItems:"stretch",transition:"opacity ".concat(h," linear ").concat(h),["".concat(t,"-handler")]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},["".concat(t,"-handler")]:{height:"50%",overflow:"hidden",color:p,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O),transition:"all ".concat(h," linear"),"&:active":{background:b},"&:hover":{height:"60%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{color:m}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,eo.Ro)()),{color:p,transition:"all ".concat(h," linear"),userSelect:"none"})},["".concat(t,"-handler-up")]:{borderStartEndRadius:o},["".concat(t,"-handler-down")]:{borderEndEndRadius:o}},ec(e,"lg")),ec(e,"sm")),{"&-disabled, &-readonly":{["".concat(t,"-handler-wrap")]:{display:"none"},["".concat(t,"-input")]:{color:"inherit"}},["\n ".concat(t,"-handler-up-disabled,\n ").concat(t,"-handler-down-disabled\n ")]:{cursor:"not-allowed"},["\n ".concat(t,"-handler-up-disabled:hover &-handler-up-inner,\n ").concat(t,"-handler-down-disabled:hover &-handler-down-inner\n ")]:{color:x}})}]},ed=e=>{let{componentCls:t,paddingBlock:n,paddingInline:r,inputAffixPadding:o,controlWidth:a,borderRadiusLG:i,borderRadiusSM:l,paddingInlineLG:s,paddingInlineSM:c,paddingBlockLG:u,paddingBlockSM:d}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign({["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(n)," 0")}},(0,et.ik)(e)),{position:"relative",display:"inline-flex",width:a,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:i,paddingInlineStart:s,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(u)," 0")}},"&-sm":{borderRadius:l,paddingInlineStart:c,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(d)," 0")}},["&:not(".concat(t,"-disabled):hover")]:{zIndex:1},"&-focused, &:focus":{zIndex:1},["&-disabled > ".concat(t,"-disabled")]:{background:"transparent"},["> div".concat(t)]:{width:"100%",border:"none",outline:"none",["&".concat(t,"-focused")]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t,"-handler-wrap")]:{zIndex:2},[t]:{color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:r,marginInlineStart:o}}})}};var ef=(0,ei.I$)("InputNumber",e=>{let t=(0,el.TS)(e,(0,en.e)(e));return[eu(t),ed(t),(0,ea.c)(t)]},e=>{var t;let n=null!==(t=e.handleVisible)&&void 0!==t?t:"auto";return Object.assign(Object.assign({},(0,en.T)(e)),{controlWidth:90,handleWidth:e.controlHeightSM-2*e.lineWidth,handleFontSize:e.fontSize/2,handleVisible:n,handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,filledHandleBg:new es.C(e.colorFillSecondary).onBackground(e.colorBgContainer).toHexString(),handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder,handleOpacity:!0===n?1:0})},{unitless:{handleOpacity:!0}}),ep=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eh=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a}=r.useContext(K.E_),i=r.useRef(null);r.useImperativeHandle(t,()=>i.current);let{className:l,rootClassName:c,size:d,disabled:f,prefixCls:p,addonBefore:h,addonAfter:m,prefix:g,bordered:v,readOnly:y,status:b,controls:x,variant:w}=e,k=ep(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls","variant"]),S=n("input-number",p),E=(0,X.Z)(S),[O,C,j]=ef(S,E),{compactSize:_,compactItemClassnames:P}=(0,J.ri)(S,a),N=r.createElement(s,{className:"".concat(S,"-handler-up-inner")}),T=r.createElement(o.Z,{className:"".concat(S,"-handler-down-inner")});"object"==typeof x&&(N=void 0===x.upIcon?N:r.createElement("span",{className:"".concat(S,"-handler-up-inner")},x.upIcon),T=void 0===x.downIcon?T:r.createElement("span",{className:"".concat(S,"-handler-down-inner")},x.downIcon));let{hasFeedback:A,status:M,isFormItemInput:I,feedbackIcon:R}=r.useContext(Y.aM),D=(0,U.F)(M,b),L=(0,G.Z)(e=>{var t;return null!==(t=null!=d?d:_)&&void 0!==t?t:e}),Z=r.useContext(V.Z),[z,B]=(0,Q.Z)(w,v),F=A&&r.createElement(r.Fragment,null,R),H=u()({["".concat(S,"-lg")]:"large"===L,["".concat(S,"-sm")]:"small"===L,["".concat(S,"-rtl")]:"rtl"===a,["".concat(S,"-in-form-item")]:I},C),q="".concat(S,"-group");return O(r.createElement(W,Object.assign({ref:i,disabled:null!=f?f:Z,className:u()(j,E,l,c,P),upHandler:N,downHandler:T,prefixCls:S,readOnly:y,controls:"boolean"==typeof x?x:void 0,prefix:g,suffix:F,addonAfter:m&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},m)),addonBefore:h&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},h)),classNames:{input:H,variant:u()({["".concat(S,"-").concat(z)]:B},(0,U.Z)(S,D,A)),affixWrapper:u()({["".concat(S,"-affix-wrapper-sm")]:"small"===L,["".concat(S,"-affix-wrapper-lg")]:"large"===L,["".concat(S,"-affix-wrapper-rtl")]:"rtl"===a},C),wrapper:u()({["".concat(q,"-rtl")]:"rtl"===a},C),groupWrapper:u()({["".concat(S,"-group-wrapper-sm")]:"small"===L,["".concat(S,"-group-wrapper-lg")]:"large"===L,["".concat(S,"-group-wrapper-rtl")]:"rtl"===a,["".concat(S,"-group-wrapper-").concat(z)]:B},(0,U.Z)("".concat(S,"-group-wrapper"),D,A),C)}},k)))});eh._InternalPanelDoNotUseOrYouWillBeFired=e=>r.createElement($.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},r.createElement(eh,Object.assign({},e)));var em=eh},65863:function(e,t,n){"use strict";n.d(t,{Z:function(){return k},n:function(){return w}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2027),l=n(28791),s=n(12757),c=n(71744),u=n(86586),d=n(33759),f=n(39109),p=n(65658),h=n(39164),m=n(31282),g=n(64024),v=n(56250),y=n(39725),b=e=>{let t;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?t=e:e&&(t={clearIcon:r.createElement(y.Z,null)}),t},x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function w(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n){let t=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var k=(0,r.forwardRef)((e,t)=>{var n;let{prefixCls:o,bordered:y=!0,status:w,size:k,disabled:S,onBlur:E,onFocus:O,suffix:C,allowClear:j,addonAfter:_,addonBefore:P,className:N,style:T,styles:A,rootClassName:M,onChange:I,classNames:R,variant:D}=e,L=x(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:Z,direction:z,input:B}=r.useContext(c.E_),F=Z("input",o),H=(0,r.useRef)(null),q=(0,g.Z)(F),[W,U,K]=(0,m.ZP)(F,q),{compactSize:$,compactItemClassnames:V}=(0,p.ri)(F,z),X=(0,d.Z)(e=>{var t;return null!==(t=null!=k?k:$)&&void 0!==t?t:e}),G=r.useContext(u.Z),{status:Y,hasFeedback:Q,feedbackIcon:J}=(0,r.useContext)(f.aM),ee=(0,s.F)(Y,w),et=!!(e.prefix||e.suffix||e.allowClear||e.showCount)||!!Q;(0,r.useRef)(et);let en=(0,h.Z)(H,!0),er=(Q||C)&&r.createElement(r.Fragment,null,C,Q&&J),eo=b(j),[ea,ei]=(0,v.Z)(D,y);return W(r.createElement(i.Z,Object.assign({ref:(0,l.sQ)(t,H),prefixCls:F,autoComplete:null==B?void 0:B.autoComplete},L,{disabled:null!=S?S:G,onBlur:e=>{en(),null==E||E(e)},onFocus:e=>{en(),null==O||O(e)},style:Object.assign(Object.assign({},null==B?void 0:B.style),T),styles:Object.assign(Object.assign({},null==B?void 0:B.styles),A),suffix:er,allowClear:eo,className:a()(N,M,K,q,V,null==B?void 0:B.className),onChange:e=>{en(),null==I||I(e)},addonAfter:_&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},_)),addonBefore:P&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},P)),classNames:Object.assign(Object.assign(Object.assign({},R),null==B?void 0:B.classNames),{input:a()({["".concat(F,"-sm")]:"small"===X,["".concat(F,"-lg")]:"large"===X,["".concat(F,"-rtl")]:"rtl"===z},null==R?void 0:R.input,null===(n=null==B?void 0:B.classNames)||void 0===n?void 0:n.input,U),variant:a()({["".concat(F,"-").concat(ea)]:ei},(0,s.Z)(F,ee)),affixWrapper:a()({["".concat(F,"-affix-wrapper-sm")]:"small"===X,["".concat(F,"-affix-wrapper-lg")]:"large"===X,["".concat(F,"-affix-wrapper-rtl")]:"rtl"===z},U),wrapper:a()({["".concat(F,"-group-rtl")]:"rtl"===z},U),groupWrapper:a()({["".concat(F,"-group-wrapper-sm")]:"small"===X,["".concat(F,"-group-wrapper-lg")]:"large"===X,["".concat(F,"-group-wrapper-rtl")]:"rtl"===z,["".concat(F,"-group-wrapper-").concat(ea)]:ei},(0,s.Z)("".concat(F,"-group-wrapper"),ee,Q),U)})})))})},90464:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r,o=n(2265),a=n(39725),i=n(36760),l=n.n(i),s=n(1119),c=n(11993),u=n(31686),d=n(83145),f=n(26365),p=n(6989),h=n(2027),m=n(96032),g=n(55041),v=n(50506),y=n(41154),b=n(31474),x=n(27380),w=n(53346),k=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],S={},E=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],O=o.forwardRef(function(e,t){var n=e.prefixCls,a=(e.onPressEnter,e.defaultValue),i=e.value,d=e.autoSize,h=e.onResize,m=e.className,g=e.style,O=e.disabled,C=e.onChange,j=(e.onInternalAutoSize,(0,p.Z)(e,E)),_=(0,v.Z)(a,{value:i,postState:function(e){return null!=e?e:""}}),P=(0,f.Z)(_,2),N=P[0],T=P[1],A=o.useRef();o.useImperativeHandle(t,function(){return{textArea:A.current}});var M=o.useMemo(function(){return d&&"object"===(0,y.Z)(d)?[d.minRows,d.maxRows]:[]},[d]),I=(0,f.Z)(M,2),R=I[0],D=I[1],L=!!d,Z=function(){try{if(document.activeElement===A.current){var e=A.current,t=e.selectionStart,n=e.selectionEnd,r=e.scrollTop;A.current.setSelectionRange(t,n),A.current.scrollTop=r}}catch(e){}},z=o.useState(2),B=(0,f.Z)(z,2),F=B[0],H=B[1],q=o.useState(),W=(0,f.Z)(q,2),U=W[0],K=W[1],$=function(){H(0)};(0,x.Z)(function(){L&&$()},[i,R,D,L]),(0,x.Z)(function(){if(0===F)H(1);else if(1===F){var e=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&S[n])return S[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),i=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l={sizingStyle:k.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),paddingSize:a,borderSize:i,boxSizing:o};return t&&n&&(S[n]=l),l}(e,n),l=i.paddingSize,s=i.borderSize,c=i.boxSizing,u=i.sizingStyle;r.setAttribute("style","".concat(u,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=e.value||e.placeholder||"";var d=void 0,f=void 0,p=r.scrollHeight;if("border-box"===c?p+=s:"content-box"===c&&(p-=l),null!==o||null!==a){r.value=" ";var h=r.scrollHeight-l;null!==o&&(d=h*o,"border-box"===c&&(d=d+l+s),p=Math.max(d,p)),null!==a&&(f=h*a,"border-box"===c&&(f=f+l+s),t=p>f?"":"hidden",p=Math.min(f,p))}var m={height:p,overflowY:t,resize:"none"};return d&&(m.minHeight=d),f&&(m.maxHeight=f),m}(A.current,!1,R,D);H(2),K(e)}else Z()},[F]);var V=o.useRef(),X=function(){w.Z.cancel(V.current)};o.useEffect(function(){return X},[]);var G=(0,u.Z)((0,u.Z)({},g),L?U:null);return(0===F||1===F)&&(G.overflowY="hidden",G.overflowX="hidden"),o.createElement(b.Z,{onResize:function(e){2===F&&(null==h||h(e),d&&(X(),V.current=(0,w.Z)(function(){$()})))},disabled:!(d||h)},o.createElement("textarea",(0,s.Z)({},j,{ref:A,style:G,className:l()(n,m,(0,c.Z)({},"".concat(n,"-disabled"),O)),disabled:O,value:N,onChange:function(e){T(e.target.value),null==C||C(e)}})))}),C=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],j=o.forwardRef(function(e,t){var n,r,a,i=e.defaultValue,y=e.value,b=e.onFocus,x=e.onBlur,w=e.onChange,k=e.allowClear,S=e.maxLength,E=e.onCompositionStart,j=e.onCompositionEnd,_=e.suffix,P=e.prefixCls,N=void 0===P?"rc-textarea":P,T=e.showCount,A=e.count,M=e.className,I=e.style,R=e.disabled,D=e.hidden,L=e.classNames,Z=e.styles,z=e.onResize,B=(0,p.Z)(e,C),F=(0,v.Z)(i,{value:y,defaultValue:i}),H=(0,f.Z)(F,2),q=H[0],W=H[1],U=null==q?"":String(q),K=o.useState(!1),$=(0,f.Z)(K,2),V=$[0],X=$[1],G=o.useRef(!1),Y=o.useState(null),Q=(0,f.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,o.useRef)(null),en=function(){var e;return null===(e=et.current)||void 0===e?void 0:e.textArea},er=function(){en().focus()};(0,o.useImperativeHandle)(t,function(){return{resizableTextArea:et.current,focus:er,blur:function(){en().blur()}}}),(0,o.useEffect)(function(){X(function(e){return!R&&e})},[R]);var eo=o.useState(null),ea=(0,f.Z)(eo,2),ei=ea[0],el=ea[1];o.useEffect(function(){if(ei){var e;(e=en()).setSelectionRange.apply(e,(0,d.Z)(ei))}},[ei]);var es=(0,m.Z)(A,T),ec=null!==(n=es.max)&&void 0!==n?n:S,eu=Number(ec)>0,ed=es.strategy(U),ef=!!ec&&ed>ec,ep=function(e,t){var n=t;!G.current&&es.exceedFormatter&&es.max&&es.strategy(t)>es.max&&(n=es.exceedFormatter(t,{max:es.max}),t!==n&&el([en().selectionStart||0,en().selectionEnd||0])),W(n),(0,g.rJ)(e.currentTarget,e,w,n)},eh=_;es.show&&(a=es.showFormatter?es.showFormatter({value:U,count:ed,maxLength:ec}):"".concat(ed).concat(eu?" / ".concat(ec):""),eh=o.createElement(o.Fragment,null,eh,o.createElement("span",{className:l()("".concat(N,"-data-count"),null==L?void 0:L.count),style:null==Z?void 0:Z.count},a)));var em=!B.autoSize&&!T&&!k;return o.createElement(h.Q,{value:U,allowClear:k,handleReset:function(e){W(""),er(),(0,g.rJ)(en(),e,w)},suffix:eh,prefixCls:N,classNames:(0,u.Z)((0,u.Z)({},L),{},{affixWrapper:l()(null==L?void 0:L.affixWrapper,(r={},(0,c.Z)(r,"".concat(N,"-show-count"),T),(0,c.Z)(r,"".concat(N,"-textarea-allow-clear"),k),r))}),disabled:R,focused:V,className:l()(M,ef&&"".concat(N,"-out-of-range")),style:(0,u.Z)((0,u.Z)({},I),J&&!em?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof a?a:void 0}},hidden:D},o.createElement(O,(0,s.Z)({},B,{maxLength:S,onKeyDown:function(e){var t=B.onPressEnter,n=B.onKeyDown;"Enter"===e.key&&t&&t(e),null==n||n(e)},onChange:function(e){ep(e,e.target.value)},onFocus:function(e){X(!0),null==b||b(e)},onBlur:function(e){X(!1),null==x||x(e)},onCompositionStart:function(e){G.current=!0,null==E||E(e)},onCompositionEnd:function(e){G.current=!1,ep(e,e.currentTarget.value),null==j||j(e)},className:l()(null==L?void 0:L.textarea),style:(0,u.Z)((0,u.Z)({},null==Z?void 0:Z.textarea),{},{resize:null==I?void 0:I.resize}),disabled:R,prefixCls:N,onResize:function(e){var t;null==z||z(e),null!==(t=en())&&void 0!==t&&t.style.height&&ee(!0)},ref:et})))}),_=n(12757),P=n(71744),N=n(86586),T=n(33759),A=n(39109),M=n(65863),I=n(31282),R=n(64024),D=n(56250),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Z=(0,o.forwardRef)((e,t)=>{var n;let r;let{prefixCls:i,bordered:s=!0,size:c,disabled:u,status:d,allowClear:f,classNames:p,rootClassName:h,className:m,variant:g}=e,v=L(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:y,direction:b}=o.useContext(P.E_),x=(0,T.Z)(c),w=o.useContext(N.Z),{status:k,hasFeedback:S,feedbackIcon:E}=o.useContext(A.aM),O=(0,_.F)(k,d),C=o.useRef(null);o.useImperativeHandle(t,()=>{var e;return{resizableTextArea:null===(e=C.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;(0,M.n)(null===(n=null===(t=C.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.blur()}}});let Z=y("input",i);"object"==typeof f&&(null==f?void 0:f.clearIcon)?r=f:f&&(r={clearIcon:o.createElement(a.Z,null)});let z=(0,R.Z)(Z),[B,F,H]=(0,I.ZP)(Z,z),[q,W]=(0,D.Z)(g,s);return B(o.createElement(j,Object.assign({},v,{disabled:null!=u?u:w,allowClear:r,className:l()(H,z,m,h),classNames:Object.assign(Object.assign({},p),{textarea:l()({["".concat(Z,"-sm")]:"small"===x,["".concat(Z,"-lg")]:"large"===x},F,null==p?void 0:p.textarea),variant:l()({["".concat(Z,"-").concat(q)]:W},(0,_.Z)(Z,O)),affixWrapper:l()("".concat(Z,"-textarea-affix-wrapper"),{["".concat(Z,"-affix-wrapper-rtl")]:"rtl"===b,["".concat(Z,"-affix-wrapper-sm")]:"small"===x,["".concat(Z,"-affix-wrapper-lg")]:"large"===x,["".concat(Z,"-textarea-show-count")]:e.showCount||(null===(n=e.count)||void 0===n?void 0:n.show)},F)}),prefixCls:Z,suffix:S&&o.createElement("span",{className:"".concat(Z,"-textarea-suffix")},E),ref:C})))})},39164:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e,t){let n=(0,r.useRef)([]),o=()=>{n.current.push(setTimeout(()=>{var t,n,r,o;(null===(t=e.current)||void 0===t?void 0:t.input)&&(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))==="password"&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(o=e.current)||void 0===o||o.input.removeAttribute("value"))}))};return(0,r.useEffect)(()=>(t&&o(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),o}},64482:function(e,t,n){"use strict";n.d(t,{default:function(){return _}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),l=n(39109),s=n(31282),c=n(65863),u=n(97416),d=n(6520),f=n(18694),p=n(28791),h=n(39164),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let g=e=>e?r.createElement(d.Z,null):r.createElement(u.Z,null),v={click:"onClick",hover:"onMouseOver"},y=r.forwardRef((e,t)=>{let{visibilityToggle:n=!0}=e,o="object"==typeof n&&void 0!==n.visible,[l,s]=(0,r.useState)(()=>!!o&&n.visible),u=(0,r.useRef)(null);r.useEffect(()=>{o&&s(n.visible)},[o,n]);let d=(0,h.Z)(u),y=()=>{let{disabled:t}=e;t||(l&&d(),s(e=>{var t;let r=!e;return"object"==typeof n&&(null===(t=n.onVisibleChange)||void 0===t||t.call(n,r)),r}))},{className:b,prefixCls:x,inputPrefixCls:w,size:k}=e,S=m(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:E}=r.useContext(i.E_),O=E("input",w),C=E("input-password",x),j=n&&(t=>{let{action:n="click",iconRender:o=g}=e,a=v[n]||"",i=o(l);return r.cloneElement(r.isValidElement(i)?i:r.createElement("span",null,i),{[a]:y,className:"".concat(t,"-icon"),key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}})})(C),_=a()(C,b,{["".concat(C,"-").concat(k)]:!!k}),P=Object.assign(Object.assign({},(0,f.Z)(S,["suffix","iconRender","visibilityToggle"])),{type:l?"text":"password",className:_,prefixCls:O,suffix:j});return k&&(P.size=k),r.createElement(c.Z,Object.assign({ref:(0,p.sQ)(t,u)},P))});var b=n(29436),x=n(19722),w=n(73002),k=n(33759),S=n(65658),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O=r.forwardRef((e,t)=>{let n;let{prefixCls:o,inputPrefixCls:l,className:s,size:u,suffix:d,enterButton:f=!1,addonAfter:h,loading:m,disabled:g,onSearch:v,onChange:y,onCompositionStart:O,onCompositionEnd:C}=e,j=E(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:_,direction:P}=r.useContext(i.E_),N=r.useRef(!1),T=_("input-search",o),A=_("input",l),{compactSize:M}=(0,S.ri)(T,P),I=(0,k.Z)(e=>{var t;return null!==(t=null!=u?u:M)&&void 0!==t?t:e}),R=r.useRef(null),D=e=>{var t;document.activeElement===(null===(t=R.current)||void 0===t?void 0:t.input)&&e.preventDefault()},L=e=>{var t,n;v&&v(null===(n=null===(t=R.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},Z="boolean"==typeof f?r.createElement(b.Z,null):null,z="".concat(T,"-button"),B=f||{},F=B.type&&!0===B.type.__ANT_BUTTON;n=F||"button"===B.type?(0,x.Tm)(B,Object.assign({onMouseDown:D,onClick:e=>{var t,n;null===(n=null===(t=null==B?void 0:B.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),L(e)},key:"enterButton"},F?{className:z,size:I}:{})):r.createElement(w.ZP,{className:z,type:f?"primary":void 0,size:I,disabled:g,key:"enterButton",onMouseDown:D,onClick:L,loading:m,icon:Z},f),h&&(n=[n,(0,x.Tm)(h,{key:"addonAfter"})]);let H=a()(T,{["".concat(T,"-rtl")]:"rtl"===P,["".concat(T,"-").concat(I)]:!!I,["".concat(T,"-with-button")]:!!f},s);return r.createElement(c.Z,Object.assign({ref:(0,p.sQ)(R,t),onPressEnter:e=>{N.current||m||L(e)}},j,{size:I,onCompositionStart:e=>{N.current=!0,null==O||O(e)},onCompositionEnd:e=>{N.current=!1,null==C||C(e)},prefixCls:A,addonAfter:n,suffix:d,onChange:e=>{e&&e.target&&"click"===e.type&&v&&v(e.target.value,e,{source:"clear"}),y&&y(e)},className:H,disabled:g}))});var C=n(90464);let j=c.Z;j.Group=e=>{let{getPrefixCls:t,direction:n}=(0,r.useContext)(i.E_),{prefixCls:o,className:c}=e,u=t("input-group",o),d=t("input"),[f,p]=(0,s.ZP)(d),h=a()(u,{["".concat(u,"-lg")]:"large"===e.size,["".concat(u,"-sm")]:"small"===e.size,["".concat(u,"-compact")]:e.compact,["".concat(u,"-rtl")]:"rtl"===n},p,c),m=(0,r.useContext)(l.aM),g=(0,r.useMemo)(()=>Object.assign(Object.assign({},m),{isFormItemInput:!1}),[m]);return f(r.createElement("span",{className:h,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},r.createElement(l.aM.Provider,{value:g},e.children)))},j.Search=O,j.TextArea=C.Z,j.Password=y;var _=j},31282:function(e,t,n){"use strict";n.d(t,{ik:function(){return p},nz:function(){return u},s7:function(){return h},x0:function(){return f}});var r=n(352),o=n(12918),a=n(17691),i=n(80669),l=n(3104),s=n(37433),c=n(65265);let u=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=e=>{let{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:a}=e;return{padding:"".concat((0,r.bf)(t)," ").concat((0,r.bf)(a)),fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:o}},f=e=>({padding:"".concat((0,r.bf)(e.paddingBlockSM)," ").concat((0,r.bf)(e.paddingInlineSM)),fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),p=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:"".concat((0,r.bf)(e.paddingBlock)," ").concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationMid)},u(e.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:"all ".concat(e.motionDurationSlow,", height 0s"),resize:"vertical"},"&-lg":Object.assign({},d(e)),"&-sm":Object.assign({},f(e)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),h=e=>{let{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},["&-lg ".concat(t,", &-lg > ").concat(t,"-group-addon")]:Object.assign({},d(e)),["&-sm ".concat(t,", &-sm > ").concat(t,"-group-addon")]:Object.assign({},f(e)),["&-lg ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightLG},["&-sm ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightSM},["> ".concat(t)]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},["".concat(t,"-group")]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:"0 ".concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationSlow),lineHeight:1,["".concat(n,"-select")]:{margin:"".concat((0,r.bf)(e.calc(e.paddingBlock).add(1).mul(-1).equal())," ").concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),["&".concat(n,"-select-single:not(").concat(n,"-select-customize-input):not(").concat(n,"-pagination-size-changer)")]:{["".concat(n,"-select-selector")]:{backgroundColor:"inherit",border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),boxShadow:"none"}},"&-open, &-focused":{["".concat(n,"-select-selector")]:{color:e.colorPrimary}}},["".concat(n,"-cascader-picker")]:{margin:"-9px ".concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),backgroundColor:"transparent",["".concat(n,"-cascader-input")]:{textAlign:"start",border:0,boxShadow:"none"}}}},["".concat(t)]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,["".concat(t,"-search-with-button &")]:{zIndex:0}}},["> ".concat(t,":first-child, ").concat(t,"-group-addon:first-child")]:{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,"-affix-wrapper")]:{["&:not(:first-child) ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0},["&:not(:last-child) ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,":last-child, ").concat(t,"-group-addon:last-child")]:{borderStartStartRadius:0,borderEndStartRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["".concat(t,"-affix-wrapper")]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(t,"-search &")]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},["&:not(:first-child), ".concat(t,"-search &:not(:first-child)")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&".concat(t,"-group-compact")]:Object.assign(Object.assign({display:"block"},(0,o.dF)()),{["".concat(t,"-group-addon, ").concat(t,"-group-wrap, > ").concat(t)]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},["\n & > ".concat(t,"-affix-wrapper,\n & > ").concat(t,"-number-affix-wrapper,\n & > ").concat(n,"-picker-range\n ")]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},["".concat(t)]:{float:"none"},["& > ".concat(n,"-select > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete ").concat(t,",\n & > ").concat(n,"-cascader-picker ").concat(t,",\n & > ").concat(t,"-group-wrapper ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},["& > ".concat(n,"-select-focused")]:{zIndex:1},["& > ".concat(n,"-select > ").concat(n,"-select-arrow")]:{zIndex:1},["& > *:first-child,\n & > ".concat(n,"-select:first-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete:first-child ").concat(t,",\n & > ").concat(n,"-cascader-picker:first-child ").concat(t)]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},["& > *:last-child,\n & > ".concat(n,"-select:last-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-cascader-picker:last-child ").concat(t,",\n & > ").concat(n,"-cascader-picker-focused:last-child ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},["& > ".concat(n,"-select-auto-complete ").concat(t)]:{verticalAlign:"top"},["".concat(t,"-group-wrapper + ").concat(t,"-group-wrapper")]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),["".concat(t,"-affix-wrapper")]:{borderRadius:0}},["".concat(t,"-group-wrapper:not(:last-child)")]:{["&".concat(t,"-search > ").concat(t,"-group")]:{["& > ".concat(t,"-group-addon > ").concat(t,"-search-button")]:{borderRadius:0},["& > ".concat(t)]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},m=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:a}=e,i=a(n).sub(a(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),p(e)),(0,c.qG)(e)),(0,c.H8)(e)),(0,c.Mu)(e)),{'&[type="color"]':{height:e.controlHeight,["&".concat(t,"-lg")]:{height:e.controlHeightLG},["&".concat(t,"-sm")]:{height:n,paddingTop:i,paddingBottom:i}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},g=e=>{let{componentCls:t}=e;return{["".concat(t,"-clear-icon")]:{margin:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextTertiary},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:"0 ".concat((0,r.bf)(e.inputAffixPadding))}}}},v=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:a,colorIconHover:i,iconCls:l}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign(Object.assign(Object.assign({},p(e)),{display:"inline-flex",["&:not(".concat(t,"-disabled):hover")]:{zIndex:1,["".concat(t,"-search-with-button &")]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},["> input".concat(t)]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t)]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),g(e)),{["".concat(l).concat(t,"-password-icon")]:{color:a,cursor:"pointer",transition:"all ".concat(o),"&:hover":{color:i}}})}},y=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{["".concat(t,"-group")]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),h(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:r}}},(0,c.ir)(e)),(0,c.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},b=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-search");return{[r]:{["".concat(t)]:{"&:hover, &:focus":{borderColor:e.colorPrimaryHover,["+ ".concat(t,"-group-addon ").concat(r,"-button:not(").concat(n,"-btn-primary)")]:{borderInlineStartColor:e.colorPrimaryHover}}},["".concat(t,"-affix-wrapper")]:{borderRadius:0},["".concat(t,"-lg")]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal({unit:!1})},["> ".concat(t,"-group")]:{["> ".concat(t,"-group-addon:last-child")]:{insetInlineStart:-1,padding:0,border:0,["".concat(r,"-button")]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius,borderEndStartRadius:0,boxShadow:"none"},["".concat(r,"-button:not(").concat(n,"-btn-primary)")]:{color:e.colorTextDescription,"&:hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},["&".concat(n,"-btn-loading::before")]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},["".concat(r,"-button")]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},["&-large ".concat(r,"-button")]:{height:e.controlHeightLG},["&-small ".concat(r,"-button")]:{height:e.controlHeightSM},"&-rtl":{direction:"rtl"},["&".concat(t,"-compact-item")]:{["&:not(".concat(t,"-compact-last-item)")]:{["".concat(t,"-group-addon")]:{["".concat(t,"-search-button")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},["&:not(".concat(t,"-compact-first-item)")]:{["".concat(t,",").concat(t,"-affix-wrapper")]:{borderRadius:0}},["> ".concat(t,"-group-addon ").concat(t,"-search-button,\n > ").concat(t,",\n ").concat(t,"-affix-wrapper")]:{"&:hover,&:focus,&:active":{zIndex:2}},["> ".concat(t,"-affix-wrapper-focused")]:{zIndex:2}}}}},x=e=>{let{componentCls:t,paddingLG:n}=e,r="".concat(t,"-textarea");return{[r]:{position:"relative","&-show-count":{["> ".concat(t)]:{height:"100%"},["".concat(t,"-data-count")]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{["> ".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(r,"-has-feedback")]:{["".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(t,"-affix-wrapper")]:{padding:0,["> textarea".concat(t)]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},["".concat(t,"-suffix")]:{margin:0,"> *:not(:last-child)":{marginInline:0},["".concat(t,"-clear-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,insetBlockStart:e.paddingXS},["".concat(r,"-suffix")]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},w=e=>{let{componentCls:t}=e;return{["".concat(t,"-out-of-range")]:{["&, & input, & textarea, ".concat(t,"-show-count-suffix, ").concat(t,"-data-count")]:{color:e.colorError}}}};t.ZP=(0,i.I$)("Input",e=>{let t=(0,l.TS)(e,(0,s.e)(e));return[m(t),x(t),v(t),y(t),b(t),w(t),(0,a.c)(t)]},s.T)},37433:function(e,t,n){"use strict";n.d(t,{T:function(){return a},e:function(){return o}});var r=n(3104);function o(e){return(0,r.TS)(e,{inputAffixPadding:e.paddingXXS})}let a=e=>{let{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:a,controlHeightLG:i,fontSizeLG:l,lineHeightLG:s,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:h,controlOutlineWidth:m,controlOutline:g,colorErrorOutline:v,colorWarningOutline:y,colorBgContainer:b}=e;return{paddingBlock:Math.max(Math.round((t-n*r)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((a-n*r)/2*10)/10-o,0),paddingBlockLG:Math.ceil((i-l*s)/2*10)/10-o,paddingInline:c-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:f,activeBorderColor:h,hoverBorderColor:p,activeShadow:"0 0 0 ".concat(m,"px ").concat(g),errorActiveShadow:"0 0 0 ".concat(m,"px ").concat(v),warningActiveShadow:"0 0 0 ".concat(m,"px ").concat(y),hoverBg:b,activeBg:b,inputFontSize:n,inputFontSizeLG:l,inputFontSizeSM:n}}},65265:function(e,t,n){"use strict";n.d(t,{$U:function(){return l},H8:function(){return m},Mu:function(){return f},S5:function(){return v},Xy:function(){return i},ir:function(){return d},qG:function(){return c}});var r=n(352),o=n(3104);let a=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),i=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},a((0,o.TS)(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),l=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),s=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},l(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),c=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},l(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),s(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),s(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),u=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),d=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.addonBg,border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},u(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),u(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group-addon")]:Object.assign({},i(e))}})}),f=(e,t)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},["&".concat(e.componentCls,"-disabled, &[disabled]")]:{color:e.colorTextDisabled}},t)}),p=(e,t)=>({background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null==t?void 0:t.inputColor},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}),h=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},p(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),m=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.colorPrimary})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),h(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),h(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),g=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{background:t.addonBg,color:t.addonColor}}}),v=e=>({"&-filled":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary},["".concat(e.componentCls,"-filled:not(:focus):not(:focus-within)")]:{"&:not(:first-child)":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)},"&:not(:last-child)":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}}}},g(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),g(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:last-child":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)}}}})})},19226:function(e,t,n){"use strict";n.d(t,{default:function(){return O}});var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),l=n(18694),s=n(71744),c=n(80856),u=n(45287),d=n(92239),f=n(352),p=n(80669),h=e=>{let{componentCls:t,bodyBg:n,lightSiderBg:r,lightTriggerBg:o,lightTriggerColor:a}=e;return{["".concat(t,"-sider-light")]:{background:r,["".concat(t,"-sider-trigger")]:{color:a,background:o},["".concat(t,"-sider-zero-width-trigger")]:{color:a,background:o,border:"1px solid ".concat(n),borderInlineStart:0}}}};let m=e=>{let{antCls:t,componentCls:n,colorText:r,triggerColor:o,footerBg:a,triggerBg:i,headerHeight:l,headerPadding:s,headerColor:c,footerPadding:u,triggerHeight:d,zeroTriggerHeight:p,zeroTriggerWidth:m,motionDurationMid:g,motionDurationSlow:v,fontSize:y,borderRadius:b,bodyBg:x,headerBg:w,siderBg:k}=e;return{[n]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:x,"&, *":{boxSizing:"border-box"},["&".concat(n,"-has-sider")]:{flexDirection:"row",["> ".concat(n,", > ").concat(n,"-content")]:{width:0}},["".concat(n,"-header, &").concat(n,"-footer")]:{flex:"0 0 auto"},["".concat(n,"-sider")]:{position:"relative",minWidth:0,background:k,transition:"all ".concat(g,", background 0s"),"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,["".concat(t,"-menu").concat(t,"-menu-inline-collapsed")]:{width:"auto"}},"&-has-trigger":{paddingBottom:d},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:d,color:o,lineHeight:(0,f.bf)(d),textAlign:"center",background:i,cursor:"pointer",transition:"all ".concat(g)},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:l,insetInlineEnd:e.calc(m).mul(-1).equal(),zIndex:1,width:m,height:p,color:o,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:k,borderStartStartRadius:0,borderStartEndRadius:b,borderEndEndRadius:b,borderEndStartRadius:0,cursor:"pointer",transition:"background ".concat(v," ease"),"&::after":{position:"absolute",inset:0,background:"transparent",transition:"all ".concat(v),content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(m).mul(-1).equal(),borderStartStartRadius:b,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:b}}}}},h(e)),{"&-rtl":{direction:"rtl"}}),["".concat(n,"-header")]:{height:l,padding:s,color:c,lineHeight:(0,f.bf)(l),background:w,["".concat(t,"-menu")]:{lineHeight:"inherit"}},["".concat(n,"-footer")]:{padding:u,color:r,fontSize:y,background:a},["".concat(n,"-content")]:{flex:"auto",minHeight:0}}};var g=(0,p.I$)("Layout",e=>[m(e)],e=>{let{colorBgLayout:t,controlHeight:n,controlHeightLG:r,colorText:o,controlHeightSM:a,marginXXS:i,colorTextLightSolid:l,colorBgContainer:s}=e,c=1.25*r;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:2*n,headerPadding:"0 ".concat(c,"px"),headerColor:o,footerPadding:"".concat(a,"px ").concat(c,"px"),footerBg:t,siderBg:"#001529",triggerHeight:r+2*i,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:r,zeroTriggerHeight:r,lightSiderBg:s,lightTriggerBg:s,lightTriggerColor:o}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function y(e){let{suffixCls:t,tagName:n,displayName:r}=e;return e=>o.forwardRef((r,a)=>o.createElement(e,Object.assign({ref:a,suffixCls:t,tagName:n},r)))}let b=o.forwardRef((e,t)=>{let{prefixCls:n,suffixCls:r,className:a,tagName:l}=e,c=v(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:u}=o.useContext(s.E_),d=u("layout",n),[f,p,h]=g(d),m=r?"".concat(d,"-").concat(r):d;return f(o.createElement(l,Object.assign({className:i()(n||m,a,p,h),ref:t},c)))}),x=o.forwardRef((e,t)=>{let{direction:n}=o.useContext(s.E_),[a,f]=o.useState([]),{prefixCls:p,className:h,rootClassName:m,children:y,hasSider:b,tagName:x,style:w}=e,k=v(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),S=(0,l.Z)(k,["suffixCls"]),{getPrefixCls:E,layout:O}=o.useContext(s.E_),C=E("layout",p),j="boolean"==typeof b?b:!!a.length||(0,u.Z)(y).some(e=>e.type===d.Z),[_,P,N]=g(C),T=i()(C,{["".concat(C,"-has-sider")]:j,["".concat(C,"-rtl")]:"rtl"===n},null==O?void 0:O.className,h,m,P,N),A=o.useMemo(()=>({siderHook:{addSider:e=>{f(t=>[].concat((0,r.Z)(t),[e]))},removeSider:e=>{f(t=>t.filter(t=>t!==e))}}}),[]);return _(o.createElement(c.V.Provider,{value:A},o.createElement(x,Object.assign({ref:t,className:T,style:Object.assign(Object.assign({},null==O?void 0:O.style),w)},S),y)))}),w=y({tagName:"div",displayName:"Layout"})(x),k=y({suffixCls:"header",tagName:"header",displayName:"Header"})(b),S=y({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(b),E=y({suffixCls:"content",tagName:"main",displayName:"Content"})(b);w.Header=k,w.Footer=S,w.Content=E,w.Sider=d.Z,w._InternalSiderContext=d.D;var O=w},14301:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var r=n(2265),o=n(36760),a=n.n(o);let i=e=>e?"function"==typeof e?e():e:null;var l=n(68710),s=n(71744),c=n(89970),u=n(5769),d=n(12918),f=n(691),p=n(88260),h=n(53454),m=n(80669),g=n(3104),v=n(34442);let y=e=>{let{componentCls:t,popoverColor:n,titleMinWidth:r,fontWeightStrong:o,innerPadding:a,boxShadowSecondary:i,colorTextHeading:l,borderRadiusLG:s,zIndexPopup:c,titleMarginBottom:u,colorBgElevated:f,popoverBg:h,titleBorderBottom:m,innerContentPadding:g,titlePadding:v}=e;return[{[t]:Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":f,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},["".concat(t,"-content")]:{position:"relative"},["".concat(t,"-inner")]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:s,boxShadow:i,padding:a},["".concat(t,"-title")]:{minWidth:r,marginBottom:u,color:l,fontWeight:o,borderBottom:m,padding:v},["".concat(t,"-inner-content")]:{color:n,padding:g}})},(0,p.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(t,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",["".concat(t,"-content")]:{display:"inline-block"}}}]},b=e=>{let{componentCls:t}=e;return{[t]:h.i.map(n=>{let r=e["".concat(n,"6")];return{["&".concat(t,"-").concat(n)]:{"--antd-arrow-background-color":r,["".concat(t,"-inner")]:{backgroundColor:r},["".concat(t,"-arrow")]:{background:"transparent"}}}})}};var x=(0,m.I$)("Popover",e=>{let{colorBgElevated:t,colorText:n}=e,r=(0,g.TS)(e,{popoverBg:t,popoverColor:n});return[y(r),b(r),(0,f._y)(r,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:n,fontHeight:r,padding:o,wireframe:a,zIndexPopupBase:i,borderRadiusLG:l,marginXS:s,lineType:c,colorSplit:u,paddingSM:d}=e,f=n-r;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:i+30},(0,v.w)(e)),(0,p.wZ)({contentRadius:l,limitVerticalRadius:!0})),{innerPadding:a?0:12,titleMarginBottom:a?0:s,titlePadding:a?"".concat(f/2,"px ").concat(o,"px ").concat(f/2-t,"px"):0,titleBorderBottom:a?"".concat(t,"px ").concat(c," ").concat(u):"none",innerContentPadding:a?"".concat(d,"px ").concat(o,"px"):0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]}),w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let k=(e,t,n)=>t||n?r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(e,"-title")},i(t)),r.createElement("div",{className:"".concat(e,"-inner-content")},i(n))):null,S=e=>{let{hashId:t,prefixCls:n,className:o,style:i,placement:l="top",title:s,content:c,children:d}=e;return r.createElement("div",{className:a()(t,n,"".concat(n,"-pure"),"".concat(n,"-placement-").concat(l),o),style:i},r.createElement("div",{className:"".concat(n,"-arrow")}),r.createElement(u.G,Object.assign({},e,{className:t,prefixCls:n}),d||k(n,s,c)))};var 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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O=e=>{let{title:t,content:n,prefixCls:o}=e;return r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(o,"-title")},i(t)),r.createElement("div",{className:"".concat(o,"-inner-content")},i(n)))},C=r.forwardRef((e,t)=>{let{prefixCls:n,title:o,content:i,overlayClassName:u,placement:d="top",trigger:f="hover",mouseEnterDelay:p=.1,mouseLeaveDelay:h=.1,overlayStyle:m={}}=e,g=E(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:v}=r.useContext(s.E_),y=v("popover",n),[b,w,k]=x(y),S=v(),C=a()(u,w,k);return b(r.createElement(c.Z,Object.assign({placement:d,trigger:f,mouseEnterDelay:p,mouseLeaveDelay:h,overlayStyle:m},g,{prefixCls:y,overlayClassName:C,ref:t,overlay:o||i?r.createElement(O,{prefixCls:y,title:o,content:i}):null,transitionName:(0,l.m)(S,"zoom-big",g.transitionName),"data-popover-inject":!0})))});C._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,className:n}=e,o=w(e,["prefixCls","className"]),{getPrefixCls:i}=r.useContext(s.E_),l=i("popover",t),[c,u,d]=x(l);return c(r.createElement(S,Object.assign({},o,{prefixCls:l,hashId:u,className:a()(n,d)})))};var j=C},29967:function(e,t,n){"use strict";n.d(t,{ZP:function(){return R}});var r=n(2265),o=n(36760),a=n.n(o),i=n(50506),l=n(18242),s=n(71744),c=n(33759);let u=r.createContext(null),d=u.Provider,f=r.createContext(null),p=f.Provider;var h=n(20873),m=n(28791),g=n(6694),v=n(34709),y=n(86586),b=n(39109),x=n(352),w=n(12918),k=n(80669),S=n(3104);let E=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-group");return{[r]:Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(r,"-rtl")]:{direction:"rtl"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},O=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:r,radioSize:o,motionDurationSlow:a,motionDurationMid:i,motionEaseInOutCirc:l,colorBgContainer:s,colorBorder:c,lineWidth:u,colorBgContainerDisabled:d,colorTextDisabled:f,paddingXS:p,dotColorDisabled:h,lineType:m,radioColor:g,radioBgColor:v,calc:y}=e,b="".concat(t,"-inner"),k=y(o).sub(y(4).mul(2)),S=y(1).mul(o).equal();return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",["&".concat(t,"-wrapper-rtl")]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,x.bf)(u)," ").concat(m," ").concat(r),borderRadius:"50%",visibility:"hidden",content:'""'},[t]:Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(b)]:{borderColor:r},["".concat(t,"-input:focus-visible + ").concat(b)]:Object.assign({},(0,w.oN)(e)),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:S,height:S,marginBlockStart:y(1).mul(o).div(-2).equal(),marginInlineStart:y(1).mul(o).div(-2).equal(),backgroundColor:g,borderBlockStart:0,borderInlineStart:0,borderRadius:S,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(l),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:S,height:S,backgroundColor:s,borderColor:c,borderStyle:"solid",borderWidth:u,borderRadius:"50%",transition:"all ".concat(i)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[b]:{borderColor:r,backgroundColor:v,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(o).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(l)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[b]:{backgroundColor:d,borderColor:c,cursor:"not-allowed","&::after":{backgroundColor:h}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[b]:{"&::after":{transform:"scale(".concat(y(k).div(o).equal({unit:!1}),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},C=e=>{let{buttonColor:t,controlHeight:n,componentCls:r,lineWidth:o,lineType:a,colorBorder:i,motionDurationSlow:l,motionDurationMid:s,buttonPaddingInline:c,fontSize:u,buttonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:h,paddingXS:m,borderRadius:g,borderRadiusSM:v,borderRadiusLG:y,buttonCheckedBg:b,buttonSolidCheckedColor:k,colorTextDisabled:S,colorBgContainerDisabled:E,buttonCheckedBgDisabled:O,buttonCheckedColorDisabled:C,colorPrimary:j,colorPrimaryHover:_,colorPrimaryActive:P,buttonSolidCheckedBg:N,buttonSolidCheckedHoverBg:T,buttonSolidCheckedActiveBg:A,calc:M}=e;return{["".concat(r,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:u,lineHeight:(0,x.bf)(M(n).sub(M(o).mul(2)).equal()),background:d,border:"".concat((0,x.bf)(o)," ").concat(a," ").concat(i),borderBlockStartWidth:M(o).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:o,cursor:"pointer",transition:["color ".concat(s),"background ".concat(s),"box-shadow ".concat(s)].join(","),a:{color:t},["> ".concat(r,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:M(o).mul(-1).equal(),insetInlineStart:M(o).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:o,paddingInline:0,backgroundColor:i,transition:"background-color ".concat(l),content:'""'}},"&:first-child":{borderInlineStart:"".concat((0,x.bf)(o)," ").concat(a," ").concat(i),borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g},"&:first-child:last-child":{borderRadius:g},["".concat(r,"-group-large &")]:{height:p,fontSize:f,lineHeight:(0,x.bf)(M(p).sub(M(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:y,borderEndStartRadius:y},"&:last-child":{borderStartEndRadius:y,borderEndEndRadius:y}},["".concat(r,"-group-small &")]:{height:h,paddingInline:M(m).sub(o).equal(),paddingBlock:0,lineHeight:(0,x.bf)(M(h).sub(M(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:j},"&:has(:focus-visible)":Object.assign({},(0,w.oN)(e)),["".concat(r,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(r,"-button-wrapper-disabled)")]:{zIndex:1,color:j,background:b,borderColor:j,"&::before":{backgroundColor:j},"&:first-child":{borderColor:j},"&:hover":{color:_,borderColor:_,"&::before":{backgroundColor:_}},"&:active":{color:P,borderColor:P,"&::before":{backgroundColor:P}}},["".concat(r,"-group-solid &-checked:not(").concat(r,"-button-wrapper-disabled)")]:{color:k,background:N,borderColor:N,"&:hover":{color:k,background:T,borderColor:T},"&:active":{color:k,background:A,borderColor:A}},"&-disabled":{color:S,backgroundColor:E,borderColor:i,cursor:"not-allowed","&:first-child, &:hover":{color:S,backgroundColor:E,borderColor:i}},["&-disabled".concat(r,"-button-wrapper-checked")]:{color:C,backgroundColor:O,borderColor:i,boxShadow:"none"}}}};var j=(0,k.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,r="0 0 0 ".concat((0,x.bf)(n)," ").concat(t),o=(0,S.TS)(e,{radioFocusShadow:r,radioButtonFocusShadow:r});return[E(o),O(o),C(o)]},e=>{let{wireframe:t,padding:n,marginXS:r,lineWidth:o,fontSizeLG:a,colorText:i,colorBgContainer:l,colorTextDisabled:s,controlItemBgActiveDisabled:c,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:h}=e;return{radioSize:a,dotSize:t?a-8:a-(4+o)*2,dotColorDisabled:s,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:l,buttonCheckedBg:l,buttonColor:i,buttonCheckedBgDisabled:c,buttonCheckedColorDisabled:s,buttonPaddingInline:n-o,wrapperMarginInlineEnd:r,radioColor:t?d:h,radioBgColor:t?l:d}},{unitless:{radioSize:!0,dotSize:!0}}),_=n(64024),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=r.forwardRef((e,t)=>{var n,o;let i=r.useContext(u),l=r.useContext(f),{getPrefixCls:c,direction:d,radio:p}=r.useContext(s.E_),x=r.useRef(null),w=(0,m.sQ)(t,x),{isFormItemInput:k}=r.useContext(b.aM),{prefixCls:S,className:E,rootClassName:O,children:C,style:N,title:T}=e,A=P(e,["prefixCls","className","rootClassName","children","style","title"]),M=c("radio",S),I="button"===((null==i?void 0:i.optionType)||l),R=I?"".concat(M,"-button"):M,D=(0,_.Z)(M),[L,Z,z]=j(M,D),B=Object.assign({},A),F=r.useContext(y.Z);i&&(B.name=i.name,B.onChange=t=>{var n,r;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(r=null==i?void 0:i.onChange)||void 0===r||r.call(i,t)},B.checked=e.value===i.value,B.disabled=null!==(n=B.disabled)&&void 0!==n?n:i.disabled),B.disabled=null!==(o=B.disabled)&&void 0!==o?o:F;let H=a()("".concat(R,"-wrapper"),{["".concat(R,"-wrapper-checked")]:B.checked,["".concat(R,"-wrapper-disabled")]:B.disabled,["".concat(R,"-wrapper-rtl")]:"rtl"===d,["".concat(R,"-wrapper-in-form-item")]:k},null==p?void 0:p.className,E,O,Z,z,D);return L(r.createElement(g.Z,{component:"Radio",disabled:B.disabled},r.createElement("label",{className:H,style:Object.assign(Object.assign({},null==p?void 0:p.style),N),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:T},r.createElement(h.Z,Object.assign({},B,{className:a()(B.className,!I&&v.A),type:"radio",prefixCls:R,ref:w})),void 0!==C?r.createElement("span",null,C):null)))}),T=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:o}=r.useContext(s.E_),[u,f]=(0,i.Z)(e.defaultValue,{value:e.value}),{prefixCls:p,className:h,rootClassName:m,options:g,buttonStyle:v="outline",disabled:y,children:b,size:x,style:w,id:k,onMouseEnter:S,onMouseLeave:E,onFocus:O,onBlur:C}=e,P=n("radio",p),T="".concat(P,"-group"),A=(0,_.Z)(P),[M,I,R]=j(P,A),D=b;g&&g.length>0&&(D=g.map(e=>"string"==typeof e||"number"==typeof e?r.createElement(N,{key:e.toString(),prefixCls:P,disabled:y,value:e,checked:u===e},e):r.createElement(N,{key:"radio-group-value-options-".concat(e.value),prefixCls:P,disabled:e.disabled||y,value:e.value,checked:u===e.value,title:e.title,style:e.style,id:e.id,required:e.required},e.label)));let L=(0,c.Z)(x),Z=a()(T,"".concat(T,"-").concat(v),{["".concat(T,"-").concat(L)]:L,["".concat(T,"-rtl")]:"rtl"===o},h,m,I,R,A);return M(r.createElement("div",Object.assign({},(0,l.Z)(e,{aria:!0,data:!0}),{className:Z,style:w,onMouseEnter:S,onMouseLeave:E,onFocus:O,onBlur:C,id:k,ref:t}),r.createElement(d,{value:{onChange:t=>{let n=t.target.value;"value"in e||f(n);let{onChange:r}=e;r&&n!==u&&r(t)},value:u,disabled:e.disabled,name:e.name,optionType:e.optionType}},D)))});var A=r.memo(T),M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},I=r.forwardRef((e,t)=>{let{getPrefixCls:n}=r.useContext(s.E_),{prefixCls:o}=e,a=M(e,["prefixCls"]),i=n("radio",o);return r.createElement(p,{value:"button"},r.createElement(N,Object.assign({prefixCls:i},a,{type:"radio",ref:t})))});N.Button=I,N.Group=A,N.__ANT_RADIO=!0;var R=N},47451:function(e,t,n){"use strict";var r=n(10295);t.Z=r.Z},87908:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),l=n(19722),s=n(71744),c=n(352),u=n(12918),d=n(80669),f=n(3104);let p=new c.E4("antSpinMove",{to:{opacity:1}}),h=new c.E4("antRotate",{to:{transform:"rotate(405deg)"}}),m=e=>{let{componentCls:t,calc:n}=e;return{["".concat(t)]:Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:"transform ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOutCirc),"&-spinning":{position:"static",display:"inline-block",opacity:1},["".concat(t,"-text")]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:"all ".concat(e.motionDurationMid),"&-show":{opacity:1,visibility:"visible"},["".concat(t,"-dot ").concat(t,"-dot-item")]:{backgroundColor:e.colorWhite},["".concat(t,"-text")]:{color:e.colorTextLightSolid}},"&-nested-loading":{position:"relative",["> div > ".concat(t)]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,["".concat(t,"-dot")]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},["".concat(t,"-text")]:{position:"absolute",top:"50%",width:"100%",textShadow:"0 1px 2px ".concat(e.colorBgContainer)},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{["".concat(t,"-dot")]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},["".concat(t,"-text")]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{["".concat(t,"-dot")]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},["".concat(t,"-text")]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},["".concat(t,"-container")]:{position:"relative",transition:"opacity ".concat(e.motionDurationSlow),"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:"all ".concat(e.motionDurationSlow),content:'""',pointerEvents:"none"}},["".concat(t,"-blur")]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},["".concat(t,"-dot")]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),backgroundColor:e.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:p,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:h,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&-sm ".concat(t,"-dot")]:{fontSize:e.dotSizeSM,i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},["&-lg ".concat(t,"-dot")]:{fontSize:e.dotSizeLG,i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},["&".concat(t,"-show-text ").concat(t,"-text")]:{display:"block"}})}};var g=(0,d.I$)("Spin",e=>[m((0,f.TS)(e,{spinDotDefault:e.colorTextDescription}))],e=>{let{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}}),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let y=null,b=e=>{let{prefixCls:t,spinning:n=!0,delay:o=0,className:c,rootClassName:u,size:d="default",tip:f,wrapperClassName:p,style:h,children:m,fullscreen:b}=e,x=v(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen"]),{getPrefixCls:w}=r.useContext(s.E_),k=w("spin",t),[S,E,O]=g(k),[C,j]=r.useState(()=>n&&(!n||!o||!!isNaN(Number(o))));r.useEffect(()=>{if(n){var e;let t=function(e,t,n){var r,o=n||{},a=o.noTrailing,i=void 0!==a&&a,l=o.noLeading,s=void 0!==l&&l,c=o.debounceMode,u=void 0===c?void 0:c,d=!1,f=0;function p(){r&&clearTimeout(r)}function h(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var l=this,c=Date.now()-f;function h(){f=Date.now(),t.apply(l,o)}function m(){r=void 0}!d&&(s||!u||r||h(),p(),void 0===u&&c>e?s?(f=Date.now(),i||(r=setTimeout(u?m:h,e))):h():!0!==i&&(r=setTimeout(u?m:h,void 0===u?e-c:e)))}return h.cancel=function(e){var t=(e||{}).upcomingOnly;p(),d=!(void 0!==t&&t)},h}(o,()=>{j(!0)},{debounceMode:!1!==(void 0!==(e=({}).atBegin)&&e)});return t(),()=>{var e;null===(e=null==t?void 0:t.cancel)||void 0===e||e.call(t)}}j(!1)},[o,n]);let _=r.useMemo(()=>void 0!==m&&!b,[m,b]),{direction:P,spin:N}=r.useContext(s.E_),T=a()(k,null==N?void 0:N.className,{["".concat(k,"-sm")]:"small"===d,["".concat(k,"-lg")]:"large"===d,["".concat(k,"-spinning")]:C,["".concat(k,"-show-text")]:!!f,["".concat(k,"-fullscreen")]:b,["".concat(k,"-fullscreen-show")]:b&&C,["".concat(k,"-rtl")]:"rtl"===P},c,u,E,O),A=a()("".concat(k,"-container"),{["".concat(k,"-blur")]:C}),M=(0,i.Z)(x,["indicator"]),I=Object.assign(Object.assign({},null==N?void 0:N.style),h),R=r.createElement("div",Object.assign({},M,{style:I,className:T,"aria-live":"polite","aria-busy":C}),function(e,t){let{indicator:n}=t,o="".concat(e,"-dot");return null===n?null:(0,l.l$)(n)?(0,l.Tm)(n,{className:a()(n.props.className,o)}):(0,l.l$)(y)?(0,l.Tm)(y,{className:a()(y.props.className,o)}):r.createElement("span",{className:a()(o,"".concat(e,"-dot-spin"))},r.createElement("i",{className:"".concat(e,"-dot-item"),key:1}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:2}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:3}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:4}))}(k,e),f&&(_||b)?r.createElement("div",{className:"".concat(k,"-text")},f):null);return S(_?r.createElement("div",Object.assign({},M,{className:a()("".concat(k,"-nested-loading"),p,E,O)}),C&&r.createElement("div",{key:"loading"},R),r.createElement("div",{className:A,key:"container"},m)):R)};b.setDefaultIndicator=e=>{y=e};var x=b},76122:function(e,t,n){"use strict";n.d(t,{N:function(){return r}});let r=e=>({color:e.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}})},63709:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var r=n(2265),o=n(61935),a=n(36760),i=n.n(a),l=n(1119),s=n(11993),c=n(26365),u=n(6989),d=n(50506),f=n(95814),p=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],h=r.forwardRef(function(e,t){var n,o=e.prefixCls,a=void 0===o?"rc-switch":o,h=e.className,m=e.checked,g=e.defaultChecked,v=e.disabled,y=e.loadingIcon,b=e.checkedChildren,x=e.unCheckedChildren,w=e.onClick,k=e.onChange,S=e.onKeyDown,E=(0,u.Z)(e,p),O=(0,d.Z)(!1,{value:m,defaultValue:g}),C=(0,c.Z)(O,2),j=C[0],_=C[1];function P(e,t){var n=j;return v||(_(n=e),null==k||k(n,t)),n}var N=i()(a,h,(n={},(0,s.Z)(n,"".concat(a,"-checked"),j),(0,s.Z)(n,"".concat(a,"-disabled"),v),n));return r.createElement("button",(0,l.Z)({},E,{type:"button",role:"switch","aria-checked":j,disabled:v,className:N,ref:t,onKeyDown:function(e){e.which===f.Z.LEFT?P(!1,e):e.which===f.Z.RIGHT&&P(!0,e),null==S||S(e)},onClick:function(e){var t=P(!j,e);null==w||w(t,e)}}),y,r.createElement("span",{className:"".concat(a,"-inner")},r.createElement("span",{className:"".concat(a,"-inner-checked")},b),r.createElement("span",{className:"".concat(a,"-inner-unchecked")},x)))});h.displayName="Switch";var m=n(6694),g=n(71744),v=n(86586),y=n(33759),b=n(352),x=n(36360),w=n(12918),k=n(80669),S=n(3104);let E=e=>{let{componentCls:t,trackHeightSM:n,trackPadding:r,trackMinWidthSM:o,innerMinMarginSM:a,innerMaxMarginSM:i,handleSizeSM:l,calc:s}=e,c="".concat(t,"-inner"),u=(0,b.bf)(s(l).add(s(r).mul(2)).equal()),d=(0,b.bf)(s(i).mul(2).equal());return{[t]:{["&".concat(t,"-small")]:{minWidth:o,height:n,lineHeight:(0,b.bf)(n),["".concat(t,"-inner")]:{paddingInlineStart:i,paddingInlineEnd:a,["".concat(c,"-checked")]:{marginInlineStart:"calc(-100% + ".concat(u," - ").concat(d,")"),marginInlineEnd:"calc(100% - ".concat(u," + ").concat(d,")")},["".concat(c,"-unchecked")]:{marginTop:s(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},["".concat(t,"-handle")]:{width:l,height:l},["".concat(t,"-loading-icon")]:{top:s(s(l).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},["&".concat(t,"-checked")]:{["".concat(t,"-inner")]:{paddingInlineStart:a,paddingInlineEnd:i,["".concat(c,"-checked")]:{marginInlineStart:0,marginInlineEnd:0},["".concat(c,"-unchecked")]:{marginInlineStart:"calc(100% - ".concat(u," + ").concat(d,")"),marginInlineEnd:"calc(-100% + ".concat(u," - ").concat(d,")")}},["".concat(t,"-handle")]:{insetInlineStart:"calc(100% - ".concat((0,b.bf)(s(l).add(r).equal()),")")}},["&:not(".concat(t,"-disabled):active")]:{["&:not(".concat(t,"-checked) ").concat(c)]:{["".concat(c,"-unchecked")]:{marginInlineStart:s(e.marginXXS).div(2).equal(),marginInlineEnd:s(e.marginXXS).mul(-1).div(2).equal()}},["&".concat(t,"-checked ").concat(c)]:{["".concat(c,"-checked")]:{marginInlineStart:s(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:s(e.marginXXS).div(2).equal()}}}}}}},O=e=>{let{componentCls:t,handleSize:n,calc:r}=e;return{[t]:{["".concat(t,"-loading-icon").concat(e.iconCls)]:{position:"relative",top:r(r(n).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},["&".concat(t,"-checked ").concat(t,"-loading-icon")]:{color:e.switchColor}}}},C=e=>{let{componentCls:t,trackPadding:n,handleBg:r,handleShadow:o,handleSize:a,calc:i}=e,l="".concat(t,"-handle");return{[t]:{[l]:{position:"absolute",top:n,insetInlineStart:n,width:a,height:a,transition:"all ".concat(e.switchDuration," ease-in-out"),"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:r,borderRadius:i(a).div(2).equal(),boxShadow:o,transition:"all ".concat(e.switchDuration," ease-in-out"),content:'""'}},["&".concat(t,"-checked ").concat(l)]:{insetInlineStart:"calc(100% - ".concat((0,b.bf)(i(a).add(n).equal()),")")},["&:not(".concat(t,"-disabled):active")]:{["".concat(l,"::before")]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},["&".concat(t,"-checked ").concat(l,"::before")]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},j=e=>{let{componentCls:t,trackHeight:n,trackPadding:r,innerMinMargin:o,innerMaxMargin:a,handleSize:i,calc:l}=e,s="".concat(t,"-inner"),c=(0,b.bf)(l(i).add(l(r).mul(2)).equal()),u=(0,b.bf)(l(a).mul(2).equal());return{[t]:{[s]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:a,paddingInlineEnd:o,transition:"padding-inline-start ".concat(e.switchDuration," ease-in-out, padding-inline-end ").concat(e.switchDuration," ease-in-out"),["".concat(s,"-checked, ").concat(s,"-unchecked")]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:"margin-inline-start ".concat(e.switchDuration," ease-in-out, margin-inline-end ").concat(e.switchDuration," ease-in-out"),pointerEvents:"none"},["".concat(s,"-checked")]:{marginInlineStart:"calc(-100% + ".concat(c," - ").concat(u,")"),marginInlineEnd:"calc(100% - ".concat(c," + ").concat(u,")")},["".concat(s,"-unchecked")]:{marginTop:l(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},["&".concat(t,"-checked ").concat(s)]:{paddingInlineStart:o,paddingInlineEnd:a,["".concat(s,"-checked")]:{marginInlineStart:0,marginInlineEnd:0},["".concat(s,"-unchecked")]:{marginInlineStart:"calc(100% - ".concat(c," + ").concat(u,")"),marginInlineEnd:"calc(-100% + ".concat(c," - ").concat(u,")")}},["&:not(".concat(t,"-disabled):active")]:{["&:not(".concat(t,"-checked) ").concat(s)]:{["".concat(s,"-unchecked")]:{marginInlineStart:l(r).mul(2).equal(),marginInlineEnd:l(r).mul(-1).mul(2).equal()}},["&".concat(t,"-checked ").concat(s)]:{["".concat(s,"-checked")]:{marginInlineStart:l(r).mul(-1).mul(2).equal(),marginInlineEnd:l(r).mul(2).equal()}}}}}},_=e=>{let{componentCls:t,trackHeight:n,trackMinWidth:r}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:r,height:n,lineHeight:"".concat((0,b.bf)(n)),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),userSelect:"none",["&:hover:not(".concat(t,"-disabled)")]:{background:e.colorTextTertiary}}),(0,w.Qy)(e)),{["&".concat(t,"-checked")]:{background:e.switchColor,["&:hover:not(".concat(t,"-disabled)")]:{background:e.colorPrimaryHover}},["&".concat(t,"-loading, &").concat(t,"-disabled")]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},["&".concat(t,"-rtl")]:{direction:"rtl"}})}};var P=(0,k.I$)("Switch",e=>{let t=(0,S.TS)(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:"rgba(0, 0, 0, ".concat(e.opacityLoading,")"),switchHandleActiveInset:"-30%"});return[_(t),j(t),C(t),O(t),E(t)]},e=>{let{fontSize:t,lineHeight:n,controlHeight:r,colorWhite:o}=e,a=t*n,i=r/2,l=a-4,s=i-4;return{trackHeight:a,trackHeightSM:i,trackMinWidth:2*l+8,trackMinWidthSM:2*s+4,trackPadding:2,handleBg:o,handleSize:l,handleSizeSM:s,handleShadow:"0 2px 4px 0 ".concat(new x.C("#00230b").setAlpha(.2).toRgbString()),innerMinMargin:l/2,innerMaxMargin:l+2+4,innerMinMarginSM:s/2,innerMaxMarginSM:s+2+4}}),N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let T=r.forwardRef((e,t)=>{let{prefixCls:n,size:a,disabled:l,loading:s,className:c,rootClassName:u,style:f,checked:p,value:b,defaultChecked:x,defaultValue:w,onChange:k}=e,S=N(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[E,O]=(0,d.Z)(!1,{value:null!=p?p:b,defaultValue:null!=x?x:w}),{getPrefixCls:C,direction:j,switch:_}=r.useContext(g.E_),T=r.useContext(v.Z),A=(null!=l?l:T)||s,M=C("switch",n),I=r.createElement("div",{className:"".concat(M,"-handle")},s&&r.createElement(o.Z,{className:"".concat(M,"-loading-icon")})),[R,D,L]=P(M),Z=(0,y.Z)(a),z=i()(null==_?void 0:_.className,{["".concat(M,"-small")]:"small"===Z,["".concat(M,"-loading")]:s,["".concat(M,"-rtl")]:"rtl"===j},c,u,D,L),B=Object.assign(Object.assign({},null==_?void 0:_.style),f);return R(r.createElement(m.Z,{component:"Switch"},r.createElement(h,Object.assign({},S,{checked:E,onChange:function(){O(arguments.length<=0?void 0:arguments[0]),null==k||k.apply(void 0,arguments)},prefixCls:M,className:z,style:B,disabled:A,ref:t,loadingIcon:I}))))});T.__ANT_SWITCH=!0;var A=T},72188:function(e,t,n){"use strict";n.d(t,{Z:function(){return oe}});var r,o,a=n(2265),i={},l="rc-table-internal-hook",s=n(26365),c=n(58525),u=n(27380),d=n(16671),f=n(54887);function p(e){var t=a.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,r=e.children,o=a.useRef(n);o.current=n;var i=a.useState(function(){return{getValue:function(){return o.current},listeners:new Set}}),l=(0,s.Z)(i,1)[0];return(0,u.Z)(function(){(0,f.unstable_batchedUpdates)(function(){l.listeners.forEach(function(e){e(n)})})},[n]),a.createElement(t.Provider,{value:l},r)},defaultValue:e}}function h(e,t){var n=(0,c.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),r=a.useContext(null==e?void 0:e.Context),o=r||{},i=o.listeners,l=o.getValue,f=a.useRef();f.current=n(r?l():null==e?void 0:e.defaultValue);var p=a.useState({}),h=(0,s.Z)(p,2)[1];return(0,u.Z)(function(){if(r)return i.add(e),function(){i.delete(e)};function e(e){var t=n(e);(0,d.Z)(f.current,t,!0)||h({})}},[r]),f.current}var m=n(1119),g=n(28791);function v(){var e=a.createContext(null);function t(){return a.useContext(e)}return{makeImmutable:function(n,r){var o=(0,g.Yr)(n),i=function(i,l){var s=o?{ref:l}:{},c=a.useRef(0),u=a.useRef(i);return null!==t()?a.createElement(n,(0,m.Z)({},i,s)):((!r||r(u.current,i))&&(c.current+=1),u.current=i,a.createElement(e.Provider,{value:c.current},a.createElement(n,(0,m.Z)({},i,s))))};return o?a.forwardRef(i):i},responseImmutable:function(e,n){var r=(0,g.Yr)(e),o=function(n,o){return t(),a.createElement(e,(0,m.Z)({},n,r?{ref:o}:{}))};return r?a.memo(a.forwardRef(o),n):a.memo(o,n)},useImmutableMark:t}}var y=v();y.makeImmutable,y.responseImmutable,y.useImmutableMark;var b=v(),x=b.makeImmutable,w=b.responseImmutable,k=b.useImmutableMark,S=p();a.memo(function(){var e,t,n,r,o,i=(t=a.useRef(0),t.current+=1,n=a.useRef(void 0),r=[],Object.keys(e||{}).map(function(t){var o;(null==e?void 0:e[t])!==(null===(o=n.current)||void 0===o?void 0:o[t])&&r.push(t)}),n.current=e,o=a.useRef([]),r.length&&(o.current=r),a.useDebugValue(t.current),a.useDebugValue(o.current.join(", ")),t.current);return a.createElement("h1",null,"Render Times: ",i)}).displayName="RenderBlock";var E=n(41154),O=n(31686),C=n(11993),j=n(36760),_=n.n(j),P=n(6397),N=n(16847),T=n(32559),A=a.createContext({renderWithProps:!1});function M(e){var t=[],n={};return e.forEach(function(e){for(var r=e||{},o=r.key,a=r.dataIndex,i=o||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[i];)i="".concat(i,"_next");n[i]=!0,t.push(i)}),t}var I=n(74126),R=function(e){var t,n=e.ellipsis,r=e.rowType,o=e.children,i=!0===n?{showTitle:!0}:n;return i&&(i.showTitle||"header"===r)&&("string"==typeof o||"number"==typeof o?t=o.toString():a.isValidElement(o)&&"string"==typeof o.props.children&&(t=o.props.children)),t},D=a.memo(function(e){var t,n,r,o,i,l,c,u,f,p,g=e.component,v=e.children,y=e.ellipsis,b=e.scope,x=e.prefixCls,w=e.className,j=e.align,T=e.record,M=e.render,D=e.dataIndex,L=e.renderIndex,Z=e.shouldCellUpdate,z=e.index,B=e.rowType,F=e.colSpan,H=e.rowSpan,q=e.fixLeft,W=e.fixRight,U=e.firstFixLeft,K=e.lastFixLeft,$=e.firstFixRight,V=e.lastFixRight,X=e.appendNode,G=e.additionalProps,Y=void 0===G?{}:G,Q=e.isSticky,J="".concat(x,"-cell"),ee=h(S,["supportSticky","allColumnsFixedLeft"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,er=(t=a.useContext(A),n=k(),(0,P.Z)(function(){if(null!=v)return[v];var e=null==D||""===D?[]:Array.isArray(D)?D:[D],n=(0,N.Z)(T,e),r=n,o=void 0;if(M){var i=M(n,T,L);!i||"object"!==(0,E.Z)(i)||Array.isArray(i)||a.isValidElement(i)?r=i:(r=i.children,o=i.props,t.renderWithProps=!0)}return[r,o]},[n,T,v,D,M,L],function(e,n){if(Z){var r=(0,s.Z)(e,2)[1];return Z((0,s.Z)(n,2)[1],r)}return!!t.renderWithProps||!(0,d.Z)(e,n,!0)})),eo=(0,s.Z)(er,2),ea=eo[0],ei=eo[1],el={},es="number"==typeof q&&et,ec="number"==typeof W&&et;es&&(el.position="sticky",el.left=q),ec&&(el.position="sticky",el.right=W);var eu=null!==(r=null!==(o=null!==(i=null==ei?void 0:ei.colSpan)&&void 0!==i?i:Y.colSpan)&&void 0!==o?o:F)&&void 0!==r?r:1,ed=null!==(l=null!==(c=null!==(u=null==ei?void 0:ei.rowSpan)&&void 0!==u?u:Y.rowSpan)&&void 0!==c?c:H)&&void 0!==l?l:1,ef=h(S,function(e){var t,n;return[(t=ed||1,n=e.hoverStartRow,z<=e.hoverEndRow&&z+t-1>=n),e.onHover]}),ep=(0,s.Z)(ef,2),eh=ep[0],em=ep[1],eg=(0,I.zX)(function(e){var t;T&&em(z,z+ed-1),null==Y||null===(t=Y.onMouseEnter)||void 0===t||t.call(Y,e)}),ev=(0,I.zX)(function(e){var t;T&&em(-1,-1),null==Y||null===(t=Y.onMouseLeave)||void 0===t||t.call(Y,e)});if(0===eu||0===ed)return null;var ey=null!==(f=Y.title)&&void 0!==f?f:R({rowType:B,ellipsis:y,children:ea}),eb=_()(J,w,(p={},(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)(p,"".concat(J,"-fix-left"),es&&et),"".concat(J,"-fix-left-first"),U&&et),"".concat(J,"-fix-left-last"),K&&et),"".concat(J,"-fix-left-all"),K&&en&&et),"".concat(J,"-fix-right"),ec&&et),"".concat(J,"-fix-right-first"),$&&et),"".concat(J,"-fix-right-last"),V&&et),"".concat(J,"-ellipsis"),y),"".concat(J,"-with-append"),X),"".concat(J,"-fix-sticky"),(es||ec)&&Q&&et),(0,C.Z)(p,"".concat(J,"-row-hover"),!ei&&eh)),Y.className,null==ei?void 0:ei.className),ex={};j&&(ex.textAlign=j);var ew=(0,O.Z)((0,O.Z)((0,O.Z)((0,O.Z)({},el),Y.style),ex),null==ei?void 0:ei.style),ek=ea;return"object"!==(0,E.Z)(ek)||Array.isArray(ek)||a.isValidElement(ek)||(ek=null),y&&(K||$)&&(ek=a.createElement("span",{className:"".concat(J,"-content")},ek)),a.createElement(g,(0,m.Z)({},ei,Y,{className:eb,style:ew,title:ey,scope:b,onMouseEnter:eg,onMouseLeave:ev,colSpan:1!==eu?eu:null,rowSpan:1!==ed?ed:null}),X,ek)});function L(e,t,n,r,o,a){var i,l,s=n[e]||{},c=n[t]||{};"left"===s.fixed?i=r.left["rtl"===o?t:e]:"right"===c.fixed&&(l=r.right["rtl"===o?e:t]);var u=!1,d=!1,f=!1,p=!1,h=n[t+1],m=n[e-1],g=!(null!=a&&a.children);return"rtl"===o?void 0!==i?p=!(m&&"left"===m.fixed)&&g:void 0!==l&&(f=!(h&&"right"===h.fixed)&&g):void 0!==i?u=!(h&&"left"===h.fixed)&&g:void 0!==l&&(d=!(m&&"right"===m.fixed)&&g),{fixLeft:i,fixRight:l,lastFixLeft:u,firstFixRight:d,lastFixRight:f,firstFixLeft:p,isSticky:r.isSticky}}var Z=a.createContext({}),z=n(6989),B=["children"];function F(e){return e.children}F.Row=function(e){var t=e.children,n=(0,z.Z)(e,B);return a.createElement("tr",n,t)},F.Cell=function(e){var t=e.className,n=e.index,r=e.children,o=e.colSpan,i=void 0===o?1:o,l=e.rowSpan,s=e.align,c=h(S,["prefixCls","direction"]),u=c.prefixCls,d=c.direction,f=a.useContext(Z),p=f.scrollColumnIndex,g=f.stickyOffsets,v=f.flattenColumns,y=f.columns,b=n+i-1+1===p?i+1:i,x=L(n,n+b-1,v,g,d,null==y?void 0:y[n]);return a.createElement(D,(0,m.Z)({className:t,index:n,component:"td",prefixCls:u,record:null,dataIndex:null,align:s,colSpan:b,rowSpan:l,render:function(){return r}},x))};var H=w(function(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,o=e.columns,i=h(S,"prefixCls"),l=r.length-1,s=r[l],c=a.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:null!=s&&s.scrollbar?l:null,columns:o}},[s,r,l,n,o]);return a.createElement(Z.Provider,{value:c},a.createElement("tfoot",{className:"".concat(i,"-summary")},t))}),q=n(31474),W=n(2857),U=n(10281),K=n(3208),$=n(18242);function V(e,t,n,r){return a.useMemo(function(){if(null!=n&&n.size){for(var o=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,r,o,a,i,l){t.push({record:n,indent:r,index:l});var s=i(n),c=null==a?void 0:a.has(s);if(n&&Array.isArray(n[o])&&c)for(var u=0;u<n[o].length;u+=1)e(t,n[o][u],r+1,o,a,i,u)}(o,e[a],0,t,n,r,a);return o}return null==e?void 0:e.map(function(e,t){return{record:e,indent:0,index:t}})},[e,t,n,r])}function X(e,t,n,r){var o,a=h(S,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),i=a.flattenColumns,l=a.expandableType,s=a.expandedKeys,c=a.childrenColumnName,u=a.onTriggerExpand,d=a.rowExpandable,f=a.onRow,p=a.expandRowByClick,m=a.rowClassName,g="nest"===l,v="row"===l&&(!d||d(e)),y=v||g,b=s&&s.has(t),x=c&&e&&e[c],w=(0,I.zX)(u),k=null==f?void 0:f(e,n),E=null==k?void 0:k.onClick;"string"==typeof m?o=m:"function"==typeof m&&(o=m(e,n,r));var C=M(i);return(0,O.Z)((0,O.Z)({},a),{},{columnsKey:C,nestExpandable:g,expanded:b,hasNestChildren:x,record:e,onTriggerExpand:w,rowSupportExpand:v,expandable:y,rowProps:(0,O.Z)((0,O.Z)({},k),{},{className:_()(o,null==k?void 0:k.className),onClick:function(t){p&&y&&u(e,t);for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];null==E||E.apply(void 0,[t].concat(r))}})})}var G=function(e){var t=e.prefixCls,n=e.children,r=e.component,o=e.cellComponent,i=e.className,l=e.expanded,s=e.colSpan,c=e.isEmpty,u=h(S,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),d=u.scrollbarSize,f=u.fixHeader,p=u.fixColumn,m=u.componentWidth,g=u.horizonScroll,v=n;return(c?g&&m:p)&&(v=a.createElement("div",{style:{width:m-(f?d:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(t,"-expanded-row-fixed")},v)),a.createElement(r,{className:i,style:{display:l?null:"none"}},a.createElement(D,{component:o,prefixCls:t,colSpan:s},v))};function Y(e,t,n,r,o){var i,l,s=e.record,c=e.prefixCls,u=e.columnsKey,d=e.fixedInfoList,f=e.expandIconColumnIndex,p=e.nestExpandable,h=e.indentSize,m=e.expandIcon,g=e.expanded,v=e.hasNestChildren,y=e.onTriggerExpand,b=u[n],x=d[n];return n===(f||0)&&p&&(i=a.createElement(a.Fragment,null,a.createElement("span",{style:{paddingLeft:"".concat(h*r,"px")},className:"".concat(c,"-row-indent indent-level-").concat(r)}),m({prefixCls:c,expanded:g,expandable:v,record:s,onExpand:y}))),t.onCell&&(l=t.onCell(s,o)),{key:b,fixedInfo:x,appendCellNode:i,additionalCellProps:l||{}}}function Q(e){var t,n=e.className,r=e.style,o=e.record,i=e.index,l=e.renderIndex,s=e.rowKey,c=e.indent,u=void 0===c?0:c,d=e.rowComponent,f=e.cellComponent,p=e.scopeCellComponent,h=X(o,s,i,u),g=h.prefixCls,v=h.flattenColumns,y=h.expandedRowClassName,b=h.expandedRowRender,x=h.rowProps,w=h.expanded,k=h.rowSupportExpand,S=a.useRef(!1);S.current||(S.current=w);var E=a.createElement(d,(0,m.Z)({},x,{"data-row-key":s,className:_()(n,"".concat(g,"-row"),"".concat(g,"-row-level-").concat(u),null==x?void 0:x.className),style:(0,O.Z)((0,O.Z)({},r),null==x?void 0:x.style)}),v.map(function(e,t){var n=e.render,r=e.dataIndex,s=e.className,c=Y(h,e,t,u,i),d=c.key,v=c.fixedInfo,y=c.appendCellNode,b=c.additionalCellProps;return a.createElement(D,(0,m.Z)({className:s,ellipsis:e.ellipsis,align:e.align,scope:e.rowScope,component:e.rowScope?p:f,prefixCls:g,key:d,record:o,index:i,renderIndex:l,dataIndex:r,render:n,shouldCellUpdate:e.shouldCellUpdate},v,{appendNode:y,additionalProps:b}))}));if(k&&(S.current||w)){var C=b(o,i,u+1,w),j=y&&y(o,i,u);t=a.createElement(G,{expanded:w,className:_()("".concat(g,"-expanded-row"),"".concat(g,"-expanded-row-level-").concat(u+1),j),prefixCls:g,component:d,cellComponent:f,colSpan:v.length,isEmpty:!1},C)}return a.createElement(a.Fragment,null,E,t)}Q.displayName="BodyRow";var J=w(Q);function ee(e){var t=e.columnKey,n=e.onColumnResize,r=a.useRef();return a.useEffect(function(){r.current&&n(t,r.current.offsetWidth)},[]),a.createElement(q.Z,{data:t},a.createElement("td",{ref:r,style:{padding:0,border:0,height:0}},a.createElement("div",{style:{height:0,overflow:"hidden"}},"\xa0")))}function et(e){var t=e.prefixCls,n=e.columnsKey,r=e.onColumnResize;return a.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),style:{height:0,fontSize:0}},a.createElement(q.Z.Collection,{onBatchResize:function(e){e.forEach(function(e){r(e.data,e.size.offsetWidth)})}},n.map(function(e){return a.createElement(ee,{key:e,columnKey:e,onColumnResize:r})})))}function en(e){var t,n=e.data,r=e.measureColumnWidth,o=h(S,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),i=o.prefixCls,l=o.getComponent,s=o.onColumnResize,c=o.flattenColumns,u=o.getRowKey,d=o.expandedKeys,f=o.childrenColumnName,p=o.emptyNode,m=V(n,f,d,u),g=a.useRef({renderWithProps:!1}),v=l(["body","wrapper"],"tbody"),y=l(["body","row"],"tr"),b=l(["body","cell"],"td"),x=l(["body","cell"],"th");t=n.length?m.map(function(e,t){var n=e.record,r=e.indent,o=e.index,i=u(n,t);return a.createElement(J,{key:i,rowKey:i,record:n,index:t,renderIndex:o,rowComponent:y,cellComponent:b,scopeCellComponent:x,getRowKey:u,indent:r})}):a.createElement(G,{expanded:!0,className:"".concat(i,"-placeholder"),prefixCls:i,component:y,cellComponent:b,colSpan:c.length,isEmpty:!0},p);var w=M(c);return a.createElement(A.Provider,{value:g.current},a.createElement(v,{className:"".concat(i,"-tbody")},r&&a.createElement(et,{prefixCls:i,columnsKey:w,onColumnResize:s}),t))}en.displayName="Body";var er=w(en),eo=["expandable"],ea="RC_TABLE_INTERNAL_COL_DEFINE",ei=["columnType"],el=function(e){for(var t=e.colWidths,n=e.columns,r=e.columCount,o=[],i=r||n.length,l=!1,s=i-1;s>=0;s-=1){var c=t[s],u=n&&n[s],d=u&&u[ea];if(c||d||l){var f=d||{},p=(f.columnType,(0,z.Z)(f,ei));o.unshift(a.createElement("col",(0,m.Z)({key:s,style:{width:c}},p))),l=!0}}return a.createElement("colgroup",null,o)},es=n(83145),ec=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"],eu=a.forwardRef(function(e,t){var n=e.className,r=e.noData,o=e.columns,i=e.flattenColumns,l=e.colWidths,s=e.columCount,c=e.stickyOffsets,u=e.direction,d=e.fixHeader,f=e.stickyTopOffset,p=e.stickyBottomOffset,m=e.stickyClassName,v=e.onScroll,y=e.maxContentScroll,b=e.children,x=(0,z.Z)(e,ec),w=h(S,["prefixCls","scrollbarSize","isSticky"]),k=w.prefixCls,E=w.scrollbarSize,j=w.isSticky,P=j&&!d?0:E,N=a.useRef(null),T=a.useCallback(function(e){(0,g.mH)(t,e),(0,g.mH)(N,e)},[]);a.useEffect(function(){var e;function t(e){var t=e.currentTarget,n=e.deltaX;n&&(v({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}return null===(e=N.current)||void 0===e||e.addEventListener("wheel",t),function(){var e;null===(e=N.current)||void 0===e||e.removeEventListener("wheel",t)}},[]);var A=a.useMemo(function(){return i.every(function(e){return e.width})},[i]),M=i[i.length-1],I={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(k,"-cell-scrollbar")}}},R=(0,a.useMemo)(function(){return P?[].concat((0,es.Z)(o),[I]):o},[P,o]),D=(0,a.useMemo)(function(){return P?[].concat((0,es.Z)(i),[I]):i},[P,i]),L=(0,a.useMemo)(function(){var e=c.right,t=c.left;return(0,O.Z)((0,O.Z)({},c),{},{left:"rtl"===u?[].concat((0,es.Z)(t.map(function(e){return e+P})),[0]):t,right:"rtl"===u?e:[].concat((0,es.Z)(e.map(function(e){return e+P})),[0]),isSticky:j})},[P,c,j]),Z=(0,a.useMemo)(function(){for(var e=[],t=0;t<s;t+=1){var n=l[t];if(void 0===n)return null;e[t]=n}return e},[l.join("_"),s]);return a.createElement("div",{style:(0,O.Z)({overflow:"hidden"},j?{top:f,bottom:p}:{}),ref:T,className:_()(n,(0,C.Z)({},m,!!m))},a.createElement("table",{style:{tableLayout:"fixed",visibility:r||Z?null:"hidden"}},(!r||!y||A)&&a.createElement(el,{colWidths:Z?[].concat((0,es.Z)(Z),[P]):[],columCount:s+1,columns:D}),b((0,O.Z)((0,O.Z)({},x),{},{stickyOffsets:L,columns:R,flattenColumns:D}))))});eu.displayName="FixedHolder";var ed=a.memo(eu);function ef(e){var t,n=e.cells,r=e.stickyOffsets,o=e.flattenColumns,i=e.rowComponent,l=e.cellComponent,s=e.tdCellComponent,c=e.onHeaderRow,u=e.index,d=h(S,["prefixCls","direction"]),f=d.prefixCls,p=d.direction;c&&(t=c(n.map(function(e){return e.column}),u));var g=M(n.map(function(e){return e.column}));return a.createElement(i,t,n.map(function(e,t){var n,i=e.column,c=L(e.colStart,e.colEnd,o,r,p,i);return i&&i.onHeaderCell&&(n=e.column.onHeaderCell(i)),a.createElement(D,(0,m.Z)({},e,{scope:i.title?e.colSpan>1?"colgroup":"col":null,ellipsis:i.ellipsis,align:i.align,component:i.title?l:s,prefixCls:f,key:g[t]},c,{additionalProps:n,rowType:"header"}))}))}ef.displayName="HeaderRow";var ep=w(function(e){var t=e.stickyOffsets,n=e.columns,r=e.flattenColumns,o=e.onHeaderRow,i=h(S,["prefixCls","getComponent"]),l=i.prefixCls,s=i.getComponent,c=a.useMemo(function(){return function(e){var t=[];!function e(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[o]=t[o]||[];var a=r;return n.filter(Boolean).map(function(n){var r={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},i=1,l=n.children;return l&&l.length>0&&(i=e(l,a,o+1).reduce(function(e,t){return e+t},0),r.hasSubColumns=!0),"colSpan"in n&&(i=n.colSpan),"rowSpan"in n&&(r.rowSpan=n.rowSpan),r.colSpan=i,r.colEnd=r.colStart+i-1,t[o].push(r),a+=i,i})}(e,0);for(var n=t.length,r=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},o=0;o<n;o+=1)r(o);return t}(n)},[n]),u=s(["header","wrapper"],"thead"),d=s(["header","row"],"tr"),f=s(["header","cell"],"th"),p=s(["header","cell"],"td");return a.createElement(u,{className:"".concat(l,"-thead")},c.map(function(e,n){return a.createElement(ef,{key:n,flattenColumns:r,cells:e,stickyOffsets:t,rowComponent:d,cellComponent:f,tdCellComponent:p,onHeaderRow:o,index:n})}))}),eh=n(45287);function em(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var eg=["children"],ev=["fixed"];function ey(e){return(0,eh.Z)(e).filter(function(e){return a.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,r=n.children,o=(0,z.Z)(n,eg),a=(0,O.Z)({key:t},o);return r&&(a.children=ey(r)),a})}function eb(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,E.Z)(e)}).reduce(function(e,n,r){var o=n.fixed,a=!0===o?"left":o,i="".concat(t,"-").concat(r),l=n.children;return l&&l.length>0?[].concat((0,es.Z)(e),(0,es.Z)(eb(l,i).map(function(e){return(0,O.Z)({fixed:a},e)}))):[].concat((0,es.Z)(e),[(0,O.Z)((0,O.Z)({key:i},n),{},{fixed:a})])},[])}var ex=function(e,t){var n=e.prefixCls,r=e.columns,o=e.children,l=e.expandable,c=e.expandedKeys,u=e.columnTitle,d=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,h=e.rowExpandable,m=e.expandIconColumnIndex,g=e.direction,v=e.expandRowByClick,y=e.columnWidth,b=e.fixed,x=e.scrollWidth,w=e.clientWidth,k=a.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,E.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,O.Z)((0,O.Z)({},t),{},{children:e(n)}):t})}((r||ey(o)||[]).slice())},[r,o]),S=a.useMemo(function(){if(l){var e,t=k.slice();if(!t.includes(i)){var r=m||0;r>=0&&t.splice(r,0,i)}var o=t.indexOf(i);t=t.filter(function(e,t){return e!==i||t===o});var s=k[o];e=("left"===b||b)&&!m?"left":("right"===b||b)&&m===k.length?"right":s?s.fixed:null;var g=(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},ea,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",u),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",y),"render",function(e,t,r){var o=d(t,r),i=p({prefixCls:n,expanded:c.has(o),expandable:!h||h(t),record:t,onExpand:f});return v?a.createElement("span",{onClick:function(e){return e.stopPropagation()}},i):i});return t.map(function(e){return e===i?g:e})}return k.filter(function(e){return e!==i})},[l,k,d,c,p,g]),j=a.useMemo(function(){var e=S;return t&&(e=t(e)),e.length||(e=[{render:function(){return null}}]),e},[t,S,g]),_=a.useMemo(function(){return"rtl"===g?eb(j).map(function(e){var t=e.fixed,n=(0,z.Z)(e,ev),r=t;return"left"===t?r="right":"right"===t&&(r="left"),(0,O.Z)({fixed:r},n)}):eb(j)},[j,g,x]),P=a.useMemo(function(){if(x&&x>0){var e=0,t=0;_.forEach(function(n){var r=em(x,n.width);r?e+=r:t+=1});var n=Math.max(x,w),r=Math.max(n-e,t),o=t,a=r/t,i=0,l=_.map(function(e){var t=(0,O.Z)({},e),n=em(x,t.width);if(n)t.width=n;else{var l=Math.floor(a);t.width=1===o?r:l,r-=l,o-=1}return i+=t.width,t});if(i<n){var s=n/i;r=n,l.forEach(function(e,t){var n=Math.floor(e.width*s);e.width=t===l.length-1?r:n,r-=n})}return[l,Math.max(i,n)]}return[_,x]},[_,x,w]),N=(0,s.Z)(P,2);return[j,N[0],N[1]]};function ew(e){var t=e.prefixCls,n=e.record,r=e.onExpand,o=e.expanded,i=e.expandable,l="".concat(t,"-row-expand-icon");return i?a.createElement("span",{className:_()(l,(0,C.Z)((0,C.Z)({},"".concat(t,"-row-expanded"),o),"".concat(t,"-row-collapsed"),!o)),onClick:function(e){r(n,e),e.stopPropagation()}}):a.createElement("span",{className:_()(l,"".concat(t,"-row-spaced"))})}function ek(e){var t=(0,a.useRef)(e),n=(0,a.useState)({}),r=(0,s.Z)(n,2)[1],o=(0,a.useRef)(null),i=(0,a.useRef)([]);return(0,a.useEffect)(function(){return function(){o.current=null}},[]),[t.current,function(e){i.current.push(e);var n=Promise.resolve();o.current=n,n.then(function(){if(o.current===n){var e=i.current,a=t.current;i.current=[],e.forEach(function(e){t.current=e(t.current)}),o.current=null,a!==t.current&&r({})}})}]}var eS=(0,n(94981).Z)()?window:null,eE=function(e){var t=e.className,n=e.children;return a.createElement("div",{className:t},n)};function eO(e,t,n,r){var o=f.unstable_batchedUpdates?function(e){f.unstable_batchedUpdates(n,e)}:n;return null!=e&&e.addEventListener&&e.addEventListener(t,o,r),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,o,r)}}}function eC(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var ej=a.forwardRef(function(e,t){var n,r,o=e.scrollBodyRef,i=e.onScroll,l=e.offsetScroll,c=e.container,u=h(S,"prefixCls"),d=(null===(n=o.current)||void 0===n?void 0:n.scrollWidth)||0,f=(null===(r=o.current)||void 0===r?void 0:r.clientWidth)||0,p=d&&f/d*f,m=a.useRef(),g=ek({scrollLeft:0,isHiddenScrollBar:!1}),v=(0,s.Z)(g,2),y=v[0],b=v[1],x=a.useRef({delta:0,x:0}),w=a.useState(!1),k=(0,s.Z)(w,2),E=k[0],j=k[1],P=function(){j(!1)},N=function(e){var t,n=(e||(null===(t=window)||void 0===t?void 0:t.event)).buttons;if(!E||0===n){E&&j(!1);return}var r=x.current.x+e.pageX-x.current.x-x.current.delta;r<=0&&(r=0),r+p>=f&&(r=f-p),i({scrollLeft:r/f*(d+2)}),x.current.x=e.pageX},T=function(){if(o.current){var e=eC(o.current).top,t=e+o.current.offsetHeight,n=c===window?document.documentElement.scrollTop+window.innerHeight:eC(c).top+c.clientHeight;t-(0,K.Z)()<=n||e>=n-l?b(function(e){return(0,O.Z)((0,O.Z)({},e),{},{isHiddenScrollBar:!0})}):b(function(e){return(0,O.Z)((0,O.Z)({},e),{},{isHiddenScrollBar:!1})})}},A=function(e){b(function(t){return(0,O.Z)((0,O.Z)({},t),{},{scrollLeft:e/d*f||0})})};return(a.useImperativeHandle(t,function(){return{setScrollLeft:A}}),a.useEffect(function(){var e=eO(document.body,"mouseup",P,!1),t=eO(document.body,"mousemove",N,!1);return T(),function(){e.remove(),t.remove()}},[p,E]),a.useEffect(function(){var e=eO(c,"scroll",T,!1),t=eO(window,"resize",T,!1);return function(){e.remove(),t.remove()}},[c]),a.useEffect(function(){y.isHiddenScrollBar||b(function(e){var t=o.current;return t?(0,O.Z)((0,O.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[y.isHiddenScrollBar]),d<=f||!p||y.isHiddenScrollBar)?null:a.createElement("div",{style:{height:(0,K.Z)(),width:f,bottom:l},className:"".concat(u,"-sticky-scroll")},a.createElement("div",{onMouseDown:function(e){e.persist(),x.current.delta=e.pageX-y.scrollLeft,x.current.x=0,j(!0),e.preventDefault()},ref:m,className:_()("".concat(u,"-sticky-scroll-bar"),(0,C.Z)({},"".concat(u,"-sticky-scroll-bar-active"),E)),style:{width:"".concat(p,"px"),transform:"translate3d(".concat(y.scrollLeft,"px, 0, 0)")}}))}),e_="rc-table",eP=[],eN={};function eT(){return"No Data"}var eA=a.forwardRef(function(e,t){var n,r=(0,O.Z)({rowKey:"key",prefixCls:e_,emptyText:eT},e),o=r.prefixCls,i=r.className,u=r.rowClassName,f=r.style,p=r.data,h=r.rowKey,g=r.scroll,v=r.tableLayout,y=r.direction,b=r.title,x=r.footer,w=r.summary,k=r.caption,j=r.id,T=r.showHeader,A=r.components,I=r.emptyText,R=r.onRow,D=r.onHeaderRow,Z=r.internalHooks,B=r.transformColumns,V=r.internalRefs,X=r.tailor,G=r.getContainerWidth,Y=r.sticky,Q=p||eP,J=!!Q.length,ee=Z===l,et=a.useCallback(function(e,t){return(0,N.Z)(A,e)||t},[A]),en=a.useMemo(function(){return"function"==typeof h?h:function(e){return e&&e[h]}},[h]),ea=et(["body"]),ei=(tH=a.useState(-1),tW=(tq=(0,s.Z)(tH,2))[0],tU=tq[1],tK=a.useState(-1),tV=(t$=(0,s.Z)(tK,2))[0],tX=t$[1],[tW,tV,a.useCallback(function(e,t){tU(e),tX(t)},[])]),ec=(0,s.Z)(ei,3),eu=ec[0],ef=ec[1],eh=ec[2],em=(tJ=(tY=r.expandable,tQ=(0,z.Z)(r,eo),!1===(tG="expandable"in r?(0,O.Z)((0,O.Z)({},tQ),tY):tQ).showExpandColumn&&(tG.expandIconColumnIndex=-1),tG).expandIcon,t0=tG.expandedRowKeys,t1=tG.defaultExpandedRowKeys,t2=tG.defaultExpandAllRows,t6=tG.expandedRowRender,t4=tG.onExpand,t3=tG.onExpandedRowsChange,t5=tG.childrenColumnName||"children",t8=a.useMemo(function(){return t6?"row":!!(r.expandable&&r.internalHooks===l&&r.expandable.__PARENT_RENDER_ICON__||Q.some(function(e){return e&&"object"===(0,E.Z)(e)&&e[t5]}))&&"nest"},[!!t6,Q]),t7=a.useState(function(){if(t1)return t1;if(t2){var e;return e=[],function t(n){(n||[]).forEach(function(n,r){e.push(en(n,r)),t(n[t5])})}(Q),e}return[]}),ne=(t9=(0,s.Z)(t7,2))[0],nt=t9[1],nn=a.useMemo(function(){return new Set(t0||ne||[])},[t0,ne]),nr=a.useCallback(function(e){var t,n=en(e,Q.indexOf(e)),r=nn.has(n);r?(nn.delete(n),t=(0,es.Z)(nn)):t=[].concat((0,es.Z)(nn),[n]),nt(t),t4&&t4(!r,e),t3&&t3(t)},[en,nn,Q,t4,t3]),[tG,t8,nn,tJ||ew,t5,nr]),eg=(0,s.Z)(em,6),ev=eg[0],ey=eg[1],eb=eg[2],eO=eg[3],eC=eg[4],eA=eg[5],eM=null==g?void 0:g.x,eI=a.useState(0),eR=(0,s.Z)(eI,2),eD=eR[0],eL=eR[1],eZ=ex((0,O.Z)((0,O.Z)((0,O.Z)({},r),ev),{},{expandable:!!ev.expandedRowRender,columnTitle:ev.columnTitle,expandedKeys:eb,getRowKey:en,onTriggerExpand:eA,expandIcon:eO,expandIconColumnIndex:ev.expandIconColumnIndex,direction:y,scrollWidth:ee&&X&&"number"==typeof eM?eM:null,clientWidth:eD}),ee?B:null),ez=(0,s.Z)(eZ,3),eB=ez[0],eF=ez[1],eH=ez[2],eq=null!=eH?eH:eM,eW=a.useMemo(function(){return{columns:eB,flattenColumns:eF}},[eB,eF]),eU=a.useRef(),eK=a.useRef(),e$=a.useRef(),eV=a.useRef();a.useImperativeHandle(t,function(){return{nativeElement:eU.current,scrollTo:function(e){var t;if(e$.current instanceof HTMLElement){var n=e.index,r=e.top,o=e.key;if(r)null===(a=e$.current)||void 0===a||a.scrollTo({top:r});else{var a,i,l=null!=o?o:en(Q[n]);null===(i=e$.current.querySelector('[data-row-key="'.concat(l,'"]')))||void 0===i||i.scrollIntoView()}}else null!==(t=e$.current)&&void 0!==t&&t.scrollTo&&e$.current.scrollTo(e)}}});var eX=a.useRef(),eG=a.useState(!1),eY=(0,s.Z)(eG,2),eQ=eY[0],eJ=eY[1],e0=a.useState(!1),e1=(0,s.Z)(e0,2),e2=e1[0],e6=e1[1],e4=ek(new Map),e3=(0,s.Z)(e4,2),e5=e3[0],e8=e3[1],e7=M(eF).map(function(e){return e5.get(e)}),e9=a.useMemo(function(){return e7},[e7.join("_")]),te=(no=eF.length,(0,a.useMemo)(function(){for(var e=[],t=[],n=0,r=0,o=0;o<no;o+=1)if("rtl"===y){t[o]=r,r+=e9[o]||0;var a=no-o-1;e[a]=n,n+=e9[a]||0}else{e[o]=n,n+=e9[o]||0;var i=no-o-1;t[i]=r,r+=e9[i]||0}return{left:e,right:t}},[e9,no,y])),tt=g&&null!=g.y,tn=g&&null!=eq||!!ev.fixed,tr=tn&&eF.some(function(e){return e.fixed}),to=a.useRef(),ta=(nl=void 0===(ni=(na="object"===(0,E.Z)(Y)?Y:{}).offsetHeader)?0:ni,nc=void 0===(ns=na.offsetSummary)?0:ns,nd=void 0===(nu=na.offsetScroll)?0:nu,np=(void 0===(nf=na.getContainer)?function(){return eS}:nf)()||eS,a.useMemo(function(){var e=!!Y;return{isSticky:e,stickyClassName:e?"".concat(o,"-sticky-holder"):"",offsetHeader:nl,offsetSummary:nc,offsetScroll:nd,container:np}},[nd,nl,nc,o,np])),ti=ta.isSticky,tl=ta.offsetHeader,ts=ta.offsetSummary,tc=ta.offsetScroll,tu=ta.stickyClassName,td=ta.container,tf=a.useMemo(function(){return null==w?void 0:w(Q)},[w,Q]),tp=(tt||ti)&&a.isValidElement(tf)&&tf.type===F&&tf.props.fixed;tt&&(nm={overflowY:"scroll",maxHeight:g.y}),tn&&(nh={overflowX:"auto"},tt||(nm={overflowY:"hidden"}),ng={width:!0===eq?"auto":eq,minWidth:"100%"});var th=a.useCallback(function(e,t){(0,W.Z)(eU.current)&&e8(function(n){if(n.get(e)!==t){var r=new Map(n);return r.set(e,t),r}return n})},[]),tm=function(e){var t=(0,a.useRef)(null),n=(0,a.useRef)();function r(){window.clearTimeout(n.current)}return(0,a.useEffect)(function(){return r},[]),[function(e){t.current=e,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)},function(){return t.current}]}(0),tg=(0,s.Z)(tm,2),tv=tg[0],ty=tg[1];function tb(e,t){t&&("function"==typeof t?t(e):t.scrollLeft!==e&&(t.scrollLeft=e,t.scrollLeft!==e&&setTimeout(function(){t.scrollLeft=e},0)))}var tx=(0,c.Z)(function(e){var t,n=e.currentTarget,r=e.scrollLeft,o="rtl"===y,a="number"==typeof r?r:n.scrollLeft,i=n||eN;ty()&&ty()!==i||(tv(i),tb(a,eK.current),tb(a,e$.current),tb(a,eX.current),tb(a,null===(t=to.current)||void 0===t?void 0:t.setScrollLeft));var l=n||eK.current;if(l){var s=l.scrollWidth,c=l.clientWidth;if(s===c){eJ(!1),e6(!1);return}o?(eJ(-a<s-c),e6(-a>0)):(eJ(a>0),e6(a<s-c))}}),tw=function(){tn&&e$.current?tx({currentTarget:e$.current}):(eJ(!1),e6(!1))},tk=a.useRef(!1);a.useEffect(function(){tk.current&&tw()},[tn,p,eB.length]),a.useEffect(function(){tk.current=!0},[]);var tS=a.useState(0),tE=(0,s.Z)(tS,2),tO=tE[0],tC=tE[1],tj=a.useState(!0),t_=(0,s.Z)(tj,2),tP=t_[0],tN=t_[1];a.useEffect(function(){X&&ee||(e$.current instanceof Element?tC((0,K.o)(e$.current).width):tC((0,K.o)(eV.current).width)),tN((0,U.G)("position","sticky"))},[]),a.useEffect(function(){ee&&V&&(V.body.current=e$.current)});var tT=a.useCallback(function(e){return a.createElement(a.Fragment,null,a.createElement(ep,e),"top"===tp&&a.createElement(H,e,tf))},[tp,tf]),tA=a.useCallback(function(e){return a.createElement(H,e,tf)},[tf]),tM=et(["table"],"table"),tI=a.useMemo(function(){return v||(tr?"max-content"===eq?"auto":"fixed":tt||ti||eF.some(function(e){return e.ellipsis})?"fixed":"auto")},[tt,tr,eF,v,ti]),tR={colWidths:e9,columCount:eF.length,stickyOffsets:te,onHeaderRow:D,fixHeader:tt,scroll:g},tD=a.useMemo(function(){return J?null:"function"==typeof I?I():I},[J,I]),tL=a.createElement(er,{data:Q,measureColumnWidth:tt||tn||ti}),tZ=a.createElement(el,{colWidths:eF.map(function(e){return e.width}),columns:eF}),tz=null!=k?a.createElement("caption",{className:"".concat(o,"-caption")},k):void 0,tB=(0,$.Z)(r,{data:!0}),tF=(0,$.Z)(r,{aria:!0});if(tt||ti){"function"==typeof ea?(ny=ea(Q,{scrollbarSize:tO,ref:e$,onScroll:tx}),tR.colWidths=eF.map(function(e,t){var n=e.width,r=t===eF.length-1?n-tO:n;return"number"!=typeof r||Number.isNaN(r)?0:r})):ny=a.createElement("div",{style:(0,O.Z)((0,O.Z)({},nh),nm),onScroll:tx,ref:e$,className:_()("".concat(o,"-body"))},a.createElement(tM,(0,m.Z)({style:(0,O.Z)((0,O.Z)({},ng),{},{tableLayout:tI})},tF),tz,tZ,tL,!tp&&tf&&a.createElement(H,{stickyOffsets:te,flattenColumns:eF,columns:eB},tf)));var tH,tq,tW,tU,tK,t$,tV,tX,tG,tY,tQ,tJ,t0,t1,t2,t6,t4,t3,t5,t8,t7,t9,ne,nt,nn,nr,no,na,ni,nl,ns,nc,nu,nd,nf,np,nh,nm,ng,nv,ny,nb=(0,O.Z)((0,O.Z)((0,O.Z)({noData:!Q.length,maxContentScroll:tn&&"max-content"===eq},tR),eW),{},{direction:y,stickyClassName:tu,onScroll:tx});nv=a.createElement(a.Fragment,null,!1!==T&&a.createElement(ed,(0,m.Z)({},nb,{stickyTopOffset:tl,className:"".concat(o,"-header"),ref:eK}),tT),ny,tp&&"top"!==tp&&a.createElement(ed,(0,m.Z)({},nb,{stickyBottomOffset:ts,className:"".concat(o,"-summary"),ref:eX}),tA),ti&&e$.current&&e$.current instanceof Element&&a.createElement(ej,{ref:to,offsetScroll:tc,scrollBodyRef:e$,onScroll:tx,container:td}))}else nv=a.createElement("div",{style:(0,O.Z)((0,O.Z)({},nh),nm),className:_()("".concat(o,"-content")),onScroll:tx,ref:e$},a.createElement(tM,(0,m.Z)({style:(0,O.Z)((0,O.Z)({},ng),{},{tableLayout:tI})},tF),tz,tZ,!1!==T&&a.createElement(ep,(0,m.Z)({},tR,eW)),tL,tf&&a.createElement(H,{stickyOffsets:te,flattenColumns:eF,columns:eB},tf)));var nx=a.createElement("div",(0,m.Z)({className:_()(o,i,(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},"".concat(o,"-rtl"),"rtl"===y),"".concat(o,"-ping-left"),eQ),"".concat(o,"-ping-right"),e2),"".concat(o,"-layout-fixed"),"fixed"===v),"".concat(o,"-fixed-header"),tt),"".concat(o,"-fixed-column"),tr),"".concat(o,"-scroll-horizontal"),tn),"".concat(o,"-has-fix-left"),eF[0]&&eF[0].fixed),"".concat(o,"-has-fix-right"),eF[eF.length-1]&&"right"===eF[eF.length-1].fixed)),style:f,id:j,ref:eU},tB),b&&a.createElement(eE,{className:"".concat(o,"-title")},b(Q)),a.createElement("div",{ref:eV,className:"".concat(o,"-container")},nv),x&&a.createElement(eE,{className:"".concat(o,"-footer")},x(Q)));tn&&(nx=a.createElement(q.Z,{onResize:function(e){var t=e.width,n=eU.current?eU.current.offsetWidth:t;ee&&G&&eU.current&&(n=G(eU.current,n)||n),n!==eD&&(tw(),eL(n))}},nx));var nw=(n=eF.map(function(e,t){return L(t,t,eF,te,y,null==eB?void 0:eB[t])}),(0,P.Z)(function(){return n},[n],function(e,t){return!(0,d.Z)(e,t)})),nk=a.useMemo(function(){return{scrollX:eq,prefixCls:o,getComponent:et,scrollbarSize:tO,direction:y,fixedInfoList:nw,isSticky:ti,supportSticky:tP,componentWidth:eD,fixHeader:tt,fixColumn:tr,horizonScroll:tn,tableLayout:tI,rowClassName:u,expandedRowClassName:ev.expandedRowClassName,expandIcon:eO,expandableType:ey,expandRowByClick:ev.expandRowByClick,expandedRowRender:ev.expandedRowRender,onTriggerExpand:eA,expandIconColumnIndex:ev.expandIconColumnIndex,indentSize:ev.indentSize,allColumnsFixedLeft:eF.every(function(e){return"left"===e.fixed}),emptyNode:tD,columns:eB,flattenColumns:eF,onColumnResize:th,hoverStartRow:eu,hoverEndRow:ef,onHover:eh,rowExpandable:ev.rowExpandable,onRow:R,getRowKey:en,expandedKeys:eb,childrenColumnName:eC}},[eq,o,et,tO,y,nw,ti,tP,eD,tt,tr,tn,tI,u,ev.expandedRowClassName,eO,ey,ev.expandRowByClick,ev.expandedRowRender,eA,ev.expandIconColumnIndex,ev.indentSize,tD,eB,eF,th,eu,ef,eh,ev.rowExpandable,R,en,eb,eC]);return a.createElement(S.Provider,{value:nk},nx)}),eM=x(eA,void 0);eM.EXPAND_COLUMN=i,eM.INTERNAL_HOOKS=l,eM.Column=function(e){return null},eM.ColumnGroup=function(e){return null},eM.Summary=F;var eI=n(48625),eR=p(null),eD=p(null),eL=function(e){var t,n=e.rowInfo,r=e.column,o=e.colIndex,i=e.indent,l=e.index,s=e.renderIndex,c=e.record,u=e.style,d=e.className,f=e.inverse,p=e.getHeight,g=r.render,v=r.dataIndex,y=r.className,b=r.width,x=h(eD,["columnsOffset"]).columnsOffset,w=Y(n,r,o,i,l),k=w.key,S=w.fixedInfo,E=w.appendCellNode,C=w.additionalCellProps,j=C.style,P=C.colSpan,N=void 0===P?1:P,T=C.rowSpan,A=void 0===T?1:T,M=x[(t=o-1)+(N||1)]-(x[t]||0),I=(0,O.Z)((0,O.Z)((0,O.Z)({},j),u),{},{flex:"0 0 ".concat(M,"px"),width:"".concat(M,"px"),marginRight:N>1?b-M:0,pointerEvents:"auto"}),R=a.useMemo(function(){return f?A<=1:0===N||0===A||A>1},[A,N,f]);R?I.visibility="hidden":f&&(I.height=null==p?void 0:p(A));var L={};return(0===A||0===N)&&(L.rowSpan=1,L.colSpan=1),a.createElement(D,(0,m.Z)({className:_()(y,d),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:"div",prefixCls:n.prefixCls,key:k,record:c,index:l,renderIndex:s,dataIndex:v,render:R?function(){return null}:g,shouldCellUpdate:r.shouldCellUpdate},S,{appendNode:E,additionalProps:(0,O.Z)((0,O.Z)({},C),{},{style:I},L)}))},eZ=["data","index","className","rowKey","style","extra","getHeight"],ez=w(a.forwardRef(function(e,t){var n,r=e.data,o=e.index,i=e.className,l=e.rowKey,s=e.style,c=e.extra,u=e.getHeight,d=(0,z.Z)(e,eZ),f=r.record,p=r.indent,g=r.index,v=h(S,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),y=v.scrollX,b=v.flattenColumns,x=v.prefixCls,w=v.fixColumn,k=v.componentWidth,E=X(f,l,o,p),j=E.rowSupportExpand,P=E.expanded,N=E.rowProps,T=E.expandedRowRender,A=E.expandedRowClassName;if(j&&P){var M=T(f,o,p+1,P),I=null==A?void 0:A(f,o,p),R={};w&&(R={style:(0,C.Z)({},"--virtual-width","".concat(k,"px"))});var L="".concat(x,"-expanded-row-cell");n=a.createElement("div",{className:_()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(p+1),I)},a.createElement(D,{component:"div",prefixCls:x,className:_()(L,(0,C.Z)({},"".concat(L,"-fixed"),w)),additionalProps:R},M))}var Z=(0,O.Z)((0,O.Z)({},s),{},{width:y});c&&(Z.position="absolute",Z.pointerEvents="none");var B=a.createElement("div",(0,m.Z)({},N,d,{ref:j?null:t,className:_()(i,"".concat(x,"-row"),null==N?void 0:N.className,(0,C.Z)({},"".concat(x,"-row-extra"),c)),style:(0,O.Z)((0,O.Z)({},Z),null==N?void 0:N.style)}),b.map(function(e,t){return a.createElement(eL,{key:t,rowInfo:E,column:e,colIndex:t,indent:p,index:o,renderIndex:g,record:f,inverse:c,getHeight:u})}));return j?a.createElement("div",{ref:t},B,n):B})),eB=w(a.forwardRef(function(e,t){var n,r=e.data,o=e.onScroll,i=h(S,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","emptyNode","scrollX"]),l=i.flattenColumns,c=i.onColumnResize,u=i.getRowKey,d=i.expandedKeys,f=i.prefixCls,p=i.childrenColumnName,g=i.emptyNode,v=i.scrollX,y=h(eR),b=y.sticky,x=y.scrollY,w=y.listItemHeight,k=a.useRef(),O=V(r,p,d,u),C=a.useMemo(function(){var e=0;return l.map(function(t){var n=t.width,r=t.key;return e+=n,[r,n,e]})},[l]),j=a.useMemo(function(){return C.map(function(e){return e[2]})},[C]);a.useEffect(function(){C.forEach(function(e){var t=(0,s.Z)(e,2);c(t[0],t[1])})},[C]),a.useImperativeHandle(t,function(){var e={scrollTo:function(e){var t;null===(t=k.current)||void 0===t||t.scrollTo(e)}};return Object.defineProperty(e,"scrollLeft",{get:function(){var e;return(null===(e=k.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=k.current)||void 0===t||t.scrollTo({left:e})}}),e});var P=function(e,t){var n=null===(o=O[t])||void 0===o?void 0:o.record,r=e.onCell;if(r){var o,a,i=r(n,t);return null!==(a=null==i?void 0:i.rowSpan)&&void 0!==a?a:1}return 1},N=a.useMemo(function(){return{columnsOffset:j}},[j]),T="".concat(f,"-tbody");if(O.length){var A={};b&&(A.position="sticky",A.bottom=0,"object"===(0,E.Z)(b)&&b.offsetScroll&&(A.bottom=b.offsetScroll)),n=a.createElement(eI.Z,{fullHeight:!1,ref:k,styles:{horizontalScrollBar:A},className:_()(T,"".concat(T,"-virtual")),height:x,itemHeight:w||24,data:O,itemKey:function(e){return u(e.record)},scrollWidth:v,onVirtualScroll:function(e){o({scrollLeft:e.x})},extraRender:function(e){var t=e.start,n=e.end,r=e.getSize,o=e.offsetY;if(n<0)return null;for(var i=l.filter(function(e){return 0===P(e,t)}),s=t,c=function(e){if(!(i=i.filter(function(t){return 0===P(t,e)})).length)return s=e,1},d=t;d>=0&&!c(d);d-=1);for(var f=l.filter(function(e){return 1!==P(e,n)}),p=n,h=function(e){if(!(f=f.filter(function(t){return 1!==P(t,e)})).length)return p=Math.max(e-1,n),1},m=n;m<O.length&&!h(m);m+=1);for(var g=[],v=function(e){if(!O[e])return 1;l.some(function(t){return P(t,e)>1})&&g.push(e)},y=s;y<=p;y+=1)if(v(y))continue;return g.map(function(e){var t=O[e],n=u(t.record,e),i=r(n);return a.createElement(ez,{key:e,data:t,rowKey:n,index:e,style:{top:-o+i.top},extra:!0,getHeight:function(t){var o=e+t-1,a=r(n,u(O[o].record,o));return a.bottom-a.top}})})}},function(e,t,n){var r=u(e.record,t);return a.createElement(ez,(0,m.Z)({data:e,rowKey:r,index:t},n))})}else n=a.createElement("div",{className:_()("".concat(f,"-placeholder"))},a.createElement(D,{component:"div",prefixCls:f},g));return a.createElement(eD.Provider,{value:N},n)})),eF=function(e,t){var n=t.ref,r=t.onScroll;return a.createElement(eB,{ref:n,data:e,onScroll:r})},eH=a.forwardRef(function(e,t){var n=e.columns,r=e.scroll,o=e.sticky,i=e.prefixCls,s=void 0===i?e_:i,c=e.className,u=e.listItemHeight,d=e.components,f=r||{},p=f.x,h=f.y;"number"!=typeof p&&(p=1),"number"!=typeof h&&(h=500);var g=a.useMemo(function(){return{sticky:o,scrollY:h,listItemHeight:u}},[o,h,u]);return a.createElement(eR.Provider,{value:g},a.createElement(eM,(0,m.Z)({},e,{className:_()(c,"".concat(s,"-virtual")),scroll:(0,O.Z)((0,O.Z)({},r),{},{x:p}),components:(0,O.Z)((0,O.Z)({},d),{},{body:eF}),columns:n,internalHooks:l,tailor:!0,ref:t})))});x(eH,void 0);var eq=n(70464),eW=n(76405),eU=n(25049),eK=n(63496),e$=n(15354),eV=n(15900),eX=a.createContext(null),eG=a.memo(function(e){for(var t,n=e.prefixCls,r=e.level,o=e.isStart,i=e.isEnd,l="".concat(n,"-indent-unit"),s=[],c=0;c<r;c+=1)s.push(a.createElement("span",{key:c,className:_()(l,(t={},(0,C.Z)(t,"".concat(l,"-start"),o[c]),(0,C.Z)(t,"".concat(l,"-end"),i[c]),t))}));return a.createElement("span",{"aria-hidden":"true",className:"".concat(n,"-indent")},s)}),eY=n(18694),eQ=["children"];function eJ(e,t){return"".concat(e,"-").concat(t)}function e0(e,t){return null!=e?e:t}function e1(e){var t=e||{},n=t.title,r=t._title,o=t.key,a=t.children,i=n||"title";return{title:i,_title:r||[i],key:o||"key",children:a||"children"}}function e2(e){return function e(t){return(0,eh.Z)(t).map(function(t){if(!(t&&t.type&&t.type.isTreeNode))return(0,T.ZP)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,r=t.props,o=r.children,a=(0,z.Z)(r,eQ),i=(0,O.Z)({key:n},a),l=e(o);return l.length&&(i.children=l),i}).filter(function(e){return e})}(e)}function e6(e,t,n){var r=e1(n),o=r._title,a=r.key,i=r.children,l=new Set(!0===t?[]:t),s=[];return!function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(c,u){for(var d,f=eJ(r?r.pos:"0",u),p=e0(c[a],f),h=0;h<o.length;h+=1){var m=o[h];if(void 0!==c[m]){d=c[m];break}}var g=(0,O.Z)((0,O.Z)({},(0,eY.Z)(c,[].concat((0,es.Z)(o),[a,i]))),{},{title:d,key:p,parent:r,pos:f,children:null,data:c,isStart:[].concat((0,es.Z)(r?r.isStart:[]),[0===u]),isEnd:[].concat((0,es.Z)(r?r.isEnd:[]),[u===n.length-1])});return s.push(g),!0===t||l.has(p)?g.children=e(c[i]||[],g):g.children=[],g})}(e),s}function e4(e){var t,n,r,o,a,i,l,s,c,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=d.initWrapper,p=d.processEntity,h=d.onProcessFinished,m=d.externalGetKey,g=d.childrenPropName,v=d.fieldNames,y=arguments.length>2?arguments[2]:void 0,b={},x={},w={posEntities:b,keyEntities:x};return f&&(w=f(w)||w),t=function(e){var t=e.node,n=e.index,r=e.pos,o=e.key,a=e.parentPos,i=e.level,l={node:t,nodes:e.nodes,index:n,key:o,pos:r,level:i},s=e0(o,r);b[r]=l,x[s]=l,l.parent=b[a],l.parent&&(l.parent.children=l.parent.children||[],l.parent.children.push(l)),p&&p(l,w)},n={externalGetKey:m||y,childrenPropName:g,fieldNames:v},a=(o=("object"===(0,E.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,i=o.externalGetKey,s=(l=e1(o.fieldNames)).key,c=l.children,u=a||c,i?"string"==typeof i?r=function(e){return e[i]}:"function"==typeof i&&(r=function(e){return i(e)}):r=function(e,t){return e0(e[s],t)},function n(o,a,i,l){var s=o?o[u]:e,c=o?eJ(i.pos,a):"0",d=o?[].concat((0,es.Z)(l),[o]):[];if(o){var f=r(o,c);t({node:o,index:a,pos:c,key:f,parentPos:i.node?i.pos:null,level:i.level+1,nodes:d})}s&&s.forEach(function(e,t){n(e,t,{node:o,pos:c,level:i?i.level+1:-1},d)})}(null),h&&h(w),w}function e3(e,t){var n=t.expandedKeys,r=t.selectedKeys,o=t.loadedKeys,a=t.loadingKeys,i=t.checkedKeys,l=t.halfCheckedKeys,s=t.dragOverNodeKey,c=t.dropPosition,u=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==r.indexOf(e),loaded:-1!==o.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==i.indexOf(e),halfChecked:-1!==l.indexOf(e),pos:String(u?u.pos:""),dragOver:s===e&&0===c,dragOverGapTop:s===e&&-1===c,dragOverGapBottom:s===e&&1===c}}function e5(e){var t=e.data,n=e.expanded,r=e.selected,o=e.checked,a=e.loaded,i=e.loading,l=e.halfChecked,s=e.dragOver,c=e.dragOverGapTop,u=e.dragOverGapBottom,d=e.pos,f=e.active,p=e.eventKey,h=(0,O.Z)((0,O.Z)({},t),{},{expanded:n,selected:r,checked:o,loaded:a,loading:i,halfChecked:l,dragOver:s,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:f,key:p});return"props"in h||Object.defineProperty(h,"props",{get:function(){return(0,T.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),h}var e8=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e7="open",e9="close",te=function(e){(0,e$.Z)(n,e);var t=(0,eV.Z)(n);function n(){var e;(0,eW.Z)(this,n);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={dragNodeHighlight:!1},e.selectHandle=void 0,e.cacheIndent=void 0,e.onSelectorClick=function(t){(0,e.props.context.onNodeClick)(t,e5(e.props)),e.isSelectable()?e.onSelect(t):e.onCheck(t)},e.onSelectorDoubleClick=function(t){(0,e.props.context.onNodeDoubleClick)(t,e5(e.props))},e.onSelect=function(t){e.isDisabled()||(0,e.props.context.onNodeSelect)(t,e5(e.props))},e.onCheck=function(t){if(!e.isDisabled()){var n=e.props,r=n.disableCheckbox,o=n.checked,a=e.props.context.onNodeCheck;e.isCheckable()&&!r&&a(t,e5(e.props),!o)}},e.onMouseEnter=function(t){(0,e.props.context.onNodeMouseEnter)(t,e5(e.props))},e.onMouseLeave=function(t){(0,e.props.context.onNodeMouseLeave)(t,e5(e.props))},e.onContextMenu=function(t){(0,e.props.context.onNodeContextMenu)(t,e5(e.props))},e.onDragStart=function(t){var n=e.props.context.onNodeDragStart;t.stopPropagation(),e.setState({dragNodeHighlight:!0}),n(t,(0,eK.Z)(e));try{t.dataTransfer.setData("text/plain","")}catch(e){}},e.onDragEnter=function(t){var n=e.props.context.onNodeDragEnter;t.preventDefault(),t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragOver=function(t){var n=e.props.context.onNodeDragOver;t.preventDefault(),t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragLeave=function(t){var n=e.props.context.onNodeDragLeave;t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragEnd=function(t){var n=e.props.context.onNodeDragEnd;t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,eK.Z)(e))},e.onDrop=function(t){var n=e.props.context.onNodeDrop;t.preventDefault(),t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,eK.Z)(e))},e.onExpand=function(t){var n=e.props,r=n.loading,o=n.context.onNodeExpand;r||o(t,e5(e.props))},e.setSelectHandle=function(t){e.selectHandle=t},e.getNodeState=function(){var t=e.props.expanded;return e.isLeaf()?null:t?e7:e9},e.hasChildren=function(){var t=e.props.eventKey;return!!((e.props.context.keyEntities[t]||{}).children||[]).length},e.isLeaf=function(){var t=e.props,n=t.isLeaf,r=t.loaded,o=e.props.context.loadData,a=e.hasChildren();return!1!==n&&(n||!o&&!a||o&&r&&!a)},e.isDisabled=function(){var t=e.props.disabled;return!!(e.props.context.disabled||t)},e.isCheckable=function(){var t=e.props.checkable,n=e.props.context.checkable;return!!n&&!1!==t&&n},e.syncLoadData=function(t){var n=t.expanded,r=t.loading,o=t.loaded,a=e.props.context,i=a.loadData,l=a.onNodeLoad;!r&&(!i||!n||e.isLeaf()||e.hasChildren()||o||l(e5(e.props)))},e.isDraggable=function(){var t=e.props,n=t.data,r=t.context.draggable;return!!(r&&(!r.nodeDraggable||r.nodeDraggable(n)))},e.renderDragHandler=function(){var t=e.props.context,n=t.draggable,r=t.prefixCls;return(null==n?void 0:n.icon)?a.createElement("span",{className:"".concat(r,"-draggable-icon")},n.icon):null},e.renderSwitcherIconDom=function(t){var n=e.props.switcherIcon,r=e.props.context.switcherIcon,o=n||r;return"function"==typeof o?o((0,O.Z)((0,O.Z)({},e.props),{},{isLeaf:t})):o},e.renderSwitcher=function(){var t=e.props.expanded,n=e.props.context.prefixCls;if(e.isLeaf()){var r=e.renderSwitcherIconDom(!0);return!1!==r?a.createElement("span",{className:_()("".concat(n,"-switcher"),"".concat(n,"-switcher-noop"))},r):null}var o=_()("".concat(n,"-switcher"),"".concat(n,"-switcher_").concat(t?e7:e9)),i=e.renderSwitcherIconDom(!1);return!1!==i?a.createElement("span",{onClick:e.onExpand,className:o},i):null},e.renderCheckbox=function(){var t=e.props,n=t.checked,r=t.halfChecked,o=t.disableCheckbox,i=e.props.context.prefixCls,l=e.isDisabled(),s=e.isCheckable();return s?a.createElement("span",{className:_()("".concat(i,"-checkbox"),n&&"".concat(i,"-checkbox-checked"),!n&&r&&"".concat(i,"-checkbox-indeterminate"),(l||o)&&"".concat(i,"-checkbox-disabled")),onClick:e.onCheck},"boolean"!=typeof s?s:null):null},e.renderIcon=function(){var t=e.props.loading,n=e.props.context.prefixCls;return a.createElement("span",{className:_()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(e.getNodeState()||"docu"),t&&"".concat(n,"-icon_loading"))})},e.renderSelector=function(){var t,n,r=e.state.dragNodeHighlight,o=e.props,i=o.title,l=void 0===i?"---":i,s=o.selected,c=o.icon,u=o.loading,d=o.data,f=e.props.context,p=f.prefixCls,h=f.showIcon,m=f.icon,g=f.loadData,v=f.titleRender,y=e.isDisabled(),b="".concat(p,"-node-content-wrapper");if(h){var x=c||m;t=x?a.createElement("span",{className:_()("".concat(p,"-iconEle"),"".concat(p,"-icon__customize"))},"function"==typeof x?x(e.props):x):e.renderIcon()}else g&&u&&(t=e.renderIcon());n="function"==typeof l?l(d):v?v(d):l;var w=a.createElement("span",{className:"".concat(p,"-title")},n);return a.createElement("span",{ref:e.setSelectHandle,title:"string"==typeof l?l:"",className:_()("".concat(b),"".concat(b,"-").concat(e.getNodeState()||"normal"),!y&&(s||r)&&"".concat(p,"-node-selected")),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onContextMenu:e.onContextMenu,onClick:e.onSelectorClick,onDoubleClick:e.onSelectorDoubleClick},t,w,e.renderDropIndicator())},e.renderDropIndicator=function(){var t=e.props,n=t.disabled,r=t.eventKey,o=e.props.context,a=o.draggable,i=o.dropLevelOffset,l=o.dropPosition,s=o.prefixCls,c=o.indent,u=o.dropIndicatorRender,d=o.dragOverNodeKey,f=o.direction,p=null!=c?c:e.cacheIndent;return e.cacheIndent=c,!n&&a&&d===r?u({dropPosition:l,dropLevelOffset:i,indent:p,prefixCls:s,direction:f}):null},e}return(0,eU.Z)(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var e=this.props.selectable,t=this.props.context.selectable;return"boolean"==typeof e?e:t}},{key:"render",value:function(){var e,t=this.props,n=t.eventKey,r=t.className,o=t.style,i=t.dragOver,l=t.dragOverGapTop,s=t.dragOverGapBottom,c=t.isLeaf,u=t.isStart,d=t.isEnd,f=t.expanded,p=t.selected,h=t.checked,g=t.halfChecked,v=t.loading,y=t.domRef,b=t.active,x=(t.data,t.onMouseMove),w=t.selectable,k=(0,z.Z)(t,e8),S=this.props.context,E=S.prefixCls,O=S.filterTreeNode,j=S.keyEntities,P=S.dropContainerKey,N=S.dropTargetKey,T=S.draggingNodeKey,A=this.isDisabled(),M=(0,$.Z)(k,{aria:!0,data:!0}),I=(j[n]||{}).level,R=d[d.length-1],D=this.isDraggable(),L=!A&&D,Z=T===n;return a.createElement("div",(0,m.Z)({ref:y,className:_()(r,"".concat(E,"-treenode"),(e={},(0,C.Z)(e,"".concat(E,"-treenode-disabled"),A),(0,C.Z)(e,"".concat(E,"-treenode-switcher-").concat(f?"open":"close"),!c),(0,C.Z)(e,"".concat(E,"-treenode-checkbox-checked"),h),(0,C.Z)(e,"".concat(E,"-treenode-checkbox-indeterminate"),g),(0,C.Z)(e,"".concat(E,"-treenode-selected"),p),(0,C.Z)(e,"".concat(E,"-treenode-loading"),v),(0,C.Z)(e,"".concat(E,"-treenode-active"),b),(0,C.Z)(e,"".concat(E,"-treenode-leaf-last"),R),(0,C.Z)(e,"".concat(E,"-treenode-draggable"),D),(0,C.Z)(e,"dragging",Z),(0,C.Z)(e,"drop-target",N===n),(0,C.Z)(e,"drop-container",P===n),(0,C.Z)(e,"drag-over",!A&&i),(0,C.Z)(e,"drag-over-gap-top",!A&&l),(0,C.Z)(e,"drag-over-gap-bottom",!A&&s),(0,C.Z)(e,"filter-node",O&&O(e5(this.props))),e)),style:o,draggable:L,"aria-grabbed":Z,onDragStart:L?this.onDragStart:void 0,onDragEnter:D?this.onDragEnter:void 0,onDragOver:D?this.onDragOver:void 0,onDragLeave:D?this.onDragLeave:void 0,onDrop:D?this.onDrop:void 0,onDragEnd:D?this.onDragEnd:void 0,onMouseMove:x},void 0!==w?{"aria-selected":!!w}:void 0,M),a.createElement(eG,{prefixCls:E,level:I,isStart:u,isEnd:d}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(a.Component),tt=function(e){return a.createElement(eX.Consumer,null,function(t){return a.createElement(te,(0,m.Z)({},e,{context:t}))})};function tn(e,t){if(!e)return[];var n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function tr(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function to(e){return e.split("-")}function ta(e,t,n,r,o,a,i,l,s,c){var u,d,f=e.clientX,p=e.clientY,h=e.target.getBoundingClientRect(),m=h.top,g=h.height,v=(("rtl"===c?-1:1)*(((null==o?void 0:o.x)||0)-f)-12)/r,y=l[n.props.eventKey];if(p<m+g/2){var b=i.findIndex(function(e){return e.key===y.key});y=l[i[b<=0?0:b-1].key]}var x=y.key,w=y,k=y.key,S=0,E=0;if(!s.includes(x))for(var O=0;O<v;O+=1)if(function(e){if(e.parent){var t=to(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}(y))y=y.parent,E+=1;else break;var C=t.props.data,j=y.node,_=!0;return 0===Number((u=to(y.pos))[u.length-1])&&0===y.level&&p<m+g/2&&a({dragNode:C,dropNode:j,dropPosition:-1})&&y.key===n.props.eventKey?S=-1:(w.children||[]).length&&s.includes(k)?a({dragNode:C,dropNode:j,dropPosition:0})?S=0:_=!1:0===E?v>-1.5?a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1:a({dragNode:C,dropNode:j,dropPosition:0})?S=0:a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1:a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1,{dropPosition:S,dropLevelOffset:E,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:k,dropContainerKey:0===S?null:(null===(d=y.parent)||void 0===d?void 0:d.key)||null,dropAllowed:_}}function ti(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function tl(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,E.Z)(e))return(0,T.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function ts(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(r){if(!n.has(r)){var o=t[r];if(o){n.add(r);var a=o.parent;!o.node.disabled&&a&&e(a.key)}}}(e)}),(0,es.Z)(n)}function tc(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function tu(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,o=t.checkable;return!!(n||r)||!1===o}function td(e,t,n,r){var o,a=[];o=r||tu;var i=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),l=new Map,s=0;return Object.keys(n).forEach(function(e){var t=n[e],r=t.level,o=l.get(r);o||(o=new Set,l.set(r,o)),o.add(t),s=Math.max(s,r)}),(0,T.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,r){for(var o=new Set(e),a=new Set,i=0;i<=n;i+=1)(t.get(i)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,i=void 0===a?[]:a;o.has(t)&&!r(n)&&i.filter(function(e){return!r(e.node)}).forEach(function(e){o.add(e.key)})});for(var l=new Set,s=n;s>=0;s-=1)(t.get(s)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||l.has(e.parent.key))){if(r(e.parent.node)){l.add(t.key);return}var n=!0,i=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=o.has(t);n&&!r&&(n=!1),!i&&(r||a.has(t))&&(i=!0)}),n&&o.add(t.key),i&&a.add(t.key),l.add(t.key)}});return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(tc(a,o))}}(i,l,s,o):function(e,t,n,r,o){for(var a=new Set(e),i=new Set(t),l=0;l<=r;l+=1)(n.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,r=e.children,l=void 0===r?[]:r;a.has(t)||i.has(t)||o(n)||l.filter(function(e){return!o(e.node)}).forEach(function(e){a.delete(e.key)})});i=new Set;for(var s=new Set,c=r;c>=0;c-=1)(n.get(c)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||s.has(e.parent.key))){if(o(e.parent.node)){s.add(t.key);return}var n=!0,r=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=a.has(t);n&&!o&&(n=!1),!r&&(o||i.has(t))&&(r=!0)}),n||a.delete(t.key),r&&i.add(t.key),s.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(tc(i,a))}}(i,t.halfCheckedKeys,l,s,o)}tt.displayName="TreeNode",tt.isTreeNode=1;var tf=n(50506),tp=n(13613),th=n(61994),tm=n(80795),tg=n(29967);let tv={},ty="SELECT_ALL",tb="SELECT_INVERT",tx="SELECT_NONE",tw=[],tk=(e,t)=>{let n=[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&(n=[].concat((0,es.Z)(n),(0,es.Z)(tk(e,t[e]))))}),n};var tS=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:r,defaultSelectedRowKeys:o,getCheckboxProps:i,onChange:l,onSelect:s,onSelectAll:c,onSelectInvert:u,onSelectNone:d,onSelectMultiple:f,columnWidth:p,type:h,selections:m,fixed:g,renderCell:v,hideSelectAll:y,checkStrictly:b=!0}=t||{},{prefixCls:x,data:w,pageData:k,getRecordByKey:S,getRowKey:E,expandType:O,childrenColumnName:C,locale:j,getPopupContainer:P}=e,N=(0,tp.ln)("Table"),[T,A]=function(e){let[t,n]=(0,a.useState)(null);return[(0,a.useCallback)((r,o,a)=>{let i=null!=t?t:r,l=Math.max(i||0,r),s=o.slice(Math.min(i||0,r),l+1).map(t=>e(t)),c=s.some(e=>!a.has(e)),u=[];return s.forEach(e=>{c?(a.has(e)||u.push(e),a.add(e)):(a.delete(e),u.push(e))}),n(c?l:null),u},[t]),e=>{n(e)}]}(e=>e),[M,I]=(0,tf.Z)(r||o||tw,{value:r}),R=a.useRef(new Map),D=(0,a.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=S(e);!n&&R.current.has(e)&&(n=R.current.get(e)),t.set(e,n)}),R.current=t}},[S,n]);a.useEffect(()=>{D(M)},[M]);let{keyEntities:L}=(0,a.useMemo)(()=>{if(b)return{keyEntities:null};let e=w;if(n){let t=new Set(w.map((e,t)=>E(e,t))),n=Array.from(R.current).reduce((e,n)=>{let[r,o]=n;return t.has(r)?e:e.concat(o)},[]);e=[].concat((0,es.Z)(e),(0,es.Z)(n))}return e4(e,{externalGetKey:E,childrenPropName:C})},[w,E,b,C,n]),Z=(0,a.useMemo)(()=>tk(C,k),[C,k]),z=(0,a.useMemo)(()=>{let e=new Map;return Z.forEach((t,n)=>{let r=E(t,n),o=(i?i(t):null)||{};e.set(r,o)}),e},[Z,E,i]),B=(0,a.useCallback)(e=>{var t;return!!(null===(t=z.get(E(e)))||void 0===t?void 0:t.disabled)},[z,E]),[F,H]=(0,a.useMemo)(()=>{if(b)return[M||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=td(M,!0,L,B);return[e||[],t]},[M,b,L,B]),q=(0,a.useMemo)(()=>new Set("radio"===h?F.slice(0,1):F),[F,h]),W=(0,a.useMemo)(()=>"radio"===h?new Set:new Set(H),[H,h]);a.useEffect(()=>{t||I(tw)},[!!t]);let U=(0,a.useCallback)((e,t)=>{let r,o;D(e),n?(r=e,o=e.map(e=>R.current.get(e))):(r=[],o=[],e.forEach(e=>{let t=S(e);void 0!==t&&(r.push(e),o.push(t))})),I(r),null==l||l(r,o,{type:t})},[I,S,l,n]),K=(0,a.useCallback)((e,t,n,r)=>{if(s){let o=n.map(e=>S(e));s(S(e),t,o,r)}U(n,"single")},[s,S,U]),$=(0,a.useMemo)(()=>!m||y?null:(!0===m?[ty,tb,tx]:m).map(e=>e===ty?{key:"all",text:j.selectionAll,onSelect(){U(w.map((e,t)=>E(e,t)).filter(e=>{let t=z.get(e);return!(null==t?void 0:t.disabled)||q.has(e)}),"all")}}:e===tb?{key:"invert",text:j.selectInvert,onSelect(){let e=new Set(q);k.forEach((t,n)=>{let r=E(t,n),o=z.get(r);(null==o?void 0:o.disabled)||(e.has(r)?e.delete(r):e.add(r))});let t=Array.from(e);u&&(N.deprecated(!1,"onSelectInvert","onChange"),u(t)),U(t,"invert")}}:e===tx?{key:"none",text:j.selectNone,onSelect(){null==d||d(),U(Array.from(q).filter(e=>{let t=z.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null===(t=e.onSelect)||void 0===t||t.call.apply(t,[e].concat(r)),A(null)}})),[m,q,k,E,u,U]);return[(0,a.useCallback)(e=>{var n;let r,o,i;if(!t)return e.filter(e=>e!==tv);let l=(0,es.Z)(e),s=new Set(q),u=Z.map(E).filter(e=>!z.get(e).disabled),d=u.every(e=>s.has(e)),w=u.some(e=>s.has(e));if("radio"!==h){let e;if($){let t={getPopupContainer:P,items:$.map((e,t)=>{let{key:n,text:r,onSelect:o}=e;return{key:null!=n?n:t,onClick:()=>{null==o||o(u)},label:r}})};e=a.createElement("div",{className:"".concat(x,"-selection-extra")},a.createElement(tm.Z,{menu:t,getPopupContainer:P},a.createElement("span",null,a.createElement(eq.Z,null))))}let t=Z.map((e,t)=>{let n=E(e,t),r=z.get(n)||{};return Object.assign({checked:s.has(n)},r)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===Z.length,i=n&&t.every(e=>{let{checked:t}=e;return t}),l=n&&t.some(e=>{let{checked:t}=e;return t});o=a.createElement(th.Z,{checked:n?i:!!Z.length&&d,indeterminate:n?!i&&l:!d&&w,onChange:()=>{let e=[];d?u.forEach(t=>{s.delete(t),e.push(t)}):u.forEach(t=>{s.has(t)||(s.add(t),e.push(t))});let t=Array.from(s);null==c||c(!d,t.map(e=>S(e)),e.map(e=>S(e))),U(t,"all"),A(null)},disabled:0===Z.length||n,"aria-label":e?"Custom selection":"Select all",skipGroup:!0}),r=!y&&a.createElement("div",{className:"".concat(x,"-selection")},o,e)}if(i="radio"===h?(e,t,n)=>{let r=E(t,n),o=s.has(r);return{node:a.createElement(tg.ZP,Object.assign({},z.get(r),{checked:o,onClick:e=>e.stopPropagation(),onChange:e=>{s.has(r)||K(r,!0,[r],e.nativeEvent)}})),checked:o}}:(e,t,n)=>{var r;let o;let i=E(t,n),l=s.has(i),c=W.has(i),d=z.get(i);return o="nest"===O?c:null!==(r=null==d?void 0:d.indeterminate)&&void 0!==r?r:c,{node:a.createElement(th.Z,Object.assign({},d,{indeterminate:o,checked:l,skipGroup:!0,onClick:e=>e.stopPropagation(),onChange:e=>{let{nativeEvent:t}=e,{shiftKey:n}=t,r=u.findIndex(e=>e===i),o=F.some(e=>u.includes(e));if(n&&b&&o){let e=T(r,u,s),t=Array.from(s);null==f||f(!l,t.map(e=>S(e)),e.map(e=>S(e))),U(t,"multiple")}else if(b){let e=l?tn(F,i):tr(F,i);K(i,!l,e,t)}else{let{checkedKeys:e,halfCheckedKeys:n}=td([].concat((0,es.Z)(F),[i]),!0,L,B),r=e;if(l){let t=new Set(e);t.delete(i),r=td(Array.from(t),{checked:!1,halfCheckedKeys:n},L,B).checkedKeys}K(i,!l,r,t)}l?A(null):A(r)}})),checked:l}},!l.includes(tv)){if(0===l.findIndex(e=>{var t;return(null===(t=e[ea])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=l;l=[e,tv].concat((0,es.Z)(t))}else l=[tv].concat((0,es.Z)(l))}let k=l.indexOf(tv),C=(l=l.filter((e,t)=>e!==tv||t===k))[k-1],j=l[k+1],N=g;void 0===N&&((null==j?void 0:j.fixed)!==void 0?N=j.fixed:(null==C?void 0:C.fixed)!==void 0&&(N=C.fixed)),N&&C&&(null===(n=C[ea])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===C.fixed&&(C.fixed=N);let M=_()("".concat(x,"-selection-col"),{["".concat(x,"-selection-col-with-dropdown")]:m&&"checkbox"===h}),I={fixed:N,width:p,className:"".concat(x,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(o):t.columnTitle:r,render:(e,t,n)=>{let{node:r,checked:o}=i(e,t,n);return v?v(o,t,n,r):r},onCell:t.onCell,[ea]:{className:M}};return l.map(e=>e===tv?I:e)},[E,Z,t,F,q,W,p,$,O,z,f,K,B]),q]},tE=n(53346);function tO(e){return null!=e&&e===e.window}var tC=n(71744),tj=n(91086),t_=n(64024),tP=n(33759),tN=n(28617),tT=n(13823),tA={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},tM=n(55015),tI=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:tA}))}),tR={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},tD=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:tR}))}),tL=n(15327),tZ=n(77565),tz=n(95814),tB={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},tF=["10","20","50","100"],tH=function(e){var t=e.pageSizeOptions,n=void 0===t?tF:t,r=e.locale,o=e.changeSize,i=e.pageSize,l=e.goButton,c=e.quickGo,u=e.rootPrefixCls,d=e.selectComponentClass,f=e.selectPrefixCls,p=e.disabled,h=e.buildOptionText,m=a.useState(""),g=(0,s.Z)(m,2),v=g[0],y=g[1],b=function(){return!v||Number.isNaN(v)?void 0:Number(v)},x="function"==typeof h?h:function(e){return"".concat(e," ").concat(r.items_per_page)},w=function(e){""!==v&&(e.keyCode===tz.Z.ENTER||"click"===e.type)&&(y(""),null==c||c(b()))},k="".concat(u,"-options");if(!o&&!c)return null;var S=null,E=null,O=null;if(o&&d){var C=(n.some(function(e){return e.toString()===i.toString()})?n:n.concat([i.toString()]).sort(function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))})).map(function(e,t){return a.createElement(d.Option,{key:t,value:e.toString()},x(e))});S=a.createElement(d,{disabled:p,prefixCls:f,showSearch:!1,className:"".concat(k,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(i||n[0]).toString(),onChange:function(e){null==o||o(Number(e))},getPopupContainer:function(e){return e.parentNode},"aria-label":r.page_size,defaultOpen:!1},C)}return c&&(l&&(O="boolean"==typeof l?a.createElement("button",{type:"button",onClick:w,onKeyUp:w,disabled:p,className:"".concat(k,"-quick-jumper-button")},r.jump_to_confirm):a.createElement("span",{onClick:w,onKeyUp:w},l)),E=a.createElement("div",{className:"".concat(k,"-quick-jumper")},r.jump_to,a.createElement("input",{disabled:p,type:"text",value:v,onChange:function(e){y(e.target.value)},onKeyUp:w,onBlur:function(e){!l&&""!==v&&(y(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(u,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(u,"-item"))>=0)||null==c||c(b()))},"aria-label":r.page}),r.page,O)),a.createElement("li",{className:k},S,E)},tq=function(e){var t,n=e.rootPrefixCls,r=e.page,o=e.active,i=e.className,l=e.showTitle,s=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),f=_()(d,"".concat(d,"-").concat(r),(t={},(0,C.Z)(t,"".concat(d,"-active"),o),(0,C.Z)(t,"".concat(d,"-disabled"),!r),t),i),p=u(r,"page",a.createElement("a",{rel:"nofollow"},r));return p?a.createElement("li",{title:l?String(r):null,className:f,onClick:function(){s(r)},onKeyDown:function(e){c(e,s,r)},tabIndex:0},p):null},tW=function(e,t,n){return n};function tU(){}function tK(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function t$(e,t,n){return Math.floor((n-1)/(void 0===e?t:e))+1}var tV=function(e){var t,n,r,o,i,l=e.prefixCls,c=void 0===l?"rc-pagination":l,u=e.selectPrefixCls,d=e.className,f=e.selectComponentClass,p=e.current,h=e.defaultCurrent,g=e.total,v=void 0===g?0:g,y=e.pageSize,b=e.defaultPageSize,x=e.onChange,w=void 0===x?tU:x,k=e.hideOnSinglePage,S=e.showPrevNextJumpers,E=e.showQuickJumper,j=e.showLessItems,P=e.showTitle,N=void 0===P||P,T=e.onShowSizeChange,A=void 0===T?tU:T,M=e.locale,I=void 0===M?tB:M,R=e.style,D=e.totalBoundaryShowSizeChanger,L=e.disabled,Z=e.simple,z=e.showTotal,B=e.showSizeChanger,F=e.pageSizeOptions,H=e.itemRender,q=void 0===H?tW:H,W=e.jumpPrevIcon,U=e.jumpNextIcon,K=e.prevIcon,V=e.nextIcon,X=a.useRef(null),G=(0,tf.Z)(10,{value:y,defaultValue:void 0===b?10:b}),Y=(0,s.Z)(G,2),Q=Y[0],J=Y[1],ee=(0,tf.Z)(1,{value:p,defaultValue:void 0===h?1:h,postState:function(e){return Math.max(1,Math.min(e,t$(void 0,Q,v)))}}),et=(0,s.Z)(ee,2),en=et[0],er=et[1],eo=a.useState(en),ea=(0,s.Z)(eo,2),ei=ea[0],el=ea[1];(0,a.useEffect)(function(){el(en)},[en]);var es=Math.max(1,en-(j?3:5)),ec=Math.min(t$(void 0,Q,v),en+(j?3:5));function eu(t,n){var r=t||a.createElement("button",{type:"button","aria-label":n,className:"".concat(c,"-item-link")});return"function"==typeof t&&(r=a.createElement(t,(0,O.Z)({},e))),r}function ed(e){var t=e.target.value,n=t$(void 0,Q,v);return""===t?t:Number.isNaN(Number(t))?ei:t>=n?n:Number(t)}var ef=v>Q&&E;function ep(e){var t=ed(e);switch(t!==ei&&el(t),e.keyCode){case tz.Z.ENTER:eh(t);break;case tz.Z.UP:eh(t-1);break;case tz.Z.DOWN:eh(t+1)}}function eh(e){if(tK(e)&&e!==en&&tK(v)&&v>0&&!L){var t=t$(void 0,Q,v),n=e;return e>t?n=t:e<1&&(n=1),n!==ei&&el(n),er(n),null==w||w(n,Q),n}return en}var em=en>1,eg=en<t$(void 0,Q,v),ev=null!=B?B:v>(void 0===D?50:D);function ey(){em&&eh(en-1)}function eb(){eg&&eh(en+1)}function ex(){eh(es)}function ew(){eh(ec)}function ek(e,t){if("Enter"===e.key||e.charCode===tz.Z.ENTER||e.keyCode===tz.Z.ENTER){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];t.apply(void 0,r)}}function eS(e){("click"===e.type||e.keyCode===tz.Z.ENTER)&&eh(ei)}var eE=null,eO=(0,$.Z)(e,{aria:!0,data:!0}),eC=z&&a.createElement("li",{className:"".concat(c,"-total-text")},z(v,[0===v?0:(en-1)*Q+1,en*Q>v?v:en*Q])),ej=null,e_=t$(void 0,Q,v);if(k&&v<=Q)return null;var eP=[],eN={rootPrefixCls:c,onClick:eh,onKeyPress:ek,showTitle:N,itemRender:q,page:-1},eT=en-1>0?en-1:0,eA=en+1<e_?en+1:e_,eM=E&&E.goButton,eI=eM,eR=null;Z&&(eM&&(eI="boolean"==typeof eM?a.createElement("button",{type:"button",onClick:eS,onKeyUp:eS},I.jump_to_confirm):a.createElement("span",{onClick:eS,onKeyUp:eS},eM),eI=a.createElement("li",{title:N?"".concat(I.jump_to).concat(en,"/").concat(e_):null,className:"".concat(c,"-simple-pager")},eI)),eR=a.createElement("li",{title:N?"".concat(en,"/").concat(e_):null,className:"".concat(c,"-simple-pager")},a.createElement("input",{type:"text",value:ei,disabled:L,onKeyDown:function(e){(e.keyCode===tz.Z.UP||e.keyCode===tz.Z.DOWN)&&e.preventDefault()},onKeyUp:ep,onChange:ep,onBlur:function(e){eh(ed(e))},size:3}),a.createElement("span",{className:"".concat(c,"-slash")},"/"),e_));var eD=j?1:2;if(e_<=3+2*eD){e_||eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:"noPager",page:1,className:"".concat(c,"-item-disabled")})));for(var eL=1;eL<=e_;eL+=1)eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:eL,page:eL,active:en===eL})))}else{var eZ=j?I.prev_3:I.prev_5,ez=j?I.next_3:I.next_5,eB=q(es,"jump-prev",eu(W,"prev page")),eF=q(ec,"jump-next",eu(U,"next page"));(void 0===S||S)&&(eE=eB?a.createElement("li",{title:N?eZ:null,key:"prev",onClick:ex,tabIndex:0,onKeyDown:function(e){ek(e,ex)},className:_()("".concat(c,"-jump-prev"),(0,C.Z)({},"".concat(c,"-jump-prev-custom-icon"),!!W))},eB):null,ej=eF?a.createElement("li",{title:N?ez:null,key:"next",onClick:ew,tabIndex:0,onKeyDown:function(e){ek(e,ew)},className:_()("".concat(c,"-jump-next"),(0,C.Z)({},"".concat(c,"-jump-next-custom-icon"),!!U))},eF):null);var eH=Math.max(1,en-eD),eq=Math.min(en+eD,e_);en-1<=eD&&(eq=1+2*eD),e_-en<=eD&&(eH=e_-2*eD);for(var eW=eH;eW<=eq;eW+=1)eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:eW,page:eW,active:en===eW})));if(en-1>=2*eD&&3!==en&&(eP[0]=a.cloneElement(eP[0],{className:_()("".concat(c,"-item-after-jump-prev"),eP[0].props.className)}),eP.unshift(eE)),e_-en>=2*eD&&en!==e_-2){var eU=eP[eP.length-1];eP[eP.length-1]=a.cloneElement(eU,{className:_()("".concat(c,"-item-before-jump-next"),eU.props.className)}),eP.push(ej)}1!==eH&&eP.unshift(a.createElement(tq,(0,m.Z)({},eN,{key:1,page:1}))),eq!==e_&&eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:e_,page:e_})))}var eK=(t=q(eT,"prev",eu(K,"prev page")),a.isValidElement(t)?a.cloneElement(t,{disabled:!em}):t);if(eK){var e$=!em||!e_;eK=a.createElement("li",{title:N?I.prev_page:null,onClick:ey,tabIndex:e$?null:0,onKeyDown:function(e){ek(e,ey)},className:_()("".concat(c,"-prev"),(0,C.Z)({},"".concat(c,"-disabled"),e$)),"aria-disabled":e$},eK)}var eV=(n=q(eA,"next",eu(V,"next page")),a.isValidElement(n)?a.cloneElement(n,{disabled:!eg}):n);eV&&(Z?(o=!eg,i=em?0:null):i=(o=!eg||!e_)?null:0,eV=a.createElement("li",{title:N?I.next_page:null,onClick:eb,tabIndex:i,onKeyDown:function(e){ek(e,eb)},className:_()("".concat(c,"-next"),(0,C.Z)({},"".concat(c,"-disabled"),o)),"aria-disabled":o},eV));var eX=_()(c,d,(r={},(0,C.Z)(r,"".concat(c,"-simple"),Z),(0,C.Z)(r,"".concat(c,"-disabled"),L),r));return a.createElement("ul",(0,m.Z)({className:eX,style:R,ref:X},eO),eC,eK,Z?eR:eP,eV,a.createElement(tH,{locale:I,rootPrefixCls:c,disabled:L,selectComponentClass:f,selectPrefixCls:void 0===u?"rc-select":u,changeSize:ev?function(e){var t=t$(e,Q,v),n=en>t&&0!==t?t:en;J(e),el(n),null==A||A(en,e),er(n),null==w||w(n,e)}:null,pageSize:Q,pageSizeOptions:F,quickGo:ef?eh:null,goButton:eI}))},tX=n(96257),tG=n(55274),tY=n(52787);let tQ=e=>a.createElement(tY.default,Object.assign({},e,{showSearch:!0,size:"small"})),tJ=e=>a.createElement(tY.default,Object.assign({},e,{showSearch:!0,size:"middle"}));tQ.Option=tY.default.Option,tJ.Option=tY.default.Option;var t0=n(352),t1=n(31282),t2=n(37433),t6=n(12918),t4=n(3104),t3=n(80669),t5=n(65265);let t8=e=>{let{componentCls:t}=e;return{["".concat(t,"-disabled")]:{"&, &:hover":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},["&".concat(t,"-disabled")]:{cursor:"not-allowed",["".concat(t,"-item")]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},["".concat(t,"-simple&")]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},["".concat(t,"-simple-pager")]:{color:e.colorTextDisabled},["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{["".concat(t,"-item-link-icon")]:{opacity:0},["".concat(t,"-item-ellipsis")]:{opacity:1}}},["&".concat(t,"-simple")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&".concat(t,"-disabled ").concat(t,"-item-link")]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},t7=e=>{let{componentCls:t}=e;return{["&".concat(t,"-mini ").concat(t,"-total-text, &").concat(t,"-mini ").concat(t,"-simple-pager")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-item")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.calc(e.itemSizeSM).sub(2).equal())},["&".concat(t,"-mini:not(").concat(t,"-disabled) ").concat(t,"-item:not(").concat(t,"-item-active)")]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},["&".concat(t,"-mini ").concat(t,"-prev, &").concat(t,"-mini ").concat(t,"-next")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini:not(").concat(t,"-disabled)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover ").concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["\n &".concat(t,"-mini ").concat(t,"-prev ").concat(t,"-item-link,\n &").concat(t,"-mini ").concat(t,"-next ").concat(t,"-item-link\n ")]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}},["&".concat(t,"-mini ").concat(t,"-jump-prev, &").concat(t,"-mini ").concat(t,"-jump-next")]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-options")]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),input:Object.assign(Object.assign({},(0,t1.x0)(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},t9=e=>{let{componentCls:t}=e;return{["\n &".concat(t,"-simple ").concat(t,"-prev,\n &").concat(t,"-simple ").concat(t,"-next\n ")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),verticalAlign:"top",["".concat(t,"-item-link")]:{height:e.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}}},["&".concat(t,"-simple ").concat(t,"-simple-pager")]:{display:"inline-block",height:e.itemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:e.marginXS,padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),textAlign:"center",backgroundColor:e.itemInputBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadius,outline:"none",transition:"border-color ".concat(e.motionDurationMid),color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:"".concat((0,t0.bf)(e.inputOutlineOffset)," 0 ").concat((0,t0.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}}}},ne=e=>{let{componentCls:t}=e;return{["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{outline:0,["".concat(t,"-item-container")]:{position:"relative",["".concat(t,"-item-link-icon")]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:"all ".concat(e.motionDurationMid),"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},["".concat(t,"-item-ellipsis")]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:"all ".concat(e.motionDurationMid)}},"&:hover":{["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}}},["\n ".concat(t,"-prev,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{marginInlineEnd:e.marginXS},["\n ".concat(t,"-prev,\n ").concat(t,"-next,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:"".concat((0,t0.bf)(e.itemSize)),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:"all ".concat(e.motionDurationMid)},["".concat(t,"-prev, ").concat(t,"-next")]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},["".concat(t,"-item-link")]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:"none",transition:"all ".concat(e.motionDurationMid)},["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover")]:{["".concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["".concat(t,"-slash")]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},["".concat(t,"-options")]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:(0,t0.bf)(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},(0,t1.ik)(e)),(0,t5.$U)(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},(0,t5.Xy)(e)),width:e.calc(e.controlHeightLG).mul(1.25).equal(),height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},nt=e=>{let{componentCls:t}=e;return{["".concat(t,"-item")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),color:e.colorText,"&:hover":{textDecoration:"none"}},["&:not(".concat(t,"-item-active)")]:{"&:hover":{transition:"all ".concat(e.motionDurationMid),backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}}}},nn=e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,t6.Wf)(e)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},["".concat(t,"-total-text")]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),nt(e)),ne(e)),t9(e)),t7(e)),t8(e)),{["@media only screen and (max-width: ".concat(e.screenLG,"px)")]:{["".concat(t,"-item")]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},["@media only screen and (max-width: ".concat(e.screenSM,"px)")]:{["".concat(t,"-options")]:{display:"none"}}}),["&".concat(e.componentCls,"-rtl")]:{direction:"rtl"}}},nr=e=>{let{componentCls:t}=e;return{["".concat(t,":not(").concat(t,"-disabled)")]:{["".concat(t,"-item")]:Object.assign({},(0,t6.Qy)(e)),["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{"&:focus-visible":Object.assign({["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}},(0,t6.oN)(e))},["".concat(t,"-prev, ").concat(t,"-next")]:{["&:focus-visible ".concat(t,"-item-link")]:Object.assign({},(0,t6.oN)(e))}}}},no=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},(0,t2.T)(e)),na=e=>(0,t4.TS)(e,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,t2.e)(e));var ni=(0,t3.I$)("Pagination",e=>{let t=na(e);return[nn(t),nr(t)]},no),nl=n(29961);let ns=e=>{let{componentCls:t}=e;return{["".concat(t).concat(t,"-bordered").concat(t,"-disabled:not(").concat(t,"-mini)")]:{"&, &:hover":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},"&:focus-visible":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},["".concat(t,"-item, ").concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,["&:hover:not(".concat(t,"-item-active)")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},["&".concat(t,"-item-active")]:{backgroundColor:e.itemActiveBgDisabled}},["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},["".concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},["".concat(t).concat(t,"-bordered:not(").concat(t,"-mini)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},["".concat(t,"-item-link")]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},["&:hover ".concat(t,"-item-link")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},["&".concat(t,"-disabled")]:{["".concat(t,"-item-link")]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},["".concat(t,"-item")]:{backgroundColor:e.itemBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),["&:hover:not(".concat(t,"-item-active)")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}};var nc=(0,t3.bk)(["Pagination","bordered"],e=>[ns(na(e))],no),nu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},nd=e=>{let{prefixCls:t,selectPrefixCls:n,className:r,rootClassName:o,style:i,size:l,locale:s,selectComponentClass:c,responsive:u,showSizeChanger:d}=e,f=nu(e,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:p}=(0,tN.Z)(u),[,h]=(0,nl.ZP)(),{getPrefixCls:m,direction:g,pagination:v={}}=a.useContext(tC.E_),y=m("pagination",t),[b,x,w]=ni(y),k=null!=d?d:v.showSizeChanger,S=a.useMemo(()=>{let e=a.createElement("span",{className:"".concat(y,"-item-ellipsis")},"•••"),t=a.createElement("button",{className:"".concat(y,"-item-link"),type:"button",tabIndex:-1},"rtl"===g?a.createElement(tZ.Z,null):a.createElement(tL.Z,null));return{prevIcon:t,nextIcon:a.createElement("button",{className:"".concat(y,"-item-link"),type:"button",tabIndex:-1},"rtl"===g?a.createElement(tL.Z,null):a.createElement(tZ.Z,null)),jumpPrevIcon:a.createElement("a",{className:"".concat(y,"-item-link")},a.createElement("div",{className:"".concat(y,"-item-container")},"rtl"===g?a.createElement(tD,{className:"".concat(y,"-item-link-icon")}):a.createElement(tI,{className:"".concat(y,"-item-link-icon")}),e)),jumpNextIcon:a.createElement("a",{className:"".concat(y,"-item-link")},a.createElement("div",{className:"".concat(y,"-item-container")},"rtl"===g?a.createElement(tI,{className:"".concat(y,"-item-link-icon")}):a.createElement(tD,{className:"".concat(y,"-item-link-icon")}),e))}},[g,y]),[E]=(0,tG.Z)("Pagination",tX.Z),O=Object.assign(Object.assign({},E),s),C=(0,tP.Z)(l),j="small"===C||!!(p&&!C&&u),P=m("select",n),N=_()({["".concat(y,"-mini")]:j,["".concat(y,"-rtl")]:"rtl"===g,["".concat(y,"-bordered")]:h.wireframe},null==v?void 0:v.className,r,o,x,w),T=Object.assign(Object.assign({},null==v?void 0:v.style),i);return b(a.createElement(a.Fragment,null,h.wireframe&&a.createElement(nc,{prefixCls:y}),a.createElement(tV,Object.assign({},S,f,{style:T,prefixCls:y,selectPrefixCls:P,className:N,selectComponentClass:c||(j?tQ:tJ),locale:O,showSizeChanger:k}))))},nf=n(87908);function np(e,t){return"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t}function nh(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}function nm(e,t){return"function"==typeof e?e(t):e}var ng={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},nv=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:ng}))}),ny=n(51646),nb=n(73002),nx=n(85180),nw=n(45937),nk=n(88208);function nS(e){if(null==e)throw TypeError("Cannot destructure "+e)}var nE=n(47970),nO=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],nC=function(e,t){var n,r,o,i,l,c=e.className,d=e.style,f=e.motion,p=e.motionNodes,h=e.motionType,g=e.onMotionStart,v=e.onMotionEnd,y=e.active,b=e.treeNodeRequiredProps,x=(0,z.Z)(e,nO),w=a.useState(!0),k=(0,s.Z)(w,2),S=k[0],E=k[1],O=a.useContext(eX).prefixCls,C=p&&"hide"!==h;(0,u.Z)(function(){p&&C!==S&&E(C)},[p]);var j=a.useRef(!1),P=function(){p&&!j.current&&(j.current=!0,v())};return(n=function(){p&&g()},r=a.useState(!1),i=(o=(0,s.Z)(r,2))[0],l=o[1],(0,u.Z)(function(){if(i)return n(),function(){P()}},[i]),(0,u.Z)(function(){return l(!0),function(){l(!1)}},[]),p)?a.createElement(nE.ZP,(0,m.Z)({ref:t,visible:S},f,{motionAppear:"show"===h,onVisibleChanged:function(e){C===e&&P()}}),function(e,t){var n=e.className,r=e.style;return a.createElement("div",{ref:t,className:_()("".concat(O,"-treenode-motion"),n),style:r},p.map(function(e){var t=(0,m.Z)({},(nS(e.data),e.data)),n=e.title,r=e.key,o=e.isStart,i=e.isEnd;delete t.children;var l=e3(r,b);return a.createElement(tt,(0,m.Z)({},t,l,{title:n,active:y,data:e.data,key:r,isStart:o,isEnd:i}))}))}):a.createElement(tt,(0,m.Z)({domRef:t,className:c,style:d},x,{active:y}))};nC.displayName="MotionTreeNode";var nj=a.forwardRef(nC);function n_(e,t,n){var r=e.findIndex(function(e){return e.key===n}),o=e[r+1],a=t.findIndex(function(e){return e.key===n});if(o){var i=t.findIndex(function(e){return e.key===o.key});return t.slice(a+1,i)}return t.slice(a+1)}var nP=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],nN={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},nT=function(){},nA="RC_TREE_MOTION_".concat(Math.random()),nM={key:nA},nI={key:nA,level:0,index:0,pos:"0",node:nM,nodes:[nM]},nR={parent:null,children:[],pos:nI.pos,data:nM,title:null,key:nA,isStart:[],isEnd:[]};function nD(e,t,n,r){return!1!==t&&n?e.slice(0,Math.ceil(n/r)+1):e}function nL(e){return e0(e.key,e.pos)}var nZ=a.forwardRef(function(e,t){var n=e.prefixCls,r=e.data,o=(e.selectable,e.checkable,e.expandedKeys),i=e.selectedKeys,l=e.checkedKeys,c=e.loadedKeys,d=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,h=e.disabled,g=e.dragging,v=e.dragOverNodeKey,y=e.dropPosition,b=e.motion,x=e.height,w=e.itemHeight,k=e.virtual,S=e.focusable,E=e.activeItem,O=e.focused,C=e.tabIndex,j=e.onKeyDown,_=e.onFocus,P=e.onBlur,N=e.onActiveChange,T=e.onListChangeStart,A=e.onListChangeEnd,M=(0,z.Z)(e,nP),I=a.useRef(null),R=a.useRef(null);a.useImperativeHandle(t,function(){return{scrollTo:function(e){I.current.scrollTo(e)},getIndentWidth:function(){return R.current.offsetWidth}}});var D=a.useState(o),L=(0,s.Z)(D,2),Z=L[0],B=L[1],F=a.useState(r),H=(0,s.Z)(F,2),q=H[0],W=H[1],U=a.useState(r),K=(0,s.Z)(U,2),$=K[0],V=K[1],X=a.useState([]),G=(0,s.Z)(X,2),Y=G[0],Q=G[1],J=a.useState(null),ee=(0,s.Z)(J,2),et=ee[0],en=ee[1],er=a.useRef(r);function eo(){var e=er.current;W(e),V(e),Q([]),en(null),A()}er.current=r,(0,u.Z)(function(){B(o);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,r=t.length;if(1!==Math.abs(n-r))return{add:!1,key:null};function o(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var r=t.filter(function(e){return!n.has(e)});return 1===r.length?r[0]:null}return n<r?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}(Z,o);if(null!==e.key){if(e.add){var t=q.findIndex(function(t){return t.key===e.key}),n=nD(n_(q,r,e.key),k,x,w),a=q.slice();a.splice(t+1,0,nR),V(a),Q(n),en("show")}else{var i=r.findIndex(function(t){return t.key===e.key}),l=nD(n_(r,q,e.key),k,x,w),s=r.slice();s.splice(i+1,0,nR),V(s),Q(l),en("hide")}}else q!==r&&(W(r),V(r))},[o,r]),a.useEffect(function(){g||eo()},[g]);var ea=b?$:r,ei={expandedKeys:o,selectedKeys:i,loadedKeys:c,loadingKeys:d,checkedKeys:l,halfCheckedKeys:f,dragOverNodeKey:v,dropPosition:y,keyEntities:p};return a.createElement(a.Fragment,null,O&&E&&a.createElement("span",{style:nN,"aria-live":"assertive"},function(e){for(var t=String(e.data.key),n=e;n.parent;)n=n.parent,t="".concat(n.data.key," > ").concat(t);return t}(E)),a.createElement("div",null,a.createElement("input",{style:nN,disabled:!1===S||h,tabIndex:!1!==S?C:null,onKeyDown:j,onFocus:_,onBlur:P,value:"",onChange:nT,"aria-label":"for screen reader"})),a.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},a.createElement("div",{className:"".concat(n,"-indent")},a.createElement("div",{ref:R,className:"".concat(n,"-indent-unit")}))),a.createElement(eI.Z,(0,m.Z)({},M,{data:ea,itemKey:nL,height:x,fullHeight:!1,virtual:k,itemHeight:w,prefixCls:"".concat(n,"-list"),ref:I,onVisibleChange:function(e,t){var n=new Set(e);t.filter(function(e){return!n.has(e)}).some(function(e){return nL(e)===nA})&&eo()}}),function(e){var t=e.pos,n=(0,m.Z)({},(nS(e.data),e.data)),r=e.title,o=e.key,i=e.isStart,l=e.isEnd,s=e0(o,t);delete n.key,delete n.children;var c=e3(s,ei);return a.createElement(nj,(0,m.Z)({},n,c,{title:r,active:!!E&&o===E.key,pos:t,data:e.data,isStart:i,isEnd:l,motion:b,motionNodes:o===nA?Y:null,motionType:et,onMotionStart:T,onMotionEnd:eo,treeNodeRequiredProps:ei,onMouseMove:function(){N(null)}}))}))});nZ.displayName="NodeList";var nz=function(e){(0,e$.Z)(n,e);var t=(0,eV.Z)(n);function n(){var e;(0,eW.Z)(this,n);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).destroyed=!1,e.delayedDragEnterLogic=void 0,e.loadingRetryTimes={},e.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:e1()},e.dragStartMousePosition=null,e.dragNode=void 0,e.currentMouseOverDroppableNodeKey=null,e.listRef=a.createRef(),e.onNodeDragStart=function(t,n){var r,o=e.state,a=o.expandedKeys,i=o.keyEntities,l=e.props.onDragStart,s=n.props.eventKey;e.dragNode=n,e.dragStartMousePosition={x:t.clientX,y:t.clientY};var c=tn(a,s);e.setState({draggingNodeKey:s,dragChildrenKeys:(r=[],function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,o=t.children;r.push(n),e(o)})}(i[s].children),r),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(c),window.addEventListener("dragend",e.onWindowDragEnd),null==l||l({event:t,node:e5(n.props)})},e.onNodeDragEnter=function(t,n){var r=e.state,o=r.expandedKeys,a=r.keyEntities,i=r.dragChildrenKeys,l=r.flattenNodes,s=r.indent,c=e.props,u=c.onDragEnter,d=c.onExpand,f=c.allowDrop,p=c.direction,h=n.props,m=h.pos,g=h.eventKey,v=(0,eK.Z)(e).dragNode;if(e.currentMouseOverDroppableNodeKey!==g&&(e.currentMouseOverDroppableNodeKey=g),!v){e.resetDragState();return}var y=ta(t,v,n,s,e.dragStartMousePosition,f,l,a,o,p),b=y.dropPosition,x=y.dropLevelOffset,w=y.dropTargetKey,k=y.dropContainerKey,S=y.dropTargetPos,E=y.dropAllowed,O=y.dragOverNodeKey;if(-1!==i.indexOf(w)||!E||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),v.props.eventKey!==n.props.eventKey&&(t.persist(),e.delayedDragEnterLogic[m]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var r=(0,es.Z)(o),i=a[n.props.eventKey];i&&(i.children||[]).length&&(r=tr(o,n.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(r),null==d||d(r,{node:e5(n.props),expanded:!0,nativeEvent:t.nativeEvent})}},800)),v.props.eventKey===w&&0===x)){e.resetDragState();return}e.setState({dragOverNodeKey:O,dropPosition:b,dropLevelOffset:x,dropTargetKey:w,dropContainerKey:k,dropTargetPos:S,dropAllowed:E}),null==u||u({event:t,node:e5(n.props),expandedKeys:o})},e.onNodeDragOver=function(t,n){var r=e.state,o=r.dragChildrenKeys,a=r.flattenNodes,i=r.keyEntities,l=r.expandedKeys,s=r.indent,c=e.props,u=c.onDragOver,d=c.allowDrop,f=c.direction,p=(0,eK.Z)(e).dragNode;if(p){var h=ta(t,p,n,s,e.dragStartMousePosition,d,a,i,l,f),m=h.dropPosition,g=h.dropLevelOffset,v=h.dropTargetKey,y=h.dropContainerKey,b=h.dropAllowed,x=h.dropTargetPos,w=h.dragOverNodeKey;-1===o.indexOf(v)&&b&&(p.props.eventKey===v&&0===g?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():m===e.state.dropPosition&&g===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&y===e.state.dropContainerKey&&x===e.state.dropTargetPos&&b===e.state.dropAllowed&&w===e.state.dragOverNodeKey||e.setState({dropPosition:m,dropLevelOffset:g,dropTargetKey:v,dropContainerKey:y,dropTargetPos:x,dropAllowed:b,dragOverNodeKey:w}),null==u||u({event:t,node:e5(n.props)}))}},e.onNodeDragLeave=function(t,n){e.currentMouseOverDroppableNodeKey!==n.props.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var r=e.props.onDragLeave;null==r||r({event:t,node:e5(n.props)})},e.onWindowDragEnd=function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(t,n){var r=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==r||r({event:t,node:e5(n.props)}),e.dragNode=null,window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDrop=function(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,i=a.dragChildrenKeys,l=a.dropPosition,s=a.dropTargetKey,c=a.dropTargetPos;if(a.dropAllowed){var u=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==s){var d=(0,O.Z)((0,O.Z)({},e3(s,e.getTreeNodeRequiredProps())),{},{active:(null===(r=e.getActiveItem())||void 0===r?void 0:r.key)===s,data:e.state.keyEntities[s].node}),f=-1!==i.indexOf(s);(0,T.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=to(c),h={event:t,node:e5(d),dragNode:e.dragNode?e5(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(i),dropToGap:0!==l,dropPosition:l+Number(p[p.length-1])};o||null==u||u(h),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(t,n){var r=e.state,o=r.expandedKeys,a=r.flattenNodes,i=n.expanded,l=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var s=a.filter(function(e){return e.key===l})[0],c=e5((0,O.Z)((0,O.Z)({},e3(l,e.getTreeNodeRequiredProps())),{},{data:s.data}));e.setExpandedKeys(i?tn(o,l):tr(o,l)),e.onNodeExpand(t,c)}},e.onNodeClick=function(t,n){var r=e.props,o=r.onClick;"click"===r.expandAction&&e.triggerExpandActionExpand(t,n),null==o||o(t,n)},e.onNodeDoubleClick=function(t,n){var r=e.props,o=r.onDoubleClick;"doubleClick"===r.expandAction&&e.triggerExpandActionExpand(t,n),null==o||o(t,n)},e.onNodeSelect=function(t,n){var r=e.state.selectedKeys,o=e.state,a=o.keyEntities,i=o.fieldNames,l=e.props,s=l.onSelect,c=l.multiple,u=n.selected,d=n[i.key],f=!u,p=(r=f?c?tr(r,d):[d]:tn(r,d)).map(function(e){var t=a[e];return t?t.node:null}).filter(function(e){return e});e.setUncontrolledState({selectedKeys:r}),null==s||s(r,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,r){var o,a=e.state,i=a.keyEntities,l=a.checkedKeys,s=a.halfCheckedKeys,c=e.props,u=c.checkStrictly,d=c.onCheck,f=n.key,p={event:"check",node:n,checked:r,nativeEvent:t.nativeEvent};if(u){var h=r?tr(l,f):tn(l,f);o={checked:h,halfChecked:tn(s,f)},p.checkedNodes=h.map(function(e){return i[e]}).filter(function(e){return e}).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:h})}else{var m=td([].concat((0,es.Z)(l),[f]),!0,i),g=m.checkedKeys,v=m.halfCheckedKeys;if(!r){var y=new Set(g);y.delete(f);var b=td(Array.from(y),{checked:!1,halfCheckedKeys:v},i);g=b.checkedKeys,v=b.halfCheckedKeys}o=g,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=v,g.forEach(function(e){var t=i[e];if(t){var n=t.node,r=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:r})}}),e.setUncontrolledState({checkedKeys:g},!1,{halfCheckedKeys:v})}null==d||d(o,p)},e.onNodeLoad=function(t){var n=t.key,r=new Promise(function(r,o){e.setState(function(a){var i=a.loadedKeys,l=a.loadingKeys,s=void 0===l?[]:l,c=e.props,u=c.loadData,d=c.onLoad;return u&&-1===(void 0===i?[]:i).indexOf(n)&&-1===s.indexOf(n)?(u(t).then(function(){var o=tr(e.state.loadedKeys,n);null==d||d(o,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:o}),e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),r()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),e.loadingRetryTimes[n]=(e.loadingRetryTimes[n]||0)+1,e.loadingRetryTimes[n]>=10){var a=e.state.loadedKeys;(0,T.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:tr(a,n)}),r()}o(t)}),{loadingKeys:tr(s,n)}):null})});return r.catch(function(){}),r},e.onNodeMouseEnter=function(t,n){var r=e.props.onMouseEnter;null==r||r({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var r=e.props.onMouseLeave;null==r||r({event:t,node:n})},e.onNodeContextMenu=function(t,n){var r=e.props.onRightClick;r&&(t.preventDefault(),r({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t||t.apply(void 0,r)},e.onBlur=function(){var t=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t||t.apply(void 0,r)},e.getTreeNodeRequiredProps=function(){var t=e.state;return{expandedKeys:t.expandedKeys||[],selectedKeys:t.selectedKeys||[],loadedKeys:t.loadedKeys||[],loadingKeys:t.loadingKeys||[],checkedKeys:t.checkedKeys||[],halfCheckedKeys:t.halfCheckedKeys||[],dragOverNodeKey:t.dragOverNodeKey,dropPosition:t.dropPosition,keyEntities:t.keyEntities}},e.setExpandedKeys=function(t){var n=e.state,r=e6(n.treeData,t,n.fieldNames);e.setUncontrolledState({expandedKeys:t,flattenNodes:r},!0)},e.onNodeExpand=function(t,n){var r=e.state.expandedKeys,o=e.state,a=o.listChanging,i=o.fieldNames,l=e.props,s=l.onExpand,c=l.loadData,u=n.expanded,d=n[i.key];if(!a){var f=r.indexOf(d),p=!u;if((0,T.ZP)(u&&-1!==f||!u&&-1===f,"Expand state not sync with index check"),r=p?tr(r,d):tn(r,d),e.setExpandedKeys(r),null==s||s(r,{node:n,expanded:p,nativeEvent:t.nativeEvent}),p&&c){var h=e.onNodeLoad(n);h&&h.then(function(){var t=e6(e.state.treeData,r,i);e.setUncontrolledState({flattenNodes:t})}).catch(function(){var t=tn(e.state.expandedKeys,d);e.setExpandedKeys(t)})}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout(function(){e.setUncontrolledState({listChanging:!1})})},e.onActiveChange=function(t){var n=e.state.activeKey,r=e.props,o=r.onActiveChange,a=r.itemScrollOffset;n!==t&&(e.setState({activeKey:t}),null!==t&&e.scrollTo({key:t,offset:void 0===a?0:a}),null==o||o(t))},e.getActiveItem=function(){var t=e.state,n=t.activeKey,r=t.flattenNodes;return null===n?null:r.find(function(e){return e.key===n})||null},e.offsetActiveKey=function(t){var n=e.state,r=n.flattenNodes,o=n.activeKey,a=r.findIndex(function(e){return e.key===o});-1===a&&t<0&&(a=r.length),a=(a+t+r.length)%r.length;var i=r[a];if(i){var l=i.key;e.onActiveChange(l)}else e.onActiveChange(null)},e.onKeyDown=function(t){var n=e.state,r=n.activeKey,o=n.expandedKeys,a=n.checkedKeys,i=n.fieldNames,l=e.props,s=l.onKeyDown,c=l.checkable,u=l.selectable;switch(t.which){case tz.Z.UP:e.offsetActiveKey(-1),t.preventDefault();break;case tz.Z.DOWN:e.offsetActiveKey(1),t.preventDefault()}var d=e.getActiveItem();if(d&&d.data){var f=e.getTreeNodeRequiredProps(),p=!1===d.data.isLeaf||!!(d.data[i.children]||[]).length,h=e5((0,O.Z)((0,O.Z)({},e3(r,f)),{},{data:d.data,active:!0}));switch(t.which){case tz.Z.LEFT:p&&o.includes(r)?e.onNodeExpand({},h):d.parent&&e.onActiveChange(d.parent.key),t.preventDefault();break;case tz.Z.RIGHT:p&&!o.includes(r)?e.onNodeExpand({},h):d.children&&d.children.length&&e.onActiveChange(d.children[0].key),t.preventDefault();break;case tz.Z.ENTER:case tz.Z.SPACE:!c||h.disabled||!1===h.checkable||h.disableCheckbox?c||!u||h.disabled||!1===h.selectable||e.onNodeSelect({},h):e.onNodeCheck({},h,!a.includes(r))}}null==s||s(t)},e.setUncontrolledState=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var o=!1,a=!0,i={};Object.keys(t).forEach(function(n){if(n in e.props){a=!1;return}o=!0,i[n]=t[n]}),o&&(!n||a)&&e.setState((0,O.Z)((0,O.Z)({},i),r))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return(0,eU.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t,n=this.state,r=n.focused,o=n.flattenNodes,i=n.keyEntities,l=n.draggingNodeKey,s=n.activeKey,c=n.dropLevelOffset,u=n.dropContainerKey,d=n.dropTargetKey,f=n.dropPosition,p=n.dragOverNodeKey,h=n.indent,g=this.props,v=g.prefixCls,y=g.className,b=g.style,x=g.showLine,w=g.focusable,k=g.tabIndex,S=g.selectable,O=g.showIcon,j=g.icon,P=g.switcherIcon,N=g.draggable,T=g.checkable,A=g.checkStrictly,M=g.disabled,I=g.motion,R=g.loadData,D=g.filterTreeNode,L=g.height,Z=g.itemHeight,z=g.virtual,B=g.titleRender,F=g.dropIndicatorRender,H=g.onContextMenu,q=g.onScroll,W=g.direction,U=g.rootClassName,K=g.rootStyle,V=(0,$.Z)(this.props,{aria:!0,data:!0});return N&&(t="object"===(0,E.Z)(N)?N:"function"==typeof N?{nodeDraggable:N}:{}),a.createElement(eX.Provider,{value:{prefixCls:v,selectable:S,showIcon:O,icon:j,switcherIcon:P,draggable:t,draggingNodeKey:l,checkable:T,checkStrictly:A,disabled:M,keyEntities:i,dropLevelOffset:c,dropContainerKey:u,dropTargetKey:d,dropPosition:f,dragOverNodeKey:p,indent:h,direction:W,dropIndicatorRender:F,loadData:R,filterTreeNode:D,titleRender:B,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},a.createElement("div",{role:"tree",className:_()(v,y,U,(e={},(0,C.Z)(e,"".concat(v,"-show-line"),x),(0,C.Z)(e,"".concat(v,"-focused"),r),(0,C.Z)(e,"".concat(v,"-active-focused"),null!==s),e)),style:K},a.createElement(nZ,(0,m.Z)({ref:this.listRef,prefixCls:v,style:b,data:o,disabled:M,selectable:S,checkable:!!T,motion:I,dragging:null!==l,height:L,itemHeight:Z,virtual:z,focusable:w,focused:r,tabIndex:void 0===k?0:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:H,onScroll:q},this.getTreeNodeRequiredProps(),V))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,r,o=t.prevProps,a={prevProps:e};function i(t){return!o&&t in e||o&&o[t]!==e[t]}var l=t.fieldNames;if(i("fieldNames")&&(l=e1(e.fieldNames),a.fieldNames=l),i("treeData")?n=e.treeData:i("children")&&((0,T.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=e2(e.children)),n){a.treeData=n;var s=e4(n,{fieldNames:l});a.keyEntities=(0,O.Z)((0,C.Z)({},nA,nI),s.keyEntities)}var c=a.keyEntities||t.keyEntities;if(i("expandedKeys")||o&&i("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!o&&e.defaultExpandParent?ts(e.expandedKeys,c):e.expandedKeys;else if(!o&&e.defaultExpandAll){var u=(0,O.Z)({},c);delete u[nA],a.expandedKeys=Object.keys(u).map(function(e){return u[e].key})}else!o&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?ts(e.defaultExpandedKeys,c):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var d=e6(n||t.treeData,a.expandedKeys||t.expandedKeys,l);a.flattenNodes=d}if(e.selectable&&(i("selectedKeys")?a.selectedKeys=ti(e.selectedKeys,e):!o&&e.defaultSelectedKeys&&(a.selectedKeys=ti(e.defaultSelectedKeys,e))),e.checkable&&(i("checkedKeys")?r=tl(e.checkedKeys)||{}:!o&&e.defaultCheckedKeys?r=tl(e.defaultCheckedKeys)||{}:n&&(r=tl(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),r)){var f=r,p=f.checkedKeys,h=void 0===p?[]:p,m=f.halfCheckedKeys,g=void 0===m?[]:m;if(!e.checkStrictly){var v=td(h,!0,c);h=v.checkedKeys,g=v.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=g}return i("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(a.Component);nz.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:o.top=0,o.left=-n*r;break;case 1:o.bottom=0,o.left=-n*r;break;case 0:o.bottom=0,o.left=r}return a.createElement("div",{style:o})},allowDrop:function(){return!0},expandAction:!1},nz.TreeNode=tt;var nB={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},nF=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nB}))}),nH={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nq=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nH}))}),nW={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nU=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nW}))}),nK={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},n$=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nK}))}),nV=n(68710),nX=n(23159),nG=n(63074);let nY=new t0.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nQ=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nJ=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,t0.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),n0=(e,t)=>{let{treeCls:n,treeNodeCls:r,treeNodePadding:o,titleHeight:a,nodeSelectedBg:i,nodeHoverBg:l}=t,s=t.paddingXS;return{[n]:Object.assign(Object.assign({},(0,t6.Wf)(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),["&".concat(n,"-rtl")]:{["".concat(n,"-switcher")]:{"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(90deg)"}}}}},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:Object.assign({},(0,t6.oN)(t)),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(r,".dragging")]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:nY,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},["".concat(r)]:{display:"flex",alignItems:"flex-start",padding:"0 0 ".concat((0,t0.bf)(o)," 0"),outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{["".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(r,"-disabled).filter-node ").concat(n,"-title")]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",visibility:"visible",opacity:.2,transition:"opacity ".concat(t.motionDurationSlow),["".concat(r,":hover &")]:{opacity:.45}},["&".concat(r,"-disabled")]:{["".concat(n,"-draggable-icon")]:{visibility:"hidden"}}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:a}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nQ(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,margin:0,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),borderRadius:t.borderRadius,"&-noop":{cursor:"unset"},["&:not(".concat(n,"-switcher-noop):hover")]:{backgroundColor:t.colorBgTextHover},"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-checkbox")]:{top:"initial",marginInlineEnd:s,alignSelf:"flex-start",marginTop:t.marginXXS},["".concat(n,"-node-content-wrapper, ").concat(n,"-checkbox + span")]:{position:"relative",zIndex:"auto",minHeight:a,margin:0,padding:"0 ".concat((0,t0.bf)(t.calc(t.paddingXS).div(2).equal())),color:"inherit",lineHeight:"".concat((0,t0.bf)(a)),background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s"),"&:hover":{backgroundColor:l},["&".concat(n,"-node-selected")]:{backgroundColor:i},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(n,"-node-content-wrapper")]:Object.assign({lineHeight:"".concat((0,t0.bf)(a)),userSelect:"none"},nJ(e,t)),["".concat(r,".drop-container")]:{"> [draggable]":{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)}},"&-show-line":{["".concat(n,"-indent")]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end":{"&:before":{display:"none"}}}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(r,"-leaf-last")]:{["".concat(n,"-switcher")]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:"".concat((0,t0.bf)(t.calc(a).div(2).equal())," !important")}}}}})}},n1=e=>{let{treeCls:t,treeNodeCls:n,treeNodePadding:r,directoryNodeSelectedBg:o,directoryNodeSelectedColor:a}=e;return{["".concat(t).concat(t,"-directory")]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,transition:"background-color ".concat(e.motionDurationMid),content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},["".concat(t,"-switcher")]:{transition:"color ".concat(e.motionDurationMid)},["".concat(t,"-node-content-wrapper")]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},["&".concat(t,"-node-selected")]:{color:a,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:o},["".concat(t,"-switcher")]:{color:a},["".concat(t,"-node-content-wrapper")]:{color:a,background:"transparent"}}}}}},n2=(e,t)=>{let n=".".concat(e),r=t.calc(t.paddingXS).div(2).equal(),o=(0,t4.TS)(t,{treeCls:n,treeNodeCls:"".concat(n,"-treenode"),treeNodePadding:r});return[n0(e,o),n1(o)]},n6=e=>{let{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}};var n4=(0,t3.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nX.C2)("".concat(n,"-checkbox"),e)},n2(n,e),(0,nG.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},n6(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})});function n3(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:o,direction:i="ltr"}=e,l="ltr"===i?"left":"right",s={[l]:-n*o+4,["ltr"===i?"right":"left"]:0};switch(t){case -1:s.top=-3;break;case 1:s.bottom=-3;break;default:s.bottom=-3,s[l]=o+4}return a.createElement("div",{style:s,className:"".concat(r,"-drop-indicator")})}var n5={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},n8=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:n5}))}),n7=n(61935),n9={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},re=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:n9}))}),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},rn=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rt}))}),rr=n(19722),ro=e=>{let t;let{prefixCls:n,switcherIcon:r,treeNodeProps:o,showLine:i}=e,{isLeaf:l,expanded:s,loading:c}=o;if(c)return a.createElement(n7.Z,{className:"".concat(n,"-switcher-loading-icon")});if(i&&"object"==typeof i&&(t=i.showLeafIcon),l){if(!i)return null;if("boolean"!=typeof t&&t){let e="function"==typeof t?t(o):t;return(0,rr.l$)(e)?(0,rr.Tm)(e,{className:_()(e.props.className||"","".concat(n,"-switcher-line-custom-icon"))}):e}return t?a.createElement(nF,{className:"".concat(n,"-switcher-line-icon")}):a.createElement("span",{className:"".concat(n,"-switcher-leaf-line")})}let u="".concat(n,"-switcher-icon"),d="function"==typeof r?r(o):r;return(0,rr.l$)(d)?(0,rr.Tm)(d,{className:_()(d.props.className||"",u)}):void 0!==d?d:i?s?a.createElement(re,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(rn,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(n8,{className:u})};let ra=a.forwardRef((e,t)=>{var n;let{getPrefixCls:r,direction:o,virtual:i,tree:l}=a.useContext(tC.E_),{prefixCls:s,className:c,showIcon:u=!1,showLine:d,switcherIcon:f,blockNode:p=!1,children:h,checkable:m=!1,selectable:g=!0,draggable:v,motion:y,style:b}=e,x=r("tree",s),w=r(),k=null!=y?y:Object.assign(Object.assign({},(0,nV.Z)(w)),{motionAppear:!1}),S=Object.assign(Object.assign({},e),{checkable:m,selectable:g,showIcon:u,motion:k,blockNode:p,showLine:!!d,dropIndicatorRender:n3}),[E,O,C]=n4(x),[,j]=(0,nl.ZP)(),P=j.paddingXS/2+((null===(n=j.Tree)||void 0===n?void 0:n.titleHeight)||j.controlHeightSM),N=a.useMemo(()=>{if(!v)return!1;let e={};switch(typeof v){case"function":e.nodeDraggable=v;break;case"object":e=Object.assign({},v)}return!1!==e.icon&&(e.icon=e.icon||a.createElement(n$,null)),e},[v]);return E(a.createElement(nz,Object.assign({itemHeight:P,ref:t,virtual:i},S,{style:Object.assign(Object.assign({},null==l?void 0:l.style),b),prefixCls:x,className:_()({["".concat(x,"-icon-hide")]:!u,["".concat(x,"-block-node")]:p,["".concat(x,"-unselectable")]:!g,["".concat(x,"-rtl")]:"rtl"===o},null==l?void 0:l.className,c,O,C),direction:o,checkable:m?a.createElement("span",{className:"".concat(x,"-checkbox-inner")}):m,selectable:g,switcherIcon:e=>a.createElement(ro,{prefixCls:x,switcherIcon:f,treeNodeProps:e,showLine:d}),draggable:N}),h))});function ri(e,t,n){let{key:r,children:o}=n;e.forEach(function(e){let a=e[r],i=e[o];!1!==t(a,e)&&ri(i||[],t,n)})}(r=o||(o={}))[r.None=0]="None",r[r.Start=1]="Start",r[r.End=2]="End";var rl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function rs(e){let{isLeaf:t,expanded:n}=e;return t?a.createElement(nF,null):n?a.createElement(nq,null):a.createElement(nU,null)}function rc(e){let{treeData:t,children:n}=e;return t||e2(n)}let ru=a.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:i}=e,l=rl(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let s=a.useRef(),c=a.useRef(),u=()=>{let{keyEntities:e}=e4(rc(l));return n?Object.keys(e):r?ts(l.expandedKeys||i||[],e):l.expandedKeys||i},[d,f]=a.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[p,h]=a.useState(()=>u());a.useEffect(()=>{"selectedKeys"in l&&f(l.selectedKeys)},[l.selectedKeys]),a.useEffect(()=>{"expandedKeys"in l&&h(l.expandedKeys)},[l.expandedKeys]);let{getPrefixCls:m,direction:g}=a.useContext(tC.E_),{prefixCls:v,className:y,showIcon:b=!0,expandAction:x="click"}=l,w=rl(l,["prefixCls","className","showIcon","expandAction"]),k=m("tree",v),S=_()("".concat(k,"-directory"),{["".concat(k,"-directory-rtl")]:"rtl"===g},y);return a.createElement(ra,Object.assign({icon:rs,ref:t,blockNode:!0},w,{showIcon:b,expandAction:x,prefixCls:k,className:S,expandedKeys:p,selectedKeys:d,onSelect:(e,t)=>{var n;let r;let{multiple:a,fieldNames:i}=l,{node:u,nativeEvent:d}=t,{key:h=""}=u,m=rc(l),g=Object.assign(Object.assign({},t),{selected:!0}),v=(null==d?void 0:d.ctrlKey)||(null==d?void 0:d.metaKey),y=null==d?void 0:d.shiftKey;a&&v?(r=e,s.current=h,c.current=r):a&&y?r=Array.from(new Set([].concat((0,es.Z)(c.current||[]),(0,es.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:r,endKey:a,fieldNames:i}=e,l=[],s=o.None;return r&&r===a?[r]:r&&a?(ri(t,e=>{if(s===o.End)return!1;if(e===r||e===a){if(l.push(e),s===o.None)s=o.Start;else if(s===o.Start)return s=o.End,!1}else s===o.Start&&l.push(e);return n.includes(e)},e1(i)),l):[]}({treeData:m,expandedKeys:p,startKey:h,endKey:s.current,fieldNames:i}))))):(r=[h],s.current=h,c.current=r),g.selectedNodes=function(e,t,n){let r=(0,es.Z)(t),o=[];return ri(e,(e,t)=>{let n=r.indexOf(e);return -1!==n&&(o.push(t),r.splice(n,1)),!!r.length},e1(n)),o}(m,r,i),null===(n=l.onSelect)||void 0===n||n.call(l,r,g),"selectedKeys"in l||f(r)},onExpand:(e,t)=>{var n;return"expandedKeys"in l||h(e),null===(n=l.onExpand)||void 0===n?void 0:n.call(l,e,t)}}))});ra.DirectoryTree=ru,ra.TreeNode=tt;var rd=n(29436),rf=n(64482),rp=function(e){let{value:t,onChange:n,filterSearch:r,tablePrefixCls:o,locale:i}=e;return r?a.createElement("div",{className:"".concat(o,"-filter-dropdown-search")},a.createElement(rf.default,{prefix:a.createElement(rd.Z,null),placeholder:i.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,className:"".concat(o,"-filter-dropdown-search-input")})):null};let rh=e=>{let{keyCode:t}=e;t===tz.Z.ENTER&&e.stopPropagation()},rm=a.forwardRef((e,t)=>a.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:rh,ref:t},e.children));function rg(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:r}=e;t.push(n),r&&(t=[].concat((0,es.Z)(t),(0,es.Z)(rg(r))))}),t}function rv(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var ry=function(e){var t,n;let r,o;let{tablePrefixCls:i,prefixCls:l,column:s,dropdownPrefixCls:c,columnKey:u,filterMultiple:f,filterMode:p="menu",filterSearch:h=!1,filterState:m,triggerFilter:g,locale:v,children:y,getPopupContainer:b,rootClassName:x}=e,{filterDropdownOpen:w,onFilterDropdownOpenChange:k,filterResetToDefaultFilteredValue:S,defaultFilteredValue:E,filterDropdownVisible:O,onFilterDropdownVisibleChange:C}=s,[j,P]=a.useState(!1),N=!!(m&&((null===(t=m.filteredKeys)||void 0===t?void 0:t.length)||m.forceFiltered)),T=e=>{P(e),null==k||k(e),null==C||C(e)},A=null!==(n=null!=w?w:O)&&void 0!==n?n:j,M=null==m?void 0:m.filteredKeys,[I,R]=function(e){let t=a.useRef(e),n=(0,ny.Z)();return[()=>t.current,e=>{t.current=e,n()}]}(M||[]),D=e=>{let{selectedKeys:t}=e;R(t)};a.useEffect(()=>{j&&D({selectedKeys:M||[]})},[M]);let[L,Z]=a.useState([]),[z,B]=a.useState(""),F=e=>{let{value:t}=e.target;B(t)};a.useEffect(()=>{j||B("")},[j]);let H=e=>{let t=e&&e.length?e:null;if(null===t&&(!m||!m.filteredKeys)||(0,d.Z)(t,null==m?void 0:m.filteredKeys,!0))return null;g({column:s,key:u,filteredKeys:t})},q=()=>{T(!1),H(I())},W=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&H([]),t&&T(!1),B(""),S?R((E||[]).map(e=>String(e))):R([])},U=_()({["".concat(c,"-menu-without-submenu")]:!(s.filters||[]).some(e=>{let{children:t}=e;return t})}),K=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),r={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(r.children=K({filters:e.children})),r})},$=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>$(e)))||[]})};if("function"==typeof s.filterDropdown)r=s.filterDropdown({prefixCls:"".concat(c,"-custom"),setSelectedKeys:e=>D({selectedKeys:e}),selectedKeys:I(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&T(!1),H(I())},clearFilters:W,filters:s.filters,visible:A,close:()=>{T(!1)}});else if(s.filterDropdown)r=s.filterDropdown;else{let e=I()||[];r=a.createElement(a.Fragment,null,0===(s.filters||[]).length?a.createElement(nx.Z,{image:nx.Z.PRESENTED_IMAGE_SIMPLE,description:v.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):"tree"===p?a.createElement(a.Fragment,null,a.createElement(rp,{filterSearch:h,value:z,onChange:F,tablePrefixCls:i,locale:v}),a.createElement("div",{className:"".concat(i,"-filter-dropdown-tree")},f?a.createElement(th.Z,{checked:e.length===rg(s.filters).length,indeterminate:e.length>0&&e.length<rg(s.filters).length,className:"".concat(i,"-filter-dropdown-checkall"),onChange:e=>{e.target.checked?R(rg(null==s?void 0:s.filters).map(e=>String(e))):R([])}},v.filterCheckall):null,a.createElement(ra,{checkable:!0,selectable:!1,blockNode:!0,multiple:f,checkStrictly:!f,className:"".concat(c,"-menu"),onCheck:(e,t)=>{let{node:n,checked:r}=t;f?D({selectedKeys:e}):D({selectedKeys:r&&n.key?[n.key]:[]})},checkedKeys:e,selectedKeys:e,showIcon:!1,treeData:K({filters:s.filters}),autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:z.trim()?e=>"function"==typeof h?h(z,$(e)):rv(z,e.title):void 0}))):a.createElement(a.Fragment,null,a.createElement(rp,{filterSearch:h,value:z,onChange:F,tablePrefixCls:i,locale:v}),a.createElement(nw.Z,{selectable:!0,multiple:f,prefixCls:"".concat(c,"-menu"),className:U,onSelect:D,onDeselect:D,selectedKeys:e,getPopupContainer:b,openKeys:L,onOpenChange:e=>{Z(e)},items:function e(t){let{filters:n,prefixCls:r,filteredKeys:o,filterMultiple:i,searchValue:l,filterSearch:s}=t;return n.map((t,n)=>{let c=String(t.value);if(t.children)return{key:c||n,label:t.text,popupClassName:"".concat(r,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:r,filteredKeys:o,filterMultiple:i,searchValue:l,filterSearch:s})};let u=i?th.Z:tg.ZP,d={key:void 0!==t.value?c:n,label:a.createElement(a.Fragment,null,a.createElement(u,{checked:o.includes(c)}),a.createElement("span",null,t.text))};return l.trim()?"function"==typeof s?s(l,t)?d:null:rv(l,t.text)?d:null:d})}({filters:s.filters||[],filterSearch:h,prefixCls:l,filteredKeys:I(),filterMultiple:f,searchValue:z})})),a.createElement("div",{className:"".concat(l,"-dropdown-btns")},a.createElement(nb.ZP,{type:"link",size:"small",disabled:S?(0,d.Z)((E||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>W()},v.filterReset),a.createElement(nb.ZP,{type:"primary",size:"small",onClick:q},v.filterConfirm)))}s.filterDropdown&&(r=a.createElement(nk.J,{selectable:void 0},r)),o="function"==typeof s.filterIcon?s.filterIcon(N):s.filterIcon?s.filterIcon:a.createElement(nv,null);let{direction:V}=a.useContext(tC.E_);return a.createElement("div",{className:"".concat(l,"-column")},a.createElement("span",{className:"".concat(i,"-column-title")},y),a.createElement(tm.Z,{dropdownRender:()=>a.createElement(rm,{className:"".concat(l,"-dropdown")},r),trigger:["click"],open:A,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==M&&R(M||[]),T(e),e||s.filterDropdown||q())},getPopupContainer:b,placement:"rtl"===V?"bottomLeft":"bottomRight",rootClassName:x},a.createElement("span",{role:"button",tabIndex:-1,className:_()("".concat(l,"-trigger"),{active:N}),onClick:e=>{e.stopPropagation()}},o)))};function rb(e,t,n){let r=[];return(e||[]).forEach((e,o)=>{var a;let i=nh(o,n);if(e.filters||"filterDropdown"in e||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;"filterDropdown"in e||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),r.push({column:e,key:np(e,i),filteredKeys:t,forceFiltered:e.filtered})}else r.push({column:e,key:np(e,i),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(r=[].concat((0,es.Z)(r),(0,es.Z)(rb(e.children,t,i))))}),r}function rx(e){let t={};return e.forEach(e=>{let{key:n,filteredKeys:r,column:o}=e,{filters:a,filterDropdown:i}=o;if(i)t[n]=r||null;else if(Array.isArray(r)){let e=rg(a);t[n]=e.filter(e=>r.includes(String(e)))}else t[n]=null}),t}function rw(e,t){return t.reduce((e,t)=>{let{column:{onFilter:n,filters:r},filteredKeys:o}=t;return n&&o&&o.length?e.filter(e=>o.some(t=>{let o=rg(r),a=o.findIndex(e=>String(e)===String(t));return n(-1!==a?o[a]:t,e)})):e},e)}let rk=e=>e.flatMap(e=>"children"in e?[e].concat((0,es.Z)(rk(e.children||[]))):[e]);var rS=function(e){let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,onFilterChange:o,getPopupContainer:i,locale:l,rootClassName:s}=e;(0,tp.ln)("Table");let c=a.useMemo(()=>rk(r||[]),[r]),[u,d]=a.useState(()=>rb(c,!0)),f=a.useMemo(()=>{let e=rb(c,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(c||[]).map((e,t)=>np(e,nh(t)));return u.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=c[e.findIndex(e=>e===t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[c,u]),p=a.useMemo(()=>rx(f),[f]),h=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),d(t),o(rx(t),t)};return[e=>(function e(t,n,r,o,i,l,s,c,u){return r.map((r,d)=>{let f=nh(d,c),{filterMultiple:p=!0,filterMode:h,filterSearch:m}=r,g=r;if(g.filters||g.filterDropdown){let e=np(g,f),c=o.find(t=>{let{key:n}=t;return e===n});g=Object.assign(Object.assign({},g),{title:o=>a.createElement(ry,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:g,columnKey:e,filterState:c,filterMultiple:p,filterMode:h,filterSearch:m,triggerFilter:l,locale:i,getPopupContainer:s,rootClassName:u},nm(r.title,o))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:e(t,n,g.children,o,i,l,s,f,u)})),g})})(t,n,e,f,l,h,i,void 0,s),f,p]},rE=function(){let e=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t<arguments.length;t++){let n=t<0||arguments.length<=t?void 0:arguments[t];n&&Object.keys(n).forEach(t=>{let r=n[t];void 0!==r&&(e[t]=r)})}return e},rO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},rC=function(e,t,n){let r=n&&"object"==typeof n?n:{},{total:o=0}=r,i=rO(r,["total"]),[l,s]=(0,a.useState)(()=>({current:"defaultCurrent"in i?i.defaultCurrent:1,pageSize:"defaultPageSize"in i?i.defaultPageSize:10})),c=rE(l,i,{total:o>0?o:e}),u=Math.ceil((o||e)/c.pageSize);c.current>u&&(c.current=u||1);let d=(e,t)=>{s({current:null!=e?e:1,pageSize:t||c.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},c),{onChange:(e,r)=>{var o;n&&(null===(o=n.onChange)||void 0===o||o.call(n,e,r)),d(e,r),t(e,r||(null==c?void 0:c.pageSize))}}),d]},rj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},r_=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rj}))}),rP={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},rN=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rP}))}),rT=n(89970);let rA="ascend",rM="descend";function rI(e){return"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple}function rR(e){return"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare}function rD(e,t,n){let r=[];function o(e,t){r.push({column:e,key:np(e,t),multiplePriority:rI(e),sortOrder:e.sortOrder})}return(e||[]).forEach((e,a)=>{let i=nh(a,n);e.children?("sortOrder"in e&&o(e,i),r=[].concat((0,es.Z)(r),(0,es.Z)(rD(e.children,t,i)))):e.sorter&&("sortOrder"in e?o(e,i):t&&e.defaultSortOrder&&r.push({column:e,key:np(e,i),multiplePriority:rI(e),sortOrder:e.defaultSortOrder}))}),r}function rL(e){let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function rZ(e){let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(rL);return 0===t.length&&e.length?Object.assign(Object.assign({},rL(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function rz(e,t,n){let r=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),o=e.slice(),a=r.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return rR(t)&&n});return a.length?o.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let{column:{sorter:r},sortOrder:o}=a[n],i=rR(r);if(i&&o){let n=i(e,t,o);if(0!==n)return o===rA?n:-n}}return 0}).map(e=>{let r=e[n];return r?Object.assign(Object.assign({},e),{[n]:rz(r,t,n)}):e}):o}var rB=x(eA,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),rF=x(eH,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),rH=n(36360),rq=e=>{let{componentCls:t,lineWidth:n,lineType:r,tableBorderColor:o,tableHeaderBg:a,tablePaddingVertical:i,tablePaddingHorizontal:l,calc:s}=e,c="".concat((0,t0.bf)(n)," ").concat(r," ").concat(o),u=(e,r,o)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(s(r).mul(-1).equal()),"\n ").concat((0,t0.bf)(s(s(o).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:c,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:c,borderTop:c,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:c},"> thead":{"> tr:not(:last-child) > th":{borderBottom:c},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:c}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(s(i).mul(-1).equal())," ").concat((0,t0.bf)(s(s(l).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:c,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},u("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),u("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:c,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,t0.bf)(n)," 0 ").concat((0,t0.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:c}}}},rW=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},t6.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},rU=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},rK=n(76122),r$=e=>{let{componentCls:t,antCls:n,motionDurationSlow:r,lineWidth:o,paddingXS:a,lineType:i,tableBorderColor:l,tableExpandIconBg:s,tableExpandColumnWidth:c,borderRadius:u,tablePaddingVertical:d,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:h,expandIconMarginTop:m,expandIconSize:g,expandIconHalfInner:v,expandIconScale:y,calc:b}=e,x="".concat((0,t0.bf)(o)," ").concat(i," ").concat(l),w=b(h).sub(o).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:c},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,rK.N)(e)),{position:"relative",float:"left",boxSizing:"border-box",width:g,height:g,padding:0,color:"inherit",lineHeight:(0,t0.bf)(g),background:s,border:x,borderRadius:u,transform:"scale(".concat(y,")"),transition:"all ".concat(r),userSelect:"none","&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(r," ease-out"),content:'""'},"&::before":{top:v,insetInlineEnd:w,insetInlineStart:w,height:o},"&::after":{top:w,bottom:w,insetInlineStart:v,width:o,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:m,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"auto"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,t0.bf)(b(d).mul(-1).equal())," ").concat((0,t0.bf)(b(f).mul(-1).equal())),padding:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(f))}}}},rV=e=>{let{componentCls:t,antCls:n,iconCls:r,tableFilterDropdownWidth:o,tableFilterDropdownSearchWidth:a,paddingXXS:i,paddingXS:l,colorText:s,lineWidth:c,lineType:u,tableBorderColor:d,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:h,borderRadius:m,motionDurationSlow:g,colorTextDescription:v,colorPrimary:y,tableHeaderFilterActiveBg:b,colorTextDisabled:x,tableFilterDropdownBg:w,tableFilterDropdownHeight:k,controlItemBgHover:S,controlItemBgActive:E,boxShadowSecondary:O,filterDropdownMenuBg:C,calc:j}=e,_="".concat(n,"-dropdown"),P="".concat(t,"-filter-dropdown"),N="".concat(n,"-tree"),T="".concat((0,t0.bf)(c)," ").concat(u," ").concat(d);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:j(i).mul(-1).equal(),marginInline:"".concat((0,t0.bf)(i)," ").concat((0,t0.bf)(j(h).div(2).mul(-1).equal())),padding:"0 ".concat((0,t0.bf)(i)),color:f,fontSize:p,borderRadius:m,cursor:"pointer",transition:"all ".concat(g),"&:hover":{color:v,background:b},"&.active":{color:y}}}},{["".concat(n,"-dropdown")]:{[P]:Object.assign(Object.assign({},(0,t6.Wf)(e)),{minWidth:o,backgroundColor:w,borderRadius:m,boxShadow:O,overflow:"hidden",["".concat(_,"-menu")]:{maxHeight:k,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:C,"&:empty::after":{display:"block",padding:"".concat((0,t0.bf)(l)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(P,"-tree")]:{paddingBlock:"".concat((0,t0.bf)(l)," 0"),paddingInline:l,[N]:{padding:0},["".concat(N,"-treenode ").concat(N,"-node-content-wrapper:hover")]:{backgroundColor:S},["".concat(N,"-treenode-checkbox-checked ").concat(N,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(P,"-search")]:{padding:l,borderBottom:T,"&-input":{input:{minWidth:a},[r]:{color:x}}},["".concat(P,"-checkall")]:{width:"100%",marginBottom:i,marginInlineStart:i},["".concat(P,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,t0.bf)(j(l).sub(c).equal())," ").concat((0,t0.bf)(l)),overflow:"hidden",borderTop:T}})}},{["".concat(n,"-dropdown ").concat(P,", ").concat(P,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:l,color:s},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},rX=e=>{let{componentCls:t,lineWidth:n,colorSplit:r,motionDurationSlow:o,zIndexTableFixed:a,tableBg:i,zIndexTableSticky:l,calc:s}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:i},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:s(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:s(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:s(l).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(r)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(r)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(r)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(r)}}}}},rG=e=>{let{componentCls:t,antCls:n,margin:r}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,t0.bf)(r)," 0")},["".concat(t,"-pagination")]:{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"> *":{flex:"none"},"&-left":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-right":{justifyContent:"flex-end"}}}}},rY=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n))}}}}},rQ=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},rJ=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSizeIcon:o,padding:a,paddingXS:i,headerIconColor:l,headerIconHoverColor:s,tableSelectionColumnWidth:c,tableSelectedRowBg:u,tableSelectedRowHoverBg:d,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:h}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:c,["&".concat(t,"-selection-col-with-dropdown")]:{width:h(c).add(o).add(h(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:h(c).add(h(i).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:h(c).add(o).add(h(a).div(4)).add(h(i).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:e.zIndexTableFixed+1},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,t0.bf)(h(p).div(4).equal()),[r]:{color:l,fontSize:o,verticalAlign:"baseline","&:hover":{color:s}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:u,"&-row-hover":{background:d}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},r0=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:r}=e,o=(e,o,a,i)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:i,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,t0.bf)(r(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(r(o).mul(-1).equal())," ").concat((0,t0.bf)(r(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,t0.bf)(r(o).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(r(n).sub(a).equal())," ").concat((0,t0.bf)(r(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,t0.bf)(r(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},o("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),o("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},r1=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:r,headerIconColor:o,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:o,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:r,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},r2=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:r,tableScrollThumbBgHover:o,tableScrollThumbSize:a,tableScrollBg:i,zIndexTableSticky:l,stickyScrollBarBorderRadius:s,lineWidth:c,lineType:u,tableBorderColor:d}=e,f="".concat((0,t0.bf)(c)," ").concat(u," ").concat(d);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:l,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,t0.bf)(a)," !important"),zIndex:l,display:"flex",alignItems:"center",background:i,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:r,borderRadius:s,transition:"all ".concat(e.motionDurationSlow,", transform none"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:o}}}}}}},r6=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:r,calc:o}=e,a="".concat((0,t0.bf)(n)," ").concat(e.lineType," ").concat(r);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,t0.bf)(o(n).mul(-1).equal())," 0 ").concat(r)}}}},r4=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:r,lineType:o,tableBorderColor:a,calc:i}=e,l="".concat((0,t0.bf)(r)," ").concat(o," ").concat(a),s="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-row")]:{display:"flex",boxSizing:"border-box",width:"100%"},["".concat(t,"-cell")]:{borderBottom:l,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(s).concat(s,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,t0.bf)(r),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:l,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:l,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:i(r).mul(-1).equal(),borderInlineStart:l}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:l,borderBottom:l}}}}}};let r3=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:r,tablePaddingHorizontal:o,tableExpandColumnWidth:a,lineWidth:i,lineType:l,tableBorderColor:s,tableFontSize:c,tableBg:u,tableRadius:d,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:h,tableHeaderCellSplitColor:m,tableFooterTextColor:g,tableFooterBg:v,calc:y}=e,b="".concat((0,t0.bf)(i)," ").concat(l," ").concat(s);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%"},(0,t6.dF)()),{[t]:Object.assign(Object.assign({},(0,t6.Wf)(e)),{fontSize:c,background:u,borderRadius:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(d)," 0 0")}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(d)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:h,borderBottom:b,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:m,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:b,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,t0.bf)(y(r).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(y(a).sub(o).equal()),"\n ").concat((0,t0.bf)(y(o).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:h,borderBottom:b,transition:"background ".concat(p," ease")}}},["".concat(t,"-footer")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o)),color:g,background:v}})}};var r5=(0,t3.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:r,controlInteractiveSize:o,headerBg:a,headerColor:i,headerSortActiveBg:l,headerSortHoverBg:s,bodySortBg:c,rowHoverBg:u,rowSelectedBg:d,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:h,cellPaddingInline:m,cellPaddingBlockMD:g,cellPaddingInlineMD:v,cellPaddingBlockSM:y,cellPaddingInlineSM:b,borderColor:x,footerBg:w,footerColor:k,headerBorderRadius:S,cellFontSize:E,cellFontSizeMD:O,cellFontSizeSM:C,headerSplitColor:j,fixedHeaderSortActiveBg:_,headerFilterHoverBg:P,filterDropdownBg:N,expandIconBg:T,selectionColumnWidth:A,stickyScrollBarBg:M,calc:I}=e,R=(0,t4.TS)(e,{tableFontSize:E,tableBg:r,tableRadius:S,tablePaddingVertical:h,tablePaddingHorizontal:m,tablePaddingVerticalMiddle:g,tablePaddingHorizontalMiddle:v,tablePaddingVerticalSmall:y,tablePaddingHorizontalSmall:b,tableBorderColor:x,tableHeaderTextColor:i,tableHeaderBg:a,tableFooterTextColor:k,tableFooterBg:w,tableHeaderCellSplitColor:j,tableHeaderSortBg:l,tableHeaderSortHoverBg:s,tableBodySortBg:c,tableFixedHeaderSortActiveBg:_,tableHeaderFilterActiveBg:P,tableFilterDropdownBg:N,tableRowHoverBg:u,tableSelectedRowBg:d,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:3,tableFontSizeMiddle:O,tableFontSizeSmall:C,tableSelectionColumnWidth:A,tableExpandIconBg:T,tableExpandColumnWidth:I(o).add(I(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:M,tableScrollThumbBgHover:t,tableScrollBg:n});return[r3(R),rG(R),r6(R),r1(R),rV(R),rq(R),rY(R),r$(R),r6(R),rU(R),rJ(R),rX(R),r2(R),rW(R),r0(R),rQ(R),r4(R)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:r,colorFillSecondary:o,colorFillContent:a,controlItemBgActive:i,controlItemBgActiveHover:l,padding:s,paddingSM:c,paddingXS:u,colorBorderSecondary:d,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:h,fontSize:m,fontSizeSM:g,lineHeight:v,lineWidth:y,colorIcon:b,colorIconHover:x,opacityLoading:w,controlInteractiveSize:k}=e,S=new rH.C(o).onBackground(n).toHexShortString(),E=new rH.C(a).onBackground(n).toHexShortString(),O=new rH.C(t).onBackground(n).toHexShortString(),C=new rH.C(b),j=new rH.C(x),_=k/2-y,P=2*_+3*y;return{headerBg:O,headerColor:r,headerSortActiveBg:S,headerSortHoverBg:E,bodySortBg:O,rowHoverBg:O,rowSelectedBg:i,rowSelectedHoverBg:l,rowExpandedBg:t,cellPaddingBlock:s,cellPaddingInline:s,cellPaddingBlockMD:c,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:d,headerBorderRadius:f,footerBg:O,footerColor:r,cellFontSize:m,cellFontSizeMD:m,cellFontSizeSM:m,headerSplitColor:d,fixedHeaderSortActiveBg:S,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:h,stickyScrollBarBorderRadius:100,expandIconMarginTop:(m*v-3*y)/2-Math.ceil((1.4*g-3*y)/2),headerIconColor:C.clone().setAlpha(C.getAlpha()*w).toRgbString(),headerIconHoverColor:j.clone().setAlpha(j.getAlpha()*w).toRgbString(),expandIconHalfInner:_,expandIconSize:P,expandIconScale:k/P}},{unitless:{expandIconScale:!0}});let r8=[];var r7=a.forwardRef((e,t)=>{var n,r;let o,i,s;let{prefixCls:c,className:u,rootClassName:d,style:f,size:p,bordered:h,dropdownPrefixCls:m,dataSource:g,pagination:v,rowSelection:y,rowKey:b="key",rowClassName:x,columns:w,children:k,childrenColumnName:S,onChange:E,getPopupContainer:O,loading:C,expandIcon:j,expandable:P,expandedRowRender:N,expandIconColumnIndex:T,indentSize:A,scroll:M,sortDirections:I,locale:R,showSorterTooltip:D=!0,virtual:L}=e;(0,tp.ln)("Table");let Z=a.useMemo(()=>w||ey(k),[w,k]),z=a.useMemo(()=>Z.some(e=>e.responsive),[Z]),B=(0,tN.Z)(z),F=a.useMemo(()=>{let e=new Set(Object.keys(B).filter(e=>B[e]));return Z.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[Z,B]),H=(0,eY.Z)(e,["className","style","columns"]),{locale:q=tT.Z,direction:W,table:U,renderEmpty:K,getPrefixCls:$,getPopupContainer:V}=a.useContext(tC.E_),X=(0,tP.Z)(p),G=Object.assign(Object.assign({},q.Table),R),Y=g||r8,Q=$("table",c),J=$("dropdown",m),[,ee]=(0,nl.ZP)(),et=(0,t_.Z)(Q),[en,er,eo]=r5(Q,et),ea=Object.assign({childrenColumnName:S,expandIconColumnIndex:T},P),{childrenColumnName:ei="children"}=ea,el=a.useMemo(()=>Y.some(e=>null==e?void 0:e[ei])?"nest":N||P&&P.expandedRowRender?"row":null,[Y]),ec={body:a.useRef()},eu=a.useRef(null),ed=a.useRef(null);n=()=>Object.assign(Object.assign({},ed.current),{nativeElement:eu.current}),(0,a.useImperativeHandle)(t,()=>{let e=n(),{nativeElement:t}=e;return"undefined"!=typeof Proxy?new Proxy(t,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(t._antProxy=t._antProxy||{},Object.keys(e).forEach(n=>{if(!(n in t._antProxy)){let r=t[n];t._antProxy[n]=r,t[n]=e[n]}}),t)});let ef=a.useMemo(()=>"function"==typeof b?b:e=>null==e?void 0:e[b],[b]),[ep]=function(e,t,n){let r=a.useRef({});return[function(o){if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){let o=new Map;!function e(r){r.forEach((r,a)=>{let i=n(r,a);o.set(i,r),r&&"object"==typeof r&&t in r&&e(r[t]||[])})}(e),r.current={data:e,childrenColumnName:t,kvMap:o,getRowKey:n}}return r.current.kvMap.get(o)}]}(Y,ei,ef),eh={},em=function(e,t){var n,r,o;let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Object.assign(Object.assign({},eh),e);a&&(null===(n=eh.resetPagination)||void 0===n||n.call(eh),(null===(r=i.pagination)||void 0===r?void 0:r.current)&&(i.pagination.current=1),v&&v.onChange&&v.onChange(1,null===(o=i.pagination)||void 0===o?void 0:o.pageSize)),M&&!1!==M.scrollToFirstRowOnChange&&ec.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:r,duration:o=450}=t,a=n(),i=function(e,t){var n,r;if("undefined"==typeof window)return 0;let o=t?"scrollTop":"scrollLeft",a=0;return tO(e)?a=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?a=e.documentElement[o]:e instanceof HTMLElement?a=e[o]:e&&(a=e[o]),e&&!tO(e)&&"number"!=typeof a&&(a=null===(r=(null!==(n=e.ownerDocument)&&void 0!==n?n:e).documentElement)||void 0===r?void 0:r[o]),a}(a,!0),l=Date.now(),s=()=>{let t=Date.now()-l,n=function(e,t,n,r){let o=n-t;return(e/=r/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t}(t>o?o:t,i,e,o);tO(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,t<o?(0,tE.Z)(s):"function"==typeof r&&r()};(0,tE.Z)(s)}(0,{getContainer:()=>ec.body.current}),null==E||E(i.pagination,i.filters,i.sorter,{currentDataSource:rw(rz(Y,i.sorterStates,ei),i.filterStates),action:t})},[eg,ev,eb,ex]=function(e){let{prefixCls:t,mergedColumns:n,onSorterChange:r,sortDirections:o,tableLocale:i,showSorterTooltip:l}=e,[s,c]=a.useState(rD(n,!0)),u=a.useMemo(()=>{let e=!0,t=rD(n,!1);if(!t.length)return s;let r=[];function o(t){e?r.push(t):r.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(o(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),o(t))}),r},[n,s]),d=a.useMemo(()=>{let e=u.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}},[u]);function f(e){let t;c(t=!1!==e.multiplePriority&&u.length&&!1!==u[0].multiplePriority?[].concat((0,es.Z)(u.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),r(rZ(t),t)}return[e=>(function e(t,n,r,o,i,l,s,c){return(n||[]).map((n,u)=>{let d=nh(u,c),f=n;if(f.sorter){let e;let c=f.sortDirections||i,u=void 0===f.showSorterTooltip?s:f.showSorterTooltip,p=np(f,d),h=r.find(e=>{let{key:t}=e;return t===p}),m=h?h.sortOrder:null,g=m?c[c.indexOf(m)+1]:c[0];if(n.sortIcon)e=n.sortIcon({sortOrder:m});else{let n=c.includes(rA)&&a.createElement(rN,{className:_()("".concat(t,"-column-sorter-up"),{active:m===rA})}),r=c.includes(rM)&&a.createElement(r_,{className:_()("".concat(t,"-column-sorter-down"),{active:m===rM})});e=a.createElement("span",{className:_()("".concat(t,"-column-sorter"),{["".concat(t,"-column-sorter-full")]:!!(n&&r)})},a.createElement("span",{className:"".concat(t,"-column-sorter-inner"),"aria-hidden":"true"},n,r))}let{cancelSort:v,triggerAsc:y,triggerDesc:b}=l||{},x=v;g===rM?x=b:g===rA&&(x=y);let w="object"==typeof u?Object.assign({title:x},u):{title:x};f=Object.assign(Object.assign({},f),{className:_()(f.className,{["".concat(t,"-column-sort")]:m}),title:r=>{let o=a.createElement("div",{className:"".concat(t,"-column-sorters")},a.createElement("span",{className:"".concat(t,"-column-title")},nm(n.title,r)),e);return u?a.createElement(rT.Z,Object.assign({},w),o):o},onHeaderCell:e=>{let r=n.onHeaderCell&&n.onHeaderCell(e)||{},a=r.onClick,i=r.onKeyDown;r.onClick=e=>{o({column:n,key:p,sortOrder:g,multiplePriority:rI(n)}),null==a||a(e)},r.onKeyDown=e=>{e.keyCode===tz.Z.ENTER&&(o({column:n,key:p,sortOrder:g,multiplePriority:rI(n)}),null==i||i(e))};let l=function(e,t){let n=nm(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n}(n.title,{}),s=null==l?void 0:l.toString();return m?r["aria-sort"]="ascend"===m?"ascending":"descending":r["aria-label"]=s||"",r.className=_()(r.className,"".concat(t,"-column-has-sorters")),r.tabIndex=0,n.ellipsis&&(r.title=(null!=l?l:"").toString()),r}})}return"children"in f&&(f=Object.assign(Object.assign({},f),{children:e(t,f.children,r,o,i,l,s,d)})),f})})(t,e,u,f,o,i,l),u,d,()=>rZ(u)]}({prefixCls:Q,mergedColumns:F,onSorterChange:(e,t)=>{em({sorter:e,sorterStates:t},"sort",!1)},sortDirections:I||["ascend","descend"],tableLocale:G,showSorterTooltip:D}),ew=a.useMemo(()=>rz(Y,ev,ei),[Y,ev]);eh.sorter=ex(),eh.sorterStates=ev;let[ek,eS,eE]=rS({prefixCls:Q,locale:G,dropdownPrefixCls:J,mergedColumns:F,onFilterChange:(e,t)=>{em({filters:e,filterStates:t},"filter",!0)},getPopupContainer:O||V,rootClassName:_()(d,et)}),eO=rw(ew,eS);eh.filters=eE,eh.filterStates=eS;let[eC]=(r=a.useMemo(()=>{let e={};return Object.keys(eE).forEach(t=>{null!==eE[t]&&(e[t]=eE[t])}),Object.assign(Object.assign({},eb),{filters:e})},[eb,eE]),[a.useCallback(e=>(function e(t,n){return t.map(t=>{let r=Object.assign({},t);return r.title=nm(t.title,n),"children"in r&&(r.children=e(r.children,n)),r})})(e,r),[r])]),[ej,e_]=rC(eO.length,(e,t)=>{em({pagination:Object.assign(Object.assign({},eh.pagination),{current:e,pageSize:t})},"paginate")},v);eh.pagination=!1===v?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let r=e[t];"function"!=typeof r&&(n[t]=r)}),n}(ej,v),eh.resetPagination=e_;let eP=a.useMemo(()=>{if(!1===v||!ej.pageSize)return eO;let{current:e=1,total:t,pageSize:n=10}=ej;return eO.length<t?eO.length>n?eO.slice((e-1)*n,e*n):eO:eO.slice((e-1)*n,e*n)},[!!v,eO,ej&&ej.current,ej&&ej.pageSize,ej&&ej.total]),[eN,eT]=tS({prefixCls:Q,data:eO,pageData:eP,getRowKey:ef,getRecordByKey:ep,expandType:el,childrenColumnName:ei,locale:G,getPopupContainer:O||V},y);ea.__PARENT_RENDER_ICON__=ea.expandIcon,ea.expandIcon=ea.expandIcon||j||function(e){let{prefixCls:t,onExpand:n,record:r,expanded:o,expandable:i}=e,l="".concat(t,"-row-expand-icon");return a.createElement("button",{type:"button",onClick:e=>{n(r,e),e.stopPropagation()},className:_()(l,{["".concat(l,"-spaced")]:!i,["".concat(l,"-expanded")]:i&&o,["".concat(l,"-collapsed")]:i&&!o}),"aria-label":o?G.collapse:G.expand,"aria-expanded":o})},"nest"===el&&void 0===ea.expandIconColumnIndex?ea.expandIconColumnIndex=y?1:0:ea.expandIconColumnIndex>0&&y&&(ea.expandIconColumnIndex-=1),"number"!=typeof ea.indentSize&&(ea.indentSize="number"==typeof A?A:15);let eA=a.useCallback(e=>eC(eN(ek(eg(e)))),[eg,ek,eN]);if(!1!==v&&(null==ej?void 0:ej.total)){let e;e=ej.size?ej.size:"small"===X||"middle"===X?"small":void 0;let t=t=>a.createElement(nd,Object.assign({},ej,{className:_()("".concat(Q,"-pagination ").concat(Q,"-pagination-").concat(t),ej.className),size:e})),n="rtl"===W?"left":"right",{position:r}=ej;if(null!==r&&Array.isArray(r)){let e=r.find(e=>e.includes("top")),a=r.find(e=>e.includes("bottom")),l=r.every(e=>"none"==="".concat(e));e||a||l||(i=t(n)),e&&(o=t(e.toLowerCase().replace("top",""))),a&&(i=t(a.toLowerCase().replace("bottom","")))}else i=t(n)}"boolean"==typeof C?s={spinning:C}:"object"==typeof C&&(s=Object.assign({spinning:!0},C));let eM=_()(eo,et,"".concat(Q,"-wrapper"),null==U?void 0:U.className,{["".concat(Q,"-wrapper-rtl")]:"rtl"===W},u,d,er),eI=Object.assign(Object.assign({},null==U?void 0:U.style),f),eR=R&&R.emptyText||(null==K?void 0:K("Table"))||a.createElement(tj.Z,{componentName:"Table"}),eD={},eL=a.useMemo(()=>{let{fontSize:e,lineHeight:t,padding:n,paddingXS:r,paddingSM:o}=ee,a=Math.floor(e*t);switch(X){case"large":return 2*n+a;case"small":return 2*r+a;default:return 2*o+a}},[ee,X]);return L&&(eD.listItemHeight=eL),en(a.createElement("div",{ref:eu,className:eM,style:eI},a.createElement(nf.Z,Object.assign({spinning:!1},s),o,a.createElement(L?rF:rB,Object.assign({},eD,H,{ref:ed,columns:F,direction:W,expandable:ea,prefixCls:Q,className:_()({["".concat(Q,"-middle")]:"middle"===X,["".concat(Q,"-small")]:"small"===X,["".concat(Q,"-bordered")]:h,["".concat(Q,"-empty")]:0===Y.length},eo,et,er),data:eP,rowKey:ef,rowClassName:(e,t,n)=>{let r;return r="function"==typeof x?_()(x(e,t,n)):_()(x),_()({["".concat(Q,"-row-selected")]:eT.has(ef(e,t))},r)},emptyText:eR,internalHooks:l,internalRefs:ec,transformColumns:eA,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(Q,"-container")),r=t;if(n){let e=getComputedStyle(n);r=t-parseInt(e.borderLeftWidth,10)-parseInt(e.borderRightWidth,10)}return r}})),i)))});let r9=a.forwardRef((e,t)=>{let n=a.useRef(0);return n.current+=1,a.createElement(r7,Object.assign({},e,{ref:t,_renderTimes:n.current}))});r9.SELECTION_COLUMN=tv,r9.EXPAND_COLUMN=i,r9.SELECTION_ALL=ty,r9.SELECTION_INVERT=tb,r9.SELECTION_NONE=tx,r9.Column=function(e){return null},r9.ColumnGroup=function(e){return null},r9.Summary=F;var oe=r9},93192:function(e,t,n){"use strict";n.d(t,{default:function(){return ef}});var r=n(2265),o=n(9738),a=n(23639),i=n(1119),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},s=n(55015),c=r.forwardRef(function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:l}))}),u=n(36760),d=n.n(u),f=n(49211),p=n.n(f),h=n(31474),m=n(45287),g=n(27380),v=n(50506),y=n(18694),b=n(28791),x=n(10281),w=n(95814),k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let S={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},E=r.forwardRef((e,t)=>{let{style:n,noStyle:o,disabled:a}=e,i=k(e,["style","noStyle","disabled"]),l={};return o||(l=Object.assign({},S)),a&&(l.pointerEvents="none"),l=Object.assign(Object.assign({},l),n),r.createElement("div",Object.assign({role:"button",tabIndex:0,ref:t},i,{onKeyDown:e=>{let{keyCode:t}=e;t===w.Z.ENTER&&e.preventDefault()},onKeyUp:t=>{let{keyCode:n}=t,{onClick:r}=e;n===w.Z.ENTER&&r&&r()},style:l}))});var O=n(71744),C=n(55274),j=n(89970),_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},P=r.forwardRef(function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:_}))}),N=n(19722),T=n(90464),A=n(76122),M=n(80669),I=n(31373),R=n(352);let D=(e,t,n,r)=>{let{titleMarginBottom:o,fontWeightStrong:a}=r;return{marginBottom:o,color:n,fontWeight:a,fontSize:e,lineHeight:t}},L=e=>{let t={};return[1,2,3,4,5].forEach(n=>{t["\n h".concat(n,"&,\n div&-h").concat(n,",\n div&-h").concat(n," > textarea,\n h").concat(n,"\n ")]=D(e["fontSizeHeading".concat(n)],e["lineHeightHeading".concat(n)],e.colorTextHeading,e)}),t},Z=e=>{let{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},(0,A.N)(e)),{textDecoration:e.linkDecoration,"&:active, &:hover":{textDecoration:e.linkHoverDecoration},["&[disabled], &".concat(t,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},z=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:I.EV[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),B=e=>{let{componentCls:t,paddingSM:n}=e;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),marginTop:e.calc(n).mul(-1).equal(),marginBottom:"calc(1em - ".concat((0,R.bf)(n),")")},["".concat(t,"-edit-content-confirm")]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorTextDescription,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},F=e=>({["".concat(e.componentCls,"-copy-success")]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},["".concat(e.componentCls,"-copy-icon-only")]:{marginInlineStart:0}}),H=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-single-line":{whiteSpace:"nowrap"},"&-ellipsis-single-line":{overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),q=e=>{let{componentCls:t,titleMarginTop:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,["&".concat(t,"-secondary")]:{color:e.colorTextDescription},["&".concat(t,"-success")]:{color:e.colorSuccess},["&".concat(t,"-warning")]:{color:e.colorWarning},["&".concat(t,"-danger")]:{color:e.colorError,"a&:active, a&:focus":{color:e.colorErrorActive},"a&:hover":{color:e.colorErrorHover}},["&".concat(t,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},L(e)),{["\n & + h1".concat(t,",\n & + h2").concat(t,",\n & + h3").concat(t,",\n & + h4").concat(t,",\n & + h5").concat(t,"\n ")]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),z(e)),Z(e)),{["\n ".concat(t,"-expand,\n ").concat(t,"-edit,\n ").concat(t,"-copy\n ")]:Object.assign(Object.assign({},(0,A.N)(e)),{marginInlineStart:e.marginXXS})}),B(e)),F(e)),H()),{"&-rtl":{direction:"rtl"}})}};var W=(0,M.I$)("Typography",e=>[q(e)],()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"})),U=e=>{let{prefixCls:t,"aria-label":n,className:o,style:a,direction:i,maxLength:l,autoSize:s=!0,value:c,onSave:u,onCancel:f,onEnd:p,component:h,enterIcon:m=r.createElement(P,null)}=e,g=r.useRef(null),v=r.useRef(!1),y=r.useRef(),[b,x]=r.useState(c);r.useEffect(()=>{x(c)},[c]),r.useEffect(()=>{if(g.current&&g.current.resizableTextArea){let{textArea:e}=g.current.resizableTextArea;e.focus();let{length:t}=e.value;e.setSelectionRange(t,t)}},[]);let k=()=>{u(b.trim())},S=h?"".concat(t,"-").concat(h):"",[E,O,C]=W(t),j=d()(t,"".concat(t,"-edit-content"),{["".concat(t,"-rtl")]:"rtl"===i},o,S,O,C);return E(r.createElement("div",{className:j,style:a},r.createElement(T.Z,{ref:g,maxLength:l,value:b,onChange:e=>{let{target:t}=e;x(t.value.replace(/[\n\r]/g,""))},onKeyDown:e=>{let{keyCode:t}=e;v.current||(y.current=t)},onKeyUp:e=>{let{keyCode:t,ctrlKey:n,altKey:r,metaKey:o,shiftKey:a}=e;y.current!==t||v.current||n||r||o||a||(t===w.Z.ENTER?(k(),null==p||p()):t===w.Z.ESC&&f())},onCompositionStart:()=>{v.current=!0},onCompositionEnd:()=>{v.current=!1},onBlur:()=>{k()},"aria-label":n,rows:1,autoSize:s}),null!==m?(0,N.Tm)(m,{className:"".concat(t,"-edit-content-confirm")}):null))};function K(e,t){return r.useMemo(()=>{let n=!!e;return[n,Object.assign(Object.assign({},t),n&&"object"==typeof e?e:null)]},[e])}var $=(e,t)=>{let n=r.useRef(!1);r.useEffect(()=>{n.current?e():n.current=!0},t)},V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let X=r.forwardRef((e,t)=>{let{prefixCls:n,component:o="article",className:a,rootClassName:i,setContentRef:l,children:s,direction:c,style:u}=e,f=V(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:p,direction:h,typography:m}=r.useContext(O.E_),g=t;l&&(g=(0,b.sQ)(t,l));let v=p("typography",n),[y,x,w]=W(v),k=d()(v,null==m?void 0:m.className,{["".concat(v,"-rtl")]:"rtl"===(null!=c?c:h)},a,i,x,w),S=Object.assign(Object.assign({},null==m?void 0:m.style),u);return y(r.createElement(o,Object.assign({className:k,style:S,ref:g},f),s))});function G(e){let t=typeof e;return"string"===t||"number"===t}function Y(e,t){let n=0,r=[];for(let o=0;o<e.length;o+=1){if(n===t)return r;let a=e[o],i=n+(G(a)?String(a).length:1);if(i>t){let e=t-n;return r.push(String(a).slice(0,e)),r}r.push(a),n=i}return e}var Q=e=>{let{enabledMeasure:t,children:n,text:o,width:a,fontSize:i,rows:l,onEllipsis:s}=e,[[c,u,d],f]=r.useState([0,0,0]),[p,h]=r.useState(0),[v,y]=r.useState(0),[b,x]=r.useState(0),w=r.useRef(null),k=r.useRef(null),S=r.useMemo(()=>(0,m.Z)(o),[o]),E=r.useMemo(()=>{let e;return e=0,S.forEach(t=>{G(t)?e+=String(t).length:e+=1}),e},[S]),O=r.useMemo(()=>t&&3===v?n(Y(S,u),u<E):p&&4!==v&&t?n(Y(S,p),p<E):n(S,!1),[t,v,n,S,u,E]);(0,g.Z)(()=>{t&&a&&i&&E&&(y(1),f([0,Math.ceil(E/2),E]))},[t,a,i,o,E,l]),(0,g.Z)(()=>{var e;1===v&&x((null===(e=w.current)||void 0===e?void 0:e.offsetHeight)||0)},[v]),(0,g.Z)(()=>{var e,t;if(b){if(1===v)((null===(e=k.current)||void 0===e?void 0:e.offsetHeight)||0)<=l*b?(y(4),s(!1)):y(2);else if(2===v){if(c!==d){let e=(null===(t=k.current)||void 0===t?void 0:t.offsetHeight)||0,n=l*b,r=c,o=d;c===d-1?o=c:e<=n?r=u:o=u;let a=Math.ceil((r+o)/2);f([r,a,o])}else y(3),h(u),s(!0)}}},[v,c,d,l,b]);let C=(e,t,n)=>r.createElement("span",{"aria-hidden":!0,ref:t,style:Object.assign({position:"fixed",display:"block",left:0,top:0,zIndex:-9999,visibility:"hidden",pointerEvents:"none",fontSize:2*Math.ceil(i/2)},n)},e);return r.createElement(r.Fragment,null,O,t&&3!==v&&4!==v&&r.createElement(r.Fragment,null,C("lg",w,{wordBreak:"keep-all",whiteSpace:"nowrap"}),C(1===v?n(S,!1):n(Y(S,u),!0),k,{width:a,whiteSpace:"normal",margin:0,padding:0})))},J=e=>{let{enabledEllipsis:t,isEllipsis:n,children:o,tooltipProps:a}=e;return(null==a?void 0:a.title)&&t?r.createElement(j.Z,Object.assign({open:!!n&&void 0},a),o):o},ee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function et(e,t,n){return!0===e||void 0===e?t:e||n&&t}function en(e){return!1===e?[!1,!1]:Array.isArray(e)?e:[e]}let er=r.forwardRef((e,t)=>{var n,i,l;let{prefixCls:s,className:u,style:f,type:w,disabled:k,children:S,ellipsis:_,editable:P,copyable:N,component:T,title:A}=e,M=ee(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:I,direction:R}=r.useContext(O.E_),[D]=(0,C.Z)("Text"),L=r.useRef(null),Z=r.useRef(null),z=I("typography",s),B=(0,y.Z)(M,["mark","code","delete","underline","strong","keyboard","italic"]),[F,H]=K(P),[q,W]=(0,v.Z)(!1,{value:H.editing}),{triggerType:V=["icon"]}=H,G=e=>{var t;e&&(null===(t=H.onStart)||void 0===t||t.call(H)),W(e)};$(()=>{var e;q||null===(e=Z.current)||void 0===e||e.focus()},[q]);let Y=e=>{null==e||e.preventDefault(),G(!0)},[er,eo]=K(N),[ea,ei]=r.useState(!1),el=r.useRef(null),es={};eo.format&&(es.format=eo.format);let ec=()=>{el.current&&clearTimeout(el.current)},eu=e=>{var t;null==e||e.preventDefault(),null==e||e.stopPropagation(),p()(eo.text||String(S)||"",es),ei(!0),ec(),el.current=setTimeout(()=>{ei(!1)},3e3),null===(t=eo.onCopy)||void 0===t||t.call(eo,e)};r.useEffect(()=>ec,[]);let[ed,ef]=r.useState(!1),[ep,eh]=r.useState(!1),[em,eg]=r.useState(!1),[ev,ey]=r.useState(!1),[eb,ex]=r.useState(!1),[ew,ek]=r.useState(!0),[eS,eE]=K(_,{expandable:!1}),eO=eS&&!em,{rows:eC=1}=eE,ej=r.useMemo(()=>!eO||void 0!==eE.suffix||eE.onEllipsis||eE.expandable||F||er,[eO,eE,F,er]);(0,g.Z)(()=>{eS&&!ej&&(ef((0,x.G)("webkitLineClamp")),eh((0,x.G)("textOverflow")))},[ej,eS]);let e_=r.useMemo(()=>!ej&&(1===eC?ep:ed),[ej,ep,ed]),eP=eO&&(e_?eb:ev),eN=eO&&1===eC&&e_,eT=eO&&eC>1&&e_,eA=e=>{var t;eg(!0),null===(t=eE.onExpand)||void 0===t||t.call(eE,e)},[eM,eI]=r.useState(0),[eR,eD]=r.useState(0),eL=e=>{var t;ey(e),ev!==e&&(null===(t=eE.onEllipsis)||void 0===t||t.call(eE,e))};r.useEffect(()=>{let e=L.current;if(eS&&e_&&e){let t=eT?e.offsetHeight<e.scrollHeight:e.offsetWidth<e.scrollWidth;eb!==t&&ex(t)}},[eS,e_,S,eT,ew,eM]),r.useEffect(()=>{let e=L.current;if("undefined"==typeof IntersectionObserver||!e||!e_||!eO)return;let t=new IntersectionObserver(()=>{ek(!!e.offsetParent)});return t.observe(e),()=>{t.disconnect()}},[e_,eO]);let eZ={};eZ=!0===eE.tooltip?{title:null!==(n=H.text)&&void 0!==n?n:S}:r.isValidElement(eE.tooltip)?{title:eE.tooltip}:"object"==typeof eE.tooltip?Object.assign({title:null!==(i=H.text)&&void 0!==i?i:S},eE.tooltip):{title:eE.tooltip};let ez=r.useMemo(()=>{let e=e=>["string","number"].includes(typeof e);return!eS||e_?void 0:e(H.text)?H.text:e(S)?S:e(A)?A:e(eZ.title)?eZ.title:void 0},[eS,e_,A,eZ.title,eP]);if(q)return r.createElement(U,{value:null!==(l=H.text)&&void 0!==l?l:"string"==typeof S?S:"",onSave:e=>{var t;null===(t=H.onChange)||void 0===t||t.call(H,e),G(!1)},onCancel:()=>{var e;null===(e=H.onCancel)||void 0===e||e.call(H),G(!1)},onEnd:H.onEnd,prefixCls:z,className:u,style:f,direction:R,component:T,maxLength:H.maxLength,autoSize:H.autoSize,enterIcon:H.enterIcon});let eB=()=>{let e;let{expandable:t,symbol:n}=eE;return t?(e=n||(null==D?void 0:D.expand),r.createElement("a",{key:"expand",className:"".concat(z,"-expand"),onClick:eA,"aria-label":null==D?void 0:D.expand},e)):null},eF=()=>{if(!F)return;let{icon:e,tooltip:t}=H,n=(0,m.Z)(t)[0]||(null==D?void 0:D.edit),o="string"==typeof n?n:"";return V.includes("icon")?r.createElement(j.Z,{key:"edit",title:!1===t?"":n},r.createElement(E,{ref:Z,className:"".concat(z,"-edit"),onClick:Y,"aria-label":o},e||r.createElement(c,{role:"button"}))):null},eH=()=>{if(!er)return null;let{tooltips:e,icon:t}=eo,n=en(e),i=en(t),l=ea?et(n[1],null==D?void 0:D.copied):et(n[0],null==D?void 0:D.copy),s=ea?null==D?void 0:D.copied:null==D?void 0:D.copy,c="string"==typeof l?l:s;return r.createElement(j.Z,{key:"copy",title:l},r.createElement(E,{className:d()("".concat(z,"-copy"),{["".concat(z,"-copy-success")]:ea,["".concat(z,"-copy-icon-only")]:null==S}),onClick:eu,"aria-label":c},ea?et(i[1],r.createElement(o.Z,null),!0):et(i[0],r.createElement(a.Z,null),!0)))},eq=e=>[e&&eB(),eF(),eH()],eW=e=>[e&&r.createElement("span",{"aria-hidden":!0,key:"ellipsis"},"..."),eE.suffix,eq(e)];return r.createElement(h.Z,{onResize:(e,t)=>{var n;let{offsetWidth:r}=e;eI(r),eD(parseInt(null===(n=window.getComputedStyle)||void 0===n?void 0:n.call(window,t).fontSize,10)||0)},disabled:!eO},n=>r.createElement(J,{tooltipProps:eZ,enabledEllipsis:eO,isEllipsis:eP},r.createElement(X,Object.assign({className:d()({["".concat(z,"-").concat(w)]:w,["".concat(z,"-disabled")]:k,["".concat(z,"-ellipsis")]:eS,["".concat(z,"-single-line")]:eO&&1===eC,["".concat(z,"-ellipsis-single-line")]:eN,["".concat(z,"-ellipsis-multiple-line")]:eT},u),prefixCls:s,style:Object.assign(Object.assign({},f),{WebkitLineClamp:eT?eC:void 0}),component:T,ref:(0,b.sQ)(n,L,t),direction:R,onClick:V.includes("text")?Y:void 0,"aria-label":null==ez?void 0:ez.toString(),title:A},B),r.createElement(Q,{enabledMeasure:eO&&!e_,text:S,rows:eC,width:eM,fontSize:eR,onEllipsis:eL},(t,n)=>{let o=t;return t.length&&n&&ez&&(o=r.createElement("span",{key:"show-content","aria-hidden":!0},o)),function(e,t){let{mark:n,code:o,underline:a,delete:i,strong:l,keyboard:s,italic:c}=e,u=t;function d(e,t){t&&(u=r.createElement(e,{},u))}return d("strong",l),d("u",a),d("del",i),d("code",o),d("mark",n),d("kbd",s),d("i",c),u}(e,r.createElement(r.Fragment,null,o,eW(n)))}))))});var eo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let ea=r.forwardRef((e,t)=>{var{ellipsis:n,rel:o}=e,a=eo(e,["ellipsis","rel"]);let i=Object.assign(Object.assign({},a),{rel:void 0===o&&"_blank"===a.target?"noopener noreferrer":o});return delete i.navigate,r.createElement(er,Object.assign({},i,{ref:t,ellipsis:!!n,component:"a"}))}),ei=r.forwardRef((e,t)=>r.createElement(er,Object.assign({ref:t},e,{component:"div"})));var el=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},es=r.forwardRef((e,t)=>{var{ellipsis:n}=e,o=el(e,["ellipsis"]);let a=r.useMemo(()=>n&&"object"==typeof n?(0,y.Z)(n,["expandable","rows"]):n,[n]);return r.createElement(er,Object.assign({ref:t},o,{ellipsis:a,component:"span"}))}),ec=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eu=[1,2,3,4,5],ed=r.forwardRef((e,t)=>{let n;let{level:o=1}=e,a=ec(e,["level"]);return n=eu.includes(o)?"h".concat(o):"h1",r.createElement(er,Object.assign({ref:t},a,{component:n}))});X.Text=es,X.Link=ea,X.Title=ed,X.Paragraph=ei;var ef=X},85010:function(e,t,n){"use strict";n.d(t,{default:function(){return eT}});var r=n(2265),o=n(83145),a=n(54887),i=n(36760),l=n.n(i),s=n(1119),c=n(76405),u=n(25049),d=n(63496),f=n(15354),p=n(15900),h=n(11993),m=n(31686),g=n(6989),v=n(73129),y=n(41154),b=n(54580),x=n(18242),w=n(32559),k=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){var n=r.toLowerCase(),i=t.toLowerCase(),l=[i];return(".jpg"===i||".jpeg"===i)&&(l=[".jpg",".jpeg"]),l.some(function(e){return n.endsWith(e)})}return/\/\*$/.test(t)?a===t.replace(/\/.*$/,""):o===t||!!/^\w+$/.test(t)&&((0,w.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(t,"'.Skip for check.")),!0)})}return!0};function S(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}var E=function(e,t,n){var r=function e(r,o){if(r){if(r.path=o||"",r.isFile)r.file(function(e){n(e)&&(r.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))});else if(r.isDirectory){var a,i,l;a=function(t){t.forEach(function(t){e(t,"".concat(o).concat(r.name,"/"))})},i=r.createReader(),l=[],function e(){i.readEntries(function(t){var n=Array.prototype.slice.apply(t);l=l.concat(n),n.length?e():a(l)})}()}}};e.forEach(function(e){r(e.webkitGetAsEntry())})},O=+new Date,C=0;function j(){return"rc-upload-".concat(O,"-").concat(++C)}var _=["component","prefixCls","className","classNames","disabled","id","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],P=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){(0,c.Z)(this,n);for(var e,r,a=arguments.length,i=Array(a),l=0;l<a;l++)i[l]=arguments[l];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,d.Z)(e),"state",{uid:j()}),(0,h.Z)((0,d.Z)(e),"reqs",{}),(0,h.Z)((0,d.Z)(e),"fileInput",void 0),(0,h.Z)((0,d.Z)(e),"_isMounted",void 0),(0,h.Z)((0,d.Z)(e),"onChange",function(t){var n=e.props,r=n.accept,a=n.directory,i=t.target.files,l=(0,o.Z)(i).filter(function(e){return!a||k(e,r)});e.uploadFiles(l),e.reset()}),(0,h.Z)((0,d.Z)(e),"onClick",function(t){var n=e.fileInput;if(n){var r=t.target,o=e.props.onClick;r&&"BUTTON"===r.tagName&&(n.parentNode.focus(),r.blur()),n.click(),o&&o(t)}}),(0,h.Z)((0,d.Z)(e),"onKeyDown",function(t){"Enter"===t.key&&e.onClick(t)}),(0,h.Z)((0,d.Z)(e),"onFileDrop",function(t){var n=e.props.multiple;if(t.preventDefault(),"dragover"!==t.type){if(e.props.directory)E(Array.prototype.slice.call(t.dataTransfer.items),e.uploadFiles,function(t){return k(t,e.props.accept)});else{var r=(0,o.Z)(t.dataTransfer.files).filter(function(t){return k(t,e.props.accept)});!1===n&&(r=r.slice(0,1)),e.uploadFiles(r)}}}),(0,h.Z)((0,d.Z)(e),"uploadFiles",function(t){var n=(0,o.Z)(t);Promise.all(n.map(function(t){return t.uid=j(),e.processFile(t,n)})).then(function(t){var n=e.props.onBatchStart;null==n||n(t.map(function(e){return{file:e.origin,parsedFile:e.parsedFile}})),t.filter(function(e){return null!==e.parsedFile}).forEach(function(t){e.post(t)})})}),(0,h.Z)((0,d.Z)(e),"processFile",(r=(0,b.Z)((0,v.Z)().mark(function t(n,r){var o,a,i,l,s,c,u,d,f;return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.props.beforeUpload,a=n,!o){t.next=14;break}return t.prev=3,t.next=6,o(n,r);case 6:a=t.sent,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),a=!1;case 12:if(!1!==a){t.next=14;break}return t.abrupt("return",{origin:n,parsedFile:null,action:null,data:null});case 14:if("function"!=typeof(i=e.props.action)){t.next=21;break}return t.next=18,i(n);case 18:l=t.sent,t.next=22;break;case 21:l=i;case 22:if("function"!=typeof(s=e.props.data)){t.next=29;break}return t.next=26,s(n);case 26:c=t.sent,t.next=30;break;case 29:c=s;case 30:return(u=("object"===(0,y.Z)(a)||"string"==typeof a)&&a?a:n)instanceof File?d=u:d=new File([u],n.name,{type:n.type}),(f=d).uid=n.uid,t.abrupt("return",{origin:n,data:c,parsedFile:f,action:l});case 35:case"end":return t.stop()}},t,null,[[3,9]])})),function(e,t){return r.apply(this,arguments)})),(0,h.Z)((0,d.Z)(e),"saveFileInput",function(t){e.fileInput=t}),e}return(0,u.Z)(n,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(e){var t=this,n=e.data,r=e.origin,o=e.action,a=e.parsedFile;if(this._isMounted){var i=this.props,l=i.onStart,s=i.customRequest,c=i.name,u=i.headers,d=i.withCredentials,f=i.method,p=r.uid;l(r),this.reqs[p]=(s||function(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(t){var r=e.data[t];if(Array.isArray(r)){r.forEach(function(e){n.append("".concat(t,"[]"),e)});return}n.append(t,r)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300){var n;return e.onError(((n=Error("cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"))).status=t.status,n.method=e.method,n.url=e.action,n),S(t))}return e.onSuccess(S(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return null!==r["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(e){null!==r[e]&&t.setRequestHeader(e,r[e])}),t.send(n),{abort:function(){t.abort()}}})({action:o,filename:c,data:n,file:a,headers:u,withCredentials:d,method:f||"post",onProgress:function(e){var n=t.props.onProgress;null==n||n(e,a)},onSuccess:function(e,n){var r=t.props.onSuccess;null==r||r(e,a,n),delete t.reqs[p]},onError:function(e,n){var r=t.props.onError;null==r||r(e,n,a),delete t.reqs[p]}})}}},{key:"reset",value:function(){this.setState({uid:j()})}},{key:"abort",value:function(e){var t=this.reqs;if(e){var n=e.uid?e.uid:e;t[n]&&t[n].abort&&t[n].abort(),delete t[n]}else Object.keys(t).forEach(function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]})}},{key:"render",value:function(){var e,t=this.props,n=t.component,o=t.prefixCls,a=t.className,i=t.classNames,c=t.disabled,u=t.id,d=t.style,f=t.styles,p=t.multiple,v=t.accept,y=t.capture,b=t.children,w=t.directory,k=t.openFileDialogOnClick,S=t.onMouseEnter,E=t.onMouseLeave,O=t.hasControlInside,C=(0,g.Z)(t,_),j=l()((e={},(0,h.Z)(e,o,!0),(0,h.Z)(e,"".concat(o,"-disabled"),c),(0,h.Z)(e,a,a),e)),P=c?{}:{onClick:k?this.onClick:function(){},onKeyDown:k?this.onKeyDown:function(){},onMouseEnter:S,onMouseLeave:E,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:O?void 0:"0"};return r.createElement(n,(0,s.Z)({},P,{className:j,role:O?void 0:"button",style:d}),r.createElement("input",(0,s.Z)({},(0,x.Z)(C,{aria:!0,data:!0}),{id:u,disabled:c,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:(0,m.Z)({display:"none"},(void 0===f?{}:f).input),className:(void 0===i?{}:i).input,accept:v},w?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},{multiple:p,onChange:this.onChange},null!=y?{capture:y}:{})),b)}}]),n}(r.Component);function N(){}var T=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;(0,c.Z)(this,n);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),(0,h.Z)((0,d.Z)(e),"uploader",void 0),(0,h.Z)((0,d.Z)(e),"saveUploader",function(t){e.uploader=t}),e}return(0,u.Z)(n,[{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){return r.createElement(P,(0,s.Z)({},this.props,{ref:this.saveUploader}))}}]),n}(r.Component);(0,h.Z)(T,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:N,onError:N,onSuccess:N,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});var A=n(50506),M=n(71744),I=n(86586),R=n(55274),D=n(13823),L=n(12918),Z=n(63074),z=n(80669),B=n(3104),F=n(352),H=e=>{let{componentCls:t,iconCls:n}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-drag")]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:"".concat((0,F.bf)(e.lineWidth)," dashed ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),[t]:{padding:e.padding},["".concat(t,"-btn")]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:"".concat((0,F.bf)(e.lineWidthFocus)," solid ").concat(e.colorPrimaryBorder)}},["".concat(t,"-drag-container")]:{display:"table-cell",verticalAlign:"middle"},["\n &:not(".concat(t,"-disabled):hover,\n &-hover:not(").concat(t,"-disabled)\n ")]:{borderColor:e.colorPrimaryHover},["p".concat(t,"-drag-icon")]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},["p".concat(t,"-text")]:{margin:"0 0 ".concat((0,F.bf)(e.marginXXS)),color:e.colorTextHeading,fontSize:e.fontSizeLG},["p".concat(t,"-hint")]:{color:e.colorTextDescription,fontSize:e.fontSize},["&".concat(t,"-disabled")]:{["p".concat(t,"-drag-icon ").concat(n,",\n p").concat(t,"-text,\n p").concat(t,"-hint\n ")]:{color:e.colorTextDisabled}}}}}},q=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSize:o,lineHeight:a,calc:i}=e,l="".concat(t,"-list-item"),s="".concat(l,"-actions"),c="".concat(l,"-action"),u=e.fontHeightSM;return{["".concat(t,"-wrapper")]:{["".concat(t,"-list")]:Object.assign(Object.assign({},(0,L.dF)()),{lineHeight:e.lineHeight,[l]:{position:"relative",height:i(e.lineHeight).mul(o).equal(),marginTop:e.marginXS,fontSize:o,display:"flex",alignItems:"center",transition:"background-color ".concat(e.motionDurationSlow),"&:hover":{backgroundColor:e.controlItemBgHover},["".concat(l,"-name")]:Object.assign(Object.assign({},L.vS),{padding:"0 ".concat((0,F.bf)(e.paddingXS)),lineHeight:a,flex:"auto",transition:"all ".concat(e.motionDurationSlow)}),[s]:{[c]:{opacity:0},[r]:{color:e.actionsColor,transition:"all ".concat(e.motionDurationSlow)},["\n ".concat(c,":focus-visible,\n &.picture ").concat(c,"\n ")]:{opacity:1},["".concat(c).concat(n,"-btn")]:{height:u,border:0,lineHeight:1}},["".concat(t,"-icon ").concat(r)]:{color:e.colorTextDescription,fontSize:o},["".concat(l,"-progress")]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:i(o).add(e.paddingXS).equal(),fontSize:o,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},["".concat(l,":hover ").concat(c)]:{opacity:1},["".concat(l,"-error")]:{color:e.colorError,["".concat(l,"-name, ").concat(t,"-icon ").concat(r)]:{color:e.colorError},[s]:{["".concat(r,", ").concat(r,":hover")]:{color:e.colorError},[c]:{opacity:1}}},["".concat(t,"-list-item-container")]:{transition:"opacity ".concat(e.motionDurationSlow,", height ").concat(e.motionDurationSlow),"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},W=n(11699);let U=new F.E4("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),K=new F.E4("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var $=e=>{let{componentCls:t}=e,n="".concat(t,"-animate-inline");return[{["".concat(t,"-wrapper")]:{["".concat(n,"-appear, ").concat(n,"-enter, ").concat(n,"-leave")]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},["".concat(n,"-appear, ").concat(n,"-enter")]:{animationName:U},["".concat(n,"-leave")]:{animationName:K}}},{["".concat(t,"-wrapper")]:(0,W.J$)(e)},U,K]},V=n(31373);let X=e=>{let{componentCls:t,iconCls:n,uploadThumbnailSize:r,uploadProgressOffset:o,calc:a}=e,i="".concat(t,"-list"),l="".concat(i,"-item");return{["".concat(t,"-wrapper")]:{["\n ".concat(i).concat(i,"-picture,\n ").concat(i).concat(i,"-picture-card,\n ").concat(i).concat(i,"-picture-circle\n ")]:{[l]:{position:"relative",height:a(r).add(a(e.lineWidth).mul(2)).add(a(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:"".concat((0,F.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},["".concat(l,"-thumbnail")]:Object.assign(Object.assign({},L.vS),{width:r,height:r,lineHeight:(0,F.bf)(a(r).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),["".concat(l,"-progress")]:{bottom:o,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingSM).mul(2).equal()),")"),marginTop:0,paddingInlineStart:a(r).add(e.paddingXS).equal()}},["".concat(l,"-error")]:{borderColor:e.colorError,["".concat(l,"-thumbnail ").concat(n)]:{["svg path[fill='".concat(V.iN[0],"']")]:{fill:e.colorErrorBg},["svg path[fill='".concat(V.iN.primary,"']")]:{fill:e.colorError}}},["".concat(l,"-uploading")]:{borderStyle:"dashed",["".concat(l,"-name")]:{marginBottom:o}}},["".concat(i).concat(i,"-picture-circle ").concat(l)]:{["&, &::before, ".concat(l,"-thumbnail")]:{borderRadius:"50%"}}}}},G=e=>{let{componentCls:t,iconCls:n,fontSizeLG:r,colorTextLightSolid:o,calc:a}=e,i="".concat(t,"-list"),l="".concat(i,"-item"),s=e.uploadPicCardSize;return{["\n ".concat(t,"-wrapper").concat(t,"-picture-card-wrapper,\n ").concat(t,"-wrapper").concat(t,"-picture-circle-wrapper\n ")]:Object.assign(Object.assign({},(0,L.dF)()),{display:"inline-block",width:"100%",["".concat(t).concat(t,"-select")]:{width:s,height:s,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:"".concat((0,F.bf)(e.lineWidth)," dashed ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),["> ".concat(t)]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},["&:not(".concat(t,"-disabled):hover")]:{borderColor:e.colorPrimary}},["".concat(i).concat(i,"-picture-card, ").concat(i).concat(i,"-picture-circle")]:{["".concat(i,"-item-container")]:{display:"inline-block",width:s,height:s,marginBlock:"0 ".concat((0,F.bf)(e.marginXS)),marginInline:"0 ".concat((0,F.bf)(e.marginXS)),verticalAlign:"top"},"&::after":{display:"none"},[l]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),height:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),backgroundColor:e.colorBgMask,opacity:0,transition:"all ".concat(e.motionDurationSlow),content:'" "'}},["".concat(l,":hover")]:{["&::before, ".concat(l,"-actions")]:{opacity:1}},["".concat(l,"-actions")]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:"all ".concat(e.motionDurationSlow),["\n ".concat(n,"-eye,\n ").concat(n,"-download,\n ").concat(n,"-delete\n ")]:{zIndex:10,width:r,margin:"0 ".concat((0,F.bf)(e.marginXXS)),fontSize:r,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},["".concat(l,"-thumbnail, ").concat(l,"-thumbnail img")]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},["".concat(l,"-name")]:{display:"none",textAlign:"center"},["".concat(l,"-file + ").concat(l,"-name")]:{position:"absolute",bottom:e.margin,display:"block",width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")")},["".concat(l,"-uploading")]:{["&".concat(l)]:{backgroundColor:e.colorFillAlter},["&::before, ".concat(n,"-eye, ").concat(n,"-download, ").concat(n,"-delete")]:{display:"none"}},["".concat(l,"-progress")]:{bottom:e.marginXL,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),paddingInlineStart:0}}}),["".concat(t,"-wrapper").concat(t,"-picture-circle-wrapper")]:{["".concat(t).concat(t,"-select")]:{borderRadius:"50%"}}}};var Y=e=>{let{componentCls:t}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"}}};let Q=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,L.Wf)(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},["".concat(t,"-select")]:{display:"inline-block"},["".concat(t,"-disabled")]:{color:n,cursor:"not-allowed"}})}};var J=(0,z.I$)("Upload",e=>{let{fontSizeHeading3:t,fontHeight:n,lineWidth:r,controlHeightLG:o,calc:a}=e,i=(0,B.TS)(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(n).div(2)).add(r).equal(),uploadPicCardSize:a(o).mul(2.55).equal()});return[Q(i),H(i),X(i),G(i),q(i),$(i),Y(i),(0,Z.Z)(i)]},e=>({actionsColor:e.colorTextDescription})),ee={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:e}}]}},name:"file",theme:"twotone"},et=n(55015),en=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:ee}))}),er=n(61935),eo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},ea=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:eo}))}),ei={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:e}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:e}}]}},name:"picture",theme:"twotone"},el=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:ei}))}),es=n(47970),ec=n(51646),eu=n(68710),ed=n(19722),ef=n(73002);function ep(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function eh(e,t){let n=(0,o.Z)(t),r=n.findIndex(t=>{let{uid:n}=t;return n===e.uid});return -1===r?n.push(e):n[r]=e,n}function em(e,t){let n=void 0!==e.uid?"uid":"name";return t.filter(t=>t[n]===e[n])[0]}let eg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},ev=e=>0===e.indexOf("image/"),ey=e=>{if(e.type&&!e.thumbUrl)return ev(e.type);let t=e.thumbUrl||e.url||"",n=eg(t);return!!(/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n))||!/^data:/.test(t)&&!n};function eb(e){return new Promise(t=>{if(!e.type||!ev(e.type)){t("");return}let n=document.createElement("canvas");n.width=200,n.height=200,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(200,"px; height: ").concat(200,"px; z-index: 9999; display: none;"),document.body.appendChild(n);let r=n.getContext("2d"),o=new Image;if(o.onload=()=>{let{width:e,height:a}=o,i=200,l=200,s=0,c=0;e>a?c=-((l=200/e*a)-i)/2:s=-((i=200/a*e)-l)/2,r.drawImage(o,s,c,i,l);let u=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(o.src),t(u)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){let t=new FileReader;t.onload=()=>{t.result&&(o.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){let n=new FileReader;n.onload=()=>{n.result&&t(n.result)},n.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var ex=n(26349),ew=n(73879),ek=n(6520),eS=n(68565),eE=n(89970);let eO=r.forwardRef((e,t)=>{var n,o;let{prefixCls:a,className:i,style:s,locale:c,listType:u,file:d,items:f,progress:p,iconRender:h,actionIconRender:m,itemRender:g,isImgUrl:v,showPreviewIcon:y,showRemoveIcon:b,showDownloadIcon:x,previewIcon:w,removeIcon:k,downloadIcon:S,onPreview:E,onDownload:O,onClose:C}=e,{status:j}=d,[_,P]=r.useState(j);r.useEffect(()=>{"removed"!==j&&P(j)},[j]);let[N,T]=r.useState(!1);r.useEffect(()=>{let e=setTimeout(()=>{T(!0)},300);return()=>{clearTimeout(e)}},[]);let A=h(d),I=r.createElement("div",{className:"".concat(a,"-icon")},A);if("picture"===u||"picture-card"===u||"picture-circle"===u){if("uploading"!==_&&(d.thumbUrl||d.url)){let e=(null==v?void 0:v(d))?r.createElement("img",{src:d.thumbUrl||d.url,alt:d.name,className:"".concat(a,"-list-item-image"),crossOrigin:d.crossOrigin}):A,t=l()("".concat(a,"-list-item-thumbnail"),{["".concat(a,"-list-item-file")]:v&&!v(d)});I=r.createElement("a",{className:t,onClick:e=>E(d,e),href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer"},e)}else{let e=l()("".concat(a,"-list-item-thumbnail"),{["".concat(a,"-list-item-file")]:"uploading"!==_});I=r.createElement("div",{className:e},A)}}let R=l()("".concat(a,"-list-item"),"".concat(a,"-list-item-").concat(_)),D="string"==typeof d.linkProps?JSON.parse(d.linkProps):d.linkProps,L=b?m(("function"==typeof k?k(d):k)||r.createElement(ex.Z,null),()=>C(d),a,c.removeFile,!0):null,Z=x&&"done"===_?m(("function"==typeof S?S(d):S)||r.createElement(ew.Z,null),()=>O(d),a,c.downloadFile):null,z="picture-card"!==u&&"picture-circle"!==u&&r.createElement("span",{key:"download-delete",className:l()("".concat(a,"-list-item-actions"),{picture:"picture"===u})},Z,L),B=l()("".concat(a,"-list-item-name")),F=d.url?[r.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:B,title:d.name},D,{href:d.url,onClick:e=>E(d,e)}),d.name),z]:[r.createElement("span",{key:"view",className:B,onClick:e=>E(d,e),title:d.name},d.name),z],H=y&&(d.url||d.thumbUrl)?r.createElement("a",{href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>E(d,e),title:c.previewFile},"function"==typeof w?w(d):w||r.createElement(ek.Z,null)):null,q=("picture-card"===u||"picture-circle"===u)&&"uploading"!==_&&r.createElement("span",{className:"".concat(a,"-list-item-actions")},H,"done"===_&&Z,L),{getPrefixCls:W}=r.useContext(M.E_),U=W(),K=r.createElement("div",{className:R},I,F,q,N&&r.createElement(es.ZP,{motionName:"".concat(U,"-fade"),visible:"uploading"===_,motionDeadline:2e3},e=>{let{className:t}=e,n="percent"in d?r.createElement(eS.Z,Object.assign({},p,{type:"line",percent:d.percent,"aria-label":d["aria-label"],"aria-labelledby":d["aria-labelledby"]})):null;return r.createElement("div",{className:l()("".concat(a,"-list-item-progress"),t)},n)})),$=d.response&&"string"==typeof d.response?d.response:(null===(n=d.error)||void 0===n?void 0:n.statusText)||(null===(o=d.error)||void 0===o?void 0:o.message)||c.uploadError,V="error"===_?r.createElement(eE.Z,{title:$,getPopupContainer:e=>e.parentNode},K):K;return r.createElement("div",{className:l()("".concat(a,"-list-item-container"),i),style:s,ref:t},g?g(V,d,f,{download:O.bind(null,d),preview:E.bind(null,d),remove:C.bind(null,d)}):V)}),eC=r.forwardRef((e,t)=>{let{listType:n="text",previewFile:a=eb,onPreview:i,onDownload:s,onRemove:c,locale:u,iconRender:d,isImageUrl:f=ey,prefixCls:p,items:h=[],showPreviewIcon:m=!0,showRemoveIcon:g=!0,showDownloadIcon:v=!1,removeIcon:y,previewIcon:b,downloadIcon:x,progress:w={size:[-1,2],showInfo:!1},appendAction:k,appendActionVisible:S=!0,itemRender:E,disabled:O}=e,C=(0,ec.Z)(),[j,_]=r.useState(!1);r.useEffect(()=>{("picture"===n||"picture-card"===n||"picture-circle"===n)&&(h||[]).forEach(e=>{"undefined"!=typeof document&&"undefined"!=typeof window&&window.FileReader&&window.File&&(e.originFileObj instanceof File||e.originFileObj instanceof Blob)&&void 0===e.thumbUrl&&(e.thumbUrl="",a&&a(e.originFileObj).then(t=>{e.thumbUrl=t||"",C()}))})},[n,h,a]),r.useEffect(()=>{_(!0)},[]);let P=(e,t)=>{if(i)return null==t||t.preventDefault(),i(e)},N=e=>{"function"==typeof s?s(e):e.url&&window.open(e.url)},T=e=>{null==c||c(e)},A=e=>{if(d)return d(e,n);let t="uploading"===e.status,o=f&&f(e)?r.createElement(el,null):r.createElement(en,null),a=t?r.createElement(er.Z,null):r.createElement(ea,null);return"picture"===n?a=t?r.createElement(er.Z,null):o:("picture-card"===n||"picture-circle"===n)&&(a=t?u.uploading:o),a},I=(e,t,n,o,a)=>{let i={type:"text",size:"small",title:o,onClick:n=>{t(),(0,ed.l$)(e)&&e.props.onClick&&e.props.onClick(n)},className:"".concat(n,"-list-item-action")};if(a&&(i.disabled=O),(0,ed.l$)(e)){let t=(0,ed.Tm)(e,Object.assign(Object.assign({},e.props),{onClick:()=>{}}));return r.createElement(ef.ZP,Object.assign({},i,{icon:t}))}return r.createElement(ef.ZP,Object.assign({},i),r.createElement("span",null,e))};r.useImperativeHandle(t,()=>({handlePreview:P,handleDownload:N}));let{getPrefixCls:R}=r.useContext(M.E_),D=R("upload",p),L=R(),Z=l()("".concat(D,"-list"),"".concat(D,"-list-").concat(n)),z=(0,o.Z)(h.map(e=>({key:e.uid,file:e}))),B={motionDeadline:2e3,motionName:"".concat(D,"-").concat("picture-card"===n||"picture-circle"===n?"animate-inline":"animate"),keys:z,motionAppear:j},F=r.useMemo(()=>{let e=Object.assign({},(0,eu.Z)(L));return delete e.onAppearEnd,delete e.onEnterEnd,delete e.onLeaveEnd,e},[L]);return"picture-card"!==n&&"picture-circle"!==n&&(B=Object.assign(Object.assign({},F),B)),r.createElement("div",{className:Z},r.createElement(es.V4,Object.assign({},B,{component:!1}),e=>{let{key:t,file:o,className:a,style:i}=e;return r.createElement(eO,{key:t,locale:u,prefixCls:D,className:a,style:i,file:o,items:h,progress:w,listType:n,isImgUrl:f,showPreviewIcon:m,showRemoveIcon:g,showDownloadIcon:v,removeIcon:y,previewIcon:b,downloadIcon:x,iconRender:A,actionIconRender:I,itemRender:E,onPreview:P,onDownload:N,onClose:T})}),k&&r.createElement(es.ZP,Object.assign({},B,{visible:S,forceRender:!0}),e=>{let{className:t,style:n}=e;return(0,ed.Tm)(k,e=>({className:l()(e.className,t),style:Object.assign(Object.assign(Object.assign({},n),{pointerEvents:t?"none":void 0}),e.style)}))}))}),ej="__LIST_IGNORE_".concat(Date.now(),"__"),e_=r.forwardRef((e,t)=>{let n;let{fileList:i,defaultFileList:s,onRemove:c,showUploadList:u=!0,listType:d="text",onPreview:f,onDownload:p,onChange:h,onDrop:m,previewFile:g,disabled:v,locale:y,iconRender:b,isImageUrl:x,progress:w,prefixCls:k,className:S,type:E="select",children:O,style:C,itemRender:j,maxCount:_,data:P={},multiple:N=!1,hasControlInside:L=!0,action:Z="",accept:z="",supportServerRender:B=!0,rootClassName:F}=e,H=r.useContext(I.Z),q=null!=v?v:H,[W,U]=(0,A.Z)(s||[],{value:i,postState:e=>null!=e?e:[]}),[K,$]=r.useState("drop"),V=r.useRef(null);r.useMemo(()=>{let e=Date.now();(i||[]).forEach((t,n)=>{t.uid||Object.isFrozen(t)||(t.uid="__AUTO__".concat(e,"_").concat(n,"__"))})},[i]);let X=(e,t,n)=>{let r=(0,o.Z)(t),i=!1;1===_?r=r.slice(-1):_&&(i=r.length>_,r=r.slice(0,_)),(0,a.flushSync)(()=>{U(r)});let l={file:e,fileList:r};n&&(l.event=n),(!i||r.some(t=>t.uid===e.uid))&&(0,a.flushSync)(()=>{null==h||h(l)})},G=e=>{let t=e.filter(e=>!e.file[ej]);if(!t.length)return;let n=t.map(e=>ep(e.file)),r=(0,o.Z)(W);n.forEach(e=>{r=eh(e,r)}),n.forEach((e,n)=>{let o=e;if(t[n].parsedFile)e.status="uploading";else{let t;let{originFileObj:n}=e;try{t=new File([n],n.name,{type:n.type})}catch(e){(t=new Blob([n],{type:n.type})).name=n.name,t.lastModifiedDate=new Date,t.lastModified=new Date().getTime()}t.uid=e.uid,o=t}X(o,r)})},Y=(e,t,n)=>{try{"string"==typeof e&&(e=JSON.parse(e))}catch(e){}if(!em(t,W))return;let r=ep(t);r.status="done",r.percent=100,r.response=e,r.xhr=n;let o=eh(r,W);X(r,o)},Q=(e,t)=>{if(!em(t,W))return;let n=ep(t);n.status="uploading",n.percent=e.percent;let r=eh(n,W);X(n,r,e)},ee=(e,t,n)=>{if(!em(n,W))return;let r=ep(n);r.error=e,r.response=t,r.status="error";let o=eh(r,W);X(r,o)},et=e=>{let t;Promise.resolve("function"==typeof c?c(e):c).then(n=>{var r;if(!1===n)return;let o=function(e,t){let n=void 0!==e.uid?"uid":"name",r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}(e,W);o&&(t=Object.assign(Object.assign({},e),{status:"removed"}),null==W||W.forEach(e=>{let n=void 0!==t.uid?"uid":"name";e[n]!==t[n]||Object.isFrozen(e)||(e.status="removed")}),null===(r=V.current)||void 0===r||r.abort(t),X(t,o))})},en=e=>{$(e.type),"drop"===e.type&&(null==m||m(e))};r.useImperativeHandle(t,()=>({onBatchStart:G,onSuccess:Y,onProgress:Q,onError:ee,fileList:W,upload:V.current}));let{getPrefixCls:er,direction:eo,upload:ea}=r.useContext(M.E_),ei=er("upload",k),el=Object.assign(Object.assign({onBatchStart:G,onError:ee,onProgress:Q,onSuccess:Y},e),{data:P,multiple:N,action:Z,accept:z,supportServerRender:B,prefixCls:ei,disabled:q,beforeUpload:(t,n)=>{var r,o,a,i;return r=void 0,o=void 0,a=void 0,i=function*(){let{beforeUpload:r,transformFile:o}=e,a=t;if(r){let e=yield r(t,n);if(!1===e)return!1;if(delete t[ej],e===ej)return Object.defineProperty(t,ej,{value:!0,configurable:!0}),!1;"object"==typeof e&&e&&(a=e)}return o&&(a=yield o(a)),a},new(a||(a=Promise))(function(e,t){function n(e){try{s(i.next(e))}catch(e){t(e)}}function l(e){try{s(i.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof a?r:new a(function(e){e(r)})).then(n,l)}s((i=i.apply(r,o||[])).next())})},onChange:void 0,hasControlInside:L});delete el.className,delete el.style,(!O||q)&&delete el.id;let es="".concat(ei,"-wrapper"),[ec,eu,ed]=J(ei,es),[ef]=(0,R.Z)("Upload",D.Z.Upload),{showRemoveIcon:eg,showPreviewIcon:ev,showDownloadIcon:ey,removeIcon:eb,previewIcon:ex,downloadIcon:ew}="boolean"==typeof u?{}:u,ek=void 0===eg?!q:!!eg,eS=(e,t)=>u?r.createElement(eC,{prefixCls:ei,listType:d,items:W,previewFile:g,onPreview:f,onDownload:p,onRemove:et,showRemoveIcon:ek,showPreviewIcon:ev,showDownloadIcon:ey,removeIcon:eb,previewIcon:ex,downloadIcon:ew,iconRender:b,locale:Object.assign(Object.assign({},ef),y),isImageUrl:x,progress:w,appendAction:e,appendActionVisible:t,itemRender:j,disabled:q}):e,eE=l()(es,S,F,eu,ed,null==ea?void 0:ea.className,{["".concat(ei,"-rtl")]:"rtl"===eo,["".concat(ei,"-picture-card-wrapper")]:"picture-card"===d,["".concat(ei,"-picture-circle-wrapper")]:"picture-circle"===d}),eO=Object.assign(Object.assign({},null==ea?void 0:ea.style),C);if("drag"===E){let e=l()(eu,ei,"".concat(ei,"-drag"),{["".concat(ei,"-drag-uploading")]:W.some(e=>"uploading"===e.status),["".concat(ei,"-drag-hover")]:"dragover"===K,["".concat(ei,"-disabled")]:q,["".concat(ei,"-rtl")]:"rtl"===eo});return ec(r.createElement("span",{className:eE},r.createElement("div",{className:e,style:eO,onDrop:en,onDragOver:en,onDragLeave:en},r.createElement(T,Object.assign({},el,{ref:V,className:"".concat(ei,"-btn")}),r.createElement("div",{className:"".concat(ei,"-drag-container")},O))),eS()))}let e_=l()(ei,"".concat(ei,"-select"),{["".concat(ei,"-disabled")]:q}),eP=(n=O?void 0:{display:"none"},r.createElement("div",{className:e_,style:n},r.createElement(T,Object.assign({},el,{ref:V}))));return ec("picture-card"===d||"picture-circle"===d?r.createElement("span",{className:eE},eS(eP,!!O)):r.createElement("span",{className:eE},eP,eS()))});var eP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eN=r.forwardRef((e,t)=>{var{style:n,height:o,hasControlInside:a=!1}=e,i=eP(e,["style","height","hasControlInside"]);return r.createElement(e_,Object.assign({ref:t,hasControlInside:a},i,{type:"drag",style:Object.assign(Object.assign({},n),{height:o})}))});e_.Dragger=eN,e_.LIST_IGNORE=ej;var eT=e_},49211:function(e,t,n){"use strict";var r=n(99623),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,i,l,s,c,u,d,f=!1;t||(t={}),i=t.debug||!1;try{if(s=r(),c=document.createRange(),u=document.getSelection(),(d=document.createElement("span")).textContent=e,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),void 0===n.clipboardData){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=o[t.format]||o.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),c.selectNodeContents(d),u.addRange(c),!document.execCommand("copy"))throw Error("copy command was unsuccessful");f=!0}catch(r){i&&console.error("unable to copy using execCommand: ",r),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(r){i&&console.error("unable to copy using clipboardData: ",r),i&&console.error("falling back to prompt"),n="message"in t?t.message:"Copy to clipboard: #{key}, Enter",a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",l=n.replace(/#{\s*key\s*}/g,a),window.prompt(l,e)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(c):u.removeAllRanges()),d&&document.body.removeChild(d),s()}return f}},7656:function(e,t,n){"use strict";function r(e,t){if(t.length<e)throw TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}n.d(t,{Z:function(){return r}})},47869:function(e,t,n){"use strict";function r(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n.d(t,{Z:function(){return r}})},7366:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(41154),o=n(25721),a=n(55463),i=n(99735),l=n(7656),s=n(47869);function c(e,t){if((0,l.Z)(2,arguments),!t||"object"!==(0,r.Z)(t))return new Date(NaN);var n=t.years?(0,s.Z)(t.years):0,c=t.months?(0,s.Z)(t.months):0,u=t.weeks?(0,s.Z)(t.weeks):0,d=t.days?(0,s.Z)(t.days):0,f=t.hours?(0,s.Z)(t.hours):0,p=t.minutes?(0,s.Z)(t.minutes):0,h=t.seconds?(0,s.Z)(t.seconds):0,m=(0,i.Z)(e),g=c||n?(0,a.Z)(m,c+12*n):m;return new Date((d||u?(0,o.Z)(g,d+7*u):g).getTime()+1e3*(h+60*(p+60*f)))}},25721:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47869),o=n(99735),a=n(7656);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e),i=(0,r.Z)(t);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}},55463:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47869),o=n(99735),a=n(7656);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e),i=(0,r.Z)(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),s=new Date(n.getTime());return(s.setMonth(n.getMonth()+i+1,0),l>=s.getDate())?s:(n.setFullYear(s.getFullYear(),s.getMonth(),l),n)}},99735:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(41154),o=n(7656);function a(e){(0,o.Z)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,r.Z)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):(("string"==typeof e||"[object String]"===t)&&"undefined"!=typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}},61134:function(e,t,n){var r;!function(o){"use strict";var a,i={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},l=!0,s="[DecimalError] ",c=s+"Invalid argument: ",u=s+"Exponent out of range: ",d=Math.floor,f=Math.pow,p=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=d(1286742750677284.5),m={};function g(e,t){var n,r,o,a,i,s,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),l?C(t,f):t;if(c=e.d,u=t.d,i=e.e,o=t.e,c=c.slice(),a=i-o){for(a<0?(r=c,a=-a,s=u.length):(r=u,o=i,s=c.length),a>(s=(i=Math.ceil(f/7))>s?i+1:s+1)&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for((s=c.length)-(a=u.length)<0&&(a=s,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/1e7|0,c[a]%=1e7;for(n&&(c.unshift(n),++o),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=o,l?C(t,f):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(c+e)}function y(e){var t,n,r,o=e.length-1,a="",i=e[0];if(o>0){for(a+=i,t=1;t<o;t++)(n=7-(r=e[t]+"").length)&&(a+=S(n)),a+=r;(n=7-(r=(i=e[t])+"").length)&&(a+=S(n))}else if(0===i)return"0";for(;i%10==0;)i/=10;return a+i}m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},m.comparedTo=m.cmp=function(e){var t,n,r,o;if(e=new this.constructor(e),this.s!==e.s)return this.s||-e.s;if(this.e!==e.e)return this.e>e.e^this.s<0?1:-1;for(t=0,n=(r=this.d.length)<(o=e.d.length)?r:o;t<n;++t)if(this.d[t]!==e.d[t])return this.d[t]>e.d[t]^this.s<0?1:-1;return r===o?0:r>o^this.s<0?1:-1},m.decimalPlaces=m.dp=function(){var e=this.d.length-1,t=(e-this.e)*7;if(e=this.d[e])for(;e%10==0;e/=10)t--;return t<0?0:t},m.dividedBy=m.div=function(e){return b(this,new this.constructor(e))},m.dividedToIntegerBy=m.idiv=function(e){var t=this.constructor;return C(b(this,new t(e),0,1),t.precision)},m.equals=m.eq=function(e){return!this.cmp(e)},m.exponent=function(){return w(this)},m.greaterThan=m.gt=function(e){return this.cmp(e)>0},m.greaterThanOrEqualTo=m.gte=function(e){return this.cmp(e)>=0},m.isInteger=m.isint=function(){return this.e>this.d.length-2},m.isNegative=m.isneg=function(){return this.s<0},m.isPositive=m.ispos=function(){return this.s>0},m.isZero=function(){return 0===this.s},m.lessThan=m.lt=function(e){return 0>this.cmp(e)},m.lessThanOrEqualTo=m.lte=function(e){return 1>this.cmp(e)},m.logarithm=m.log=function(e){var t,n=this.constructor,r=n.precision,o=r+5;if(void 0===e)e=new n(10);else if((e=new n(e)).s<1||e.eq(a))throw Error(s+"NaN");if(this.s<1)throw Error(s+(this.s?"NaN":"-Infinity"));return this.eq(a)?new n(0):(l=!1,t=b(E(this,o),E(e,o),o),l=!0,C(t,r))},m.minus=m.sub=function(e){return e=new this.constructor(e),this.s==e.s?j(this,e):g(this,(e.s=-e.s,e))},m.modulo=m.mod=function(e){var t,n=this.constructor,r=n.precision;if(!(e=new n(e)).s)throw Error(s+"NaN");return this.s?(l=!1,t=b(this,e,0,1).times(e),l=!0,this.minus(t)):C(new n(this),r)},m.naturalExponential=m.exp=function(){return x(this)},m.naturalLogarithm=m.ln=function(){return E(this)},m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},m.plus=m.add=function(e){return e=new this.constructor(e),this.s==e.s?g(this,e):j(this,(e.s=-e.s,e))},m.precision=m.sd=function(e){var t,n,r;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(c+e);if(t=w(this)+1,n=7*(r=this.d.length-1)+1,r=this.d[r]){for(;r%10==0;r/=10)n--;for(r=this.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},m.squareRoot=m.sqrt=function(){var e,t,n,r,o,a,i,c=this.constructor;if(this.s<1){if(!this.s)return new c(0);throw Error(s+"NaN")}for(e=w(this),l=!1,0==(o=Math.sqrt(+this))||o==1/0?(((t=y(this.d)).length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=d((e+1)/2)-(e<0||e%2),r=new c(t=o==1/0?"5e"+e:(t=o.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new c(o.toString()),o=i=(n=c.precision)+3;;)if(r=(a=r).plus(b(this,a,i+2)).times(.5),y(a.d).slice(0,i)===(t=y(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),o==i&&"4999"==t){if(C(a,n+1,0),a.times(a).eq(this)){r=a;break}}else if("9999"!=t)break;i+=4}return l=!0,C(r,n)},m.times=m.mul=function(e){var t,n,r,o,a,i,s,c,u,d=this.constructor,f=this.d,p=(e=new d(e)).d;if(!this.s||!e.s)return new d(0);for(e.s*=this.s,n=this.e+e.e,(c=f.length)<(u=p.length)&&(a=f,f=p,p=a,i=c,c=u,u=i),a=[],r=i=c+u;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,o=c+r;o>r;)s=a[o]+p[r]*f[o-r-1]+t,a[o--]=s%1e7|0,t=s/1e7|0;a[o]=(a[o]+t)%1e7|0}for(;!a[--i];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,l?C(e,d.precision):e},m.toDecimalPlaces=m.todp=function(e,t){var n=this,r=n.constructor;return(n=new r(n),void 0===e)?n:(v(e,0,1e9),void 0===t?t=r.rounding:v(t,0,8),C(n,e+w(n)+1,t))},m.toExponential=function(e,t){var n,r=this,o=r.constructor;return void 0===e?n=_(r,!0):(v(e,0,1e9),void 0===t?t=o.rounding:v(t,0,8),n=_(r=C(new o(r),e+1,t),!0,e+1)),n},m.toFixed=function(e,t){var n,r,o=this.constructor;return void 0===e?_(this):(v(e,0,1e9),void 0===t?t=o.rounding:v(t,0,8),n=_((r=C(new o(this),e+w(this)+1,t)).abs(),!1,e+w(r)+1),this.isneg()&&!this.isZero()?"-"+n:n)},m.toInteger=m.toint=function(){var e=this.constructor;return C(new e(this),w(this)+1,e.rounding)},m.toNumber=function(){return+this},m.toPower=m.pow=function(e){var t,n,r,o,i,c,u=this,f=u.constructor,p=+(e=new f(e));if(!e.s)return new f(a);if(!(u=new f(u)).s){if(e.s<1)throw Error(s+"Infinity");return u}if(u.eq(a))return u;if(r=f.precision,e.eq(a))return C(u,r);if(c=(t=e.e)>=(n=e.d.length-1),i=u.s,c){if((n=p<0?-p:p)<=9007199254740991){for(o=new f(a),t=Math.ceil(r/7+4),l=!1;n%2&&P((o=o.times(u)).d,t),0!==(n=d(n/2));)P((u=u.times(u)).d,t);return l=!0,e.s<0?new f(a).div(o):C(o,r)}}else if(i<0)throw Error(s+"NaN");return i=i<0&&1&e.d[Math.max(t,n)]?-1:1,u.s=1,l=!1,o=e.times(E(u,r+12)),l=!0,(o=x(o)).s=i,o},m.toPrecision=function(e,t){var n,r,o=this,a=o.constructor;return void 0===e?(n=w(o),r=_(o,n<=a.toExpNeg||n>=a.toExpPos)):(v(e,1,1e9),void 0===t?t=a.rounding:v(t,0,8),n=w(o=C(new a(o),e,t)),r=_(o,e<=n||n<=a.toExpNeg,e)),r},m.toSignificantDigits=m.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(v(e,1,1e9),void 0===t?t=n.rounding:v(t,0,8)),C(new n(this),e,t)},m.toString=m.valueOf=m.val=m.toJSON=function(){var e=w(this),t=this.constructor;return _(this,e<=t.toExpNeg||e>=t.toExpPos)};var b=function(){function e(e,t){var n,r=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+r,e[o]=n%1e7|0,r=n/1e7|0;return r&&e.unshift(r),e}function t(e,t,n,r){var o,a;if(n!=r)a=n>r?1:-1;else for(o=a=0;o<n;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=1e7*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,o,a,i){var l,c,u,d,f,p,h,m,g,v,y,b,x,k,S,E,O,j,_=r.constructor,P=r.s==o.s?1:-1,N=r.d,T=o.d;if(!r.s)return new _(r);if(!o.s)throw Error(s+"Division by zero");for(u=0,c=r.e-o.e,O=T.length,S=N.length,m=(h=new _(P)).d=[];T[u]==(N[u]||0);)++u;if(T[u]>(N[u]||0)&&--c,(b=null==a?a=_.precision:i?a+(w(r)-w(o))+1:a)<0)return new _(0);if(b=b/7+2|0,u=0,1==O)for(d=0,T=T[0],b++;(u<S||d)&&b--;u++)x=1e7*d+(N[u]||0),m[u]=x/T|0,d=x%T|0;else{for((d=1e7/(T[0]+1)|0)>1&&(T=e(T,d),N=e(N,d),O=T.length,S=N.length),k=O,v=(g=N.slice(0,O)).length;v<O;)g[v++]=0;(j=T.slice()).unshift(0),E=T[0],T[1]>=1e7/2&&++E;do d=0,(l=t(T,g,O,v))<0?(y=g[0],O!=v&&(y=1e7*y+(g[1]||0)),(d=y/E|0)>1?(d>=1e7&&(d=1e7-1),p=(f=e(T,d)).length,v=g.length,1==(l=t(f,g,p,v))&&(d--,n(f,O<p?j:T,p))):(0==d&&(l=d=1),f=T.slice()),(p=f.length)<v&&f.unshift(0),n(g,f,v),-1==l&&(v=g.length,(l=t(T,g,O,v))<1&&(d++,n(g,O<v?j:T,v))),v=g.length):0===l&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[v++]=N[k]||0:(g=[N[k]],v=1);while((k++<S||void 0!==g[0])&&b--)}return m[0]||m.shift(),h.e=c,C(h,i?a+w(h)+1:a)}}();function x(e,t){var n,r,o,i,s,c=0,d=0,p=e.constructor,h=p.precision;if(w(e)>16)throw Error(u+w(e));if(!e.s)return new p(a);for(null==t?(l=!1,s=h):s=t,i=new p(.03125);e.abs().gte(.1);)e=e.times(i),d+=5;for(s+=Math.log(f(2,d))/Math.LN10*2+5|0,n=r=o=new p(a),p.precision=s;;){if(r=C(r.times(e),s),n=n.times(++c),y((i=o.plus(b(r,n,s))).d).slice(0,s)===y(o.d).slice(0,s)){for(;d--;)o=C(o.times(o),s);return p.precision=h,null==t?(l=!0,C(o,h)):o}o=i}}function w(e){for(var t=7*e.e,n=e.d[0];n>=10;n/=10)t++;return t}function k(e,t,n){if(t>e.LN10.sd())throw l=!0,n&&(e.precision=n),Error(s+"LN10 precision limit exceeded");return C(new e(e.LN10),t)}function S(e){for(var t="";e--;)t+="0";return t}function E(e,t){var n,r,o,i,c,u,d,f,p,h=1,m=e,g=m.d,v=m.constructor,x=v.precision;if(m.s<1)throw Error(s+(m.s?"NaN":"-Infinity"));if(m.eq(a))return new v(0);if(null==t?(l=!1,f=x):f=t,m.eq(10))return null==t&&(l=!0),k(v,f);if(f+=10,v.precision=f,r=(n=y(g)).charAt(0),!(15e14>Math.abs(i=w(m))))return d=k(v,f+2,x).times(i+""),m=E(new v(r+"."+n.slice(1)),f-10).plus(d),v.precision=x,null==t?(l=!0,C(m,x)):m;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=y((m=m.times(e)).d)).charAt(0),h++;for(i=w(m),r>1?(m=new v("0."+n),i++):m=new v(r+"."+n.slice(1)),u=c=m=b(m.minus(a),m.plus(a),f),p=C(m.times(m),f),o=3;;){if(c=C(c.times(p),f),y((d=u.plus(b(c,new v(o),f))).d).slice(0,f)===y(u.d).slice(0,f))return u=u.times(2),0!==i&&(u=u.plus(k(v,f+2,x).times(i+""))),u=b(u,new v(h),f),v.precision=x,null==t?(l=!0,C(u,x)):u;u=d,o+=2}}function O(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(o=t.length;48===t.charCodeAt(o-1);)--o;if(t=t.slice(r,o)){if(o-=r,n=n-r-1,e.e=d(n/7),e.d=[],r=(n+1)%7,n<0&&(r+=7),r<o){for(r&&e.d.push(+t.slice(0,r)),o-=7;r<o;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=o;for(;r--;)t+="0";if(e.d.push(+t),l&&(e.e>h||e.e<-h))throw Error(u+n)}else e.s=0,e.e=0,e.d=[0];return e}function C(e,t,n){var r,o,a,i,s,c,p,m,g=e.d;for(i=1,a=g[0];a>=10;a/=10)i++;if((r=t-i)<0)r+=7,o=t,p=g[m=0];else{if((m=Math.ceil((r+1)/7))>=(a=g.length))return e;for(i=1,p=a=g[m];a>=10;a/=10)i++;r%=7,o=r-7+i}if(void 0!==n&&(s=p/(a=f(10,i-o-1))%10|0,c=t<0||void 0!==g[m+1]||p%a,c=n<4?(s||c)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||c||6==n&&(r>0?o>0?p/f(10,i-o):0:g[m-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return c?(a=w(e),g.length=1,t=t-a-1,g[0]=f(10,(7-t%7)%7),e.e=d(-t/7)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(0==r?(g.length=m,a=1,m--):(g.length=m+1,a=f(10,7-r),g[m]=o>0?(p/f(10,i-o)%f(10,o)|0)*a:0),c)for(;;){if(0==m){1e7==(g[0]+=a)&&(g[0]=1,++e.e);break}if(g[m]+=a,1e7!=g[m])break;g[m--]=0,a=1}for(r=g.length;0===g[--r];)g.pop();if(l&&(e.e>h||e.e<-h))throw Error(u+w(e));return e}function j(e,t){var n,r,o,a,i,s,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),l?C(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),i=u-r){for((d=i<0)?(n=c,i=-i,s=f.length):(n=f,r=u,s=c.length),i>(o=Math.max(Math.ceil(h/7),s)+2)&&(i=o,n.length=1),n.reverse(),o=i;o--;)n.push(0);n.reverse()}else{for((d=(o=c.length)<(s=f.length))&&(s=o),o=0;o<s;o++)if(c[o]!=f[o]){d=c[o]<f[o];break}i=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),s=c.length,o=f.length-s;o>0;--o)c[s++]=0;for(o=f.length;o>i;){if(c[--o]<f[o]){for(a=o;a&&0===c[--a];)c[a]=1e7-1;--c[a],c[o]+=1e7}c[o]-=f[o]}for(;0===c[--s];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(t.d=c,t.e=r,l?C(t,h):t):new p(0)}function _(e,t,n){var r,o=w(e),a=y(e.d),i=a.length;return t?(n&&(r=n-i)>0?a=a.charAt(0)+"."+a.slice(1)+S(r):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(o<0?"e":"e+")+o):o<0?(a="0."+S(-o-1)+a,n&&(r=n-i)>0&&(a+=S(r))):o>=i?(a+=S(o+1-i),n&&(r=n-o-1)>0&&(a=a+"."+S(r))):((r=o+1)<i&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-i)>0&&(o+1===i&&(a+="."),a+=S(r))),e.s<0?"-"+a:a}function P(e,t){if(e.length>t)return e.length=t,!0}function N(e){if(!e||"object"!=typeof e)throw Error(s+"Object expected");var t,n,r,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<o.length;t+=3)if(void 0!==(r=e[n=o[t]])){if(d(r)===r&&r>=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(c+n+": "+r)}if(void 0!==(r=e[n="LN10"])){if(r==Math.LN10)this[n]=new this(r);else throw Error(c+n+": "+r)}return this}(i=function e(t){var n,r,o;function a(e){if(!(this instanceof a))return new a(e);if(this.constructor=a,e instanceof a){this.s=e.s,this.e=e.e,this.d=(e=e.d)?e.slice():e;return}if("number"==typeof e){if(0*e!=0)throw Error(c+e);if(e>0)this.s=1;else if(e<0)e=-e,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(e===~~e&&e<1e7){this.e=0,this.d=[e];return}return O(this,e.toString())}if("string"!=typeof e)throw Error(c+e);if(45===e.charCodeAt(0)?(e=e.slice(1),this.s=-1):this.s=1,p.test(e))O(this,e);else throw Error(c+e)}if(a.prototype=m,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=e,a.config=a.set=N,void 0===t&&(t={}),t)for(n=0,o=["precision","rounding","toExpNeg","toExpPos","LN10"];n<o.length;)t.hasOwnProperty(r=o[n++])||(t[r]=this[r]);return a.config(t),a}(i)).default=i.Decimal=i,a=new i(1),void 0!==(r=(function(){return i}).call(t,n,t,e))&&(e.exports=r)}(0)},84617:function(e,t,n){"use strict";var r=n(9973);t.__esModule=!0,t.default=function(e,t){e.classList?e.classList.add(t):(0,o.default)(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))};var o=r(n(98598));e.exports=t.default},98598:function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")},e.exports=t.default},67973:function(e){"use strict";function t(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}e.exports=function(e,n){e.classList?e.classList.remove(n):"string"==typeof e.className?e.className=t(e.className,n):e.setAttribute("class",t(e.className&&e.className.baseVal||"",n))}},77625:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,i){if("function"!=typeof r)throw TypeError("The listener must be a function");var l=new o(r,a||e,i),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],l]:e._events[s].push(l):(e._events[s]=l,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),l.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,a=r.length,i=Array(a);o<a;o++)i[o]=r[o].fn;return i},l.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,o,a,i){var l=n?n+e:e;if(!this._events[l])return!1;var s,c,u=this._events[l],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,a),!0;case 6:return u.fn.call(u.context,t,r,o,a,i),!0}for(c=1,s=Array(d-1);c<d;c++)s[c-1]=arguments[c];u.fn.apply(u.context,s)}else{var f,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,o);break;default:if(!s)for(f=1,s=Array(d-1);f<d;f++)s[f-1]=arguments[f];u[c].fn.apply(u[c].context,s)}}return!0},l.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},l.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},l.prototype.removeListener=function(e,t,r,o){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return i(this,a),this;var l=this._events[a];if(l.fn)l.fn!==t||o&&!l.once||r&&l.context!==r||i(this,a);else{for(var s=0,c=[],u=l.length;s<u;s++)(l[s].fn!==t||o&&!l[s].once||r&&l[s].context!==r)&&c.push(l[s]);c.length?this._events[a]=1===c.length?c[0]:c:i(this,a)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l},6500:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},i=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!a)return!1;for(r in e);return void 0===r||t.call(e,r)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(t=arguments[f],null!=t)for(n in t)r=s(d,n),d!==(o=s(t,n))&&(h&&o&&(i(o)||(c=a(o)))?(c?(c=!1,u=r&&a(r)?r:[]):u=r&&i(r)?r:{},l(d,{name:n,newValue:e(h,u,o)})):void 0!==o&&l(d,{name:n,newValue:o}));return d}},80662:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g;function c(e){return e?e.replace(s,""):""}e.exports=function(e,s){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];s=s||{};var u=1,d=1;function f(e){var t=e.match(n);t&&(u+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(r),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=s.source}h.prototype.content=e;var m=[];function g(t){var n=Error(s.source+":"+u+":"+d+": "+t);if(n.reason=t,n.filename=s.source,n.line=u,n.column=d,n.source=e,s.silent)m.push(n);else throw n}function v(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function y(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return d+=2,f(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}return v(r),function(){var e,n=[];for(y(n);e=function(){var e=p(),n=v(o);if(n){if(b(),!v(a))return g("property missing ':'");var r=v(i),s=e({type:"declaration",property:c(n[0].replace(t,"")),value:r?c(r[0].replace(t,"")):""});return v(l),s}}();)!1!==e&&(n.push(e),y(n));return n}()}},94975:function(e,t,n){var r=n(39866)(n(74288),"DataView");e.exports=r},9855:function(e,t,n){var r=n(43596),o=n(35907),a=n(35355),i=n(39870),l=n(73372);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},99078:function(e,t,n){var r=n(62285),o=n(28706),a=n(63717),i=n(78410),l=n(13368);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},88675:function(e,t,n){var r=n(39866)(n(74288),"Map");e.exports=r},76219:function(e,t,n){var r=n(38764),o=n(78615),a=n(83391),i=n(53483),l=n(74724);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},69308:function(e,t,n){var r=n(39866)(n(74288),"Promise");e.exports=r},41497:function(e,t,n){var r=n(39866)(n(74288),"Set");e.exports=r},11549:function(e,t,n){var r=n(76219),o=n(54351),a=n(16096);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},85885:function(e,t,n){var r=n(99078),o=n(84092),a=n(31663),i=n(69135),l=n(39552),s=n(63960);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=l,c.prototype.set=s,e.exports=c},23910:function(e,t,n){var r=n(74288).Symbol;e.exports=r},80098:function(e,t,n){var r=n(74288).Uint8Array;e.exports=r},10880:function(e,t,n){var r=n(39866)(n(74288),"WeakMap");e.exports=r},60493:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},78897:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}},42774:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},26685:function(e,t,n){var r=n(47909);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},56883:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},28579:function(e,t,n){var r=n(89772),o=n(56569),a=n(25614),i=n(98051),l=n(84257),s=n(9792),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),u=!n&&o(e),d=!n&&!u&&i(e),f=!n&&!u&&!d&&s(e),p=n||u||d||f,h=p?r(e.length,String):[],m=h.length;for(var g in e)(t||c.call(e,g))&&!(p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||l(g,m)))&&h.push(g);return h}},73819:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},73817:function(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},25253:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},53417:function(e){e.exports=function(e){return e.split("")}},24457:function(e,t,n){var r=n(37560);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},83023:function(e,t,n){var r=n(4521);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},67676:function(e,t,n){var r=n(98060),o=n(97930)(r);e.exports=o},28935:function(e,t,n){var r=n(67676);e.exports=function(e,t){var n=!0;return r(e,function(e,r,o){return n=!!t(e,r,o)}),n}},67646:function(e,t,n){var r=n(78371);e.exports=function(e,t,n){for(var o=-1,a=e.length;++o<a;){var i=e[o],l=t(i);if(null!=l&&(void 0===s?l==l&&!r(l):n(l,s)))var s=l,c=i}return c}},8235:function(e){e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return -1}},72569:function(e,t,n){var r=n(73817),o=n(37134);e.exports=function e(t,n,a,i,l){var s=-1,c=t.length;for(a||(a=o),l||(l=[]);++s<c;){var u=t[s];n>0&&a(u)?n>1?e(u,n-1,a,i,l):r(l,u):i||(l[l.length]=u)}return l}},63321:function(e,t,n){var r=n(33023)();e.exports=r},98060:function(e,t,n){var r=n(63321),o=n(43228);e.exports=function(e,t){return e&&r(e,t,o)}},92167:function(e,t,n){var r=n(67906),o=n(70235);e.exports=function(e,t){t=r(t,e);for(var n=0,a=t.length;null!=e&&n<a;)e=e[o(t[n++])];return n&&n==a?e:void 0}},36452:function(e,t,n){var r=n(73817),o=n(25614);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},54506:function(e,t,n){var r=n(23910),o=n(4479),a=n(80910),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},58905:function(e){e.exports=function(e,t){return e>t}},93012:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},47909:function(e,t,n){var r=n(8235),o=n(31953),a=n(35281);e.exports=function(e,t,n){return t==t?a(e,t,n):r(e,o,n)}},90370:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},56318:function(e,t,n){var r=n(6791),o=n(10303);e.exports=function e(t,n,a,i,l){return t===n||(null!=t&&null!=n&&(o(t)||o(n))?r(t,n,a,i,e,l):t!=t&&n!=n)}},6791:function(e,t,n){var r=n(85885),o=n(97638),a=n(88030),i=n(64974),l=n(81690),s=n(25614),c=n(98051),u=n(9792),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,m,g,v){var y=s(e),b=s(t),x=y?f:l(e),w=b?f:l(t);x=x==d?p:x,w=w==d?p:w;var k=x==p,S=w==p,E=x==w;if(E&&c(e)){if(!c(t))return!1;y=!0,k=!1}if(E&&!k)return v||(v=new r),y||u(e)?o(e,t,n,m,g,v):a(e,t,x,n,m,g,v);if(!(1&n)){var O=k&&h.call(e,"__wrapped__"),C=S&&h.call(t,"__wrapped__");if(O||C){var j=O?e.value():e,_=C?t.value():t;return v||(v=new r),g(j,_,n,m,v)}}return!!E&&(v||(v=new r),i(e,t,n,m,g,v))}},62538:function(e,t,n){var r=n(85885),o=n(56318);e.exports=function(e,t,n,a){var i=n.length,l=i,s=!a;if(null==e)return!l;for(e=Object(e);i--;){var c=n[i];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<l;){var u=(c=n[i])[0],d=e[u],f=c[1];if(s&&c[2]){if(void 0===d&&!(u in e))return!1}else{var p=new r;if(a)var h=a(d,f,u,e,t,p);if(!(void 0===h?o(f,d,3,a,p):h))return!1}}return!0}},31953:function(e){e.exports=function(e){return e!=e}},57595:function(e,t,n){var r=n(86757),o=n(79551),a=n(28302),i=n(1292),l=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,u=s.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?d:l).test(i(e))}},59332:function(e,t,n){var r=n(54506),o=n(13973),a=n(10303),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},88157:function(e,t,n){var r=n(25569),o=n(51501),a=n(79586),i=n(25614),l=n(22350);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):l(e)}},4578:function(e,t,n){var r=n(35365),o=n(77184),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},20121:function(e){e.exports=function(e,t){return e<t}},24240:function(e,t,n){var r=n(67676),o=n(5629);e.exports=function(e,t){var n=-1,a=o(e)?Array(e.length):[];return r(e,function(e,r,o){a[++n]=t(e,r,o)}),a}},25569:function(e,t,n){var r=n(62538),o=n(58424),a=n(47073);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},51501:function(e,t,n){var r=n(56318),o=n(13735),a=n(17764),i=n(67352),l=n(45669),s=n(47073),c=n(70235);e.exports=function(e,t){return i(e)&&l(t)?s(c(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},84046:function(e,t,n){var r=n(73819),o=n(92167),a=n(88157),i=n(24240),l=n(89200),s=n(23305),c=n(80701),u=n(79586),d=n(25614);e.exports=function(e,t,n){t=t.length?r(t,function(e){return d(e)?function(t){return o(t,1===e.length?e[0]:e)}:e}):[u];var f=-1;return t=r(t,s(a)),l(i(e,function(e,n,o){return{criteria:r(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,n)})}},18155:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},73584:function(e,t,n){var r=n(92167);e.exports=function(e){return function(t){return r(t,e)}}},19608:function(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,o,a){for(var i=-1,l=n(t((r-e)/(o||1)),0),s=Array(l);l--;)s[a?l:++i]=e,e+=o;return s}},44843:function(e,t,n){var r=n(79586),o=n(49478),a=n(98796);e.exports=function(e,t){return a(o(e,t,r),e+"")}},9810:function(e,t,n){var r=n(92353),o=n(4521),a=n(79586),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=i},99558:function(e){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+t];return a}},12327:function(e,t,n){var r=n(67676);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},89200:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},89772:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},65020:function(e,t,n){var r=n(23910),o=n(73819),a=n(25614),i=n(78371),l=1/0,s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-l?"-0":n}},41087:function(e,t,n){var r=n(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},23305:function(e){e.exports=function(e){return function(t){return e(t)}}},13826:function(e,t,n){var r=n(11549),o=n(26685),a=n(56883),i=n(65734),l=n(57600),s=n(27794);e.exports=function(e,t,n){var c=-1,u=o,d=e.length,f=!0,p=[],h=p;if(n)f=!1,u=a;else if(d>=200){var m=t?null:l(e);if(m)return s(m);f=!1,u=i,h=new r}else h=t?[]:p;e:for(;++c<d;){var g=e[c],v=t?t(g):g;if(g=n||0!==g?g:0,f&&v==v){for(var y=h.length;y--;)if(h[y]===v)continue e;t&&h.push(v),p.push(g)}else u(h,v,n)||(h!==p&&h.push(v),p.push(g))}return p}},65734:function(e){e.exports=function(e,t){return e.has(t)}},67906:function(e,t,n){var r=n(25614),o=n(67352),a=n(39365),i=n(3641);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},91684:function(e,t,n){var r=n(99558);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},1536:function(e,t,n){var r=n(78371);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,a=e==e,i=r(e),l=void 0!==t,s=null===t,c=t==t,u=r(t);if(!s&&!u&&!i&&e>t||i&&l&&c&&!s&&!u||o&&l&&c||!n&&c||!a)return 1;if(!o&&!i&&!u&&e<t||u&&n&&a&&!o&&!i||s&&n&&a||!l&&a||!c)return -1}return 0}},80701:function(e,t,n){var r=n(1536);e.exports=function(e,t,n){for(var o=-1,a=e.criteria,i=t.criteria,l=a.length,s=n.length;++o<l;){var c=r(a[o],i[o]);if(c){if(o>=s)return c;return c*("desc"==n[o]?-1:1)}}return e.index-t.index}},92077:function(e,t,n){var r=n(74288)["__core-js_shared__"];e.exports=r},97930:function(e,t,n){var r=n(5629);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,l=Object(n);(t?i--:++i<a)&&!1!==o(l[i],i,l););return n}}},33023:function(e){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),l=i.length;l--;){var s=i[e?l:++o];if(!1===n(a[s],s,a))break}return t}}},80675:function(e,t,n){var r=n(91684),o=n(14503),a=n(88551),i=n(3641);e.exports=function(e){return function(t){var n=o(t=i(t))?a(t):void 0,l=n?n[0]:t.charAt(0),s=n?r(n,1).join(""):t.slice(1);return l[e]()+s}}},82602:function(e,t,n){var r=n(88157),o=n(5629),a=n(43228);e.exports=function(e){return function(t,n,i){var l=Object(t);if(!o(t)){var s=r(n,3);t=a(t),n=function(e){return s(l[e],e,l)}}var c=e(t,n,i);return c>-1?l[s?t[c]:c]:void 0}}},35464:function(e,t,n){var r=n(19608),o=n(49639),a=n(175);e.exports=function(e){return function(t,n,i){return i&&"number"!=typeof i&&o(t,n,i)&&(n=i=void 0),t=a(t),void 0===n?(n=t,t=0):n=a(n),i=void 0===i?t<n?1:-1:a(i),r(t,n,i,e)}}},57600:function(e,t,n){var r=n(41497),o=n(93810),a=n(27794),i=r&&1/a(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=i},4521:function(e,t,n){var r=n(39866),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},97638:function(e,t,n){var r=n(11549),o=n(25253),a=n(65734);e.exports=function(e,t,n,i,l,s){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],y=t[h];if(i)var b=c?i(y,v,h,t,e,s):i(v,y,h,e,t,s);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!o(t,function(e,t){if(!a(g,t)&&(v===e||l(v,e,n,i,s)))return g.push(t)})){m=!1;break}}else if(!(v===y||l(v,y,n,i,s))){m=!1;break}}return s.delete(e),s.delete(t),m}},88030:function(e,t,n){var r=n(23910),o=n(80098),a=n(37560),i=n(97638),l=n(22523),s=n(27794),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new o(e),new o(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=l;case"[object Set]":var h=1&r;if(p||(p=s),e.size!=t.size&&!h)break;var m=f.get(e);if(m)return m==t;r|=2,f.set(e,t);var g=i(p(e),p(t),r,c,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},64974:function(e,t,n){var r=n(28529),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,l){var s=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!s)return!1;for(var d=u;d--;){var f=c[d];if(!(s?f in t:o.call(t,f)))return!1}var p=l.get(e),h=l.get(t);if(p&&h)return p==t&&h==e;var m=!0;l.set(e,t),l.set(t,e);for(var g=s;++d<u;){var v=e[f=c[d]],y=t[f];if(a)var b=s?a(y,v,f,t,e,l):a(v,y,f,e,t,l);if(!(void 0===b?v===y||i(v,y,n,a,l):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(m=!1)}return l.delete(e),l.delete(t),m}},17071:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},28529:function(e,t,n){var r=n(36452),o=n(80466),a=n(43228);e.exports=function(e){return r(e,a,o)}},1507:function(e,t,n){var r=n(7545);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},58424:function(e,t,n){var r=n(45669),o=n(43228);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},39866:function(e,t,n){var r=n(57595),o=n(3138);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},62602:function(e,t,n){var r=n(45070)(Object.getPrototypeOf,Object);e.exports=r},4479:function(e,t,n){var r=n(23910),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[l]=n:delete e[l]),o}},80466:function(e,t,n){var r=n(42774),o=n(55716),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,l=i?function(e){return null==e?[]:r(i(e=Object(e)),function(t){return a.call(e,t)})}:o;e.exports=l},81690:function(e,t,n){var r=n(94975),o=n(88675),a=n(69308),i=n(41497),l=n(10880),s=n(54506),c=n(1292),u="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=c(r),g=c(o),v=c(a),y=c(i),b=c(l),x=s;(r&&x(new r(new ArrayBuffer(1)))!=h||o&&x(new o)!=u||a&&x(a.resolve())!=d||i&&x(new i)!=f||l&&x(new l)!=p)&&(x=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case m:return h;case g:return u;case v:return d;case y:return f;case b:return p}return t}),e.exports=x},3138:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},59592:function(e,t,n){var r=n(67906),o=n(56569),a=n(25614),i=n(84257),l=n(13973),s=n(70235);e.exports=function(e,t,n){t=r(t,e);for(var c=-1,u=t.length,d=!1;++c<u;){var f=s(t[c]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&l(u)&&i(f,u)&&(a(e)||o(e))}},14503:function(e){var t=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},43596:function(e,t,n){var r=n(20453);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},35907:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},35355:function(e,t,n){var r=n(20453),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},39870:function(e,t,n){var r=n(20453),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},73372:function(e,t,n){var r=n(20453);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},37134:function(e,t,n){var r=n(23910),o=n(56569),a=n(25614),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},84257:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},49639:function(e,t,n){var r=n(37560),o=n(5629),a=n(84257),i=n(28302);e.exports=function(e,t,n){if(!i(n))return!1;var l=typeof t;return("number"==l?!!(o(n)&&a(t,n.length)):"string"==l&&t in n)&&r(n[t],e)}},67352:function(e,t,n){var r=n(25614),o=n(78371),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},7545:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},79551:function(e,t,n){var r,o=n(92077),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},35365:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},45669:function(e,t,n){var r=n(28302);e.exports=function(e){return e==e&&!r(e)}},62285:function(e){e.exports=function(){this.__data__=[],this.size=0}},28706:function(e,t,n){var r=n(24457),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},63717:function(e,t,n){var r=n(24457);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},78410:function(e,t,n){var r=n(24457);e.exports=function(e){return r(this.__data__,e)>-1}},13368:function(e,t,n){var r=n(24457);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},38764:function(e,t,n){var r=n(9855),o=n(99078),a=n(88675);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},78615:function(e,t,n){var r=n(1507);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},83391:function(e,t,n){var r=n(1507);e.exports=function(e){return r(this,e).get(e)}},53483:function(e,t,n){var r=n(1507);e.exports=function(e){return r(this,e).has(e)}},74724:function(e,t,n){var r=n(1507);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},22523:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},47073:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},23787:function(e,t,n){var r=n(50967);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},20453:function(e,t,n){var r=n(39866)(Object,"create");e.exports=r},77184:function(e,t,n){var r=n(45070)(Object.keys,Object);e.exports=r},39931:function(e,t,n){e=n.nmd(e);var r=n(17071),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,l=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},45070:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},49478:function(e,t,n){var r=n(60493),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,i=-1,l=o(a.length-t,0),s=Array(l);++i<l;)s[i]=a[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=a[i];return c[t]=n(s),r(e,this,c)}}},74288:function(e,t,n){var r=n(17071),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},54351:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},16096:function(e){e.exports=function(e){return this.__data__.has(e)}},27794:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},98796:function(e,t,n){var r=n(9810),o=n(31610)(r);e.exports=o},31610:function(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),a=16-(o-r);if(r=o,a>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},84092:function(e,t,n){var r=n(99078);e.exports=function(){this.__data__=new r,this.size=0}},31663:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},69135:function(e){e.exports=function(e){return this.__data__.get(e)}},39552:function(e){e.exports=function(e){return this.__data__.has(e)}},63960:function(e,t,n){var r=n(99078),o=n(88675),a=n(76219);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},35281:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return -1}},88551:function(e,t,n){var r=n(53417),o=n(14503),a=n(26364);e.exports=function(e){return o(e)?a(e):r(e)}},39365:function(e,t,n){var r=n(23787),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)}),t});e.exports=i},70235:function(e,t,n){var r=n(78371),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},1292:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5035:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},26364:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",o="[^"+t+"]",a="(?:\ud83c[\udde6-\uddff]){2}",i="[\ud800-\udbff][\udc00-\udfff]",l="(?:"+n+"|"+r+")?",s="[\\ufe0e\\ufe0f]?",c="(?:\\u200d(?:"+[o,a,i].join("|")+")"+s+l+")*",u=RegExp(r+"(?="+r+")|(?:"+[o+n+"?",n,a,i,"["+t+"]"].join("|")+")"+(s+l+c),"g");e.exports=function(e){return e.match(u)||[]}},92353:function(e){e.exports=function(e){return function(){return e}}},7310:function(e,t,n){var r=n(28302),o=n(11121),a=n(6660),i=Math.max,l=Math.min;e.exports=function(e,t,n){var s,c,u,d,f,p,h=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,d=e.apply(r,n)}function b(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,a=o();if(b(a))return w(a);f=setTimeout(x,(e=a-p,n=a-h,r=t-e,g?l(r,u-n):r))}function w(e){return(f=void 0,v&&s)?y(e):(s=c=void 0,d)}function k(){var e,n=o(),r=b(n);if(s=arguments,c=this,p=n,r){if(void 0===f)return h=e=p,f=setTimeout(x,t),m?y(e):d;if(g)return clearTimeout(f),f=setTimeout(x,t),y(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?i(a(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),k.cancel=function(){void 0!==f&&clearTimeout(f),h=0,s=p=c=f=void 0},k.flush=function(){return void 0===f?d:w(o())},k}},37560:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},32242:function(e,t,n){var r=n(78897),o=n(28935),a=n(88157),i=n(25614),l=n(49639);e.exports=function(e,t,n){var s=i(e)?r:o;return n&&l(e,t,n)&&(t=void 0),s(e,a(t,3))}},84173:function(e,t,n){var r=n(82602)(n(12152));e.exports=r},12152:function(e,t,n){var r=n(8235),o=n(88157),a=n(85759),i=Math.max;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return -1;var s=null==n?0:a(n);return s<0&&(s=i(l+s,0)),r(e,o(t,3),s)}},11314:function(e,t,n){var r=n(72569),o=n(89238);e.exports=function(e,t){return r(o(e,t),1)}},13735:function(e,t,n){var r=n(92167);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},17764:function(e,t,n){var r=n(93012),o=n(59592);e.exports=function(e,t){return null!=e&&o(e,t,r)}},79586:function(e){e.exports=function(e){return e}},56569:function(e,t,n){var r=n(90370),o=n(10303),a=Object.prototype,i=a.hasOwnProperty,l=a.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!l.call(e,"callee")};e.exports=s},25614:function(e){var t=Array.isArray;e.exports=t},5629:function(e,t,n){var r=n(86757),o=n(13973);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},24342:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return!0===e||!1===e||o(e)&&"[object Boolean]"==r(e)}},98051:function(e,t,n){e=n.nmd(e);var r=n(74288),o=n(7406),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,l=i&&i.exports===a?r.Buffer:void 0,s=l?l.isBuffer:void 0;e.exports=s||o},21652:function(e,t,n){var r=n(56318);e.exports=function(e,t){return r(e,t)}},86757:function(e,t,n){var r=n(54506),o=n(28302);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},13973:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},82559:function(e,t,n){var r=n(22345);e.exports=function(e){return r(e)&&e!=+e}},77571:function(e){e.exports=function(e){return null==e}},22345:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"number"==typeof e||o(e)&&"[object Number]"==r(e)}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},90231:function(e,t,n){var r=n(54506),o=n(62602),a=n(10303),i=Object.prototype,l=Function.prototype.toString,s=i.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},42715:function(e,t,n){var r=n(54506),o=n(25614),a=n(10303);e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&"[object String]"==r(e)}},78371:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},9792:function(e,t,n){var r=n(59332),o=n(23305),a=n(39931),i=a&&a.isTypedArray,l=i?o(i):r;e.exports=l},43228:function(e,t,n){var r=n(28579),o=n(4578),a=n(5629);e.exports=function(e){return a(e)?r(e):o(e)}},86185:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},89238:function(e,t,n){var r=n(73819),o=n(88157),a=n(24240),i=n(25614);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},41443:function(e,t,n){var r=n(83023),o=n(98060),a=n(88157);e.exports=function(e,t){var n={};return t=a(t,3),o(e,function(e,o,a){r(n,o,t(e,o,a))}),n}},95645:function(e,t,n){var r=n(67646),o=n(58905),a=n(79586);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},35802:function(e,t,n){var r=n(67646),o=n(58905),a=n(88157);e.exports=function(e,t){return e&&e.length?r(e,a(t,2),o):void 0}},50967:function(e,t,n){var r=n(76219);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},99008:function(e,t,n){var r=n(67646),o=n(20121),a=n(79586);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),a=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),a):void 0}},93810:function(e){e.exports=function(){}},11121:function(e,t,n){var r=n(74288);e.exports=function(){return r.Date.now()}},22350:function(e,t,n){var r=n(18155),o=n(73584),a=n(67352),i=n(70235);e.exports=function(e){return a(e)?r(i(e)):o(e)}},99676:function(e,t,n){var r=n(35464)();e.exports=r},33645:function(e,t,n){var r=n(25253),o=n(88157),a=n(12327),i=n(25614),l=n(49639);e.exports=function(e,t,n){var s=i(e)?r:a;return n&&l(e,t,n)&&(t=void 0),s(e,o(t,3))}},34935:function(e,t,n){var r=n(72569),o=n(84046),a=n(44843),i=n(49639),l=a(function(e,t){if(null==e)return[];var n=t.length;return n>1&&i(e,t[0],t[1])?t=[]:n>2&&i(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])});e.exports=l},55716:function(e){e.exports=function(){return[]}},7406:function(e){e.exports=function(){return!1}},37065:function(e,t,n){var r=n(7310),o=n(28302);e.exports=function(e,t,n){var a=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(n)&&(a="leading"in n?!!n.leading:a,i="trailing"in n?!!n.trailing:i),r(e,t,{leading:a,maxWait:t,trailing:i})}},175:function(e,t,n){var r=n(6660),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},85759:function(e,t,n){var r=n(175);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},6660:function(e,t,n){var r=n(41087),o=n(28302),a=n(78371),i=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return i;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):l.test(e)?i:+e}},3641:function(e,t,n){var r=n(65020);e.exports=function(e){return null==e?"":r(e)}},47230:function(e,t,n){var r=n(88157),o=n(13826);e.exports=function(e,t){return e&&e.length?o(e,r(t,2)):[]}},75551:function(e,t,n){var r=n(80675)("toUpperCase");e.exports=r},30401:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},40875:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22135:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},64935:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},96362:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},87769:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},42208:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},29202:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},54001:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},21047:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},96137:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},80221:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},70525:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},76865:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},49663:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},95805:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},11239:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},24601:function(){},15452:function(e,t){var n,r,o;r=[],void 0!==(o="function"==typeof(n=function e(){var t,n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},r=!n.document&&!!n.postMessage,o=n.IS_PAPA_WORKER||!1,a={},i=0,l={};function s(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new p(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<r){let t=this._config.newline;t||(a=this._config.quoteChar||'"',t=this._handle.guessLineEndings(e,a)),e=[...e.split(t).slice(r)].join(t)}this.isFirstChunk&&w(this._config.beforeFirstChunk)&&void 0!==(a=this._config.beforeFirstChunk(e))&&(e=a),this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e,a=(this._partialLine="",this._handle.parse(r,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,this._finished||(this._partialLine=r.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),r=this._finished||this._config.preview&&this._rowCount>=this._config.preview,o)n.postMessage({results:a,workerId:l.WORKER_ID,finished:r});else if(w(this._config.chunk)&&!t){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!r||!w(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),r||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){w(this._config.error)?this._config.error(e):o&&this._config.error&&n.postMessage({workerId:l.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=l.RemoteChunkSize),s.call(this,e),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),r||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var e,n,o=this._config.downloadRequestHeaders;for(n in o)t.setRequestHeader(n,o[n])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}r&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function u(e){(e=e||{}).chunkSize||(e.chunkSize=l.LocalChunkSize),s.call(this,e);var t,n,r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,o=(this._config.chunkSize&&(o=Math.min(this._start+this._config.chunkSize,this._input.size),e=n.call(e,this._start,o)),t.readAsText(e,this._config.encoding));r||this._chunkLoaded({target:{result:o}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function d(e){var t;s.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,n;if(!this._finished)return t=(e=this._config.chunkSize)?(n=t.substring(0,e),t.substring(e)):(n=t,""),this._finished=!t,this.parseChunk(n)}}function f(e){s.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){s.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){s.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=x(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=x(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=x(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=x(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function p(e){var t,n,r,o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,s=this,c=0,u=0,d=!1,f=!1,p=[],g={data:[],errors:[],meta:{}};function v(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function y(){if(g&&r&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!v(e)})),x()){if(g){if(Array.isArray(g.data[0])){for(var t,n=0;x()&&n<g.data.length;n++)g.data[n].forEach(o);g.data.splice(0,1)}else g.data.forEach(o)}function o(t,n){w(e.transformHeader)&&(t=e.transformHeader(t,n)),p.push(t)}}function s(t,n){for(var r=e.header?{}:[],o=0;o<t.length;o++){let n,c;var l=o,s=t[o],s=(n=l=e.header?o>=p.length?"__parsed_extra":p[o]:l,c=s=e.transform?e.transform(s,l):s,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[n]&&(e.dynamicTyping[n]=e.dynamicTypingFunction(n)),!0===(e.dynamicTyping[n]||e.dynamicTyping))?"true"===c||"TRUE"===c||"false"!==c&&"FALSE"!==c&&((e=>{if(a.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(c)?parseFloat(c):i.test(c)?new Date(c):""===c?null:c):c);"__parsed_extra"===l?(r[l]=r[l]||[],r[l].push(s)):r[l]=s}return e.header&&(o>p.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+p.length+" fields but parsed "+o,u+n):o<p.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+p.length+" fields but parsed "+o,u+n)),r}g&&(e.header||e.dynamicTyping||e.transform)&&(t=1,!g.data.length||Array.isArray(g.data[0])?(g.data=g.data.map(s),t=g.data.length):g.data=s(g.data,0),e.header&&g.meta&&(g.meta.fields=p),u+=t)}function x(){return e.header&&0===p.length}function k(e,t,n,r){e={type:e,code:t,message:n},void 0!==r&&(e.row=r),g.errors.push(e)}w(e.step)&&(o=e.step,e.step=function(t){g=t,x()?y():(y(),0!==g.data.length&&(c+=t.data.length,e.preview&&c>e.preview?n.abort():(g.data=g.data[0],o(g,s))))}),this.parse=function(o,a,i){var s=e.quoteChar||'"',s=(e.newline||(e.newline=this.guessLineEndings(o,s)),r=!1,e.delimiter?w(e.delimiter)&&(e.delimiter=e.delimiter(o),g.meta.delimiter=e.delimiter):((s=((t,n,r,o,a)=>{var i,s,c,u;a=a||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var d=0;d<a.length;d++){for(var f,p=a[d],h=0,g=0,y=0,b=(c=void 0,new m({comments:o,delimiter:p,newline:n,preview:10}).parse(t)),x=0;x<b.data.length;x++)r&&v(b.data[x])?y++:(g+=f=b.data[x].length,void 0===c?c=f:0<f&&(h+=Math.abs(f-c),c=f));0<b.data.length&&(g/=b.data.length-y),(void 0===s||h<=s)&&(void 0===u||u<g)&&1.99<g&&(s=h,i=p,u=g)}return{successful:!!(e.delimiter=i),bestDelimiter:i}})(o,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=s.bestDelimiter:(r=!0,e.delimiter=l.DefaultDelimiter),g.meta.delimiter=e.delimiter),b(e));return e.preview&&e.header&&s.preview++,t=o,g=(n=new m(s)).parse(t,a,i),y(),d?{meta:{paused:!0}}:g||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,n.abort(),t=w(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){s.streamer._halted?(d=!1,s.streamer.parseChunk(t,!0)):setTimeout(s.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,n.abort(),g.meta.aborted=!0,w(e.complete)&&e.complete(g),t=""},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=RegExp(h(t)+"([^]*?)"+h(t),"gm"),n=(e=e.replace(t,"")).split("\r"),t=e.split("\n"),e=1<t.length&&t[0].length<n[0].length;if(1===n.length||e)return"\n";for(var r=0,o=0;o<n.length;o++)"\n"===n[o][0]&&r++;return r>=n.length/2?"\r\n":"\r"}}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,n=e.newline,r=e.comments,o=e.step,a=e.preview,i=e.fastMode,s=null,c=!1,u=null==e.quoteChar?'"':e.quoteChar,d=u;if(void 0!==e.escapeChar&&(d=e.escapeChar),("string"!=typeof t||-1<l.BAD_DELIMITERS.indexOf(t))&&(t=","),r===t)throw Error("Comment character same as delimiter");!0===r?r="#":("string"!=typeof r||-1<l.BAD_DELIMITERS.indexOf(r))&&(r=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var f=0,p=!1;this.parse=function(l,m,g){if("string"!=typeof l)throw Error("Input must be a string");var v=l.length,y=t.length,b=n.length,x=r.length,k=w(o),S=[],E=[],O=[],C=f=0;if(!l)return Z();if(i||!1!==i&&-1===l.indexOf(u)){for(var j=l.split(n),_=0;_<j.length;_++){if(O=j[_],f+=O.length,_!==j.length-1)f+=n.length;else if(g)break;if(!r||O.substring(0,x)!==r){if(k){if(S=[],I(O.split(t)),z(),p)return Z()}else I(O.split(t));if(a&&a<=_)return S=S.slice(0,a),Z(!0)}}return Z()}for(var P=l.indexOf(t,f),N=l.indexOf(n,f),T=RegExp(h(d)+h(u),"g"),A=l.indexOf(u,f);;)if(l[f]===u)for(A=f,f++;;){if(-1===(A=l.indexOf(u,A+1)))return g||E.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:S.length,index:f}),D();if(A===v-1)return D(l.substring(f,A).replace(T,u));if(u===d&&l[A+1]===d)A++;else if(u===d||0===A||l[A-1]!==d){-1!==P&&P<A+1&&(P=l.indexOf(t,A+1));var M=R(-1===(N=-1!==N&&N<A+1?l.indexOf(n,A+1):N)?P:Math.min(P,N));if(l.substr(A+1+M,y)===t){O.push(l.substring(f,A).replace(T,u)),l[f=A+1+M+y]!==u&&(A=l.indexOf(u,f)),P=l.indexOf(t,f),N=l.indexOf(n,f);break}if(M=R(N),l.substring(A+1+M,A+1+M+b)===n){if(O.push(l.substring(f,A).replace(T,u)),L(A+1+M+b),P=l.indexOf(t,f),A=l.indexOf(u,f),k&&(z(),p))return Z();if(a&&S.length>=a)return Z(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:S.length,index:f}),A++}}else if(r&&0===O.length&&l.substring(f,f+x)===r){if(-1===N)return Z();f=N+b,N=l.indexOf(n,f),P=l.indexOf(t,f)}else if(-1!==P&&(P<N||-1===N))O.push(l.substring(f,P)),f=P+y,P=l.indexOf(t,f);else{if(-1===N)break;if(O.push(l.substring(f,N)),L(N+b),k&&(z(),p))return Z();if(a&&S.length>=a)return Z(!0)}return D();function I(e){S.push(e),C=f}function R(e){return -1!==e&&(e=l.substring(A+1,e))&&""===e.trim()?e.length:0}function D(e){return g||(void 0===e&&(e=l.substring(f)),O.push(e),f=v,I(O),k&&z()),Z()}function L(e){f=e,I(O),O=[],N=l.indexOf(n,f)}function Z(r){if(e.header&&!m&&S.length&&!c){var o=S[0],a={},i=new Set(o);let t=!1;for(let n=0;n<o.length;n++){let r=o[n];if(a[r=w(e.transformHeader)?e.transformHeader(r,n):r]){let e,l=a[r];for(;e=r+"_"+l,l++,i.has(e););i.add(e),o[n]=e,a[r]++,t=!0,(s=null===s?{}:s)[e]=r}else a[r]=1,o[n]=r;i.add(r)}t&&console.warn("Duplicate headers found and renamed."),c=!0}return{data:S,errors:E,meta:{delimiter:t,linebreak:n,aborted:p,truncated:!!r,cursor:C+(m||0),renamedHeaders:s}}}function z(){o(Z()),S=[],E=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return f}}function g(e){var t=e.data,n=a[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var o={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(w(n.userStep)){for(var i=0;i<t.results.data.length&&(n.userStep({data:t.results.data[i],errors:t.results.errors,meta:t.results.meta},o),!r);i++);delete t.results}else w(n.userChunk)&&(n.userChunk(t.results,o,t.file),delete t.results)}t.finished&&!r&&v(t.workerId,t.results)}function v(e,t){var n=a[e];w(n.userComplete)&&n.userComplete(t),n.terminate(),delete a[e]}function y(){throw Error("Not implemented.")}function b(e){if("object"!=typeof e||null===e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=b(e[t]);return n}function x(e,t){return function(){e.apply(t,arguments)}}function w(e){return"function"==typeof e}return l.parse=function(t,r){var o,s,p,h=(r=r||{}).dynamicTyping||!1;if(w(h)&&(r.dynamicTypingFunction=h,h={}),r.dynamicTyping=h,r.transform=!!w(r.transform)&&r.transform,!r.worker||!l.WORKERS_SUPPORTED){let e;return h=null,l.NODE_STREAM_INPUT,"string"==typeof t?(t=65279!==(e=t).charCodeAt(0)?e:e.slice(1),h=new(r.download?c:d)(r)):!0===t.readable&&w(t.read)&&w(t.on)?h=new f(r):(n.File&&t instanceof File||t instanceof Object)&&(h=new u(r)),h.stream(t)}(h=!!l.WORKERS_SUPPORTED&&(s=n.URL||n.webkitURL||null,p=e.toString(),o=l.BLOB_URL||(l.BLOB_URL=s.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",p,")();"],{type:"text/javascript"}))),(o=new n.Worker(o)).onmessage=g,o.id=i++,a[o.id]=o)).userStep=r.step,h.userChunk=r.chunk,h.userComplete=r.complete,h.userError=r.error,r.step=w(r.step),r.chunk=w(r.chunk),r.complete=w(r.complete),r.error=w(r.error),delete r.worker,h.postMessage({input:t,config:r,workerId:h.id})},l.unparse=function(e,t){var n=!1,r=!0,o=",",a="\r\n",i='"',s=i+i,c=!1,u=null,d=!1,f=((()=>{if("object"==typeof t){if("string"!=typeof t.delimiter||l.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(o=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(a=t.newline),"string"==typeof t.quoteChar&&(i=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(s=t.escapeChar+i),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),RegExp(h(i),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,c);if("object"==typeof e[0])return p(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),p(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function p(e,t,n){var i="",l=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),s=!Array.isArray(t[0]);if(l&&r){for(var c=0;c<e.length;c++)0<c&&(i+=o),i+=m(e[c],c);0<t.length&&(i+=a)}for(var u=0;u<t.length;u++){var d=(l?e:t[u]).length,f=!1,p=l?0===Object.keys(t[u]).length:0===t[u].length;if(n&&!l&&(f="greedy"===n?""===t[u].join("").trim():1===t[u].length&&0===t[u][0].length),"greedy"===n&&l){for(var h=[],g=0;g<d;g++){var v=s?e[g]:g;h.push(t[u][v])}f=""===h.join("").trim()}if(!f){for(var y=0;y<d;y++){0<y&&!p&&(i+=o);var b=l&&s?e[y]:y;i+=m(t[u][b],y)}u<t.length-1&&(!n||0<d&&!p)&&(i+=a)}}return i}function m(e,t){var r,a;return null==e?"":e.constructor===Date?JSON.stringify(e).slice(1,25):(a=!1,d&&"string"==typeof e&&d.test(e)&&(e="'"+e,a=!0),r=e.toString().replace(f,s),(a=a||!0===n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1})(r,l.BAD_DELIMITERS)||-1<r.indexOf(o)||" "===r.charAt(0)||" "===r.charAt(r.length-1))?i+r+i:r)}},l.RECORD_SEP="\x1e",l.UNIT_SEP="\x1f",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r","\n",'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!r&&!!n.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=m,l.ParserHandle=p,l.NetworkStreamer=c,l.FileStreamer=u,l.StringStreamer=d,l.ReadableStreamStreamer=f,n.jQuery&&((t=n.jQuery).fn.parse=function(e){var r=e.config||{},o=[];return this.each(function(e){if(!("INPUT"===t(this).prop("tagName").toUpperCase()&&"file"===t(this).attr("type").toLowerCase()&&n.FileReader)||!this.files||0===this.files.length)return!0;for(var a=0;a<this.files.length;a++)o.push({file:this.files[a],inputElem:this,instanceConfig:t.extend({},r)})}),a(),this;function a(){if(0===o.length)w(e.complete)&&e.complete();else{var n,r,a,s,c=o[0];if(w(e.before)){var u=e.before(c.file,c.inputElem);if("object"==typeof u){if("abort"===u.action)return n="AbortError",r=c.file,a=c.inputElem,s=u.reason,void(w(e.error)&&e.error({name:n},r,a,s));if("skip"===u.action)return void i();"object"==typeof u.config&&(c.instanceConfig=t.extend(c.instanceConfig,u.config))}else if("skip"===u)return void i()}var d=c.instanceConfig.complete;c.instanceConfig.complete=function(e){w(d)&&d(e,c.file,c.inputElem),i()},l.parse(c.file,c.instanceConfig)}}function i(){o.splice(0,1),a()}}),o&&(n.onmessage=function(e){e=e.data,void 0===l.WORKER_ID&&e&&(l.WORKER_ID=e.workerId),"string"==typeof e.input?n.postMessage({workerId:l.WORKER_ID,results:l.parse(e.input,e.config),finished:!0}):(n.File&&e.input instanceof File||e.input instanceof Object)&&(e=l.parse(e.input,e.config))&&n.postMessage({workerId:l.WORKER_ID,results:e,finished:!0})}),(c.prototype=Object.create(s.prototype)).constructor=c,(u.prototype=Object.create(s.prototype)).constructor=u,(d.prototype=Object.create(d.prototype)).constructor=d,(f.prototype=Object.create(s.prototype)).constructor=f,l})?n.apply(t,r):n)&&(e.exports=o)},48049:function(e,t,n){"use strict";var r=n(14397);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},40718:function(e,t,n){e.exports=n(48049)()},14397:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},96032:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6989),o=n(31686),a=n(41154),i=n(2265),l=["show"];function s(e,t){return i.useMemo(function(){var n={};t&&(n.show="object"===(0,a.Z)(t)&&t.formatter?t.formatter:!!t);var i=n=(0,o.Z)((0,o.Z)({},n),e),s=i.show,c=(0,r.Z)(i,l);return(0,o.Z)((0,o.Z)({},c),{},{show:!!s,showFormatter:"function"==typeof s?s:void 0,strategy:c.strategy||function(e){return e.length}})},[e,t])}},2027:function(e,t,n){"use strict";n.d(t,{Q:function(){return d},Z:function(){return b}});var r=n(31686),o=n(1119),a=n(11993),i=n(41154),l=n(36760),s=n.n(l),c=n(2265),u=n(55041),d=function(e){var t=e.inputElement,n=e.children,l=e.prefixCls,d=e.prefix,f=e.suffix,p=e.addonBefore,h=e.addonAfter,m=e.className,g=e.style,v=e.disabled,y=e.readOnly,b=e.focused,x=e.triggerFocus,w=e.allowClear,k=e.value,S=e.handleReset,E=e.hidden,O=e.classes,C=e.classNames,j=e.dataAttrs,_=e.styles,P=e.components,N=null!=n?n:t,T=(null==P?void 0:P.affixWrapper)||"span",A=(null==P?void 0:P.groupWrapper)||"span",M=(null==P?void 0:P.wrapper)||"span",I=(null==P?void 0:P.groupAddon)||"span",R=(0,c.useRef)(null),D=(0,u.X3)(e),L=(0,c.cloneElement)(N,{value:k,className:s()(N.props.className,!D&&(null==C?void 0:C.variant))||null});if(D){var Z=null;if(w){var z,B,F,H,q=!v&&!y&&k,W="".concat(l,"-clear-icon"),U="object"===(0,i.Z)(w)&&null!=w&&w.clearIcon?w.clearIcon:"✖";Z=c.createElement("span",{onClick:S,onMouseDown:function(e){return e.preventDefault()},className:s()(W,(H={},(0,a.Z)(H,"".concat(W,"-hidden"),!q),(0,a.Z)(H,"".concat(W,"-has-suffix"),!!f),H)),role:"button",tabIndex:-1},U)}var K="".concat(l,"-affix-wrapper"),$=s()(K,(F={},(0,a.Z)(F,"".concat(l,"-disabled"),v),(0,a.Z)(F,"".concat(K,"-disabled"),v),(0,a.Z)(F,"".concat(K,"-focused"),b),(0,a.Z)(F,"".concat(K,"-readonly"),y),(0,a.Z)(F,"".concat(K,"-input-with-clear-btn"),f&&w&&k),F),null==O?void 0:O.affixWrapper,null==C?void 0:C.affixWrapper,null==C?void 0:C.variant),V=(f||w)&&c.createElement("span",{className:s()("".concat(l,"-suffix"),null==C?void 0:C.suffix),style:null==_?void 0:_.suffix},Z,f);L=c.createElement(T,(0,o.Z)({className:$,style:null==_?void 0:_.affixWrapper,onClick:function(e){var t;null!==(t=R.current)&&void 0!==t&&t.contains(e.target)&&(null==x||x())}},null==j?void 0:j.affixWrapper,{ref:R}),d&&c.createElement("span",{className:s()("".concat(l,"-prefix"),null==C?void 0:C.prefix),style:null==_?void 0:_.prefix},d),L,V)}if((0,u.He)(e)){var X="".concat(l,"-group"),G="".concat(X,"-addon"),Y="".concat(X,"-wrapper"),Q=s()("".concat(l,"-wrapper"),X,null==O?void 0:O.wrapper,null==C?void 0:C.wrapper),J=s()(Y,(0,a.Z)({},"".concat(Y,"-disabled"),v),null==O?void 0:O.group,null==C?void 0:C.groupWrapper);L=c.createElement(A,{className:J},c.createElement(M,{className:Q},p&&c.createElement(I,{className:G},p),L,h&&c.createElement(I,{className:G},h)))}return c.cloneElement(L,{className:s()(null===(z=L.props)||void 0===z?void 0:z.className,m)||null,style:(0,r.Z)((0,r.Z)({},null===(B=L.props)||void 0===B?void 0:B.style),g),hidden:E})},f=n(83145),p=n(26365),h=n(6989),m=n(50506),g=n(18694),v=n(96032),y=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],b=(0,c.forwardRef)(function(e,t){var n,i=e.autoComplete,l=e.onChange,b=e.onFocus,x=e.onBlur,w=e.onPressEnter,k=e.onKeyDown,S=e.prefixCls,E=void 0===S?"rc-input":S,O=e.disabled,C=e.htmlSize,j=e.className,_=e.maxLength,P=e.suffix,N=e.showCount,T=e.count,A=e.type,M=e.classes,I=e.classNames,R=e.styles,D=e.onCompositionStart,L=e.onCompositionEnd,Z=(0,h.Z)(e,y),z=(0,c.useState)(!1),B=(0,p.Z)(z,2),F=B[0],H=B[1],q=(0,c.useRef)(!1),W=(0,c.useRef)(null),U=function(e){W.current&&(0,u.nH)(W.current,e)},K=(0,m.Z)(e.defaultValue,{value:e.value}),$=(0,p.Z)(K,2),V=$[0],X=$[1],G=null==V?"":String(V),Y=(0,c.useState)(null),Q=(0,p.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,v.Z)(T,N),en=et.max||_,er=et.strategy(G),eo=!!en&&er>en;(0,c.useImperativeHandle)(t,function(){return{focus:U,blur:function(){var e;null===(e=W.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=W.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=W.current)||void 0===e||e.select()},input:W.current}}),(0,c.useEffect)(function(){H(function(e){return(!e||!O)&&e})},[O]);var ea=function(e,t,n){var r,o,a=t;if(!q.current&&et.exceedFormatter&&et.max&&et.strategy(t)>et.max)a=et.exceedFormatter(t,{max:et.max}),t!==a&&ee([(null===(r=W.current)||void 0===r?void 0:r.selectionStart)||0,(null===(o=W.current)||void 0===o?void 0:o.selectionEnd)||0]);else if("compositionEnd"===n.source)return;X(a),W.current&&(0,u.rJ)(W.current,e,l,a)};(0,c.useEffect)(function(){if(J){var e;null===(e=W.current)||void 0===e||e.setSelectionRange.apply(e,(0,f.Z)(J))}},[J]);var ei=eo&&"".concat(E,"-out-of-range");return c.createElement(d,(0,o.Z)({},Z,{prefixCls:E,className:s()(j,ei),handleReset:function(e){X(""),U(),W.current&&(0,u.rJ)(W.current,e,l)},value:G,focused:F,triggerFocus:U,suffix:function(){var e=Number(en)>0;if(P||et.show){var t=et.showFormatter?et.showFormatter({value:G,count:er,maxLength:en}):"".concat(er).concat(e?" / ".concat(en):"");return c.createElement(c.Fragment,null,et.show&&c.createElement("span",{className:s()("".concat(E,"-show-count-suffix"),(0,a.Z)({},"".concat(E,"-show-count-has-suffix"),!!P),null==I?void 0:I.count),style:(0,r.Z)({},null==R?void 0:R.count)},t),P)}return null}(),disabled:O,classes:M,classNames:I,styles:R}),(n=(0,g.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]),c.createElement("input",(0,o.Z)({autoComplete:i},n,{onChange:function(e){ea(e,e.target.value,{source:"change"})},onFocus:function(e){H(!0),null==b||b(e)},onBlur:function(e){H(!1),null==x||x(e)},onKeyDown:function(e){w&&"Enter"===e.key&&w(e),null==k||k(e)},className:s()(E,(0,a.Z)({},"".concat(E,"-disabled"),O),null==I?void 0:I.input),style:null==R?void 0:R.input,ref:W,size:C,type:void 0===A?"text":A,onCompositionStart:function(e){q.current=!0,null==D||D(e)},onCompositionEnd:function(e){q.current=!1,ea(e,e.currentTarget.value,{source:"compositionEnd"}),null==L||L(e)}}))))})},55041:function(e,t,n){"use strict";function r(e){return!!(e.addonBefore||e.addonAfter)}function o(e){return!!(e.prefix||e.suffix||e.allowClear)}function a(e,t,n,r){if(n){var o=t;if("click"===t.type){var a=e.cloneNode(!0);o=Object.create(t,{target:{value:a},currentTarget:{value:a}}),a.value="",n(o);return}if("file"!==e.type&&void 0!==r){var i=e.cloneNode(!0);o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value=r,n(o);return}n(o)}}function i(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}n.d(t,{He:function(){return r},X3:function(){return o},nH:function(){return i},rJ:function(){return a}})},10281:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(94981),o=function(e){if((0,r.Z)()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(e){return e in n.style})}return!1},a=function(e,t){if(!o(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function i(e,t){return Array.isArray(e)||void 0===t?o(e):a(e,t)}},6337:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=l(n(2265)),a=l(n(49211)),i=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(s,e);var t,n,l=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=f(s);return e=t?Reflect.construct(n,arguments,f(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return d(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return p(d(e=l.call.apply(l,[this].concat(n))),"onClick",function(t){var n=e.props,r=n.text,i=n.onCopy,l=n.children,s=n.options,c=o.default.Children.only(l),u=(0,a.default)(r,s);i&&i(r,u),c&&c.props&&"function"==typeof c.props.onClick&&c.props.onClick(t)}),e}return n=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),r=o.default.Children.only(t);return o.default.cloneElement(r,c(c({},n),{},{onClick:this.onClick}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,n),Object.defineProperty(s,"prototype",{writable:!1}),s}(o.default.PureComponent);t.CopyToClipboard=h,p(h,"defaultProps",{onCopy:void 0,options:void 0})},29233:function(e,t,n){"use strict";var r=n(6337).CopyToClipboard;r.CopyToClipboard=r,e.exports=r},13126:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),m=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope"),t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isFragment=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case l:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case m:case h:case s:return e;default:return t}}case o:return t}}}(e)===a}},82558:function(e,t,n){"use strict";e.exports=n(13126)},52181:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState((function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}).bind(this))}function a(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function i(e){var t=e.prototype;if(!t||!t.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,i=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?i="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(i="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==i||null!==l)throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(e.displayName||e.name)+" uses "+("function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==i?"\n "+i:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks");if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=a;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return i}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},59221:function(e,t,n){"use strict";n.d(t,{ZP:function(){return eB},bO:function(){return U}});var r=n(2265),o=n(40718),a=n.n(o),i=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty;function c(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function u(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);var o=r.cache,a=o.get(t),i=o.get(n);if(a&&i)return a===n&&i===t;o.set(t,n),o.set(n,t);var l=e(t,n,r);return o.delete(t),o.delete(n),l}}function d(e){return i(e).concat(l(e))}var f=Object.hasOwn||function(e,t){return s.call(e,t)};function p(e,t){return e||t?e===t:e===t||e!=e&&t!=t}var h="_owner",m=Object.getOwnPropertyDescriptor,g=Object.keys;function v(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function y(e,t){return p(e.getTime(),t.getTime())}function b(e,t,n){if(e.size!==t.size)return!1;for(var r,o,a={},i=e.entries(),l=0;(r=i.next())&&!r.done;){for(var s=t.entries(),c=!1,u=0;(o=s.next())&&!o.done;){var d=r.value,f=d[0],p=d[1],h=o.value,m=h[0],g=h[1];!c&&!a[u]&&(c=n.equals(f,m,l,u,e,t,n)&&n.equals(p,g,f,m,e,t,n))&&(a[u]=!0),u++}if(!c)return!1;l++}return!0}function x(e,t,n){var r,o=g(e),a=o.length;if(g(t).length!==a)return!1;for(;a-- >0;)if((r=o[a])===h&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!f(t,r)||!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function w(e,t,n){var r,o,a,i=d(e),l=i.length;if(d(t).length!==l)return!1;for(;l-- >0;)if((r=i[l])===h&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!f(t,r)||!n.equals(e[r],t[r],r,r,e,t,n)||(o=m(e,r),a=m(t,r),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function k(e,t){return p(e.valueOf(),t.valueOf())}function S(e,t){return e.source===t.source&&e.flags===t.flags}function E(e,t,n){if(e.size!==t.size)return!1;for(var r,o,a={},i=e.values();(r=i.next())&&!r.done;){for(var l=t.values(),s=!1,c=0;(o=l.next())&&!o.done;)!s&&!a[c]&&(s=n.equals(r.value,o.value,r.value,o.value,e,t,n))&&(a[c]=!0),c++;if(!s)return!1}return!0}function O(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var C=Array.isArray,j="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,_=Object.assign,P=Object.prototype.toString.call.bind(Object.prototype.toString),N=T();function T(e){void 0===e&&(e={});var t,n,r,o,a,i,l,s,d,f=e.circular,p=e.createInternalComparator,h=e.createState,m=e.strict,g=(n=(t=function(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,o={areArraysEqual:r?w:v,areDatesEqual:y,areMapsEqual:r?c(b,w):b,areObjectsEqual:r?w:x,arePrimitiveWrappersEqual:k,areRegExpsEqual:S,areSetsEqual:r?c(E,w):E,areTypedArraysEqual:r?w:O};if(n&&(o=_({},o,n(o))),t){var a=u(o.areArraysEqual),i=u(o.areMapsEqual),l=u(o.areObjectsEqual),s=u(o.areSetsEqual);o=_({},o,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:l,areSetsEqual:s})}return o}(e)).areArraysEqual,r=t.areDatesEqual,o=t.areMapsEqual,a=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,l=t.areRegExpsEqual,s=t.areSetsEqual,d=t.areTypedArraysEqual,function(e,t,c){if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return e!=e&&t!=t;var u=e.constructor;if(u!==t.constructor)return!1;if(u===Object)return a(e,t,c);if(C(e))return n(e,t,c);if(null!=j&&j(e))return d(e,t,c);if(u===Date)return r(e,t,c);if(u===RegExp)return l(e,t,c);if(u===Map)return o(e,t,c);if(u===Set)return s(e,t,c);var f=P(e);return"[object Date]"===f?r(e,t,c):"[object RegExp]"===f?l(e,t,c):"[object Map]"===f?o(e,t,c):"[object Set]"===f?s(e,t,c):"[object Object]"===f?"function"!=typeof e.then&&"function"!=typeof t.then&&a(e,t,c):"[object Arguments]"===f?a(e,t,c):("[object Boolean]"===f||"[object Number]"===f||"[object String]"===f)&&i(e,t,c)}),N=p?p(g):function(e,t,n,r,o,a,i){return g(e,t,i)};return function(e){var t=e.circular,n=e.comparator,r=e.createState,o=e.equals,a=e.strict;if(r)return function(e,i){var l=r(),s=l.cache;return n(e,i,{cache:void 0===s?t?new WeakMap:void 0:s,equals:o,meta:l.meta,strict:a})};if(t)return function(e,t){return n(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:a})};var i={cache:void 0,equals:o,meta:void 0,strict:a};return function(e,t){return n(e,t,i)}}({circular:void 0!==f&&f,comparator:g,createState:h,equals:N,strict:void 0!==m&&m})}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;requestAnimationFrame(function r(o){if(n<0&&(n=o),o-n>t)e(o),n=-1;else{var a;a=r,"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(a)}})}function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(e,t,n){var r;return(r=function(e,t){if("object"!==R(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==R(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===R(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}T({strict:!0}),T({circular:!0}),T({circular:!0,strict:!0}),T({createInternalComparator:function(){return p}}),T({strict:!0,createInternalComparator:function(){return p}}),T({circular:!0,createInternalComparator:function(){return p}}),T({circular:!0,createInternalComparator:function(){return p},strict:!0});var z=["Webkit","Moz","O","ms"],B=["-webkit-","-moz-","-o-","-ms-"],F=["transform","transformOrigin","transition"],H=function(e){return e},q=function(e,t){if(-1===F.indexOf(e))return Z({},e,Number.isNaN(t)?0:t);var n="transition"===e,r=e.replace(/(\w)/,function(e){return e.toUpperCase()}),o=t;return z.reduce(function(e,a,i){return n&&(o=t.replace(/(transform|transform-origin)/gim,"".concat(B[i],"$1"))),L(L({},e),{},Z({},a+r,o))},{})},W=function(e,t){return Object.keys(t).reduce(function(n,r){return L(L({},n),{},Z({},r,e(r,t[r])))},{})},U=function(e){return Object.keys(e).reduce(function(e,t){return L(L({},e),q(t,e[t]))},e)},K=function(e,t,n){return e.map(function(e){return"".concat(e.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())})," ").concat(t,"ms ").concat(n)}).join(",")},$=function(e,t,n,r,o,a,i,l){};function V(e,t){if(e){if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var G=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},Y=function(e,t){return e.map(function(e,n){return e*Math.pow(t,n)}).reduce(function(e,t){return e+t})},Q=function(e,t){return function(n){return Y(G(e,t),n)}},J=function(){for(var e,t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=r[0],i=r[1],l=r[2],s=r[3];if(1===r.length)switch(r[0]){case"linear":a=0,i=0,l=1,s=1;break;case"ease":a=.25,i=.1,l=.25,s=1;break;case"ease-in":a=.42,i=0,l=1,s=1;break;case"ease-out":a=.42,i=0,l=.58,s=1;break;case"ease-in-out":a=0,i=0,l=.58,s=1;break;default:var c=r[0].split("(");if("cubic-bezier"===c[0]&&4===c[1].split(")")[0].split(",").length){var u,d=function(e){if(Array.isArray(e))return e}(u=c[1].split(")")[0].split(",").map(function(e){return parseFloat(e)}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),4!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(u,4)||V(u,4)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a=d[0],i=d[1],l=d[2],s=d[3]}else $(!1,"[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s",r)}$([a,l,i,s].every(function(e){return"number"==typeof e&&e>=0&&e<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",r);var f=Q(a,l),p=Q(i,s),h=(e=a,t=l,function(n){var r;return Y([].concat(function(e){if(Array.isArray(e))return X(e)}(r=G(e,t).map(function(e,t){return e*t}).slice(1))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||V(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),n)}),m=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var o,a=f(n)-t,i=h(n);if(1e-4>Math.abs(a-t)||i<1e-4)break;n=(o=n-a/i)>1?1:o<0?0:o}return p(n)};return m.isStepper=!1,m},ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,n=void 0===t?100:t,r=e.damping,o=void 0===r?8:r,a=e.dt,i=void 0===a?17:a,l=function(e,t,r){var a=r+(-(e-t)*n-r*o)*i/1e3,l=r*i/1e3+e;return 1e-4>Math.abs(l-t)&&1e-4>Math.abs(a)?[t,0]:[l,a]};return l.isStepper=!0,l.dt=i,l},et=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0];if("string"==typeof r)switch(r){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return J(r);case"spring":return ee();default:if("cubic-bezier"===r.split("(")[0])return J(r);$(!1,"[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s",t)}return"function"==typeof r?r:($(!1,"[configEasing]: first argument type should be function or string, instead received %s",t),null)};function en(e){return(en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function er(e){return function(e){if(Array.isArray(e))return es(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||el(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach(function(t){ei(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ei(e,t,n){var r;return(r=function(e,t){if("object"!==en(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==en(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===en(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function el(e,t){if(e){if("string"==typeof e)return es(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return es(e,t)}}function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ec=function(e,t,n){return e+(t-e)*n},eu=function(e){return e.from!==e.to},ed=function e(t,n,r){var o=W(function(e,n){if(eu(n)){var r,o=function(e){if(Array.isArray(e))return e}(r=t(n.from,n.to,n.velocity))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(r,2)||el(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o[1];return ea(ea({},n),{},{from:a,velocity:i})}return n},n);return r<1?W(function(e,t){return eu(t)?ea(ea({},t),{},{velocity:ec(t.velocity,o[e].velocity,r),from:ec(t.from,o[e].from,r)}):t},n):e(t,o,r-1)},ef=function(e,t,n,r,o){var a,i,l=[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})}),s=l.reduce(function(n,r){return ea(ea({},n),{},ei({},r,[e[r],t[r]]))},{}),c=l.reduce(function(n,r){return ea(ea({},n),{},ei({},r,{from:e[r],velocity:0,to:t[r]}))},{}),u=-1,d=function(){return null};return d=n.isStepper?function(r){a||(a=r);var i=(r-a)/n.dt;c=ed(n,c,i),o(ea(ea(ea({},e),t),W(function(e,t){return t.from},c))),a=r,Object.values(c).filter(eu).length&&(u=requestAnimationFrame(d))}:function(a){i||(i=a);var l=(a-i)/r,c=W(function(e,t){return ec.apply(void 0,er(t).concat([n(l)]))},s);if(o(ea(ea(ea({},e),t),c)),l<1)u=requestAnimationFrame(d);else{var f=W(function(e,t){return ec.apply(void 0,er(t).concat([n(1)]))},s);o(ea(ea(ea({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(u)}}};function ep(e){return(ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eh=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function em(e){return function(e){if(Array.isArray(e))return eg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return eg(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ev(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ey(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ev(Object(n),!0).forEach(function(t){eb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ev(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eb(e,t,n){return(t=ex(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ex(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ep(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ep(t)?t:String(t)}function ew(e,t){return(ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ek(e,t){if(t&&("object"===ep(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eS(e)}function eS(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eE(e){return(eE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ew(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eE(a);return e=t?Reflect.construct(n,arguments,eE(this).constructor):n.apply(this,arguments),ek(this,e)});function a(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a);var n,r=(n=o.call(this,e,t)).props,i=r.isActive,l=r.attributeName,s=r.from,c=r.to,u=r.steps,d=r.children,f=r.duration;if(n.handleStyleChange=n.handleStyleChange.bind(eS(n)),n.changeStyle=n.changeStyle.bind(eS(n)),!i||f<=0)return n.state={style:{}},"function"==typeof d&&(n.state={style:c}),ek(n);if(u&&u.length)n.state={style:u[0].style};else if(s){if("function"==typeof d)return n.state={style:s},ek(n);n.state={style:l?eb({},l,s):s}}else n.state={style:{}};return n}return n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,o=t.attributeName,a=t.shouldReAnimate,i=t.to,l=t.from,s=this.state.style;if(r){if(!n){var c={style:o?eb({},o,i):i};this.state&&s&&(o&&s[o]!==i||!o&&s!==i)&&this.setState(c);return}if(!N(e.to,i)||!e.canBegin||!e.isActive){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?l:e.to;if(this.state&&s){var f={style:o?eb({},o,d):d};(o&&[o]!==d||!o&&s!==d)&&this.setState(f)}this.runAnimation(ey(ey({},this.props),{},{from:d,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"runJSAnimation",value:function(e){var t=this,n=e.from,r=e.to,o=e.duration,a=e.easing,i=e.begin,l=e.onAnimationEnd,s=e.onAnimationStart,c=ef(n,r,et(a),o,this.changeStyle);this.manager.start([s,i,function(){t.stopJSAnimation=c()},o,l])}},{key:"runStepAnimation",value:function(e){var t=this,n=e.steps,r=e.begin,o=e.onAnimationStart,a=n[0],i=a.style,l=a.duration;return this.manager.start([o].concat(em(n.reduce(function(e,r,o){if(0===o)return e;var a=r.duration,i=r.easing,l=void 0===i?"ease":i,s=r.style,c=r.properties,u=r.onAnimationEnd,d=o>0?n[o-1]:r,f=c||Object.keys(s);if("function"==typeof l||"spring"===l)return[].concat(em(e),[t.runJSAnimation.bind(t,{from:d.style,to:s,duration:a,easing:l}),a]);var p=K(f,a,l),h=ey(ey(ey({},d.style),s),{},{transition:p});return[].concat(em(e),[h,a,u]).filter(H)},[i,Math.max(void 0===l?0:l,r)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){if(!this.manager){var t,n,r;this.manager=(t=function(){return null},n=!1,r=function e(r){if(!n){if(Array.isArray(r)){if(!r.length)return;var o=function(e){if(Array.isArray(e))return e}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return I(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,void 0)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o.slice(1);if("number"==typeof a){A(e.bind(null,i),a);return}e(a),A(e.bind(null,i));return}"object"===M(r)&&t(r),"function"==typeof r&&r()}},{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}})}var o=e.begin,a=e.duration,i=e.attributeName,l=e.to,s=e.easing,c=e.onAnimationStart,u=e.onAnimationEnd,d=e.steps,f=e.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),"function"==typeof s||"function"==typeof f||"spring"===s){this.runJSAnimation(e);return}if(d.length>1){this.runStepAnimation(e);return}var h=i?eb({},i,l):l,m=K(Object.keys(h),a,s);p.start([c,o,ey(ey({},h),{},{transition:m}),a,u])}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration),o=(e.attributeName,e.easing,e.isActive),a=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eh)),i=r.Children.count(t),l=U(this.state.style);if("function"==typeof t)return t(l);if(!o||0===i||n<=0)return t;var s=function(e){var t=e.props,n=t.style,o=t.className;return(0,r.cloneElement)(e,ey(ey({},a),{},{style:ey(ey({},void 0===n?{}:n),l),className:o}))};return 1===i?s(r.Children.only(t)):r.createElement("div",null,r.Children.map(t,function(e){return s(e)}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ex(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);eO.displayName="Animate",eO.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},eO.propTypes={from:a().oneOfType([a().object,a().string]),to:a().oneOfType([a().object,a().string]),attributeName:a().string,duration:a().number,begin:a().number,easing:a().oneOfType([a().string,a().func]),steps:a().arrayOf(a().shape({duration:a().number.isRequired,style:a().object.isRequired,easing:a().oneOfType([a().oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),a().func]),properties:a().arrayOf("string"),onAnimationEnd:a().func})),children:a().oneOfType([a().node,a().func]),isActive:a().bool,canBegin:a().bool,onAnimationEnd:a().func,shouldReAnimate:a().bool,onAnimationStart:a().func,onAnimationReStart:a().func};var eC=n(30719),ej=["children","appearOptions","enterOptions","leaveOptions"];function e_(e){return(e_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eP(){return(eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eN(Object(n),!0).forEach(function(t){eR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eA(e,t){return(eA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eM(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eI(e){return(eI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eR(e,t,n){return(t=eD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eD(e){var t=function(e,t){if("object"!==e_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==e_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===e_(t)?t:String(t)}void 0===Number.isFinite&&(Number.isFinite=function(e){return"number"==typeof e&&isFinite(e)});var eL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.steps,n=e.duration;return t&&t.length?t.reduce(function(e,t){return e+(Number.isFinite(t.duration)&&t.duration>0?t.duration:0)},0):Number.isFinite(n)?n:0},eZ=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eA(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eI(a);return e=t?Reflect.construct(n,arguments,eI(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===e_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eM(e)}(this,e)});function a(){var e;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),eR(eM(e=o.call(this)),"handleEnter",function(t,n){var r=e.props,o=r.appearOptions,a=r.enterOptions;e.handleStyleActive(n?o:a)}),eR(eM(e),"handleExit",function(){var t=e.props.leaveOptions;e.handleStyleActive(t)}),e.state={isActive:!1},e}return n=[{key:"handleStyleActive",value:function(e){if(e){var t=e.onAnimationEnd?function(){e.onAnimationEnd()}:null;this.setState(eT(eT({},e),{},{onAnimationEnd:t,isActive:!0}))}}},{key:"parseTimeout",value:function(){var e=this.props,t=e.appearOptions,n=e.enterOptions,r=e.leaveOptions;return eL(t)+eL(n)+eL(r)}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,o=(t.appearOptions,t.enterOptions,t.leaveOptions,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,ej));return r.createElement(eC.Transition,eP({},o,{onEnter:this.handleEnter,onExit:this.handleExit,timeout:this.parseTimeout()}),function(){return r.createElement(eO,e.state,r.Children.only(n))})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eD(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.Component);function ez(e){var t=e.component,n=e.children,o=e.appear,a=e.enter,i=e.leave;return r.createElement(eC.TransitionGroup,{component:t},r.Children.map(n,function(e,t){return r.createElement(eZ,{appearOptions:o,enterOptions:a,leaveOptions:i,key:"child-".concat(t)},e)}))}eZ.propTypes={appearOptions:a().object,enterOptions:a().object,leaveOptions:a().object,children:a().element},ez.propTypes={appear:a().object,enter:a().object,leave:a().object,children:a().oneOfType([a().array,a().element]),component:a().any},ez.defaultProps={component:"span"};var eB=eO},94263:function(e,t){"use strict";t.Z={'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}},33664:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,function(e){if(!e||!e.__esModule){var t={};if(null!=e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}t.default=e}}(n(40718));var r=l(n(84617)),o=l(n(67973)),a=l(n(2265)),i=l(n(20536));function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n(32601);var c=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return(0,r.default)(e,t)})},u=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return(0,o.default)(e,t)})},d=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).onEnter=function(e,n){var r=t.getClassNames(n?"appear":"enter").className;t.removeClasses(e,"exit"),c(e,r),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.getClassNames(n?"appear":"enter").activeClassName;t.reflowAndAddClass(e,r),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.getClassNames("appear").doneClassName,o=t.getClassNames("enter").doneClassName;t.removeClasses(e,n?"appear":"enter"),c(e,n?r+" "+o:o),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.getClassNames("exit").className;t.removeClasses(e,"appear"),t.removeClasses(e,"enter"),c(e,n),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.getClassNames("exit").activeClassName;t.reflowAndAddClass(e,n),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.getClassNames("exit").doneClassName;t.removeClasses(e,"exit"),c(e,n),t.props.onExited&&t.props.onExited(e)},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?(r&&n?n+"-":"")+e:n[e],a=r?o+"-active":n[e+"Active"],i=r?o+"-done":n[e+"Done"];return{className:o,activeClassName:a,doneClassName:i}},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.removeClasses=function(e,t){var n=this.getClassNames(t),r=n.className,o=n.activeClassName,a=n.doneClassName;r&&u(e,r),o&&u(e,o),a&&u(e,a)},n.reflowAndAddClass=function(e,t){t&&(e&&e.scrollTop,c(e,t))},n.render=function(){var e=s({},this.props);return delete e.classNames,a.default.createElement(i.default,s({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(a.default.Component);d.defaultProps={classNames:""},d.propTypes={},t.default=d,e.exports=t.default},31601:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,i(n(40718));var r=i(n(2265)),o=n(54887),a=i(n(38244));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).handleEnter=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEnter",0,n)},t.handleEntering=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntering",0,n)},t.handleEntered=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntered",0,n)},t.handleExit=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExit",1,n)},t.handleExiting=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExiting",1,n)},t.handleExited=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExited",1,n)},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.handleLifecycle=function(e,t,n){var a,i=this.props.children,l=r.default.Children.toArray(i)[t];l.props[e]&&(a=l.props)[e].apply(a,n),this.props[e]&&this.props[e]((0,o.findDOMNode)(this))},n.render=function(){var e=this.props,t=e.children,n=e.in,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["children","in"]),i=r.default.Children.toArray(t),l=i[0],s=i[1];return delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,r.default.createElement(a.default,o,n?r.default.cloneElement(l,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(s,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},t}(r.default.Component);l.propTypes={},t.default=l,e.exports=t.default},20536:function(e,t,n){"use strict";t.__esModule=!0,t.default=t.EXITING=t.ENTERED=t.ENTERING=t.EXITED=t.UNMOUNTED=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}return t.default=e,t}(n(40718)),o=l(n(2265)),a=l(n(54887)),i=n(52181);function l(e){return e&&e.__esModule?e:{default:e}}n(32601);var s="unmounted";t.UNMOUNTED=s;var c="exited";t.EXITED=c;var u="entering";t.ENTERING=u;var d="entered";t.ENTERED=d;var f="exiting";t.EXITING=f;var p=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,o,a=n.transitionGroup,i=a&&!a.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=c,r.appearStatus=u):o=d:o=t.unmountOnExit||t.mountOnEnter?s:c,r.state={status:o},r.nextCallback=null,r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===s?{status:c}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==u&&n!==d&&(t=u):(n===u||n===d)&&(t=f)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=a.default.findDOMNode(this);t===u?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===c&&this.setState({status:s})},n.performEnter=function(e,t){var n=this,r=this.props.enter,o=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,a=this.getTimeouts(),i=o?a.appear:a.enter;if(!t&&!r){this.safeSetState({status:d},function(){n.props.onEntered(e)});return}this.props.onEnter(e,o),this.safeSetState({status:u},function(){n.props.onEntering(e,o),n.onTransitionEnd(e,i,function(){n.safeSetState({status:d},function(){n.props.onEntered(e,o)})})})},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();if(!n){this.safeSetState({status:c},function(){t.props.onExited(e)});return}this.props.onExit(e),this.safeSetState({status:f},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:c},function(){t.props.onExited(e)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;if(!e||r){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)},n.render=function(){var e=this.state.status;if(e===s)return null;var t=this.props,n=t.children,r=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var a=o.default.Children.only(n);return o.default.cloneElement(a,r)},t}(o.default.Component);function h(){}p.contextTypes={transitionGroup:r.object},p.childContextTypes={transitionGroup:function(){}},p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},p.UNMOUNTED=0,p.EXITED=1,p.ENTERING=2,p.ENTERED=3,p.EXITING=4;var m=(0,i.polyfill)(p);t.default=m},38244:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=l(n(40718)),o=l(n(2265)),a=n(52181),i=n(28710);function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var u=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},d=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(c(c(r)));return r.state={handleExited:o,firstRender:!0},r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},n.componentDidMount=function(){this.appeared=!0,this.mounted=!0},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?(0,i.getInitialChildMapping)(e,r):(0,i.getNextChildMapping)(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=(0,i.getChildMapping)(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=s({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["component","childFactory"]),a=u(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===t)?a:o.default.createElement(t,r,a)},t}(o.default.Component);d.childContextTypes={transitionGroup:r.default.object.isRequired},d.propTypes={},d.defaultProps={component:"div",childFactory:function(e){return e}};var f=(0,a.polyfill)(d);t.default=f,e.exports=t.default},30719:function(e,t,n){"use strict";var r=l(n(33664)),o=l(n(31601)),a=l(n(38244)),i=l(n(20536));function l(e){return e&&e.__esModule?e:{default:e}}e.exports={Transition:i.default,TransitionGroup:a.default,ReplaceTransition:o.default,CSSTransition:r.default}},28710:function(e,t,n){"use strict";t.__esModule=!0,t.getChildMapping=o,t.mergeChildMappings=a,t.getInitialChildMapping=function(e,t){return o(e.children,function(n){return(0,r.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:i(n,"appear",e),enter:i(n,"enter",e),exit:i(n,"exit",e)})})},t.getNextChildMapping=function(e,t,n){var l=o(e.children),s=a(t,l);return Object.keys(s).forEach(function(o){var a=s[o];if((0,r.isValidElement)(a)){var c=o in t,u=o in l,d=t[o],f=(0,r.isValidElement)(d)&&!d.props.in;u&&(!c||f)?s[o]=(0,r.cloneElement)(a,{onExited:n.bind(null,a),in:!0,exit:i(a,"exit",e),enter:i(a,"enter",e)}):u||!c||f?u&&c&&(0,r.isValidElement)(d)&&(s[o]=(0,r.cloneElement)(a,{onExited:n.bind(null,a),in:d.props.in,exit:i(a,"exit",e),enter:i(a,"enter",e)})):s[o]=(0,r.cloneElement)(a,{in:!1})}}),s};var r=n(2265);function o(e,t){var n=Object.create(null);return e&&r.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,r.isValidElement)(e)?t(e):e}),n}function a(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),a=[];for(var i in e)i in t?a.length&&(o[i]=a,a=[]):a.push(i);var l={};for(var s in t){if(o[s])for(r=0;r<o[s].length;r++){var c=o[s][r];l[o[s][r]]=n(c)}l[s]=n(s)}for(r=0;r<a.length;r++)l[a[r]]=n(a[r]);return l}function i(e,t,n){return null!=n[t]?n[t]:e.props[t]}},32601:function(e,t,n){"use strict";var r;t.__esModule=!0,t.classNamesShape=t.timeoutsShape=void 0,(r=n(40718))&&r.__esModule,t.timeoutsShape=null,t.classNamesShape=null},31699:function(e,t,n){"use strict";n.d(t,{$:function(){return Z}});var r=n(2265),o=n(87602),a=n(59221),i=n(21652),l=n.n(i),s=n(77571),c=n.n(s),u=n(9841),d=n(13137),f=n(20407),p=n(58772),h=n(16630),m=n(82944),g=n(34067),v=n(85355),y=n(41637),b=n(11638);function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var w=["x","y"];function k(){return(k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){var n=e.x,r=e.y,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,w),a=parseInt("".concat(n),10),i=parseInt("".concat(r),10),l=parseInt("".concat(t.height||o.height),10),s=parseInt("".concat(t.width||o.width),10);return E(E(E(E(E({},t),o),a?{x:a}:{}),i?{y:i}:{}),{},{height:l,width:s,name:t.name,radius:t.radius})}function C(e){return r.createElement(b.bn,k({shapeType:"rectangle",propTransformer:O,activeClassName:"recharts-active-bar"},e))}var j=["value","background"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(f,e);var t,n,i,s=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=R(f);return e=t?Reflect.construct(n,arguments,R(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return I(e)}(this,e)});function f(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,f);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return D(I(e=s.call.apply(s,[this].concat(n))),"state",{isAnimationFinished:!1}),D(I(e),"id",(0,h.EL)("recharts-bar-")),D(I(e),"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),D(I(e),"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return n=[{key:"renderRectanglesStatically",value:function(e){var t=this,n=this.props,o=n.shape,a=n.dataKey,i=n.activeIndex,l=n.activeBar,s=(0,m.L6)(this.props,!1);return e&&e.map(function(e,n){var c=n===i,d=T(T(T({},s),e),{},{isActive:c,option:c?l:o,index:n,dataKey:a,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return r.createElement(u.m,P({className:"recharts-bar-rectangle"},(0,y.bw)(t.props,e,n),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),r.createElement(C,d))})}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,n=t.data,o=t.layout,i=t.isAnimationActive,l=t.animationBegin,s=t.animationDuration,c=t.animationEasing,d=t.animationId,f=this.state.prevData;return r.createElement(a.ZP,{begin:l,duration:s,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var a=t.t,i=n.map(function(e,t){var n=f&&f[t];if(n){var r=(0,h.k4)(n.x,e.x),i=(0,h.k4)(n.y,e.y),l=(0,h.k4)(n.width,e.width),s=(0,h.k4)(n.height,e.height);return T(T({},e),{},{x:r(a),y:i(a),width:l(a),height:s(a)})}if("horizontal"===o){var c=(0,h.k4)(0,e.height)(a);return T(T({},e),{},{y:e.y+e.height-c,height:c})}var u=(0,h.k4)(0,e.width)(a);return T(T({},e),{},{width:u})});return r.createElement(u.m,null,e.renderRectanglesStatically(i))})}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!l()(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:"renderBackground",value:function(){var e=this,t=this.props,n=t.data,o=t.dataKey,a=t.activeIndex,i=(0,m.L6)(this.props.background,!1);return n.map(function(t,n){t.value;var l=t.background,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,j);if(!l)return null;var c=T(T(T(T(T({},s),{},{fill:"#eee"},l),i),(0,y.bw)(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:o,index:n,key:"background-bar-".concat(n),className:"recharts-bar-background-rectangle"});return r.createElement(C,P({option:e.props.background,isActive:n===a},c))})}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.data,a=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,m.NN)(s,d.W);if(!c)return null;var f="vertical"===l?o[0].height/2:o[0].width/2,p=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:(0,v.F$)(e,t)}};return r.createElement(u.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:o,xAxis:a,yAxis:i,layout:l,offset:f,dataPointFormatter:p})}))}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.data,a=e.className,i=e.xAxis,l=e.yAxis,s=e.left,d=e.top,f=e.width,h=e.height,m=e.isAnimationActive,g=e.background,v=e.id;if(t||!n||!n.length)return null;var y=this.state.isAnimationFinished,b=(0,o.Z)("recharts-bar",a),x=i&&i.allowDataOverflow,w=l&&l.allowDataOverflow,k=x||w,S=c()(v)?this.id:v;return r.createElement(u.m,{className:b},x||w?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(S)},r.createElement("rect",{x:x?s:s-f/2,y:w?d:d-h/2,width:x?f:2*f,height:w?h:2*h}))):null,r.createElement(u.m,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,S),(!m||y)&&p.e.renderCallByParent(this.props,n))}}],i=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],n&&A(f.prototype,n),i&&A(f,i),Object.defineProperty(f,"prototype",{writable:!1}),f}(r.PureComponent);D(Z,"displayName","Bar"),D(Z,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!g.x.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),D(Z,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,o=e.bandSize,a=e.xAxis,i=e.yAxis,l=e.xAxisTicks,s=e.yAxisTicks,c=e.stackedData,u=e.dataStartIndex,d=e.displayedData,p=e.offset,g=(0,v.Bu)(r,n);if(!g)return null;var y=t.layout,b=n.props,x=b.dataKey,w=b.children,k=b.minPointSize,S="horizontal"===y?i:a,E=c?S.scale.domain():null,O=(0,v.Yj)({numericAxis:S}),C=(0,m.NN)(w,f.b),j=d.map(function(e,t){var r,d,f,p,m,b;if(c?r=(0,v.Vv)(c[u+t],E):Array.isArray(r=(0,v.F$)(e,x))||(r=[O,r]),"horizontal"===y){var w,S=[i.scale(r[0]),i.scale(r[1])],j=S[0],_=S[1];d=(0,v.Fy)({axis:a,ticks:l,bandSize:o,offset:g.offset,entry:e,index:t}),f=null!==(w=null!=_?_:j)&&void 0!==w?w:void 0,p=g.size;var P=j-_;if(m=Number.isNaN(P)?0:P,b={x:d,y:i.y,width:p,height:i.height},Math.abs(k)>0&&Math.abs(m)<Math.abs(k)){var N=(0,h.uY)(m||k)*(Math.abs(k)-Math.abs(m));f-=N,m+=N}}else{var A=[a.scale(r[0]),a.scale(r[1])],M=A[0],I=A[1];if(d=M,f=(0,v.Fy)({axis:i,ticks:s,bandSize:o,offset:g.offset,entry:e,index:t}),p=I-M,m=g.size,b={x:a.x,y:f,width:a.width,height:m},Math.abs(k)>0&&Math.abs(p)<Math.abs(k)){var R=(0,h.uY)(p||k)*(Math.abs(k)-Math.abs(p));p+=R}}return T(T(T({},e),{},{x:d,y:f,width:p,height:m,value:c?r:r[1],payload:e,background:b},C&&C[t]&&C[t].props),{},{tooltipPayload:[(0,v.Qo)(n,e)],tooltipPosition:{x:d+p/2,y:f+m/2}})});return T({data:j,layout:y},p)})},80285:function(e,t,n){"use strict";n.d(t,{O:function(){return N}});var r=n(2265),o=n(86757),a=n.n(o),i=n(13735),l=n.n(i),s=n(87602),c=n(46485),u=n(9841),d=n(58811),f=n(26680),p=n(16630),h=n(41637),m=n(82944),g=n(78242),v=["viewBox"],y=["viewBox"],b=["ticks"];function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(){return(w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function E(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(k,e);var t,n,o,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=j(k);return e=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function k(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,k),(t=i.call(this,e)).state={fontSize:"",letterSpacing:""},t}return n=[{key:"shouldComponentUpdate",value:function(e,t){var n=e.viewBox,r=E(e,v),o=this.props,a=o.viewBox,i=E(o,y);return!(0,c.w)(n,a)||!(0,c.w)(r,i)||!(0,c.w)(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,n,r,o,a,i,l=this.props,s=l.x,c=l.y,u=l.width,d=l.height,f=l.orientation,h=l.tickSize,m=l.mirror,g=l.tickMargin,v=m?-1:1,y=e.tickSize||h,b=(0,p.hj)(e.tickCoord)?e.tickCoord:e.coordinate;switch(f){case"top":t=n=e.coordinate,i=(r=(o=c+ +!m*d)-v*y)-v*g,a=b;break;case"left":r=o=e.coordinate,a=(t=(n=s+ +!m*u)-v*y)-v*g,i=b;break;case"right":r=o=e.coordinate,a=(t=(n=s+ +m*u)+v*y)+v*g,i=b;break;default:t=n=e.coordinate,i=(r=(o=c+ +m*d)+v*y)+v*g,a=b}return{line:{x1:t,y1:r,x2:n,y2:o},tick:{x:a,y:i}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,n=t.orientation,r=t.mirror;switch(n){case"left":e=r?"start":"end";break;case"right":e=r?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,n=e.mirror,r="end";switch(t){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.orientation,c=e.mirror,u=e.axisLine,d=S(S(S({},(0,m.L6)(this.props,!1)),(0,m.L6)(u,!1)),{},{fill:"none"});if("top"===i||"bottom"===i){var f=+("top"===i&&!c||"bottom"===i&&c);d=S(S({},d),{},{x1:t,y1:n+f*a,x2:t+o,y2:n+f*a})}else{var p=+("left"===i&&!c||"right"===i&&c);d=S(S({},d),{},{x1:t+p*o,y1:n,x2:t+p*o,y2:n+a})}return r.createElement("line",w({},d,{className:(0,s.Z)("recharts-cartesian-axis-line",l()(u,"className"))}))}},{key:"renderTicks",value:function(e,t,n){var o=this,i=this.props,c=i.tickLine,d=i.stroke,f=i.tick,p=i.tickFormatter,v=i.unit,y=(0,g.f)(S(S({},this.props),{},{ticks:e}),t,n),b=this.getTickTextAnchor(),x=this.getTickVerticalAnchor(),E=(0,m.L6)(this.props,!1),O=(0,m.L6)(f,!1),C=S(S({},E),{},{fill:"none"},(0,m.L6)(c,!1)),j=y.map(function(e,t){var n=o.getTickLineCoord(e),i=n.line,m=n.tick,g=S(S(S(S({textAnchor:b,verticalAnchor:x},E),{},{stroke:"none",fill:d},O),m),{},{index:t,payload:e,visibleTicksCount:y.length,tickFormatter:p});return r.createElement(u.m,w({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},(0,h.bw)(o.props,e,t)),c&&r.createElement("line",w({},C,i,{className:(0,s.Z)("recharts-cartesian-axis-tick-line",l()(c,"className"))})),f&&k.renderTickItem(f,g,"".concat(a()(p)?p(e.value,t):e.value).concat(v||"")))});return r.createElement("g",{className:"recharts-cartesian-axis-ticks"},j)}},{key:"render",value:function(){var e=this,t=this.props,n=t.axisLine,o=t.width,i=t.height,l=t.ticksGenerator,c=t.className;if(t.hide)return null;var d=this.props,p=d.ticks,h=E(d,b),m=p;return(a()(l)&&(m=l(p&&p.length>0?this.props:h)),o<=0||i<=0||!m||!m.length)?null:r.createElement(u.m,{className:(0,s.Z)("recharts-cartesian-axis",c),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),f._.renderCallByParent(this.props))}}],o=[{key:"renderTickItem",value:function(e,t,n){return r.isValidElement(e)?r.cloneElement(e,t):a()(e)?e(t):r.createElement(d.x,w({},t,{className:"recharts-cartesian-axis-tick-value"}),n)}}],n&&O(k.prototype,n),o&&O(k,o),Object.defineProperty(k,"prototype",{writable:!1}),k}(r.Component);_(N,"displayName","CartesianAxis"),_(N,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"})},56940:function(e,t,n){"use strict";n.d(t,{q:function(){return P}});var r=n(2265),o=n(86757),a=n.n(o),i=n(1175),l=n(16630),s=n(82944),c=n(85355),u=n(78242),d=n(80285),f=n(25739),p=["x1","y1","x2","y2","key"],h=["offset"];function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var x=function(e){var t=e.fill;if(!t||"none"===t)return null;var n=e.fillOpacity,o=e.x,a=e.y,i=e.width,l=e.height;return r.createElement("rect",{x:o,y:a,width:i,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function w(e,t){var n;if(r.isValidElement(e))n=r.cloneElement(e,t);else if(a()(e))n=e(t);else{var o=t.x1,i=t.y1,l=t.x2,c=t.y2,u=t.key,d=b(t,p),f=(0,s.L6)(d,!1),m=(f.offset,b(f,h));n=r.createElement("line",y({},m,{x1:o,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function k(e){var t=e.x,n=e.width,o=e.horizontal,a=void 0===o||o,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(r,o){return w(a,v(v({},e),{},{x1:t,y1:r,x2:t+n,y2:r,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function S(e){var t=e.y,n=e.height,o=e.vertical,a=void 0===o||o,i=e.verticalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(r,o){return w(a,v(v({},e),{},{x1:r,y1:t,x2:r,y2:t+n,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function E(e){var t=e.horizontalFill,n=e.fillOpacity,o=e.x,a=e.y,i=e.width,l=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(void 0===c||c)||!t||!t.length)return null;var u=s.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,s){var c=u[s+1]?u[s+1]-e:a+l-e;if(c<=0)return null;var d=s%t.length;return r.createElement("rect",{key:"react-".concat(s),y:e,x:o,height:c,width:i,stroke:"none",fill:t[d],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function O(e){var t=e.vertical,n=e.verticalFill,o=e.fillOpacity,a=e.x,i=e.y,l=e.width,s=e.height,c=e.verticalPoints;if(!(void 0===t||t)||!n||!n.length)return null;var u=c.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,t){var c=u[t+1]?u[t+1]-e:a+l-e;if(c<=0)return null;var d=t%n.length;return r.createElement("rect",{key:"react-".concat(t),x:e,y:i,width:c,height:s,stroke:"none",fill:n[d],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var C=function(e,t){var n=e.xAxis,r=e.width,o=e.height,a=e.offset;return(0,c.Rf)((0,u.f)(v(v(v({},d.O.defaultProps),n),{},{ticks:(0,c.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),a.left,a.left+a.width,t)},j=function(e,t){var n=e.yAxis,r=e.width,o=e.height,a=e.offset;return(0,c.Rf)((0,u.f)(v(v(v({},d.O.defaultProps),n),{},{ticks:(0,c.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),a.top,a.top+a.height,t)},_={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function P(e){var t,n,o,s,c,u,d=(0,f.zn)(),p=(0,f.Mw)(),h=(0,f.qD)(),g=v(v({},e),{},{stroke:null!==(t=e.stroke)&&void 0!==t?t:_.stroke,fill:null!==(n=e.fill)&&void 0!==n?n:_.fill,horizontal:null!==(o=e.horizontal)&&void 0!==o?o:_.horizontal,horizontalFill:null!==(s=e.horizontalFill)&&void 0!==s?s:_.horizontalFill,vertical:null!==(c=e.vertical)&&void 0!==c?c:_.vertical,verticalFill:null!==(u=e.verticalFill)&&void 0!==u?u:_.verticalFill}),b=g.x,w=g.y,P=g.width,N=g.height,T=g.xAxis,A=g.yAxis,M=g.syncWithTicks,I=g.horizontalValues,R=g.verticalValues;if(!(0,l.hj)(P)||P<=0||!(0,l.hj)(N)||N<=0||!(0,l.hj)(b)||b!==+b||!(0,l.hj)(w)||w!==+w)return null;var D=g.verticalCoordinatesGenerator||C,L=g.horizontalCoordinatesGenerator||j,Z=g.horizontalPoints,z=g.verticalPoints;if((!Z||!Z.length)&&a()(L)){var B=I&&I.length,F=L({yAxis:A?v(v({},A),{},{ticks:B?I:A.ticks}):void 0,width:d,height:p,offset:h},!!B||M);(0,i.Z)(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(m(F),"]")),Array.isArray(F)&&(Z=F)}if((!z||!z.length)&&a()(D)){var H=R&&R.length,q=D({xAxis:T?v(v({},T),{},{ticks:H?R:T.ticks}):void 0,width:d,height:p,offset:h},!!H||M);(0,i.Z)(Array.isArray(q),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(m(q),"]")),Array.isArray(q)&&(z=q)}return r.createElement("g",{className:"recharts-cartesian-grid"},r.createElement(x,{fill:g.fill,fillOpacity:g.fillOpacity,x:g.x,y:g.y,width:g.width,height:g.height}),r.createElement(k,y({},g,{offset:h,horizontalPoints:Z})),r.createElement(S,y({},g,{offset:h,verticalPoints:z})),r.createElement(E,y({},g,{horizontalPoints:Z})),r.createElement(O,y({},g,{verticalPoints:z})))}P.displayName="CartesianGrid"},13137:function(e,t,n){"use strict";n.d(t,{W:function(){return u}});var r=n(2265),o=n(69398),a=n(9841),i=n(82944),l=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e){var t=e.offset,n=e.layout,u=e.width,d=e.dataKey,f=e.data,p=e.dataPointFormatter,h=e.xAxis,m=e.yAxis,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,l),v=(0,i.L6)(g,!1);"x"===e.direction&&"number"!==h.type&&(0,o.Z)(!1);var y=f.map(function(e){var o,i,l=p(e,d),f=l.x,g=l.y,y=l.value,b=l.errorVal;if(!b)return null;var x=[];if(Array.isArray(b)){var w=function(e){if(Array.isArray(e))return e}(b)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(b,2)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,2)}}(b,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=w[0],i=w[1]}else o=i=b;if("vertical"===n){var k=h.scale,S=g+t,E=S+u,O=S-u,C=k(y-o),j=k(y+i);x.push({x1:j,y1:E,x2:j,y2:O}),x.push({x1:C,y1:S,x2:j,y2:S}),x.push({x1:C,y1:E,x2:C,y2:O})}else if("horizontal"===n){var _=m.scale,P=f+t,N=P-u,T=P+u,A=_(y-o),M=_(y+i);x.push({x1:N,y1:M,x2:T,y2:M}),x.push({x1:P,y1:A,x2:P,y2:M}),x.push({x1:N,y1:A,x2:T,y2:A})}return r.createElement(a.m,s({className:"recharts-errorBar",key:"bar-".concat(x.map(function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))},v),x.map(function(e){return r.createElement("line",s({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))}))});return r.createElement(a.m,{className:"recharts-errorBars"},y)}u.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},u.displayName="ErrorBar"},54061:function(e,t,n){"use strict";n.d(t,{x:function(){return I}});var r=n(2265),o=n(59221),a=n(86757),i=n.n(a),l=n(77571),s=n.n(l),c=n(21652),u=n.n(c),d=n(87602),f=n(57165),p=n(81889),h=n(9841),m=n(58772),g=n(13137),v=n(16630),y=n(82944),b=n(34067),x=n(85355),w=["type","layout","connectNulls","ref"];function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(){return(S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return j(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,M(r.key),r)}}function P(e,t){return(P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function N(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t,n){return(t=M(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}var I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}(c,e);var t,n,a,l=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=T(c);return e=t?Reflect.construct(n,arguments,T(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return N(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return A(N(e=l.call.apply(l,[this].concat(n))),"state",{isAnimationFinished:!0,totalLength:0}),A(N(e),"generateSimpleStrokeDasharray",function(e,t){return"".concat(t,"px ").concat(e-t,"px")}),A(N(e),"getStrokeDasharray",function(t,n,r){var o=r.reduce(function(e,t){return e+t});if(!o)return e.generateSimpleStrokeDasharray(n,t);for(var a=t%o,i=n-t,l=[],s=0,u=0;s<r.length;u+=r[s],++s)if(u+r[s]>a){l=[].concat(C(r.slice(0,s)),[a-u]);break}var d=l.length%2==0?[0,i]:[i];return[].concat(C(c.repeat(r,Math.floor(t/o))),C(l),d).map(function(e){return"".concat(e,"px")}).join(", ")}),A(N(e),"id",(0,v.EL)("recharts-line-")),A(N(e),"pathRef",function(t){e.mainCurve=t}),A(N(e),"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),A(N(e),"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return n=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.points,a=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,y.NN)(s,g.W);if(!c)return null;var u=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:(0,x.F$)(e.payload,t)}};return r.createElement(h.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:o,xAxis:a,yAxis:i,layout:l,dataPointFormatter:u})}))}},{key:"renderDots",value:function(e,t,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.dot,i=o.points,l=o.dataKey,s=(0,y.L6)(this.props,!1),u=(0,y.L6)(a,!0),d=i.map(function(e,t){var n=O(O(O({key:"dot-".concat(t),r:3},s),u),{},{value:e.value,dataKey:l,cx:e.x,cy:e.y,index:t,payload:e.payload});return c.renderDotItem(a,n)}),f={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return r.createElement(h.m,S({className:"recharts-line-dots",key:"dots"},f),d)}},{key:"renderCurveStatically",value:function(e,t,n,o){var a=this.props,i=a.type,l=a.layout,s=a.connectNulls,c=(a.ref,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,w)),u=O(O(O({},(0,y.L6)(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},o),{},{type:i,layout:l,connectNulls:s});return r.createElement(f.H,S({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,a=this.props,i=a.points,l=a.strokeDasharray,s=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,p=a.animateNewValues,h=a.width,m=a.height,g=this.state,y=g.prevPoints,b=g.totalLength;return r.createElement(o.ZP,{begin:c,duration:u,isActive:s,easing:d,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o,a=r.t;if(y){var s=y.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(y[n]){var r=y[n],o=(0,v.k4)(r.x,e.x),i=(0,v.k4)(r.y,e.y);return O(O({},e),{},{x:o(a),y:i(a)})}if(p){var l=(0,v.k4)(2*h,e.x),c=(0,v.k4)(m/2,e.y);return O(O({},e),{},{x:l(a),y:c(a)})}return O(O({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var u=(0,v.k4)(0,b)(a);if(l){var d="".concat(l).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});o=n.getStrokeDasharray(u,b,d)}else o=n.generateSimpleStrokeDasharray(b,u);return n.renderCurveStatically(i,e,t,{strokeDasharray:o})})}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,o=n.isAnimationActive,a=this.state,i=a.prevPoints,l=a.totalLength;return o&&r&&r.length&&(!i&&l>0||!u()(i,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,o=t.dot,a=t.points,i=t.className,l=t.xAxis,c=t.yAxis,u=t.top,f=t.left,p=t.width,g=t.height,v=t.isAnimationActive,b=t.id;if(n||!a||!a.length)return null;var x=this.state.isAnimationFinished,w=1===a.length,k=(0,d.Z)("recharts-line",i),S=l&&l.allowDataOverflow,E=c&&c.allowDataOverflow,O=S||E,C=s()(b)?this.id:b,j=null!==(e=(0,y.L6)(o,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,y.$k)(o)?o:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return r.createElement(h.m,{className:k},S||E?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(C)},r.createElement("rect",{x:S?f:f-p/2,y:E?u:u-g/2,width:S?p:2*p,height:E?g:2*g})),!T&&r.createElement("clipPath",{id:"clipPath-dots-".concat(C)},r.createElement("rect",{x:f-A/2,y:u-A/2,width:p+A,height:g+A}))):null,!w&&this.renderCurve(O,C),this.renderErrorBar(O,C),(w||o)&&this.renderDots(O,T,C),(!v||x)&&m.e.renderCallByParent(this.props,a))}}],a=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!=0?[].concat(C(e),[0]):e,r=[],o=0;o<t;++o)r=[].concat(C(r),C(n));return r}},{key:"renderDotItem",value:function(e,t){var n;if(r.isValidElement(e))n=r.cloneElement(e,t);else if(i()(e))n=e(t);else{var o=(0,d.Z)("recharts-line-dot",e?e.className:"");n=r.createElement(p.o,S({},t,{className:o}))}return n}}],n&&_(c.prototype,n),a&&_(c,a),Object.defineProperty(c,"prototype",{writable:!1}),c}(r.PureComponent);A(I,"displayName","Line"),A(I,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!b.x.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),A(I,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,i=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout;return O({points:c.map(function(e,t){var c=(0,x.F$)(e,i);return"horizontal"===d?{x:(0,x.Hv)({axis:n,ticks:o,bandSize:l,entry:e,index:t}),y:s()(c)?null:r.scale(c),value:c,payload:e}:{x:s()(c)?null:n.scale(c),y:(0,x.Hv)({axis:r,ticks:a,bandSize:l,entry:e,index:t}),value:c,payload:e}}),layout:d},u)})},97059:function(e,t,n){"use strict";n.d(t,{K:function(){return c}});var r=n(2265),o=n(87602),a=n(25739),i=n(80285),l=n(85355);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=function(e){var t=e.xAxisId,n=(0,a.zn)(),c=(0,a.Mw)(),u=(0,a.bH)(t);return null==u?null:r.createElement(i.O,s({},u,{className:(0,o.Z)("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:n,height:c},ticksGenerator:function(e){return(0,l.uY)(e,!0)}}))};c.displayName="XAxis",c.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0}},62994:function(e,t,n){"use strict";n.d(t,{B:function(){return c}});var r=n(2265),o=n(87602),a=n(25739),i=n(80285),l=n(85355);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=function(e){var t=e.yAxisId,n=(0,a.zn)(),c=(0,a.Mw)(),u=(0,a.Ud)(t);return null==u?null:r.createElement(i.O,s({},u,{className:(0,o.Z)("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:n,height:c},ticksGenerator:function(e){return(0,l.uY)(e,!0)}}))};c.displayName="YAxis",c.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1}},78242:function(e,t,n){"use strict";n.d(t,{f:function(){return h}});var r=n(86757),o=n.n(r),a=n(16630),i=n(4094),l=n(34067),s=n(25311);function c(e,t,n){if(t<1)return[];if(1===t&&void 0===n)return e;for(var r=[],o=0;o<e.length;o+=t){if(void 0!==n&&!0!==n(e[o]))return;r.push(e[o])}return r}function u(e,t,n,r,o){if(e*t<e*r||e*t>e*o)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-o)<=0}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){var r,d,f,h,m,g=e.tick,v=e.ticks,y=e.viewBox,b=e.minTickGap,x=e.orientation,w=e.interval,k=e.tickFormatter,S=e.unit,E=e.angle;if(!v||!v.length||!g)return[];if((0,a.hj)(w)||l.x.isSsr)return c(v,("number"==typeof w&&(0,a.hj)(w)?w:0)+1);var O="top"===x||"bottom"===x?"width":"height",C=S&&"width"===O?(0,i.xE)(S,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=function(e,r){var a,l,c=o()(k)?k(e.value,r):e.value;return"width"===O?(l={width:(a=(0,i.xE)(c,{fontSize:t,letterSpacing:n})).width+C.width,height:a.height+C.height},(0,s.xE)(l,E)):(0,i.xE)(c,{fontSize:t,letterSpacing:n})[O]},_=v.length>=2?(0,a.uY)(v[1].coordinate-v[0].coordinate):1,P=(r="width"===O,d=y.x,f=y.y,h=y.width,m=y.height,1===_?{start:r?d:f,end:r?d+h:f+m}:{start:r?d+h:f+m,end:r?d:f});return"equidistantPreserveStart"===w?function(e,t,n,r,o){for(var a,i=(r||[]).slice(),l=t.start,s=t.end,d=0,f=1,p=l;f<=i.length;)if(a=function(){var t,a=null==r?void 0:r[d];if(void 0===a)return{v:c(r,f)};var i=d,h=function(){return void 0===t&&(t=n(a,i)),t},m=a.coordinate,g=0===d||u(e,m,h,p,s);g||(d=0,p=l,f+=1),g&&(p=m+e*(h()/2+o),d+=f)}())return a.v;return[]}(_,P,j,v,b):("preserveStart"===w||"preserveStartEnd"===w?function(e,t,n,r,o,a){var i=(r||[]).slice(),l=i.length,s=t.start,c=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-c);i[l-1]=d=p(p({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),u(e,d.tickCoord,function(){return f},s,c)&&(c=d.tickCoord-e*(f/2+o),i[l-1]=p(p({},d),{},{isShow:!0}))}for(var m=a?l-1:l,g=function(t){var r,a=i[t],l=function(){return void 0===r&&(r=n(a,t)),r};if(0===t){var d=e*(a.coordinate-e*l()/2-s);i[t]=a=p(p({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else i[t]=a=p(p({},a),{},{tickCoord:a.coordinate});u(e,a.tickCoord,l,s,c)&&(s=a.tickCoord+e*(l()/2+o),i[t]=p(p({},a),{},{isShow:!0}))},v=0;v<m;v++)g(v);return i}(_,P,j,v,b,"preserveStartEnd"===w):function(e,t,n,r,o){for(var a=(r||[]).slice(),i=a.length,l=t.start,s=t.end,c=function(t){var r,c=a[t],d=function(){return void 0===r&&(r=n(c,t)),r};if(t===i-1){var f=e*(c.coordinate+e*d()/2-s);a[t]=c=p(p({},c),{},{tickCoord:f>0?c.coordinate-f*e:c.coordinate})}else a[t]=c=p(p({},c),{},{tickCoord:c.coordinate});u(e,c.tickCoord,d,l,s)&&(s=c.tickCoord-e*(d()/2+o),a[t]=p(p({},c),{},{isShow:!0}))},d=i-1;d>=0;d--)c(d);return a}(_,P,j,v,b)).filter(function(e){return e.isShow})}},93765:function(e,t,n){"use strict";n.d(t,{z:function(){return tx}});var r=n(2265),o=n(77571),a=n.n(o),i=n(86757),l=n.n(i),s=n(99676),c=n.n(s),u=n(13735),d=n.n(u),f=n(34935),p=n.n(f),h=n(37065),m=n.n(h),g=n(84173),v=n.n(g),y=n(32242),b=n.n(y),x=n(87602),w=n(69398),k=n(48777),S=n(9841),E=n(8147),O=n(22190),C=n(81889),j=n(73649),_=n(82944),P=n(55284),N=n(58811),T=n(85355),A=n(16630);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t,n){var r;return(r=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===M(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var L=["Webkit","Moz","O","ms"],Z=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=L.reduce(function(e,r){return R(R({},e),{},D({},r+n,t))},{});return r[e]=t,r};function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(){return(B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach(function(t){$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V(r.key),r)}}function W(e,t){return(W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function U(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t,n){return(t=V(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e){var t=function(e,t){if("object"!==z(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==z(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===z(t)?t:String(t)}var X=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,o=e.x,a=e.width,i=e.travellerWidth;if(!t||!t.length)return{};var l=t.length,s=(0,P.x)().domain(c()(0,l)).range([o,o+a-i]),u=s.domain().map(function(e){return s(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:s(n),endX:s(r),scale:s,scaleValues:u}},G=function(e){return e.changedTouches&&!!e.changedTouches.length},Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(i,e);var t,n,o,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=K(i);return e=t?Reflect.construct(n,arguments,K(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===z(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return U(e)}(this,e)});function i(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),$(U(t=a.call(this,e)),"handleDrag",function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)}),$(U(t),"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])}),$(U(t),"handleDragEnd",function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=t.props,n=e.endIndex,r=e.onDragEnd,o=e.startIndex;null==r||r({endIndex:n,startIndex:o})}),t.detachDragEndListener()}),$(U(t),"handleLeaveWrapper",function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))}),$(U(t),"handleEnterSlideOrTraveller",function(){t.setState({isTextActive:!0})}),$(U(t),"handleLeaveSlideOrTraveller",function(){t.setState({isTextActive:!1})}),$(U(t),"handleSlideDragStart",function(e){var n=G(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:n.pageX}),t.attachDragEndListener()}),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(U(t),"startX"),endX:t.handleTravellerDragStart.bind(U(t),"endX")},t.state={},t}return n=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,n=e.endX,r=this.state.scaleValues,o=this.props,a=o.gap,l=o.data.length-1,s=i.getIndexInRange(r,Math.min(t,n)),c=i.getIndexInRange(r,Math.max(t,n));return{startIndex:s-s%a,endIndex:c===l?l:c-c%a}}},{key:"getTextOfTick",value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,o=t.dataKey,a=(0,T.F$)(n[e],o,e);return l()(r)?r(a,e):a}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,o=t.endX,a=this.props,i=a.x,l=a.width,s=a.travellerWidth,c=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,i+l-s-o,i+l-s-r):f<0&&(f=Math.max(f,i-r,i-o));var p=this.getIndex({startX:r+f,endX:o+f});(p.startIndex!==c||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:o+f,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var n=G(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,n=this.state,r=n.brushMoveStartX,o=n.movingTravellerId,a=n.endX,i=n.startX,l=this.state[o],s=this.props,c=s.x,u=s.width,d=s.travellerWidth,f=s.onChange,p=s.gap,h=s.data,m={startX:this.state.startX,endX:this.state.endX},g=e.pageX-r;g>0?g=Math.min(g,c+u-d-l):g<0&&(g=Math.max(g,c-l)),m[o]=l+g;var v=this.getIndex(m),y=v.startIndex,b=v.endIndex,x=function(){var e=h.length-1;return"startX"===o&&(a>i?y%p==0:b%p==0)||a<i&&b===e||"endX"===o&&(a>i?b%p==0:y%p==0)||a>i&&b===e};this.setState(($(t={},o,l+g),$(t,"brushMoveStartX",e.pageX),t),function(){f&&x()&&f(v)})}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var n=this,r=this.state,o=r.scaleValues,a=r.startX,i=r.endX,l=this.state[t],s=o.indexOf(l);if(-1!==s){var c=s+e;if(-1!==c&&!(c>=o.length)){var u=o[c];"startX"===t&&u>=i||"endX"===t&&u<=a||this.setState($({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.fill,l=e.stroke;return r.createElement("rect",{stroke:l,fill:i,x:t,y:n,width:o,height:a})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.data,l=e.children,s=e.padding,c=r.Children.only(l);return c?r.cloneElement(c,{x:t,y:n,width:o,height:a,margin:s,compact:!0,data:i}):null}},{key:"renderTravellerLayer",value:function(e,t){var n=this,o=this.props,a=o.y,l=o.travellerWidth,s=o.height,c=o.traveller,u=o.ariaLabel,d=o.data,f=o.startIndex,p=o.endIndex,h=Math.max(e,this.props.x),m=H(H({},(0,_.L6)(this.props,!1)),{},{x:h,y:a,width:l,height:s}),g=u||"Min value: ".concat(d[f].name,", Max value: ").concat(d[p].name);return r.createElement(S.m,{tabIndex:0,role:"slider","aria-label":g,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),n.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){n.setState({isTravellerFocused:!0})},onBlur:function(){n.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},i.renderTraveller(c,m))}},{key:"renderSlide",value:function(e,t){var n=this.props,o=n.y,a=n.height,i=n.stroke,l=n.travellerWidth;return r.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:i,fillOpacity:.2,x:Math.min(e,t)+l,y:o,width:Math.max(Math.abs(t-e)-l,0),height:a})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,o=e.y,a=e.height,i=e.travellerWidth,l=e.stroke,s=this.state,c=s.startX,u=s.endX,d={pointerEvents:"none",fill:l};return r.createElement(S.m,{className:"recharts-brush-texts"},r.createElement(N.x,B({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,u)-5,y:o+a/2},d),this.getTextOfTick(t)),r.createElement(N.x,B({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,u)+i+5,y:o+a/2},d),this.getTextOfTick(n)))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.className,o=e.children,a=e.x,i=e.y,l=e.width,s=e.height,c=e.alwaysShowText,u=this.state,d=u.startX,f=u.endX,p=u.isTextActive,h=u.isSlideMoving,m=u.isTravellerMoving,g=u.isTravellerFocused;if(!t||!t.length||!(0,A.hj)(a)||!(0,A.hj)(i)||!(0,A.hj)(l)||!(0,A.hj)(s)||l<=0||s<=0)return null;var v=(0,x.Z)("recharts-brush",n),y=1===r.Children.count(o),b=Z("userSelect","none");return r.createElement(S.m,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),y&&this.renderPanorama(),this.renderSlide(d,f),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(f,"endX"),(p||h||m||g||c)&&this.renderText())}}],o=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,n=e.y,o=e.width,a=e.height,i=e.stroke,l=Math.floor(n+a/2)-1;return r.createElement(r.Fragment,null,r.createElement("rect",{x:t,y:n,width:o,height:a,fill:i,stroke:"none"}),r.createElement("line",{x1:t+1,y1:l,x2:t+o-1,y2:l,fill:"none",stroke:"#fff"}),r.createElement("line",{x1:t+1,y1:l+2,x2:t+o-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):i.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var n=e.data,r=e.width,o=e.x,a=e.travellerWidth,i=e.updateId,l=e.startIndex,s=e.endIndex;if(n!==t.prevData||i!==t.prevUpdateId)return H({prevData:n,prevTravellerWidth:a,prevUpdateId:i,prevX:o,prevWidth:r},n&&n.length?X({data:n,width:r,x:o,travellerWidth:a,startIndex:l,endIndex:s}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||o!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([o,o+r-a]);var c=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:i,prevX:o,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:c}}return null}},{key:"getIndexInRange",value:function(e,t){for(var n=e.length,r=0,o=n-1;o-r>1;){var a=Math.floor((r+o)/2);e[a]>t?o=a:r=a}return t>=e[o]?o:r}}],n&&q(i.prototype,n),o&&q(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}(r.PureComponent);$(Y,"displayName","Brush"),$(Y,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Q=n(4094),J=n(38569),ee=n(26680),et=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r="extendDomain"),r===t},en=n(25311),er=n(1175);function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ea(){return(ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eo(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eo(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var es=function(e){var t=e.x,n=e.y,r=e.xAxis,o=e.yAxis,a=(0,en.Ky)({x:r.scale,y:o.scale}),i=a.apply({x:t,y:n},{bandAware:!0});return et(e,"discard")&&!a.isInRange(i)?null:i};function ec(e){var t=e.x,n=e.y,o=e.r,a=e.alwaysShow,i=e.clipPathId,l=(0,A.P2)(t),s=(0,A.P2)(n);if((0,er.Z)(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!l||!s)return null;var c=es(e);if(!c)return null;var u=c.x,d=c.y,f=e.shape,p=e.className,h=el(el({clipPath:et(e,"hidden")?"url(#".concat(i,")"):void 0},(0,_.L6)(e,!0)),{},{cx:u,cy:d});return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-dot",p)},ec.renderDot(f,h),ee._.renderCallByParent(e,{x:u-o,y:d-o,width:2*o,height:2*o}))}ec.displayName="ReferenceDot",ec.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1},ec.renderDot=function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):r.createElement(C.o,ea({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))};var eu=n(33645),ed=n.n(eu),ef=n(25739);function ep(e){return(ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function em(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eh(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ep(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ep(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ev(){return(ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ey=function(e,t,n,r,o,a,i,l,s){var c=o.x,u=o.y,d=o.width,f=o.height;if(n){var p=s.y,h=e.y.apply(p,{position:a});if(et(s,"discard")&&!e.y.isInRange(h))return null;var m=[{x:c+d,y:h},{x:c,y:h}];return"left"===l?m.reverse():m}if(t){var g=s.x,v=e.x.apply(g,{position:a});if(et(s,"discard")&&!e.x.isInRange(v))return null;var y=[{x:v,y:u+f},{x:v,y:u}];return"top"===i?y.reverse():y}if(r){var b=s.segment.map(function(t){return e.apply(t,{position:a})});return et(s,"discard")&&ed()(b,function(t){return!e.isInRange(t)})?null:b}return null};function eb(e){var t,n,o=e.x,a=e.y,i=e.segment,s=e.xAxisId,c=e.yAxisId,u=e.shape,d=e.className,f=e.alwaysShow,p=(0,ef.sp)(),h=(0,ef.bH)(s),m=(0,ef.Ud)(c),g=(0,ef.d2)();if(!p||!g)return null;(0,er.Z)(void 0===f,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=ey((0,en.Ky)({x:h.scale,y:m.scale}),(0,A.P2)(o),(0,A.P2)(a),i&&2===i.length,g,e.position,h.orientation,m.orientation,e);if(!v)return null;var y=function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(v,2)||function(e,t){if(e){if("string"==typeof e)return eg(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,2)}}(v,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],w=b.x,k=b.y,E=y[1],O=E.x,C=E.y,j=em(em({clipPath:et(e,"hidden")?"url(#".concat(p,")"):void 0},(0,_.L6)(e,!0)),{},{x1:w,y1:k,x2:O,y2:C});return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-line",d)},(t=u,n=j,r.isValidElement(t)?r.cloneElement(t,n):l()(t)?t(n):r.createElement("line",ev({},n,{className:"recharts-reference-line-line"}))),ee._.renderCallByParent(e,(0,en._b)({x1:w,y1:k,x2:O,y2:C})))}function ex(e){return(ex="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(){return(ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==ex(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ex(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ex(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}eb.displayName="ReferenceLine",eb.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"};var eE=function(e,t,n,r,o){var a=o.x1,i=o.x2,l=o.y1,s=o.y2,c=o.xAxis,u=o.yAxis;if(!c||!u)return null;var d=(0,en.Ky)({x:c.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(l,{position:"start"}):d.y.rangeMin},p={x:t?d.x.apply(i,{position:"end"}):d.x.rangeMax,y:r?d.y.apply(s,{position:"end"}):d.y.rangeMax};return!et(o,"discard")||d.isInRange(f)&&d.isInRange(p)?(0,en.O1)(f,p):null};function eO(e){var t=e.x1,n=e.x2,o=e.y1,a=e.y2,i=e.className,l=e.alwaysShow,s=e.clipPathId;(0,er.Z)(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var c=(0,A.P2)(t),u=(0,A.P2)(n),d=(0,A.P2)(o),f=(0,A.P2)(a),p=e.shape;if(!c&&!u&&!d&&!f&&!p)return null;var h=eE(c,u,d,f,e);if(!h&&!p)return null;var m=et(e,"hidden")?"url(#".concat(s,")"):void 0;return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-area",i)},eO.renderRect(p,eS(eS({clipPath:m},(0,_.L6)(e,!0)),h)),ee._.renderCallByParent(e,h))}function eC(e){return function(e){if(Array.isArray(e))return ej(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ej(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ej(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}eO.displayName="ReferenceArea",eO.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1},eO.renderRect=function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):r.createElement(j.A,ew({},t,{className:"recharts-reference-area-rect"}))};var e_=function(e,t,n,r,o){var a=(0,_.NN)(e,eb),i=(0,_.NN)(e,ec),l=[].concat(eC(a),eC(i)),s=(0,_.NN)(e,eO),c="".concat(r,"Id"),u=r[0],d=t;if(l.length&&(d=l.reduce(function(e,t){if(t.props[c]===n&&et(t.props,"extendDomain")&&(0,A.hj)(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),s.length){var f="".concat(u,"1"),p="".concat(u,"2");d=s.reduce(function(e,t){if(t.props[c]===n&&et(t.props,"extendDomain")&&(0,A.hj)(t.props[f])&&(0,A.hj)(t.props[p])){var r=t.props[f],o=t.props[p];return[Math.min(e[0],r,o),Math.max(e[1],r,o)]}return e},d)}return o&&o.length&&(d=o.reduce(function(e,t){return(0,A.hj)(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},eP=n(39206),eN=n(46485),eT=n(77625),eA=new(n.n(eT)()),eM="recharts.syncMouseEvents",eI=n(41637);function eR(e){return(eR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eD(e,t,n){return(t=eL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eL(e){var t=function(e,t){if("object"!==eR(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eR(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eR(t)?t:String(t)}var eZ=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),eD(this,"activeIndex",0),eD(this,"coordinateList",[]),eD(this,"layout","horizontal")}return e=[{key:"setDetails",value:function(e){var t,n=e.coordinateList,r=void 0===n?null:n,o=e.container,a=void 0===o?null:o,i=e.layout,l=void 0===i?null:i,s=e.offset,c=void 0===s?null:s,u=e.mouseHandlerCallback,d=void 0===u?null:u;this.coordinateList=null!==(t=null!=r?r:this.coordinateList)&&void 0!==t?t:[],this.container=null!=a?a:this.container,this.layout=null!=l?l:this.layout,this.offset=null!=c?c:this.offset,this.mouseHandlerCallback=null!=d?d:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"setIndex",value:function(e){this.activeIndex=e}},{key:"spoofMouse",value:function(){if("horizontal"===this.layout&&0!==this.coordinateList.length){var e,t,n=this.container.getBoundingClientRect(),r=n.x,o=n.y,a=n.height,i=this.coordinateList[this.activeIndex].coordinate,l=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,s=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,c=o+this.offset.top+a/2+s;this.mouseHandlerCallback({pageX:r+i+l,pageY:c})}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eL(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),ez=n(11638),eB=n(57165);function eF(e){return(eF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eH=["x","y","top","left","width","height","className"];function eq(){return(eq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var eU=function(e){var t=e.x,n=void 0===t?0:t,o=e.y,a=void 0===o?0:o,i=e.top,l=void 0===i?0:i,s=e.left,c=void 0===s?0:s,u=e.width,d=void 0===u?0:u,f=e.height,p=void 0===f?0:f,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eW(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eF(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eF(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eF(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({x:n,y:a,top:l,left:c,width:d,height:p},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eH));return(0,A.hj)(n)&&(0,A.hj)(a)&&(0,A.hj)(d)&&(0,A.hj)(p)&&(0,A.hj)(l)&&(0,A.hj)(c)?r.createElement("path",eq({},(0,_.L6)(m,!0),{className:(0,x.Z)("recharts-cross",h),d:"M".concat(n,",").concat(l,"v").concat(p,"M").concat(c,",").concat(a,"h").concat(d)})):null};function eK(e){var t=e.cx,n=e.cy,r=e.radius,o=e.startAngle,a=e.endAngle;return{points:[(0,eP.op)(t,n,r,o),(0,eP.op)(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:o,endAngle:a}}var e$=n(60474);function eV(e){return(eV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eX(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eV(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eV(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eV(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eY(e){var t,n,o=e.element,a=e.tooltipEventType,i=e.isActive,l=e.activeCoordinate,s=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,p=e.chartName;if(!o||!o.props.cursor||!i||!l||"ScatterChart"!==p&&"axis"!==a)return null;var h=eB.H;if("ScatterChart"===p)n=l,h=eU;else if("BarChart"===p)t=d/2,n={stroke:"none",fill:"#ccc",x:"horizontal"===f?l.x-t:c.left+.5,y:"horizontal"===f?c.top+.5:l.y-t,width:"horizontal"===f?d:c.width-1,height:"horizontal"===f?c.height-1:d},h=j.A;else if("radial"===f){var m=eK(l),g=m.cx,v=m.cy,y=m.radius;n={cx:g,cy:v,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:y,outerRadius:y},h=e$.L}else n={points:function(e,t,n){var r,o,a,i;if("horizontal"===e)a=r=t.x,o=n.top,i=n.top+n.height;else if("vertical"===e)i=o=t.y,r=n.left,a=n.left+n.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return eK(t);var l=t.cx,s=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.angle,f=(0,eP.op)(l,s,c,d),p=(0,eP.op)(l,s,u,d);r=f.x,o=f.y,a=p.x,i=p.y}return[{x:r,y:o},{x:a,y:i}]}(f,l,c)},h=eB.H;var b=eG(eG(eG(eG({stroke:"#ccc",pointerEvents:"none"},c),n),(0,_.L6)(o.props.cursor,!1)),{},{payload:s,payloadIndex:u,className:"recharts-tooltip-cursor"});return(0,r.isValidElement)(o.props.cursor)?(0,r.cloneElement)(o.props.cursor,b):(0,r.createElement)(h,b)}var eQ=["item"],eJ=["children","className","width","height","style","compact","title","desc"];function e0(e){return(e0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e1(){return(e1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function e2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||e7(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e6(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function e4(e,t){return(e4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function e3(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e5(e){return(e5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e8(e){return function(e){if(Array.isArray(e))return e9(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||e7(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e7(e,t){if(e){if("string"==typeof e)return e9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e9(e,t)}}function e9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){tn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tn(e,t,n){return(t=tr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(e){var t=function(e,t){if("object"!==e0(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==e0(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===e0(t)?t:String(t)}var to={xAxis:["bottom","top"],yAxis:["left","right"]},ta={width:"100%",height:"100%"},ti={x:0,y:0};function tl(e){return e}var ts=function(e,t,n,r){var o=t.find(function(e){return e&&e.index===n});if(o){if("horizontal"===e)return{x:o.coordinate,y:r.y};if("vertical"===e)return{x:r.x,y:o.coordinate};if("centric"===e){var a=o.coordinate,i=r.radius;return tt(tt(tt({},r),(0,eP.op)(r.cx,r.cy,i,a)),{},{angle:a,radius:i})}var l=o.coordinate,s=r.angle;return tt(tt(tt({},r),(0,eP.op)(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}return ti},tc=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,o=t.dataEndIndex,a=(null!=n?n:[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(e8(e),e8(n)):e},[]);return a.length>0?a:e&&e.length&&(0,A.hj)(r)&&(0,A.hj)(o)?e.slice(r,o+1):[]};function tu(e){return"number"===e?[0,"auto"]:void 0}var td=function(e,t,n,r){var o=e.graphicalItems,a=e.tooltipAxis,i=tc(t,e);return n<0||!o||!o.length||n>=i.length?null:o.reduce(function(o,l){var s,c,u=null!==(s=l.props.data)&&void 0!==s?s:t;if(u&&e.dataStartIndex+e.dataEndIndex!==0&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),a.dataKey&&!a.allowDuplicatedCategory){var d=void 0===u?i:u;c=(0,A.Ap)(d,a.dataKey,r)}else c=u&&u[n]||i[n];return c?[].concat(e8(o),[(0,T.Qo)(l,c)]):o},[])},tf=function(e,t,n,r){var o=r||{x:e.chartX,y:e.chartY},a="horizontal"===n?o.x:"vertical"===n?o.y:"centric"===n?o.angle:o.radius,i=e.orderedTooltipTicks,l=e.tooltipAxis,s=e.tooltipTicks,c=(0,T.VO)(a,i,s,l);if(c>=0&&s){var u=s[c]&&s[c].value,d=td(e,t,c,u),f=ts(n,i,c,o);return{activeTooltipIndex:c,activeLabel:u,activePayload:d,activeCoordinate:f}}return null},tp=function(e,t){var n=t.axes,r=t.graphicalItems,o=t.axisType,i=t.axisIdKey,l=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,d=e.layout,f=e.children,p=e.stackOffset,h=(0,T.NA)(d,o);return n.reduce(function(t,n){var m=n.props,g=m.type,v=m.dataKey,y=m.allowDataOverflow,b=m.allowDuplicatedCategory,x=m.scale,w=m.ticks,k=m.includeHidden,S=n.props[i];if(t[S])return t;var E=tc(e.data,{graphicalItems:r.filter(function(e){return e.props[i]===S}),dataStartIndex:s,dataEndIndex:u}),O=E.length;(function(e,t,n){if("number"===n&&!0===t&&Array.isArray(e)){var r=null==e?void 0:e[0],o=null==e?void 0:e[1];if(r&&o&&(0,A.hj)(r)&&(0,A.hj)(o))return!0}return!1})(n.props.domain,y,g)&&(_=(0,T.LG)(n.props.domain,null,y),h&&("number"===g||"auto"!==x)&&(N=(0,T.gF)(E,v,"category")));var C=tu(g);if(!_||0===_.length){var j,_,P,N,M,I=null!==(M=n.props.domain)&&void 0!==M?M:C;if(v){if(_=(0,T.gF)(E,v,g),"category"===g&&h){var R=(0,A.bv)(_);b&&R?(P=_,_=c()(0,O)):b||(_=(0,T.ko)(I,_,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(e8(e),[t])},[]))}else if("category"===g)_=b?_.filter(function(e){return""!==e&&!a()(e)}):(0,T.ko)(I,_,n).reduce(function(e,t){return e.indexOf(t)>=0||""===t||a()(t)?e:[].concat(e8(e),[t])},[]);else if("number"===g){var D=(0,T.ZI)(E,r.filter(function(e){return e.props[i]===S&&(k||!e.props.hide)}),v,o,d);D&&(_=D)}h&&("number"===g||"auto"!==x)&&(N=(0,T.gF)(E,v,"category"))}else _=h?c()(0,O):l&&l[S]&&l[S].hasStack&&"number"===g?"expand"===p?[0,1]:(0,T.EB)(l[S].stackGroups,s,u):(0,T.s6)(E,r.filter(function(e){return e.props[i]===S&&(k||!e.props.hide)}),g,d,!0);"number"===g?(_=e_(f,_,S,o,w),I&&(_=(0,T.LG)(I,_,y))):"category"===g&&I&&_.every(function(e){return I.indexOf(e)>=0})&&(_=I)}return tt(tt({},t),{},tn({},S,tt(tt({},n.props),{},{axisType:o,domain:_,categoricalDomain:N,duplicateDomain:P,originalDomain:null!==(j=n.props.domain)&&void 0!==j?j:C,isCategorical:h,layout:d})))},{})},th=function(e,t){var n=t.graphicalItems,r=t.Axis,o=t.axisType,a=t.axisIdKey,i=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,u=e.layout,f=e.children,p=tc(e.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:s}),h=p.length,m=(0,T.NA)(u,o),g=-1;return n.reduce(function(e,t){var v,y=t.props[a],b=tu("number");return e[y]?e:(g++,v=m?c()(0,h):i&&i[y]&&i[y].hasStack?e_(f,v=(0,T.EB)(i[y].stackGroups,l,s),y,o):e_(f,v=(0,T.LG)(b,(0,T.s6)(p,n.filter(function(e){return e.props[a]===y&&!e.props.hide}),"number",u),r.defaultProps.allowDataOverflow),y,o),tt(tt({},e),{},tn({},y,tt(tt({axisType:o},r.defaultProps),{},{hide:!0,orientation:d()(to,"".concat(o,".").concat(g%2),null),domain:v,originalDomain:b,isCategorical:m,layout:u}))))},{})},tm=function(e,t){var n=t.axisType,r=void 0===n?"xAxis":n,o=t.AxisComp,a=t.graphicalItems,i=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,c=e.children,u="".concat(r,"Id"),d=(0,_.NN)(c,o),f={};return d&&d.length?f=tp(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:l,dataEndIndex:s}):a&&a.length&&(f=th(e,{Axis:o,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:l,dataEndIndex:s})),f},tg=function(e){var t=(0,A.Kt)(e),n=(0,T.uY)(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:p()(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:(0,T.zT)(t,n)}},tv=function(e){var t=e.children,n=e.defaultShowTooltip,r=(0,_.sP)(t,Y),o=0,a=0;return e.data&&0!==e.data.length&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(o=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},ty=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},tb=function(e,t){var n=e.props,r=e.graphicalItems,o=e.xAxisMap,a=void 0===o?{}:o,i=e.yAxisMap,l=void 0===i?{}:i,s=n.width,c=n.height,u=n.children,f=n.margin||{},p=(0,_.sP)(u,Y),h=(0,_.sP)(u,O.D),m=Object.keys(l).reduce(function(e,t){var n=l[t],r=n.orientation;return n.mirror||n.hide?e:tt(tt({},e),{},tn({},r,e[r]+n.width))},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return n.mirror||n.hide?e:tt(tt({},e),{},tn({},r,d()(e,"".concat(r))+n.height))},{top:f.top||0,bottom:f.bottom||0}),v=tt(tt({},g),m),y=v.bottom;p&&(v.bottom+=p.props.height||Y.defaultProps.height),h&&t&&(v=(0,T.By)(v,r,n,t));var b=s-v.left-v.right,x=c-v.top-v.bottom;return tt(tt({brushBottom:y},v),{},{width:Math.max(b,0),height:Math.max(x,0)})},tx=function(e){var t,n=e.chartName,o=e.GraphicalChild,i=e.defaultTooltipEventType,s=void 0===i?"axis":i,c=e.validateTooltipEventTypes,u=void 0===c?["axis"]:c,f=e.axisComponents,p=e.legendContent,h=e.formatAxisMap,g=e.defaultProps,y=function(e,t){var n=t.graphicalItems,r=t.stackGroups,o=t.offset,i=t.updateId,l=t.dataStartIndex,s=t.dataEndIndex,c=e.barSize,u=e.layout,d=e.barGap,p=e.barCategoryGap,h=e.maxBarSize,m=ty(u),g=m.numericAxisName,v=m.cateAxisName,y=!!n&&!!n.length&&n.some(function(e){var t=(0,_.Gf)(e&&e.type);return t&&t.indexOf("Bar")>=0})&&(0,T.pt)({barSize:c,stackGroups:r}),b=[];return n.forEach(function(n,c){var m,x=tc(e.data,{graphicalItems:[n],dataStartIndex:l,dataEndIndex:s}),k=n.props,S=k.dataKey,E=k.maxBarSize,O=n.props["".concat(g,"Id")],C=n.props["".concat(v,"Id")],j=f.reduce(function(e,r){var o,a=t["".concat(r.axisType,"Map")],i=n.props["".concat(r.axisType,"Id")];a&&a[i]||"zAxis"===r.axisType||(0,w.Z)(!1);var l=a[i];return tt(tt({},e),{},(tn(o={},r.axisType,l),tn(o,"".concat(r.axisType,"Ticks"),(0,T.uY)(l)),o))},{}),P=j[v],N=j["".concat(v,"Ticks")],A=r&&r[O]&&r[O].hasStack&&(0,T.O3)(n,r[O].stackGroups),M=(0,_.Gf)(n.type).indexOf("Bar")>=0,I=(0,T.zT)(P,N),R=[];if(M){var D,L,Z=a()(E)?h:E,z=null!==(D=null!==(L=(0,T.zT)(P,N,!0))&&void 0!==L?L:Z)&&void 0!==D?D:0;R=(0,T.qz)({barGap:d,barCategoryGap:p,bandSize:z!==I?z:I,sizeList:y[C],maxBarSize:Z}),z!==I&&(R=R.map(function(e){return tt(tt({},e),{},{position:tt(tt({},e.position),{},{offset:e.position.offset-z/2})})}))}var B=n&&n.type&&n.type.getComposedData;B&&b.push({props:tt(tt({},B(tt(tt({},j),{},{displayedData:x,props:e,dataKey:S,item:n,bandSize:I,barPosition:R,offset:o,stackedData:A,layout:u,dataStartIndex:l,dataEndIndex:s}))),{},(tn(m={key:n.key||"item-".concat(c)},g,j[g]),tn(m,v,j[v]),tn(m,"animationId",i),m)),childIndex:(0,_.$R)(n,e.children),item:n})}),b},O=function(e,t){var r=e.props,a=e.dataStartIndex,i=e.dataEndIndex,l=e.updateId;if(!(0,_.TT)({props:r}))return null;var s=r.children,c=r.layout,u=r.stackOffset,d=r.data,p=r.reverseStackOrder,m=ty(c),g=m.numericAxisName,v=m.cateAxisName,b=(0,_.NN)(s,o),x=(0,T.wh)(d,b,"".concat(g,"Id"),"".concat(v,"Id"),u,p),w=f.reduce(function(e,t){var n="".concat(t.axisType,"Map");return tt(tt({},e),{},tn({},n,tm(r,tt(tt({},t),{},{graphicalItems:b,stackGroups:t.axisType===g&&x,dataStartIndex:a,dataEndIndex:i}))))},{}),k=tb(tt(tt({},w),{},{props:r,graphicalItems:b}),null==t?void 0:t.legendBBox);Object.keys(w).forEach(function(e){w[e]=h(r,w[e],k,e.replace("Map",""),n)});var S=tg(w["".concat(v,"Map")]),E=y(r,tt(tt({},w),{},{dataStartIndex:a,dataEndIndex:i,updateId:l,graphicalItems:b,stackGroups:x,offset:k}));return tt(tt({formattedGraphicalItems:E,graphicalItems:b,offset:k,stackGroups:x},S),w)};return t=function(e){(function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&e4(e,t)})(c,e);var t,o,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=e5(c);return e=t?Reflect.construct(n,arguments,e5(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===e0(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return e3(e)}(this,e)});function c(e){var t,o,s;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,c),tn(e3(s=i.call(this,e)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),tn(e3(s),"accessibilityManager",new eZ),tn(e3(s),"handleLegendBBoxUpdate",function(e){if(e){var t=s.state,n=t.dataStartIndex,r=t.dataEndIndex,o=t.updateId;s.setState(tt({legendBBox:e},O({props:s.props,dataStartIndex:n,dataEndIndex:r,updateId:o},tt(tt({},s.state),{},{legendBBox:e}))))}}),tn(e3(s),"handleReceiveSyncEvent",function(e,t,n){s.props.syncId===e&&(n!==s.eventEmitterSymbol||"function"==typeof s.props.syncMethod)&&s.applySyncEvent(t)}),tn(e3(s),"handleBrushChange",function(e){var t=e.startIndex,n=e.endIndex;if(t!==s.state.dataStartIndex||n!==s.state.dataEndIndex){var r=s.state.updateId;s.setState(function(){return tt({dataStartIndex:t,dataEndIndex:n},O({props:s.props,dataStartIndex:t,dataEndIndex:n,updateId:r},s.state))}),s.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),tn(e3(s),"handleMouseEnter",function(e){var t=s.getMouseInfo(e);if(t){var n=tt(tt({},t),{},{isTooltipActive:!0});s.setState(n),s.triggerSyncEvent(n);var r=s.props.onMouseEnter;l()(r)&&r(n,e)}}),tn(e3(s),"triggeredAfterMouseMove",function(e){var t=s.getMouseInfo(e),n=t?tt(tt({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};s.setState(n),s.triggerSyncEvent(n);var r=s.props.onMouseMove;l()(r)&&r(n,e)}),tn(e3(s),"handleItemMouseEnter",function(e){s.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),tn(e3(s),"handleItemMouseLeave",function(){s.setState(function(){return{isTooltipActive:!1}})}),tn(e3(s),"handleMouseMove",function(e){e.persist(),s.throttleTriggeredAfterMouseMove(e)}),tn(e3(s),"handleMouseLeave",function(e){var t={isTooltipActive:!1};s.setState(t),s.triggerSyncEvent(t);var n=s.props.onMouseLeave;l()(n)&&n(t,e)}),tn(e3(s),"handleOuterEvent",function(e){var t,n=(0,_.Bh)(e),r=d()(s.props,"".concat(n));n&&l()(r)&&r(null!==(t=/.*touch.*/i.test(n)?s.getMouseInfo(e.changedTouches[0]):s.getMouseInfo(e))&&void 0!==t?t:{},e)}),tn(e3(s),"handleClick",function(e){var t=s.getMouseInfo(e);if(t){var n=tt(tt({},t),{},{isTooltipActive:!0});s.setState(n),s.triggerSyncEvent(n);var r=s.props.onClick;l()(r)&&r(n,e)}}),tn(e3(s),"handleMouseDown",function(e){var t=s.props.onMouseDown;l()(t)&&t(s.getMouseInfo(e),e)}),tn(e3(s),"handleMouseUp",function(e){var t=s.props.onMouseUp;l()(t)&&t(s.getMouseInfo(e),e)}),tn(e3(s),"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),tn(e3(s),"handleTouchStart",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseDown(e.changedTouches[0])}),tn(e3(s),"handleTouchEnd",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseUp(e.changedTouches[0])}),tn(e3(s),"triggerSyncEvent",function(e){void 0!==s.props.syncId&&eA.emit(eM,s.props.syncId,e,s.eventEmitterSymbol)}),tn(e3(s),"applySyncEvent",function(e){var t=s.props,n=t.layout,r=t.syncMethod,o=s.state.updateId,a=e.dataStartIndex,i=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)s.setState(tt({dataStartIndex:a,dataEndIndex:i},O({props:s.props,dataStartIndex:a,dataEndIndex:i,updateId:o},s.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,c=e.chartY,u=e.activeTooltipIndex,d=s.state,f=d.offset,p=d.tooltipTicks;if(!f)return;if("function"==typeof r)u=r(p,e);else if("value"===r){u=-1;for(var h=0;h<p.length;h++)if(p[h].value===e.activeLabel){u=h;break}}var m=tt(tt({},f),{},{x:f.left,y:f.top}),g=Math.min(l,m.x+m.width),v=Math.min(c,m.y+m.height),y=p[u]&&p[u].value,b=td(s.state,s.props.data,u),x=p[u]?{x:"horizontal"===n?p[u].coordinate:g,y:"horizontal"===n?v:p[u].coordinate}:ti;s.setState(tt(tt({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else s.setState(e)}),tn(e3(s),"renderCursor",function(e){var t,o=s.state,a=o.isTooltipActive,i=o.activeCoordinate,l=o.activePayload,c=o.offset,u=o.activeTooltipIndex,d=o.tooltipAxisBandSize,f=s.getTooltipEventType(),p=null!==(t=e.props.active)&&void 0!==t?t:a,h=s.props.layout,m=e.key||"_recharts-cursor";return r.createElement(eY,{key:m,activeCoordinate:i,activePayload:l,activeTooltipIndex:u,chartName:n,element:e,isActive:p,layout:h,offset:c,tooltipAxisBandSize:d,tooltipEventType:f})}),tn(e3(s),"renderPolarAxis",function(e,t,n){var o=d()(e,"type.axisType"),a=d()(s.state,"".concat(o,"Map")),i=a&&a[e.props["".concat(o,"Id")]];return(0,r.cloneElement)(e,tt(tt({},i),{},{className:o,key:e.key||"".concat(t,"-").concat(n),ticks:(0,T.uY)(i,!0)}))}),tn(e3(s),"renderGrid",function(e){var t=s.state,n=t.xAxisMap,o=t.yAxisMap,a=t.offset,i=(0,A.Kt)(n),l=v()(o,function(e){return b()(e.domain,Number.isFinite)})||(0,A.Kt)(o),c=e.props||{};return(0,r.cloneElement)(e,{key:e.key||"grid",x:(0,A.hj)(c.x)?c.x:a.left,y:(0,A.hj)(c.y)?c.y:a.top,width:(0,A.hj)(c.width)?c.width:a.width,height:(0,A.hj)(c.height)?c.height:a.height,xAxis:i,yAxis:l,verticalCoordinatesGenerator:c.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:c.horizontalCoordinatesGenerator})}),tn(e3(s),"renderPolarGrid",function(e){var t=e.props,n=t.radialLines,o=t.polarAngles,a=t.polarRadius,i=s.state,l=i.radiusAxisMap,c=i.angleAxisMap,u=(0,A.Kt)(l),d=(0,A.Kt)(c),f=d.cx,p=d.cy,h=d.innerRadius,m=d.outerRadius;return(0,r.cloneElement)(e,{polarAngles:Array.isArray(o)?o:(0,T.uY)(d,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:(0,T.uY)(u,!0).map(function(e){return e.coordinate}),cx:f,cy:p,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:n})}),tn(e3(s),"renderLegend",function(){var e=s.state.formattedGraphicalItems,t=s.props,n=t.children,o=t.width,a=t.height,i=s.props.margin||{},l=o-(i.left||0)-(i.right||0),c=(0,J.z)({children:n,formattedGraphicalItems:e,legendWidth:l,legendContent:p});if(!c)return null;var u=c.item,d=e6(c,eQ);return(0,r.cloneElement)(u,tt(tt({},d),{},{chartWidth:o,chartHeight:a,margin:i,onBBoxUpdate:s.handleLegendBBoxUpdate}))}),tn(e3(s),"renderTooltip",function(){var e,t=s.props.children,n=(0,_.sP)(t,E.u);if(!n)return null;var o=s.state,a=o.isTooltipActive,i=o.activeCoordinate,l=o.activePayload,c=o.activeLabel,u=o.offset,d=null!==(e=n.props.active)&&void 0!==e?e:a;return(0,r.cloneElement)(n,{viewBox:tt(tt({},u),{},{x:u.left,y:u.top}),active:d,label:c,payload:d?l:[],coordinate:i})}),tn(e3(s),"renderBrush",function(e){var t=s.props,n=t.margin,o=t.data,a=s.state,i=a.offset,l=a.dataStartIndex,c=a.dataEndIndex,u=a.updateId;return(0,r.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:(0,T.DO)(s.handleBrushChange,e.props.onChange),data:o,x:(0,A.hj)(e.props.x)?e.props.x:i.left,y:(0,A.hj)(e.props.y)?e.props.y:i.top+i.height+i.brushBottom-(n.bottom||0),width:(0,A.hj)(e.props.width)?e.props.width:i.width,startIndex:l,endIndex:c,updateId:"brush-".concat(u)})}),tn(e3(s),"renderReferenceElement",function(e,t,n){if(!e)return null;var o=e3(s).clipPathId,a=s.state,i=a.xAxisMap,l=a.yAxisMap,c=a.offset,u=e.props,d=u.xAxisId,f=u.yAxisId;return(0,r.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(n),xAxis:i[d],yAxis:l[f],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:o})}),tn(e3(s),"renderActivePoints",function(e){var t=e.item,n=e.activePoint,r=e.basePoint,o=e.childIndex,a=e.isRange,i=[],l=t.props.key,s=t.item.props,u=s.activeDot,d=tt(tt({index:o,dataKey:s.dataKey,cx:n.x,cy:n.y,r:4,fill:(0,T.fk)(t.item),strokeWidth:2,stroke:"#fff",payload:n.payload,value:n.value,key:"".concat(l,"-activePoint-").concat(o)},(0,_.L6)(u,!1)),(0,eI.Ym)(u));return i.push(c.renderActiveDot(u,d)),r?i.push(c.renderActiveDot(u,tt(tt({},d),{},{cx:r.x,cy:r.y,key:"".concat(l,"-basePoint-").concat(o)}))):a&&i.push(null),i}),tn(e3(s),"renderGraphicChild",function(e,t,n){var o=s.filterFormatItem(e,t,n);if(!o)return null;var i=s.getTooltipEventType(),l=s.state,c=l.isTooltipActive,u=l.tooltipAxis,d=l.activeTooltipIndex,f=l.activeLabel,p=s.props.children,h=(0,_.sP)(p,E.u),m=o.props,g=m.points,v=m.isRange,y=m.baseLine,b=o.item.props,x=b.activeDot,w=b.hide,k=b.activeBar,S=b.activeShape,O={};"axis"!==i&&h&&"click"===h.props.trigger?O={onClick:(0,T.DO)(s.handleItemMouseEnter,e.props.onClick)}:"axis"!==i&&(O={onMouseLeave:(0,T.DO)(s.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:(0,T.DO)(s.handleItemMouseEnter,e.props.onMouseEnter)});var C=(0,r.cloneElement)(e,tt(tt({},o.props),O));if(!w&&c&&h&&(x||k||S)){if(d>=0){if(u.dataKey&&!u.allowDuplicatedCategory){var j="function"==typeof u.dataKey?function(e){return"function"==typeof u.dataKey?u.dataKey(e.payload):null}:"payload.".concat(u.dataKey.toString());N=(0,A.Ap)(g,j,f),M=v&&y&&(0,A.Ap)(y,j,f)}else N=null==g?void 0:g[d],M=v&&y&&y[d];if(S||k){var P=void 0!==e.props.activeIndex?e.props.activeIndex:d;return[(0,r.cloneElement)(e,tt(tt(tt({},o.props),O),{},{activeIndex:P})),null,null]}if(!a()(N))return[C].concat(e8(s.renderActivePoints({item:o,activePoint:N,basePoint:M,childIndex:d,isRange:v})))}else{var N,M,I,R=(null!==(I=s.getItemByXY(s.state.activeCoordinate))&&void 0!==I?I:{graphicalItem:C}).graphicalItem,D=R.item,L=void 0===D?e:D,Z=R.childIndex,z=tt(tt(tt({},o.props),O),{},{activeIndex:Z});return[(0,r.cloneElement)(L,z),null,null]}}return v?[C,null,null]:[C,null]}),tn(e3(s),"renderCustomized",function(e,t,n){return(0,r.cloneElement)(e,tt(tt({key:"recharts-customized-".concat(n)},s.props),s.state))}),tn(e3(s),"renderMap",{CartesianGrid:{handler:s.renderGrid,once:!0},ReferenceArea:{handler:s.renderReferenceElement},ReferenceLine:{handler:tl},ReferenceDot:{handler:s.renderReferenceElement},XAxis:{handler:tl},YAxis:{handler:tl},Brush:{handler:s.renderBrush,once:!0},Bar:{handler:s.renderGraphicChild},Line:{handler:s.renderGraphicChild},Area:{handler:s.renderGraphicChild},Radar:{handler:s.renderGraphicChild},RadialBar:{handler:s.renderGraphicChild},Scatter:{handler:s.renderGraphicChild},Pie:{handler:s.renderGraphicChild},Funnel:{handler:s.renderGraphicChild},Tooltip:{handler:s.renderCursor,once:!0},PolarGrid:{handler:s.renderPolarGrid,once:!0},PolarAngleAxis:{handler:s.renderPolarAxis},PolarRadiusAxis:{handler:s.renderPolarAxis},Customized:{handler:s.renderCustomized}}),s.clipPathId="".concat(null!==(t=e.id)&&void 0!==t?t:(0,A.EL)("recharts"),"-clip"),s.throttleTriggeredAfterMouseMove=m()(s.triggeredAfterMouseMove,null!==(o=e.throttleDelay)&&void 0!==o?o:1e3/60),s.state={},s}return o=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,o=e.layout,a=(0,_.sP)(t,E.u);if(a){var i=a.props.defaultIndex;if("number"==typeof i&&!(i<0)&&!(i>this.state.tooltipTicks.length)){var l=this.state.tooltipTicks[i]&&this.state.tooltipTicks[i].value,s=td(this.state,n,i,l),c=this.state.tooltipTicks[i].coordinate,u=(this.state.offset.top+r)/2,d="horizontal"===o?{x:c,y:u}:{y:c,x:u},f=this.state.formattedGraphicalItems.find(function(e){return"Scatter"===e.item.type.name});f&&(d=tt(tt({},d),f.props.points[i].tooltipPosition),s=f.props.points[i].tooltipPayload);var p={activeTooltipIndex:i,isTooltipActive:!0,activeLabel:l,activePayload:s,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(i)}}}},{key:"getSnapshotBeforeUpdate",value:function(e,t){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin){var n,r;this.accessibilityManager.setDetails({offset:{left:null!==(n=this.props.margin.left)&&void 0!==n?n:0,top:null!==(r=this.props.margin.top)&&void 0!==r?r:0}})}return null}},{key:"componentDidUpdate",value:function(e){(0,_.rL)([(0,_.sP)(e.children,E.u)],[(0,_.sP)(this.props.children,E.u)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=(0,_.sP)(this.props.children,E.u);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return u.indexOf(t)>=0?t:s}return s}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=(0,Q.os)(n),o={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,i=this.inRange(o.chartX,o.chartY,a);if(!i)return null;var l=this.state,s=l.xAxisMap,c=l.yAxisMap;if("axis"!==this.getTooltipEventType()&&s&&c){var u=(0,A.Kt)(s).scale,d=(0,A.Kt)(c).scale,f=u&&u.invert?u.invert(o.chartX):null,p=d&&d.invert?d.invert(o.chartY):null;return tt(tt({},o),{},{xValue:f,yValue:p})}var h=tf(this.state,this.props.data,this.props.layout,i);return h?tt(tt({},o),h):null}},{key:"inRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.props.layout,o=e/n,a=t/n;if("horizontal"===r||"vertical"===r){var i=this.state.offset;return o>=i.left&&o<=i.left+i.width&&a>=i.top&&a<=i.top+i.height?{x:o,y:a}:null}var l=this.state,s=l.angleAxisMap,c=l.radiusAxisMap;if(s&&c){var u=(0,A.Kt)(s);return(0,eP.z3)({x:o,y:a},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=(0,_.sP)(e,E.u),r={};return n&&"axis"===t&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),tt(tt({},(0,eI.Ym)(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){eA.on(eM,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eA.removeListener(eM,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,o=0,a=r.length;o<a;o++){var i=r[o];if(i.item===e||i.props.key===e.key||t===(0,_.Gf)(i.item.type)&&n===i.childIndex)return i}return null}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,o=t.top,a=t.height,i=t.width;return r.createElement("defs",null,r.createElement("clipPath",{id:e},r.createElement("rect",{x:n,y:o,height:a,width:i})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e2(t,2),r=n[0],o=n[1];return tt(tt({},e),{},tn({},r,o.scale))},{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e2(t,2),r=n[0],o=n[1];return tt(tt({},e),{},tn({},r,o.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var o=0,a=n.length;o<a;o++){var i=n[o],l=i.props,s=i.item,c=(0,_.Gf)(s.type);if("Bar"===c){var u=(l.data||[]).find(function(t){return(0,j.X)(e,t)});if(u)return{graphicalItem:i,payload:u}}else if("RadialBar"===c){var d=(l.data||[]).find(function(t){return(0,eP.z3)(e,t)});if(d)return{graphicalItem:i,payload:d}}else if((0,ez.lT)(i,r)||(0,ez.V$)(i,r)||(0,ez.w7)(i,r)){var f=(0,ez.a3)({graphicalItem:i,activeTooltipItem:r,itemData:s.props.data}),p=void 0===s.props.activeIndex?f:s.props.activeIndex;return{graphicalItem:tt(tt({},i),{},{childIndex:p}),payload:(0,ez.w7)(i,r)?s.props.data[f]:i.props.data[f]}}}return null}},{key:"render",value:function(){var e,t,n=this;if(!(0,_.TT)(this))return null;var o=this.props,a=o.children,i=o.className,l=o.width,s=o.height,c=o.style,u=o.compact,d=o.title,f=o.desc,p=e6(o,eJ),h=(0,_.L6)(p,!1);if(u)return r.createElement(k.T,e1({},h,{width:l,height:s,title:d,desc:f}),this.renderClipPath(),(0,_.eu)(a,this.renderMap));this.props.accessibilityLayer&&(h.tabIndex=null!==(e=this.props.tabIndex)&&void 0!==e?e:0,h.role=null!==(t=this.props.role)&&void 0!==t?t:"img",h.onKeyDown=function(e){n.accessibilityManager.keyboardEvent(e)},h.onFocus=function(){n.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return r.createElement(ef.br,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},r.createElement("div",e1({className:(0,x.Z)("recharts-wrapper",i),style:tt({position:"relative",cursor:"default",width:l,height:s},c)},m,{ref:function(e){n.container=e},role:"region"}),r.createElement(k.T,e1({},h,{width:l,height:s,title:d,desc:f,style:ta}),this.renderClipPath(),(0,_.eu)(a,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tr(r.key),r)}}(c.prototype,o),Object.defineProperty(c,"prototype",{writable:!1}),c}(r.Component),tn(t,"displayName",n),tn(t,"defaultProps",tt({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},g)),tn(t,"getDerivedStateFromProps",function(e,t){var n=e.dataKey,r=e.data,o=e.children,i=e.width,l=e.height,s=e.layout,c=e.stackOffset,u=e.margin,d=t.dataStartIndex,f=t.dataEndIndex;if(void 0===t.updateId){var p=tv(e);return tt(tt(tt({},p),{},{updateId:0},O(tt(tt({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:i,prevHeight:l,prevLayout:s,prevStackOffset:c,prevMargin:u,prevChildren:o})}if(n!==t.prevDataKey||r!==t.prevData||i!==t.prevWidth||l!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!(0,eN.w)(u,t.prevMargin)){var h=tv(e),m={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=tt(tt({},tf(t,r,s)),{},{updateId:t.updateId+1}),v=tt(tt(tt({},h),m),g);return tt(tt(tt({},v),O(tt({props:e},v),t)),{},{prevDataKey:n,prevData:r,prevWidth:i,prevHeight:l,prevLayout:s,prevStackOffset:c,prevMargin:u,prevChildren:o})}if(!(0,_.rL)(o,t.prevChildren)){var y,b,x,w,k=(0,_.sP)(o,Y),S=k&&null!==(y=null===(b=k.props)||void 0===b?void 0:b.startIndex)&&void 0!==y?y:d,E=k&&null!==(x=null===(w=k.props)||void 0===w?void 0:w.endIndex)&&void 0!==x?x:f,C=a()(r)||S!==d||E!==f?t.updateId+1:t.updateId;return tt(tt({updateId:C},O(tt(tt({props:e},t),{},{updateId:C,dataStartIndex:S,dataEndIndex:E}),t)),{},{prevChildren:o,dataStartIndex:S,dataEndIndex:E})}return null}),tn(t,"renderActiveDot",function(e,t){var n;return n=(0,r.isValidElement)(e)?(0,r.cloneElement)(e,t):l()(e)?e(t):r.createElement(C.o,t),r.createElement(S.m,{className:"recharts-active-dot",key:t.key},n)}),t}},20407:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});var r=function(e){return null};r.displayName="Cell"},26680:function(e,t,n){"use strict";n.d(t,{_:function(){return O}});var r=n(2265),o=n(77571),a=n.n(o),i=n(86757),l=n.n(i),s=n(28302),c=n.n(s),u=n(87602),d=n(58811),f=n(82944),p=n(16630),h=n(39206);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var g=["offset"];function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var w=function(e){var t=e.value,n=e.formatter,r=a()(e.children)?t:e.children;return l()(n)?n(r):r},k=function(e,t,n){var o,i,l=e.position,s=e.viewBox,c=e.offset,d=e.className,f=s.cx,m=s.cy,g=s.innerRadius,v=s.outerRadius,y=s.startAngle,b=s.endAngle,w=s.clockWise,k=(g+v)/2,S=(0,p.uY)(b-y)*Math.min(Math.abs(b-y),360),E=S>=0?1:-1;"insideStart"===l?(o=y+E*c,i=w):"insideEnd"===l?(o=b-E*c,i=!w):"end"===l&&(o=b+E*c,i=w),i=S<=0?i:!i;var O=(0,h.op)(f,m,k,o),C=(0,h.op)(f,m,k,o+(i?1:-1)*359),j="M".concat(O.x,",").concat(O.y,"\n A").concat(k,",").concat(k,",0,1,").concat(i?0:1,",\n ").concat(C.x,",").concat(C.y),_=a()(e.id)?(0,p.EL)("recharts-radial-line-"):e.id;return r.createElement("text",x({},n,{dominantBaseline:"central",className:(0,u.Z)("recharts-radial-bar-label",d)}),r.createElement("defs",null,r.createElement("path",{id:_,d:j})),r.createElement("textPath",{xlinkHref:"#".concat(_)},t))},S=function(e){var t=e.viewBox,n=e.offset,r=e.position,o=t.cx,a=t.cy,i=t.innerRadius,l=t.outerRadius,s=(t.startAngle+t.endAngle)/2;if("outside"===r){var c=(0,h.op)(o,a,l+n,s),u=c.x;return{x:u,y:c.y,textAnchor:u>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var d=(0,h.op)(o,a,(i+l)/2,s);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}},E=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,o=e.position,a=t.x,i=t.y,l=t.width,s=t.height,u=s>=0?1:-1,d=u*r,f=u>0?"end":"start",h=u>0?"start":"end",m=l>=0?1:-1,g=m*r,v=m>0?"end":"start",y=m>0?"start":"end";if("top"===o)return b(b({},{x:a+l/2,y:i-u*r,textAnchor:"middle",verticalAnchor:f}),n?{height:Math.max(i-n.y,0),width:l}:{});if("bottom"===o)return b(b({},{x:a+l/2,y:i+s+d,textAnchor:"middle",verticalAnchor:h}),n?{height:Math.max(n.y+n.height-(i+s),0),width:l}:{});if("left"===o){var x={x:a-g,y:i+s/2,textAnchor:v,verticalAnchor:"middle"};return b(b({},x),n?{width:Math.max(x.x-n.x,0),height:s}:{})}if("right"===o){var w={x:a+l+g,y:i+s/2,textAnchor:y,verticalAnchor:"middle"};return b(b({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:s}:{})}var k=n?{width:l,height:s}:{};return"insideLeft"===o?b({x:a+g,y:i+s/2,textAnchor:y,verticalAnchor:"middle"},k):"insideRight"===o?b({x:a+l-g,y:i+s/2,textAnchor:v,verticalAnchor:"middle"},k):"insideTop"===o?b({x:a+l/2,y:i+d,textAnchor:"middle",verticalAnchor:h},k):"insideBottom"===o?b({x:a+l/2,y:i+s-d,textAnchor:"middle",verticalAnchor:f},k):"insideTopLeft"===o?b({x:a+g,y:i+d,textAnchor:y,verticalAnchor:h},k):"insideTopRight"===o?b({x:a+l-g,y:i+d,textAnchor:v,verticalAnchor:h},k):"insideBottomLeft"===o?b({x:a+g,y:i+s-d,textAnchor:y,verticalAnchor:f},k):"insideBottomRight"===o?b({x:a+l-g,y:i+s-d,textAnchor:v,verticalAnchor:f},k):c()(o)&&((0,p.hj)(o.x)||(0,p.hU)(o.x))&&((0,p.hj)(o.y)||(0,p.hU)(o.y))?b({x:a+(0,p.h1)(o.x,l),y:i+(0,p.h1)(o.y,s),textAnchor:"end",verticalAnchor:"end"},k):b({x:a+l/2,y:i+s/2,textAnchor:"middle",verticalAnchor:"middle"},k)};function O(e){var t,n=e.offset,o=b({offset:void 0===n?5:n},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,g)),i=o.viewBox,s=o.position,c=o.value,h=o.children,m=o.content,v=o.className,y=o.textBreakAll;if(!i||a()(c)&&a()(h)&&!(0,r.isValidElement)(m)&&!l()(m))return null;if((0,r.isValidElement)(m))return(0,r.cloneElement)(m,o);if(l()(m)){if(t=(0,r.createElement)(m,o),(0,r.isValidElement)(t))return t}else t=w(o);var O="cx"in i&&(0,p.hj)(i.cx),C=(0,f.L6)(o,!0);if(O&&("insideStart"===s||"insideEnd"===s||"end"===s))return k(o,t,C);var j=O?S(o):E(o);return r.createElement(d.x,x({className:(0,u.Z)("recharts-label",void 0===v?"":v)},C,j,{breakAll:y}),t)}O.displayName="Label";var C=function(e){var t=e.cx,n=e.cy,r=e.angle,o=e.startAngle,a=e.endAngle,i=e.r,l=e.radius,s=e.innerRadius,c=e.outerRadius,u=e.x,d=e.y,f=e.top,h=e.left,m=e.width,g=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if((0,p.hj)(m)&&(0,p.hj)(g)){if((0,p.hj)(u)&&(0,p.hj)(d))return{x:u,y:d,width:m,height:g};if((0,p.hj)(f)&&(0,p.hj)(h))return{x:f,y:h,width:m,height:g}}return(0,p.hj)(u)&&(0,p.hj)(d)?{x:u,y:d,width:0,height:0}:(0,p.hj)(t)&&(0,p.hj)(n)?{cx:t,cy:n,startAngle:o||r||0,endAngle:a||r||0,innerRadius:s||0,outerRadius:c||l||i||0,clockWise:v}:e.viewBox?e.viewBox:{}};O.parseViewBox=C,O.renderCallByParent=function(e,t){var n,o,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&a&&!e.label)return null;var i=e.children,s=C(e),u=(0,f.NN)(i,O).map(function(e,n){return(0,r.cloneElement)(e,{viewBox:t||s,key:"label-".concat(n)})});return a?[(n=e.label,o=t||s,n?!0===n?r.createElement(O,{key:"label-implicit",viewBox:o}):(0,p.P2)(n)?r.createElement(O,{key:"label-implicit",viewBox:o,value:n}):(0,r.isValidElement)(n)?n.type===O?(0,r.cloneElement)(n,{key:"label-implicit",viewBox:o}):r.createElement(O,{key:"label-implicit",content:n,viewBox:o}):l()(n)?r.createElement(O,{key:"label-implicit",content:n,viewBox:o}):c()(n)?r.createElement(O,x({viewBox:o},n,{key:"label-implicit"})):null:null)].concat(function(e){if(Array.isArray(e))return v(e)}(u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,void 0)}}(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):u}},58772:function(e,t,n){"use strict";n.d(t,{e:function(){return O}});var r=n(2265),o=n(77571),a=n.n(o),i=n(28302),l=n.n(i),s=n(86757),c=n.n(s),u=n(86185),d=n.n(u),f=n(26680),p=n(9841),h=n(82944),m=n(85355);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var v=["valueAccessor"],y=["data","dataKey","clockWise","id","textBreakAll"];function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var E=function(e){return Array.isArray(e.value)?d()(e.value):e.value};function O(e){var t=e.valueAccessor,n=void 0===t?E:t,o=S(e,v),i=o.data,l=o.dataKey,s=o.clockWise,c=o.id,u=o.textBreakAll,d=S(o,y);return i&&i.length?r.createElement(p.m,{className:"recharts-label-list"},i.map(function(e,t){var o=a()(l)?n(e,t):(0,m.F$)(e&&e.payload,l),i=a()(c)?{}:{id:"".concat(c,"-").concat(t)};return r.createElement(f._,x({},(0,h.L6)(e,!0),d,i,{parentViewBox:e.parentViewBox,value:o,textBreakAll:u,viewBox:f._.parseViewBox(a()(s)?e:k(k({},e),{},{clockWise:s})),key:"label-".concat(t),index:t}))})):null}O.displayName="LabelList",O.renderCallByParent=function(e,t){var n,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&o&&!e.label)return null;var a=e.children,i=(0,h.NN)(a,O).map(function(e,n){return(0,r.cloneElement)(e,{data:t,key:"labelList-".concat(n)})});return o?[(n=e.label)?!0===n?r.createElement(O,{key:"labelList-implicit",data:t}):r.isValidElement(n)||c()(n)?r.createElement(O,{key:"labelList-implicit",data:t,content:n}):l()(n)?r.createElement(O,x({data:t},n,{key:"labelList-implicit"})):null:null].concat(function(e){if(Array.isArray(e))return b(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return b(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,void 0)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i}},22190:function(e,t,n){"use strict";n.d(t,{D:function(){return A}});var r=n(2265),o=n(86757),a=n.n(o),i=n(87602),l=n(1175),s=n(48777),c=n(14870),u=n(41637);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(){return(f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(y,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=m(y);return e=t?Reflect.construct(n,arguments,m(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function y(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,y),o.apply(this,arguments)}return n=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,n=32/6,o=32/3,a=e.inactive?t:e.color;if("plainline"===e.type)return r.createElement("line",{strokeWidth:4,fill:"none",stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:16,x2:32,y2:16,className:"recharts-legend-icon"});if("line"===e.type)return r.createElement("path",{strokeWidth:4,fill:"none",stroke:a,d:"M0,".concat(16,"h").concat(o,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*o,",").concat(16,"\n H").concat(32,"M").concat(2*o,",").concat(16,"\n A").concat(n,",").concat(n,",0,1,1,").concat(o,",").concat(16),className:"recharts-legend-icon"});if("rect"===e.type)return r.createElement("path",{stroke:"none",fill:a,d:"M0,".concat(4,"h").concat(32,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(r.isValidElement(e.legendIcon)){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);return delete i.legendIcon,r.cloneElement(e.legendIcon,i)}return r.createElement(c.v,{fill:a,cx:16,cy:16,size:32,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,n=t.payload,o=t.iconSize,c=t.layout,d=t.formatter,p=t.inactiveColor,h={x:0,y:0,width:32,height:32},m={display:"horizontal"===c?"inline-block":"block",marginRight:10},v={display:"inline-block",verticalAlign:"middle",marginRight:4};return n.map(function(t,n){var c,y=t.formatter||d,b=(0,i.Z)((g(c={"recharts-legend-item":!0},"legend-item-".concat(n),!0),g(c,"inactive",t.inactive),c));if("none"===t.type)return null;var x=a()(t.value)?null:t.value;(0,l.Z)(!a()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var w=t.inactive?p:t.color;return r.createElement("li",f({className:b,style:m,key:"legend-item-".concat(n)},(0,u.bw)(e.props,t,n)),r.createElement(s.T,{width:o,height:o,viewBox:h,style:v},e.renderIcon(t)),r.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},y?y(x,t,n):x))})}},{key:"render",value:function(){var e=this.props,t=e.payload,n=e.layout,o=e.align;return t&&t.length?r.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===n?o:"left"}},this.renderItems()):null}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}(y.prototype,n),Object.defineProperty(y,"prototype",{writable:!1}),y}(r.PureComponent);g(y,"displayName","Legend"),g(y,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var b=n(16630),x=n(93528);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k=["ref"];function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N(r.key),r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){var t=function(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===w(t)?t:String(t)}function T(e){return e.value}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(i,e);var t,n,o,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=_(i);return e=t?Reflect.construct(n,arguments,_(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return j(e)}(this,e)});function i(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return P(j(e=a.call.apply(a,[this].concat(n))),"lastBoundingBox",{width:-1,height:-1}),e}return n=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){return this.wrapperNode&&this.wrapperNode.getBoundingClientRect?this.wrapperNode.getBoundingClientRect():null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var t=this.wrapperNode.getBoundingClientRect();(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t))}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?E({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,n,r=this.props,o=r.layout,a=r.align,i=r.verticalAlign,l=r.margin,s=r.chartWidth,c=r.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===a&&"vertical"===o?{left:((s||0)-this.getBBoxSnapshot().width)/2}:"right"===a?{right:l&&l.right||0}:{left:l&&l.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(n="middle"===i?{top:((c||0)-this.getBBoxSnapshot().height)/2}:"bottom"===i?{bottom:l&&l.bottom||0}:{top:l&&l.top||0}),E(E({},t),n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.content,o=t.width,a=t.height,i=t.wrapperStyle,l=t.payloadUniqBy,s=t.payload,c=E(E({position:"absolute",width:o||"auto",height:a||"auto"},this.getDefaultPosition(i)),i);return r.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(t){e.wrapperNode=t}},function(e,t){if(r.isValidElement(e))return r.cloneElement(e,t);if("function"==typeof e)return r.createElement(e,t);t.ref;var n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,k);return r.createElement(y,n)}(n,E(E({},this.props),{},{payload:(0,x.z)(s,l,T)})))}}],o=[{key:"getWithHeight",value:function(e,t){var n=e.props.layout;return"vertical"===n&&(0,b.hj)(e.props.height)?{height:e.props.height}:"horizontal"===n?{width:e.props.width||t}:null}}],n&&O(i.prototype,n),o&&O(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}(r.PureComponent);P(A,"displayName","Legend"),P(A,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"})},47625:function(e,t,n){"use strict";n.d(t,{h:function(){return m}});var r=n(87602),o=n(2265),a=n(37065),i=n.n(a),l=n(82558),s=n(16630),c=n(1175),u=n(82944);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m=(0,o.forwardRef)(function(e,t){var n,a=e.aspect,d=e.initialDimension,f=void 0===d?{width:-1,height:-1}:d,m=e.width,g=void 0===m?"100%":m,v=e.height,y=void 0===v?"100%":v,b=e.minWidth,x=void 0===b?0:b,w=e.minHeight,k=e.maxHeight,S=e.children,E=e.debounce,O=void 0===E?0:E,C=e.id,j=e.className,_=e.onResize,P=e.style,N=(0,o.useRef)(null),T=(0,o.useRef)();T.current=_,(0,o.useImperativeHandle)(t,function(){return Object.assign(N.current,{get current(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current}})});var A=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)({containerWidth:f.width,containerHeight:f.height}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(n,2)||function(e,t){if(e){if("string"==typeof e)return h(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),M=A[0],I=A[1],R=(0,o.useCallback)(function(e,t){I(function(n){var r=Math.round(e),o=Math.round(t);return n.containerWidth===r&&n.containerHeight===o?n:{containerWidth:r,containerHeight:o}})},[]);(0,o.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,o=n.height;R(r,o),null===(t=T.current)||void 0===t||t.call(T,r,o)};O>0&&(e=i()(e,O,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=N.current.getBoundingClientRect();return R(n.width,n.height),t.observe(N.current),function(){t.disconnect()}},[R,O]);var D=(0,o.useMemo)(function(){var e=M.containerWidth,t=M.containerHeight;if(e<0||t<0)return null;(0,c.Z)((0,s.hU)(g)||(0,s.hU)(y),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",g,y),(0,c.Z)(!a||a>0,"The aspect(%s) must be greater than zero.",a);var n=(0,s.hU)(g)?e:g,r=(0,s.hU)(y)?t:y;a&&a>0&&(n?r=n/a:r&&(n=r*a),k&&r>k&&(r=k)),(0,c.Z)(n>0||r>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,r,g,y,x,w,a);var i=!Array.isArray(S)&&(0,l.isElement)(S)&&(0,u.Gf)(S.type).endsWith("Chart");return o.Children.map(S,function(e){return(0,l.isElement)(e)?(0,o.cloneElement)(e,p({width:n,height:r},i?{style:p({height:"100%",width:"100%",maxHeight:r,maxWidth:n},e.props.style)}:{})):e})},[a,S,y,k,w,x,M,g]);return o.createElement("div",{id:C?"".concat(C):void 0,className:(0,r.Z)("recharts-responsive-container",j),style:p(p({},void 0===P?{}:P),{},{width:g,height:y,minWidth:x,minHeight:w,maxHeight:k}),ref:N},D)})},58811:function(e,t,n){"use strict";n.d(t,{x:function(){return L}});var r=n(2265),o=n(77571),a=n.n(o),i=n(87602),l=n(16630),s=n(34067),c=n(82944),u=n(4094);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r.key),r)}}var m=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,g=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,v=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,y=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,b={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},x=Object.keys(b),w=function(){var e,t;function n(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this.num=e,this.unit=t,this.num=e,this.unit=t,Number.isNaN(e)&&(this.unit=""),""===t||v.test(t)||(this.num=NaN,this.unit=""),x.includes(t)&&(this.num=e*b[t],this.unit="px")}return e=[{key:"add",value:function(e){return this.unit!==e.unit?new n(NaN,""):new n(this.num+e.num,this.unit)}},{key:"subtract",value:function(e){return this.unit!==e.unit?new n(NaN,""):new n(this.num-e.num,this.unit)}},{key:"multiply",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(NaN,""):new n(this.num*e.num,this.unit||e.unit)}},{key:"divide",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(NaN,""):new n(this.num/e.num,this.unit||e.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],t=[{key:"parse",value:function(e){var t,r=f(null!==(t=y.exec(e))&&void 0!==t?t:[],3),o=r[1],a=r[2];return new n(parseFloat(o),null!=a?a:"")}}],e&&h(n.prototype,e),t&&h(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();function k(e){if(e.includes("NaN"))return"NaN";for(var t=e;t.includes("*")||t.includes("/");){var n,r=f(null!==(n=m.exec(t))&&void 0!==n?n:[],4),o=r[1],a=r[2],i=r[3],l=w.parse(null!=o?o:""),s=w.parse(null!=i?i:""),c="*"===a?l.multiply(s):l.divide(s);if(c.isNaN())return"NaN";t=t.replace(m,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,d=f(null!==(u=g.exec(t))&&void 0!==u?u:[],4),p=d[1],h=d[2],v=d[3],y=w.parse(null!=p?p:""),b=w.parse(null!=v?v:""),x="+"===h?y.add(b):y.subtract(b);if(x.isNaN())return"NaN";t=t.replace(g,x.toString())}return t}var S=/\(([^()]*)\)/;function E(e){var t=function(e){try{var t;return t=e.replace(/\s+/g,""),t=function(e){for(var t=e;t.includes("(");){var n=f(S.exec(t),2)[1];t=t.replace(S,k(n))}return t}(t),t=k(t)}catch(e){return"NaN"}}(e.slice(5,-1));return"NaN"===t?"":t}var O=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],C=["dx","dy","angle","className","breakAll"];function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var T=/[ \f\n\r\t\v\u2028\u2029]+/,A=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var o=[];a()(t)||(o=n?t.toString().split(""):t.toString().split(T));var i=o.map(function(e){return{word:e,width:(0,u.xE)(e,r).width}}),l=n?0:(0,u.xE)("\xa0",r).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch(e){return null}},M=function(e,t,n,r,o){var a,i=e.maxLines,s=e.children,c=e.style,u=e.breakAll,d=(0,l.hj)(i),f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(function(e,t){var a=t.word,i=t.width,l=e[e.length-1];return l&&(null==r||o||l.width+i+n<Number(r))?(l.words.push(a),l.width+=i+n):e.push({words:[a],width:i}),e},[])},p=f(t);if(!d)return p;for(var h=function(e){var t=f(A({breakAll:u,style:c,children:s.slice(0,e)+"…"}).wordsWithComputedWidth);return[t.length>i||t.reduce(function(e,t){return e.width>t.width?e:t}).width>Number(r),t]},m=0,g=s.length-1,v=0;m<=g&&v<=s.length-1;){var y=Math.floor((m+g)/2),b=P(h(y-1),2),x=b[0],w=b[1],k=P(h(y),1)[0];if(x||k||(m=y+1),x&&k&&(g=y-1),!x&&k){a=w;break}v++}return a||p},I=function(e){return[{words:a()(e)?[]:e.toString().split(T)}]},R=function(e){var t=e.width,n=e.scaleToFit,r=e.children,o=e.style,a=e.breakAll,i=e.maxLines;if((t||n)&&!s.x.isSsr){var l=A({breakAll:a,children:r,style:o});return l?M({breakAll:a,children:r,maxLines:i,style:o},l.wordsWithComputedWidth,l.spaceWidth,t,n):I(r)}return I(r)},D="#808080",L=function(e){var t,n=e.x,o=void 0===n?0:n,a=e.y,s=void 0===a?0:a,u=e.lineHeight,d=void 0===u?"1em":u,f=e.capHeight,p=void 0===f?"0.71em":f,h=e.scaleToFit,m=void 0!==h&&h,g=e.textAnchor,v=e.verticalAnchor,y=e.fill,b=void 0===y?D:y,x=_(e,O),w=(0,r.useMemo)(function(){return R({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:m,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,m,x.style,x.width]),k=x.dx,S=x.dy,P=x.angle,N=x.className,T=x.breakAll,A=_(x,C);if(!(0,l.P2)(o)||!(0,l.P2)(s))return null;var M=o+((0,l.hj)(k)?k:0),I=s+((0,l.hj)(S)?S:0);switch(void 0===v?"end":v){case"start":t=E("calc(".concat(p,")"));break;case"middle":t=E("calc(".concat((w.length-1)/2," * -").concat(d," + (").concat(p," / 2))"));break;default:t=E("calc(".concat(w.length-1," * -").concat(d,")"))}var L=[];if(m){var Z=w[0].width,z=x.width;L.push("scale(".concat(((0,l.hj)(z)?z/Z:1)/Z,")"))}return P&&L.push("rotate(".concat(P,", ").concat(M,", ").concat(I,")")),L.length&&(A.transform=L.join(" ")),r.createElement("text",j({},(0,c.L6)(A,!0),{x:M,y:I,className:(0,i.Z)("recharts-text",N),textAnchor:void 0===g?"start":g,fill:b.includes("url")?D:b}),w.map(function(e,n){var o=e.words.join(T?"":" ");return r.createElement("tspan",{x:M,dy:0===n?t:d,key:o},o)}))}},8147:function(e,t,n){"use strict";n.d(t,{u:function(){return F}});var r=n(2265),o=n(34935),a=n.n(o),i=n(77571),l=n.n(i),s=n(87602),c=n(16630);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==u(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===u(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e){return Array.isArray(e)&&(0,c.P2)(e[0])&&(0,c.P2)(e[1])?e.join(" ~ "):e}var m=function(e){var t=e.separator,n=void 0===t?" : ":t,o=e.contentStyle,i=e.itemStyle,u=void 0===i?{}:i,f=e.labelStyle,m=e.payload,g=e.formatter,v=e.itemSorter,y=e.wrapperClassName,b=e.labelClassName,x=e.label,w=e.labelFormatter,k=p({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},void 0===o?{}:o),S=p({margin:0},void 0===f?{}:f),E=!l()(x),O=E?x:"",C=(0,s.Z)("recharts-default-tooltip",y),j=(0,s.Z)("recharts-tooltip-label",b);return E&&w&&null!=m&&(O=w(x,m)),r.createElement("div",{className:C,style:k},r.createElement("p",{className:j,style:S},r.isValidElement(O)?O:"".concat(O)),function(){if(m&&m.length){var e=(v?a()(m,v):m).map(function(e,t){if("none"===e.type)return null;var o=p({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},u),a=e.formatter||g||h,i=e.value,l=e.name,s=i,f=l;if(a&&null!=s&&null!=f){var v=a(i,l,e,t,m);if(Array.isArray(v)){var y=function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(v,2)||function(e,t){if(e){if("string"==typeof e)return d(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,2)}}(v,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s=y[0],f=y[1]}else s=v}return r.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:o},(0,c.P2)(f)?r.createElement("span",{className:"recharts-tooltip-item-name"},f):null,(0,c.P2)(f)?r.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,r.createElement("span",{className:"recharts-tooltip-item-value"},s),r.createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))});return r.createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())},g=n(59221);function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t,n){var r;return(r=function(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==v(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===v(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b="recharts-tooltip-wrapper",x={visibility:"hidden"};function w(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,o=e.offsetTopLeft,a=e.position,i=e.reverseDirection,l=e.tooltipDimension,s=e.viewBox,u=e.viewBoxDimension;if(a&&(0,c.hj)(a[r]))return a[r];var d=n[r]-l-o,f=n[r]+o;return t[r]?i[r]?d:f:i[r]?d<s[r]?Math.max(f,s[r]):Math.max(d,s[r]):f+l>s[r]+u?Math.max(d,s[r]):Math.max(f,s[r])}function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){return(O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function C(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=j(a);return e=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return C(e)}(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return _(C(e=o.call.apply(o,[this].concat(n))),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),_(C(e),"lastBoundingBox",{width:-1,height:-1}),_(C(e),"handleKeyDown",function(t){if("Escape"===t.key){var n,r,o,a;e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(n=null===(r=e.props.coordinate)||void 0===r?void 0:r.x)&&void 0!==n?n:0,y:null!==(o=null===(a=e.props.coordinate)||void 0===a?void 0:a.y)&&void 0!==o?o:0}})}}),e}return n=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.lastBoundingBox.width)>1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height)}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)!==this.state.dismissedAtCoordinate.x||(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var e,t,n,o,a,i,l,u,d,f,p,h,m,v,k,S,O,C,j,_,P,N=this,T=this.props,A=T.active,M=T.allowEscapeViewBox,I=T.animationDuration,R=T.animationEasing,D=T.children,L=T.coordinate,Z=T.hasPayload,z=T.isAnimationActive,B=T.offset,F=T.position,H=T.reverseDirection,q=T.useTranslate3d,W=T.viewBox,U=T.wrapperStyle,K=(v=(e={allowEscapeViewBox:M,coordinate:L,offsetTopLeft:B,position:F,reverseDirection:H,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:q,viewBox:W}).allowEscapeViewBox,k=e.coordinate,S=e.offsetTopLeft,O=e.position,C=e.reverseDirection,j=e.tooltipBox,_=e.useTranslate3d,P=e.viewBox,j.height>0&&j.width>0&&k?(n=(t={translateX:h=w({allowEscapeViewBox:v,coordinate:k,key:"x",offsetTopLeft:S,position:O,reverseDirection:C,tooltipDimension:j.width,viewBox:P,viewBoxDimension:P.width}),translateY:m=w({allowEscapeViewBox:v,coordinate:k,key:"y",offsetTopLeft:S,position:O,reverseDirection:C,tooltipDimension:j.height,viewBox:P,viewBoxDimension:P.height}),useTranslate3d:_}).translateX,o=t.translateY,a=t.useTranslate3d,p=(0,g.bO)({transform:a?"translate3d(".concat(n,"px, ").concat(o,"px, 0)"):"translate(".concat(n,"px, ").concat(o,"px)")})):p=x,{cssProperties:p,cssClasses:(u=(i={translateX:h,translateY:m,coordinate:k}).coordinate,d=i.translateX,f=i.translateY,(0,s.Z)(b,(y(l={},"".concat(b,"-right"),(0,c.hj)(d)&&u&&(0,c.hj)(u.x)&&d>=u.x),y(l,"".concat(b,"-left"),(0,c.hj)(d)&&u&&(0,c.hj)(u.x)&&d<u.x),y(l,"".concat(b,"-bottom"),(0,c.hj)(f)&&u&&(0,c.hj)(u.y)&&f>=u.y),y(l,"".concat(b,"-top"),(0,c.hj)(f)&&u&&(0,c.hj)(u.y)&&f<u.y),l)))}),$=K.cssClasses,V=K.cssProperties,X=E(E(E({},z&&A&&(0,g.bO)({transition:"transform ".concat(I,"ms ").concat(R)})),V),{},{pointerEvents:"none",visibility:!this.state.dismissed&&A&&Z?"visible":"hidden",position:"absolute",top:0,left:0},U);return r.createElement("div",{tabIndex:-1,role:"dialog",className:$,style:X,ref:function(e){N.wrapperNode=e}},D)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent),T=n(34067),A=n(93528);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t){return(D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Z(e,t,n){return(t=z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e){var t=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===M(t)?t:String(t)}function B(e){return e.dataKey}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=L(a);return e=t?Reflect.construct(n,arguments,L(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"render",value:function(){var e,t=this,n=this.props,o=n.active,a=n.allowEscapeViewBox,i=n.animationDuration,l=n.animationEasing,s=n.content,c=n.coordinate,u=n.filterNull,d=n.isAnimationActive,f=n.offset,p=n.payload,h=n.payloadUniqBy,g=n.position,v=n.reverseDirection,y=n.useTranslate3d,b=n.viewBox,x=n.wrapperStyle,w=null!=p?p:[];u&&w.length&&(w=(0,A.z)(p.filter(function(e){return null!=e.value&&(!0!==e.hide||t.props.includeHidden)}),h,B));var k=w.length>0;return r.createElement(N,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:o,coordinate:c,hasPayload:k,offset:f,position:g,reverseDirection:v,useTranslate3d:y,viewBox:b,wrapperStyle:x},(e=R(R({},this.props),{},{payload:w}),r.isValidElement(s)?r.cloneElement(s,e):"function"==typeof s?r.createElement(s,e):r.createElement(m,e)))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,z(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);Z(F,"displayName","Tooltip"),Z(F,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!T.x.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}})},9841:function(e,t,n){"use strict";n.d(t,{m:function(){return s}});var r=n(2265),o=n(87602),a=n(82944),i=["children","className"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=r.forwardRef(function(e,t){var n=e.children,s=e.className,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),u=(0,o.Z)("recharts-layer",s);return r.createElement("g",l({className:u},(0,a.L6)(c,!0),{ref:t}),n)})},48777:function(e,t,n){"use strict";n.d(t,{T:function(){return s}});var r=n(2265),o=n(87602),a=n(82944),i=["children","width","height","viewBox","className","style","title","desc"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e){var t=e.children,n=e.width,s=e.height,c=e.viewBox,u=e.className,d=e.style,f=e.title,p=e.desc,h=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),m=c||{width:n,height:s,x:0,y:0},g=(0,o.Z)("recharts-surface",u);return r.createElement("svg",l({},(0,a.L6)(h,!0,"svg"),{className:g,width:n,height:s,style:d,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),r.createElement("title",null,f),r.createElement("desc",null,p),t)}},25739:function(e,t,n){"use strict";n.d(t,{br:function(){return h},Mw:function(){return w},zn:function(){return x},sp:function(){return m},qD:function(){return b},d2:function(){return y},bH:function(){return g},Ud:function(){return v}});var r=n(2265),o=n(69398),a=n(50967),i=n.n(a)()(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),l=(0,r.createContext)(void 0),s=(0,r.createContext)(void 0),c=(0,r.createContext)(void 0),u=(0,r.createContext)({}),d=(0,r.createContext)(void 0),f=(0,r.createContext)(0),p=(0,r.createContext)(0),h=function(e){var t=e.state,n=t.xAxisMap,o=t.yAxisMap,a=t.offset,h=e.clipPathId,m=e.children,g=e.width,v=e.height,y=i(a);return r.createElement(l.Provider,{value:n},r.createElement(s.Provider,{value:o},r.createElement(u.Provider,{value:a},r.createElement(c.Provider,{value:y},r.createElement(d.Provider,{value:h},r.createElement(f.Provider,{value:v},r.createElement(p.Provider,{value:g},m)))))))},m=function(){return(0,r.useContext)(d)},g=function(e){var t=(0,r.useContext)(l);null!=t||(0,o.Z)(!1);var n=t[e];return null!=n||(0,o.Z)(!1),n},v=function(e){var t=(0,r.useContext)(s);null!=t||(0,o.Z)(!1);var n=t[e];return null!=n||(0,o.Z)(!1),n},y=function(){return(0,r.useContext)(c)},b=function(){return(0,r.useContext)(u)},x=function(){return(0,r.useContext)(p)},w=function(){return(0,r.useContext)(f)}},57165:function(e,t,n){"use strict";n.d(t,{H:function(){return $}});var r=n(2265);function o(){}function a(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function i(e){this._context=e}function l(e){this._context=e}function s(e){this._context=e}i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:a(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},l.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},s.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class c{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function u(e){this._context=e}function d(e){this._context=e}function f(e){return new d(e)}function p(e,t,n){var r=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(r||o<0&&-0),i=(n-e._y1)/(o||r<0&&-0);return((a<0?-1:1)+(i<0?-1:1))*Math.min(Math.abs(a),Math.abs(i),.5*Math.abs((a*o+i*r)/(r+o)))||0}function h(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function m(e,t,n){var r=e._x0,o=e._y0,a=e._x1,i=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,o+l*t,a-l,i-l*n,a,i)}function g(e){this._context=e}function v(e){this._context=new y(e)}function y(e){this._context=e}function b(e){this._context=e}function x(e){var t,n,r=e.length-1,o=Array(r),a=Array(r),i=Array(r);for(o[0]=0,a[0]=2,i[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,i[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,i[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=o[t]/a[t-1],a[t]-=n,i[t]-=n*i[t-1];for(o[r-1]=i[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(i[t]-o[t+1])/a[t];for(t=0,a[r-1]=(e[r]+o[r-1])/2;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function w(e,t){this._context=e,this._t=t}u.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:m(this,this._t0,h(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,m(this,h(this,n=p(this,e,t)),n);break;default:m(this,this._t0,n=p(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(v.prototype=Object.create(g.prototype)).point=function(e,t){g.prototype.point.call(this,t,e)},y.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,a){this._context.bezierCurveTo(t,e,r,n,a,o)}},b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=x(e),o=x(t),a=0,i=1;i<n;++a,++i)this._context.bezierCurveTo(r[0][a],o[0][a],r[1][a],o[1][a],e[i],t[i])}(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var k=n(22516),S=n(76115),E=n(67790);function O(e){return e[0]}function C(e){return e[1]}function j(e,t){var n=(0,S.Z)(!0),r=null,o=f,a=null,i=(0,E.d)(l);function l(l){var s,c,u,d=(l=(0,k.Z)(l)).length,f=!1;for(null==r&&(a=o(u=i())),s=0;s<=d;++s)!(s<d&&n(c=l[s],s,l))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(c,s,l),+t(c,s,l));if(u)return a=null,u+""||null}return e="function"==typeof e?e:void 0===e?O:(0,S.Z)(e),t="function"==typeof t?t:void 0===t?C:(0,S.Z)(t),l.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),l):e},l.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),l):t},l.defined=function(e){return arguments.length?(n="function"==typeof e?e:(0,S.Z)(!!e),l):n},l.curve=function(e){return arguments.length?(o=e,null!=r&&(a=o(r)),l):o},l.context=function(e){return arguments.length?(null==e?r=a=null:a=o(r=e),l):r},l}function _(e,t,n){var r=null,o=(0,S.Z)(!0),a=null,i=f,l=null,s=(0,E.d)(c);function c(c){var u,d,f,p,h,m=(c=(0,k.Z)(c)).length,g=!1,v=Array(m),y=Array(m);for(null==a&&(l=i(h=s())),u=0;u<=m;++u){if(!(u<m&&o(p=c[u],u,c))===g){if(g=!g)d=u,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),f=u-1;f>=d;--f)l.point(v[f],y[f]);l.lineEnd(),l.areaEnd()}}g&&(v[u]=+e(p,u,c),y[u]=+t(p,u,c),l.point(r?+r(p,u,c):v[u],n?+n(p,u,c):y[u]))}if(h)return l=null,h+""||null}function u(){return j().defined(o).curve(i).context(a)}return e="function"==typeof e?e:void 0===e?O:(0,S.Z)(+e),t="function"==typeof t?t:void 0===t?(0,S.Z)(0):(0,S.Z)(+t),n="function"==typeof n?n:void 0===n?C:(0,S.Z)(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:(0,S.Z)(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:(0,S.Z)(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(o="function"==typeof e?e:(0,S.Z)(!!e),c):o},c.curve=function(e){return arguments.length?(i=e,null!=a&&(l=i(a)),c):i},c.context=function(e){return arguments.length?(null==e?a=l=null:l=i(a=e),c):a},c}var P=n(75551),N=n.n(P),T=n(86757),A=n.n(T),M=n(87602),I=n(41637),R=n(82944),D=n(16630);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(){return(Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==L(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==L(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===L(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var F={curveBasisClosed:function(e){return new l(e)},curveBasisOpen:function(e){return new s(e)},curveBasis:function(e){return new i(e)},curveBumpX:function(e){return new c(e,!0)},curveBumpY:function(e){return new c(e,!1)},curveLinearClosed:function(e){return new u(e)},curveLinear:f,curveMonotoneX:function(e){return new g(e)},curveMonotoneY:function(e){return new v(e)},curveNatural:function(e){return new b(e)},curveStep:function(e){return new w(e,.5)},curveStepAfter:function(e){return new w(e,1)},curveStepBefore:function(e){return new w(e,0)}},H=function(e){return e.x===+e.x&&e.y===+e.y},q=function(e){return e.x},W=function(e){return e.y},U=function(e,t){if(A()(e))return e;var n="curve".concat(N()(e));return("curveMonotone"===n||"curveBump"===n)&&t?F["".concat(n).concat("vertical"===t?"Y":"X")]:F[n]||f},K=function(e){var t,n=e.type,r=e.points,o=void 0===r?[]:r,a=e.baseLine,i=e.layout,l=e.connectNulls,s=void 0!==l&&l,c=U(void 0===n?"linear":n,i),u=s?o.filter(function(e){return H(e)}):o;if(Array.isArray(a)){var d=s?a.filter(function(e){return H(e)}):a,f=u.map(function(e,t){return B(B({},e),{},{base:d[t]})});return(t="vertical"===i?_().y(W).x1(q).x0(function(e){return e.base.x}):_().x(q).y1(W).y0(function(e){return e.base.y})).defined(H).curve(c),t(f)}return(t="vertical"===i&&(0,D.hj)(a)?_().y(W).x1(q).x0(a):(0,D.hj)(a)?_().x(q).y1(W).y0(a):j().x(q).y(W)).defined(H).curve(c),t(u)},$=function(e){var t=e.className,n=e.points,o=e.path,a=e.pathRef;if((!n||!n.length)&&!o)return null;var i=n&&n.length?K(e):o;return r.createElement("path",Z({},(0,R.L6)(e,!1),(0,I.Ym)(e),{className:(0,M.Z)("recharts-curve",t),d:i,ref:a}))}},81889:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(2265),o=n(87602),a=n(41637),i=n(82944);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=function(e){var t=e.cx,n=e.cy,s=e.r,c=e.className,u=(0,o.Z)("recharts-dot",c);return t===+t&&n===+n&&s===+s?r.createElement("circle",l({},(0,i.L6)(e,!1),(0,a.Ym)(e),{className:u,cx:t,cy:n,r:s})):null}},73649:function(e,t,n){"use strict";n.d(t,{A:function(){return m},X:function(){return p}});var r=n(2265),o=n(87602),a=n(59221),i=n(82944);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e,t,n,r,o){var a,i=Math.min(Math.abs(n)/2,Math.abs(r)/2),l=r>=0?1:-1,s=n>=0?1:-1,c=r>=0&&n>=0||r<0&&n<0?1:0;if(i>0&&o instanceof Array){for(var u=[0,0,0,0],d=0;d<4;d++)u[d]=o[d]>i?i:o[d];a="M".concat(e,",").concat(t+l*u[0]),u[0]>0&&(a+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+s*u[0],",").concat(t)),a+="L ".concat(e+n-s*u[1],",").concat(t),u[1]>0&&(a+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,",\n ").concat(e+n,",").concat(t+l*u[1])),a+="L ".concat(e+n,",").concat(t+r-l*u[2]),u[2]>0&&(a+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,",\n ").concat(e+n-s*u[2],",").concat(t+r)),a+="L ".concat(e+s*u[3],",").concat(t+r),u[3]>0&&(a+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,",\n ").concat(e,",").concat(t+r-l*u[3])),a+="Z"}else if(i>0&&o===+o&&o>0){var f=Math.min(i,o);a="M ".concat(e,",").concat(t+l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+s*f,",").concat(t,"\n L ").concat(e+n-s*f,",").concat(t,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n,",").concat(t+l*f,"\n L ").concat(e+n,",").concat(t+r-l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n-s*f,",").concat(t+r,"\n L ").concat(e+s*f,",").concat(t+r,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e,",").concat(t+r-l*f," Z")}else a="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return a},p=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,o=t.x,a=t.y,i=t.width,l=t.height;return!!(Math.abs(i)>0&&Math.abs(l)>0)&&n>=Math.min(o,o+i)&&n<=Math.max(o,o+i)&&r>=Math.min(a,a+l)&&r<=Math.max(a,a+l)},h={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},m=function(e){var t,n=d(d({},h),e),l=(0,r.useRef)(),u=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(-1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,2)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=u[0],m=u[1];(0,r.useEffect)(function(){if(l.current&&l.current.getTotalLength)try{var e=l.current.getTotalLength();e&&m(e)}catch(e){}},[]);var g=n.x,v=n.y,y=n.width,b=n.height,x=n.radius,w=n.className,k=n.animationEasing,S=n.animationDuration,E=n.animationBegin,O=n.isAnimationActive,C=n.isUpdateAnimationActive;if(g!==+g||v!==+v||y!==+y||b!==+b||0===y||0===b)return null;var j=(0,o.Z)("recharts-rectangle",w);return C?r.createElement(a.ZP,{canBegin:p>0,from:{width:y,height:b,x:g,y:v},to:{width:y,height:b,x:g,y:v},duration:S,animationEasing:k,isActive:C},function(e){var t=e.width,o=e.height,c=e.x,u=e.y;return r.createElement(a.ZP,{canBegin:p>0,from:"0px ".concat(-1===p?1:p,"px"),to:"".concat(p,"px 0px"),attributeName:"strokeDasharray",begin:E,duration:S,isActive:O,easing:k},r.createElement("path",s({},(0,i.L6)(n,!0),{className:j,d:f(c,u,t,o,x),ref:l})))}):r.createElement("path",s({},(0,i.L6)(n,!0),{className:j,d:f(g,v,y,b,x)}))}},60474:function(e,t,n){"use strict";n.d(t,{L:function(){return g}});var r=n(2265),o=n(87602),a=n(82944),i=n(39206),l=n(16630);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e){var t=e.cx,n=e.cy,r=e.radius,o=e.angle,a=e.sign,l=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,u=s*(l?1:-1)+r,d=Math.asin(s/u)/i.Wk,f=c?o:o+a*d;return{center:(0,i.op)(t,n,u,f),circleTangency:(0,i.op)(t,n,r,f),lineTangency:(0,i.op)(t,n,u*Math.cos(d*i.Wk),c?o-a*d:o),theta:d}},p=function(e){var t,n=e.cx,r=e.cy,o=e.innerRadius,a=e.outerRadius,s=e.startAngle,c=(t=e.endAngle,(0,l.uY)(t-s)*Math.min(Math.abs(t-s),359.999)),u=s+c,d=(0,i.op)(n,r,a,s),f=(0,i.op)(n,r,a,u),p="M ".concat(d.x,",").concat(d.y,"\n A ").concat(a,",").concat(a,",0,\n ").concat(+(Math.abs(c)>180),",").concat(+(s>u),",\n ").concat(f.x,",").concat(f.y,"\n ");if(o>0){var h=(0,i.op)(n,r,o,s),m=(0,i.op)(n,r,o,u);p+="L ".concat(m.x,",").concat(m.y,"\n A ").concat(o,",").concat(o,",0,\n ").concat(+(Math.abs(c)>180),",").concat(+(s<=u),",\n ").concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(n,",").concat(r," Z");return p},h=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,i=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=(0,l.uY)(u-c),h=f({cx:t,cy:n,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),m=h.circleTangency,g=h.lineTangency,v=h.theta,y=f({cx:t,cy:n,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:s}),b=y.circleTangency,x=y.lineTangency,w=y.theta,k=s?Math.abs(c-u):Math.abs(c-u)-v-w;if(k<0)return i?"M ".concat(g.x,",").concat(g.y,"\n a").concat(a,",").concat(a,",0,0,1,").concat(2*a,",0\n a").concat(a,",").concat(a,",0,0,1,").concat(-(2*a),",0\n "):p({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:c,endAngle:u});var S="M ".concat(g.x,",").concat(g.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,"\n A").concat(o,",").concat(o,",0,").concat(+(k>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,"\n ");if(r>0){var E=f({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),O=E.circleTangency,C=E.lineTangency,j=E.theta,_=f({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),P=_.circleTangency,N=_.lineTangency,T=_.theta,A=s?Math.abs(c-u):Math.abs(c-u)-j-T;if(A<0&&0===a)return"".concat(S,"L").concat(t,",").concat(n,"Z");S+="L".concat(N.x,",").concat(N.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,"\n A").concat(r,",").concat(r,",0,").concat(+(A>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(C.x,",").concat(C.y,"Z")}else S+="L".concat(t,",").concat(n,"Z");return S},m={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},g=function(e){var t,n=d(d({},m),e),i=n.cx,s=n.cy,u=n.innerRadius,f=n.outerRadius,g=n.cornerRadius,v=n.forceCornerRadius,y=n.cornerIsExternal,b=n.startAngle,x=n.endAngle,w=n.className;if(f<u||b===x)return null;var k=(0,o.Z)("recharts-sector",w),S=f-u,E=(0,l.h1)(g,S,0,!0);return t=E>0&&360>Math.abs(b-x)?h({cx:i,cy:s,innerRadius:u,outerRadius:f,cornerRadius:Math.min(E,S/2),forceCornerRadius:v,cornerIsExternal:y,startAngle:b,endAngle:x}):p({cx:i,cy:s,innerRadius:u,outerRadius:f,startAngle:b,endAngle:x}),r.createElement("path",c({},(0,a.L6)(n,!0),{className:k,d:t,role:"img"}))}},14870:function(e,t,n){"use strict";n.d(t,{v:function(){return M}});var r=n(2265),o=n(75551),a=n.n(o);let i=Math.cos,l=Math.sin,s=Math.sqrt,c=Math.PI,u=2*c;var d={draw(e,t){let n=s(t/c);e.moveTo(n,0),e.arc(0,0,n,0,u)}};let f=s(1/3),p=2*f,h=l(c/10)/l(7*c/10),m=l(u/10)*h,g=-i(u/10)*h,v=s(3),y=s(3)/2,b=1/s(12),x=(b/2+1)*3;var w=n(76115),k=n(67790);s(3),s(3);var S=n(87602),E=n(82944);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var C=["type","size","sizeType"];function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==O(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==O(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===O(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var N={symbolCircle:d,symbolCross:{draw(e,t){let n=s(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},symbolDiamond:{draw(e,t){let n=s(t/p),r=n*f;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},symbolSquare:{draw(e,t){let n=s(t),r=-n/2;e.rect(r,r,n,n)}},symbolStar:{draw(e,t){let n=s(.8908130915292852*t),r=m*n,o=g*n;e.moveTo(0,-n),e.lineTo(r,o);for(let t=1;t<5;++t){let a=u*t/5,s=i(a),c=l(a);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*o,c*r+s*o)}e.closePath()}},symbolTriangle:{draw(e,t){let n=-s(t/(3*v));e.moveTo(0,2*n),e.lineTo(-v*n,-n),e.lineTo(v*n,-n),e.closePath()}},symbolWye:{draw(e,t){let n=s(t/x),r=n/2,o=n*b,a=n*b+n,i=-r;e.moveTo(r,o),e.lineTo(r,a),e.lineTo(i,a),e.lineTo(-.5*r-y*o,y*r+-.5*o),e.lineTo(-.5*r-y*a,y*r+-.5*a),e.lineTo(-.5*i-y*a,y*i+-.5*a),e.lineTo(-.5*r+y*o,-.5*o-y*r),e.lineTo(-.5*r+y*a,-.5*a-y*r),e.lineTo(-.5*i+y*a,-.5*a-y*i),e.closePath()}}},T=Math.PI/180,A=function(e,t,n){if("area"===t)return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var r=18*T;return 1.25*e*e*(Math.tan(r)-Math.tan(2*r)*Math.pow(Math.tan(r),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},M=function(e){var t,n=e.type,o=void 0===n?"circle":n,i=e.size,l=void 0===i?64:i,s=e.sizeType,c=void 0===s?"area":s,u=P(P({},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,C)),{},{type:o,size:l,sizeType:c}),f=u.className,p=u.cx,h=u.cy,m=(0,E.L6)(u,!0);return p===+p&&h===+h&&l===+l?r.createElement("path",j({},m,{className:(0,S.Z)("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(h,")"),d:(t=N["symbol".concat(a()(o))]||d,(function(e,t){let n=null,r=(0,k.d)(o);function o(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return e="function"==typeof e?e:(0,w.Z)(e||d),t="function"==typeof t?t:(0,w.Z)(void 0===t?64:+t),o.type=function(t){return arguments.length?(e="function"==typeof t?t:(0,w.Z)(t),o):e},o.size=function(e){return arguments.length?(t="function"==typeof e?e:(0,w.Z)(+e),o):t},o.context=function(e){return arguments.length?(n=null==e?null:e,o):n},o})().type(t).size(A(l,c,o))())})):null};M.registerSymbol=function(e,t){N["symbol".concat(a()(e))]=t}},11638:function(e,t,n){"use strict";n.d(t,{bn:function(){return A},a3:function(){return z},lT:function(){return M},V$:function(){return I},w7:function(){return R}});var r=n(2265),o=n(86757),a=n.n(o),i=n(90231),l=n.n(i),s=n(24342),c=n.n(s),u=n(21652),d=n.n(u),f=n(73649),p=n(87602),h=n(59221),m=n(82944);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(){return(v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var w=function(e,t,n,r,o){var a=n-r;return"M ".concat(e,",").concat(t)+"L ".concat(e+n,",").concat(t)+"L ".concat(e+n-a/2,",").concat(t+o)+"L ".concat(e+n-a/2-r,",").concat(t+o)+"L ".concat(e,",").concat(t," Z")},k={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},S=function(e){var t,n=x(x({},k),e),o=(0,r.useRef)(),a=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(-1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,2)||function(e,t){if(e){if("string"==typeof e)return y(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],l=a[1];(0,r.useEffect)(function(){if(o.current&&o.current.getTotalLength)try{var e=o.current.getTotalLength();e&&l(e)}catch(e){}},[]);var s=n.x,c=n.y,u=n.upperWidth,d=n.lowerWidth,f=n.height,g=n.className,b=n.animationEasing,S=n.animationDuration,E=n.animationBegin,O=n.isUpdateAnimationActive;if(s!==+s||c!==+c||u!==+u||d!==+d||f!==+f||0===u&&0===d||0===f)return null;var C=(0,p.Z)("recharts-trapezoid",g);return O?r.createElement(h.ZP,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:f,x:s,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:s,y:c},duration:S,animationEasing:b,isActive:O},function(e){var t=e.upperWidth,a=e.lowerWidth,l=e.height,s=e.x,c=e.y;return r.createElement(h.ZP,{canBegin:i>0,from:"0px ".concat(-1===i?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:E,duration:S,easing:b},r.createElement("path",v({},(0,m.L6)(n,!0),{className:C,d:w(s,c,t,a,l),ref:o})))}):r.createElement("g",null,r.createElement("path",v({},(0,m.L6)(n,!0),{className:C,d:w(s,c,u,d,f)})))},E=n(60474),O=n(9841),C=n(14870),j=["option","shapeType","propTransformer","activeClassName","isActive"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return r.createElement(f.A,n);case"trapezoid":return r.createElement(S,n);case"sector":return r.createElement(E.L,n);case"symbols":if("symbols"===t)return r.createElement(C.v,n);break;default:return null}}function A(e){var t,n=e.option,o=e.shapeType,i=e.propTransformer,s=e.activeClassName,u=e.isActive,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,j);if((0,r.isValidElement)(n))t=(0,r.cloneElement)(n,N(N({},d),(0,r.isValidElement)(n)?n.props:n));else if(a()(n))t=n(d);else if(l()(n)&&!c()(n)){var f=(void 0===i?function(e,t){return N(N({},t),e)}:i)(n,d);t=r.createElement(T,{shapeType:o,elementProps:f})}else t=r.createElement(T,{shapeType:o,elementProps:d});return u?r.createElement(O.m,{className:void 0===s?"recharts-active-shape":s},t):t}function M(e,t){return null!=t&&"trapezoids"in e.props}function I(e,t){return null!=t&&"sectors"in e.props}function R(e,t){return null!=t&&"points"in e.props}function D(e,t){var n,r,o=e.x===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.x)||e.x===t.x,a=e.y===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.y)||e.y===t.y;return o&&a}function L(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Z(e,t){var n=e.x===t.x,r=e.y===t.y,o=e.z===t.z;return n&&r&&o}function z(e){var t,n,r,o=e.activeTooltipItem,a=e.graphicalItem,i=e.itemData,l=(M(a,o)?t="trapezoids":I(a,o)?t="sectors":R(a,o)&&(t="points"),t),s=M(a,o)?null===(n=o.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:I(a,o)?null===(r=o.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:R(a,o)?o.payload:{},c=i.filter(function(e,t){var n=d()(s,e),r=a.props[l].filter(function(e){var t;return(M(a,o)?t=D:I(a,o)?t=L:R(a,o)&&(t=Z),t)(e,o)}),i=a.props[l].indexOf(r[r.length-1]);return n&&t===i});return i.indexOf(c[c.length-1])}},25311:function(e,t,n){"use strict";n.d(t,{Ky:function(){return w},O1:function(){return y},_b:function(){return b},t9:function(){return v},xE:function(){return k}});var r=n(41443),o=n.n(r),a=n(32242),i=n.n(a),l=n(85355),s=n(82944),c=n(16630),u=n(31699);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var v=function(e,t,n,r,o){var a=e.width,i=e.height,d=e.layout,f=e.children,p=Object.keys(t),g={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:i-n.bottom,bottomMirror:i-n.bottom},v=!!(0,s.sP)(f,u.$);return p.reduce(function(a,i){var s,u,f,p,y,b=t[i],x=b.orientation,w=b.domain,k=b.padding,S=void 0===k?{}:k,E=b.mirror,O=b.reversed,C="".concat(x).concat(E?"Mirror":"");if("number"===b.type&&("gap"===b.padding||"no-gap"===b.padding)){var j=w[1]-w[0],_=1/0,P=b.categoricalDomain.sort();P.forEach(function(e,t){t>0&&(_=Math.min((e||0)-(P[t-1]||0),_))});var N=_/j,T="vertical"===b.layout?n.height:n.width;if("gap"===b.padding&&(s=N*T/2),"no-gap"===b.padding){var A=(0,c.h1)(e.barCategoryGap,N*T),M=N*T/2;s=M-A-(M-A)/T*A}}u="xAxis"===r?[n.left+(S.left||0)+(s||0),n.left+n.width-(S.right||0)-(s||0)]:"yAxis"===r?"horizontal"===d?[n.top+n.height-(S.bottom||0),n.top+(S.top||0)]:[n.top+(S.top||0)+(s||0),n.top+n.height-(S.bottom||0)-(s||0)]:b.range,O&&(u=[u[1],u[0]]);var I=(0,l.Hq)(b,o,v),R=I.scale,D=I.realScaleType;R.domain(w).range(u),(0,l.zF)(R);var L=(0,l.g$)(R,h(h({},b),{},{realScaleType:D}));"xAxis"===r?(y="top"===x&&!E||"bottom"===x&&E,f=n.left,p=g[C]-y*b.height):"yAxis"===r&&(y="left"===x&&!E||"right"===x&&E,f=g[C]-y*b.width,p=n.top);var Z=h(h(h({},b),L),{},{realScaleType:D,x:f,y:p,scale:R,width:"xAxis"===r?n.width:b.width,height:"yAxis"===r?n.height:b.height});return Z.bandSize=(0,l.zT)(Z,L),b.hide||"xAxis"!==r?b.hide||(g[C]+=(y?-1:1)*Z.width):g[C]+=(y?-1:1)*Z.height,h(h({},a),{},m({},i,Z))},{})},y=function(e,t){var n=e.x,r=e.y,o=t.x,a=t.y;return{x:Math.min(n,o),y:Math.min(r,a),width:Math.abs(o-n),height:Math.abs(a-r)}},b=function(e){return y({x:e.x1,y:e.y1},{x:e.x2,y:e.y2})},x=function(){var e,t;function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this.scale=e}return e=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=t.position;if(void 0!==e){if(r)switch(r){case"start":default:return this.scale(e);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o;case"end":var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a}if(n){var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],t=[{key:"create",value:function(e){return new n(e)}}],e&&f(n.prototype,e),t&&f(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();m(x,"EPS",1e-4);var w=function(e){var t=Object.keys(e).reduce(function(t,n){return h(h({},t),{},m({},n,x.create(e[n])))},{});return h(h({},t),{},{apply:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware,a=n.position;return o()(e,function(e,n){return t[n].apply(e,{bandAware:r,position:a})})},isInRange:function(e){return i()(e,function(e,n){return t[n].isInRange(e)})}})},k=function(e){var t=e.width,n=e.height,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(r%180+180)%180*Math.PI/180,a=Math.atan(n/t);return Math.abs(o>a&&o<Math.PI-a?n/Math.sin(o):t/Math.cos(o))}},85355:function(e,t,n){"use strict";n.d(t,{By:function(){return r4},VO:function(){return r0},zF:function(){return oo},DO:function(){return on},Bu:function(){return oa},zT:function(){return ob},qz:function(){return r6},pt:function(){return r2},Yj:function(){return op},Fy:function(){return of},Hv:function(){return od},Rf:function(){return r9},gF:function(){return rJ},s6:function(){return r8},EB:function(){return om},fk:function(){return r1},wh:function(){return oc},O3:function(){return oh},uY:function(){return oe},g$:function(){return ou},Qo:function(){return ow},F$:function(){return rQ},NA:function(){return r7},ko:function(){return ox},ZI:function(){return r5},Hq:function(){return or},LG:function(){return oy},Vv:function(){return oi}});var r,o,a,i,l,s,c,u={};n.r(u),n.d(u,{scaleBand:function(){return d.Z},scaleDiverging:function(){return function e(){var t=eR(nQ()(eg));return t.copy=function(){return nX(t,e())},eS.O.apply(t,arguments)}},scaleDivergingLog:function(){return function e(){var t=eW(nQ()).domain([.1,1,10]);return t.copy=function(){return nX(t,e()).base(t.base())},eS.O.apply(t,arguments)}},scaleDivergingPow:function(){return nJ},scaleDivergingSqrt:function(){return n0},scaleDivergingSymlog:function(){return function e(){var t=e$(nQ());return t.copy=function(){return nX(t,e()).constant(t.constant())},eS.O.apply(t,arguments)}},scaleIdentity:function(){return function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,eh),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,eh):[0,1],eR(r)}},scaleImplicit:function(){return eV.O},scaleLinear:function(){return eD},scaleLog:function(){return function e(){let t=eW(ew()).domain([1,10]);return t.copy=()=>ex(t,e()).base(t.base()),eS.o.apply(t,arguments),t}},scaleOrdinal:function(){return eV.Z},scalePoint:function(){return d.x},scalePow:function(){return eJ},scaleQuantile:function(){return function e(){var t,n=[],r=[],o=[];function a(){var e=0,t=Math.max(1,r.length);for(o=Array(t-1);++e<t;)o[e-1]=function(e,t,n=S){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,a=Math.floor(o),i=+n(e[a],a,e);return i+(+n(e[a+1],a+1,e)-i)*(o-a)}}(n,e/t);return i}function i(e){return null==e||isNaN(e=+e)?t:r[O(o,e)]}return i.invertExtent=function(e){var t=r.indexOf(e);return t<0?[NaN,NaN]:[t>0?o[t-1]:n[0],t<o.length?o[t]:n[n.length-1]]},i.domain=function(e){if(!arguments.length)return n.slice();for(let t of(n=[],e))null==t||isNaN(t=+t)||n.push(t);return n.sort(b),a()},i.range=function(e){return arguments.length?(r=Array.from(e),a()):r.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return o.slice()},i.copy=function(){return e().domain(n).range(r).unknown(t)},eS.o.apply(i,arguments)}},scaleQuantize:function(){return function e(){var t,n=0,r=1,o=1,a=[.5],i=[0,1];function l(e){return null!=e&&e<=e?i[O(a,e,0,o)]:t}function s(){var e=-1;for(a=Array(o);++e<o;)a[e]=((e+1)*r-(e-o)*n)/(o+1);return l}return l.domain=function(e){return arguments.length?([n,r]=e,n=+n,r=+r,s()):[n,r]},l.range=function(e){return arguments.length?(o=(i=Array.from(e)).length-1,s()):i.slice()},l.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,a[0]]:t>=o?[a[o-1],r]:[a[t-1],a[t]]},l.unknown=function(e){return arguments.length&&(t=e),l},l.thresholds=function(){return a.slice()},l.copy=function(){return e().domain([n,r]).range(i).unknown(t)},eS.o.apply(eR(l),arguments)}},scaleRadial:function(){return function e(){var t,n=ek(),r=[0,1],o=!1;function a(e){var r,a=Math.sign(r=n(e))*Math.sqrt(Math.abs(r));return isNaN(a)?t:o?Math.round(a):a}return a.invert=function(e){return n.invert(e1(e))},a.domain=function(e){return arguments.length?(n.domain(e),a):n.domain()},a.range=function(e){return arguments.length?(n.range((r=Array.from(e,eh)).map(e1)),a):r.slice()},a.rangeRound=function(e){return a.range(e).round(!0)},a.round=function(e){return arguments.length?(o=!!e,a):o},a.clamp=function(e){return arguments.length?(n.clamp(e),a):n.clamp()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e(n.domain(),r).round(o).clamp(n.clamp()).unknown(t)},eS.o.apply(a,arguments),eR(a)}},scaleSequential:function(){return function e(){var t=eR(nV()(eg));return t.copy=function(){return nX(t,e())},eS.O.apply(t,arguments)}},scaleSequentialLog:function(){return function e(){var t=eW(nV()).domain([1,10]);return t.copy=function(){return nX(t,e()).base(t.base())},eS.O.apply(t,arguments)}},scaleSequentialPow:function(){return nG},scaleSequentialQuantile:function(){return function e(){var t=[],n=eg;function r(e){if(null!=e&&!isNaN(e=+e))return n((O(t,e,1)-1)/(t.length-1))}return r.domain=function(e){if(!arguments.length)return t.slice();for(let n of(t=[],e))null==n||isNaN(n=+n)||t.push(n);return t.sort(b),r},r.interpolator=function(e){return arguments.length?(n=e,r):n},r.range=function(){return t.map((e,r)=>n(r/(t.length-1)))},r.quantiles=function(e){return Array.from({length:e+1},(n,r)=>(function(e,t,n){if(!(!(r=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,void 0))).length)||isNaN(t=+t))){if(t<=0||r<2)return e6(e);if(t>=1)return e2(e);var r,o=(r-1)*t,a=Math.floor(o),i=e2((function e(t,n,r=0,o=1/0,a){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),o=Math.floor(Math.min(t.length-1,o)),!(r<=n&&n<=o))return t;for(a=void 0===a?e4:function(e=b){if(e===b)return e4;if("function"!=typeof e)throw TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(a);o>r;){if(o-r>600){let i=o-r+1,l=n-r+1,s=Math.log(i),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(i-c)/i)*(l-i/2<0?-1:1),d=Math.max(r,Math.floor(n-l*c/i+u)),f=Math.min(o,Math.floor(n+(i-l)*c/i+u));e(t,n,d,f,a)}let i=t[n],l=r,s=o;for(e3(t,r,n),a(t[o],i)>0&&e3(t,r,o);l<s;){for(e3(t,l,s),++l,--s;0>a(t[l],i);)++l;for(;a(t[s],i)>0;)--s}0===a(t[r],i)?e3(t,r,s):e3(t,++s,o),s<=n&&(r=s+1),n<=s&&(o=s-1)}return t})(e,a).subarray(0,a+1));return i+(e6(e.subarray(a+1))-i)*(o-a)}})(t,r/e))},r.copy=function(){return e(n).domain(t)},eS.O.apply(r,arguments)}},scaleSequentialSqrt:function(){return nY},scaleSequentialSymlog:function(){return function e(){var t=e$(nV());return t.copy=function(){return nX(t,e()).constant(t.constant())},eS.O.apply(t,arguments)}},scaleSqrt:function(){return e0},scaleSymlog:function(){return function e(){var t=e$(ew());return t.copy=function(){return ex(t,e()).constant(t.constant())},eS.o.apply(t,arguments)}},scaleThreshold:function(){return function e(){var t,n=[.5],r=[0,1],o=1;function a(e){return null!=e&&e<=e?r[O(n,e,0,o)]:t}return a.domain=function(e){return arguments.length?(o=Math.min((n=Array.from(e)).length,r.length-1),a):n.slice()},a.range=function(e){return arguments.length?(r=Array.from(e),o=Math.min(n.length,r.length-1),a):r.slice()},a.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e().domain(n).range(r).unknown(t)},eS.o.apply(a,arguments)}},scaleTime:function(){return nK},scaleUtc:function(){return n$},tickFormat:function(){return eI}});var d=n(55284);let f=Math.sqrt(50),p=Math.sqrt(10),h=Math.sqrt(2);function m(e,t,n){let r,o,a;let i=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(i)),s=i/Math.pow(10,l),c=s>=f?10:s>=p?5:s>=h?2:1;return(l<0?(r=Math.round(e*(a=Math.pow(10,-l)/c)),o=Math.round(t*a),r/a<e&&++r,o/a>t&&--o,a=-a):(r=Math.round(e/(a=Math.pow(10,l)*c)),o=Math.round(t/a),r*a<e&&++r,o*a>t&&--o),o<r&&.5<=n&&n<2)?m(e,t,2*n):[r,o,a]}function g(e,t,n){if(t=+t,e=+e,!((n=+n)>0))return[];if(e===t)return[e];let r=t<e,[o,a,i]=r?m(t,e,n):m(e,t,n);if(!(a>=o))return[];let l=a-o+1,s=Array(l);if(r){if(i<0)for(let e=0;e<l;++e)s[e]=-((a-e)/i);else for(let e=0;e<l;++e)s[e]=(a-e)*i}else if(i<0)for(let e=0;e<l;++e)s[e]=-((o+e)/i);else for(let e=0;e<l;++e)s[e]=(o+e)*i;return s}function v(e,t,n){return m(e=+e,t=+t,n=+n)[2]}function y(e,t,n){t=+t,e=+e,n=+n;let r=t<e,o=r?v(t,e,n):v(e,t,n);return(r?-1:1)*(o<0?-(1/o):o)}function b(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function x(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function w(e){let t,n,r;function o(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>n(e[t],r)?o=t+1:a=t}while(o<a)}return o}return 2!==e.length?(t=b,n=(t,n)=>b(e(t),n),r=(t,n)=>e(t)-n):(t=e===b||e===x?e:k,n=e,r=e),{left:o,center:function(e,t,n=0,a=e.length){let i=o(e,t,n,a-1);return i>n&&r(e[i-1],t)>-r(e[i],t)?i-1:i},right:function(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>=n(e[t],r)?o=t+1:a=t}while(o<a)}return o}}}function k(){return 0}function S(e){return null===e?NaN:+e}let E=w(b),O=E.right;function C(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function j(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _(){}E.left,w(S).center;var P="\\s*([+-]?\\d+)\\s*",N="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",T="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A=/^#([0-9a-f]{3,8})$/,M=RegExp(`^rgb\\(${P},${P},${P}\\)$`),I=RegExp(`^rgb\\(${T},${T},${T}\\)$`),R=RegExp(`^rgba\\(${P},${P},${P},${N}\\)$`),D=RegExp(`^rgba\\(${T},${T},${T},${N}\\)$`),L=RegExp(`^hsl\\(${N},${T},${T}\\)$`),Z=RegExp(`^hsla\\(${N},${T},${T},${N}\\)$`),z={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function B(){return this.rgb().formatHex()}function F(){return this.rgb().formatRgb()}function H(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=A.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?q(t):3===n?new K(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?W(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?W(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=M.exec(e))?new K(t[1],t[2],t[3],1):(t=I.exec(e))?new K(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=R.exec(e))?W(t[1],t[2],t[3],t[4]):(t=D.exec(e))?W(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=L.exec(e))?Q(t[1],t[2]/100,t[3]/100,1):(t=Z.exec(e))?Q(t[1],t[2]/100,t[3]/100,t[4]):z.hasOwnProperty(e)?q(z[e]):"transparent"===e?new K(NaN,NaN,NaN,0):null}function q(e){return new K(e>>16&255,e>>8&255,255&e,1)}function W(e,t,n,r){return r<=0&&(e=t=n=NaN),new K(e,t,n,r)}function U(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof _||(o=H(o)),o)?new K((o=o.rgb()).r,o.g,o.b,o.opacity):new K:new K(e,t,n,null==r?1:r)}function K(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function $(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}`}function V(){let e=X(this.opacity);return`${1===e?"rgb(":"rgba("}${G(this.r)}, ${G(this.g)}, ${G(this.b)}${1===e?")":`, ${e})`}`}function X(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function G(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Y(e){return((e=G(e))<16?"0":"")+e.toString(16)}function Q(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ee(e,t,n,r)}function J(e){if(e instanceof ee)return new ee(e.h,e.s,e.l,e.opacity);if(e instanceof _||(e=H(e)),!e)return new ee;if(e instanceof ee)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,l=a-o,s=(a+o)/2;return l?(i=t===a?(n-r)/l+(n<r)*6:n===a?(r-t)/l+2:(t-n)/l+4,l/=s<.5?a+o:2-a-o,i*=60):l=s>0&&s<1?0:i,new ee(i,l,s,e.opacity)}function ee(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function et(e){return(e=(e||0)%360)<0?e+360:e}function en(e){return Math.max(0,Math.min(1,e||0))}function er(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function eo(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}C(_,H,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:B,formatHex:B,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return J(this).formatHsl()},formatRgb:F,toString:F}),C(K,U,j(_,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new K(G(this.r),G(this.g),G(this.b),X(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$,formatHex:$,formatHex8:function(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}${Y((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:V,toString:V})),C(ee,function(e,t,n,r){return 1==arguments.length?J(e):new ee(e,t,n,null==r?1:r)},j(_,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ee(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new K(er(e>=240?e-240:e+120,o,r),er(e,o,r),er(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ee(et(this.h),en(this.s),en(this.l),X(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=X(this.opacity);return`${1===e?"hsl(":"hsla("}${et(this.h)}, ${100*en(this.s)}%, ${100*en(this.l)}%${1===e?")":`, ${e})`}`}}));var ea=e=>()=>e;function ei(e,t){var n=t-e;return n?function(t){return e+t*n}:ea(isNaN(e)?t:e)}var el=function e(t){var n,r=1==(n=+(n=t))?ei:function(e,t){var r,o,a;return t-e?(r=e,o=t,r=Math.pow(r,a=n),o=Math.pow(o,a)-r,a=1/a,function(e){return Math.pow(r+e*o,a)}):ea(isNaN(e)?t:e)};function o(e,t){var n=r((e=U(e)).r,(t=U(t)).r),o=r(e.g,t.g),a=r(e.b,t.b),i=ei(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function es(e){return function(t){var n,r,o=t.length,a=Array(o),i=Array(o),l=Array(o);for(n=0;n<o;++n)r=U(t[n]),a[n]=r.r||0,i[n]=r.g||0,l[n]=r.b||0;return a=e(a),i=e(i),l=e(l),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=l(e),r+""}}}function ec(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}es(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,l=r<t-1?e[r+2]:2*a-o;return eo((n-r/t)*t,i,o,a,l)}}),es(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],l=e[(r+2)%t];return eo((n-r/t)*t,o,a,i,l)}});var eu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ed=RegExp(eu.source,"g");function ef(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?ea(t):("number"===o?ec:"string"===o?(r=H(t))?(t=r,el):function(e,t){var n,r,o,a,i,l=eu.lastIndex=ed.lastIndex=0,s=-1,c=[],u=[];for(e+="",t+="";(o=eu.exec(e))&&(a=ed.exec(t));)(i=a.index)>l&&(i=t.slice(l,i),c[s]?c[s]+=i:c[++s]=i),(o=o[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,u.push({i:s,x:ec(o,a)})),l=ed.lastIndex;return l<t.length&&(i=t.slice(l),c[s]?c[s]+=i:c[++s]=i),c.length<2?u[0]?(n=u[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=u.length,function(e){for(var n,r=0;r<t;++r)c[(n=u[r]).i]=n.x(e);return c.join("")})}:t instanceof H?el:t instanceof Date?function(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=Array(o),i=Array(r);for(n=0;n<o;++n)a[n]=ef(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=ef(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:ec:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}})(e,t)}function ep(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function eh(e){return+e}var em=[0,1];function eg(e){return e}function ev(e,t){var n;return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n})}function ey(e,t,n){var r=e[0],o=e[1],a=t[0],i=t[1];return o<r?(r=ev(o,r),a=n(i,a)):(r=ev(r,o),a=n(a,i)),function(e){return a(r(e))}}function eb(e,t,n){var r=Math.min(e.length,t.length)-1,o=Array(r),a=Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)o[i]=ev(e[i],e[i+1]),a[i]=n(t[i],t[i+1]);return function(t){var n=O(e,t,1,r)-1;return a[n](o[n](t))}}function ex(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ew(){var e,t,n,r,o,a,i=em,l=em,s=ef,c=eg;function u(){var e,t,n,s=Math.min(i.length,l.length);return c!==eg&&(e=i[0],t=i[s-1],e>t&&(n=e,e=t,t=n),c=function(n){return Math.max(e,Math.min(t,n))}),r=s>2?eb:ey,o=a=null,d}function d(t){return null==t||isNaN(t=+t)?n:(o||(o=r(i.map(e),l,s)))(e(c(t)))}return d.invert=function(n){return c(t((a||(a=r(l,i.map(e),ec)))(n)))},d.domain=function(e){return arguments.length?(i=Array.from(e,eh),u()):i.slice()},d.range=function(e){return arguments.length?(l=Array.from(e),u()):l.slice()},d.rangeRound=function(e){return l=Array.from(e),s=ep,u()},d.clamp=function(e){return arguments.length?(c=!!e||eg,u()):c!==eg},d.interpolate=function(e){return arguments.length?(s=e,u()):s},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function ek(){return ew()(eg,eg)}var eS=n(89999),eE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eO(e){var t;if(!(t=eE.exec(e)))throw Error("invalid format: "+e);return new eC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function eC(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ej(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function e_(e){return(e=ej(Math.abs(e)))?e[1]:NaN}function eP(e,t){var n=ej(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+Array(o-r.length+2).join("0")}eO.prototype=eC.prototype,eC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var eN={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eP(100*e,t),r:eP,s:function(e,t){var n=ej(e,t);if(!n)return e+"";var o=n[0],a=n[1],i=a-(r=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,l=o.length;return i===l?o:i>l?o+Array(i-l+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+Array(1-i).join("0")+ej(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function eT(e){return e}var eA=Array.prototype.map,eM=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function eI(e,t,n,r){var o,l,s=y(e,t,n);switch((r=eO(null==r?",f":r)).type){case"s":var c=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(l=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(e_(c)/3)))-e_(Math.abs(s))))||(r.precision=l),i(r,c);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(l=Math.max(0,e_(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(o=Math.abs(o=s)))-e_(o))+1)||(r.precision=l-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(l=Math.max(0,-e_(Math.abs(s))))||(r.precision=l-("%"===r.type)*2)}return a(r)}function eR(e){var t=e.domain;return e.ticks=function(e){var n=t();return g(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return eI(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,a=t(),i=0,l=a.length-1,s=a[i],c=a[l],u=10;for(c<s&&(o=s,s=c,c=o,o=i,i=l,l=o);u-- >0;){if((o=v(s,c,n))===r)return a[i]=s,a[l]=c,t(a);if(o>0)s=Math.floor(s/o)*o,c=Math.ceil(c/o)*o;else if(o<0)s=Math.ceil(s*o)/o,c=Math.floor(c*o)/o;else break;r=o}return e},e}function eD(){var e=ek();return e.copy=function(){return ex(e,eD())},eS.o.apply(e,arguments),eR(e)}function eL(e,t){e=e.slice();var n,r=0,o=e.length-1,a=e[r],i=e[o];return i<a&&(n=r,r=o,o=n,n=a,a=i,i=n),e[r]=t.floor(a),e[o]=t.ceil(i),e}function eZ(e){return Math.log(e)}function ez(e){return Math.exp(e)}function eB(e){return-Math.log(-e)}function eF(e){return-Math.exp(-e)}function eH(e){return isFinite(e)?+("1e"+e):e<0?0:e}function eq(e){return(t,n)=>-e(-t,n)}function eW(e){let t,n;let r=e(eZ,ez),o=r.domain,i=10;function l(){var a,l;return t=(a=i)===Math.E?Math.log:10===a&&Math.log10||2===a&&Math.log2||(a=Math.log(a),e=>Math.log(e)/a),n=10===(l=i)?eH:l===Math.E?Math.exp:e=>Math.pow(l,e),o()[0]<0?(t=eq(t),n=eq(n),e(eB,eF)):e(eZ,ez),r}return r.base=function(e){return arguments.length?(i=+e,l()):i},r.domain=function(e){return arguments.length?(o(e),l()):o()},r.ticks=e=>{let r,a;let l=o(),s=l[0],c=l[l.length-1],u=c<s;u&&([s,c]=[c,s]);let d=t(s),f=t(c),p=null==e?10:+e,h=[];if(!(i%1)&&f-d<p){if(d=Math.floor(d),f=Math.ceil(f),s>0){for(;d<=f;++d)for(r=1;r<i;++r)if(!((a=d<0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}}else for(;d<=f;++d)for(r=i-1;r>=1;--r)if(!((a=d>0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}2*h.length<p&&(h=g(s,c,p))}else h=g(d,f,Math.min(f-d,p)).map(n);return u?h.reverse():h},r.tickFormat=(e,o)=>{if(null==e&&(e=10),null==o&&(o=10===i?"s":","),"function"!=typeof o&&(i%1||null!=(o=eO(o)).precision||(o.trim=!0),o=a(o)),e===1/0)return o;let l=Math.max(1,i*e/r.ticks().length);return e=>{let r=e/n(Math.round(t(e)));return r*i<i-.5&&(r*=i),r<=l?o(e):""}},r.nice=()=>o(eL(o(),{floor:e=>n(Math.floor(t(e))),ceil:e=>n(Math.ceil(t(e)))})),r}function eU(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function eK(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function e$(e){var t=1,n=e(eU(1),eK(t));return n.constant=function(n){return arguments.length?e(eU(t=+n),eK(t)):t},eR(n)}a=(o=function(e){var t,n,o,a=void 0===e.grouping||void 0===e.thousands?eT:(t=eA.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,a=[],i=0,l=t[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),a.push(e.substring(o-=l,o+l)),!((s+=l+1)>r));)l=t[i=(i+1)%t.length];return a.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",l=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",c=void 0===e.numerals?eT:(o=eA.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return o[+e]})}),u=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"−":e.minus+"",f=void 0===e.nan?"NaN":e.nan+"";function p(e){var t=(e=eO(e)).fill,n=e.align,o=e.sign,p=e.symbol,h=e.zero,m=e.width,g=e.comma,v=e.precision,y=e.trim,b=e.type;"n"===b?(g=!0,b="g"):eN[b]||(void 0===v&&(v=12),y=!0,b="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var x="$"===p?i:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===p?l:/[%p]/.test(b)?u:"",k=eN[b],S=/[defgprs%]/.test(b);function E(e){var i,l,u,p=x,E=w;if("c"===b)E=k(e)+E,e="";else{var O=(e=+e)<0||1/e<0;if(e=isNaN(e)?f:k(Math.abs(e),v),y&&(e=function(e){t:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break t;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),O&&0==+e&&"+"!==o&&(O=!1),p=(O?"("===o?o:d:"-"===o||"("===o?"":o)+p,E=("s"===b?eM[8+r/3]:"")+E+(O&&"("===o?")":""),S){for(i=-1,l=e.length;++i<l;)if(48>(u=e.charCodeAt(i))||u>57){E=(46===u?s+e.slice(i+1):e.slice(i))+E,e=e.slice(0,i);break}}}g&&!h&&(e=a(e,1/0));var C=p.length+e.length+E.length,j=C<m?Array(m-C+1).join(t):"";switch(g&&h&&(e=a(j+e,j.length?m-E.length:1/0),j=""),n){case"<":e=p+e+E+j;break;case"=":e=p+j+e+E;break;case"^":e=j.slice(0,C=j.length>>1)+p+e+E+j.slice(C);break;default:e=j+p+e+E}return c(e)}return v=void 0===v?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),E.toString=function(){return e+""},E}return{format:p,formatPrefix:function(e,t){var n=p(((e=eO(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(e_(t)/3))),o=Math.pow(10,-r),a=eM[8+r/3];return function(e){return n(o*e)+a}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,i=o.formatPrefix;var eV=n(36967);function eX(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function eG(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function eY(e){return e<0?-e*e:e*e}function eQ(e){var t=e(eg,eg),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(eg,eg):.5===n?e(eG,eY):e(eX(n),eX(1/n)):n},eR(t)}function eJ(){var e=eQ(ew());return e.copy=function(){return ex(e,eJ()).exponent(e.exponent())},eS.o.apply(e,arguments),e}function e0(){return eJ.apply(null,arguments).exponent(.5)}function e1(e){return Math.sign(e)*e*e}function e2(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function e6(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function e4(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function e3(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}let e5=new Date,e8=new Date;function e7(e,t,n,r){function o(t){return e(t=0==arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{let t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,r,a)=>{let i;let l=[];if(n=o.ceil(n),a=null==a?1:Math.floor(a),!(n<r)||!(a>0))return l;do l.push(i=new Date(+n)),t(n,a),e(n);while(i<n&&n<r);return l},o.filter=n=>e7(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(o.count=(t,r)=>(e5.setTime(+t),e8.setTime(+r),e(e5),e(e8),Math.floor(n(e5,e8))),o.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?o.filter(r?t=>r(t)%e==0:t=>o.count(0,t)%e==0):o:null),o}let e9=e7(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);e9.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?e7(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):e9:null,e9.range;let te=e7(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());te.range;let tt=e7(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());tt.range;let tn=e7(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());tn.range;let tr=e7(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getHours());tr.range;let to=e7(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());to.range;let ta=e7(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);ta.range;let ti=e7(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);ti.range;let tl=e7(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));function ts(e){return e7(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}tl.range;let tc=ts(0),tu=ts(1),td=ts(2),tf=ts(3),tp=ts(4),th=ts(5),tm=ts(6);function tg(e){return e7(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/6048e5)}tc.range,tu.range,td.range,tf.range,tp.range,th.range,tm.range;let tv=tg(0),ty=tg(1),tb=tg(2),tx=tg(3),tw=tg(4),tk=tg(5),tS=tg(6);tv.range,ty.range,tb.range,tx.range,tw.range,tk.range,tS.range;let tE=e7(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());tE.range;let tO=e7(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());tO.range;let tC=e7(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());tC.every=e=>isFinite(e=Math.floor(e))&&e>0?e7(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,tC.range;let tj=e7(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function t_(e,t,n,r,o,a){let i=[[te,1,1e3],[te,5,5e3],[te,15,15e3],[te,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function l(t,n,r){let o=Math.abs(n-t)/r,a=w(([,,e])=>e).right(i,o);if(a===i.length)return e.every(y(t/31536e6,n/31536e6,r));if(0===a)return e9.every(Math.max(y(t,n,r),1));let[l,s]=i[o/i[a-1][2]<i[a][2]/o?a-1:a];return l.every(s)}return[function(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let o=n&&"function"==typeof n.range?n:l(e,t,n),a=o?o.range(e,+t+1):[];return r?a.reverse():a},l]}tj.every=e=>isFinite(e=Math.floor(e))&&e>0?e7(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,tj.range;let[tP,tN]=t_(tj,tO,tv,tl,to,tn),[tT,tA]=t_(tC,tE,tc,ta,tr,tt);function tM(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function tI(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tR(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var tD={"-":"",_:" ",0:"0"},tL=/^\s*\d+/,tZ=/^%/,tz=/[\\^$*+?|[\]().{}]/g;function tB(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",a=o.length;return r+(a<n?Array(n-a+1).join(t)+o:o)}function tF(e){return e.replace(tz,"\\$&")}function tH(e){return RegExp("^(?:"+e.map(tF).join("|")+")","i")}function tq(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function tW(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function tU(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function tK(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function t$(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function tV(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function tX(e,t,n){var r=tL.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function tG(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function tY(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function tQ(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function tJ(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function t0(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function t1(e,t,n){var r=tL.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function t2(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function t6(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function t4(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function t3(e,t,n){var r=tL.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function t5(e,t,n){var r=tL.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function t8(e,t,n){var r=tZ.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function t7(e,t,n){var r=tL.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function t9(e,t,n){var r=tL.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ne(e,t){return tB(e.getDate(),t,2)}function nt(e,t){return tB(e.getHours(),t,2)}function nn(e,t){return tB(e.getHours()%12||12,t,2)}function nr(e,t){return tB(1+ta.count(tC(e),e),t,3)}function no(e,t){return tB(e.getMilliseconds(),t,3)}function na(e,t){return no(e,t)+"000"}function ni(e,t){return tB(e.getMonth()+1,t,2)}function nl(e,t){return tB(e.getMinutes(),t,2)}function ns(e,t){return tB(e.getSeconds(),t,2)}function nc(e){var t=e.getDay();return 0===t?7:t}function nu(e,t){return tB(tc.count(tC(e)-1,e),t,2)}function nd(e){var t=e.getDay();return t>=4||0===t?tp(e):tp.ceil(e)}function nf(e,t){return e=nd(e),tB(tp.count(tC(e),e)+(4===tC(e).getDay()),t,2)}function np(e){return e.getDay()}function nh(e,t){return tB(tu.count(tC(e)-1,e),t,2)}function nm(e,t){return tB(e.getFullYear()%100,t,2)}function ng(e,t){return tB((e=nd(e)).getFullYear()%100,t,2)}function nv(e,t){return tB(e.getFullYear()%1e4,t,4)}function ny(e,t){var n=e.getDay();return tB((e=n>=4||0===n?tp(e):tp.ceil(e)).getFullYear()%1e4,t,4)}function nb(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tB(t/60|0,"0",2)+tB(t%60,"0",2)}function nx(e,t){return tB(e.getUTCDate(),t,2)}function nw(e,t){return tB(e.getUTCHours(),t,2)}function nk(e,t){return tB(e.getUTCHours()%12||12,t,2)}function nS(e,t){return tB(1+ti.count(tj(e),e),t,3)}function nE(e,t){return tB(e.getUTCMilliseconds(),t,3)}function nO(e,t){return nE(e,t)+"000"}function nC(e,t){return tB(e.getUTCMonth()+1,t,2)}function nj(e,t){return tB(e.getUTCMinutes(),t,2)}function n_(e,t){return tB(e.getUTCSeconds(),t,2)}function nP(e){var t=e.getUTCDay();return 0===t?7:t}function nN(e,t){return tB(tv.count(tj(e)-1,e),t,2)}function nT(e){var t=e.getUTCDay();return t>=4||0===t?tw(e):tw.ceil(e)}function nA(e,t){return e=nT(e),tB(tw.count(tj(e),e)+(4===tj(e).getUTCDay()),t,2)}function nM(e){return e.getUTCDay()}function nI(e,t){return tB(ty.count(tj(e)-1,e),t,2)}function nR(e,t){return tB(e.getUTCFullYear()%100,t,2)}function nD(e,t){return tB((e=nT(e)).getUTCFullYear()%100,t,2)}function nL(e,t){return tB(e.getUTCFullYear()%1e4,t,4)}function nZ(e,t){var n=e.getUTCDay();return tB((e=n>=4||0===n?tw(e):tw.ceil(e)).getUTCFullYear()%1e4,t,4)}function nz(){return"+0000"}function nB(){return"%"}function nF(e){return+e}function nH(e){return Math.floor(+e/1e3)}function nq(e){return new Date(e)}function nW(e){return e instanceof Date?+e:+new Date(+e)}function nU(e,t,n,r,o,a,i,l,s,c){var u=ek(),d=u.invert,f=u.domain,p=c(".%L"),h=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),x=c("%Y");function w(e){return(s(e)<e?p:l(e)<e?h:i(e)<e?m:a(e)<e?g:r(e)<e?o(e)<e?v:y:n(e)<e?b:x)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,nW)):f().map(nq)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?w:c(t)},u.nice=function(e){var n=f();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?f(eL(n,e)):u},u.copy=function(){return ex(u,nU(e,t,n,r,o,a,i,l,s,c))},u}function nK(){return eS.o.apply(nU(tT,tA,tC,tE,tc,ta,tr,tt,te,s).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function n$(){return eS.o.apply(nU(tP,tN,tj,tO,tv,ti,to,tn,te,c).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function nV(){var e,t,n,r,o,a=0,i=1,l=eg,s=!1;function c(t){return null==t||isNaN(t=+t)?o:l(0===n?.5:(t=(r(t)-e)*n,s?Math.max(0,Math.min(1,t)):t))}function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,l=e(n,r),c):[l(0),l(1)]}}return c.domain=function(o){return arguments.length?([a,i]=o,e=r(a=+a),t=r(i=+i),n=e===t?0:1/(t-e),c):[a,i]},c.clamp=function(e){return arguments.length?(s=!!e,c):s},c.interpolator=function(e){return arguments.length?(l=e,c):l},c.range=u(ef),c.rangeRound=u(ep),c.unknown=function(e){return arguments.length?(o=e,c):o},function(o){return r=o,e=o(a),t=o(i),n=e===t?0:1/(t-e),c}}function nX(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function nG(){var e=eQ(nV());return e.copy=function(){return nX(e,nG()).exponent(e.exponent())},eS.O.apply(e,arguments)}function nY(){return nG.apply(null,arguments).exponent(.5)}function nQ(){var e,t,n,r,o,a,i,l=0,s=.5,c=1,u=1,d=eg,f=!1;function p(e){return isNaN(e=+e)?i:(e=.5+((e=+a(e))-t)*(u*e<u*t?r:o),d(f?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var n,r,o;return arguments.length?([n,r,o]=t,d=function(e,t){void 0===t&&(t=e,e=ef);for(var n=0,r=t.length-1,o=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(o,o=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}(e,[n,r,o]),p):[d(0),d(.5),d(1)]}}return p.domain=function(i){return arguments.length?([l,s,c]=i,e=a(l=+l),t=a(s=+s),n=a(c=+c),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),u=t<e?-1:1,p):[l,s,c]},p.clamp=function(e){return arguments.length?(f=!!e,p):f},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=h(ef),p.rangeRound=h(ep),p.unknown=function(e){return arguments.length?(i=e,p):i},function(i){return a=i,e=i(l),t=i(s),n=i(c),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),u=t<e?-1:1,p}}function nJ(){var e=eQ(nQ());return e.copy=function(){return nX(e,nJ()).exponent(e.exponent())},eS.O.apply(e,arguments)}function n0(){return nJ.apply(null,arguments).exponent(.5)}function n1(e,t){if((o=e.length)>1)for(var n,r,o,a=1,i=e[t[0]],l=i.length;a<o;++a)for(r=i,i=e[t[a]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}s=(l=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,a=e.days,i=e.shortDays,l=e.months,s=e.shortMonths,c=tH(o),u=tq(o),d=tH(a),f=tq(a),p=tH(i),h=tq(i),m=tH(l),g=tq(l),v=tH(s),y=tq(s),b={a:function(e){return i[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:ne,e:ne,f:na,g:ng,G:ny,H:nt,I:nn,j:nr,L:no,m:ni,M:nl,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:nF,s:nH,S:ns,u:nc,U:nu,V:nf,w:np,W:nh,x:null,X:null,y:nm,Y:nv,Z:nb,"%":nB},x={a:function(e){return i[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:nx,e:nx,f:nO,g:nD,G:nZ,H:nw,I:nk,j:nS,L:nE,m:nC,M:nj,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:nF,s:nH,S:n_,u:nP,U:nN,V:nA,w:nM,W:nI,x:null,X:null,y:nR,Y:nL,Z:nz,"%":nB},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:t0,e:t0,f:t5,g:tG,G:tX,H:t2,I:t2,j:t1,L:t3,m:tJ,M:t6,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:tQ,Q:t7,s:t9,S:t4,u:tU,U:tK,V:t$,w:tW,W:tV,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:tG,Y:tX,Z:tY,"%":t8};function k(e,t){return function(n){var r,o,a,i=[],l=-1,s=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++l<c;)37===e.charCodeAt(l)&&(i.push(e.slice(s,l)),null!=(o=tD[r=e.charAt(++l)])?r=e.charAt(++l):o="e"===r?" ":"0",(a=t[r])&&(r=a(n,o)),i.push(r),s=l+1);return i.push(e.slice(s,l)),i.join("")}}function S(e,t){return function(n){var r,o,a=tR(1900,void 0,1);if(E(a,e,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!t||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(r=(o=(r=tI(tR(a.y,0,1))).getUTCDay())>4||0===o?ty.ceil(r):ty(r),r=ti.offset(r,(a.V-1)*7),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(r=(o=(r=tM(tR(a.y,0,1))).getDay())>4||0===o?tu.ceil(r):tu(r),r=ta.offset(r,(a.V-1)*7),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?tI(tR(a.y,0,1)).getUTCDay():tM(tR(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,tI(a)):tM(a)}}function E(e,t,n,r){for(var o,a,i=0,l=t.length,s=n.length;i<l;){if(r>=s)return -1;if(37===(o=t.charCodeAt(i++))){if(!(a=w[(o=t.charAt(i++))in tD?t.charAt(i++):o])||(r=a(e,n,r))<0)return -1}else if(o!=n.charCodeAt(r++))return -1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,l.parse,c=l.utcFormat,l.utcParse;var n2=n(22516),n6=n(76115);function n4(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function n3(e,t){return e[t]}function n5(e){let t=[];return t.key=e,t}var n8=n(95645),n7=n.n(n8),n9=n(99008),re=n.n(n9),rt=n(77571),rn=n.n(rt),rr=n(86757),ro=n.n(rr),ra=n(42715),ri=n.n(ra),rl=n(13735),rs=n.n(rl),rc=n(11314),ru=n.n(rc),rd=n(82559),rf=n.n(rd),rp=n(75551),rh=n.n(rp),rm=n(21652),rg=n.n(rm),rv=n(34935),ry=n.n(rv),rb=n(61134),rx=n.n(rb);function rw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var rk=function(e){return e},rS={},rE=function(e){return e===rS},rO=function(e){return function t(){return 0==arguments.length||1==arguments.length&&rE(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},rC=function(e){return function e(t,n){return 1===t?n:rO(function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var i=o.filter(function(e){return e!==rS}).length;return i>=t?n.apply(void 0,o):e(t-i,rO(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=o.map(function(e){return rE(e)?t.shift():e});return n.apply(void 0,((function(e){if(Array.isArray(e))return rw(e)})(a)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return rw(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rw(e,void 0)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(t))}))})}(e.length,e)},rj=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},r_=rC(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),rP=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t.length)return rk;var r=t.reverse(),o=r[0],a=r.slice(1);return function(){return a.reduce(function(e,t){return t(e)},o.apply(void 0,arguments))}},rN=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},rT=function(e){var t=null,n=null;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return t&&o.every(function(e,n){return e===t[n]})?n:(t=o,n=e.apply(void 0,o))}},rA=(rC(function(e,t,n){var r=+e;return r+n*(+t-r)}),rC(function(e,t,n){var r=t-+e;return(n-e)/(r=r||1/0)}),rC(function(e,t,n){var r=t-+e;return Math.max(0,Math.min(1,(n-e)/(r=r||1/0)))}),{rangeStep:function(e,t,n){for(var r=new(rx())(e),o=0,a=[];r.lt(t)&&o<1e5;)a.push(r.toNumber()),r=r.add(n),o++;return a},getDigitCount:function(e){return 0===e?1:Math.floor(new(rx())(e).abs().log(10).toNumber())+1}});function rM(e){return function(e){if(Array.isArray(e))return rD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||rR(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}}(e,t)||rR(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rR(e,t){if(e){if("string"==typeof e)return rD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rD(e,t)}}function rD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rL(e){var t=rI(e,2),n=t[0],r=t[1],o=n,a=r;return n>r&&(o=r,a=n),[o,a]}function rZ(e,t,n){if(e.lte(0))return new(rx())(0);var r=rA.getDigitCount(e.toNumber()),o=new(rx())(10).pow(r),a=e.div(o),i=1!==r?.05:.1,l=new(rx())(Math.ceil(a.div(i).toNumber())).add(n).mul(i).mul(o);return t?l:new(rx())(Math.ceil(l))}function rz(e,t,n){var r=1,o=new(rx())(e);if(!o.isint()&&n){var a=Math.abs(e);a<1?(r=new(rx())(10).pow(rA.getDigitCount(e)-1),o=new(rx())(Math.floor(o.div(r).toNumber())).mul(r)):a>1&&(o=new(rx())(Math.floor(e)))}else 0===e?o=new(rx())(Math.floor((t-1)/2)):n||(o=new(rx())(Math.floor(e)));var i=Math.floor((t-1)/2);return rP(r_(function(e){return o.add(new(rx())(e-i).mul(r)).toNumber()}),rj)(0,t)}var rB=rT(function(e){var t=rI(e,2),n=t[0],r=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=Math.max(o,2),l=rI(rL([n,r]),2),s=l[0],c=l[1];if(s===-1/0||c===1/0){var u=c===1/0?[s].concat(rM(rj(0,o-1).map(function(){return 1/0}))):[].concat(rM(rj(0,o-1).map(function(){return-1/0})),[c]);return n>r?rN(u):u}if(s===c)return rz(s,o,a);var d=function e(t,n,r,o){var a,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new(rx())(0),tickMin:new(rx())(0),tickMax:new(rx())(0)};var l=rZ(new(rx())(n).sub(t).div(r-1),o,i),s=Math.ceil((a=t<=0&&n>=0?new(rx())(0):(a=new(rx())(t).add(n).div(2)).sub(new(rx())(a).mod(l))).sub(t).div(l).toNumber()),c=Math.ceil(new(rx())(n).sub(a).div(l).toNumber()),u=s+c+1;return u>r?e(t,n,r,o,i+1):(u<r&&(c=n>0?c+(r-u):c,s=n>0?s:s+(r-u)),{step:l,tickMin:a.sub(new(rx())(s).mul(l)),tickMax:a.add(new(rx())(c).mul(l))})}(s,c,i,a),f=d.step,p=d.tickMin,h=d.tickMax,m=rA.rangeStep(p,h.add(new(rx())(.1).mul(f)),f);return n>r?rN(m):m});rT(function(e){var t=rI(e,2),n=t[0],r=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=Math.max(o,2),l=rI(rL([n,r]),2),s=l[0],c=l[1];if(s===-1/0||c===1/0)return[n,r];if(s===c)return rz(s,o,a);var u=rZ(new(rx())(c).sub(s).div(i-1),a,0),d=rP(r_(function(e){return new(rx())(s).add(new(rx())(e).mul(u)).toNumber()}),rj)(0,i).filter(function(e){return e>=s&&e<=c});return n>r?rN(d):d});var rF=rT(function(e,t){var n=rI(e,2),r=n[0],o=n[1],a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=rI(rL([r,o]),2),l=i[0],s=i[1];if(l===-1/0||s===1/0)return[r,o];if(l===s)return[l];var c=rZ(new(rx())(s).sub(l).div(Math.max(t,2)-1),a,0),u=[].concat(rM(rA.rangeStep(new(rx())(l),new(rx())(s).sub(new(rx())(.99).mul(c)),c)),[s]);return r>o?rN(u):u}),rH=n(13137),rq=n(16630),rW=n(82944),rU=n(38569);function rK(e){return(rK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r$(Object(n),!0).forEach(function(t){rX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rX(e,t,n){var r;return(r=function(e,t){if("object"!==rK(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==rK(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===rK(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rG(e){return function(e){if(Array.isArray(e))return rY(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rY(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rY(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rQ(e,t,n){return rn()(e)||rn()(t)?n:(0,rq.P2)(t)?rs()(e,t,n):ro()(t)?t(e):n}function rJ(e,t,n,r){var o=ru()(e,function(e){return rQ(e,t)});if("number"===n){var a=o.filter(function(e){return(0,rq.hj)(e)||parseFloat(e)});return a.length?[re()(a),n7()(a)]:[1/0,-1/0]}return(r?o.filter(function(e){return!rn()(e)}):o).map(function(e){return(0,rq.P2)(e)||e instanceof Date?e:""})}var r0=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,i=null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0;if(i<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var l=o.range,s=0;s<i;s++){var c=s>0?r[s-1].coordinate:r[i-1].coordinate,u=r[s].coordinate,d=s>=i-1?r[0].coordinate:r[s+1].coordinate,f=void 0;if((0,rq.uY)(u-c)!==(0,rq.uY)(d-u)){var p=[];if((0,rq.uY)(d-u)===(0,rq.uY)(l[1]-l[0])){f=d;var h=u+l[1]-l[0];p[0]=Math.min(h,(h+c)/2),p[1]=Math.max(h,(h+c)/2)}else{f=c;var m=d+l[1]-l[0];p[0]=Math.min(u,(m+u)/2),p[1]=Math.max(u,(m+u)/2)}var g=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>g[0]&&e<=g[1]||e>=p[0]&&e<=p[1]){a=r[s].index;break}}else{var v=Math.min(c,d),y=Math.max(c,d);if(e>(v+u)/2&&e<=(y+u)/2){a=r[s].index;break}}}else for(var b=0;b<i;b++)if(0===b&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b>0&&b<i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b===i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2){a=n[b].index;break}return a},r1=function(e){var t,n=e.type.displayName,r=e.props,o=r.stroke,a=r.fill;switch(n){case"Line":t=o;break;case"Area":case"Radar":t=o&&"none"!==o?o:a;break;default:t=a}return t},r2=function(e){var t=e.barSize,n=e.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var o={},a=Object.keys(r),i=0,l=a.length;i<l;i++)for(var s=r[a[i]].stackGroups,c=Object.keys(s),u=0,d=c.length;u<d;u++){var f=s[c[u]],p=f.items,h=f.cateAxisId,m=p.filter(function(e){return(0,rW.Gf)(e.type).indexOf("Bar")>=0});if(m&&m.length){var g=m[0].props.barSize,v=m[0].props[h];o[v]||(o[v]=[]),o[v].push({item:m[0],stackList:m.slice(1),barSize:rn()(g)?t:g})}}return o},r6=function(e){var t,n=e.barGap,r=e.barCategoryGap,o=e.bandSize,a=e.sizeList,i=void 0===a?[]:a,l=e.maxBarSize,s=i.length;if(s<1)return null;var c=(0,rq.h1)(n,o,0,!0),u=[];if(i[0].barSize===+i[0].barSize){var d=!1,f=o/s,p=i.reduce(function(e,t){return e+t.barSize||0},0);(p+=(s-1)*c)>=o&&(p-=(s-1)*c,c=0),p>=o&&f>0&&(d=!0,f*=.9,p=s*f);var h={offset:((o-p)/2>>0)-c,size:0};t=i.reduce(function(e,t){var n={item:t.item,position:{offset:h.offset+h.size+c,size:d?f:t.barSize}},r=[].concat(rG(e),[n]);return h=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:h})}),r},u)}else{var m=(0,rq.h1)(r,o,0,!0);o-2*m-(s-1)*c<=0&&(c=0);var g=(o-2*m-(s-1)*c)/s;g>1&&(g>>=0);var v=l===+l?Math.min(g,l):g;t=i.reduce(function(e,t,n){var r=[].concat(rG(e),[{item:t.item,position:{offset:m+(g+c)*n+(g-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return t},r4=function(e,t,n,r){var o=n.children,a=n.width,i=n.margin,l=a-(i.left||0)-(i.right||0),s=(0,rU.z)({children:o,legendWidth:l});if(s){var c=r||{},u=c.width,d=c.height,f=s.align,p=s.verticalAlign,h=s.layout;if(("vertical"===h||"horizontal"===h&&"middle"===p)&&"center"!==f&&(0,rq.hj)(e[f]))return rV(rV({},e),{},rX({},f,e[f]+(u||0)));if(("horizontal"===h||"vertical"===h&&"center"===f)&&"middle"!==p&&(0,rq.hj)(e[p]))return rV(rV({},e),{},rX({},p,e[p]+(d||0)))}return e},r3=function(e,t,n,r,o){var a=t.props.children,i=(0,rW.NN)(a,rH.W).filter(function(e){var t;return t=e.props.direction,!!rn()(o)||("horizontal"===r?"yAxis"===o:"vertical"===r||"x"===t?"xAxis"===o:"y"!==t||"yAxis"===o)});if(i&&i.length){var l=i.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=rQ(t,n,0),o=Array.isArray(r)?[re()(r),n7()(r)]:[r,r],a=l.reduce(function(e,n){var r=rQ(t,n,0),a=o[0]-Math.abs(Array.isArray(r)?r[0]:r),i=o[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(i,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},r5=function(e,t,n,r,o){var a=t.map(function(t){return r3(e,t,n,o,r)}).filter(function(e){return!rn()(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},r8=function(e,t,n,r,o){var a=t.map(function(t){var a=t.props.dataKey;return"number"===n&&a&&r3(e,t,a,r)||rJ(e,a,n,o)});if("number"===n)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var i={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)i[t[n]]||(i[t[n]]=!0,e.push(t[n]));return e},[])},r7=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},r9=function(e,t,n,r){if(r)return e.map(function(e){return e.coordinate});var o,a,i=e.map(function(e){return e.coordinate===t&&(o=!0),e.coordinate===n&&(a=!0),e.coordinate});return o||i.push(t),a||i.push(n),i},oe=function(e,t,n){if(!e)return null;var r=e.scale,o=e.duplicateDomain,a=e.type,i=e.range,l="scaleBand"===e.realScaleType?r.bandwidth()/2:2,s=(t||n)&&"category"===a&&r.bandwidth?r.bandwidth()/l:0;return(s="angleAxis"===e.axisType&&(null==i?void 0:i.length)>=2?2*(0,rq.uY)(i[0]-i[1])*s:s,t&&(e.ticks||e.niceTicks))?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(o?o.indexOf(e):e)+s,value:e,offset:s}}).filter(function(e){return!rf()(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+s,value:e,index:t,offset:s}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+s,value:e,offset:s}}):r.domain().map(function(e,t){return{coordinate:r(e)+s,value:o?o[e]:e,index:t,offset:s}})},ot=new WeakMap,on=function(e,t){if("function"!=typeof t)return e;ot.has(e)||ot.set(e,new WeakMap);var n=ot.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},or=function(e,t,n){var r=e.scale,o=e.type,a=e.layout,i=e.axisType;if("auto"===r)return"radial"===a&&"radiusAxis"===i?{scale:d.Z(),realScaleType:"band"}:"radial"===a&&"angleAxis"===i?{scale:eD(),realScaleType:"linear"}:"category"===o&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!n)?{scale:d.x(),realScaleType:"point"}:"category"===o?{scale:d.Z(),realScaleType:"band"}:{scale:eD(),realScaleType:"linear"};if(ri()(r)){var l="scale".concat(rh()(r));return{scale:(u[l]||d.x)(),realScaleType:u[l]?l:"point"}}return ro()(r)?{scale:r}:{scale:d.x(),realScaleType:"point"}},oo=function(e){var t=e.domain();if(t&&!(t.length<=2)){var n=t.length,r=e.range(),o=Math.min(r[0],r[1])-1e-4,a=Math.max(r[0],r[1])+1e-4,i=e(t[0]),l=e(t[n-1]);(i<o||i>a||l<o||l>a)&&e.domain([t[0],t[n-1]])}},oa=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},oi=function(e,t){if(!t||2!==t.length||!(0,rq.hj)(t[0])||!(0,rq.hj)(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),o=[e[0],e[1]];return(!(0,rq.hj)(e[0])||e[0]<n)&&(o[0]=n),(!(0,rq.hj)(e[1])||e[1]>r)&&(o[1]=r),o[0]>r&&(o[0]=r),o[1]<n&&(o[1]=n),o},ol={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var o=0,a=0,i=0;i<t;++i){var l=rf()(e[i][n][1])?e[i][n][0]:e[i][n][1];l>=0?(e[i][n][0]=o,e[i][n][1]=o+l,o=e[i][n][1]):(e[i][n][0]=a,e[i][n][1]=a+l,a=e[i][n][1])}},expand:function(e,t){if((r=e.length)>0){for(var n,r,o,a=0,i=e[0].length;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}n1(e,t)}},none:n1,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,o=e[t[0]],a=o.length;r<a;++r){for(var i=0,l=0;i<n;++i)l+=e[i][r][1]||0;o[r][1]+=o[r][0]=-l/2}n1(e,t)}},wiggle:function(e,t){if((o=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,o,a=0,i=1;i<r;++i){for(var l=0,s=0,c=0;l<o;++l){for(var u=e[t[l]],d=u[i][1]||0,f=(d-(u[i-1][1]||0))/2,p=0;p<l;++p){var h=e[t[p]];f+=(h[i][1]||0)-(h[i-1][1]||0)}s+=d,c+=f*d}n[i-1][1]+=n[i-1][0]=a,s&&(a-=c/s)}n[i-1][1]+=n[i-1][0]=a,n1(e,t)}},positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var o=0,a=0;a<t;++a){var i=rf()(e[a][n][1])?e[a][n][0]:e[a][n][1];i>=0?(e[a][n][0]=o,e[a][n][1]=o+i,o=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},os=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),o=ol[n];return(function(){var e=(0,n6.Z)([]),t=n4,n=n1,r=n3;function o(o){var a,i,l=Array.from(e.apply(this,arguments),n5),s=l.length,c=-1;for(let e of o)for(a=0,++c;a<s;++a)(l[a][c]=[0,+r(e,l[a].key,c,o)]).data=e;for(a=0,i=(0,n2.Z)(t(l));a<s;++a)l[i[a]].index=a;return n(l,i),l}return o.keys=function(t){return arguments.length?(e="function"==typeof t?t:(0,n6.Z)(Array.from(t)),o):e},o.value=function(e){return arguments.length?(r="function"==typeof e?e:(0,n6.Z)(+e),o):r},o.order=function(e){return arguments.length?(t=null==e?n4:"function"==typeof e?e:(0,n6.Z)(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(n=null==e?n1:e,o):n},o})().keys(r).value(function(e,t){return+rQ(e,t,0)}).order(n4).offset(o)(e)},oc=function(e,t,n,r,o,a){if(!e)return null;var i=(a?t.reverse():t).reduce(function(e,t){var o=t.props,a=o.stackId;if(o.hide)return e;var i=t.props[n],l=e[i]||{hasStack:!1,stackGroups:{}};if((0,rq.P2)(a)){var s=l.stackGroups[a]||{numericAxisId:n,cateAxisId:r,items:[]};s.items.push(t),l.hasStack=!0,l.stackGroups[a]=s}else l.stackGroups[(0,rq.EL)("_stackId_")]={numericAxisId:n,cateAxisId:r,items:[t]};return rV(rV({},e),{},rX({},i,l))},{});return Object.keys(i).reduce(function(t,a){var l=i[a];return l.hasStack&&(l.stackGroups=Object.keys(l.stackGroups).reduce(function(t,a){var i=l.stackGroups[a];return rV(rV({},t),{},rX({},a,{numericAxisId:n,cateAxisId:r,items:i.items,stackedData:os(e,i.items,o)}))},{})),rV(rV({},t),{},rX({},a,l))},{})},ou=function(e,t){var n=t.realScaleType,r=t.type,o=t.tickCount,a=t.originalDomain,i=t.allowDecimals,l=n||t.scale;if("auto"!==l&&"linear"!==l)return null;if(o&&"number"===r&&a&&("auto"===a[0]||"auto"===a[1])){var s=e.domain();if(!s.length)return null;var c=rB(s,o,i);return e.domain([re()(c),n7()(c)]),{niceTicks:c}}return o&&"number"===r?{niceTicks:rF(e.domain(),o,i)}:null},od=function(e){var t=e.axis,n=e.ticks,r=e.bandSize,o=e.entry,a=e.index,i=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!rn()(o[t.dataKey])){var l=(0,rq.Ap)(n,"value",o[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var s=rQ(o,rn()(i)?t.dataKey:i);return rn()(s)?null:t.scale(s)},of=function(e){var t=e.axis,n=e.ticks,r=e.offset,o=e.bandSize,a=e.entry,i=e.index;if("category"===t.type)return n[i]?n[i].coordinate+r:null;var l=rQ(a,t.dataKey,t.domain[i]);return rn()(l)?null:t.scale(l)-o/2+r},op=function(e){var t=e.numericAxis,n=t.scale.domain();if("number"===t.type){var r=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return r<=0&&o>=0?0:o<0?o:r}return n[0]},oh=function(e,t){var n=e.props.stackId;if((0,rq.P2)(n)){var r=t[n];if(r){var o=r.items.indexOf(e);return o>=0?r.stackedData[o]:null}}return null},om=function(e,t,n){return Object.keys(e).reduce(function(r,o){var a=e[o].stackedData.reduce(function(e,r){var o=r.slice(t,n+1).reduce(function(e,t){return[re()(t.concat([e[0]]).filter(rq.hj)),n7()(t.concat([e[1]]).filter(rq.hj))]},[1/0,-1/0]);return[Math.min(e[0],o[0]),Math.max(e[1],o[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},og=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ov=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oy=function(e,t,n){if(ro()(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if((0,rq.hj)(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(og.test(e[0])){var o=+og.exec(e[0])[1];r[0]=t[0]-o}else ro()(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if((0,rq.hj)(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(ov.test(e[1])){var a=+ov.exec(e[1])[1];r[1]=t[1]+a}else ro()(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},ob=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var o=ry()(t,function(e){return e.coordinate}),a=1/0,i=1,l=o.length;i<l;i++){var s=o[i],c=o[i-1];a=Math.min((s.coordinate||0)-(c.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},ox=function(e,t,n){return!e||!e.length||rg()(e,rs()(n,"type.defaultProps.domain"))?t:e},ow=function(e,t){var n=e.props,r=n.dataKey,o=n.name,a=n.unit,i=n.formatter,l=n.tooltipType,s=n.chartType,c=n.hide;return rV(rV({},(0,rW.L6)(e,!1)),{},{dataKey:r,unit:a,formatter:i,name:o||r,color:r1(e),value:rQ(t,r),type:l,payload:t,chartType:s,hide:c})}},4094:function(e,t,n){"use strict";n.d(t,{os:function(){return d},xE:function(){return u}});var r=n(34067);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){var r,a;r=t,a=n[t],(r=function(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var l={widthCache:{},cacheCount:0},s={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},c="recharts_measurement_span",u=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||r.x.isSsr)return{width:0,height:0};var o=(Object.keys(t=i({},n)).forEach(function(e){t[e]||delete t[e]}),t),a=JSON.stringify({text:e,copyStyle:o});if(l.widthCache[a])return l.widthCache[a];try{var u=document.getElementById(c);u||((u=document.createElement("span")).setAttribute("id",c),u.setAttribute("aria-hidden","true"),document.body.appendChild(u));var d=i(i({},s),o);Object.assign(u.style,d),u.textContent="".concat(e);var f=u.getBoundingClientRect(),p={width:f.width,height:f.height};return l.widthCache[a]=p,++l.cacheCount>2e3&&(l.cacheCount=0,l.widthCache={}),p}catch(e){return{width:0,height:0}}},d=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}}},16630:function(e,t,n){"use strict";n.d(t,{Ap:function(){return w},EL:function(){return g},Kt:function(){return y},P2:function(){return h},bv:function(){return b},h1:function(){return v},hU:function(){return f},hj:function(){return p},k4:function(){return x},uY:function(){return d}});var r=n(42715),o=n.n(r),a=n(82559),i=n.n(a),l=n(13735),s=n.n(l),c=n(22345),u=n.n(c),d=function(e){return 0===e?0:e>0?1:-1},f=function(e){return o()(e)&&e.indexOf("%")===e.length-1},p=function(e){return u()(e)&&!i()(e)},h=function(e){return p(e)||o()(e)},m=0,g=function(e){var t=++m;return"".concat(e||"").concat(t)},v=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!p(e)&&!o()(e))return r;if(f(e)){var l=e.indexOf("%");n=t*parseFloat(e.slice(0,l))/100}else n=+e;return i()(n)&&(n=r),a&&n>t&&(n=t),n},y=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},b=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++){if(n[e[r]])return!0;n[e[r]]=!0}return!1},x=function(e,t){return p(e)&&p(t)?function(n){return e+n*(t-e)}:function(){return t}};function w(e,t,n){return e&&e.length?e.find(function(e){return e&&("function"==typeof t?t(e):s()(e,t))===n}):null}},34067:function(e,t,n){"use strict";n.d(t,{x:function(){return r}});var r={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return r[e]},set:function(e,t){if("string"==typeof e)r[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){r[t]=e[t]})}}}},1175:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var r=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o]}},39206:function(e,t,n){"use strict";n.d(t,{$4:function(){return h},Wk:function(){return f},op:function(){return p},t9:function(){return m},z3:function(){return b}});var r=n(77571),o=n.n(r),a=n(16630),i=n(85355);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){var r;return(r=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===l(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f=Math.PI/180,p=function(e,t,n,r){return{x:e+Math.cos(-f*r)*n,y:t+Math.sin(-f*r)*n}},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},m=function(e,t,n,r,l){var s=e.width,f=e.height,p=e.startAngle,m=e.endAngle,g=(0,a.h1)(e.cx,s,s/2),v=(0,a.h1)(e.cy,f,f/2),y=h(s,f,n),b=(0,a.h1)(e.innerRadius,y,0),x=(0,a.h1)(e.outerRadius,y,.8*y);return Object.keys(t).reduce(function(e,n){var a,s=t[n],f=s.domain,h=s.reversed;if(o()(s.range))"angleAxis"===r?a=[p,m]:"radiusAxis"===r&&(a=[b,x]),h&&(a=[a[1],a[0]]);else{var y,w=function(e){if(Array.isArray(e))return e}(y=a=s.range)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(y,2)||function(e,t){if(e){if("string"==typeof e)return d(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,2)}}(y,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();p=w[0],m=w[1]}var k=(0,i.Hq)(s,l),S=k.realScaleType,E=k.scale;E.domain(f).range(a),(0,i.zF)(E);var O=(0,i.g$)(E,c(c({},s),{},{realScaleType:S})),C=c(c(c({},s),O),{},{range:a,radius:x,realScaleType:S,scale:E,cx:g,cy:v,innerRadius:b,outerRadius:x,startAngle:p,endAngle:m});return c(c({},e),{},u({},n,C))},{})},g=function(e,t){var n=e.x,r=e.y;return Math.sqrt(Math.pow(n-t.x,2)+Math.pow(r-t.y,2))},v=function(e,t){var n=e.x,r=e.y,o=t.cx,a=t.cy,i=g({x:n,y:r},{x:o,y:a});if(i<=0)return{radius:i};var l=Math.acos((n-o)/i);return r>a&&(l=2*Math.PI-l),{radius:i,angle:180*l/Math.PI,angleInRadian:l}},y=function(e){var t=e.startAngle,n=e.endAngle,r=Math.min(Math.floor(t/360),Math.floor(n/360));return{startAngle:t-360*r,endAngle:n-360*r}},b=function(e,t){var n,r=v({x:e.x,y:e.y},t),o=r.radius,a=r.angle,i=t.innerRadius,l=t.outerRadius;if(o<i||o>l)return!1;if(0===o)return!0;var s=y(t),u=s.startAngle,d=s.endAngle,f=a;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;n=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;n=f>=d&&f<=u}return n?c(c({},t),{},{radius:o,angle:f+360*Math.min(Math.floor(t.startAngle/360),Math.floor(t.endAngle/360))}):null}},82944:function(e,t,n){"use strict";n.d(t,{$R:function(){return Z},$k:function(){return T},Bh:function(){return L},Gf:function(){return S},L6:function(){return M},NN:function(){return j},TT:function(){return P},eu:function(){return D},rL:function(){return I},sP:function(){return _}});var r=n(13735),o=n.n(r),a=n(77571),i=n.n(a),l=n(42715),s=n.n(l),c=n(86757),u=n.n(c),d=n(28302),f=n.n(d),p=n(2265),h=n(82558),m=n(16630),g=n(46485),v=n(41637),y=["children"],b=["children"];function x(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},S=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},E=null,O=null,C=function e(t){if(t===E&&Array.isArray(O))return O;var n=[];return p.Children.forEach(t,function(t){i()(t)||((0,h.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),O=n,E=t,n};function j(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return S(e)}):[S(t)],C(e).forEach(function(e){var t=o()(e,"type.displayName")||o()(e,"type.name");-1!==r.indexOf(t)&&n.push(e)}),n}function _(e,t){var n=j(e,t);return n&&n[0]}var P=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!!(0,m.hj)(n)&&!(n<=0)&&!!(0,m.hj)(r)&&!(r<=0)},N=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],T=function(e){return e&&"object"===w(e)&&"cx"in e&&"cy"in e&&"r"in e},A=function(e,t,n,r){var o,a=null!==(o=null===v.ry||void 0===v.ry?void 0:v.ry[r])&&void 0!==o?o:[];return!u()(e)&&(r&&a.includes(t)||v.Yh.includes(t))||n&&v.nv.includes(t)},M=function(e,t,n){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,p.isValidElement)(e)&&(r=e.props),!f()(r))return null;var o={};return Object.keys(r).forEach(function(e){var a;A(null===(a=r)||void 0===a?void 0:a[e],e,t,n)&&(o[e]=r[e])}),o},I=function e(t,n){if(t===n)return!0;var r=p.Children.count(t);if(r!==p.Children.count(n))return!1;if(0===r)return!0;if(1===r)return R(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var o=0;o<r;o++){var a=t[o],i=n[o];if(Array.isArray(a)||Array.isArray(i)){if(!e(a,i))return!1}else if(!R(a,i))return!1}return!0},R=function(e,t){if(i()(e)&&i()(t))return!0;if(!i()(e)&&!i()(t)){var n=e.props||{},r=n.children,o=x(n,y),a=t.props||{},l=a.children,s=x(a,b);if(r&&l)return(0,g.w)(o,s)&&I(r,l);if(!r&&!l)return(0,g.w)(o,s)}return!1},D=function(e,t){var n=[],r={};return C(e).forEach(function(e,o){if(e&&e.type&&s()(e.type)&&N.indexOf(e.type)>=0)n.push(e);else if(e){var a=S(e.type),i=t[a]||{},l=i.handler,c=i.once;if(l&&(!c||!r[a])){var u=l(e,a,o);n.push(u),r[a]=!0}}}),n},L=function(e){var t=e&&e.type;return t&&k[t]?k[t]:null},Z=function(e,t){return C(t).indexOf(e)}},46485:function(e,t,n){"use strict";function r(e,t){for(var n in e)if(({}).hasOwnProperty.call(e,n)&&(!({}).hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if(({}).hasOwnProperty.call(t,r)&&!({}).hasOwnProperty.call(e,r))return!1;return!0}n.d(t,{w:function(){return r}})},38569:function(e,t,n){"use strict";n.d(t,{z:function(){return c}});var r=n(22190),o=n(85355),a=n(82944);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c=function(e){var t,n=e.children,i=e.formattedGraphicalItems,l=e.legendWidth,c=e.legendContent,u=(0,a.sP)(n,r.D);return u?(t=u.props&&u.props.payload?u.props&&u.props.payload:"children"===c?(i||[]).reduce(function(e,t){var n=t.item,r=t.props,o=r.sectors||r.data||[];return e.concat(o.map(function(e){return{type:u.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(i||[]).map(function(e){var t=e.item,n=t.props,r=n.dataKey,a=n.name,i=n.legendType;return{inactive:n.hide,dataKey:r,type:u.props.iconType||i||"square",color:(0,o.fk)(t),value:a||r,payload:t.props}}),s(s(s({},u.props),r.D.getWithHeight(u,l)),{},{payload:t,item:u})):null}},93528:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(47230),o=n.n(r),a=n(86757),i=n.n(a);function l(e,t,n){return!0===t?o()(e,n):i()(t)?o()(e,t):e}},41637:function(e,t,n){"use strict";n.d(t,{Yh:function(){return l},Ym:function(){return d},bw:function(){return f},nv:function(){return u},ry:function(){return c}});var r=n(2265),o=n(28302),a=n.n(o);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var l=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],s=["points","pathLength"],c={svg:["viewBox","children"],polygon:s,polyline:s},u=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],d=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,r.isValidElement)(e)&&(n=e.props),!a()(n))return null;var o={};return Object.keys(n).forEach(function(e){u.includes(e)&&(o[e]=t||function(t){return n[e](n,t)})}),o},f=function(e,t,n){if(!a()(e)||"object"!==i(e))return null;var r=null;return Object.keys(e).forEach(function(o){var a=e[o];u.includes(o)&&"function"==typeof a&&(r||(r={}),r[o]=function(e){return a(t,n,e),null})}),r}},52744:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(80662));t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,o.default)(e),a="function"==typeof t;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,o=e.value;a?t(r,o,e):o&&((n=n||{})[r]=o)}}),n}},18975:function(e,t,n){"use strict";var r=n(40257);n(24601);var o=n(2265),a=o&&"object"==typeof o&&"default"in o?o:{default:o},i=void 0!==r&&r.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},s=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,o=t.optimizeForSpeed,a=void 0===o?i:o;c(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var s="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=s?s.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},t.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var n="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){i||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},t.deleteRule=function(e){if("undefined"==typeof window){this._serverSheet.deleteRule(e);return}if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},t.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},t.makeStyleTag=function(e,t,n){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var o=document.head||document.getElementsByTagName("head")[0];return n?o.insertBefore(r,n):o.appendChild(r),r},function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,[{key:"length",get:function(){return this._rulesCount}}]),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var u=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},d={};function f(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return d[r]||(d[r]="jsx-"+u(e+"-"+n)),d[r]}function p(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return d[n]||(d[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[n]}var h=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,o=t.optimizeForSpeed,a=void 0!==o&&o;this._sheet=r||new s({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),r&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,o=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var a=o.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=a,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var o=f(r,n);return{styleId:o,rules:Array.isArray(t)?t.map(function(e){return p(o,e)}):[p(o,t)]}}return{styleId:f(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=o.createContext(null);m.displayName="StyleSheetContext";var g=a.default.useInsertionEffect||a.default.useLayoutEffect,v="undefined"!=typeof window?new h:void 0;function y(e){var t=v||o.useContext(m);return t&&("undefined"==typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}y.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},t.style=y},29:function(e,t,n){"use strict";e.exports=n(18975).style},99623:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}},21092:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,a=s(e),i=a[0],l=a[1],c=new o((i+l)*3/4-l),u=0,d=l>0?i-4:i;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,a=[],i=0,l=r-o;i<l;i+=16383)a.push(function(e,t,r){for(var o,a=[],i=t;i<r;i+=3)a.push(n[(o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}(e,i,i+16383>l?l:i+16383));return 1===o?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===o&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,l=a.length;i<l;++i)n[i]=a[i],r[a.charCodeAt(i)]=i;function s(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},10536:function(e,t,n){"use strict";var r=n(21092),o=n(32119),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!l.isEncoding(t))throw TypeError("Unknown encoding: "+t);var n=0|h(e,t),r=i(n),o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(P(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(P(e,SharedArrayBuffer)||e&&P(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);var o=function(e){if(l.isBuffer(e)){var t,n=0|p(e.length),r=i(n);return 0===r.length||e.copy(r,0,0,n),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?i(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),i(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),n=i(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function f(e,t,n){var r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),l.prototype),r}function p(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return C(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(o)return r?-1:C(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,n){var o,a,i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",a=t;a<n;++a)o+=N[e[a]];return o}(this,t,n);case"utf8":case"utf-8":return b(this,t,n);case"ascii":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}(this,t,n);case"base64":return o=t,a=n,0===o&&a===this.length?r.fromByteArray(this):r.fromByteArray(this.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),o="",a=0;a<r.length-1;a+=2)o+=String.fromCharCode(r[a]+256*r[a+1]);return o}(this,t,n);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,o){var a;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),(a=n=+n)!=a&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return -1;n=e.length-1}else if(n<0){if(!o)return -1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var a,i=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;i=2,l/=2,s/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var u=-1;for(a=n;a<l;a++)if(c(e,a)===c(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===s)return u*i}else -1!==u&&(a-=a-u),u=-1}else for(n+s>l&&(n=l-s),a=n;a>=0;a--){for(var d=!0,f=0;f<s;f++)if(c(e,a+f)!==c(t,f)){d=!1;break}if(d)return a}return -1}function b(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var a,i,l,s,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:(192&(a=e[o+1]))==128&&(s=(31&c)<<6|63&a)>127&&(u=s);break;case 3:a=e[o+1],i=e[o+2],(192&a)==128&&(192&i)==128&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:a=e[o+1],i=e[o+2],l=e[o+3],(192&a)==128&&(192&i)==128&&(192&l)==128&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&l)>65535&&s<1114112&&(u=s)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}function x(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function w(e,t,n,r,o,a){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function k(e,t,n,r,o,a){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function S(e,t,n,r,a){return t=+t,n>>>=0,a||k(e,t,n,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,n,r,23,4),n+4}function E(e,t,n,r,a){return t=+t,n>>>=0,a||k(e,t,n,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,n,r,52,8),n+8}t.lW=l,t.h2=50,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return s(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return(c(e),e<=0)?i(e):void 0!==t?"string"==typeof n?i(e).fill(t,n):i(e).fill(t):i(e)},l.allocUnsafe=function(e){return u(e)},l.allocUnsafeSlow=function(e){return u(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(P(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),P(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;var n,r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(P(a,Uint8Array))o+a.length>r.length?l.from(a).copy(r,o):Uint8Array.prototype.set.call(r,a,o);else if(l.isBuffer(a))a.copy(r,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},l.byteLength=h,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.h2;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,o){if(P(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var a=o-r,i=n-t,s=Math.min(a,i),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){a=c[d],i=u[d];break}return a<i?-1:i<a?1:0},l.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,a,i,l,s,c,u,d,f=this.length-t;if((void 0===n||n>f)&&(n=f),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var p=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var a=t.length;r>a/2&&(r=a/2);for(var i=0;i<r;++i){var l=parseInt(t.substr(2*i,2),16);if(l!=l)break;e[n+i]=l}return i}(this,e,t,n);case"utf8":case"utf-8":return o=t,a=n,_(C(e,this.length-o),this,o,a);case"ascii":case"latin1":case"binary":return i=t,l=n,_(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(e),this,i,l);case"base64":return s=t,c=n,_(j(e),this,s,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,d=n,_(function(e,t){for(var n,r,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o.push(n%256),o.push(r);return o}(e,this.length-u),this,u,d);default:if(p)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=t,o=1,a=this[e+--r];r>0&&(o*=256);)a+=this[e+--r]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return(e>>>=0,t||x(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var o=Math.pow(2,8*n)-1;w(this,e,t,n,o,0)}var a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var o=Math.pow(2,8*n)-1;w(this,e,t,n,o,0)}var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);w(this,e,t,n,o-1,-o)}var a=0,i=1,l=0;for(this[t]=255&e;++a<n&&(i*=256);)e<0&&0===l&&0!==this[t+a-1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);w(this,e,t,n,o-1,-o)}var a=n-1,i=1,l=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,n){return S(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return S(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return E(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return E(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),o},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var o,a=e.charCodeAt(0);("utf8"===r&&a<128||"latin1"===r)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var i=l.isBuffer(e)?e:l.from(e,r),s=i.length;if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=i[o%s]}return this};var O=/[^+/0-9A-Za-z-_]/g;function C(e,t){t=t||1/0;for(var n,r=e.length,o=null,a=[],i=0;i<r;++i){if((n=e.charCodeAt(i))>55295&&n<57344){if(!o){if(n>56319||i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return a}function j(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function _(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length)&&!(o>=e.length);++o)t[o+n]=e[o];return o}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var N=function(){for(var e="0123456789abcdef",t=Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)t[r+o]=e[n]+e[o];return t}()},32119:function(e,t){t.read=function(e,t,n,r,o){var a,i,l=8*o-r-1,s=(1<<l)-1,c=s>>1,u=-7,d=n?o-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=l;u>0;a=256*a+e[t+d],d+=f,u-=8);for(i=a&(1<<-u)-1,a>>=-u,u+=r;u>0;i=256*i+e[t+d],d+=f,u-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,r),a-=c}return(p?-1:1)*i*Math.pow(2,a-r)},t.write=function(e,t,n,r,o,a){var i,l,s,c=8*a-o-1,u=(1<<c)-1,d=u>>1,f=23===o?5960464477539062e-23:0,p=r?0:a-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(l=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),i+d>=1?t+=f/s:t+=f*Math.pow(2,1-d),t*s>=2&&(i++,s/=2),i+d>=u?(l=0,i=u):i+d>=1?(l=(t*s-1)*Math.pow(2,o),i+=d):(l=t*Math.pow(2,d-1)*Math.pow(2,o),i=0));o>=8;e[n+p]=255&l,p+=h,l/=256,o-=8);for(i=i<<o|l,c+=o;c>0;e[n+p]=255&i,p+=h,i/=256,c-=8);e[n+p-h]|=128*m}},9973:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},85498:function(e,t,n){"use strict";var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U,K,$,V,X,G,Y;let Q,J,ee;function et(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function en(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}n.d(t,{ZP:function(){return tF}});let er=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return er=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>255*Math.random()&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^n()&15>>+e/4).toString(16))};function eo(e){return"object"==typeof e&&null!==e&&("name"in e&&"AbortError"===e.name||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}let ea=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e){try{if("[object Error]"===Object.prototype.toString.call(e)){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class ei extends Error{}class el extends ei{constructor(e,t,n,r){super(`${el.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=t}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){return e&&r?400===e?new ed(e,t,n,r):401===e?new ef(e,t,n,r):403===e?new ep(e,t,n,r):404===e?new eh(e,t,n,r):409===e?new em(e,t,n,r):422===e?new eg(e,t,n,r):429===e?new ev(e,t,n,r):e>=500?new ey(e,t,n,r):new el(e,t,n,r):new ec({message:n,cause:ea(t)})}}class es extends el{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class ec extends el{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class eu extends ec{constructor({message:e}={}){super({message:e??"Request timed out."})}}class ed extends el{}class ef extends el{}class ep extends el{}class eh extends el{}class em extends el{}class eg extends el{}class ev extends el{}class ey extends el{}let eb=/^[a-z][a-z0-9+.-]*:/i,ex=e=>eb.test(e);function ew(e){return"object"!=typeof e?{}:e??{}}let ek=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new ei(`${e} must be an integer`);if(t<0)throw new ei(`${e} must be a positive integer`);return t},eS=e=>{try{return JSON.parse(e)}catch(e){return}},eE=e=>new Promise(t=>setTimeout(t,e)),eO={off:0,error:200,warn:300,info:400,debug:500},eC=(e,t,n)=>{if(e){if(Object.prototype.hasOwnProperty.call(eO,e))return e;eT(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(eO))}`)}};function ej(){}function e_(e,t,n){return!t||eO[e]>eO[n]?ej:t[e].bind(t)}let eP={error:ej,warn:ej,info:ej,debug:ej},eN=new WeakMap;function eT(e){let t=e.logger,n=e.logLevel??"off";if(!t)return eP;let r=eN.get(t);if(r&&r[0]===n)return r[1];let o={error:e_("error",t,n),warn:e_("warn",t,n),info:e_("info",t,n),debug:e_("debug",t,n)};return eN.set(t,[n,o]),o}let eA=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,"x-api-key"===e.toLowerCase()||"authorization"===e.toLowerCase()||"cookie"===e.toLowerCase()||"set-cookie"===e.toLowerCase()?"***":t]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),eM="0.54.0",eI=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,eR=()=>{let e="undefined"!=typeof Deno&&null!=Deno.build?"deno":"undefined"!=typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":eL(Deno.build.os),"X-Stainless-Arch":eD(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":eL(globalThis.process.platform??"unknown"),"X-Stainless-Arch":eD(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,o=n[3]||0;return{browser:e,version:`${t}.${r}.${o}`}}}return null}();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},eD=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",eL=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",eZ=()=>Q??(Q=eR());function ez(...e){let t=globalThis.ReadableStream;if(void 0===t)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function eB(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ez({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function eF(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function eH(e){if(null===e||"object"!=typeof e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}let eq=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function eW(e){let t;return(J??(J=(t=new globalThis.TextEncoder).encode.bind(t)))(e)}function eU(e){let t;return(ee??(ee=(t=new globalThis.TextDecoder).decode.bind(t)))(e)}class eK{constructor(){r.set(this,void 0),o.set(this,void 0),et(this,r,new Uint8Array,"f"),et(this,o,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?eW(e):e;et(this,r,function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}([en(this,r,"f"),n]),"f");let a=[];for(;null!=(t=function(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}(en(this,r,"f"),en(this,o,"f")));){if(t.carriage&&null==en(this,o,"f")){et(this,o,t.index,"f");continue}if(null!=en(this,o,"f")&&(t.index!==en(this,o,"f")+1||t.carriage)){a.push(eU(en(this,r,"f").subarray(0,en(this,o,"f")-1))),et(this,r,en(this,r,"f").subarray(en(this,o,"f")),"f"),et(this,o,null,"f");continue}let e=null!==en(this,o,"f")?t.preceding-1:t.preceding,n=eU(en(this,r,"f").subarray(0,e));a.push(n),et(this,r,en(this,r,"f").subarray(t.index),"f"),et(this,o,null,"f")}return a}flush(){return en(this,r,"f").length?this.decode("\n"):[]}}r=new WeakMap,o=new WeakMap,eK.NEWLINE_CHARS=new Set(["\n","\r"]),eK.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class e${constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new e$(async function*(){if(n)throw new ei("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of eV(e,t)){if("completion"===n.event)try{yield JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("message_start"===n.event||"message_delta"===n.event||"message_stop"===n.event||"content_block_start"===n.event||"content_block_delta"===n.event||"content_block_stop"===n.event)try{yield JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("ping"!==n.event&&"error"===n.event)throw new el(void 0,eS(n.data)??n.data,void 0,e.headers)}r=!0}catch(e){if(eo(e))return;throw e}finally{r||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;async function*r(){let t=new eK;for await(let n of eF(e))for(let e of t.decode(n))yield e;for(let e of t.flush())yield e}return new e$(async function*(){if(n)throw new ei("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let e=!1;try{for await(let t of r())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(eo(e))return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=r=>({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new e$(()=>r(e),this.controller),new e$(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this;return ez({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let o=eW(JSON.stringify(n)+"\n");t.enqueue(o)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*eV(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}let n=new eG,r=new eK;for await(let t of eX(eF(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*eX(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?eW(n):n,o=new Uint8Array(t.length+r.length);for(o.set(t),o.set(r,t.length),t=o;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class eG{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}async function eY(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:o,startTime:a}=t,i=await (async()=>{if(t.options.stream)return(eT(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass)?t.options.__streamClass.fromSSEResponse(n,t.controller):e$.fromSSEResponse(n,t.controller);if(204===n.status)return null;if(t.options.__binaryResponse)return n;let r=n.headers.get("content-type"),o=r?.split(";")[0]?.trim();return o?.includes("application/json")||o?.endsWith("+json")?eQ(await n.json(),n):await n.text()})();return eT(e).debug(`[${r}] response parsed`,eA({retryOfRequestLogID:o,url:n.url,status:n.status,body:i,durationMs:Date.now()-a})),i}function eQ(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}class eJ extends Promise{constructor(e,t,n=eY){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,a.set(this,void 0),et(this,a,e,"f")}_thenUnwrap(e){return new eJ(en(this,a,"f"),this.responsePromise,async(t,n)=>eQ(e(await this.parseResponse(t,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(en(this,a,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}a=new WeakMap;class e0{constructor(e,t,n,r){i.set(this,void 0),et(this,i,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageRequestOptions()}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new ei("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await en(this,i,"f").requestAPIList(this.constructor,e)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(i=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class e1 extends eJ{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await eY(e,t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}class e2 extends e0{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let e=this.first_id;return e?{...this.options,query:{...ew(this.options.query),before_id:e}}:null}let e=this.last_id;return e?{...this.options,query:{...ew(this.options.query),after_id:e}}:null}}let e6=()=>{if("undefined"==typeof File){let{process:e}=globalThis;throw Error("`File` is not defined as a global, which is required for file uploads."+("string"==typeof e?.versions?.node&&20>parseInt(e.versions.node.split("."))?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function e4(e,t,n){return e6(),new File(e,t??"unknown_file",n)}function e3(e){return("object"==typeof e&&null!==e&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}let e5=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],e8=async(e,t)=>({...e,body:await e9(e.body,t)}),e7=new WeakMap,e9=async(e,t)=>{if(!await function(e){let t="function"==typeof e?e:e.fetch,n=e7.get(t);if(n)return n;let r=(async()=>{try{let e="Response"in t?t.Response:(await t("data:,")).constructor,n=new FormData;if(n.toString()===await new e(n).text())return!1;return!0}catch{return!0}})();return e7.set(t,r),r}(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>tr(n,e,t))),n},te=e=>e instanceof Blob&&"name"in e,tt=e=>"object"==typeof e&&null!==e&&(e instanceof Response||e5(e)||te(e)),tn=e=>{if(tt(e))return!0;if(Array.isArray(e))return e.some(tn);if(e&&"object"==typeof e){for(let t in e)if(tn(e[t]))return!0}return!1},tr=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(n instanceof Response){let r={},o=n.headers.get("Content-Type");o&&(r={type:o}),e.append(t,e4([await n.blob()],e3(n),r))}else if(e5(n))e.append(t,e4([await new Response(eB(n)).blob()],e3(n)));else if(te(n))e.append(t,e4([n],e3(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(n=>tr(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>tr(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},to=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ta=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&to(e),ti=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob;async function tl(e,t,n){if(e6(),e=await e,t||(t=e3(e)),ta(e))return e instanceof File&&null==t&&null==n?e:e4([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(ti(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),e4(await ts(r),t,n)}let r=await ts(e);if(!n?.type){let e=r.find(e=>"object"==typeof e&&"type"in e&&e.type);"string"==typeof e&&(n={...n,type:e})}return e4(r,t,n)}async function ts(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(to(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(e5(e))for await(let n of e)t.push(...await ts(n));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:""}${function(e){if("object"!=typeof e||null===e)return"";let t=Object.getOwnPropertyNames(e);return`; props: [${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`)}return t}class tc{constructor(e){this._client=e}}let tu=Symbol.for("brand.privateNullableHeaders"),td=Array.isArray,tf=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[o,a]of function*(e){let t;if(!e)return;if(tu in e){let{values:t,nulls:n}=e;for(let e of(yield*t.entries(),n))yield[e,null];return}let n=!1;for(let r of(e instanceof Headers?t=e.entries():td(e)?t=e:(n=!0,t=Object.entries(e??{})),t)){let e=r[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=td(r[1])?r[1]:[r[1]],o=!1;for(let r of t)void 0!==r&&(n&&!o&&(o=!0,yield[e,null]),yield[e,r])}}(r)){let r=o.toLowerCase();e.has(r)||(t.delete(o),e.add(r)),null===a?(t.delete(o),n.add(r)):(t.append(o,a),n.delete(r))}}return{[tu]:!0,values:t,nulls:n}};function tp(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}let th=((e=tp)=>function(t,...n){let r;if(1===t.length)return t[0];let o=!1,a=t.reduce((t,r,a)=>(/[?#]/.test(r)&&(o=!0),t+r+(a===n.length?"":(o?encodeURIComponent:e)(String(n[a])))),""),i=a.split(/[?#]/,1)[0],l=[],s=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;for(;null!==(r=s.exec(i));)l.push({start:r.index,length:r[0].length});if(l.length>0){let e=0,t=l.reduce((t,n)=>{let r=" ".repeat(n.start-e),o="^".repeat(n.length);return e=n.start+n.length,t+r+o},"");throw new ei(`Path parameters result in path with invalid segments:+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199],{12660:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},88009:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},37527:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]},name:"bank",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},9775:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},68208:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83669:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26430:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},5540:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11894:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},44625:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},26349:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62670:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},73879:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},29271:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41169:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},11741:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},97416:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},6520:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34310:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM472 744a40 40 0 1080 0 40 40 0 10-80 0zm16-104h48c4.4 0 8-3.6 8-8V448c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8z"}}]},name:"file-exclamation",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},38434:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},10798:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71282:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},92403:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},48231:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},62272:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},45246:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},16601:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},99890:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},28595:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},96473:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},89245:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},69993:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},78355:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},23907:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},55322:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},8881:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},71891:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},41361:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"}}]},name:"team",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58630:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},3632:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},35291:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},i=n(55015),l=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},58747:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}},75105:function(e,t,n){"use strict";n.d(t,{Z:function(){return et}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(87602),s=n(59221),c=n(86757),u=n.n(c),d=n(95645),f=n.n(d),p=n(77571),h=n.n(p),m=n(82559),g=n.n(m),v=n(21652),y=n.n(v),b=n(57165),x=n(81889),w=n(9841),k=n(58772),S=n(34067),E=n(16630),O=n(85355),C=n(82944),j=["layout","type","stroke","connectNulls","isRange","ref"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(i,e);var t,n,r,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=R(i);return e=t?Reflect.construct(n,arguments,R(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return I(e)}(this,e)});function i(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return D(I(e=a.call.apply(a,[this].concat(n))),"state",{isAnimationFinished:!0}),D(I(e),"id",(0,E.EL)("recharts-area-")),D(I(e),"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),u()(t)&&t()}),D(I(e),"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),u()(t)&&t()}),e}return n=[{key:"renderDots",value:function(e,t,n){var r=this.props.isAnimationActive,a=this.state.isAnimationFinished;if(r&&!a)return null;var l=this.props,s=l.dot,c=l.points,u=l.dataKey,d=(0,C.L6)(this.props,!1),f=(0,C.L6)(s,!0),p=c.map(function(e,t){var n=T(T(T({key:"dot-".concat(t),r:3},d),f),{},{dataKey:u,cx:e.x,cy:e.y,index:t,value:e.value,payload:e.payload});return i.renderDotItem(s,n)}),h={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return o.createElement(w.m,P({className:"recharts-area-dots"},h),p)}},{key:"renderHorizontalRect",value:function(e){var t=this.props,n=t.baseLine,r=t.points,a=t.strokeWidth,i=r[0].x,l=r[r.length-1].x,s=e*Math.abs(i-l),c=f()(r.map(function(e){return e.y||0}));return((0,E.hj)(n)&&"number"==typeof n?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(f()(n.map(function(e){return e.y||0})),c)),(0,E.hj)(c))?o.createElement("rect",{x:i<l?i:i-s,y:0,width:s,height:Math.floor(c+(a?parseInt("".concat(a),10):1))}):null}},{key:"renderVerticalRect",value:function(e){var t=this.props,n=t.baseLine,r=t.points,a=t.strokeWidth,i=r[0].y,l=r[r.length-1].y,s=e*Math.abs(i-l),c=f()(r.map(function(e){return e.x||0}));return((0,E.hj)(n)&&"number"==typeof n?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(f()(n.map(function(e){return e.x||0})),c)),(0,E.hj)(c))?o.createElement("rect",{x:0,y:i<l?i:i-s,width:c+(a?parseInt("".concat(a),10):1),height:Math.floor(s)}):null}},{key:"renderClipRect",value:function(e){return"vertical"===this.props.layout?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:"renderAreaStatically",value:function(e,t,n,r){var a=this.props,i=a.layout,l=a.type,s=a.stroke,c=a.connectNulls,u=a.isRange,d=(a.ref,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,j));return o.createElement(w.m,{clipPath:n?"url(#clipPath-".concat(r,")"):null},o.createElement(b.H,P({},(0,C.L6)(d,!0),{points:e,connectNulls:c,type:l,baseLine:t,layout:i,stroke:"none",className:"recharts-area-area"})),"none"!==s&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:e})),"none"!==s&&u&&o.createElement(b.H,P({},(0,C.L6)(this.props,!1),{className:"recharts-area-curve",layout:i,type:l,connectNulls:c,fill:"none",points:t})))}},{key:"renderAreaWithAnimation",value:function(e,t){var n=this,r=this.props,a=r.points,i=r.baseLine,l=r.isAnimationActive,c=r.animationBegin,u=r.animationDuration,d=r.animationEasing,f=r.animationId,p=this.state,m=p.prevPoints,v=p.prevBaseLine;return o.createElement(s.ZP,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"area-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var l=r.t;if(m){var s,c=m.length/a.length,u=a.map(function(e,t){var n=Math.floor(t*c);if(m[n]){var r=m[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e});return s=(0,E.hj)(i)&&"number"==typeof i?(0,E.k4)(v,i)(l):h()(i)||g()(i)?(0,E.k4)(v,0)(l):i.map(function(e,t){var n=Math.floor(t*c);if(v[n]){var r=v[n],o=(0,E.k4)(r.x,e.x),a=(0,E.k4)(r.y,e.y);return T(T({},e),{},{x:o(l),y:a(l)})}return e}),n.renderAreaStatically(u,s,e,t)}return o.createElement(w.m,null,o.createElement("defs",null,o.createElement("clipPath",{id:"animationClipPath-".concat(t)},n.renderClipRect(l))),o.createElement(w.m,{clipPath:"url(#animationClipPath-".concat(t,")")},n.renderAreaStatically(a,i,e,t)))})}},{key:"renderArea",value:function(e,t){var n=this.props,r=n.points,o=n.baseLine,a=n.isAnimationActive,i=this.state,l=i.prevPoints,s=i.prevBaseLine,c=i.totalLength;return a&&r&&r.length&&(!l&&c>0||!y()(l,r)||!y()(s,o))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,o,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,a=t.points,i=t.className,s=t.top,c=t.left,u=t.xAxis,d=t.yAxis,f=t.width,p=t.height,m=t.isAnimationActive,g=t.id;if(n||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=1===a.length,b=(0,l.Z)("recharts-area",i),x=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,E=x||S,O=h()(g)?this.id:g,j=null!==(e=(0,C.L6)(r,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,C.$k)(r)?r:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return o.createElement(w.m,{className:b},x||S?o.createElement("defs",null,o.createElement("clipPath",{id:"clipPath-".concat(O)},o.createElement("rect",{x:x?c:c-f/2,y:S?s:s-p/2,width:x?f:2*f,height:S?p:2*p})),!T&&o.createElement("clipPath",{id:"clipPath-dots-".concat(O)},o.createElement("rect",{x:c-A/2,y:s-A/2,width:f+A,height:p+A}))):null,y?null:this.renderArea(E,O),(r||y)&&this.renderDots(E,T,O),(!m||v)&&k.e.renderCallByParent(this.props,a))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}:e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null}}],n&&A(i.prototype,n),r&&A(i,r),Object.defineProperty(i,"prototype",{writable:!1}),i}(o.PureComponent);D(Z,"displayName","Area"),D(Z,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!S.x.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),D(Z,"getBaseValue",function(e,t,n,r){var o=e.layout,a=e.baseValue,i=t.props.baseValue,l=null!=i?i:a;if((0,E.hj)(l)&&"number"==typeof l)return l;var s="horizontal"===o?r:n,c=s.scale.domain();if("number"===s.type){var u=Math.max(c[0],c[1]),d=Math.min(c[0],c[1]);return"dataMin"===l?d:"dataMax"===l?u:u<0?u:Math.max(Math.min(c[0],c[1]),0)}return"dataMin"===l?c[0]:"dataMax"===l?c[1]:c[0]}),D(Z,"getComposedData",function(e){var t,n=e.props,r=e.item,o=e.xAxis,a=e.yAxis,i=e.xAxisTicks,l=e.yAxisTicks,s=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,p=e.offset,h=n.layout,m=u&&u.length,g=Z.getBaseValue(n,r,o,a),v="horizontal"===h,y=!1,b=f.map(function(e,t){m?n=u[d+t]:Array.isArray(n=(0,O.F$)(e,c))?y=!0:n=[g,n];var n,r=null==n[1]||m&&null==(0,O.F$)(e,c);return v?{x:(0,O.Hv)({axis:o,ticks:i,bandSize:s,entry:e,index:t}),y:r?null:a.scale(n[1]),value:n,payload:e}:{x:r?null:o.scale(n[1]),y:(0,O.Hv)({axis:a,ticks:l,bandSize:s,entry:e,index:t}),value:n,payload:e}});return t=m||y?b.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:null!=t&&null!=e.y?a.scale(t):null}:{x:null!=t?o.scale(t):null,y:e.y}}):v?a.scale(g):o.scale(g),T({points:b,baseLine:t,layout:h,isRange:y},p)}),D(Z,"renderDotItem",function(e,t){return o.isValidElement(e)?o.cloneElement(e,t):u()(e)?e(t):o.createElement(x.o,P({},t,{className:"recharts-area-dot"}))});var z=n(97059),B=n(62994),F=n(25311),H=(0,i.z)({chartName:"AreaChart",GraphicalChild:Z,axisComponents:[{axisType:"xAxis",AxisComp:z.K},{axisType:"yAxis",AxisComp:B.B}],formatAxisMap:F.t9}),q=n(56940),W=n(8147),U=n(22190),K=n(54061),$=n(65278),V=n(98593),X=n(69448),G=n(32644),Y=n(7084),Q=n(26898),J=n(97324),ee=n(1153);let et=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:l,stack:s=!1,colors:c=Q.s,valueFormatter:u=ee.Cj,startEndOnly:d=!1,showXAxis:f=!0,showYAxis:p=!0,yAxisWidth:h=56,intervalType:m="equidistantPreserveStart",showAnimation:g=!1,animationDuration:v=900,showTooltip:y=!0,showLegend:b=!0,showGridLines:w=!0,showGradient:k=!0,autoMinValue:S=!1,curveType:E="linear",minValue:O,maxValue:C,connectNulls:j=!1,allowDecimals:_=!0,noDataText:P,className:N,onValueChange:T,enableLegendSlider:A=!1,customTooltip:M,rotateLabelX:I,tickGap:R=5}=e,D=(0,r._T)(e,["data","categories","index","stack","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","showAnimation","animationDuration","showTooltip","showLegend","showGridLines","showGradient","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),L=(f||p)&&(!d||p)?20:0,[F,et]=(0,o.useState)(60),[en,er]=(0,o.useState)(void 0),[eo,ea]=(0,o.useState)(void 0),ei=(0,G.me)(i,c),el=(0,G.i4)(S,O,C),es=!!T;function ec(e){es&&(e===eo&&!en||(0,G.FB)(n,e)&&en&&en.dataKey===e?(ea(void 0),null==T||T(null)):(ea(e),null==T||T({eventType:"category",categoryClicked:e})),er(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,J.q)("w-full h-80",N)},D),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(H,{data:n,onClick:es&&(eo||en)?()=>{er(void 0),ea(void 0),null==T||T(null)}:void 0},w?o.createElement(q.q,{className:(0,J.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(z.K,{padding:{left:L,right:L},hide:!f,dataKey:l,tick:{transform:"translate(0, 6)"},ticks:d?[n[0][l],n[n.length-1][l]]:void 0,fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),interval:d?"preserveStartEnd":m,tickLine:!1,axisLine:!1,minTickGap:R,angle:null==I?void 0:I.angle,dy:null==I?void 0:I.verticalShift,height:null==I?void 0:I.xAxisHeight}),o.createElement(B.B,{width:h,hide:!p,axisLine:!1,tickLine:!1,type:"number",domain:el,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,J.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:u,allowDecimals:_}),o.createElement(W.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:y?e=>{let{active:t,payload:n,label:r}=e;return M?o.createElement(M,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:Y.fr.Gray})}),active:t,label:r}):o.createElement(V.ZP,{active:t,payload:n,label:r,valueFormatter:u,categoryColors:ei})}:o.createElement(o.Fragment,null),position:{y:0}}),b?o.createElement(U.D,{verticalAlign:"top",height:F,content:e=>{let{payload:t}=e;return(0,$.Z)({payload:t},ei,et,eo,es?e=>ec(e):void 0,A)}}):null,i.map(e=>{var t,n;return o.createElement("defs",{key:e},k?o.createElement("linearGradient",{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{offset:"5%",stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.15:.4}),o.createElement("stop",{offset:"95%",stopColor:"currentColor",stopOpacity:0})):o.createElement("linearGradient",{className:(0,ee.bM)(null!==(n=ei.get(e))&&void 0!==n?n:Y.fr.Gray,Q.K.text).textColor,id:ei.get(e),x1:"0",y1:"0",x2:"0",y2:"1"},o.createElement("stop",{stopColor:"currentColor",stopOpacity:en||eo&&eo!==e?.1:.3})))}),i.map(e=>{var t;return o.createElement(Z,{className:(0,ee.bM)(null!==(t=ei.get(e))&&void 0!==t?t:Y.fr.Gray,Q.K.text).strokeColor,strokeOpacity:en||eo&&eo!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(x.o,{className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(t=ei.get(u))&&void 0!==t?t:Y.fr.Gray,Q.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),es&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,G.FB)(n,e.dataKey)&&eo&&eo===e.dataKey?(ea(void 0),er(void 0),null==T||T(null)):(ea(e.dataKey),er({index:e.index,dataKey:e.dataKey}),null==T||T(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,G.FB)(n,e)&&!(en||eo&&eo!==e)||(null==en?void 0:en.index)===f&&(null==en?void 0:en.dataKey)===e?o.createElement(x.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,J.q)("stroke-tremor-background dark:stroke-dark-tremor-background",T?"cursor-pointer":"",(0,ee.bM)(null!==(r=ei.get(d))&&void 0!==r?r:Y.fr.Gray,Q.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:E,dataKey:e,stroke:"",fill:"url(#".concat(ei.get(e),")"),strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:g,animationDuration:v,stackId:s?"a":void 0,connectNulls:j})}),T?i.map(e=>o.createElement(K.x,{className:(0,J.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:E,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:j,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ec(n)}})):null):o.createElement(X.Z,{noDataText:P})))});et.displayName="AreaChart"},40278:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(47625),u=n(93765),d=n(31699),f=n(97059),p=n(62994),h=n(25311),m=(0,u.z)({chartName:"BarChart",GraphicalChild:d.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:f.K},{axisType:"yAxis",AxisComp:p.B}],formatAxisMap:h.t9}),g=n(56940),v=n(8147),y=n(22190),b=n(65278),x=n(98593),w=n(69448),k=n(32644);let S=s.forwardRef((e,t)=>{let{data:n=[],categories:u=[],index:h,colors:S=a.s,valueFormatter:E=l.Cj,layout:O="horizontal",stack:C=!1,relative:j=!1,startEndOnly:_=!1,animationDuration:P=900,showAnimation:N=!1,showXAxis:T=!0,showYAxis:A=!0,yAxisWidth:M=56,intervalType:I="equidistantPreserveStart",showTooltip:R=!0,showLegend:D=!0,showGridLines:L=!0,autoMinValue:Z=!1,minValue:z,maxValue:B,allowDecimals:F=!0,noDataText:H,onValueChange:q,enableLegendSlider:W=!1,customTooltip:U,rotateLabelX:K,tickGap:$=5,className:V}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap","className"]),G=T||A?20:0,[Y,Q]=(0,s.useState)(60),J=(0,k.me)(u,S),[ee,et]=s.useState(void 0),[en,er]=(0,s.useState)(void 0),eo=!!q;function ea(e,t,n){var r,o,a,i;n.stopPropagation(),q&&((0,k.vZ)(ee,Object.assign(Object.assign({},e.payload),{value:e.value}))?(er(void 0),et(void 0),null==q||q(null)):(er(null===(o=null===(r=e.tooltipPayload)||void 0===r?void 0:r[0])||void 0===o?void 0:o.dataKey),et(Object.assign(Object.assign({},e.payload),{value:e.value})),null==q||q(Object.assign({eventType:"bar",categoryClicked:null===(i=null===(a=e.tooltipPayload)||void 0===a?void 0:a[0])||void 0===i?void 0:i.dataKey},e.payload))))}let ei=(0,k.i4)(Z,z,B);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-80",V)},X),s.createElement(c.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(m,{data:n,stackOffset:C?"sign":j?"expand":"none",layout:"vertical"===O?"vertical":"horizontal",onClick:eo&&(en||ee)?()=>{et(void 0),er(void 0),null==q||q(null)}:void 0},L?s.createElement(g.q,{className:(0,i.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==O,vertical:"vertical"===O}):null,"vertical"!==O?s.createElement(f.K,{padding:{left:G,right:G},hide:!T,dataKey:h,interval:_?"preserveStartEnd":I,tick:{transform:"translate(0, 6)"},ticks:_?[n[0][h],n[n.length-1][h]]:void 0,fill:"",stroke:"",className:(0,i.q)("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight,minTickGap:$}):s.createElement(f.K,{hide:!T,type:"number",tick:{transform:"translate(-3, 0)"},domain:ei,fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:E,minTickGap:$,allowDecimals:F,angle:null==K?void 0:K.angle,dy:null==K?void 0:K.verticalShift,height:null==K?void 0:K.xAxisHeight}),"vertical"!==O?s.createElement(p.B,{width:M,hide:!A,axisLine:!1,tickLine:!1,type:"number",domain:ei,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:j?e=>"".concat((100*e).toString()," %"):E,allowDecimals:F}):s.createElement(p.B,{width:M,hide:!A,dataKey:h,axisLine:!1,tickLine:!1,ticks:_?[n[0][h],n[n.length-1][h]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:(0,i.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")}),s.createElement(v.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:R?e=>{let{active:t,payload:n,label:r}=e;return U?s.createElement(U,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=J.get(e.dataKey))&&void 0!==t?t:o.fr.Gray})}),active:t,label:r}):s.createElement(x.ZP,{active:t,payload:n,label:r,valueFormatter:E,categoryColors:J})}:s.createElement(s.Fragment,null),position:{y:0}}),D?s.createElement(y.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,b.Z)({payload:t},J,Q,en,eo?e=>{eo&&(e!==en||ee?(er(e),null==q||q({eventType:"category",categoryClicked:e})):(er(void 0),null==q||q(null)),et(void 0))}:void 0,W)}}):null,u.map(e=>{var t;return s.createElement(d.$,{className:(0,i.q)((0,l.bM)(null!==(t=J.get(e))&&void 0!==t?t:o.fr.Gray,a.K.background).fillColor,q?"cursor-pointer":""),key:e,name:e,type:"linear",stackId:C||j?"a":void 0,dataKey:e,fill:"",isAnimationActive:N,animationDuration:P,shape:e=>((e,t,n,r)=>{let{fillOpacity:o,name:a,payload:i,value:l}=e,{x:c,width:u,y:d,height:f}=e;return"horizontal"===r&&f<0?(d+=f,f=Math.abs(f)):"vertical"===r&&u<0&&(c+=u,u=Math.abs(u)),s.createElement("rect",{x:c,y:d,width:u,height:f,opacity:t||n&&n!==a?(0,k.vZ)(t,Object.assign(Object.assign({},i),{value:l}))?o:.3:o})})(e,ee,en,O),onClick:ea})})):s.createElement(w.Z,{noDataText:H})))});S.displayName="BarChart"},14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return ez}});var r=n(5853),o=n(7084),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(60474),u=n(47625),d=n(93765),f=n(86757),p=n.n(f),h=n(9841),m=n(81889),g=n(87602),v=n(82944),y=["points","className","baseLinePoints","connectNulls"];function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return w(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var k=function(e){return e&&e.x===+e.x&&e.y===+e.y},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){k(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),k(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},E=function(e,t){var n=S(e);t&&(n=[n.reduce(function(e,t){return[].concat(x(e),x(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},O=function(e,t,n){var r=E(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(E(t.reverse(),n).slice(1))},C=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,y);if(!t||!t.length)return null;var i=(0,g.Z)("recharts-polygon",n);if(r&&r.length){var l=a.stroke&&"none"!==a.stroke,c=O(t,r,o);return s.createElement("g",{className:i},s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===c.slice(-1)?a.fill:"none",stroke:"none",d:c})),l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(t,o)})):null,l?s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"none",d:E(r,o)})):null)}var u=E(t,o);return s.createElement("path",b({},(0,v.L6)(a,!0),{fill:"Z"===u.slice(-1)?a.fill:"none",className:i,d:u}))},j=n(58811),_=n(41637),P=n(39206);function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(){return(T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach(function(t){L(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z(r.key),r)}}function R(e,t){return(R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t,n){return(t=Z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e){var t=function(e,t){if("object"!==N(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==N(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===N(t)?t:String(t)}var z=Math.PI/180,B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&R(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=D(a);return e=t?Reflect.construct(n,arguments,D(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===N(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"getTickLineCoord",value:function(e){var t=this.props,n=t.cx,r=t.cy,o=t.radius,a=t.orientation,i=t.tickSize,l=(0,P.op)(n,r,o,e.coordinate),s=(0,P.op)(n,r,o+("inner"===a?-1:1)*(i||8),e.coordinate);return{x1:l.x,y1:l.y,x2:s.x,y2:s.y}}},{key:"getTickTextAnchor",value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*z);return n>1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,a=e.axisLineType,i=M(M({},(0,v.L6)(this.props,!1)),{},{fill:"none"},(0,v.L6)(o,!1));if("circle"===a)return s.createElement(m.o,T({className:"recharts-polar-angle-axis-line"},i,{cx:t,cy:n,r:r}));var l=this.props.ticks.map(function(e){return(0,P.op)(t,n,r,e.coordinate)});return s.createElement(C,T({className:"recharts-polar-angle-axis-line"},i,{points:l}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,i=t.tickFormatter,l=t.stroke,c=(0,v.L6)(this.props,!1),u=(0,v.L6)(r,!1),d=M(M({},c),{},{fill:"none"},(0,v.L6)(o,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),p=M(M(M({textAnchor:e.getTickTextAnchor(t)},c),{},{stroke:"none",fill:l},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return s.createElement(h.m,T({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),o&&s.createElement("line",T({className:"recharts-polar-angle-axis-tick-line"},d,f)),r&&a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?s.createElement(h.m,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks()):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,T({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],n&&I(a.prototype,n),r&&I(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);L(B,"displayName","PolarAngleAxis"),L(B,"axisType","angleAxis"),L(B,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var F=n(35802),H=n.n(F),q=n(37891),W=n.n(q),U=n(26680),K=["cx","cy","angle","ticks","axisLine"],$=["ticks","tick","angle","tickFormatter","stroke"];function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(){return(X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach(function(t){en(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Q(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,er(r.key),r)}}function ee(e,t){return(ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function et(e){return(et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function en(e,t,n){return(t=er(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(e){var t=function(e,t){if("object"!==V(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==V(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===V(t)?t:String(t)}var eo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=et(a);return e=t?Reflect.construct(n,arguments,et(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===V(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"getTickValueCoord",value:function(e){var t=e.coordinate,n=this.props,r=n.angle,o=n.cx,a=n.cy;return(0,P.op)(o,a,t,r)}},{key:"getTickTextAnchor",value:function(){var e;switch(this.props.orientation){case"left":e="end";break;case"right":e="start";break;default:e="middle"}return e}},{key:"getViewBox",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,o=e.ticks,a=H()(o,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:W()(o,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,o=e.ticks,a=e.axisLine,i=Q(e,K),l=o.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=(0,P.op)(t,n,l[0],r),u=(0,P.op)(t,n,l[1],r),d=Y(Y(Y({},(0,v.L6)(i,!1)),{},{fill:"none"},(0,v.L6)(a,!1)),{},{x1:c.x,y1:c.y,x2:u.x,y2:u.y});return s.createElement("line",X({className:"recharts-polar-radius-axis-line"},d))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.angle,i=t.tickFormatter,l=t.stroke,c=Q(t,$),u=this.getTickTextAnchor(),d=(0,v.L6)(c,!1),f=(0,v.L6)(r,!1),p=n.map(function(t,n){var c=e.getTickValueCoord(t),p=Y(Y(Y(Y({textAnchor:u,transform:"rotate(".concat(90-o,", ").concat(c.x,", ").concat(c.y,")")},d),{},{stroke:"none",fill:l},f),{},{index:n},c),{},{payload:t});return s.createElement(h.m,X({className:"recharts-polar-radius-axis-tick",key:"tick-".concat(t.coordinate)},(0,_.bw)(e.props,t,n)),a.renderTickItem(r,p,i?i(t.value,n):t.value))});return s.createElement(h.m,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return t&&t.length?s.createElement(h.m,{className:"recharts-polar-radius-axis"},n&&this.renderAxisLine(),r&&this.renderTicks(),U._.renderCallByParent(this.props,this.getViewBox())):null}}],r=[{key:"renderTickItem",value:function(e,t,n){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(j.x,X({},t,{className:"recharts-polar-radius-axis-tick-value"}),n)}}],n&&J(a.prototype,n),r&&J(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);en(eo,"displayName","PolarRadiusAxis"),en(eo,"axisType","radiusAxis"),en(eo,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});var ea=n(59221),ei=n(13735),el=n.n(ei),es=n(21652),ec=n.n(es),eu=n(77571),ed=n.n(eu),ef=n(57165),ep=n(58772),eh=n(20407),em=n(34067),eg=n(16630),ev=n(85355),ey=n(1175),eb=n(11638);function ex(e){return(ex="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(){return(ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(t){e_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eP(r.key),r)}}function eO(e,t){return(eO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eC(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ej(e){return(ej=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e_(e,t,n){return(t=eP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eP(e){var t=function(e,t){if("object"!==ex(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ex(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ex(t)?t:String(t)}var eN=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eO(e,t)}(a,e);var t,n,r,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=ej(a);return e=t?Reflect.construct(n,arguments,ej(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===ex(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eC(e)}(this,e)});function a(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),e_(eC(t=o.call(this,e)),"pieRef",null),e_(eC(t),"sectorRefs",[]),e_(eC(t),"id",(0,eg.EL)("recharts-pie-")),e_(eC(t),"handleAnimationEnd",function(){var e=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),p()(e)&&e()}),e_(eC(t),"handleAnimationStart",function(){var e=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),p()(e)&&e()}),t.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},t}return n=[{key:"isActiveIndex",value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?-1!==t.indexOf(e):e===t}},{key:"hasActiveIndex",value:function(){var e=this.props.activeIndex;return Array.isArray(e)?0!==e.length:e||0===e}},{key:"renderLabels",value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var t=this.props,n=t.label,r=t.labelLine,o=t.dataKey,i=t.valueKey,l=(0,v.L6)(this.props,!1),c=(0,v.L6)(n,!1),u=(0,v.L6)(r,!1),d=n&&n.offsetRadius||20,f=e.map(function(e,t){var f=(e.startAngle+e.endAngle)/2,p=(0,P.op)(e.cx,e.cy,e.outerRadius+d,f),m=eS(eS(eS(eS({},l),e),{},{stroke:"none"},c),{},{index:t,textAnchor:a.getTextAnchor(p.x,e.cx)},p),g=eS(eS(eS(eS({},l),e),{},{fill:"none",stroke:e.fill},u),{},{index:t,points:[(0,P.op)(e.cx,e.cy,e.outerRadius,f),p],key:"line"}),v=o;return ed()(o)&&ed()(i)?v="value":ed()(o)&&(v=i),s.createElement(h.m,{key:"label-".concat(e.startAngle,"-").concat(e.endAngle)},r&&a.renderLabelLineItem(r,g),a.renderLabelItem(n,m,(0,ev.F$)(e,v)))});return s.createElement(h.m,{className:"recharts-pie-labels"},f)}},{key:"renderSectorsStatically",value:function(e){var t=this,n=this.props,r=n.activeShape,o=n.blendStroke,a=n.inactiveShape;return e.map(function(n,i){if((null==n?void 0:n.startAngle)===0&&(null==n?void 0:n.endAngle)===0&&1!==e.length)return null;var l=t.isActiveIndex(i),c=a&&t.hasActiveIndex()?a:null,u=eS(eS({},n),{},{stroke:o?n.fill:n.stroke,tabIndex:-1});return s.createElement(h.m,ew({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:"recharts-pie-sector"},(0,_.bw)(t.props,n,i),{key:"sector-".concat(null==n?void 0:n.startAngle,"-").concat(null==n?void 0:n.endAngle,"-").concat(n.midAngle)}),s.createElement(eb.bn,ew({option:l?r:c,isActive:l,shapeType:"sector"},u)))})}},{key:"renderSectorsWithAnimation",value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,o=t.animationBegin,a=t.animationDuration,i=t.animationEasing,l=t.animationId,c=this.state,u=c.prevSectors,d=c.prevIsAnimationActive;return s.createElement(ea.ZP,{begin:o,duration:a,isActive:r,easing:i,from:{t:0},to:{t:1},key:"pie-".concat(l,"-").concat(d),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,o=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=u&&u[t],i=t>0?el()(e,"paddingAngle",0):0;if(n){var l=(0,eg.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),s=eS(eS({},e),{},{startAngle:a+i,endAngle:a+l(r)+i});o.push(s),a=s.endAngle}else{var c=e.endAngle,d=e.startAngle,f=(0,eg.k4)(0,c-d)(r),p=eS(eS({},e),{},{startAngle:a+i,endAngle:a+f+i});o.push(p),a=p.endAngle}}),s.createElement(h.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!ec()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,a=t.label,i=t.cx,l=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eg.hj)(i)||!(0,eg.hj)(l)||!(0,eg.hj)(c)||!(0,eg.hj)(u))return null;var p=(0,g.Z)("recharts-pie",o);return s.createElement(h.m,{tabIndex:this.props.rootTabIndex,className:p,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),U._.renderCallByParent(this.props,null,!1),(!d||f)&&ep.e.renderCallByParent(this.props,r,!1))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e<t?"end":"middle"}},{key:"renderLabelLineItem",value:function(e,t){return s.isValidElement(e)?s.cloneElement(e,t):p()(e)?e(t):s.createElement(ef.H,ew({},t,{type:"linear",className:"recharts-pie-label-line"}))}},{key:"renderLabelItem",value:function(e,t,n){if(s.isValidElement(e))return s.cloneElement(e,t);var r=n;return p()(e)&&(r=e(t),s.isValidElement(r))?r:s.createElement(j.x,ew({},t,{alignmentBaseline:"middle",className:"recharts-pie-label-text"}),r)}}],n&&eE(a.prototype,n),r&&eE(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(s.PureComponent);e_(eN,"displayName","Pie"),e_(eN,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!em.x.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0}),e_(eN,"parseDeltaAngle",function(e,t){return(0,eg.uY)(t-e)*Math.min(Math.abs(t-e),360)}),e_(eN,"getRealPieData",function(e){var t=e.props,n=t.data,r=t.children,o=(0,v.L6)(e.props,!1),a=(0,v.NN)(r,eh.b);return n&&n.length?n.map(function(e,t){return eS(eS(eS({payload:e},o),e),a&&a[t]&&a[t].props)}):a&&a.length?a.map(function(e){return eS(eS({},o),e.props)}):[]}),e_(eN,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,o=t.width,a=t.height,i=(0,P.$4)(o,a);return{cx:r+(0,eg.h1)(e.props.cx,o,o/2),cy:n+(0,eg.h1)(e.props.cy,a,a/2),innerRadius:(0,eg.h1)(e.props.innerRadius,i,0),outerRadius:(0,eg.h1)(e.props.outerRadius,i,.8*i),maxRadius:e.props.maxRadius||Math.sqrt(o*o+a*a)/2}}),e_(eN,"getComposedData",function(e){var t,n,r=e.item,o=e.offset,a=eN.getRealPieData(r);if(!a||!a.length)return null;var i=r.props,l=i.cornerRadius,s=i.startAngle,c=i.endAngle,u=i.paddingAngle,d=i.dataKey,f=i.nameKey,p=i.valueKey,h=i.tooltipType,m=Math.abs(r.props.minAngle),g=eN.parseCoordinateOfPie(r,o),v=eN.parseDeltaAngle(s,c),y=Math.abs(v),b=d;ed()(d)&&ed()(p)?((0,ey.Z)(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b="value"):ed()(d)&&((0,ey.Z)(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b=p);var x=a.filter(function(e){return 0!==(0,ev.F$)(e,b,0)}).length,w=y-x*m-(y>=360?x:x-1)*u,k=a.reduce(function(e,t){var n=(0,ev.F$)(t,b,0);return e+((0,eg.hj)(n)?n:0)},0);return k>0&&(t=a.map(function(e,t){var r,o=(0,ev.F$)(e,b,0),a=(0,ev.F$)(e,f,t),i=((0,eg.hj)(o)?o:0)/k,c=(r=t?n.endAngle+(0,eg.uY)(v)*u*(0!==o?1:0):s)+(0,eg.uY)(v)*((0!==o?m:0)+i*w),d=(r+c)/2,p=(g.innerRadius+g.outerRadius)/2,y=[{name:a,value:o,payload:e,dataKey:b,type:h}],x=(0,P.op)(g.cx,g.cy,p,d);return n=eS(eS(eS({percent:i,cornerRadius:l,name:a,tooltipPayload:y,midAngle:d,middleRadius:p,tooltipPosition:x},e),g),{},{value:(0,ev.F$)(e,b),startAngle:r,endAngle:c,payload:e,paddingAngle:(0,eg.uY)(v)*u})})),eS(eS({},g),{},{sectors:t,data:a})});var eT=(0,d.z)({chartName:"PieChart",GraphicalChild:eN,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:B},{axisType:"radiusAxis",AxisComp:eo}],formatAxisMap:P.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eA=n(8147),eM=n(69448),eI=n(98593);let eR=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return s.createElement(eI.$B,null,s.createElement("div",{className:(0,i.q)("px-4 py-2")},s.createElement(eI.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eD=(e,t)=>e.map((e,n)=>{let r=n<t.length?t[n]:o.fr.Gray;return Object.assign(Object.assign({},e),{color:r,className:(0,l.bM)(null!=r?r:o.fr.Gray,a.K.background).fillColor,fill:""})}),eL=(e,t,n,r)=>e||t((0,l.vP)(n.map(e=>e[r]))),eZ=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l}=e;return s.createElement("g",null,s.createElement(c.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:a,endAngle:i,className:l,fill:"",opacity:.3,style:{outline:"none"}}))},ez=s.forwardRef((e,t)=>{let{data:n=[],category:c="value",index:d="name",colors:f=a.s,variant:p="donut",valueFormatter:h=l.Cj,label:m,showLabel:g=!0,animationDuration:v=900,showAnimation:y=!1,showTooltip:b=!0,noDataText:x,onValueChange:w,customTooltip:k,className:S}=e,E=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),O="donut"==p,C=eL(m,h,n,c),[j,_]=s.useState(void 0),P=!!w;return(0,s.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[j]),s.createElement("div",Object.assign({ref:t,className:(0,i.q)("w-full h-40",S)},E),s.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?s.createElement(eT,{onClick:P&&j?()=>{_(void 0),null==w||w(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},g&&O?s.createElement("text",{className:(0,i.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},C):null,s.createElement(eN,{className:(0,i.q)("stroke-tremor-background dark:stroke-dark-tremor-background",w?"cursor-pointer":"cursor-default"),data:eD(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:O?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:c,nameKey:d,isAnimationActive:y,animationDuration:v,onClick:function(e,t,n){n.stopPropagation(),P&&(j===t?(_(void 0),null==w||w(null)):(_(t),null==w||w(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:j,inactiveShape:eZ,style:{outline:"none"}}),s.createElement(eA.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:b?e=>{var t;let{active:n,payload:r}=e;return k?s.createElement(k,{payload:null==r?void 0:r.map(e=>{var t,n,a;return Object.assign(Object.assign({},e),{color:null!==(a=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==a?a:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):s.createElement(eR,{active:n,payload:r,valueFormatter:h})}:s.createElement(s.Fragment,null)})):s.createElement(eM.Z,{noDataText:x})))});ez.displayName="DonutChart"},59664:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(5853),o=n(2265),a=n(47625),i=n(93765),l=n(54061),s=n(97059),c=n(62994),u=n(25311),d=(0,i.z)({chartName:"LineChart",GraphicalChild:l.x,axisComponents:[{axisType:"xAxis",AxisComp:s.K},{axisType:"yAxis",AxisComp:c.B}],formatAxisMap:u.t9}),f=n(56940),p=n(8147),h=n(22190),m=n(81889),g=n(65278),v=n(98593),y=n(69448),b=n(32644),x=n(7084),w=n(26898),k=n(97324),S=n(1153);let E=o.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:u,colors:E=w.s,valueFormatter:O=S.Cj,startEndOnly:C=!1,showXAxis:j=!0,showYAxis:_=!0,yAxisWidth:P=56,intervalType:N="equidistantPreserveStart",animationDuration:T=900,showAnimation:A=!1,showTooltip:M=!0,showLegend:I=!0,showGridLines:R=!0,autoMinValue:D=!1,curveType:L="linear",minValue:Z,maxValue:z,connectNulls:B=!1,allowDecimals:F=!0,noDataText:H,className:q,onValueChange:W,enableLegendSlider:U=!1,customTooltip:K,rotateLabelX:$,tickGap:V=5}=e,X=(0,r._T)(e,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","tickGap"]),G=j||_?20:0,[Y,Q]=(0,o.useState)(60),[J,ee]=(0,o.useState)(void 0),[et,en]=(0,o.useState)(void 0),er=(0,b.me)(i,E),eo=(0,b.i4)(D,Z,z),ea=!!W;function ei(e){ea&&(e===et&&!J||(0,b.FB)(n,e)&&J&&J.dataKey===e?(en(void 0),null==W||W(null)):(en(e),null==W||W({eventType:"category",categoryClicked:e})),ee(void 0))}return o.createElement("div",Object.assign({ref:t,className:(0,k.q)("w-full h-80",q)},X),o.createElement(a.h,{className:"h-full w-full"},(null==n?void 0:n.length)?o.createElement(d,{data:n,onClick:ea&&(et||J)?()=>{ee(void 0),en(void 0),null==W||W(null)}:void 0},R?o.createElement(f.q,{className:(0,k.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,o.createElement(s.K,{padding:{left:G,right:G},hide:!j,dataKey:u,interval:C?"preserveStartEnd":N,tick:{transform:"translate(0, 6)"},ticks:C?[n[0][u],n[n.length-1][u]]:void 0,fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:V,angle:null==$?void 0:$.angle,dy:null==$?void 0:$.verticalShift,height:null==$?void 0:$.xAxisHeight}),o.createElement(c.B,{width:P,hide:!_,axisLine:!1,tickLine:!1,type:"number",domain:eo,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,k.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:O,allowDecimals:F}),o.createElement(p.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:r}=e;return K?o.createElement(K,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=er.get(e.dataKey))&&void 0!==t?t:x.fr.Gray})}),active:t,label:r}):o.createElement(v.ZP,{active:t,payload:n,label:r,valueFormatter:O,categoryColors:er})}:o.createElement(o.Fragment,null),position:{y:0}}),I?o.createElement(h.D,{verticalAlign:"top",height:Y,content:e=>{let{payload:t}=e;return(0,g.Z)({payload:t},er,Q,et,ea?e=>ei(e):void 0,U)}}):null,i.map(e=>{var t;return o.createElement(l.x,{className:(0,k.q)((0,S.bM)(null!==(t=er.get(e))&&void 0!==t?t:x.fr.Gray,w.K.text).strokeColor),strokeOpacity:J||et&&et!==e?.3:1,activeDot:e=>{var t;let{cx:r,cy:a,stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,dataKey:u}=e;return o.createElement(m.o,{className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(t=er.get(u))&&void 0!==t?t:x.fr.Gray,w.K.text).fillColor),cx:r,cy:a,r:5,fill:"",stroke:i,strokeLinecap:l,strokeLinejoin:s,strokeWidth:c,onClick:(t,r)=>{r.stopPropagation(),ea&&(e.index===(null==J?void 0:J.index)&&e.dataKey===(null==J?void 0:J.dataKey)||(0,b.FB)(n,e.dataKey)&&et&&et===e.dataKey?(en(void 0),ee(void 0),null==W||W(null)):(en(e.dataKey),ee({index:e.index,dataKey:e.dataKey}),null==W||W(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var r;let{stroke:a,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,cx:c,cy:u,dataKey:d,index:f}=t;return(0,b.FB)(n,e)&&!(J||et&&et!==e)||(null==J?void 0:J.index)===f&&(null==J?void 0:J.dataKey)===e?o.createElement(m.o,{key:f,cx:c,cy:u,r:5,stroke:a,fill:"",strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,className:(0,k.q)("stroke-tremor-background dark:stroke-dark-tremor-background",W?"cursor-pointer":"",(0,S.bM)(null!==(r=er.get(d))&&void 0!==r?r:x.fr.Gray,w.K.text).fillColor)}):o.createElement(o.Fragment,{key:f})},key:e,name:e,type:L,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:A,animationDuration:T,connectNulls:B})}),W?i.map(e=>o.createElement(l.x,{className:(0,k.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:L,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:B,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;ei(n)}})):null):o.createElement(y.Z,{noDataText:H})))});E.displayName="LineChart"},65278:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(2265);let o=(e,t)=>{let[n,o]=(0,r.useState)(t);(0,r.useEffect)(()=>{let t=()=>{o(window.innerWidth),e()};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e,n])};var a=n(5853),i=n(26898),l=n(97324),s=n(1153);let c=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},u=e=>{var t=(0,a._T)(e,[]);return r.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),r.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},d=(0,s.fn)("Legend"),f=e=>{let{name:t,color:n,onClick:o,activeLegend:a}=e,c=!!o;return r.createElement("li",{className:(0,l.q)(d("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",c?"cursor-pointer":"cursor-default","text-tremor-content",c?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",c?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:e=>{e.stopPropagation(),null==o||o(t,n)}},r.createElement("svg",{className:(0,l.q)("flex-none h-2 w-2 mr-1.5",(0,s.bM)(n,i.K.text).textColor,a&&a!==t?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},r.createElement("circle",{cx:4,cy:4,r:4})),r.createElement("p",{className:(0,l.q)("whitespace-nowrap truncate text-tremor-default","text-tremor-content",c?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",a&&a!==t?"opacity-40":"opacity-100",c?"dark:group-hover:text-dark-tremor-content-emphasis":"")},t))},p=e=>{let{icon:t,onClick:n,disabled:o}=e,[a,i]=r.useState(!1),s=r.useRef(null);return r.useEffect(()=>(a?s.current=setInterval(()=>{null==n||n()},300):clearInterval(s.current),()=>clearInterval(s.current)),[a,n]),(0,r.useEffect)(()=>{o&&(clearInterval(s.current),i(!1))},[o]),r.createElement("button",{type:"button",className:(0,l.q)(d("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:e=>{e.stopPropagation(),null==n||n()},onMouseDown:e=>{e.stopPropagation(),i(!0)},onMouseUp:e=>{e.stopPropagation(),i(!1)}},r.createElement(t,{className:"w-full"}))},h=r.forwardRef((e,t)=>{var n,o;let{categories:s,colors:h=i.s,className:m,onClickLegendItem:g,activeLegend:v,enableLegendSlider:y=!1}=e,b=(0,a._T)(e,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),x=r.useRef(null),[w,k]=r.useState(null),[S,E]=r.useState(null),O=r.useRef(null),C=(0,r.useCallback)(()=>{let e=null==x?void 0:x.current;e&&k({left:e.scrollLeft>0,right:e.scrollWidth-e.clientWidth>e.scrollLeft})},[k]),j=(0,r.useCallback)(e=>{var t;let n=null==x?void 0:x.current,r=null!==(t=null==n?void 0:n.clientWidth)&&void 0!==t?t:0;n&&y&&(n.scrollTo({left:"left"===e?n.scrollLeft-r:n.scrollLeft+r,behavior:"smooth"}),setTimeout(()=>{C()},400))},[y,C]);r.useEffect(()=>{let e=e=>{"ArrowLeft"===e?j("left"):"ArrowRight"===e&&j("right")};return S?(e(S),O.current=setInterval(()=>{e(S)},300)):clearInterval(O.current),()=>clearInterval(O.current)},[S,j]);let _=e=>{e.stopPropagation(),"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),E(e.key))},P=e=>{e.stopPropagation(),E(null)};return r.useEffect(()=>{let e=null==x?void 0:x.current;return y&&(C(),null==e||e.addEventListener("keydown",_),null==e||e.addEventListener("keyup",P)),()=>{null==e||e.removeEventListener("keydown",_),null==e||e.removeEventListener("keyup",P)}},[C,y]),r.createElement("ol",Object.assign({ref:t,className:(0,l.q)(d("root"),"relative overflow-hidden",m)},b),r.createElement("div",{ref:x,tabIndex:0,className:(0,l.q)("h-full flex",y?(null==w?void 0:w.right)||(null==w?void 0:w.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},s.map((e,t)=>r.createElement(f,{key:"item-".concat(t),name:e,color:h[t],onClick:g,activeLegend:v}))),y&&((null==w?void 0:w.right)||(null==w?void 0:w.left))?r.createElement(r.Fragment,null,r.createElement("div",{className:(0,l.q)("from-tremor-background","dark:from-dark-tremor-background","absolute top-0 bottom-0 left-0 w-4 bg-gradient-to-r to-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("to-tremor-background","dark:to-dark-tremor-background","absolute top-0 bottom-0 right-10 w-4 bg-gradient-to-r from-transparent pointer-events-none")}),r.createElement("div",{className:(0,l.q)("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full")},r.createElement(p,{icon:c,onClick:()=>{E(null),j("left")},disabled:!(null==w?void 0:w.left)}),r.createElement(p,{icon:u,onClick:()=>{E(null),j("right")},disabled:!(null==w?void 0:w.right)}))):null)});h.displayName="Legend";let m=(e,t,n,a,i,l)=>{let{payload:s}=e,c=(0,r.useRef)(null);o(()=>{var e,t;n((t=null===(e=c.current)||void 0===e?void 0:e.clientHeight)?Number(t)+20:60)});let u=s.filter(e=>"none"!==e.type);return r.createElement("div",{ref:c,className:"flex items-center justify-end"},r.createElement(h,{categories:u.map(e=>e.value),colors:u.map(e=>t.get(e.value)),onClickLegendItem:i,activeLegend:a,enableLegendSlider:l}))}},98593:function(e,t,n){"use strict";n.d(t,{$B:function(){return s},ZP:function(){return u},zX:function(){return c}});var r=n(2265),o=n(7084),a=n(26898),i=n(97324),l=n(1153);let s=e=>{let{children:t}=e;return r.createElement("div",{className:(0,i.q)("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},t)},c=e=>{let{value:t,name:n,color:o}=e;return r.createElement("div",{className:"flex items-center justify-between space-x-8"},r.createElement("div",{className:"flex items-center space-x-2"},r.createElement("span",{className:(0,i.q)("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",(0,l.bM)(o,a.K.background).bgColor)}),r.createElement("p",{className:(0,i.q)("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},n)),r.createElement("p",{className:(0,i.q)("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},t))},u=e=>{let{active:t,payload:n,label:a,categoryColors:l,valueFormatter:u}=e;if(t&&n){let e=n.filter(e=>"none"!==e.type);return r.createElement(s,null,r.createElement("div",{className:(0,i.q)("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},r.createElement("p",{className:(0,i.q)("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},a)),r.createElement("div",{className:(0,i.q)("px-4 py-2 space-y-1")},e.map((e,t)=>{var n;let{value:a,name:i}=e;return r.createElement(c,{key:"id-".concat(t),value:u(a),name:i,color:null!==(n=l.get(i))&&void 0!==n?n:o.fr.Blue})})))}return null}},69448:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(97324),o=n(2265),a=n(5853);let i=(0,n(1153).fn)("Flex"),l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},s={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},c={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},u=o.forwardRef((e,t)=>{let{flexDirection:n="row",justifyContent:u="between",alignItems:d="center",children:f,className:p}=e,h=(0,a._T)(e,["flexDirection","justifyContent","alignItems","children","className"]);return o.createElement("div",Object.assign({ref:t,className:(0,r.q)(i("root"),"flex w-full",c[n],l[u],s[d],p)},h),f)});u.displayName="Flex";var d=n(84264);let f=e=>{let{noDataText:t="No data"}=e;return o.createElement(u,{alignItems:"center",justifyContent:"center",className:(0,r.q)("w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border")},o.createElement(d.Z,{className:(0,r.q)("text-tremor-content","dark:text-dark-tremor-content")},t))}},32644:function(e,t,n){"use strict";n.d(t,{FB:function(){return a},i4:function(){return o},me:function(){return r},vZ:function(){return function e(t,n){if(t===n)return!0;if("object"!=typeof t||"object"!=typeof n||null===t||null===n)return!1;let r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(let a of r)if(!o.includes(a)||!e(t[a],n[a]))return!1;return!0}}});let r=(e,t)=>{let n=new Map;return e.forEach((e,r)=>{n.set(e,t[r])}),n},o=(e,t,n)=>[e?"auto":null!=t?t:0,null!=n?n:"auto"];function a(e,t){let n=[];for(let r of e)if(Object.prototype.hasOwnProperty.call(r,t)&&(n.push(r[t]),n.length>1))return!1;return!0}},47323:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(5853),o=n(2265),a=n(1526),i=n(7084),l=n(97324),s=n(1153),c=n(26898);let u={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},d={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},f={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,l.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,s.bM)(t,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,l.q)((0,s.bM)(t,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},h=(0,s.fn)("Icon"),m=o.forwardRef((e,t)=>{let{icon:n,variant:c="simple",tooltip:m,size:g=i.u8.SM,color:v,className:y}=e,b=(0,r._T)(e,["icon","variant","tooltip","size","color","className"]),x=p(c,v),{tooltipProps:w,getReferenceProps:k}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,s.lq)([t,w.refs.setReference]),className:(0,l.q)(h("root"),"inline-flex flex-shrink-0 items-center",x.bgColor,x.textColor,x.borderColor,x.ringColor,f[c].rounded,f[c].border,f[c].shadow,f[c].ring,u[g].paddingX,u[g].paddingY,y)},k,b),o.createElement(a.Z,Object.assign({text:m},w)),o.createElement(n,{className:(0,l.q)(h("icon"),"shrink-0",d[g].height,d[g].width)}))});m.displayName="Icon"},69262:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},l=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var s=n(96398),c=n(97324),u=n(1153);let d=o.forwardRef((e,t)=>{let{value:n,defaultValue:d,type:f,placeholder:p="Type...",icon:h,error:m=!1,errorMessage:g,disabled:v=!1,stepper:y,makeInputClassName:b,className:x,onChange:w,onValueChange:k,autoFocus:S}=e,E=(0,r._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[O,C]=(0,o.useState)(S||!1),[j,_]=(0,o.useState)(!1),P=(0,o.useCallback)(()=>_(!j),[j,_]),N=(0,o.useRef)(null),T=(0,s.Uh)(n||d);return o.useEffect(()=>{let e=()=>C(!0),t=()=>C(!1),n=N.current;return n&&(n.addEventListener("focus",e),n.addEventListener("blur",t),S&&n.focus()),()=>{n&&(n.removeEventListener("focus",e),n.removeEventListener("blur",t))}},[S]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,c.q)(b("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,s.um)(T,v,m),O&&(0,c.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),x)},h?o.createElement(h,{className:(0,c.q)(b("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,u.lq)([N,t]),defaultValue:d,value:n,type:j?"text":f,className:(0,c.q)(b("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",h?"pl-2":"pl-3",m?"pr-3":"pr-4",v?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:v,"data-testid":"base-input",onChange:e=>{null==w||w(e),null==k||k(e.target.value)}},E)),"password"!==f||v?null:o.createElement("button",{className:(0,c.q)(b("toggleButton"),"mr-2"),type:"button",onClick:()=>P(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(l,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(i,{className:(0,c.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),m?o.createElement(a,{className:(0,c.q)(b("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=y?y:null),m&&g?o.createElement("p",{className:(0,c.q)(b("errorMessage"),"text-sm text-red-500 mt-1")},g):null)});d.displayName="BaseInput"},53003:function(e,t,n){"use strict";let r,o,a;n.d(t,{Z:function(){return nF}});var i,l,s,c,u=n(5853),d=n(2265),f=n(54887),p=n(13323),h=n(64518),m=n(96822),g=n(40293);function v(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,d.useMemo)(()=>(0,g.r)(...t),[...t])}var y=n(72238),b=n(93689);let x=(0,d.createContext)(!1);var w=n(61424),k=n(27847);let S=d.Fragment,E=d.Fragment,O=(0,d.createContext)(null),C=(0,d.createContext)(null);Object.assign((0,k.yV)(function(e,t){var n;let r,o,a=(0,d.useRef)(null),i=(0,b.T)((0,b.h)(e=>{a.current=e}),t),l=v(a),s=function(e){let t=(0,d.useContext)(x),n=(0,d.useContext)(O),r=v(e),[o,a]=(0,d.useState)(()=>{if(!t&&null!==n||w.O.isServer)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)});return(0,d.useEffect)(()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))},[o,r]),(0,d.useEffect)(()=>{t||null!==n&&a(n.current)},[n,a,t]),o}(a),[c]=(0,d.useState)(()=>{var e;return w.O.isServer?null:null!=(e=null==l?void 0:l.createElement("div"))?e:null}),u=(0,d.useContext)(C),g=(0,y.H)();return(0,h.e)(()=>{!s||!c||s.contains(c)||(c.setAttribute("data-headlessui-portal",""),s.appendChild(c))},[s,c]),(0,h.e)(()=>{if(c&&u)return u.register(c)},[u,c]),n=()=>{var e;s&&c&&(c instanceof Node&&s.contains(c)&&s.removeChild(c),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))},r=(0,p.z)(n),o=(0,d.useRef)(!1),(0,d.useEffect)(()=>(o.current=!1,()=>{o.current=!0,(0,m.Y)(()=>{o.current&&r()})}),[r]),g&&s&&c?(0,f.createPortal)((0,k.sY)({ourProps:{ref:i},theirProps:e,defaultTag:S,name:"Portal"}),c):null}),{Group:(0,k.yV)(function(e,t){let{target:n,...r}=e,o={ref:(0,b.T)(t)};return d.createElement(O.Provider,{value:n},(0,k.sY)({ourProps:o,theirProps:r,defaultTag:E,name:"Popover.Group"}))})});var j=n(31948),_=n(17684),P=n(98505),N=n(80004),T=n(38198),A=n(3141),M=((r=M||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r);function I(){let e=(0,d.useRef)(0);return(0,A.s)("keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}var R=n(37863),D=n(47634),L=n(37105),Z=n(24536),z=n(37388),B=((o=B||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),F=((a=F||{})[a.TogglePopover=0]="TogglePopover",a[a.ClosePopover=1]="ClosePopover",a[a.SetButton=2]="SetButton",a[a.SetButtonId=3]="SetButtonId",a[a.SetPanel=4]="SetPanel",a[a.SetPanelId=5]="SetPanelId",a);let H={0:e=>{let t={...e,popoverState:(0,Z.E)(e.popoverState,{0:1,1:0})};return 0===t.popoverState&&(t.__demoMode=!1),t},1:e=>1===e.popoverState?e:{...e,popoverState:1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},q=(0,d.createContext)(null);function W(e){let t=(0,d.useContext)(q);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Popover /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,W),t}return t}q.displayName="PopoverContext";let U=(0,d.createContext)(null);function K(e){let t=(0,d.useContext)(U);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Popover /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,K),t}return t}U.displayName="PopoverAPIContext";let $=(0,d.createContext)(null);function V(){return(0,d.useContext)($)}$.displayName="PopoverGroupContext";let X=(0,d.createContext)(null);function G(e,t){return(0,Z.E)(t.type,H,e,t)}X.displayName="PopoverPanelContext";let Y=k.AN.RenderStrategy|k.AN.Static,Q=k.AN.RenderStrategy|k.AN.Static,J=Object.assign((0,k.yV)(function(e,t){var n,r,o,a;let i,l,s,c,u,f;let{__demoMode:h=!1,...m}=e,g=(0,d.useRef)(null),y=(0,b.T)(t,(0,b.h)(e=>{g.current=e})),x=(0,d.useRef)([]),w=(0,d.useReducer)(G,{__demoMode:h,popoverState:h?0:1,buttons:x,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:(0,d.createRef)(),afterPanelSentinel:(0,d.createRef)()}),[{popoverState:S,button:E,buttonId:O,panel:_,panelId:N,beforePanelSentinel:A,afterPanelSentinel:M},I]=w,D=v(null!=(n=g.current)?n:E),z=(0,d.useMemo)(()=>{if(!E||!_)return!1;for(let e of document.querySelectorAll("body > *"))if(Number(null==e?void 0:e.contains(E))^Number(null==e?void 0:e.contains(_)))return!0;let e=(0,L.GO)(),t=e.indexOf(E),n=(t+e.length-1)%e.length,r=(t+1)%e.length,o=e[n],a=e[r];return!_.contains(o)&&!_.contains(a)},[E,_]),B=(0,j.E)(O),F=(0,j.E)(N),H=(0,d.useMemo)(()=>({buttonId:B,panelId:F,close:()=>I({type:1})}),[B,F,I]),W=V(),K=null==W?void 0:W.registerPopover,$=(0,p.z)(()=>{var e;return null!=(e=null==W?void 0:W.isFocusWithinPopoverGroup())?e:(null==D?void 0:D.activeElement)&&((null==E?void 0:E.contains(D.activeElement))||(null==_?void 0:_.contains(D.activeElement)))});(0,d.useEffect)(()=>null==K?void 0:K(H),[K,H]);let[Y,Q]=(i=(0,d.useContext)(C),l=(0,d.useRef)([]),s=(0,p.z)(e=>(l.current.push(e),i&&i.register(e),()=>c(e))),c=(0,p.z)(e=>{let t=l.current.indexOf(e);-1!==t&&l.current.splice(t,1),i&&i.unregister(e)}),u=(0,d.useMemo)(()=>({register:s,unregister:c,portals:l}),[s,c,l]),[l,(0,d.useMemo)(()=>function(e){let{children:t}=e;return d.createElement(C.Provider,{value:u},t)},[u])]),J=function(){var e;let{defaultContainers:t=[],portals:n,mainTreeNodeRef:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(0,d.useRef)(null!=(e=null==r?void 0:r.current)?e:null),a=v(o),i=(0,p.z)(()=>{var e,r,i;let l=[];for(let e of t)null!==e&&(e instanceof HTMLElement?l.push(e):"current"in e&&e.current instanceof HTMLElement&&l.push(e.current));if(null!=n&&n.current)for(let e of n.current)l.push(e);for(let t of null!=(e=null==a?void 0:a.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||t.contains(null==(i=null==(r=o.current)?void 0:r.getRootNode())?void 0:i.host)||l.some(e=>t.contains(e))||l.push(t));return l});return{resolveContainers:i,contains:(0,p.z)(e=>i().some(t=>t.contains(e))),mainTreeNodeRef:o,MainTreeNode:(0,d.useMemo)(()=>function(){return null!=r?null:d.createElement(T._,{features:T.A.Hidden,ref:o})},[o,r])}}({mainTreeNodeRef:null==W?void 0:W.mainTreeNodeRef,portals:Y,defaultContainers:[E,_]});r=null==D?void 0:D.defaultView,o="focus",a=e=>{var t,n,r,o;e.target!==window&&e.target instanceof HTMLElement&&0===S&&($()||E&&_&&(J.contains(e.target)||null!=(n=null==(t=A.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(o=null==(r=M.current)?void 0:r.contains)&&o.call(r,e.target)||I({type:1})))},f=(0,j.E)(a),(0,d.useEffect)(()=>{function e(e){f.current(e)}return(r=null!=r?r:window).addEventListener(o,e,!0),()=>r.removeEventListener(o,e,!0)},[r,o,!0]),(0,P.O)(J.resolveContainers,(e,t)=>{I({type:1}),(0,L.sP)(t,L.tJ.Loose)||(e.preventDefault(),null==E||E.focus())},0===S);let ee=(0,p.z)(e=>{I({type:1});let t=e?e instanceof HTMLElement?e:"current"in e&&e.current instanceof HTMLElement?e.current:E:E;null==t||t.focus()}),et=(0,d.useMemo)(()=>({close:ee,isPortalled:z}),[ee,z]),en=(0,d.useMemo)(()=>({open:0===S,close:ee}),[S,ee]);return d.createElement(X.Provider,{value:null},d.createElement(q.Provider,{value:w},d.createElement(U.Provider,{value:et},d.createElement(R.up,{value:(0,Z.E)(S,{0:R.ZM.Open,1:R.ZM.Closed})},d.createElement(Q,null,(0,k.sY)({ourProps:{ref:y},theirProps:m,slot:en,defaultTag:"div",name:"Popover"}),d.createElement(J.MainTreeNode,null))))))}),{Button:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-button-".concat(n),...o}=e,[a,i]=W("Popover.Button"),{isPortalled:l}=K("Popover.Button"),s=(0,d.useRef)(null),c="headlessui-focus-sentinel-".concat((0,_.M)()),u=V(),f=null==u?void 0:u.closeOthers,h=null!==(0,d.useContext)(X);(0,d.useEffect)(()=>{if(!h)return i({type:3,buttonId:r}),()=>{i({type:3,buttonId:null})}},[h,r,i]);let[m]=(0,d.useState)(()=>Symbol()),g=(0,b.T)(s,t,h?null:e=>{if(e)a.buttons.current.push(m);else{let e=a.buttons.current.indexOf(m);-1!==e&&a.buttons.current.splice(e,1)}a.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),e&&i({type:2,button:e})}),y=(0,b.T)(s,t),x=v(s),w=(0,p.z)(e=>{var t,n,r;if(h){if(1===a.popoverState)return;switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),i({type:1}),null==(r=a.button)||r.focus()}}else switch(e.key){case z.R.Space:case z.R.Enter:e.preventDefault(),e.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0});break;case z.R.Escape:if(0!==a.popoverState)return null==f?void 0:f(a.buttonId);if(!s.current||null!=x&&x.activeElement&&!s.current.contains(x.activeElement))return;e.preventDefault(),e.stopPropagation(),i({type:1})}}),S=(0,p.z)(e=>{h||e.key===z.R.Space&&e.preventDefault()}),E=(0,p.z)(t=>{var n,r;(0,D.P)(t.currentTarget)||e.disabled||(h?(i({type:1}),null==(n=a.button)||n.focus()):(t.preventDefault(),t.stopPropagation(),1===a.popoverState&&(null==f||f(a.buttonId)),i({type:0}),null==(r=a.button)||r.focus()))}),O=(0,p.z)(e=>{e.preventDefault(),e.stopPropagation()}),C=0===a.popoverState,j=(0,d.useMemo)(()=>({open:C}),[C]),P=(0,N.f)(e,s),A=h?{ref:y,type:P,onKeyDown:w,onClick:E}:{ref:g,id:a.buttonId,type:P,"aria-expanded":0===a.popoverState,"aria-controls":a.panel?a.panelId:void 0,onKeyDown:w,onKeyUp:S,onClick:E,onMouseDown:O},R=I(),B=(0,p.z)(()=>{let e=a.panel;e&&(0,Z.E)(R.current,{[M.Forwards]:()=>(0,L.jA)(e,L.TO.First),[M.Backwards]:()=>(0,L.jA)(e,L.TO.Last)})===L.fE.Error&&(0,L.jA)((0,L.GO)().filter(e=>"true"!==e.dataset.headlessuiFocusGuard),(0,Z.E)(R.current,{[M.Forwards]:L.TO.Next,[M.Backwards]:L.TO.Previous}),{relativeTo:a.button})});return d.createElement(d.Fragment,null,(0,k.sY)({ourProps:A,theirProps:o,slot:j,defaultTag:"button",name:"Popover.Button"}),C&&!h&&l&&d.createElement(T._,{id:c,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:B}))}),Overlay:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-overlay-".concat(n),...o}=e,[{popoverState:a},i]=W("Popover.Overlay"),l=(0,b.T)(t),s=(0,R.oJ)(),c=null!==s?(s&R.ZM.Open)===R.ZM.Open:0===a,u=(0,p.z)(e=>{if((0,D.P)(e.currentTarget))return e.preventDefault();i({type:1})}),f=(0,d.useMemo)(()=>({open:0===a}),[a]);return(0,k.sY)({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:u},theirProps:o,slot:f,defaultTag:"div",features:Y,visible:c,name:"Popover.Overlay"})}),Panel:(0,k.yV)(function(e,t){let n=(0,_.M)(),{id:r="headlessui-popover-panel-".concat(n),focus:o=!1,...a}=e,[i,l]=W("Popover.Panel"),{close:s,isPortalled:c}=K("Popover.Panel"),u="headlessui-focus-sentinel-before-".concat((0,_.M)()),f="headlessui-focus-sentinel-after-".concat((0,_.M)()),m=(0,d.useRef)(null),g=(0,b.T)(m,t,e=>{l({type:4,panel:e})}),y=v(m),x=(0,k.Y2)();(0,h.e)(()=>(l({type:5,panelId:r}),()=>{l({type:5,panelId:null})}),[r,l]);let w=(0,R.oJ)(),S=null!==w?(w&R.ZM.Open)===R.ZM.Open:0===i.popoverState,E=(0,p.z)(e=>{var t;if(e.key===z.R.Escape){if(0!==i.popoverState||!m.current||null!=y&&y.activeElement&&!m.current.contains(y.activeElement))return;e.preventDefault(),e.stopPropagation(),l({type:1}),null==(t=i.button)||t.focus()}});(0,d.useEffect)(()=>{var t;e.static||1===i.popoverState&&(null==(t=e.unmount)||t)&&l({type:4,panel:null})},[i.popoverState,e.unmount,e.static,l]),(0,d.useEffect)(()=>{if(i.__demoMode||!o||0!==i.popoverState||!m.current)return;let e=null==y?void 0:y.activeElement;m.current.contains(e)||(0,L.jA)(m.current,L.TO.First)},[i.__demoMode,o,m,i.popoverState]);let O=(0,d.useMemo)(()=>({open:0===i.popoverState,close:s}),[i,s]),C={ref:g,id:r,onKeyDown:E,onBlur:o&&0===i.popoverState?e=>{var t,n,r,o,a;let s=e.relatedTarget;s&&m.current&&(null!=(t=m.current)&&t.contains(s)||(l({type:1}),(null!=(r=null==(n=i.beforePanelSentinel.current)?void 0:n.contains)&&r.call(n,s)||null!=(a=null==(o=i.afterPanelSentinel.current)?void 0:o.contains)&&a.call(o,s))&&s.focus({preventScroll:!0})))}:void 0,tabIndex:-1},j=I(),P=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var t;(0,L.jA)(e,L.TO.First)===L.fE.Error&&(null==(t=i.afterPanelSentinel.current)||t.focus())},[M.Backwards]:()=>{var e;null==(e=i.button)||e.focus({preventScroll:!0})}})}),N=(0,p.z)(()=>{let e=m.current;e&&(0,Z.E)(j.current,{[M.Forwards]:()=>{var e;if(!i.button)return;let t=(0,L.GO)(),n=t.indexOf(i.button),r=t.slice(0,n+1),o=[...t.slice(n+1),...r];for(let t of o.slice())if("true"===t.dataset.headlessuiFocusGuard||null!=(e=i.panel)&&e.contains(t)){let e=o.indexOf(t);-1!==e&&o.splice(e,1)}(0,L.jA)(o,L.TO.First,{sorted:!1})},[M.Backwards]:()=>{var t;(0,L.jA)(e,L.TO.Previous)===L.fE.Error&&(null==(t=i.button)||t.focus())}})});return d.createElement(X.Provider,{value:r},S&&c&&d.createElement(T._,{id:u,ref:i.beforePanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:P}),(0,k.sY)({mergeRefs:x,ourProps:C,theirProps:a,slot:O,defaultTag:"div",features:Q,visible:S,name:"Popover.Panel"}),S&&c&&d.createElement(T._,{id:f,ref:i.afterPanelSentinel,features:T.A.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:N}))}),Group:(0,k.yV)(function(e,t){let n;let r=(0,d.useRef)(null),o=(0,b.T)(r,t),[a,i]=(0,d.useState)([]),l={mainTreeNodeRef:n=(0,d.useRef)(null),MainTreeNode:(0,d.useMemo)(()=>function(){return d.createElement(T._,{features:T.A.Hidden,ref:n})},[n])},s=(0,p.z)(e=>{i(t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t})}),c=(0,p.z)(e=>(i(t=>[...t,e]),()=>s(e))),u=(0,p.z)(()=>{var e;let t=(0,g.r)(r);if(!t)return!1;let n=t.activeElement;return!!(null!=(e=r.current)&&e.contains(n))||a.some(e=>{var r,o;return(null==(r=t.getElementById(e.buttonId.current))?void 0:r.contains(n))||(null==(o=t.getElementById(e.panelId.current))?void 0:o.contains(n))})}),f=(0,p.z)(e=>{for(let t of a)t.buttonId.current!==e&&t.close()}),h=(0,d.useMemo)(()=>({registerPopover:c,unregisterPopover:s,isFocusWithinPopoverGroup:u,closeOthers:f,mainTreeNodeRef:l.mainTreeNodeRef}),[c,s,u,f,l.mainTreeNodeRef]),m=(0,d.useMemo)(()=>({}),[]);return d.createElement($.Provider,{value:h},(0,k.sY)({ourProps:{ref:o},theirProps:e,slot:m,defaultTag:"div",name:"Popover.Group"}),d.createElement(l.MainTreeNode,null))})});var ee=n(33044),et=n(28517);let en=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}),d.createElement("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"}))};var er=n(4537),eo=n(99735),ea=n(7656);function ei(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setHours(0,0,0,0),t}function el(){return ei(Date.now())}function es(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return t.setDate(1),t.setHours(0,0,0,0),t}var ec=n(97324),eu=n(96398),ed=n(41154);function ef(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)}),n||new Date(NaN)}function ep(e){var t,n;if((0,ea.Z)(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==(0,ed.Z)(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach(function(e){var t=(0,eo.Z)(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)}),n||new Date(NaN)}var eh=n(25721),em=n(47869);function eg(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,-n)}var ev=n(55463);function ey(e,t){if((0,ea.Z)(2,arguments),!t||"object"!==(0,ed.Z)(t))return new Date(NaN);var n=t.years?(0,em.Z)(t.years):0,r=t.months?(0,em.Z)(t.months):0,o=t.weeks?(0,em.Z)(t.weeks):0,a=t.days?(0,em.Z)(t.days):0,i=t.hours?(0,em.Z)(t.hours):0,l=t.minutes?(0,em.Z)(t.minutes):0,s=t.seconds?(0,em.Z)(t.seconds):0;return new Date(eg(function(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,-n)}(e,r+12*n),a+7*o).getTime()-1e3*(s+60*(l+60*i)))}function eb(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ex(e){return(0,ea.Z)(1,arguments),e instanceof Date||"object"===(0,ed.Z)(e)&&"[object Date]"===Object.prototype.toString.call(e)}function ew(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCDay();return t.setUTCDate(t.getUTCDate()-((n<1?7:0)+n-1)),t.setUTCHours(0,0,0,0),t}function ek(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=ew(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=ew(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}var eS={};function eE(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getUTCDay();return d.setUTCDate(d.getUTCDate()-((f<u?7:0)+f-u)),d.setUTCHours(0,0,0,0),d}function eO(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getUTCFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var h=eE(p,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var g=eE(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}function eC(e,t){for(var n=Math.abs(e).toString();n.length<t;)n="0"+n;return(e<0?"-":"")+n}var ej={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return eC("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):eC(n+1,2)},d:function(e,t){return eC(e.getUTCDate(),t.length)},h:function(e,t){return eC(e.getUTCHours()%12||12,t.length)},H:function(e,t){return eC(e.getUTCHours(),t.length)},m:function(e,t){return eC(e.getUTCMinutes(),t.length)},s:function(e,t){return eC(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length;return eC(Math.floor(e.getUTCMilliseconds()*Math.pow(10,n-3)),t.length)}},e_={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function eP(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;return 0===a?n+String(o):n+String(o)+(t||"")+eC(a,2)}function eN(e,t){return e%60==0?(e>0?"-":"+")+eC(Math.abs(e)/60,2):eT(e,t)}function eT(e,t){var n=Math.abs(e);return(e>0?"-":"+")+eC(Math.floor(n/60),2)+(t||"")+eC(n%60,2)}var eA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return ej.y(e,t)},Y:function(e,t,n,r){var o=eO(e,r),a=o>0?o:1-o;return"YY"===t?eC(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):eC(a,t.length)},R:function(e,t){return eC(ek(e),t.length)},u:function(e,t){return eC(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return eC(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return eC(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return ej.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return eC(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((eE(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=eO(e,t),f=new Date(0);return f.setUTCFullYear(d,0,u),f.setUTCHours(0,0,0,0),eE(f,t)})(n,t).getTime())/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):eC(o,t.length)},I:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((ew(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=ek(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),ew(n)})(t).getTime())/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):eC(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):ej.d(e,t)},D:function(e,t,n){var r=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getTime();return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),Math.floor((n-t.getTime())/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):eC(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return eC(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return eC(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return eC(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?e_.noon:0===o?e_.midnight:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?e_.evening:o>=12?e_.afternoon:o>=4?e_.morning:e_.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ej.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ej.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):eC(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):ej.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):ej.s(e,t)},S:function(e,t){return ej.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return eN(o);case"XXXX":case"XX":return eT(o);default:return eT(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return eN(o);case"xxxx":case"xx":return eT(o);default:return eT(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eP(o,":");default:return"GMT"+eT(o,":")}},t:function(e,t,n,r){return eC(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return eC((r._originalDate||e).getTime(),t.length)}},eM=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},eI=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},eR={p:eI,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],a=r[2];if(!a)return eM(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",eM(o,t)).replace("{{time}}",eI(a,t))}};function eD(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var eL=["D","DD"],eZ=["YY","YYYY"];function ez(e,t,n){if("YYYY"===e)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var eB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function eF(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var eH={date:eF({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:eF({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:eF({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},eq={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function eW(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!=n&&n.width?String(n.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var i=e.defaultWidth,l=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[l]||e.values[i]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function eU(e){return function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;var l=i[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(s,function(e){return e.test(l)}):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(s,function(e){return e.test(l)});return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(l.length)}}}var eK={code:"en-US",formatDistance:function(e,t,n){var r,o=eB[e];return(r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix)?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:eH,formatRelative:function(e,t,n,r){return eq[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:eW({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:eW({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:eW({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:eW({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:eW({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(i={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(i.matchPattern);if(!n)return null;var r=n[0],o=e.match(i.parsePattern);if(!o)return null;var a=i.valueCallback?i.valueCallback(o[0]):o[0];return{value:a=t.valueCallback?t.valueCallback(a):a,rest:e.slice(r.length)}}),era:eU({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:eU({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:eU({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:eU({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:eU({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},e$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eV=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eX=/^'([^]*?)'?$/,eG=/''/g,eY=/[a-zA-Z]/;function eQ(e,t,n){(0,ea.Z)(2,arguments);var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w=String(t),k=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:eS.locale)&&void 0!==r?r:eK,S=(0,em.Z)(null!==(a=null!==(i=null!==(l=null!==(s=null==n?void 0:n.firstWeekContainsDate)&&void 0!==s?s:null==n?void 0:null===(c=n.locale)||void 0===c?void 0:null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==l?l:eS.firstWeekContainsDate)&&void 0!==i?i:null===(d=eS.locale)||void 0===d?void 0:null===(f=d.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==a?a:1);if(!(S>=1&&S<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=(0,em.Z)(null!==(p=null!==(h=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n?void 0:null===(v=n.locale)||void 0===v?void 0:null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:eS.weekStartsOn)&&void 0!==h?h:null===(b=eS.locale)||void 0===b?void 0:null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==p?p:0);if(!(E>=0&&E<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw RangeError("locale must contain localize property");if(!k.formatLong)throw RangeError("locale must contain formatLong property");var O=(0,eo.Z)(e);if(!function(e){return(0,ea.Z)(1,arguments),(!!ex(e)||"number"==typeof e)&&!isNaN(Number((0,eo.Z)(e)))}(O))throw RangeError("Invalid time value");var C=eD(O),j=function(e,t){return(0,ea.Z)(2,arguments),function(e,t){return(0,ea.Z)(2,arguments),new Date((0,eo.Z)(e).getTime()+(0,em.Z)(t))}(e,-(0,em.Z)(t))}(O,C),_={firstWeekContainsDate:S,weekStartsOn:E,locale:k,_originalDate:O};return w.match(eV).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,eR[t])(e,k.formatLong):e}).join("").match(e$).map(function(r){if("''"===r)return"'";var o,a=r[0];if("'"===a)return(o=r.match(eX))?o[1].replace(eG,"'"):r;var i=eA[a];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===eZ.indexOf(r)||ez(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||-1===eL.indexOf(r)||ez(r,t,String(e)),i(j,r,k.localize,_);if(a.match(eY))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");return r}).join("")}var eJ=n(1153);let e0=(0,eJ.fn)("DateRangePicker"),e1=(e,t,n,r)=>{var o;if(n&&(e=null===(o=r.get(n))||void 0===o?void 0:o.from),e)return ei(e&&!t?e:ef([e,t]))},e2=(e,t,n,r)=>{var o,a;if(n&&(e=ei(null!==(a=null===(o=r.get(n))||void 0===o?void 0:o.to)&&void 0!==a?a:el())),e)return ei(e&&!t?e:ep([e,t]))},e6=[{value:"tdy",text:"Today",from:el()},{value:"w",text:"Last 7 days",from:ey(el(),{days:7})},{value:"t",text:"Last 30 days",from:ey(el(),{days:30})},{value:"m",text:"Month to Date",from:es(el())},{value:"y",text:"Year to Date",from:eb(el())}],e4=(e,t,n,r)=>{let o=(null==n?void 0:n.code)||"en-US";if(!e&&!t)return"";if(e&&!t)return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e&&t){if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()===r.getTime()}(e,t))return r?eQ(e,r):e.toLocaleDateString(o,{year:"numeric",month:"short",day:"numeric"});if(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())return r?"".concat(eQ(e,r)," - ").concat(eQ(t,r)):"".concat(e.toLocaleDateString(o,{month:"short",day:"numeric"})," - \n ").concat(t.getDate(),", ").concat(t.getFullYear());{if(r)return"".concat(eQ(e,r)," - ").concat(eQ(t,r));let n={year:"numeric",month:"short",day:"numeric"};return"".concat(e.toLocaleDateString(o,n)," - \n ").concat(t.toLocaleDateString(o,n))}}return""};function e3(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function e5(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t),o=n.getFullYear(),a=n.getDate(),i=new Date(0);i.setFullYear(o,r,15),i.setHours(0,0,0,0);var l=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(i);return n.setMonth(r,Math.min(a,l)),n}function e8(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,em.Z)(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function e7(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function e9(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function te(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()<r.getTime()}function tt(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()-((f<u?7:0)+f-u)),d.setHours(0,0,0,0),d}function tn(e){return(0,ea.Z)(1,arguments),tt(e,{weekStartsOn:1})}function tr(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return n.getTime()===r.getTime()}function to(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getTime()>r.getTime()}function ta(e,t){(0,ea.Z)(2,arguments);var n=ei(e),r=ei(t);return Math.round((n.getTime()-eD(n)-(r.getTime()-eD(r)))/864e5)}function ti(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,eh.Z)(e,7*n)}function tl(e,t){(0,ea.Z)(2,arguments);var n=(0,em.Z)(t);return(0,ev.Z)(e,12*n)}function ts(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.weekStartsOn)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==o?o:eS.weekStartsOn)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(u>=0&&u<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=(0,eo.Z)(e),f=d.getDay();return d.setDate(d.getDate()+((f<u?-7:0)+6-(f-u))),d.setHours(23,59,59,999),d}function tc(e){return(0,ea.Z)(1,arguments),ts(e,{weekStartsOn:1})}var tu=function(){return(tu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function td(e,t,n){if(n||2==arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var tf={exports:{}},tp={};tf.exports=function(){if(s)return tp;s=1;var e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,r=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(t,a,i){var l,s={},c=null,u=null;for(l in void 0!==i&&(c=""+i),void 0!==a.key&&(c=""+a.key),void 0!==a.ref&&(u=a.ref),a)n.call(a,l)&&!o.hasOwnProperty(l)&&(s[l]=a[l]);if(t&&t.defaultProps)for(l in a=t.defaultProps)void 0===s[l]&&(s[l]=a[l]);return{$$typeof:e,type:t,key:c,ref:u,props:s,_owner:r.current}}return tp.Fragment=t,tp.jsx=a,tp.jsxs=a,tp}();var th=tf.exports;function tm(e){return"multiple"===e.mode}function tg(e){return"range"===e.mode}function tv(e){return"single"===e.mode}var ty={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"},tb=Object.freeze({__proto__:null,formatCaption:function(e,t){return eQ(e,"LLLL y",t)},formatDay:function(e,t){return eQ(e,"d",t)},formatMonthCaption:function(e,t){return eQ(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return eQ(e,"cccccc",t)},formatYearCaption:function(e,t){return eQ(e,"yyyy",t)}}),tx=Object.freeze({__proto__:null,labelDay:function(e,t,n){return eQ(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return eQ(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}}),tw=(0,d.createContext)(void 0);function tk(e){var t,n,r,o,a,i,l,s,c=e.initialProps,u={captionLayout:"buttons",classNames:ty,formatters:tb,labels:tx,locale:eK,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},d=(t=c.fromYear,n=c.toYear,r=c.fromMonth,o=c.toMonth,a=c.fromDate,i=c.toDate,r?a=es(r):t&&(a=new Date(t,0,1)),o?i=e3(o):n&&(i=new Date(n,11,31)),{fromDate:a?ei(a):void 0,toDate:i?ei(i):void 0}),f=d.fromDate,p=d.toDate,h=null!==(l=c.captionLayout)&&void 0!==l?l:u.captionLayout;"buttons"===h||f&&p||(h="buttons"),(tv(c)||tm(c)||tg(c))&&(s=c.onSelect);var m=tu(tu(tu({},u),c),{captionLayout:h,classNames:tu(tu({},u.classNames),c.classNames),components:tu({},c.components),formatters:tu(tu({},u.formatters),c.formatters),fromDate:f,labels:tu(tu({},u.labels),c.labels),mode:c.mode||u.mode,modifiers:tu(tu({},u.modifiers),c.modifiers),modifiersClassNames:tu(tu({},u.modifiersClassNames),c.modifiersClassNames),onSelect:s,styles:tu(tu({},u.styles),c.styles),toDate:p});return th.jsx(tw.Provider,{value:m,children:e.children})}function tS(){var e=(0,d.useContext)(tw);if(!e)throw Error("useDayPicker must be used within a DayPickerProvider.");return e}function tE(e){var t=tS(),n=t.locale,r=t.classNames,o=t.styles,a=t.formatters.formatCaption;return th.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:n})})}function tO(e){return th.jsx("svg",tu({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:th.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tC(e){var t,n,r=e.onChange,o=e.value,a=e.children,i=e.caption,l=e.className,s=e.style,c=tS(),u=null!==(n=null===(t=c.components)||void 0===t?void 0:t.IconDropdown)&&void 0!==n?n:tO;return th.jsxs("div",{className:l,style:s,children:[th.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),th.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:a}),th.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[i,th.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function tj(e){var t,n=tS(),r=n.fromDate,o=n.toDate,a=n.styles,i=n.locale,l=n.formatters.formatMonthCaption,s=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r||!o)return th.jsx(th.Fragment,{});var d=[];if(function(e,t){(0,ea.Z)(2,arguments);var n=(0,eo.Z)(e),r=(0,eo.Z)(t);return n.getFullYear()===r.getFullYear()}(r,o))for(var f=es(r),p=r.getMonth();p<=o.getMonth();p++)d.push(e5(f,p));else for(var f=es(new Date),p=0;p<=11;p++)d.push(e5(f,p));var h=null!==(t=null==c?void 0:c.Dropdown)&&void 0!==t?t:tC;return th.jsx(h,{name:"months","aria-label":u(),className:s.dropdown_month,style:a.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=e5(es(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:i}),children:d.map(function(e){return th.jsx("option",{value:e.getMonth(),children:l(e,{locale:i})},e.getMonth())})})}function t_(e){var t,n=e.displayMonth,r=tS(),o=r.fromDate,a=r.toDate,i=r.locale,l=r.styles,s=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!o||!a)return th.jsx(th.Fragment,{});for(var p=o.getFullYear(),h=a.getFullYear(),m=p;m<=h;m++)f.push(e8(eb(new Date),m));var g=null!==(t=null==c?void 0:c.Dropdown)&&void 0!==t?t:tC;return th.jsx(g,{name:"years","aria-label":d(),className:s.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=e8(es(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:u(n,{locale:i}),children:f.map(function(e){return th.jsx("option",{value:e.getFullYear(),children:u(e,{locale:i})},e.getFullYear())})})}var tP=(0,d.createContext)(void 0);function tN(e){var t,n,r,o,a,i,l,s,c,u,f,p,h,m,g,v,y=tS(),b=(g=(r=(n=t=tS()).month,o=n.defaultMonth,a=n.today,i=r||o||a||new Date,l=n.toDate,s=n.fromDate,c=n.numberOfMonths,l&&0>e7(l,i)&&(i=(0,ev.Z)(l,-1*((void 0===c?1:c)-1))),s&&0>e7(i,s)&&(i=s),u=es(i),f=t.month,h=(p=(0,d.useState)(u))[0],m=[void 0===f?h:f,p[1]])[0],v=m[1],[g,function(e){if(!t.disableNavigation){var n,r=es(e);v(r),null===(n=t.onMonthChange)||void 0===n||n.call(t,r)}}]),x=b[0],w=b[1],k=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=es(e),a=e7(es((0,ev.Z)(o,r)),o),i=[],l=0;l<a;l++){var s=(0,ev.Z)(o,l);i.push(s)}return n&&(i=i.reverse()),i}(x,y),S=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=es(e);if(!n||!(e7(n,e)<a))return(0,ev.Z)(i,r?a:1)}}(x,y),E=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,a=es(e);if(!n||!(0>=e7(a,n)))return(0,ev.Z)(a,-(r?void 0===o?1:o:1))}}(x,y),O=function(e){return k.some(function(t){return e9(e,t)})};return th.jsx(tP.Provider,{value:{currentMonth:x,displayMonths:k,goToMonth:w,goToDate:function(e,t){O(e)||(t&&te(e,t)?w((0,ev.Z)(e,1+-1*y.numberOfMonths)):w(e))},previousMonth:E,nextMonth:S,isDateDisplayed:O},children:e.children})}function tT(){var e=(0,d.useContext)(tP);if(!e)throw Error("useNavigation must be used within a NavigationProvider");return e}function tA(e){var t,n=tS(),r=n.classNames,o=n.styles,a=n.components,i=tT().goToMonth,l=function(t){i((0,ev.Z)(t,e.displayIndex?-e.displayIndex:0))},s=null!==(t=null==a?void 0:a.CaptionLabel)&&void 0!==t?t:tE,c=th.jsx(s,{id:e.id,displayMonth:e.displayMonth});return th.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[th.jsx("div",{className:r.vhidden,children:c}),th.jsx(tj,{onChange:l,displayMonth:e.displayMonth}),th.jsx(t_,{onChange:l,displayMonth:e.displayMonth})]})}function tM(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function tI(e){return th.jsx("svg",tu({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:th.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var tR=(0,d.forwardRef)(function(e,t){var n=tS(),r=n.classNames,o=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var i=a.join(" "),l=tu(tu({},o.button_reset),o.button);return e.style&&Object.assign(l,e.style),th.jsx("button",tu({},e,{ref:t,type:"button",className:i,style:l}))});function tD(e){var t,n,r=tS(),o=r.dir,a=r.locale,i=r.classNames,l=r.styles,s=r.labels,c=s.labelPrevious,u=s.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return th.jsx(th.Fragment,{});var f=c(e.previousMonth,{locale:a}),p=[i.nav_button,i.nav_button_previous].join(" "),h=u(e.nextMonth,{locale:a}),m=[i.nav_button,i.nav_button_next].join(" "),g=null!==(t=null==d?void 0:d.IconRight)&&void 0!==t?t:tI,v=null!==(n=null==d?void 0:d.IconLeft)&&void 0!==n?n:tM;return th.jsxs("div",{className:i.nav,style:l.nav,children:[!e.hidePrevious&&th.jsx(tR,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===o?th.jsx(g,{className:i.nav_icon,style:l.nav_icon}):th.jsx(v,{className:i.nav_icon,style:l.nav_icon})}),!e.hideNext&&th.jsx(tR,{name:"next-month","aria-label":h,className:m,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===o?th.jsx(v,{className:i.nav_icon,style:l.nav_icon}):th.jsx(g,{className:i.nav_icon,style:l.nav_icon})})]})}function tL(e){var t=tS().numberOfMonths,n=tT(),r=n.previousMonth,o=n.nextMonth,a=n.goToMonth,i=n.displayMonths,l=i.findIndex(function(t){return e9(e.displayMonth,t)}),s=0===l,c=l===i.length-1;return th.jsx(tD,{displayMonth:e.displayMonth,hideNext:t>1&&(s||!c),hidePrevious:t>1&&(c||!s),nextMonth:o,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){o&&a(o)}})}function tZ(e){var t,n,r=tS(),o=r.classNames,a=r.disableNavigation,i=r.styles,l=r.captionLayout,s=r.components,c=null!==(t=null==s?void 0:s.CaptionLabel)&&void 0!==t?t:tE;return n=a?th.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?th.jsx(tA,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?th.jsxs(th.Fragment,{children:[th.jsx(tA,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),th.jsx(tL,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):th.jsxs(th.Fragment,{children:[th.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(tL,{displayMonth:e.displayMonth,id:e.id})]}),th.jsx("div",{className:o.caption,style:i.caption,children:n})}function tz(e){var t=tS(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?th.jsx("tfoot",{className:o,style:r.tfoot,children:th.jsx("tr",{children:th.jsx("td",{colSpan:8,children:n})})}):th.jsx(th.Fragment,{})}function tB(){var e=tS(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,a=e.weekStartsOn,i=e.ISOWeek,l=e.formatters.formatWeekdayName,s=e.labels.labelWeekday,c=function(e,t,n){for(var r=n?tn(new Date):tt(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=(0,eh.Z)(r,a);o.push(i)}return o}(o,a,i);return th.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&th.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(e,r){return th.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":s(e,{locale:o}),children:l(e,{locale:o})},r)})]})}function tF(){var e,t=tS(),n=t.classNames,r=t.styles,o=t.components,a=null!==(e=null==o?void 0:o.HeadRow)&&void 0!==e?e:tB;return th.jsx("thead",{style:r.head,className:n.head,children:th.jsx(a,{})})}function tH(e){var t=tS(),n=t.locale,r=t.formatters.formatDay;return th.jsx(th.Fragment,{children:r(e.date,{locale:n})})}var tq=(0,d.createContext)(void 0);function tW(e){return tm(e.initialProps)?th.jsx(tU,{initialProps:e.initialProps,children:e.children}):th.jsx(tq.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function tU(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,a=t.max,i={disabled:[]};return r&&i.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return tr(t,e)});return!!(t&&!n)}),th.jsx(tq.Provider,{value:{selected:r,onDayClick:function(e,n,i){if(null===(l=t.onDayClick)||void 0===l||l.call(t,e,n,i),(!n.selected||!o||(null==r?void 0:r.length)!==o)&&(n.selected||!a||(null==r?void 0:r.length)!==a)){var l,s,c=r?td([],r,!0):[];if(n.selected){var u=c.findIndex(function(t){return tr(e,t)});c.splice(u,1)}else c.push(e);null===(s=t.onSelect)||void 0===s||s.call(t,c,e,n,i)}},modifiers:i},children:n})}function tK(){var e=(0,d.useContext)(tq);if(!e)throw Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var t$=(0,d.createContext)(void 0);function tV(e){return tg(e.initialProps)?th.jsx(tX,{initialProps:e.initialProps,children:e.children}):th.jsx(t$.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function tX(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},a=o.from,i=o.to,l=t.min,s=t.max,c={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(c.range_start=[a],i?(c.range_end=[i],tr(a,i)||(c.range_middle=[{after:a,before:i}])):c.range_end=[a]):i&&(c.range_start=[i],c.range_end=[i]),l&&(a&&!i&&c.disabled.push({after:eg(a,l-1),before:(0,eh.Z)(a,l-1)}),a&&i&&c.disabled.push({after:a,before:(0,eh.Z)(a,l-1)}),!a&&i&&c.disabled.push({after:eg(i,l-1),before:(0,eh.Z)(i,l-1)})),s){if(a&&!i&&(c.disabled.push({before:(0,eh.Z)(a,-s+1)}),c.disabled.push({after:(0,eh.Z)(a,s-1)})),a&&i){var u=s-(ta(i,a)+1);c.disabled.push({before:eg(a,u)}),c.disabled.push({after:(0,eh.Z)(i,u)})}!a&&i&&(c.disabled.push({before:(0,eh.Z)(i,-s+1)}),c.disabled.push({after:(0,eh.Z)(i,s-1)}))}return th.jsx(t$.Provider,{value:{selected:r,onDayClick:function(e,n,o){null===(s=t.onDayClick)||void 0===s||s.call(t,e,n,o);var a,i,l,s,c,u=(i=(a=r||{}).from,l=a.to,i&&l?tr(l,e)&&tr(i,e)?void 0:tr(l,e)?{from:l,to:void 0}:tr(i,e)?void 0:to(i,e)?{from:e,to:l}:{from:i,to:e}:l?to(e,l)?{from:l,to:e}:{from:e,to:l}:i?te(e,i)?{from:e,to:i}:{from:i,to:e}:{from:e,to:void 0});null===(c=t.onSelect)||void 0===c||c.call(t,u,e,n,o)},modifiers:c},children:n})}function tG(){var e=(0,d.useContext)(t$);if(!e)throw Error("useSelectRange must be used within a SelectRangeProvider");return e}function tY(e){return Array.isArray(e)?td([],e,!0):void 0!==e?[e]:[]}(l=c||(c={})).Outside="outside",l.Disabled="disabled",l.Selected="selected",l.Hidden="hidden",l.Today="today",l.RangeStart="range_start",l.RangeEnd="range_end",l.RangeMiddle="range_middle";var tQ=c.Selected,tJ=c.Disabled,t0=c.Hidden,t1=c.Today,t2=c.RangeEnd,t6=c.RangeMiddle,t4=c.RangeStart,t3=c.Outside,t5=(0,d.createContext)(void 0);function t8(e){var t,n,r,o=tS(),a=tK(),i=tG(),l=((t={})[tQ]=tY(o.selected),t[tJ]=tY(o.disabled),t[t0]=tY(o.hidden),t[t1]=[o.today],t[t2]=[],t[t6]=[],t[t4]=[],t[t3]=[],o.fromDate&&t[tJ].push({before:o.fromDate}),o.toDate&&t[tJ].push({after:o.toDate}),tm(o)?t[tJ]=t[tJ].concat(a.modifiers[tJ]):tg(o)&&(t[tJ]=t[tJ].concat(i.modifiers[tJ]),t[t4]=i.modifiers[t4],t[t6]=i.modifiers[t6],t[t2]=i.modifiers[t2]),t),s=(n=o.modifiers,r={},Object.entries(n).forEach(function(e){var t=e[0],n=e[1];r[t]=tY(n)}),r),c=tu(tu({},l),s);return th.jsx(t5.Provider,{value:c,children:e.children})}function t7(){var e=(0,d.useContext)(t5);if(!e)throw Error("useModifiers must be used within a ModifiersProvider");return e}function t9(e,t,n){var r=Object.keys(t).reduce(function(n,r){return t[r].some(function(t){if("boolean"==typeof t)return t;if(ex(t))return tr(e,t);if(Array.isArray(t)&&t.every(ex))return t.includes(e);if(t&&"object"==typeof t&&"from"in t)return r=t.from,o=t.to,r&&o?(0>ta(o,r)&&(r=(n=[o,r])[0],o=n[1]),ta(e,r)>=0&&ta(o,e)>=0):o?tr(o,e):!!r&&tr(r,e);if(t&&"object"==typeof t&&"dayOfWeek"in t)return t.dayOfWeek.includes(e.getDay());if(t&&"object"==typeof t&&"before"in t&&"after"in t){var n,r,o,a=ta(t.before,e),i=ta(t.after,e),l=a>0,s=i<0;return to(t.before,t.after)?s&&l:l||s}return t&&"object"==typeof t&&"after"in t?ta(e,t.after)>0:t&&"object"==typeof t&&"before"in t?ta(t.before,e)>0:"function"==typeof t&&t(e)})&&n.push(r),n},[]),o={};return r.forEach(function(e){return o[e]=!0}),n&&!e9(e,n)&&(o.outside=!0),o}var ne=(0,d.createContext)(void 0);function nt(e){var t=tT(),n=t7(),r=(0,d.useState)(),o=r[0],a=r[1],i=(0,d.useState)(),l=i[0],s=i[1],c=function(e,t){for(var n,r,o=es(e[0]),a=e3(e[e.length-1]),i=o;i<=a;){var l=t9(i,t);if(!(!l.disabled&&!l.hidden)){i=(0,eh.Z)(i,1);continue}if(l.selected)return i;l.today&&!r&&(r=i),n||(n=i),i=(0,eh.Z)(i,1)}return r||n}(t.displayMonths,n),u=(null!=o?o:l&&t.isDateDisplayed(l))?l:c,f=function(e){a(e)},p=tS(),h=function(e,r){if(o){var a=function e(t,n){var r=n.moveBy,o=n.direction,a=n.context,i=n.modifiers,l=n.retry,s=void 0===l?{count:0,lastFocused:t}:l,c=a.weekStartsOn,u=a.fromDate,d=a.toDate,f=a.locale,p=({day:eh.Z,week:ti,month:ev.Z,year:tl,startOfWeek:function(e){return a.ISOWeek?tn(e):tt(e,{locale:f,weekStartsOn:c})},endOfWeek:function(e){return a.ISOWeek?tc(e):ts(e,{locale:f,weekStartsOn:c})}})[r](t,"after"===o?1:-1);"before"===o&&u?p=ef([u,p]):"after"===o&&d&&(p=ep([d,p]));var h=!0;if(i){var m=t9(p,i);h=!m.disabled&&!m.hidden}return h?p:s.count>365?s.lastFocused:e(p,{moveBy:r,direction:o,context:a,modifiers:i,retry:tu(tu({},s),{count:s.count+1})})}(o,{moveBy:e,direction:r,context:p,modifiers:n});tr(o,a)||(t.goToDate(a,o),f(a))}};return th.jsx(ne.Provider,{value:{focusedDay:o,focusTarget:u,blur:function(){s(o),a(void 0)},focus:f,focusDayAfter:function(){return h("day","after")},focusDayBefore:function(){return h("day","before")},focusWeekAfter:function(){return h("week","after")},focusWeekBefore:function(){return h("week","before")},focusMonthBefore:function(){return h("month","before")},focusMonthAfter:function(){return h("month","after")},focusYearBefore:function(){return h("year","before")},focusYearAfter:function(){return h("year","after")},focusStartOfWeek:function(){return h("startOfWeek","before")},focusEndOfWeek:function(){return h("endOfWeek","after")}},children:e.children})}function nn(){var e=(0,d.useContext)(ne);if(!e)throw Error("useFocusContext must be used within a FocusProvider");return e}var nr=(0,d.createContext)(void 0);function no(e){return tv(e.initialProps)?th.jsx(na,{initialProps:e.initialProps,children:e.children}):th.jsx(nr.Provider,{value:{selected:void 0},children:e.children})}function na(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var o,a,i;if(null===(o=t.onDayClick)||void 0===o||o.call(t,e,n,r),n.selected&&!t.required){null===(a=t.onSelect)||void 0===a||a.call(t,void 0,e,n,r);return}null===(i=t.onSelect)||void 0===i||i.call(t,e,e,n,r)}};return th.jsx(nr.Provider,{value:r,children:n})}function ni(){var e=(0,d.useContext)(nr);if(!e)throw Error("useSelectSingle must be used within a SelectSingleProvider");return e}function nl(e){var t,n,r,o,a,i,l,s,u,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U=(0,d.useRef)(null),K=(t=e.date,n=e.displayMonth,i=tS(),l=nn(),s=t9(t,t7(),n),u=tS(),f=ni(),p=tK(),h=tG(),g=(m=nn()).focusDayAfter,v=m.focusDayBefore,y=m.focusWeekAfter,b=m.focusWeekBefore,x=m.blur,w=m.focus,k=m.focusMonthBefore,S=m.focusMonthAfter,E=m.focusYearBefore,O=m.focusYearAfter,C=m.focusStartOfWeek,j=m.focusEndOfWeek,_={onClick:function(e){var n,r,o,a;tv(u)?null===(n=f.onDayClick)||void 0===n||n.call(f,t,s,e):tm(u)?null===(r=p.onDayClick)||void 0===r||r.call(p,t,s,e):tg(u)?null===(o=h.onDayClick)||void 0===o||o.call(h,t,s,e):null===(a=u.onDayClick)||void 0===a||a.call(u,t,s,e)},onFocus:function(e){var n;w(t),null===(n=u.onDayFocus)||void 0===n||n.call(u,t,s,e)},onBlur:function(e){var n;x(),null===(n=u.onDayBlur)||void 0===n||n.call(u,t,s,e)},onKeyDown:function(e){var n;switch(e.key){case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?g():v();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===u.dir?v():g();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),y();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),b();break;case"PageUp":e.preventDefault(),e.stopPropagation(),e.shiftKey?E():k();break;case"PageDown":e.preventDefault(),e.stopPropagation(),e.shiftKey?O():S();break;case"Home":e.preventDefault(),e.stopPropagation(),C();break;case"End":e.preventDefault(),e.stopPropagation(),j()}null===(n=u.onDayKeyDown)||void 0===n||n.call(u,t,s,e)},onKeyUp:function(e){var n;null===(n=u.onDayKeyUp)||void 0===n||n.call(u,t,s,e)},onMouseEnter:function(e){var n;null===(n=u.onDayMouseEnter)||void 0===n||n.call(u,t,s,e)},onMouseLeave:function(e){var n;null===(n=u.onDayMouseLeave)||void 0===n||n.call(u,t,s,e)},onPointerEnter:function(e){var n;null===(n=u.onDayPointerEnter)||void 0===n||n.call(u,t,s,e)},onPointerLeave:function(e){var n;null===(n=u.onDayPointerLeave)||void 0===n||n.call(u,t,s,e)},onTouchCancel:function(e){var n;null===(n=u.onDayTouchCancel)||void 0===n||n.call(u,t,s,e)},onTouchEnd:function(e){var n;null===(n=u.onDayTouchEnd)||void 0===n||n.call(u,t,s,e)},onTouchMove:function(e){var n;null===(n=u.onDayTouchMove)||void 0===n||n.call(u,t,s,e)},onTouchStart:function(e){var n;null===(n=u.onDayTouchStart)||void 0===n||n.call(u,t,s,e)}},P=tS(),N=ni(),T=tK(),A=tG(),M=tv(P)?N.selected:tm(P)?T.selected:tg(P)?A.selected:void 0,I=!!(i.onDayClick||"default"!==i.mode),(0,d.useEffect)(function(){var e;!s.outside&&l.focusedDay&&I&&tr(l.focusedDay,t)&&(null===(e=U.current)||void 0===e||e.focus())},[l.focusedDay,t,U,I,s.outside]),D=(R=[i.classNames.day],Object.keys(s).forEach(function(e){var t=i.modifiersClassNames[e];if(t)R.push(t);else if(Object.values(c).includes(e)){var n=i.classNames["day_".concat(e)];n&&R.push(n)}}),R).join(" "),L=tu({},i.styles.day),Object.keys(s).forEach(function(e){var t;L=tu(tu({},L),null===(t=i.modifiersStyles)||void 0===t?void 0:t[e])}),Z=L,z=!!(s.outside&&!i.showOutsideDays||s.hidden),B=null!==(a=null===(o=i.components)||void 0===o?void 0:o.DayContent)&&void 0!==a?a:tH,F={style:Z,className:D,children:th.jsx(B,{date:t,displayMonth:n,activeModifiers:s}),role:"gridcell"},H=l.focusTarget&&tr(l.focusTarget,t)&&!s.outside,q=l.focusedDay&&tr(l.focusedDay,t),W=tu(tu(tu({},F),((r={disabled:s.disabled,role:"gridcell"})["aria-selected"]=s.selected,r.tabIndex=q||H?0:-1,r)),_),{isButton:I,isHidden:z,activeModifiers:s,selectedDays:M,buttonProps:W,divProps:F});return K.isHidden?th.jsx("div",{role:"gridcell"}):K.isButton?th.jsx(tR,tu({name:"day",ref:U},K.buttonProps)):th.jsx("div",tu({},K.divProps))}function ns(e){var t=e.number,n=e.dates,r=tS(),o=r.onWeekNumberClick,a=r.styles,i=r.classNames,l=r.locale,s=r.labels.labelWeekNumber,c=(0,r.formatters.formatWeekNumber)(Number(t),{locale:l});if(!o)return th.jsx("span",{className:i.weeknumber,style:a.weeknumber,children:c});var u=s(Number(t),{locale:l});return th.jsx(tR,{name:"week-number","aria-label":u,className:i.weeknumber,style:a.weeknumber,onClick:function(e){o(t,n,e)},children:c})}function nc(e){var t,n,r,o=tS(),a=o.styles,i=o.classNames,l=o.showWeekNumber,s=o.components,c=null!==(t=null==s?void 0:s.Day)&&void 0!==t?t:nl,u=null!==(n=null==s?void 0:s.WeekNumber)&&void 0!==n?n:ns;return l&&(r=th.jsx("td",{className:i.cell,style:a.cell,children:th.jsx(u,{number:e.weekNumber,dates:e.dates})})),th.jsxs("tr",{className:i.row,style:a.row,children:[r,e.dates.map(function(t){return th.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:th.jsx(c,{displayMonth:e.displayMonth,date:t})},function(e){return(0,ea.Z)(1,arguments),Math.floor(function(e){return(0,ea.Z)(1,arguments),(0,eo.Z)(e).getTime()}(e)/1e3)}(t))})]})}function nu(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?tc(t):ts(t,n),o=(null==n?void 0:n.ISOWeek)?tn(e):tt(e,n),a=ta(r,o),i=[],l=0;l<=a;l++)i.push((0,eh.Z)(o,l));return i.reduce(function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e);return Math.round((tn(t).getTime()-(function(e){(0,ea.Z)(1,arguments);var t=function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=tn(r),a=new Date(0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);var i=tn(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),tn(n)})(t).getTime())/6048e5)+1}(t):function(e,t){(0,ea.Z)(1,arguments);var n=(0,eo.Z)(e);return Math.round((tt(n,t).getTime()-(function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),d=function(e,t){(0,ea.Z)(1,arguments);var n,r,o,a,i,l,s,c,u=(0,eo.Z)(e),d=u.getFullYear(),f=(0,em.Z)(null!==(n=null!==(r=null!==(o=null!==(a=null==t?void 0:t.firstWeekContainsDate)&&void 0!==a?a:null==t?void 0:null===(i=t.locale)||void 0===i?void 0:null===(l=i.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:eS.firstWeekContainsDate)&&void 0!==r?r:null===(s=eS.locale)||void 0===s?void 0:null===(c=s.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var h=tt(p,t),m=new Date(0);m.setFullYear(d,0,f),m.setHours(0,0,0,0);var g=tt(m,t);return u.getTime()>=h.getTime()?d+1:u.getTime()>=g.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(d,0,u),f.setHours(0,0,0,0),tt(f,t)})(n,t).getTime())/6048e5)+1}(t,n),o=e.find(function(e){return e.weekNumber===r});return o?o.dates.push(t):e.push({weekNumber:r,dates:[t]}),e},[])}function nd(e){var t,n,r,o=tS(),a=o.locale,i=o.classNames,l=o.styles,s=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,p=o.ISOWeek,h=function(e,t){var n=nu(es(e),e3(e),t);if(null==t?void 0:t.useFixedWeeks){var r=function(e,t){return(0,ea.Z)(1,arguments),function(e,t,n){(0,ea.Z)(2,arguments);var r=tt(e,n),o=tt(t,n);return Math.round((r.getTime()-eD(r)-(o.getTime()-eD(o)))/6048e5)}(function(e){(0,ea.Z)(1,arguments);var t=(0,eo.Z)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),es(e),t)+1}(e,t);if(r<6){var o=n[n.length-1],a=o.dates[o.dates.length-1],i=ti(a,6-r),l=nu(ti(a,1),i,t);n.push.apply(n,l)}}return n}(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:a,weekStartsOn:d,firstWeekContainsDate:f}),m=null!==(t=null==u?void 0:u.Head)&&void 0!==t?t:tF,g=null!==(n=null==u?void 0:u.Row)&&void 0!==n?n:nc,v=null!==(r=null==u?void 0:u.Footer)&&void 0!==r?r:tz;return th.jsxs("table",{id:e.id,className:i.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!s&&th.jsx(m,{}),th.jsx("tbody",{className:i.tbody,style:l.tbody,children:h.map(function(t){return th.jsx(g,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),th.jsx(v,{displayMonth:e.displayMonth})]})}var nf="undefined"!=typeof window&&window.document&&window.document.createElement?d.useLayoutEffect:d.useEffect,np=!1,nh=0;function nm(){return"react-day-picker-".concat(++nh)}function ng(e){var t,n,r,o,a,i,l,s,c=tS(),u=c.dir,f=c.classNames,p=c.styles,h=c.components,m=tT().displayMonths,g=(r=null!=(t=c.id?"".concat(c.id,"-").concat(e.displayIndex):void 0)?t:np?nm():null,a=(o=(0,d.useState)(r))[0],i=o[1],nf(function(){null===a&&i(nm())},[]),(0,d.useEffect)(function(){!1===np&&(np=!0)},[]),null!==(n=null!=t?t:a)&&void 0!==n?n:void 0),v=c.id?"".concat(c.id,"-grid-").concat(e.displayIndex):void 0,y=[f.month],b=p.month,x=0===e.displayIndex,w=e.displayIndex===m.length-1,k=!x&&!w;"rtl"===u&&(w=(l=[x,w])[0],x=l[1]),x&&(y.push(f.caption_start),b=tu(tu({},b),p.caption_start)),w&&(y.push(f.caption_end),b=tu(tu({},b),p.caption_end)),k&&(y.push(f.caption_between),b=tu(tu({},b),p.caption_between));var S=null!==(s=null==h?void 0:h.Caption)&&void 0!==s?s:tZ;return th.jsxs("div",{className:y.join(" "),style:b,children:[th.jsx(S,{id:g,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),th.jsx(nd,{id:v,"aria-labelledby":g,displayMonth:e.displayMonth})]},e.displayIndex)}function nv(e){var t=tS(),n=t.classNames,r=t.styles;return th.jsx("div",{className:n.months,style:r.months,children:e.children})}function ny(e){var t,n,r=e.initialProps,o=tS(),a=nn(),i=tT(),l=(0,d.useState)(!1),s=l[0],c=l[1];(0,d.useEffect)(function(){o.initialFocus&&a.focusTarget&&(s||(a.focus(a.focusTarget),c(!0)))},[o.initialFocus,s,a.focus,a.focusTarget,a]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=tu(tu({},o.styles.root),o.style),p=Object.keys(r).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var n;return tu(tu({},e),((n={})[t]=r[t],n))},{}),h=null!==(n=null===(t=r.components)||void 0===t?void 0:t.Months)&&void 0!==n?n:nv;return th.jsx("div",tu({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:th.jsx(h,{children:i.displayMonths.map(function(e,t){return th.jsx(ng,{displayIndex:t,displayMonth:e},t)})})}))}function nb(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}(e,["children"]);return th.jsx(tk,{initialProps:n,children:th.jsx(tN,{children:th.jsx(no,{initialProps:n,children:th.jsx(tW,{initialProps:n,children:th.jsx(tV,{initialProps:n,children:th.jsx(t8,{children:th.jsx(nt,{children:t})})})})})})})}function nx(e){return th.jsx(nb,tu({},e,{children:th.jsx(ny,{initialProps:e})}))}let nw=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))},nk=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))},nS=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"}))},nE=e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"}))};var nO=n(84264);n(41649);var nC=n(1526),nj=n(7084),n_=n(26898);let nP={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-1",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-1.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-lg"},xl:{paddingX:"px-3.5",paddingY:"py-1.5",fontSize:"text-xl"}},nN={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},nT={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},nA={[nj.wu.Increase]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.ModerateIncrease]:{bgColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Emerald,n_.K.text).textColor},[nj.wu.Decrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.ModerateDecrease]:{bgColor:(0,eJ.bM)(nj.fr.Rose,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Rose,n_.K.text).textColor},[nj.wu.Unchanged]:{bgColor:(0,eJ.bM)(nj.fr.Orange,n_.K.background).bgColor,textColor:(0,eJ.bM)(nj.fr.Orange,n_.K.text).textColor}},nM={[nj.wu.Increase]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z"}))},[nj.wu.ModerateIncrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.0037 9.41421L7.39712 18.0208L5.98291 16.6066L14.5895 8H7.00373V6H18.0037V17H16.0037V9.41421Z"}))},[nj.wu.Decrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z"}))},[nj.wu.ModerateDecrease]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M14.5895 16.0032L5.98291 7.39664L7.39712 5.98242L16.0037 14.589V7.00324H18.0037V18.0032H7.00373V16.0032H14.5895Z"}))},[nj.wu.Unchanged]:e=>{var t=(0,u._T)(e,[]);return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),d.createElement("path",{d:"M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"}))}},nI=(0,eJ.fn)("BadgeDelta");d.forwardRef((e,t)=>{let{deltaType:n=nj.wu.Increase,isIncreasePositive:r=!0,size:o=nj.u8.SM,tooltip:a,children:i,className:l}=e,s=(0,u._T)(e,["deltaType","isIncreasePositive","size","tooltip","children","className"]),c=nM[n],f=(0,eJ.Fo)(n,r),p=i?nN:nP,{tooltipProps:h,getReferenceProps:m}=(0,nC.l)();return d.createElement("span",Object.assign({ref:(0,eJ.lq)([t,h.refs.setReference]),className:(0,ec.q)(nI("root"),"w-max flex-shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-full bg-opacity-20 dark:bg-opacity-25",nA[f].bgColor,nA[f].textColor,p[o].paddingX,p[o].paddingY,p[o].fontSize,l)},m,s),d.createElement(nC.Z,Object.assign({text:a},h)),d.createElement(c,{className:(0,ec.q)(nI("icon"),"shrink-0",i?(0,ec.q)("-ml-1 mr-1.5"):nT[o].height,nT[o].width)}),i?d.createElement("p",{className:(0,ec.q)(nI("text"),"text-sm whitespace-nowrap")},i):null)}).displayName="BadgeDelta";var nR=n(47323);let nD=e=>{var{onClick:t,icon:n}=e,r=(0,u._T)(e,["onClick","icon"]);return d.createElement("button",Object.assign({type:"button",className:(0,ec.q)("flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle select-none dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content")},r),d.createElement(nR.Z,{onClick:t,icon:n,variant:"simple",color:"slate",size:"sm"}))};function nL(e){var{mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,enableYearNavigation:l,classNames:s,weekStartsOn:c=0}=e,f=(0,u._T)(e,["mode","defaultMonth","selected","onSelect","locale","disabled","enableYearNavigation","classNames","weekStartsOn"]);return d.createElement(nx,Object.assign({showOutsideDays:!0,mode:t,defaultMonth:n,selected:r,onSelect:o,locale:a,disabled:i,weekStartsOn:c,classNames:Object.assign({months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-2 relative items-center",caption_label:"text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium",nav:"space-x-1 flex items-center",nav_button:"flex items-center justify-center p-1 h-7 w-7 outline-none focus:ring-2 transition duration-100 border border-tremor-border dark:border-dark-tremor-border hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted rounded-tremor-small focus:border-tremor-brand-subtle dark:focus:border-dark-tremor-brand-subtle focus:ring-tremor-brand-muted dark:focus:ring-dark-tremor-brand-muted text-tremor-content-subtle dark:text-dark-tremor-content-subtle hover:text-tremor-content dark:hover:text-dark-tremor-content",nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"w-9 font-normal text-center text-tremor-content-subtle dark:text-dark-tremor-content-subtle",row:"flex w-full mt-0.5",cell:"text-center p-0 relative focus-within:relative text-tremor-default text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",day:"h-9 w-9 p-0 hover:bg-tremor-background-subtle dark:hover:bg-dark-tremor-background-subtle outline-tremor-brand dark:outline-dark-tremor-brand rounded-tremor-default",day_today:"font-bold",day_selected:"aria-selected:bg-tremor-background-emphasis aria-selected:text-tremor-content-inverted dark:aria-selected:bg-dark-tremor-background-emphasis dark:aria-selected:text-dark-tremor-content-inverted ",day_disabled:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle disabled:hover:bg-transparent",day_outside:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle"},s),components:{IconLeft:e=>{var t=(0,u._T)(e,[]);return d.createElement(nw,Object.assign({className:"h-4 w-4"},t))},IconRight:e=>{var t=(0,u._T)(e,[]);return d.createElement(nk,Object.assign({className:"h-4 w-4"},t))},Caption:e=>{var t=(0,u._T)(e,[]);let{goToMonth:n,nextMonth:r,previousMonth:o,currentMonth:i}=tT();return d.createElement("div",{className:"flex justify-between items-center"},d.createElement("div",{className:"flex items-center space-x-1"},l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,-1)),icon:nS}),d.createElement(nD,{onClick:()=>o&&n(o),icon:nw})),d.createElement(nO.Z,{className:"text-tremor-default tabular-nums capitalize text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis font-medium"},eQ(t.displayMonth,"LLLL yyy",{locale:a})),d.createElement("div",{className:"flex items-center space-x-1"},d.createElement(nD,{onClick:()=>r&&n(r),icon:nk}),l&&d.createElement(nD,{onClick:()=>i&&n(tl(i,1)),icon:nE})))}}},f))}nL.displayName="DateRangePicker",n(27281);var nZ=n(57365),nz=n(44140);let nB=el(),nF=d.forwardRef((e,t)=>{var n,r;let{value:o,defaultValue:a,onValueChange:i,enableSelect:l=!0,minDate:s,maxDate:c,placeholder:f="Select range",selectPlaceholder:p="Select range",disabled:h=!1,locale:m=eK,enableClear:g=!0,displayFormat:v,children:y,className:b,enableYearNavigation:x=!1,weekStartsOn:w=0,disabledDates:k}=e,S=(0,u._T)(e,["value","defaultValue","onValueChange","enableSelect","minDate","maxDate","placeholder","selectPlaceholder","disabled","locale","enableClear","displayFormat","children","className","enableYearNavigation","weekStartsOn","disabledDates"]),[E,O]=(0,nz.Z)(a,o),[C,j]=(0,d.useState)(!1),[_,P]=(0,d.useState)(!1),N=(0,d.useMemo)(()=>{let e=[];return s&&e.push({before:s}),c&&e.push({after:c}),[...e,...null!=k?k:[]]},[s,c,k]),T=(0,d.useMemo)(()=>{let e=new Map;return y?d.Children.forEach(y,t=>{var n;e.set(t.props.value,{text:null!==(n=(0,eu.qg)(t))&&void 0!==n?n:t.props.value,from:t.props.from,to:t.props.to})}):e6.forEach(t=>{e.set(t.value,{text:t.text,from:t.from,to:nB})}),e},[y]),A=(0,d.useMemo)(()=>{if(y)return(0,eu.sl)(y);let e=new Map;return e6.forEach(t=>e.set(t.value,t.text)),e},[y]),M=(null==E?void 0:E.selectValue)||"",I=e1(null==E?void 0:E.from,s,M,T),R=e2(null==E?void 0:E.to,c,M,T),D=I||R?e4(I,R,m,v):f,L=es(null!==(r=null!==(n=null!=R?R:I)&&void 0!==n?n:c)&&void 0!==r?r:nB),Z=g&&!h;return d.createElement("div",Object.assign({ref:t,className:(0,ec.q)("w-full min-w-[10rem] relative flex justify-between text-tremor-default max-w-sm shadow-tremor-input dark:shadow-dark-tremor-input rounded-tremor-default",b)},S),d.createElement(J,{as:"div",className:(0,ec.q)("w-full",l?"rounded-l-tremor-default":"rounded-tremor-default",C&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10")},d.createElement("div",{className:"relative w-full"},d.createElement(J.Button,{onFocus:()=>j(!0),onBlur:()=>j(!1),disabled:h,className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate focus:ring-2 transition duration-100 rounded-l-tremor-default flex flex-nowrap border pl-3 py-2","rounded-l-tremor-default border-tremor-border text-tremor-content-emphasis focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",l?"rounded-l-tremor-default":"rounded-tremor-default",Z?"pr-8":"pr-4",(0,eu.um)((0,eu.Uh)(I||R),h))},d.createElement(en,{className:(0,ec.q)(e0("calendarIcon"),"flex-none shrink-0 h-5 w-5 -ml-0.5 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle"),"aria-hidden":"true"}),d.createElement("p",{className:"truncate"},D)),Z&&I?d.createElement("button",{type:"button",className:(0,ec.q)("absolute outline-none inset-y-0 right-0 flex items-center transition duration-100 mr-4"),onClick:e=>{e.preventDefault(),null==i||i({}),O({})}},d.createElement(er.Z,{className:(0,ec.q)(e0("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null),d.createElement(ee.u,{className:"absolute z-10 min-w-min left-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(J.Panel,{focus:!0,className:(0,ec.q)("divide-y overflow-y-auto outline-none rounded-tremor-default p-3 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},d.createElement(nL,Object.assign({mode:"range",showOutsideDays:!0,defaultMonth:L,selected:{from:I,to:R},onSelect:e=>{null==i||i({from:null==e?void 0:e.from,to:null==e?void 0:e.to}),O({from:null==e?void 0:e.from,to:null==e?void 0:e.to})},locale:m,disabled:N,enableYearNavigation:x,classNames:{day_range_middle:(0,ec.q)("!rounded-none aria-selected:!bg-tremor-background-subtle aria-selected:dark:!bg-dark-tremor-background-subtle aria-selected:!text-tremor-content aria-selected:dark:!bg-dark-tremor-background-subtle"),day_range_start:"rounded-r-none rounded-l-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted",day_range_end:"rounded-l-none rounded-r-tremor-small aria-selected:text-tremor-brand-inverted dark:aria-selected:text-dark-tremor-brand-inverted"},weekStartsOn:w},e))))),l&&d.createElement(et.R,{as:"div",className:(0,ec.q)("w-48 -ml-px rounded-r-tremor-default",_&&"ring-2 ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted z-10"),value:M,onChange:e=>{let{from:t,to:n}=T.get(e),r=null!=n?n:nB;null==i||i({from:t,to:r,selectValue:e}),O({from:t,to:r,selectValue:e})},disabled:h},e=>{var t;let{value:n}=e;return d.createElement(d.Fragment,null,d.createElement(et.R.Button,{onFocus:()=>P(!0),onBlur:()=>P(!1),className:(0,ec.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-r-tremor-default transition duration-100 border px-4 py-2","border-tremor-border shadow-tremor-input text-tremor-content-emphasis focus:border-tremor-brand-subtle","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:text-dark-tremor-content-emphasis dark:focus:border-dark-tremor-brand-subtle",(0,eu.um)((0,eu.Uh)(n),h))},n&&null!==(t=A.get(n))&&void 0!==t?t:p),d.createElement(ee.u,{className:"absolute z-10 w-full inset-x-0 right-0",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},d.createElement(et.R.Options,{className:(0,ec.q)("divide-y overflow-y-auto outline-none border my-1","shadow-tremor-dropdown bg-tremor-background border-tremor-border divide-tremor-border rounded-tremor-default","dark:shadow-dark-tremor-dropdown dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border")},null!=y?y:e6.map(e=>d.createElement(nZ.Z,{key:e.value,value:e.value},e.text)))))}))});nF.displayName="DateRangePicker"},92414:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(5853),o=n(2265);n(42698),n(64016),n(8710);var a=n(33232),i=n(44140),l=n(58747);let s=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var c=n(4537),u=n(28517),d=n(33044);let f=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),o.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var p=n(97324),h=n(1153),m=n(96398);let g=(0,h.fn)("MultiSelect"),v=o.forwardRef((e,t)=>{let{defaultValue:n,value:h,onValueChange:v,placeholder:y="Select...",placeholderSearch:b="Search",disabled:x=!1,icon:w,children:k,className:S}=e,E=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className"]),[O,C]=(0,i.Z)(n,h),{reactElementChildren:j,optionsAvailable:_}=(0,o.useMemo)(()=>{let e=o.Children.toArray(k).filter(o.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,m.n0)("",e)}},[k]),[P,N]=(0,o.useState)(""),T=(null!=O?O:[]).length>0,A=(0,o.useMemo)(()=>P?(0,m.n0)(P,j):_,[P,j,_]),M=()=>{N("")};return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:O,value:O,onChange:e=>{null==v||v(e),C(e)},disabled:x,className:(0,p.q)("w-full min-w-[10rem] relative text-tremor-default",S)},E,{multiple:!0}),e=>{let{value:t}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,p.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",w?"pl-11 -ml-0.5":"pl-3",(0,m.um)(t.length>0,x))},w&&o.createElement("span",{className:(0,p.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(w,{className:(0,p.q)(g("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("div",{className:"h-6 flex items-center"},t.length>0?o.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},_.filter(e=>t.includes(e.props.value)).map((e,n)=>{var r;return o.createElement("div",{key:n,className:(0,p.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},o.createElement("div",{className:"text-xs truncate "},null!==(r=e.props.children)&&void 0!==r?r:e.props.value),o.createElement("div",{onClick:n=>{n.preventDefault();let r=t.filter(t=>t!==e.props.value);null==v||v(r),C(r)}},o.createElement(f,{className:(0,p.q)(g("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):o.createElement("span",null,y)),o.createElement("span",{className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},o.createElement(l.Z,{className:(0,p.q)(g("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),T&&!x?o.createElement("button",{type:"button",className:(0,p.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),C([]),null==v||v([])}},o.createElement(c.Z,{className:(0,p.q)(g("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,p.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},o.createElement("div",{className:(0,p.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},o.createElement("span",null,o.createElement(s,{className:(0,p.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:b,className:(0,p.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>N(e.target.value),value:P})),o.createElement(a.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:M}},{value:{selectedValue:t}}),A))))})});v.displayName="MultiSelect"},46030:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698),n(64016),n(8710);var o=n(33232),a=n(2265),i=n(97324),l=n(1153),s=n(28517);let c=(0,l.fn)("MultiSelectItem"),u=a.forwardRef((e,t)=>{let{value:n,className:u,children:d}=e,f=(0,r._T)(e,["value","className","children"]),{selectedValue:p}=(0,a.useContext)(o.Z),h=(0,l.NZ)(n,p);return a.createElement(s.R.Option,Object.assign({className:(0,i.q)(c("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",u),ref:t,key:n,value:n},f),a.createElement("input",{type:"checkbox",className:(0,i.q)(c("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:h,readOnly:!0}),a.createElement("span",{className:"whitespace-nowrap truncate"},null!=d?d:n))});u.displayName="MultiSelectItem"},30150:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(2265);let a=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var l=n(97324),s=n(1153),c=n(69262);let u="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",f=o.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:f=!0,disabled:p,onValueChange:h,onChange:m}=e,g=(0,r._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),v=(0,o.useRef)(null),[y,b]=o.useState(!1),x=o.useCallback(()=>{b(!0)},[]),w=o.useCallback(()=>{b(!1)},[]),[k,S]=o.useState(!1),E=o.useCallback(()=>{S(!0)},[]),O=o.useCallback(()=>{S(!1)},[]);return o.createElement(c.Z,Object.assign({type:"number",ref:(0,s.lq)([v,t]),disabled:p,makeInputClassName:(0,s.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=v.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&O()},onChange:e=>{p||(null==h||h(parseFloat(e.target.value)),null==m||m(e))},stepper:f?o.createElement("div",{className:(0,l.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepDown(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(i,{"data-testid":"step-down",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepUp(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-up",className:(k?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},g))});f.displayName="NumberInput"},27281:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(5853),o=n(2265),a=n(58747),i=n(4537),l=n(97324),s=n(1153),c=n(96398),u=n(28517),d=n(33044),f=n(44140);let p=(0,s.fn)("Select"),h=o.forwardRef((e,t)=>{let{defaultValue:n,value:s,onValueChange:h,placeholder:m="Select...",disabled:g=!1,icon:v,enableClear:y=!0,children:b,className:x}=e,w=(0,r._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","children","className"]),[k,S]=(0,f.Z)(n,s),E=(0,o.useMemo)(()=>{let e=o.Children.toArray(b).filter(o.isValidElement);return(0,c.sl)(e)},[b]);return o.createElement(u.R,Object.assign({as:"div",ref:t,defaultValue:k,value:k,onChange:e=>{null==h||h(e),S(e)},disabled:g,className:(0,l.q)("w-full min-w-[10rem] relative text-tremor-default",x)},w),e=>{var t;let{value:n}=e;return o.createElement(o.Fragment,null,o.createElement(u.R.Button,{className:(0,l.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",v?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(n),g))},v&&o.createElement("span",{className:(0,l.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(v,{className:(0,l.q)(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},n&&null!==(t=E.get(n))&&void 0!==t?t:m),o.createElement("span",{className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,l.q)(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),y&&k?o.createElement("button",{type:"button",className:(0,l.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),S(""),null==h||h("")}},o.createElement(i.Z,{className:(0,l.q)(p("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(d.u,{className:"absolute z-10 w-full",enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},o.createElement(u.R.Options,{className:(0,l.q)("divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] left-0 border my-1","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},b)))})});h.displayName="Select"},57365:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(28517),i=n(97324);let l=(0,n(1153).fn)("SelectItem"),s=o.forwardRef((e,t)=>{let{value:n,icon:s,className:c,children:u}=e,d=(0,r._T)(e,["value","icon","className","children"]);return o.createElement(a.R.Option,Object.assign({className:(0,i.q)(l("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","ui-active:bg-tremor-background-muted ui-active:text-tremor-content-strong ui-selected:text-tremor-content-strong ui-selected:bg-tremor-background-muted text-tremor-content-emphasis","dark:ui-active:bg-dark-tremor-background-muted dark:ui-active:text-dark-tremor-content-strong dark:ui-selected:text-dark-tremor-content-strong dark:ui-selected:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",c),ref:t,key:n,value:n},d),s&&o.createElement(s,{className:(0,i.q)(l("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),o.createElement("span",{className:"whitespace-nowrap truncate"},null!=u?u:n))});s.displayName="SelectItem"},92858:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var r=n(5853),o=n(2265),a=n(62963),i=n(90945),l=n(13323),s=n(17684),c=n(80004),u=n(93689),d=n(38198),f=n(47634),p=n(56314),h=n(27847),m=n(64518);let g=(0,o.createContext)(null),v=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-description-".concat(n),...a}=e,i=function e(){let t=(0,o.useContext)(g);if(null===t){let t=Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),l=(0,u.T)(t);(0,m.e)(()=>i.register(r),[r,i.register]);let c={ref:l,...i.props,id:r};return(0,h.sY)({ourProps:c,theirProps:a,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})}),{});var y=n(37388);let b=(0,o.createContext)(null),x=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-label-".concat(n),passive:a=!1,...i}=e,l=function e(){let t=(0,o.useContext)(b);if(null===t){let t=Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),c=(0,u.T)(t);(0,m.e)(()=>l.register(r),[r,l.register]);let d={ref:c,...l.props,id:r};return a&&("onClick"in d&&(delete d.htmlFor,delete d.onClick),"onClick"in i&&delete i.onClick),(0,h.sY)({ourProps:d,theirProps:i,slot:l.slot||{},defaultTag:"label",name:l.name||"Label"})}),{}),w=(0,o.createContext)(null);w.displayName="GroupContext";let k=o.Fragment,S=Object.assign((0,h.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-switch-".concat(n),checked:m,defaultChecked:g=!1,onChange:v,name:b,value:x,form:k,...S}=e,E=(0,o.useContext)(w),O=(0,o.useRef)(null),C=(0,u.T)(O,t,null===E?null:E.setSwitch),[j,_]=(0,a.q)(m,v,g),P=(0,l.z)(()=>null==_?void 0:_(!j)),N=(0,l.z)(e=>{if((0,f.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),P()}),T=(0,l.z)(e=>{e.key===y.R.Space?(e.preventDefault(),P()):e.key===y.R.Enter&&(0,p.g)(e.currentTarget)}),A=(0,l.z)(e=>e.preventDefault()),M=(0,o.useMemo)(()=>({checked:j}),[j]),I={id:r,ref:C,role:"switch",type:(0,c.f)(e,O),tabIndex:0,"aria-checked":j,"aria-labelledby":null==E?void 0:E.labelledby,"aria-describedby":null==E?void 0:E.describedby,onClick:N,onKeyUp:T,onKeyPress:A},R=(0,i.G)();return(0,o.useEffect)(()=>{var e;let t=null==(e=O.current)?void 0:e.closest("form");t&&void 0!==g&&R.addEventListener(t,"reset",()=>{_(g)})},[O,_]),o.createElement(o.Fragment,null,null!=b&&j&&o.createElement(d._,{features:d.A.Hidden,...(0,h.oA)({as:"input",type:"checkbox",hidden:!0,readOnly:!0,form:k,checked:j,name:b,value:x})}),(0,h.sY)({ourProps:I,theirProps:S,slot:M,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[n,r]=(0,o.useState)(null),[a,i]=function(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(b.Provider,{value:r},e.children)},[t])]}(),[s,c]=function(){let[e,t]=(0,o.useState)([]);return[e.length>0?e.join(" "):void 0,(0,o.useMemo)(()=>function(e){let n=(0,l.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),r=(0,o.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props}),[n,e.slot,e.name,e.props]);return o.createElement(g.Provider,{value:r},e.children)},[t])]}(),u=(0,o.useMemo)(()=>({switch:n,setSwitch:r,labelledby:a,describedby:s}),[n,r,a,s]);return o.createElement(c,{name:"Switch.Description"},o.createElement(i,{name:"Switch.Label",props:{htmlFor:null==(t=u.switch)?void 0:t.id,onClick(e){n&&("LABEL"===e.currentTarget.tagName&&e.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},o.createElement(w.Provider,{value:u},(0,h.sY)({ourProps:{},theirProps:e,defaultTag:k,name:"Switch.Group"}))))},Label:x,Description:v});var E=n(44140),O=n(26898),C=n(97324),j=n(1153),_=n(1526);let P=(0,j.fn)("Switch"),N=o.forwardRef((e,t)=>{let{checked:n,defaultChecked:a=!1,onChange:i,color:l,name:s,error:c,errorMessage:u,disabled:d,required:f,tooltip:p,id:h}=e,m=(0,r._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:l?(0,j.bM)(l,O.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:l?(0,j.bM)(l,O.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,y]=(0,E.Z)(a,n),[b,x]=(0,o.useState)(!1),{tooltipProps:w,getReferenceProps:k}=(0,_.l)(300);return o.createElement("div",{className:"flex flex-row items-center justify-start"},o.createElement(_.Z,Object.assign({text:p},w)),o.createElement("div",Object.assign({ref:(0,j.lq)([t,w.refs.setReference]),className:(0,C.q)(P("root"),"flex flex-row relative h-5")},m,k),o.createElement("input",{type:"checkbox",className:(0,C.q)(P("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:s,required:f,checked:v,onChange:e=>{e.preventDefault()}}),o.createElement(S,{checked:v,onChange:e=>{y(e),null==i||i(e)},disabled:d,className:(0,C.q)(P("switch"),"w-10 h-5 group relative inline-flex flex-shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>x(!0),onBlur:()=>x(!1),id:h},o.createElement("span",{className:(0,C.q)(P("sr-only"),"sr-only")},"Switch ",v?"on":"off"),o.createElement("span",{"aria-hidden":"true",className:(0,C.q)(P("background"),v?g.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),o.createElement("span",{"aria-hidden":"true",className:(0,C.q)(P("round"),v?(0,C.q)(g.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",b?(0,C.q)("ring-2",g.ringColor):"")}))),c&&u?o.createElement("p",{className:(0,C.q)(P("errorMessage"),"text-sm text-red-500 mt-1 ")},u):null)});N.displayName="Switch"},12485:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(5853),o=n(31492),a=n(26898),i=n(97324),l=n(1153),s=n(2265),c=n(35242),u=n(42698);n(64016),n(8710),n(33232);let d=(0,l.fn)("Tab"),f=s.forwardRef((e,t)=>{let{icon:n,className:f,children:p}=e,h=(0,r._T)(e,["icon","className","children"]),m=(0,s.useContext)(c.O),g=(0,s.useContext)(u.Z);return s.createElement(o.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",g?(0,l.bM)(g,a.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,l.bM)(t,a.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,l.bM)(t,a.K.text).selectTextColor:"text-tremor-content dark:text-dark-tremor-content")}}(m,g),f)},h),n?s.createElement(n,{className:(0,i.q)(d("icon"),"flex-none h-5 w-5",p?"mr-2":"")}):null,p?s.createElement("span",null,p):null)});f.displayName="Tab"},18135:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(31492),a=n(97324),i=n(1153),l=n(2265);let s=(0,i.fn)("TabGroup"),c=l.forwardRef((e,t)=>{let{defaultIndex:n,index:i,onIndexChange:c,children:u,className:d}=e,f=(0,r._T)(e,["defaultIndex","index","onIndexChange","children","className"]);return l.createElement(o.O.Group,Object.assign({as:"div",ref:t,defaultIndex:n,selectedIndex:i,onChange:c,className:(0,a.q)(s("root"),"w-full",d)},f),u)});c.displayName="TabGroup"},35242:function(e,t,n){"use strict";n.d(t,{O:function(){return c},Z:function(){return d}});var r=n(5853),o=n(2265),a=n(42698);n(64016),n(8710),n(33232);var i=n(31492),l=n(97324);let s=(0,n(1153).fn)("TabList"),c=(0,o.createContext)("line"),u={line:(0,l.q)("flex border-b space-x-4","border-tremor-border","dark:border-dark-tremor-border"),solid:(0,l.q)("inline-flex p-0.5 rounded-tremor-default space-x-1.5","bg-tremor-background-subtle","dark:bg-dark-tremor-background-subtle")},d=o.forwardRef((e,t)=>{let{color:n,variant:d="line",children:f,className:p}=e,h=(0,r._T)(e,["color","variant","children","className"]);return o.createElement(i.O.List,Object.assign({ref:t,className:(0,l.q)(s("root"),"justify-start overflow-x-clip",u[d],p)},h),o.createElement(c.Provider,{value:d},o.createElement(a.Z.Provider,{value:n},f)))});d.displayName="TabList"},29706:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853);n(42698);var o=n(64016);n(8710);var a=n(33232),i=n(97324),l=n(1153),s=n(2265);let c=(0,l.fn)("TabPanel"),u=s.forwardRef((e,t)=>{let{children:n,className:l}=e,u=(0,r._T)(e,["children","className"]),{selectedValue:d}=(0,s.useContext)(a.Z),f=d===(0,s.useContext)(o.Z);return s.createElement("div",Object.assign({ref:t,className:(0,i.q)(c("root"),"w-full mt-2",f?"":"hidden",l),"aria-selected":f?"true":"false"},u),n)});u.displayName="TabPanel"},77991:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(5853),o=n(31492);n(42698);var a=n(64016);n(8710);var i=n(33232),l=n(97324),s=n(1153),c=n(2265);let u=(0,s.fn)("TabPanels"),d=c.forwardRef((e,t)=>{let{children:n,className:s}=e,d=(0,r._T)(e,["children","className"]);return c.createElement(o.O.Panels,Object.assign({as:"div",ref:t,className:(0,l.q)(u("root"),"w-full",s)},d),e=>{let{selectedIndex:t}=e;return c.createElement(i.Z.Provider,{value:{selectedValue:t}},c.Children.map(n,(e,t)=>c.createElement(a.Z.Provider,{value:t},e)))})});d.displayName="TabPanels"},49566:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265);n(97324);var a=n(1153),i=n(69262);let l=(0,a.fn)("TextInput"),s=o.forwardRef((e,t)=>{let{type:n="text"}=e,a=(0,r._T)(e,["type"]);return o.createElement(i.Z,Object.assign({ref:t,type:n,makeInputClassName:l},a))});s.displayName="TextInput"},16853:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(96398),a=n(44140),i=n(2265),l=n(97324),s=n(1153);let c=(0,s.fn)("Textarea"),u=i.forwardRef((e,t)=>{let{value:n,defaultValue:u="",placeholder:d="Type...",error:f=!1,errorMessage:p,disabled:h=!1,className:m,onChange:g,onValueChange:v}=e,y=(0,r._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange"]),[b,x]=(0,a.Z)(u,n),w=(0,i.useRef)(null),k=(0,o.Uh)(b);return i.createElement(i.Fragment,null,i.createElement("textarea",Object.assign({ref:(0,s.lq)([w,t]),value:b,placeholder:d,disabled:h,className:(0,l.q)(c("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,o.um)(k,h,f),h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",m),"data-testid":"text-area",onChange:e=>{null==g||g(e),x(e.target.value),null==v||v(e.target.value)}},y)),f&&p?i.createElement("p",{className:(0,l.q)(c("errorMessage"),"text-sm text-red-500 mt-1")},p):null)});u.displayName="Textarea"},96398:function(e,t,n){"use strict";n.d(t,{Uh:function(){return c},n0:function(){return l},qg:function(){return a},sl:function(){return i},um:function(){return s}});var r=n(97324),o=n(2265);let a=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(a).join(""):"object"==typeof e&&e?a(e.props.children):void 0;function i(e){let t=new Map;return o.Children.map(e,e=>{var n;t.set(e.props.value,null!==(n=a(e))&&void 0!==n?n:e.props.value)}),t}function l(e,t){return o.Children.map(t,t=>{var n;if((null!==(n=a(t))&&void 0!==n?n:t.props.value).toLowerCase().includes(e.toLowerCase()))return t})}let s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.q)(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",n&&"text-red-500",n?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function c(e){return null!=e&&""!==e}},87452:function(e,t,n){"use strict";n.d(t,{Z:function(){return d},r:function(){return u}});var r=n(5853),o=n(21886);n(42698),n(64016);var a=n(8710);n(33232);var i=n(97324),l=n(1153),s=n(2265);let c=(0,l.fn)("Accordion"),u=(0,s.createContext)({isOpen:!1}),d=s.forwardRef((e,t)=>{var n;let{defaultOpen:l=!1,children:d,className:f}=e,p=(0,r._T)(e,["defaultOpen","children","className"]),h=null!==(n=(0,s.useContext)(a.Z))&&void 0!==n?n:(0,i.q)("rounded-tremor-default border");return s.createElement(o.p,Object.assign({as:"div",ref:t,className:(0,i.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",h,f),defaultOpen:l},p),e=>{let{open:t}=e;return s.createElement(u.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(2265),a=n(21886),i=n(97324);let l=(0,n(1153).fn)("AccordionBody"),s=o.forwardRef((e,t)=>{let{children:n,className:s}=e,c=(0,r._T)(e,["children","className"]);return o.createElement(a.p.Panel,Object.assign({ref:t,className:(0,i.q)(l("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",s)},c),n)});s.displayName="AccordionBody"},72208:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(2265),a=n(21886);let i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var l=n(87452),s=n(97324);let c=(0,n(1153).fn)("AccordionHeader"),u=o.forwardRef((e,t)=>{let{children:n,className:u}=e,d=(0,r._T)(e,["children","className"]),{isOpen:f}=(0,o.useContext)(l.r);return o.createElement(a.p.Button,Object.assign({ref:t,className:(0,s.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),o.createElement("div",{className:(0,s.q)(c("children"),"flex flex-1 text-inherit mr-4")},n),o.createElement("div",null,o.createElement(i,{className:(0,s.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",f?"transition-all":"transition-all -rotate-180")})))});u.displayName="AccordionHeader"},67982:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265);let l=(0,a.fn)("Divider"),s=i.forwardRef((e,t)=>{let{className:n,children:a}=e,s=(0,r._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(l("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",n)},s),a?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,o.q)("text-inherit whitespace-nowrap")},a),i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});s.displayName="Divider"},49804:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265),l=n(9496);let s=(0,a.fn)("Col"),c=i.forwardRef((e,t)=>{let{numColSpan:n=1,numColSpanSm:a,numColSpanMd:c,numColSpanLg:u,children:d,className:f}=e,p=(0,r._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),h=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),(()=>{let e=h(n,l.PT),t=h(a,l.SP),r=h(c,l.VS),i=h(u,l._w);return(0,o.q)(e,t,r,i)})(),f)},p),d)});c.displayName="Col"},67101:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(5853),o=n(97324),a=n(1153),i=n(2265),l=n(9496);let s=(0,a.fn)("Grid"),c=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",u=i.forwardRef((e,t)=>{let{numItems:n=1,numItemsSm:a,numItemsMd:u,numItemsLg:d,children:f,className:p}=e,h=(0,r._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),m=c(n,l._m),g=c(a,l.LH),v=c(u,l.l5),y=c(d,l.N4),b=(0,o.q)(m,g,v,y);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),"grid",b,p)},h),f)});u.displayName="Grid"},9496:function(e,t,n){"use strict";n.d(t,{LH:function(){return o},N4:function(){return i},PT:function(){return l},SP:function(){return s},VS:function(){return c},_m:function(){return r},_w:function(){return u},l5:function(){return a}});let r={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},o={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},a={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},i={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},l={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},s={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},c={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},u={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},94789:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(2265),a=n(26898),i=n(97324),l=n(1153);let s=(0,l.fn)("Callout"),c=o.forwardRef((e,t)=>{let{title:n,icon:c,color:u,className:d,children:f}=e,p=(0,r._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",u?(0,i.q)((0,l.bM)(u,a.K.background).bgColor,(0,l.bM)(u,a.K.darkBorder).borderColor,(0,l.bM)(u,a.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,i.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),d)},p),o.createElement("div",{className:(0,i.q)(s("header"),"flex items-start")},c?o.createElement(c,{className:(0,i.q)(s("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,i.q)(s("title"),"font-semibold")},n)),o.createElement("p",{className:(0,i.q)(s("body"),"overflow-y-auto",f?"mt-2":"")},f))});c.displayName="Callout"},35829:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(26898),a=n(97324),i=n(1153),l=n(2265);let s=l.forwardRef((e,t)=>{let{color:n,children:s,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)("font-semibold text-tremor-metric",n?(0,i.bM)(n,o.K.darkText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",c)},u),s)});s.displayName="Metric"},97765:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(5853),o=n(26898),a=n(97324),i=n(1153),l=n(2265);let s=l.forwardRef((e,t)=>{let{color:n,children:s,className:c}=e,u=(0,r._T)(e,["color","children","className"]);return l.createElement("p",Object.assign({ref:t,className:(0,a.q)(n?(0,i.bM)(n,o.K.lightText).textColor:"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",c)},u),s)});s.displayName="Subtitle"},96889:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(5853),o=n(2265),a=n(26898),i=n(97324),l=n(1153);let s=(0,l.fn)("BarList"),c=o.forwardRef((e,t)=>{var n;let c;let{data:u=[],color:d,valueFormatter:f=l.Cj,showAnimation:p=!1,className:h}=e,m=(0,r._T)(e,["data","color","valueFormatter","showAnimation","className"]),g=(n=u.map(e=>e.value),c=-1/0,n.forEach(e=>{c=Math.max(c,e)}),n.map(e=>0===e?0:Math.max(e/c*100,1)));return o.createElement("div",Object.assign({ref:t,className:(0,i.q)(s("root"),"flex justify-between space-x-6",h)},m),o.createElement("div",{className:(0,i.q)(s("bars"),"relative w-full")},u.map((e,t)=>{var n,r,c;let f=e.icon;return o.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:(0,i.q)(s("bar"),"flex items-center rounded-tremor-small bg-opacity-30","h-9",e.color||d?(0,l.bM)(null!==(r=e.color)&&void 0!==r?r:d,a.K.background).bgColor:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle dark:bg-opacity-30",t===u.length-1?"mb-0":"mb-2"),style:{width:"".concat(g[t],"%"),transition:p?"all 1s":""}},o.createElement("div",{className:(0,i.q)("absolute max-w-full flex left-2")},f?o.createElement(f,{className:(0,i.q)(s("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?o.createElement("a",{href:e.href,target:null!==(c=e.target)&&void 0!==c?c:"_blank",rel:"noreferrer",className:(0,i.q)(s("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name):o.createElement("p",{className:(0,i.q)(s("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name)))})),o.createElement("div",{className:"text-right min-w-min"},u.map((e,t)=>{var n;return o.createElement("div",{key:null!==(n=e.key)&&void 0!==n?n:e.name,className:(0,i.q)(s("labelWrapper"),"flex justify-end items-center","h-9",t===u.length-1?"mb-0":"mb-2")},o.createElement("p",{className:(0,i.q)(s("labelText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},f(e.value)))})))});c.displayName="BarList"},42698:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2265),o=n(7084);n(97324);let a=(0,r.createContext)(o.fr.Blue)},64016:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)(0)},8710:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)(void 0)},33232:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(2265).createContext)({selectedValue:void 0,handleValueChange:void 0})},44140:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);let o=(e,t)=>{let n=void 0!==t,[o,a]=(0,r.useState)(e);return[n?t:o,e=>{n||a(e)}]}},61778:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}});var r=n(2265),o=n(8900),a=n(39725),i=n(49638),l=n(54537),s=n(55726),c=n(36760),u=n.n(c),d=n(47970),f=n(18242),p=n(19722),h=n(71744),m=n(352),g=n(12918),v=n(80669);let y=(e,t,n,r,o)=>({background:e,border:"".concat((0,m.bf)(r.lineWidth)," ").concat(r.lineType," ").concat(t),["".concat(o,"-icon")]:{color:n}}),b=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:o,fontSize:a,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:u,colorText:d,colorTextHeading:f,withDescriptionPadding:p,defaultPadding:h}=e;return{[t]:Object.assign(Object.assign({},(0,g.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:s,["&".concat(t,"-rtl")]:{direction:"rtl"},["".concat(t,"-content")]:{flex:1,minWidth:0},["".concat(t,"-icon")]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-message":{color:f},["&".concat(t,"-motion-leave")]:{overflow:"hidden",opacity:1,transition:"max-height ".concat(n," ").concat(c,", opacity ").concat(n," ").concat(c,",\n padding-top ").concat(n," ").concat(c,", padding-bottom ").concat(n," ").concat(c,",\n margin-bottom ").concat(n," ").concat(c)},["&".concat(t,"-motion-leave-active")]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),["".concat(t,"-with-description")]:{alignItems:"flex-start",padding:p,["".concat(t,"-icon")]:{marginInlineEnd:o,fontSize:u,lineHeight:0},["".concat(t,"-message")]:{display:"block",marginBottom:r,color:f,fontSize:i},["".concat(t,"-description")]:{display:"block",color:d}},["".concat(t,"-banner")]:{marginBottom:0,border:"0 !important",borderRadius:0}}},x=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:o,colorWarning:a,colorWarningBorder:i,colorWarningBg:l,colorError:s,colorErrorBorder:c,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":y(o,r,n,e,t),"&-info":y(p,f,d,e,t),"&-warning":y(l,i,a,e,t),"&-error":Object.assign(Object.assign({},y(u,c,s,e,t)),{["".concat(t,"-description > pre")]:{margin:0,padding:0}})}}},w=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:o,fontSizeIcon:a,colorIcon:i,colorIconHover:l}=e;return{[t]:{"&-action":{marginInlineStart:o},["".concat(t,"-close-icon")]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,m.bf)(a),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",["".concat(n,"-close")]:{color:i,transition:"color ".concat(r),"&:hover":{color:l}}},"&-close-text":{color:i,transition:"color ".concat(r),"&:hover":{color:l}}}}};var k=(0,v.I$)("Alert",e=>[b(e),x(e),w(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:"".concat(e.paddingContentVerticalSM,"px ").concat(12,"px"),withDescriptionPadding:"".concat(e.paddingMD,"px ").concat(e.paddingContentHorizontalLG,"px")})),S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let E={success:o.Z,info:s.Z,error:a.Z,warning:l.Z},O=e=>{let{icon:t,prefixCls:n,type:o}=e,a=E[o]||null;return t?(0,p.wm)(t,r.createElement("span",{className:"".concat(n,"-icon")},t),()=>({className:u()("".concat(n,"-icon"),{[t.props.className]:t.props.className})})):r.createElement(a,{className:"".concat(n,"-icon")})},C=e=>{let{isClosable:t,prefixCls:n,closeIcon:o,handleClose:a}=e,l=!0===o||void 0===o?r.createElement(i.Z,null):o;return t?r.createElement("button",{type:"button",onClick:a,className:"".concat(n,"-close-icon"),tabIndex:0},l):null};var j=e=>{let{description:t,prefixCls:n,message:o,banner:a,className:i,rootClassName:l,style:s,onMouseEnter:c,onMouseLeave:p,onClick:m,afterClose:g,showIcon:v,closable:y,closeText:b,closeIcon:x,action:w}=e,E=S(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action"]),[j,_]=r.useState(!1),P=r.useRef(null),{getPrefixCls:N,direction:T,alert:A}=r.useContext(h.E_),M=N("alert",n),[I,R,D]=k(M),L=t=>{var n;_(!0),null===(n=e.onClose)||void 0===n||n.call(e,t)},Z=r.useMemo(()=>void 0!==e.type?e.type:a?"warning":"info",[e.type,a]),z=r.useMemo(()=>!!b||("boolean"==typeof y?y:!1!==x&&null!=x),[b,x,y]),B=!!a&&void 0===v||v,F=u()(M,"".concat(M,"-").concat(Z),{["".concat(M,"-with-description")]:!!t,["".concat(M,"-no-icon")]:!B,["".concat(M,"-banner")]:!!a,["".concat(M,"-rtl")]:"rtl"===T},null==A?void 0:A.className,i,l,D,R),H=(0,f.Z)(E,{aria:!0,data:!0});return I(r.createElement(d.ZP,{visible:!j,motionName:"".concat(M,"-motion"),motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:g},n=>{let{className:a,style:i}=n;return r.createElement("div",Object.assign({ref:P,"data-show":!j,className:u()(F,a),style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.style),s),i),onMouseEnter:c,onMouseLeave:p,onClick:m,role:"alert"},H),B?r.createElement(O,{description:t,icon:e.icon,prefixCls:M,type:Z}):null,r.createElement("div",{className:"".concat(M,"-content")},o?r.createElement("div",{className:"".concat(M,"-message")},o):null,t?r.createElement("div",{className:"".concat(M,"-description")},t):null),w?r.createElement("div",{className:"".concat(M,"-action")},w):null,r.createElement(C,{isClosable:z,prefixCls:M,closeIcon:b||x,handleClose:L}))}))},_=n(76405),P=n(25049),N=n(37977),T=n(63929),A=n(24995),M=n(15354);let I=function(e){function t(){var e,n,r;return(0,_.Z)(this,t),n=t,r=arguments,n=(0,A.Z)(n),(e=(0,N.Z)(this,(0,T.Z)()?Reflect.construct(n,r||[],(0,A.Z)(this).constructor):n.apply(this,r))).state={error:void 0,info:{componentStack:""}},e}return(0,M.Z)(t,e),(0,P.Z)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,description:t,children:n}=this.props,{error:o,info:a}=this.state,i=a&&a.componentStack?a.componentStack:null,l=void 0===e?(o||"").toString():e;return o?r.createElement(j,{type:"error",message:l,description:r.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},void 0===t?i:t)}):n}}]),t}(r.Component);j.ErrorBoundary=I;var R=j},33866:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var r=n(2265),o=n(36760),a=n.n(o),i=n(47970),l=n(93350),s=n(19722),c=n(71744),u=n(352),d=n(12918),f=n(18536),p=n(3104),h=n(80669);let m=new u.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=new u.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),v=new u.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),y=new u.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),b=new u.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),x=new u.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),w=e=>{let{componentCls:t,iconCls:n,antCls:r,badgeShadowSize:o,motionDurationSlow:a,textFontSize:i,textFontSizeSM:l,statusSize:s,dotSize:c,textFontWeight:p,indicatorHeight:h,indicatorHeightSM:w,marginXS:k,calc:S}=e,E="".concat(r,"-scroll-number"),O=(0,f.Z)(e,(e,n)=>{let{darkColor:r}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:r,["&:not(".concat(t,"-count)")]:{color:r}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{zIndex:e.indicatorZIndex,minWidth:h,height:h,color:e.badgeTextColor,fontWeight:p,fontSize:i,lineHeight:(0,u.bf)(h),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:S(h).div(2).equal(),boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor),transition:"background ".concat(e.motionDurationMid),a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},["".concat(t,"-count-sm")]:{minWidth:w,height:w,fontSize:l,lineHeight:(0,u.bf)(w),borderRadius:S(w).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,u.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:c,minWidth:c,height:c,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor)},["".concat(t,"-dot").concat(E)]:{transition:"background ".concat(a)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(E,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(t,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(t,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:s,height:s,verticalAlign:"middle",borderRadius:"50%"},["".concat(t,"-status-success")]:{backgroundColor:e.colorSuccess},["".concat(t,"-status-processing")]:{overflow:"visible",color:e.colorPrimary,backgroundColor:e.colorPrimary,"&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:m,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(t,"-status-default")]:{backgroundColor:e.colorTextPlaceholder},["".concat(t,"-status-error")]:{backgroundColor:e.colorError},["".concat(t,"-status-warning")]:{backgroundColor:e.colorWarning},["".concat(t,"-status-text")]:{marginInlineStart:k,color:e.colorText,fontSize:e.fontSize}}}),O),{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:g,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["".concat(t,"-zoom-leave")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:b,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(E,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(E,"-custom-component, ").concat(E)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},["".concat(E)]:{overflow:"hidden",["".concat(E,"-only")]:{position:"relative",display:"inline-block",height:h,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(E,"-only-unit")]:{height:h,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(E,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(E,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},k=e=>{let{fontHeight:t,lineWidth:n,marginXS:r,colorBorderBg:o}=e,a=e.colorBgContainer,i=e.colorError,l=e.colorErrorHover;return(0,p.TS)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:a,badgeColor:i,badgeColorHover:l,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:r,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},S=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:r,lineWidth:o}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*o,indicatorHeightSM:t,dotSize:r/2,textFontSize:r,textFontSizeSM:r,textFontWeight:"normal",statusSize:r/2}};var E=(0,h.I$)("Badge",e=>w(k(e)),S);let O=e=>{let{antCls:t,badgeFontHeight:n,marginXS:r,badgeRibbonOffset:o,calc:a}=e,i="".concat(t,"-ribbon"),l=(0,f.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(i,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat("".concat(t,"-ribbon-wrapper"))]:{position:"relative"},["".concat(i)]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:r,padding:"0 ".concat((0,u.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,u.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(i,"-text")]:{color:e.colorTextLightSolid},["".concat(i,"-corner")]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:"".concat((0,u.bf)(a(o).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),l),{["&".concat(i,"-placement-end")]:{insetInlineEnd:a(o).mul(-1).equal(),borderEndEndRadius:0,["".concat(i,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(i,"-placement-start")]:{insetInlineStart:a(o).mul(-1).equal(),borderEndStartRadius:0,["".concat(i,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var C=(0,h.I$)(["Badge","Ribbon"],e=>O(k(e)),S);function j(e){let t,{prefixCls:n,value:o,current:i,offset:l=0}=e;return l&&(t={position:"absolute",top:"".concat(l,"00%"),left:0}),r.createElement("span",{style:t,className:a()("".concat(n,"-only-unit"),{current:i})},o)}function _(e){let t,n;let{prefixCls:o,count:a,value:i}=e,l=Number(i),s=Math.abs(a),[c,u]=r.useState(l),[d,f]=r.useState(s),p=()=>{u(l),f(s)};if(r.useEffect(()=>{let e=setTimeout(()=>{p()},1e3);return()=>{clearTimeout(e)}},[l]),c===l||Number.isNaN(l)||Number.isNaN(c))t=[r.createElement(j,Object.assign({},e,{key:l,current:!0}))],n={transition:"none"};else{t=[];let o=l+10,a=[];for(let e=l;e<=o;e+=1)a.push(e);let i=a.findIndex(e=>e%10===c);t=a.map((t,n)=>r.createElement(j,Object.assign({},e,{key:t,value:t%10,offset:n-i,current:n===i}))),n={transform:"translateY(".concat(-function(e,t,n){let r=e,o=0;for(;(r+10)%10!==t;)r+=n,o+=n;return o}(c,l,d<s?1:-1),"00%)")}}return r.createElement("span",{className:"".concat(o,"-only"),style:n,onTransitionEnd:p},t)}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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=r.forwardRef((e,t)=>{let{prefixCls:n,count:o,className:i,motionClassName:l,style:u,title:d,show:f,component:p="sup",children:h}=e,m=P(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:g}=r.useContext(c.E_),v=g("scroll-number",n),y=Object.assign(Object.assign({},m),{"data-show":f,style:u,className:a()(v,i,l),title:d}),b=o;if(o&&Number(o)%1==0){let e=String(o).split("");b=r.createElement("bdi",null,e.map((t,n)=>r.createElement(_,{prefixCls:v,count:Number(o),value:t,key:e.length-n})))}return(u&&u.borderColor&&(y.style=Object.assign(Object.assign({},u),{boxShadow:"0 0 0 1px ".concat(u.borderColor," inset")})),h)?(0,s.Tm)(h,e=>({className:a()("".concat(v,"-custom-component"),null==e?void 0:e.className,l)})):r.createElement(p,Object.assign({},y,{ref:t}),b)});var T=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let A=r.forwardRef((e,t)=>{var n,o,u,d,f;let{prefixCls:p,scrollNumberPrefixCls:h,children:m,status:g,text:v,color:y,count:b=null,overflowCount:x=99,dot:w=!1,size:k="default",title:S,offset:O,style:C,className:j,rootClassName:_,classNames:P,styles:A,showZero:M=!1}=e,I=T(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:R,direction:D,badge:L}=r.useContext(c.E_),Z=R("badge",p),[z,B,F]=E(Z),H=b>x?"".concat(x,"+"):b,q="0"===H||0===H,W=(null!=g||null!=y)&&(null===b||q&&!M),U=w&&!q,K=U?"":H,$=(0,r.useMemo)(()=>(null==K||""===K||q&&!M)&&!U,[K,q,M,U]),V=(0,r.useRef)(b);$||(V.current=b);let X=V.current,G=(0,r.useRef)(K);$||(G.current=K);let Y=G.current,Q=(0,r.useRef)(U);$||(Q.current=U);let J=(0,r.useMemo)(()=>{if(!O)return Object.assign(Object.assign({},null==L?void 0:L.style),C);let e={marginTop:O[1]};return"rtl"===D?e.left=parseInt(O[0],10):e.right=-parseInt(O[0],10),Object.assign(Object.assign(Object.assign({},e),null==L?void 0:L.style),C)},[D,O,C,null==L?void 0:L.style]),ee=null!=S?S:"string"==typeof X||"number"==typeof X?X:void 0,et=$||!v?null:r.createElement("span",{className:"".concat(Z,"-status-text")},v),en=X&&"object"==typeof X?(0,s.Tm)(X,e=>({style:Object.assign(Object.assign({},J),e.style)})):void 0,er=(0,l.o2)(y,!1),eo=a()(null==P?void 0:P.indicator,null===(n=null==L?void 0:L.classNames)||void 0===n?void 0:n.indicator,{["".concat(Z,"-status-dot")]:W,["".concat(Z,"-status-").concat(g)]:!!g,["".concat(Z,"-color-").concat(y)]:er}),ea={};y&&!er&&(ea.color=y,ea.background=y);let ei=a()(Z,{["".concat(Z,"-status")]:W,["".concat(Z,"-not-a-wrapper")]:!m,["".concat(Z,"-rtl")]:"rtl"===D},j,_,null==L?void 0:L.className,null===(o=null==L?void 0:L.classNames)||void 0===o?void 0:o.root,null==P?void 0:P.root,B,F);if(!m&&W){let e=J.color;return z(r.createElement("span",Object.assign({},I,{className:ei,style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.root),null===(u=null==L?void 0:L.styles)||void 0===u?void 0:u.root),J)}),r.createElement("span",{className:eo,style:Object.assign(Object.assign(Object.assign({},null==A?void 0:A.indicator),null===(d=null==L?void 0:L.styles)||void 0===d?void 0:d.indicator),ea)}),v&&r.createElement("span",{style:{color:e},className:"".concat(Z,"-status-text")},v)))}return z(r.createElement("span",Object.assign({ref:t},I,{className:ei,style:Object.assign(Object.assign({},null===(f=null==L?void 0:L.styles)||void 0===f?void 0:f.root),null==A?void 0:A.root)}),m,r.createElement(i.ZP,{visible:!$,motionName:"".concat(Z,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:o,ref:i}=e,l=R("scroll-number",h),s=Q.current,c=a()(null==P?void 0:P.indicator,null===(t=null==L?void 0:L.classNames)||void 0===t?void 0:t.indicator,{["".concat(Z,"-dot")]:s,["".concat(Z,"-count")]:!s,["".concat(Z,"-count-sm")]:"small"===k,["".concat(Z,"-multiple-words")]:!s&&Y&&Y.toString().length>1,["".concat(Z,"-status-").concat(g)]:!!g,["".concat(Z,"-color-").concat(y)]:er}),u=Object.assign(Object.assign(Object.assign({},null==A?void 0:A.indicator),null===(n=null==L?void 0:L.styles)||void 0===n?void 0:n.indicator),J);return y&&!er&&((u=u||{}).background=y),r.createElement(N,{prefixCls:l,show:!$,motionClassName:o,className:c,count:Y,title:ee,style:u,key:"scrollNumber",ref:i},en)}),et))});A.Ribbon=e=>{let{className:t,prefixCls:n,style:o,color:i,children:s,text:u,placement:d="end",rootClassName:f}=e,{getPrefixCls:p,direction:h}=r.useContext(c.E_),m=p("ribbon",n),g="".concat(m,"-wrapper"),[v,y,b]=C(m,g),x=(0,l.o2)(i,!1),w=a()(m,"".concat(m,"-placement-").concat(d),{["".concat(m,"-rtl")]:"rtl"===h,["".concat(m,"-color-").concat(i)]:x},t),k={},S={};return i&&!x&&(k.background=i,S.color=i),v(r.createElement("div",{className:a()(g,f,y,b)},s,r.createElement("div",{className:a()(w,y),style:Object.assign(Object.assign({},k),o)},r.createElement("span",{className:"".concat(m,"-text")},u),r.createElement("div",{className:"".concat(m,"-corner"),style:S}))))};var M=A},67960:function(e,t,n){"use strict";n.d(t,{Z:function(){return e8}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),l=n(71744),s=n(33759),c=e=>{let{prefixCls:t,className:n,style:o,size:i,shape:l}=e,s=a()({["".concat(t,"-lg")]:"large"===i,["".concat(t,"-sm")]:"small"===i}),c=a()({["".concat(t,"-circle")]:"circle"===l,["".concat(t,"-square")]:"square"===l,["".concat(t,"-round")]:"round"===l}),u=r.useMemo(()=>"number"==typeof i?{width:i,height:i,lineHeight:"".concat(i,"px")}:{},[i]);return r.createElement("span",{className:a()(t,s,c,n),style:Object.assign(Object.assign({},u),o)})},u=n(352),d=n(80669),f=n(3104);let p=new u.E4("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),h=e=>({height:e,lineHeight:(0,u.bf)(e)}),m=e=>Object.assign({width:e},h(e)),g=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:p,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),v=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},h(e)),y=e=>{let{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:o,controlHeightSM:a}=e;return{["".concat(t)]:Object.assign({display:"inline-block",verticalAlign:"top",background:n},m(r)),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"},["".concat(t).concat(t,"-lg")]:Object.assign({},m(o)),["".concat(t).concat(t,"-sm")]:Object.assign({},m(a))}},b=e=>{let{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:o,controlHeightSM:a,gradientFromColor:i,calc:l}=e;return{["".concat(r)]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:n},v(t,l)),["".concat(r,"-lg")]:Object.assign({},v(o,l)),["".concat(r,"-sm")]:Object.assign({},v(a,l))}},x=e=>Object.assign({width:e},h(e)),w=e=>{let{skeletonImageCls:t,imageSizeBase:n,gradientFromColor:r,borderRadiusSM:o,calc:a}=e;return{["".concat(t)]:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",background:r,borderRadius:o},x(a(n).mul(2).equal())),{["".concat(t,"-path")]:{fill:"#bfbfbf"},["".concat(t,"-svg")]:Object.assign(Object.assign({},x(n)),{maxWidth:a(n).mul(4).equal(),maxHeight:a(n).mul(4).equal()}),["".concat(t,"-svg").concat(t,"-svg-circle")]:{borderRadius:"50%"}}),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"}}},k=(e,t,n)=>{let{skeletonButtonCls:r}=e;return{["".concat(n).concat(r,"-circle")]:{width:t,minWidth:t,borderRadius:"50%"},["".concat(n).concat(r,"-round")]:{borderRadius:t}}},S=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},h(e)),E=e=>{let{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:o,controlHeightSM:a,gradientFromColor:i,calc:l}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:i,borderRadius:t,width:l(r).mul(2).equal(),minWidth:l(r).mul(2).equal()},S(r,l))},k(e,r,n)),{["".concat(n,"-lg")]:Object.assign({},S(o,l))}),k(e,o,"".concat(n,"-lg"))),{["".concat(n,"-sm")]:Object.assign({},S(a,l))}),k(e,a,"".concat(n,"-sm")))},O=e=>{let{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:o,skeletonButtonCls:a,skeletonInputCls:i,skeletonImageCls:l,controlHeight:s,controlHeightLG:c,controlHeightSM:u,gradientFromColor:d,padding:f,marginSM:p,borderRadius:h,titleHeight:v,blockRadius:x,paragraphLiHeight:k,controlHeightXS:S,paragraphMarginTop:O}=e;return{["".concat(t)]:{display:"table",width:"100%",["".concat(t,"-header")]:{display:"table-cell",paddingInlineEnd:f,verticalAlign:"top",["".concat(n)]:Object.assign({display:"inline-block",verticalAlign:"top",background:d},m(s)),["".concat(n,"-circle")]:{borderRadius:"50%"},["".concat(n,"-lg")]:Object.assign({},m(c)),["".concat(n,"-sm")]:Object.assign({},m(u))},["".concat(t,"-content")]:{display:"table-cell",width:"100%",verticalAlign:"top",["".concat(r)]:{width:"100%",height:v,background:d,borderRadius:x,["+ ".concat(o)]:{marginBlockStart:u}},["".concat(o)]:{padding:0,"> li":{width:"100%",height:k,listStyle:"none",background:d,borderRadius:x,"+ li":{marginBlockStart:S}}},["".concat(o,"> li:last-child:not(:first-child):not(:nth-child(2))")]:{width:"61%"}},["&-round ".concat(t,"-content")]:{["".concat(r,", ").concat(o," > li")]:{borderRadius:h}}},["".concat(t,"-with-avatar ").concat(t,"-content")]:{["".concat(r)]:{marginBlockStart:p,["+ ".concat(o)]:{marginBlockStart:O}}},["".concat(t).concat(t,"-element")]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},E(e)),y(e)),b(e)),w(e)),["".concat(t).concat(t,"-block")]:{width:"100%",["".concat(a)]:{width:"100%"},["".concat(i)]:{width:"100%"}},["".concat(t).concat(t,"-active")]:{["\n ".concat(r,",\n ").concat(o," > li,\n ").concat(n,",\n ").concat(a,",\n ").concat(i,",\n ").concat(l,"\n ")]:Object.assign({},g(e))}}};var C=(0,d.I$)("Skeleton",e=>{let{componentCls:t,calc:n}=e;return[O((0,f.TS)(e,{skeletonAvatarCls:"".concat(t,"-avatar"),skeletonTitleCls:"".concat(t,"-title"),skeletonParagraphCls:"".concat(t,"-paragraph"),skeletonButtonCls:"".concat(t,"-button"),skeletonInputCls:"".concat(t,"-input"),skeletonImageCls:"".concat(t,"-image"),imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:"linear-gradient(90deg, ".concat(e.gradientFromColor," 25%, ").concat(e.gradientToColor," 37%, ").concat(e.gradientFromColor," 63%)"),skeletonLoadingMotionDuration:"1.4s"}))]},e=>{let{colorFillContent:t,colorFill:n}=e;return{color:t,colorGradientEnd:n,gradientFromColor:t,gradientToColor:n,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),j=n(1119),_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM288 604a64 64 0 10128 0 64 64 0 10-128 0zm118-224a48 48 0 1096 0 48 48 0 10-96 0zm158 228a96 96 0 10192 0 96 96 0 10-192 0zm148-314a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"dot-chart",theme:"outlined"},P=n(55015),N=r.forwardRef(function(e,t){return r.createElement(P.Z,(0,j.Z)({},e,{ref:t,icon:_}))}),T=n(83145),A=e=>{let t=t=>{let{width:n,rows:r=2}=e;return Array.isArray(n)?n[t]:r-1===t?n:void 0},{prefixCls:n,className:o,style:i,rows:l}=e,s=(0,T.Z)(Array(l)).map((e,n)=>r.createElement("li",{key:n,style:{width:t(n)}}));return r.createElement("ul",{className:a()(n,o),style:i},s)},M=e=>{let{prefixCls:t,className:n,width:o,style:i}=e;return r.createElement("h3",{className:a()(t,n),style:Object.assign({width:o},i)})};function I(e){return e&&"object"==typeof e?e:{}}let R=e=>{let{prefixCls:t,loading:n,className:o,rootClassName:i,style:s,children:u,avatar:d=!1,title:f=!0,paragraph:p=!0,active:h,round:m}=e,{getPrefixCls:g,direction:v,skeleton:y}=r.useContext(l.E_),b=g("skeleton",t),[x,w,k]=C(b);if(n||!("loading"in e)){let e,t;let n=!!d,l=!!f,u=!!p;if(n){let t=Object.assign(Object.assign({prefixCls:"".concat(b,"-avatar")},l&&!u?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),I(d));e=r.createElement("div",{className:"".concat(b,"-header")},r.createElement(c,Object.assign({},t)))}if(l||u){let e,o;if(l){let t=Object.assign(Object.assign({prefixCls:"".concat(b,"-title")},!n&&u?{width:"38%"}:n&&u?{width:"50%"}:{}),I(f));e=r.createElement(M,Object.assign({},t))}if(u){let e=Object.assign(Object.assign({prefixCls:"".concat(b,"-paragraph")},function(e,t){let n={};return e&&t||(n.width="61%"),!e&&t?n.rows=3:n.rows=2,n}(n,l)),I(p));o=r.createElement(A,Object.assign({},e))}t=r.createElement("div",{className:"".concat(b,"-content")},e,o)}let g=a()(b,{["".concat(b,"-with-avatar")]:n,["".concat(b,"-active")]:h,["".concat(b,"-rtl")]:"rtl"===v,["".concat(b,"-round")]:m},null==y?void 0:y.className,o,i,w,k);return x(r.createElement("div",{className:g,style:Object.assign(Object.assign({},null==y?void 0:y.style),s)},e,t))}return void 0!==u?u:null};R.Button=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,block:u=!1,size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s,["".concat(p,"-block")]:u},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-button"),size:d},v))))},R.Avatar=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,shape:u="circle",size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls","className"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-avatar"),shape:u,size:d},v))))},R.Input=e=>{let{prefixCls:t,className:n,rootClassName:o,active:s,block:u,size:d="default"}=e,{getPrefixCls:f}=r.useContext(l.E_),p=f("skeleton",t),[h,m,g]=C(p),v=(0,i.Z)(e,["prefixCls"]),y=a()(p,"".concat(p,"-element"),{["".concat(p,"-active")]:s,["".concat(p,"-block")]:u},n,o,m,g);return h(r.createElement("div",{className:y},r.createElement(c,Object.assign({prefixCls:"".concat(p,"-input"),size:d},v))))},R.Image=e=>{let{prefixCls:t,className:n,rootClassName:o,style:i,active:s}=e,{getPrefixCls:c}=r.useContext(l.E_),u=c("skeleton",t),[d,f,p]=C(u),h=a()(u,"".concat(u,"-element"),{["".concat(u,"-active")]:s},n,o,f,p);return d(r.createElement("div",{className:h},r.createElement("div",{className:a()("".concat(u,"-image"),n),style:i},r.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(u,"-image-svg")},r.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(u,"-image-path")})))))},R.Node=e=>{let{prefixCls:t,className:n,rootClassName:o,style:i,active:s,children:c}=e,{getPrefixCls:u}=r.useContext(l.E_),d=u("skeleton",t),[f,p,h]=C(d),m=a()(d,"".concat(d,"-element"),{["".concat(d,"-active")]:s},p,n,o,h),g=null!=c?c:r.createElement(N,null);return f(r.createElement("div",{className:m},r.createElement("div",{className:a()("".concat(d,"-image"),n),style:i},g)))};var D=n(49638),L=n(39760),Z=n(96473),z=n(11993),B=n(31686),F=n(26365),H=n(41154),q=n(6989),W=n(50506),U=n(79267),K=(0,r.createContext)(null),$=n(31474),V=n(58525),X=n(28791),G=n(53346),Y=function(e){var t=e.activeTabOffset,n=e.horizontal,o=e.rtl,a=e.indicator,i=void 0===a?{}:a,l=i.size,s=i.align,c=void 0===s?"center":s,u=(0,r.useState)(),d=(0,F.Z)(u,2),f=d[0],p=d[1],h=(0,r.useRef)(),m=r.useCallback(function(e){return"function"==typeof l?l(e):"number"==typeof l?l:e},[l]);function g(){G.Z.cancel(h.current)}return(0,r.useEffect)(function(){var e={};if(t){if(n){e.width=m(t.width);var r=o?"right":"left";"start"===c&&(e[r]=t[r]),"center"===c&&(e[r]=t[r]+t.width/2,e.transform=o?"translateX(50%)":"translateX(-50%)"),"end"===c&&(e[r]=t[r]+t.width,e.transform="translateX(-100%)")}else e.height=m(t.height),"start"===c&&(e.top=t.top),"center"===c&&(e.top=t.top+t.height/2,e.transform="translateY(-50%)"),"end"===c&&(e.top=t.top+t.height,e.transform="translateY(-100%)")}return g(),h.current=(0,G.Z)(function(){p(e)}),g},[t,n,o,c,m]),{style:f}},Q={width:0,height:0,left:0,top:0};function J(e,t){var n=r.useRef(e),o=r.useState({}),a=(0,F.Z)(o,2)[1];return[n.current,function(e){var r="function"==typeof e?e(n.current):e;r!==n.current&&t(r,n.current),n.current=r,a({})}]}var ee=n(27380);function et(e){var t=(0,r.useState)(0),n=(0,F.Z)(t,2),o=n[0],a=n[1],i=(0,r.useRef)(0),l=(0,r.useRef)();return l.current=e,(0,ee.o)(function(){var e;null===(e=l.current)||void 0===e||e.call(l)},[o]),function(){i.current===o&&(i.current+=1,a(i.current))}}var en={width:0,height:0,left:0,top:0,right:0};function er(e){var t;return e instanceof Map?(t={},e.forEach(function(e,n){t[n]=e})):t=e,JSON.stringify(t)}function eo(e){return String(e).replace(/"/g,"TABS_DQ")}function ea(e,t,n,r){return!!n&&!r&&!1!==e&&(void 0!==e||!1!==t&&null!==t)}var ei=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.editable,a=e.locale,i=e.style;return o&&!1!==o.showAdd?r.createElement("button",{ref:t,type:"button",className:"".concat(n,"-nav-add"),style:i,"aria-label":(null==a?void 0:a.addAriaLabel)||"Add tab",onClick:function(e){o.onEdit("add",{event:e})}},o.addIcon||"+"):null}),el=r.forwardRef(function(e,t){var n,o=e.position,a=e.prefixCls,i=e.extra;if(!i)return null;var l={};return"object"!==(0,H.Z)(i)||r.isValidElement(i)?l.right=i:l=i,"right"===o&&(n=l.right),"left"===o&&(n=l.left),n?r.createElement("div",{className:"".concat(a,"-extra-content"),ref:t},n):null}),es=n(71030),ec=n(33082),eu=n(95814),ed=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.id,i=e.tabs,l=e.locale,s=e.mobile,c=e.moreIcon,u=e.moreTransitionName,d=e.style,f=e.className,p=e.editable,h=e.tabBarGutter,m=e.rtl,g=e.removeAriaLabel,v=e.onTabClick,y=e.getPopupContainer,b=e.popupClassName,x=(0,r.useState)(!1),w=(0,F.Z)(x,2),k=w[0],S=w[1],E=(0,r.useState)(null),O=(0,F.Z)(E,2),C=O[0],j=O[1],_="".concat(o,"-more-popup"),P="".concat(n,"-dropdown"),N=null!==C?"".concat(_,"-").concat(C):null,T=null==l?void 0:l.dropdownAriaLabel,A=r.createElement(ec.ZP,{onClick:function(e){v(e.key,e.domEvent),S(!1)},prefixCls:"".concat(P,"-menu"),id:_,tabIndex:-1,role:"listbox","aria-activedescendant":N,selectedKeys:[C],"aria-label":void 0!==T?T:"expanded dropdown"},i.map(function(e){var t=e.closable,n=e.disabled,a=e.closeIcon,i=e.key,l=e.label,s=ea(t,a,p,n);return r.createElement(ec.sN,{key:i,id:"".concat(_,"-").concat(i),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(i),disabled:n},r.createElement("span",null,l),s&&r.createElement("button",{type:"button","aria-label":g||"remove",tabIndex:0,className:"".concat(P,"-menu-item-remove"),onClick:function(e){e.stopPropagation(),e.preventDefault(),e.stopPropagation(),p.onEdit("remove",{key:i,event:e})}},a||p.removeIcon||"\xd7"))}));function M(e){for(var t=i.filter(function(e){return!e.disabled}),n=t.findIndex(function(e){return e.key===C})||0,r=t.length,o=0;o<r;o+=1){var a=t[n=(n+e+r)%r];if(!a.disabled){j(a.key);return}}}(0,r.useEffect)(function(){var e=document.getElementById(N);e&&e.scrollIntoView&&e.scrollIntoView(!1)},[C]),(0,r.useEffect)(function(){k||j(null)},[k]);var I=(0,z.Z)({},m?"marginRight":"marginLeft",h);i.length||(I.visibility="hidden",I.order=1);var R=a()((0,z.Z)({},"".concat(P,"-rtl"),m)),D=s?null:r.createElement(es.Z,{prefixCls:P,overlay:A,trigger:["hover"],visible:!!i.length&&k,transitionName:u,onVisibleChange:S,overlayClassName:a()(R,b),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:y},r.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:I,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":_,id:"".concat(o,"-more"),"aria-expanded":k,onKeyDown:function(e){var t=e.which;if(!k){[eu.Z.DOWN,eu.Z.SPACE,eu.Z.ENTER].includes(t)&&(S(!0),e.preventDefault());return}switch(t){case eu.Z.UP:M(-1),e.preventDefault();break;case eu.Z.DOWN:M(1),e.preventDefault();break;case eu.Z.ESC:S(!1);break;case eu.Z.SPACE:case eu.Z.ENTER:null!==C&&v(C,e)}}},void 0===c?"More":c));return r.createElement("div",{className:a()("".concat(n,"-nav-operations"),f),style:d,ref:t},D,r.createElement(ei,{prefixCls:n,locale:l,editable:p}))}),ef=r.memo(ed,function(e,t){return t.tabMoving}),ep=function(e){var t=e.prefixCls,n=e.id,o=e.active,i=e.tab,l=i.key,s=i.label,c=i.disabled,u=i.closeIcon,d=i.icon,f=e.closable,p=e.renderWrapper,h=e.removeAriaLabel,m=e.editable,g=e.onClick,v=e.onFocus,y=e.style,b="".concat(t,"-tab"),x=ea(f,u,m,c);function w(e){c||g(e)}var k=r.useMemo(function(){return d&&"string"==typeof s?r.createElement("span",null,s):s},[s,d]),S=r.createElement("div",{key:l,"data-node-key":eo(l),className:a()(b,(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(b,"-with-remove"),x),"".concat(b,"-active"),o),"".concat(b,"-disabled"),c)),style:y,onClick:w},r.createElement("div",{role:"tab","aria-selected":o,id:n&&"".concat(n,"-tab-").concat(l),className:"".concat(b,"-btn"),"aria-controls":n&&"".concat(n,"-panel-").concat(l),"aria-disabled":c,tabIndex:c?null:0,onClick:function(e){e.stopPropagation(),w(e)},onKeyDown:function(e){[eu.Z.SPACE,eu.Z.ENTER].includes(e.which)&&(e.preventDefault(),w(e))},onFocus:v},d&&r.createElement("span",{className:"".concat(b,"-icon")},d),s&&k),x&&r.createElement("button",{type:"button","aria-label":h||"remove",tabIndex:0,className:"".concat(b,"-remove"),onClick:function(e){e.stopPropagation(),e.preventDefault(),e.stopPropagation(),m.onEdit("remove",{key:l,event:e})}},u||m.removeIcon||"\xd7"));return p?p(S):S},eh=function(e,t){var n=e.offsetWidth,r=e.offsetHeight,o=e.offsetTop,a=e.offsetLeft,i=e.getBoundingClientRect(),l=i.width,s=i.height,c=i.x,u=i.y;return 1>Math.abs(l-n)?[l,s,c-t.x,u-t.y]:[n,r,a,o]},em=function(e){var t=e.current||{},n=t.offsetWidth,r=void 0===n?0:n,o=t.offsetHeight;if(e.current){var a=e.current.getBoundingClientRect(),i=a.width,l=a.height;if(1>Math.abs(i-r))return[i,l]}return[r,void 0===o?0:o]},eg=function(e,t){return e[t?0:1]},ev=r.forwardRef(function(e,t){var n,o,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,_,P,N,A,M,I,R,D,L,Z,H,q,W,U,G,ee,ea=e.className,es=e.style,ec=e.id,eu=e.animated,ed=e.activeKey,ev=e.rtl,ey=e.extra,eb=e.editable,ex=e.locale,ew=e.tabPosition,ek=e.tabBarGutter,eS=e.children,eE=e.onTabClick,eO=e.onTabScroll,eC=e.indicator,ej=r.useContext(K),e_=ej.prefixCls,eP=ej.tabs,eN=(0,r.useRef)(null),eT=(0,r.useRef)(null),eA=(0,r.useRef)(null),eM=(0,r.useRef)(null),eI=(0,r.useRef)(null),eR=(0,r.useRef)(null),eD=(0,r.useRef)(null),eL="top"===ew||"bottom"===ew,eZ=J(0,function(e,t){eL&&eO&&eO({direction:e>t?"left":"right"})}),ez=(0,F.Z)(eZ,2),eB=ez[0],eF=ez[1],eH=J(0,function(e,t){!eL&&eO&&eO({direction:e>t?"top":"bottom"})}),eq=(0,F.Z)(eH,2),eW=eq[0],eU=eq[1],eK=(0,r.useState)([0,0]),e$=(0,F.Z)(eK,2),eV=e$[0],eX=e$[1],eG=(0,r.useState)([0,0]),eY=(0,F.Z)(eG,2),eQ=eY[0],eJ=eY[1],e0=(0,r.useState)([0,0]),e1=(0,F.Z)(e0,2),e2=e1[0],e6=e1[1],e4=(0,r.useState)([0,0]),e3=(0,F.Z)(e4,2),e5=e3[0],e8=e3[1],e7=(n=new Map,o=(0,r.useRef)([]),i=(0,r.useState)({}),l=(0,F.Z)(i,2)[1],s=(0,r.useRef)("function"==typeof n?n():n),c=et(function(){var e=s.current;o.current.forEach(function(t){e=t(e)}),o.current=[],s.current=e,l({})}),[s.current,function(e){o.current.push(e),c()}]),e9=(0,F.Z)(e7,2),te=e9[0],tt=e9[1],tn=(u=eQ[0],(0,r.useMemo)(function(){for(var e=new Map,t=te.get(null===(o=eP[0])||void 0===o?void 0:o.key)||Q,n=t.left+t.width,r=0;r<eP.length;r+=1){var o,a,i=eP[r].key,l=te.get(i);l||(l=te.get(null===(a=eP[r-1])||void 0===a?void 0:a.key)||Q);var s=e.get(i)||(0,B.Z)({},l);s.right=n-s.left-s.width,e.set(i,s)}return e},[eP.map(function(e){return e.key}).join("_"),te,u])),tr=eg(eV,eL),to=eg(eQ,eL),ta=eg(e2,eL),ti=eg(e5,eL),tl=tr<to+ta,ts=tl?tr-ti:tr-ta,tc="".concat(e_,"-nav-operations-hidden"),tu=0,td=0;function tf(e){return e<tu?tu:e>td?td:e}eL&&ev?(tu=0,td=Math.max(0,to-ts)):(tu=Math.min(0,ts-to),td=0);var tp=(0,r.useRef)(null),th=(0,r.useState)(),tm=(0,F.Z)(th,2),tg=tm[0],tv=tm[1];function ty(){tv(Date.now())}function tb(){tp.current&&clearTimeout(tp.current)}d=function(e,t){function n(e,t){e(function(e){return tf(e+t)})}return!!tl&&(eL?n(eF,e):n(eU,t),tb(),ty(),!0)},f=(0,r.useState)(),h=(p=(0,F.Z)(f,2))[0],m=p[1],g=(0,r.useState)(0),y=(v=(0,F.Z)(g,2))[0],b=v[1],x=(0,r.useState)(0),k=(w=(0,F.Z)(x,2))[0],S=w[1],E=(0,r.useState)(),C=(O=(0,F.Z)(E,2))[0],_=O[1],P=(0,r.useRef)(),N=(0,r.useRef)(),(A=(0,r.useRef)(null)).current={onTouchStart:function(e){var t=e.touches[0];m({x:t.screenX,y:t.screenY}),window.clearInterval(P.current)},onTouchMove:function(e){if(h){e.preventDefault();var t=e.touches[0],n=t.screenX,r=t.screenY;m({x:n,y:r});var o=n-h.x,a=r-h.y;d(o,a);var i=Date.now();b(i),S(i-y),_({x:o,y:a})}},onTouchEnd:function(){if(h&&(m(null),_(null),C)){var e=C.x/k,t=C.y/k;if(!(.1>Math.max(Math.abs(e),Math.abs(t)))){var n=e,r=t;P.current=window.setInterval(function(){if(.01>Math.abs(n)&&.01>Math.abs(r)){window.clearInterval(P.current);return}n*=.9046104802746175,r*=.9046104802746175,d(20*n,20*r)},20)}}},onWheel:function(e){var t=e.deltaX,n=e.deltaY,r=0,o=Math.abs(t),a=Math.abs(n);o===a?r="x"===N.current?t:n:o>a?(r=t,N.current="x"):(r=n,N.current="y"),d(-r,-r)&&e.preventDefault()}},r.useEffect(function(){function e(e){A.current.onTouchMove(e)}function t(e){A.current.onTouchEnd(e)}return document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",t,{passive:!1}),eM.current.addEventListener("touchstart",function(e){A.current.onTouchStart(e)},{passive:!1}),eM.current.addEventListener("wheel",function(e){A.current.onWheel(e)}),function(){document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)}},[]),(0,r.useEffect)(function(){return tb(),tg&&(tp.current=setTimeout(function(){tv(0)},100)),tb},[tg]);var tx=(M=eL?eB:eW,Z=(I=(0,B.Z)((0,B.Z)({},e),{},{tabs:eP})).tabs,H=I.tabPosition,q=I.rtl,["top","bottom"].includes(H)?(R="width",D=q?"right":"left",L=Math.abs(M)):(R="height",D="top",L=-M),(0,r.useMemo)(function(){if(!Z.length)return[0,0];for(var e=Z.length,t=e,n=0;n<e;n+=1){var r=tn.get(Z[n].key)||en;if(r[D]+r[R]>L+ts){t=n-1;break}}for(var o=0,a=e-1;a>=0;a-=1)if((tn.get(Z[a].key)||en)[D]<L){o=a+1;break}return o>=t?[0,0]:[o,t]},[tn,ts,to,ta,ti,L,H,Z.map(function(e){return e.key}).join("_"),q])),tw=(0,F.Z)(tx,2),tk=tw[0],tS=tw[1],tE=(0,V.Z)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ed,t=tn.get(e)||{width:0,height:0,left:0,right:0,top:0};if(eL){var n=eB;ev?t.right<eB?n=t.right:t.right+t.width>eB+ts&&(n=t.right+t.width-ts):t.left<-eB?n=-t.left:t.left+t.width>-eB+ts&&(n=-(t.left+t.width-ts)),eU(0),eF(tf(n))}else{var r=eW;t.top<-eW?r=-t.top:t.top+t.height>-eW+ts&&(r=-(t.top+t.height-ts)),eF(0),eU(tf(r))}}),tO={};"top"===ew||"bottom"===ew?tO[ev?"marginRight":"marginLeft"]=ek:tO.marginTop=ek;var tC=eP.map(function(e,t){var n=e.key;return r.createElement(ep,{id:ec,prefixCls:e_,key:n,tab:e,style:0===t?void 0:tO,closable:e.closable,editable:eb,active:n===ed,renderWrapper:eS,removeAriaLabel:null==ex?void 0:ex.removeAriaLabel,onClick:function(e){eE(n,e)},onFocus:function(){tE(n),ty(),eM.current&&(ev||(eM.current.scrollLeft=0),eM.current.scrollTop=0)}})}),tj=function(){return tt(function(){var e,t=new Map,n=null===(e=eI.current)||void 0===e?void 0:e.getBoundingClientRect();return eP.forEach(function(e){var r,o=e.key,a=null===(r=eI.current)||void 0===r?void 0:r.querySelector('[data-node-key="'.concat(eo(o),'"]'));if(a){var i=eh(a,n),l=(0,F.Z)(i,4),s=l[0],c=l[1],u=l[2],d=l[3];t.set(o,{width:s,height:c,left:u,top:d})}}),t})};(0,r.useEffect)(function(){tj()},[eP.map(function(e){return e.key}).join("_")]);var t_=et(function(){var e=em(eN),t=em(eT),n=em(eA);eX([e[0]-t[0]-n[0],e[1]-t[1]-n[1]]);var r=em(eD);e6(r),e8(em(eR));var o=em(eI);eJ([o[0]-r[0],o[1]-r[1]]),tj()}),tP=eP.slice(0,tk),tN=eP.slice(tS+1),tT=[].concat((0,T.Z)(tP),(0,T.Z)(tN)),tA=tn.get(ed),tM=Y({activeTabOffset:tA,horizontal:eL,indicator:eC,rtl:ev}).style;(0,r.useEffect)(function(){tE()},[ed,tu,td,er(tA),er(tn),eL]),(0,r.useEffect)(function(){t_()},[ev]);var tI=!!tT.length,tR="".concat(e_,"-nav-wrap");return eL?ev?(U=eB>0,W=eB!==td):(W=eB<0,U=eB!==tu):(G=eW<0,ee=eW!==tu),r.createElement($.Z,{onResize:t_},r.createElement("div",{ref:(0,X.x1)(t,eN),role:"tablist",className:a()("".concat(e_,"-nav"),ea),style:es,onKeyDown:function(){ty()}},r.createElement(el,{ref:eT,position:"left",extra:ey,prefixCls:e_}),r.createElement($.Z,{onResize:t_},r.createElement("div",{className:a()(tR,(0,z.Z)((0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(tR,"-ping-left"),W),"".concat(tR,"-ping-right"),U),"".concat(tR,"-ping-top"),G),"".concat(tR,"-ping-bottom"),ee)),ref:eM},r.createElement($.Z,{onResize:t_},r.createElement("div",{ref:eI,className:"".concat(e_,"-nav-list"),style:{transform:"translate(".concat(eB,"px, ").concat(eW,"px)"),transition:tg?"none":void 0}},tC,r.createElement(ei,{ref:eD,prefixCls:e_,locale:ex,editable:eb,style:(0,B.Z)((0,B.Z)({},0===tC.length?void 0:tO),{},{visibility:tI?"hidden":null})}),r.createElement("div",{className:a()("".concat(e_,"-ink-bar"),(0,z.Z)({},"".concat(e_,"-ink-bar-animated"),eu.inkBar)),style:tM}))))),r.createElement(ef,(0,j.Z)({},e,{removeAriaLabel:null==ex?void 0:ex.removeAriaLabel,ref:eR,prefixCls:e_,tabs:tT,className:!tI&&tc,tabMoving:!!tg})),r.createElement(el,{ref:eA,position:"right",extra:ey,prefixCls:e_})))}),ey=r.forwardRef(function(e,t){var n=e.prefixCls,o=e.className,i=e.style,l=e.id,s=e.active,c=e.tabKey,u=e.children;return r.createElement("div",{id:l&&"".concat(l,"-panel-").concat(c),role:"tabpanel",tabIndex:s?0:-1,"aria-labelledby":l&&"".concat(l,"-tab-").concat(c),"aria-hidden":!s,style:i,className:a()(n,s&&"".concat(n,"-active"),o),ref:t},u)}),eb=["renderTabBar"],ex=["label","key"],ew=function(e){var t=e.renderTabBar,n=(0,q.Z)(e,eb),o=r.useContext(K).tabs;return t?t((0,B.Z)((0,B.Z)({},n),{},{panes:o.map(function(e){var t=e.label,n=e.key,o=(0,q.Z)(e,ex);return r.createElement(ey,(0,j.Z)({tab:t,key:n,tabKey:n},o))})}),ev):r.createElement(ev,n)},ek=n(47970),eS=["key","forceRender","style","className","destroyInactiveTabPane"],eE=function(e){var t=e.id,n=e.activeKey,o=e.animated,i=e.tabPosition,l=e.destroyInactiveTabPane,s=r.useContext(K),c=s.prefixCls,u=s.tabs,d=o.tabPane,f="".concat(c,"-tabpane");return r.createElement("div",{className:a()("".concat(c,"-content-holder"))},r.createElement("div",{className:a()("".concat(c,"-content"),"".concat(c,"-content-").concat(i),(0,z.Z)({},"".concat(c,"-content-animated"),d))},u.map(function(e){var i=e.key,s=e.forceRender,c=e.style,u=e.className,p=e.destroyInactiveTabPane,h=(0,q.Z)(e,eS),m=i===n;return r.createElement(ek.ZP,(0,j.Z)({key:i,visible:m,forceRender:s,removeOnLeave:!!(l||p),leavedClassName:"".concat(f,"-hidden")},o.tabPaneMotion),function(e,n){var o=e.style,l=e.className;return r.createElement(ey,(0,j.Z)({},h,{prefixCls:f,id:t,tabKey:i,animated:d,active:m,style:(0,B.Z)((0,B.Z)({},c),o),className:a()(u,l),ref:n}))})})))};n(32559);var eO=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicator"],eC=0,ej=r.forwardRef(function(e,t){var n=e.id,o=e.prefixCls,i=void 0===o?"rc-tabs":o,l=e.className,s=e.items,c=e.direction,u=e.activeKey,d=e.defaultActiveKey,f=e.editable,p=e.animated,h=e.tabPosition,m=void 0===h?"top":h,g=e.tabBarGutter,v=e.tabBarStyle,y=e.tabBarExtraContent,b=e.locale,x=e.moreIcon,w=e.moreTransitionName,k=e.destroyInactiveTabPane,S=e.renderTabBar,E=e.onChange,O=e.onTabClick,C=e.onTabScroll,_=e.getPopupContainer,P=e.popupClassName,N=e.indicator,T=(0,q.Z)(e,eO),A=r.useMemo(function(){return(s||[]).filter(function(e){return e&&"object"===(0,H.Z)(e)&&"key"in e})},[s]),M="rtl"===c,I=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{inkBar:!0,tabPane:!1};return(e=!1===t?{inkBar:!1,tabPane:!1}:!0===t?{inkBar:!0,tabPane:!1}:(0,B.Z)({inkBar:!0},"object"===(0,H.Z)(t)?t:{})).tabPaneMotion&&void 0===e.tabPane&&(e.tabPane=!0),!e.tabPaneMotion&&e.tabPane&&(e.tabPane=!1),e}(p),R=(0,r.useState)(!1),D=(0,F.Z)(R,2),L=D[0],Z=D[1];(0,r.useEffect)(function(){Z((0,U.Z)())},[]);var $=(0,W.Z)(function(){var e;return null===(e=A[0])||void 0===e?void 0:e.key},{value:u,defaultValue:d}),V=(0,F.Z)($,2),X=V[0],G=V[1],Y=(0,r.useState)(function(){return A.findIndex(function(e){return e.key===X})}),Q=(0,F.Z)(Y,2),J=Q[0],ee=Q[1];(0,r.useEffect)(function(){var e,t=A.findIndex(function(e){return e.key===X});-1===t&&(t=Math.max(0,Math.min(J,A.length-1)),G(null===(e=A[t])||void 0===e?void 0:e.key)),ee(t)},[A.map(function(e){return e.key}).join("_"),X,J]);var et=(0,W.Z)(null,{value:n}),en=(0,F.Z)(et,2),er=en[0],eo=en[1];(0,r.useEffect)(function(){n||(eo("rc-tabs-".concat(eC)),eC+=1)},[]);var ea={id:er,activeKey:X,animated:I,tabPosition:m,rtl:M,mobile:L},ei=(0,B.Z)((0,B.Z)({},ea),{},{editable:f,locale:b,moreIcon:x,moreTransitionName:w,tabBarGutter:g,onTabClick:function(e,t){null==O||O(e,t);var n=e!==X;G(e),n&&(null==E||E(e))},onTabScroll:C,extra:y,style:v,panes:null,getPopupContainer:_,popupClassName:P,indicator:N});return r.createElement(K.Provider,{value:{tabs:A,prefixCls:i}},r.createElement("div",(0,j.Z)({ref:t,id:n,className:a()(i,"".concat(i,"-").concat(m),(0,z.Z)((0,z.Z)((0,z.Z)({},"".concat(i,"-mobile"),L),"".concat(i,"-editable"),f),"".concat(i,"-rtl"),M),l)},T),r.createElement(ew,(0,j.Z)({},ei,{renderTabBar:S})),r.createElement(eE,(0,j.Z)({destroyInactiveTabPane:k},ea,{animated:I}))))}),e_=n(64024),eP=n(68710);let eN={motionAppear:!1,motionEnter:!0,motionLeave:!0};var eT=n(45287),eA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},eM=n(12918),eI=n(18544),eR=e=>{let{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{["".concat(t,"-switch")]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:"opacity ".concat(n)}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:"opacity ".concat(n)}}}}},[(0,eI.oN)(e,"slide-up"),(0,eI.oN)(e,"slide-down")]]};let eD=e=>{let{componentCls:t,tabsCardPadding:n,cardBg:r,cardGutter:o,colorBorderSecondary:a,itemSelectedColor:i}=e;return{["".concat(t,"-card")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{margin:0,padding:n,background:r,border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut)},["".concat(t,"-tab-active")]:{color:i,background:e.colorBgContainer},["".concat(t,"-ink-bar")]:{visibility:"hidden"}},["&".concat(t,"-top, &").concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginLeft:{_skip_check_:!0,value:(0,u.bf)(o)}}}},["&".concat(t,"-top")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")},["".concat(t,"-tab-active")]:{borderBottomColor:e.colorBgContainer}}},["&".concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},["".concat(t,"-tab-active")]:{borderTopColor:e.colorBgContainer}}},["&".concat(t,"-left, &").concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginTop:(0,u.bf)(o)}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,u.bf)(e.borderRadiusLG)," 0 0 ").concat((0,u.bf)(e.borderRadiusLG))}},["".concat(t,"-tab-active")]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0")}},["".concat(t,"-tab-active")]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},eL=e=>{let{componentCls:t,itemHoverColor:n,dropdownEdgeChildVerticalPadding:r}=e;return{["".concat(t,"-dropdown")]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},["".concat(t,"-dropdown-menu")]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:"".concat((0,u.bf)(r)," 0"),overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},eM.vS),{display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:"".concat((0,u.bf)(e.paddingXXS)," ").concat((0,u.bf)(e.paddingSM)),color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},eZ=e=>{let{componentCls:t,margin:n,colorBorderSecondary:r,horizontalMargin:o,verticalItemPadding:a,verticalItemMargin:i,calc:l}=e;return{["".concat(t,"-top, ").concat(t,"-bottom")]:{flexDirection:"column",["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r),content:"''"},["".concat(t,"-ink-bar")]:{height:e.lineWidthBold,"&-animated":{transition:"width ".concat(e.motionDurationSlow,", left ").concat(e.motionDurationSlow,",\n right ").concat(e.motionDurationSlow)}},["".concat(t,"-nav-wrap")]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},["&".concat(t,"-nav-wrap-ping-left::before")]:{opacity:1},["&".concat(t,"-nav-wrap-ping-right::after")]:{opacity:1}}}},["".concat(t,"-top")]:{["> ".concat(t,"-nav,\n > div > ").concat(t,"-nav")]:{"&::before":{bottom:0},["".concat(t,"-ink-bar")]:{bottom:0}}},["".concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},["".concat(t,"-ink-bar")]:{top:0}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{order:0}},["".concat(t,"-left, ").concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{flexDirection:"column",minWidth:l(e.controlHeight).mul(1.25).equal(),["".concat(t,"-tab")]:{padding:a,textAlign:"center"},["".concat(t,"-tab + ").concat(t,"-tab")]:{margin:i},["".concat(t,"-nav-wrap")]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},["&".concat(t,"-nav-wrap-ping-top::before")]:{opacity:1},["&".concat(t,"-nav-wrap-ping-bottom::after")]:{opacity:1}},["".concat(t,"-ink-bar")]:{width:e.lineWidthBold,"&-animated":{transition:"height ".concat(e.motionDurationSlow,", top ").concat(e.motionDurationSlow)}},["".concat(t,"-nav-list, ").concat(t,"-nav-operations")]:{flex:"1 0 auto",flexDirection:"column"}}},["".concat(t,"-left")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-ink-bar")]:{right:{_skip_check_:!0,value:0}}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{marginLeft:{_skip_check_:!0,value:(0,u.bf)(l(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},["> ".concat(t,"-content > ").concat(t,"-tabpane")]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},["".concat(t,"-right")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{order:1,["".concat(t,"-ink-bar")]:{left:{_skip_check_:!0,value:0}}},["> ".concat(t,"-content-holder, > div > ").concat(t,"-content-holder")]:{order:0,marginRight:{_skip_check_:!0,value:l(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},["> ".concat(t,"-content > ").concat(t,"-tabpane")]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},ez=e=>{let{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,horizontalItemPaddingSM:o,horizontalItemPaddingLG:a}=e;return{[t]:{"&-small":{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:o,fontSize:e.titleFontSizeSM}}},"&-large":{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:a,fontSize:e.titleFontSizeLG}}}},["".concat(t,"-card")]:{["&".concat(t,"-small")]:{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:n}},["&".concat(t,"-bottom")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius))}},["&".concat(t,"-top")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:"".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius)," 0 0")}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"0 ".concat((0,u.bf)(e.borderRadius)," ").concat((0,u.bf)(e.borderRadius)," 0")}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav ").concat(t,"-tab")]:{borderRadius:{_skip_check_:!0,value:"".concat((0,u.bf)(e.borderRadius)," 0 0 ").concat((0,u.bf)(e.borderRadius))}}}},["&".concat(t,"-large")]:{["> ".concat(t,"-nav")]:{["".concat(t,"-tab")]:{padding:r}}}}}},eB=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:o,tabsHorizontalItemMargin:a,horizontalItemPadding:i,itemSelectedColor:l,itemColor:s}=e,c="".concat(t,"-tab");return{[c]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:i,fontSize:e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:s,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:n}},(0,eM.Qy)(e)),"&-btn":{outline:"none",transition:"all 0.3s",["".concat(c,"-icon:not(:last-child)")]:{marginInlineEnd:e.marginSM}},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorTextDescription,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextHeading}},"&:hover":{color:r},["&".concat(c,"-active ").concat(c,"-btn")]:{color:l,textShadow:e.tabsActiveTextShadow},["&".concat(c,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed"},["&".concat(c,"-disabled ").concat(c,"-btn, &").concat(c,"-disabled ").concat(t,"-remove")]:{"&:focus, &:active":{color:e.colorTextDisabled}},["& ".concat(c,"-remove ").concat(o)]:{margin:0},["".concat(o,":not(:last-child)")]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},["".concat(c," + ").concat(c)]:{margin:{_skip_check_:!0,value:a}}}},eF=e=>{let{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:o,calc:a}=e;return{["".concat(t,"-rtl")]:{direction:"rtl",["".concat(t,"-nav")]:{["".concat(t,"-tab")]:{margin:{_skip_check_:!0,value:n},["".concat(t,"-tab:last-of-type")]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:(0,u.bf)(e.marginSM)}},["".concat(t,"-tab-remove")]:{marginRight:{_skip_check_:!0,value:(0,u.bf)(e.marginXS)},marginLeft:{_skip_check_:!0,value:(0,u.bf)(a(e.marginXXS).mul(-1).equal())},[r]:{margin:0}}}},["&".concat(t,"-left")]:{["> ".concat(t,"-nav")]:{order:1},["> ".concat(t,"-content-holder")]:{order:0}},["&".concat(t,"-right")]:{["> ".concat(t,"-nav")]:{order:0},["> ".concat(t,"-content-holder")]:{order:1}},["&".concat(t,"-card").concat(t,"-top, &").concat(t,"-card").concat(t,"-bottom")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-tab + ").concat(t,"-tab")]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},["".concat(t,"-dropdown-rtl")]:{direction:"rtl"},["".concat(t,"-menu-item")]:{["".concat(t,"-dropdown-rtl")]:{textAlign:{_skip_check_:!0,value:"right"}}}}},eH=e=>{let{componentCls:t,tabsCardPadding:n,cardHeight:r,cardGutter:o,itemHoverColor:a,itemActiveColor:i,colorBorderSecondary:l}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,eM.Wf)(e)),{display:"flex",["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{position:"relative",display:"flex",flex:"none",alignItems:"center",["".concat(t,"-nav-wrap")]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:"opacity ".concat(e.motionDurationSlow),content:"''",pointerEvents:"none"}},["".concat(t,"-nav-list")]:{position:"relative",display:"flex",transition:"opacity ".concat(e.motionDurationSlow)},["".concat(t,"-nav-operations")]:{display:"flex",alignSelf:"stretch"},["".concat(t,"-nav-operations-hidden")]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},["".concat(t,"-nav-more")]:{position:"relative",padding:n,background:"transparent",border:0,color:e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},["".concat(t,"-nav-add")]:Object.assign({minWidth:r,minHeight:r,marginLeft:{_skip_check_:!0,value:o},padding:"0 ".concat((0,u.bf)(e.paddingXS)),background:"transparent",border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(l),borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0"),outline:"none",cursor:"pointer",color:e.colorText,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut),"&:hover":{color:a},"&:active, &:focus:not(:focus-visible)":{color:i}},(0,eM.Qy)(e))},["".concat(t,"-extra-content")]:{flex:"none"},["".concat(t,"-ink-bar")]:{position:"absolute",background:e.inkBarColor,pointerEvents:"none"}}),eB(e)),{["".concat(t,"-content")]:{position:"relative",width:"100%"},["".concat(t,"-content-holder")]:{flex:"auto",minWidth:0,minHeight:0},["".concat(t,"-tabpane")]:{outline:"none","&-hidden":{display:"none"}}}),["".concat(t,"-centered")]:{["> ".concat(t,"-nav, > div > ").concat(t,"-nav")]:{["".concat(t,"-nav-wrap")]:{["&:not([class*='".concat(t,"-nav-wrap-ping'])")]:{justifyContent:"center"}}}}}};var eq=(0,d.I$)("Tabs",e=>{let t=(0,f.TS)(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:"0 0 0 ".concat((0,u.bf)(e.horizontalItemGutter)),tabsHorizontalItemMarginRTL:"0 0 0 ".concat((0,u.bf)(e.horizontalItemGutter))});return[ez(t),eF(t),eZ(t),eL(t),eD(t),eH(t),eR(t)]},e=>{let t=e.controlHeightLG;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:t,cardPadding:"".concat((t-Math.round(e.fontSize*e.lineHeight))/2-e.lineWidth,"px ").concat(e.padding,"px"),cardPaddingSM:"".concat(1.5*e.paddingXXS,"px ").concat(e.padding,"px"),cardPaddingLG:"".concat(e.paddingXS,"px ").concat(e.padding,"px ").concat(1.5*e.paddingXXS,"px"),titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:"0 0 ".concat(e.margin,"px 0"),horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:"".concat(e.paddingSM,"px 0"),horizontalItemPaddingSM:"".concat(e.paddingXS,"px 0"),horizontalItemPaddingLG:"".concat(e.padding,"px 0"),verticalItemPadding:"".concat(e.paddingXS,"px ").concat(e.paddingLG,"px"),verticalItemMargin:"".concat(e.margin,"px 0 0 0"),itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}}),eW=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eU=e=>{var t,n,o,i,c,u;let d;let{type:f,className:p,rootClassName:h,size:m,onEdit:g,hideAdd:v,centered:y,addIcon:b,popupClassName:x,children:w,items:k,animated:S,style:E,indicatorSize:O,indicator:C}=e,j=eW(e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize","indicator"]),{prefixCls:_,moreIcon:P=r.createElement(L.Z,null)}=j,{direction:N,tabs:T,getPrefixCls:A,getPopupContainer:M}=r.useContext(l.E_),I=A("tabs",_),R=(0,e_.Z)(I),[z,B,F]=eq(I,R);"editable-card"===f&&(d={onEdit:(e,t)=>{let{key:n,event:r}=t;null==g||g("add"===e?r:n,e)},removeIcon:r.createElement(D.Z,null),addIcon:b||r.createElement(Z.Z,null),showAdd:!0!==v});let H=A(),q=(0,s.Z)(m),W=k||(0,eT.Z)(w).map(e=>{if(r.isValidElement(e)){let{key:t,props:n}=e,r=n||{},{tab:o}=r,a=eA(r,["tab"]);return Object.assign(Object.assign({key:String(t)},a),{label:o})}return null}).filter(e=>e),U=function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{inkBar:!0,tabPane:!1};return(t=!1===n?{inkBar:!1,tabPane:!1}:!0===n?{inkBar:!0,tabPane:!0}:Object.assign({inkBar:!0},"object"==typeof n?n:{})).tabPane&&(t.tabPaneMotion=Object.assign(Object.assign({},eN),{motionName:(0,eP.m)(e,"switch")})),t}(I,S),K=Object.assign(Object.assign({},null==T?void 0:T.style),E),$={align:null!==(t=null==C?void 0:C.align)&&void 0!==t?t:null===(n=null==T?void 0:T.indicator)||void 0===n?void 0:n.align,size:null!==(u=null!==(i=null!==(o=null==C?void 0:C.size)&&void 0!==o?o:O)&&void 0!==i?i:null===(c=null==T?void 0:T.indicator)||void 0===c?void 0:c.size)&&void 0!==u?u:null==T?void 0:T.indicatorSize};return z(r.createElement(ej,Object.assign({direction:N,getPopupContainer:M,moreTransitionName:"".concat(H,"-slide-up")},j,{items:W,className:a()({["".concat(I,"-").concat(q)]:q,["".concat(I,"-card")]:["card","editable-card"].includes(f),["".concat(I,"-editable-card")]:"editable-card"===f,["".concat(I,"-centered")]:y},null==T?void 0:T.className,p,h,B,F,R),popupClassName:a()(x,B,F,R),style:K,editable:d,moreIcon:P,prefixCls:I,animated:U,indicator:$})))};eU.TabPane=()=>null;var eK=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},e$=e=>{var{prefixCls:t,className:n,hoverable:o=!0}=e,i=eK(e,["prefixCls","className","hoverable"]);let{getPrefixCls:s}=r.useContext(l.E_),c=s("card",t),u=a()("".concat(c,"-grid"),n,{["".concat(c,"-grid-hoverable")]:o});return r.createElement("div",Object.assign({},i,{className:u}))};let eV=e=>{let{antCls:t,componentCls:n,headerHeight:r,cardPaddingBase:o,tabsMarginBottom:a}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:r,marginBottom:-1,padding:"0 ".concat((0,u.bf)(o)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")},(0,eM.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},eM.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:a,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},eX=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:o}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,u.bf)(o)," 0 0 0 ").concat(n,",\n 0 ").concat((0,u.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,u.bf)(o)," ").concat((0,u.bf)(o)," 0 0 ").concat(n,",\n ").concat((0,u.bf)(o)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,u.bf)(o)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:r}}},eG=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:r,cardActionsIconSize:o,colorBorderSecondary:a,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),display:"flex",borderRadius:"0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},(0,eM.dF)()),{"& > li":{margin:r,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:"color ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:e.colorTextDescription,lineHeight:(0,u.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(n)]:{fontSize:o,lineHeight:(0,u.bf)(e.calc(o).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a)}}})},eY=e=>Object.assign(Object.assign({margin:"".concat((0,u.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,eM.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},eM.vS),"&-description":{color:e.colorTextDescription}}),eQ=e=>{let{componentCls:t,cardPaddingBase:n,colorFillAlter:r}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,u.bf)(n)),background:r,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,u.bf)(e.padding)," ").concat((0,u.bf)(n))}}},eJ=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},e0=e=>{let{antCls:t,componentCls:n,cardShadow:r,cardHeadPadding:o,colorBorderSecondary:a,boxShadowTertiary:i,cardPaddingBase:l,extraColor:s}=e;return{[n]:Object.assign(Object.assign({},(0,eM.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(n,"-bordered)")]:{boxShadow:i},["".concat(n,"-head")]:eV(e),["".concat(n,"-extra")]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},["".concat(n,"-body")]:Object.assign({padding:l,borderRadius:" 0 0 ".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG))},(0,eM.dF)()),["".concat(n,"-grid")]:eX(e),["".concat(n,"-cover")]:{"> *":{display:"block",width:"100%"},["img, img + ".concat(t,"-image-mask")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0")}},["".concat(n,"-actions")]:eG(e),["".concat(n,"-meta")]:eY(e)}),["".concat(n,"-bordered")]:{border:"".concat((0,u.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(n,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(n,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:r}},["".concat(n,"-contain-grid")]:{borderRadius:"".concat((0,u.bf)(e.borderRadiusLG)," ").concat((0,u.bf)(e.borderRadiusLG)," 0 0 "),["".concat(n,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(n,"-loading) ").concat(n,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(n,"-contain-tabs")]:{["> ".concat(n,"-head")]:{minHeight:0,["".concat(n,"-head-title, ").concat(n,"-extra")]:{paddingTop:o}}},["".concat(n,"-type-inner")]:eQ(e),["".concat(n,"-loading")]:eJ(e),["".concat(n,"-rtl")]:{direction:"rtl"}}},e1=e=>{let{componentCls:t,cardPaddingSM:n,headerHeightSM:r,headerFontSizeSM:o}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:r,padding:"0 ".concat((0,u.bf)(n)),fontSize:o,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:n}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var e2=(0,d.I$)("Card",e=>{let t=(0,f.TS)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[e0(t),e1(t)]},e=>({headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText})),e6=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let e4=e=>{let{prefixCls:t,actions:n=[]}=e;return r.createElement("ul",{className:"".concat(t,"-actions")},n.map((e,t)=>r.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(t)},r.createElement("span",null,e))))},e3=r.forwardRef((e,t)=>{let n;let{prefixCls:o,className:c,rootClassName:u,style:d,extra:f,headStyle:p={},bodyStyle:h={},title:m,loading:g,bordered:v=!0,size:y,type:b,cover:x,actions:w,tabList:k,children:S,activeTabKey:E,defaultActiveTabKey:O,tabBarExtraContent:C,hoverable:j,tabProps:_={}}=e,P=e6(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:N,direction:T,card:A}=r.useContext(l.E_),M=r.useMemo(()=>{let e=!1;return r.Children.forEach(S,t=>{t&&t.type&&t.type===e$&&(e=!0)}),e},[S]),I=N("card",o),[D,L,Z]=e2(I),z=r.createElement(R,{loading:!0,active:!0,paragraph:{rows:4},title:!1},S),B=void 0!==E,F=Object.assign(Object.assign({},_),{[B?"activeKey":"defaultActiveKey"]:B?E:O,tabBarExtraContent:C}),H=(0,s.Z)(y),q=H&&"default"!==H?H:"large",W=k?r.createElement(eU,Object.assign({size:q},F,{className:"".concat(I,"-head-tabs"),onChange:t=>{var n;null===(n=e.onTabChange)||void 0===n||n.call(e,t)},items:k.map(e=>{var{tab:t}=e;return Object.assign({label:t},e6(e,["tab"]))})})):null;(m||f||W)&&(n=r.createElement("div",{className:"".concat(I,"-head"),style:p},r.createElement("div",{className:"".concat(I,"-head-wrapper")},m&&r.createElement("div",{className:"".concat(I,"-head-title")},m),f&&r.createElement("div",{className:"".concat(I,"-extra")},f)),W));let U=x?r.createElement("div",{className:"".concat(I,"-cover")},x):null,K=r.createElement("div",{className:"".concat(I,"-body"),style:h},g?z:S),$=w&&w.length?r.createElement(e4,{prefixCls:I,actions:w}):null,V=(0,i.Z)(P,["onTabChange"]),X=a()(I,null==A?void 0:A.className,{["".concat(I,"-loading")]:g,["".concat(I,"-bordered")]:v,["".concat(I,"-hoverable")]:j,["".concat(I,"-contain-grid")]:M,["".concat(I,"-contain-tabs")]:k&&k.length,["".concat(I,"-").concat(H)]:H,["".concat(I,"-type-").concat(b)]:!!b,["".concat(I,"-rtl")]:"rtl"===T},c,u,L,Z),G=Object.assign(Object.assign({},null==A?void 0:A.style),d);return D(r.createElement("div",Object.assign({ref:t},V,{className:X,style:G}),n,U,K,$))});var e5=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};e3.Grid=e$,e3.Meta=e=>{let{prefixCls:t,className:n,avatar:o,title:i,description:s}=e,c=e5(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=r.useContext(l.E_),d=u("card",t),f=a()("".concat(d,"-meta"),n),p=o?r.createElement("div",{className:"".concat(d,"-meta-avatar")},o):null,h=i?r.createElement("div",{className:"".concat(d,"-meta-title")},i):null,m=s?r.createElement("div",{className:"".concat(d,"-meta-description")},s):null,g=h||m?r.createElement("div",{className:"".concat(d,"-meta-detail")},h,m):null;return r.createElement("div",Object.assign({},c,{className:f}),p,g)};var e8=e3},69410:function(e,t,n){"use strict";var r=n(54998);t.Z=r.Z},44851:function(e,t,n){"use strict";n.d(t,{default:function(){return H}});var r=n(2265),o=n(77565),a=n(36760),i=n.n(a),l=n(83145),s=n(26365),c=n(41154),u=n(50506),d=n(32559),f=n(1119),p=n(6989),h=n(45287),m=n(11993),g=n(47970),v=n(95814),y=r.forwardRef(function(e,t){var n,o=e.prefixCls,a=e.forceRender,l=e.className,c=e.style,u=e.children,d=e.isActive,f=e.role,p=r.useState(d||a),h=(0,s.Z)(p,2),g=h[0],v=h[1];return(r.useEffect(function(){(a||d)&&v(!0)},[a,d]),g)?r.createElement("div",{ref:t,className:i()("".concat(o,"-content"),(n={},(0,m.Z)(n,"".concat(o,"-content-active"),d),(0,m.Z)(n,"".concat(o,"-content-inactive"),!d),n),l),style:c,role:f},r.createElement("div",{className:"".concat(o,"-content-box")},u)):null});y.displayName="PanelContent";var b=["showArrow","headerClass","isActive","onItemClick","forceRender","className","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],x=r.forwardRef(function(e,t){var n,o,a=e.showArrow,l=e.headerClass,s=e.isActive,c=e.onItemClick,u=e.forceRender,d=e.className,h=e.prefixCls,x=e.collapsible,w=e.accordion,k=e.panelKey,S=e.extra,E=e.header,O=e.expandIcon,C=e.openMotion,j=e.destroyInactivePanel,_=e.children,P=(0,p.Z)(e,b),N="disabled"===x,T="header"===x,A="icon"===x,M=function(){null==c||c(k)},I="function"==typeof O?O(e):r.createElement("i",{className:"arrow"});I&&(I=r.createElement("div",{className:"".concat(h,"-expand-icon"),onClick:["header","icon"].includes(x)?M:void 0},I));var R=i()((n={},(0,m.Z)(n,"".concat(h,"-item"),!0),(0,m.Z)(n,"".concat(h,"-item-active"),s),(0,m.Z)(n,"".concat(h,"-item-disabled"),N),n),d),D={className:i()(l,(o={},(0,m.Z)(o,"".concat(h,"-header"),!0),(0,m.Z)(o,"".concat(h,"-header-collapsible-only"),T),(0,m.Z)(o,"".concat(h,"-icon-collapsible-only"),A),o)),"aria-expanded":s,"aria-disabled":N,onKeyDown:function(e){("Enter"===e.key||e.keyCode===v.Z.ENTER||e.which===v.Z.ENTER)&&M()}};return T||A||(D.onClick=M,D.role=w?"tab":"button",D.tabIndex=N?-1:0),r.createElement("div",(0,f.Z)({},P,{ref:t,className:R}),r.createElement("div",D,(void 0===a||a)&&I,r.createElement("span",{className:"".concat(h,"-header-text"),onClick:"header"===x?M:void 0},E),null!=S&&"boolean"!=typeof S&&r.createElement("div",{className:"".concat(h,"-extra")},S)),r.createElement(g.ZP,(0,f.Z)({visible:s,leavedClassName:"".concat(h,"-content-hidden")},C,{forceRender:u,removeOnLeave:j}),function(e,t){var n=e.className,o=e.style;return r.createElement(y,{ref:t,prefixCls:h,className:n,style:o,isActive:s,forceRender:u,role:w?"tabpanel":void 0},_)}))}),w=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],k=function(e,t){var n=t.prefixCls,o=t.accordion,a=t.collapsible,i=t.destroyInactivePanel,l=t.onItemClick,s=t.activeKey,c=t.openMotion,u=t.expandIcon;return e.map(function(e,t){var d=e.children,h=e.label,m=e.key,g=e.collapsible,v=e.onItemClick,y=e.destroyInactivePanel,b=(0,p.Z)(e,w),k=String(null!=m?m:t),S=null!=g?g:a,E=!1;return E=o?s[0]===k:s.indexOf(k)>-1,r.createElement(x,(0,f.Z)({},b,{prefixCls:n,key:k,panelKey:k,isActive:E,accordion:o,openMotion:c,expandIcon:u,header:h,collapsible:S,onItemClick:function(e){"disabled"!==S&&(l(e),null==v||v(e))},destroyInactivePanel:null!=y?y:i}),d)})},S=function(e,t,n){if(!e)return null;var o=n.prefixCls,a=n.accordion,i=n.collapsible,l=n.destroyInactivePanel,s=n.onItemClick,c=n.activeKey,u=n.openMotion,d=n.expandIcon,f=e.key||String(t),p=e.props,h=p.header,m=p.headerClass,g=p.destroyInactivePanel,v=p.collapsible,y=p.onItemClick,b=!1;b=a?c[0]===f:c.indexOf(f)>-1;var x=null!=v?v:i,w={key:f,panelKey:f,header:h,headerClass:m,isActive:b,prefixCls:o,destroyInactivePanel:null!=g?g:l,openMotion:u,accordion:a,children:e.props.children,onItemClick:function(e){"disabled"!==x&&(s(e),null==y||y(e))},expandIcon:d,collapsible:x};return"string"==typeof e.type?e:(Object.keys(w).forEach(function(e){void 0===w[e]&&delete w[e]}),r.cloneElement(e,w))};function E(e){var t=e;if(!Array.isArray(t)){var n=(0,c.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var O=Object.assign(r.forwardRef(function(e,t){var n,o=e.prefixCls,a=void 0===o?"rc-collapse":o,c=e.destroyInactivePanel,f=e.style,p=e.accordion,m=e.className,g=e.children,v=e.collapsible,y=e.openMotion,b=e.expandIcon,x=e.activeKey,w=e.defaultActiveKey,O=e.onChange,C=e.items,j=i()(a,m),_=(0,u.Z)([],{value:x,onChange:function(e){return null==O?void 0:O(e)},defaultValue:w,postState:E}),P=(0,s.Z)(_,2),N=P[0],T=P[1];(0,d.ZP)(!g,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var A=(n={prefixCls:a,accordion:p,openMotion:y,expandIcon:b,collapsible:v,destroyInactivePanel:void 0!==c&&c,onItemClick:function(e){return T(function(){return p?N[0]===e?[]:[e]:N.indexOf(e)>-1?N.filter(function(t){return t!==e}):[].concat((0,l.Z)(N),[e])})},activeKey:N},Array.isArray(C)?k(C,n):(0,h.Z)(g).map(function(e,t){return S(e,t,n)}));return r.createElement("div",{ref:t,className:j,style:f,role:p?"tablist":void 0},A)}),{Panel:x});O.Panel;var C=n(18694),j=n(68710),_=n(19722),P=n(71744),N=n(33759);let T=r.forwardRef((e,t)=>{let{getPrefixCls:n}=r.useContext(P.E_),{prefixCls:o,className:a,showArrow:l=!0}=e,s=n("collapse",o),c=i()({["".concat(s,"-no-arrow")]:!l},a);return r.createElement(O.Panel,Object.assign({ref:t},e,{prefixCls:s,className:c}))});var A=n(352),M=n(12918),I=n(63074),R=n(80669),D=n(3104);let L=e=>{let{componentCls:t,contentBg:n,padding:r,headerBg:o,headerPadding:a,collapseHeaderPaddingSM:i,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:s,lineWidth:c,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:h,fontSizeLG:m,lineHeight:g,lineHeightLG:v,marginSM:y,paddingSM:b,paddingLG:x,paddingXS:w,motionDurationSlow:k,fontSizeIcon:S,contentPadding:E,fontHeight:O,fontHeightLG:C}=e,j="".concat((0,A.bf)(c)," ").concat(u," ").concat(d);return{[t]:Object.assign(Object.assign({},(0,M.Wf)(e)),{backgroundColor:o,border:j,borderBottom:0,borderRadius:s,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:j,"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["> ".concat(t,"-header")]:{position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:a,color:p,lineHeight:g,cursor:"pointer",transition:"all ".concat(k,", visibility 0s"),["> ".concat(t,"-header-text")]:{flex:"auto"},"&:focus":{outline:"none"},["".concat(t,"-expand-icon")]:{height:O,display:"flex",alignItems:"center",paddingInlineEnd:y},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,M.Ro)()),{fontSize:S,svg:{transition:"transform ".concat(k)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}},["".concat(t,"-icon-collapsible-only")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:f,backgroundColor:n,borderTop:j,["& > ".concat(t,"-content-box")]:{padding:E},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:i,paddingInlineStart:w,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(b).sub(w).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:b}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:m,lineHeight:v,["> ".concat(t,"-header")]:{padding:l,paddingInlineStart:r,["> ".concat(t,"-expand-icon")]:{height:C,marginInlineStart:e.calc(x).sub(r).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:x}}},["".concat(t,"-item:last-child")]:{["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,A.bf)(s)," ").concat((0,A.bf)(s))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:h,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:y}}}}})}},Z=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow svg");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},z=e=>{let{componentCls:t,headerBg:n,paddingXXS:r,colorBorder:o}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(o)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:"transparent",borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{paddingTop:r}}}},B=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var F=(0,R.I$)("Collapse",e=>{let t=(0,D.TS)(e,{collapseHeaderPaddingSM:"".concat((0,A.bf)(e.paddingXS)," ").concat((0,A.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,A.bf)(e.padding)," ").concat((0,A.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[L(t),z(t),B(t),Z(t),(0,I.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer})),H=Object.assign(r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a,collapse:l}=r.useContext(P.E_),{prefixCls:s,className:c,rootClassName:u,style:d,bordered:f=!0,ghost:p,size:m,expandIconPosition:g="start",children:v,expandIcon:y}=e,b=(0,N.Z)(e=>{var t;return null!==(t=null!=m?m:e)&&void 0!==t?t:"middle"}),x=n("collapse",s),w=n(),[k,S,E]=F(x),T=r.useMemo(()=>"left"===g?"start":"right"===g?"end":g,[g]),A=i()("".concat(x,"-icon-position-").concat(T),{["".concat(x,"-borderless")]:!f,["".concat(x,"-rtl")]:"rtl"===a,["".concat(x,"-ghost")]:!!p,["".concat(x,"-").concat(b)]:"middle"!==b},null==l?void 0:l.className,c,u,S,E),M=Object.assign(Object.assign({},(0,j.Z)(w)),{motionAppear:!1,leavedClassName:"".concat(x,"-content-hidden")}),I=r.useMemo(()=>v?(0,h.Z)(v).map((e,t)=>{var n,r;if(null===(n=e.props)||void 0===n?void 0:n.disabled){let n=null!==(r=e.key)&&void 0!==r?r:String(t),{disabled:o,collapsible:a}=e.props,i=Object.assign(Object.assign({},(0,C.Z)(e.props,["disabled"])),{key:n,collapsible:null!=a?a:o?"disabled":void 0});return(0,_.Tm)(e,i)}return e}):null,[v]);return k(r.createElement(O,Object.assign({ref:t,openMotion:M},(0,C.Z)(e,["rootClassName"]),{expandIcon:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=y?y(e):r.createElement(o.Z,{rotate:e.isActive?90:void 0});return(0,_.Tm)(t,()=>({className:i()(t.props.className,"".concat(x,"-arrow"))}))},prefixCls:x,className:A,style:Object.assign(Object.assign({},null==l?void 0:l.style),d)}),I))}),{Panel:T})},23496:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),l=n(352),s=n(12918),c=n(80669),u=n(3104);let d=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:o,textPaddingInline:a,orientationMargin:i,verticalMarginInline:c}=e;return{[t]:Object.assign(Object.assign({},(0,s.Wf)(e)),{borderBlockStart:"".concat((0,l.bf)(o)," solid ").concat(r),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:c,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat((0,l.bf)(o)," solid ").concat(r)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat((0,l.bf)(e.dividerHorizontalGutterMargin)," 0")},["&-horizontal".concat(t,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat((0,l.bf)(e.dividerHorizontalWithTextGutterMargin)," 0"),color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(r),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat((0,l.bf)(o)," solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(t,"-with-text-left")]:{"&::before":{width:"calc(".concat(i," * 100%)")},"&::after":{width:"calc(100% - ".concat(i," * 100%)")}},["&-horizontal".concat(t,"-with-text-right")]:{"&::before":{width:"calc(100% - ".concat(i," * 100%)")},"&::after":{width:"calc(".concat(i," * 100%)")}},["".concat(t,"-inner-text")]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:"".concat((0,l.bf)(o)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(t,"-dashed")]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(t,"-with-text")]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},["&-horizontal".concat(t,"-with-text-left").concat(t,"-no-default-orientation-margin-left")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(t,"-inner-text")]:{paddingInlineStart:n}},["&-horizontal".concat(t,"-with-text-right").concat(t,"-no-default-orientation-margin-right")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(t,"-inner-text")]:{paddingInlineEnd:n}}})}};var f=(0,c.I$)("Divider",e=>[d((0,u.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0}))],e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},h=e=>{let{getPrefixCls:t,direction:n,divider:o}=r.useContext(i.E_),{prefixCls:l,type:s="horizontal",orientation:c="center",orientationMargin:u,className:d,rootClassName:h,children:m,dashed:g,plain:v,style:y}=e,b=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),x=t("divider",l),[w,k,S]=f(x),E=c.length>0?"-".concat(c):c,O=!!m,C="left"===c&&null!=u,j="right"===c&&null!=u,_=a()(x,null==o?void 0:o.className,k,S,"".concat(x,"-").concat(s),{["".concat(x,"-with-text")]:O,["".concat(x,"-with-text").concat(E)]:O,["".concat(x,"-dashed")]:!!g,["".concat(x,"-plain")]:!!v,["".concat(x,"-rtl")]:"rtl"===n,["".concat(x,"-no-default-orientation-margin-left")]:C,["".concat(x,"-no-default-orientation-margin-right")]:j},d,h),P=r.useMemo(()=>"number"==typeof u?u:/^\d+$/.test(u)?Number(u):u,[u]),N=Object.assign(Object.assign({},C&&{marginLeft:P}),j&&{marginRight:P});return w(r.createElement("div",Object.assign({className:_,style:Object.assign(Object.assign({},null==o?void 0:o.style),y)},b,{role:"separator"}),m&&"vertical"!==s&&r.createElement("span",{className:"".concat(x,"-inner-text"),style:N},m)))}},20577:function(e,t,n){"use strict";n.d(t,{Z:function(){return em}});var r=n(2265),o=n(70464),a=n(1119),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},l=n(55015),s=r.forwardRef(function(e,t){return r.createElement(l.Z,(0,a.Z)({},e,{ref:t,icon:i}))}),c=n(36760),u=n.n(c),d=n(11993),f=n(41154),p=n(26365),h=n(6989),m=n(76405),g=n(25049);function v(){return"function"==typeof BigInt}function y(e){return!e&&0!==e&&!Number.isNaN(e)||!String(e).trim()}function b(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var r=t||"0",o=r.split("."),a=o[0]||"0",i=o[1]||"0";"0"===a&&"0"===i&&(n=!1);var l=n?"-":"";return{negative:n,negativeStr:l,trimStr:r,integerStr:a,decimalStr:i,fullStr:"".concat(l).concat(r)}}function x(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function w(e){var t=String(e);if(x(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&S(t)?t.length-t.indexOf(".")-1:0}function k(e){var t=String(e);if(x(e)){if(e>Number.MAX_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(v()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);t=e.toFixed(w(t))}return b(t).fullStr}function S(e){return"number"==typeof e?!Number.isNaN(e):!!e&&(/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e))}var E=function(){function e(t){if((0,m.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"negative",void 0),(0,d.Z)(this,"integer",void 0),(0,d.Z)(this,"decimal",void 0),(0,d.Z)(this,"decimalLen",void 0),(0,d.Z)(this,"empty",void 0),(0,d.Z)(this,"nan",void 0),y(t)){this.empty=!0;return}if(this.origin=String(t),"-"===t||Number.isNaN(t)){this.nan=!0;return}var n=t;if(x(n)&&(n=Number(n)),S(n="string"==typeof n?n:k(n))){var r=b(n);this.negative=r.negative;var o=r.trimStr.split(".");this.integer=BigInt(o[0]);var a=o[1]||"0";this.decimal=BigInt(a),this.decimalLen=a.length}else this.nan=!0}return(0,g.Z)(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(e){return BigInt("".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(e,"0")))}},{key:"negate",value:function(){var t=new e(this.toString());return t.negative=!t.negative,t}},{key:"cal",value:function(t,n,r){var o=Math.max(this.getDecimalStr().length,t.getDecimalStr().length),a=n(this.alignDecimal(o),t.alignDecimal(o)).toString(),i=r(o),l=b(a),s=l.negativeStr,c=l.trimStr,u="".concat(s).concat(c.padStart(i+1,"0"));return new e("".concat(u.slice(0,-i),".").concat(u.slice(-i)))}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=new e(t);return n.isInvalidate()?this:this.cal(n,function(e,t){return e+t},function(e){return e})}},{key:"multi",value:function(t){var n=new e(t);return this.isInvalidate()||n.isInvalidate()?new e(NaN):this.cal(n,function(e,t){return e*t},function(e){return 2*e})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toString()===(null==e?void 0:e.toString())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":b("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}(),O=function(){function e(t){if((0,m.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"number",void 0),(0,d.Z)(this,"empty",void 0),y(t)){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return(0,g.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(w(this.number),w(n));return new e(r.toFixed(o))}},{key:"multi",value:function(t){var n=Number(t);if(this.isInvalidate()||Number.isNaN(n))return new e(NaN);var r=this.number*n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var o=Math.max(w(this.number),w(n));return new e(r.toFixed(o))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toNumber()===(null==e?void 0:e.toNumber())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":k(this.number):this.origin}}]),e}();function C(e){return v()?new E(e):new O(e)}function j(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var o=b(e),a=o.negativeStr,i=o.integerStr,l=o.decimalStr,s="".concat(t).concat(l),c="".concat(a).concat(i);if(n>=0){var u=Number(l[n]);return u>=5&&!r?j(C(e).add("".concat(a,"0.").concat("0".repeat(n)).concat(10-u)).toString(),t,n,r):0===n?c:"".concat(c).concat(t).concat(l.padEnd(n,"0").slice(0,n))}return".0"===s?c:"".concat(c).concat(s)}var _=n(2027),P=n(27380),N=n(28791),T=n(32559),A=n(79267),M=function(){var e=(0,r.useState)(!1),t=(0,p.Z)(e,2),n=t[0],o=t[1];return(0,P.Z)(function(){o((0,A.Z)())},[]),n},I=n(53346);function R(e){var t=e.prefixCls,n=e.upNode,o=e.downNode,i=e.upDisabled,l=e.downDisabled,s=e.onStep,c=r.useRef(),f=r.useRef([]),p=r.useRef();p.current=s;var h=function(){clearTimeout(c.current)},m=function(e,t){e.preventDefault(),h(),p.current(t),c.current=setTimeout(function e(){p.current(t),c.current=setTimeout(e,200)},600)};if(r.useEffect(function(){return function(){h(),f.current.forEach(function(e){return I.Z.cancel(e)})}},[]),M())return null;var g="".concat(t,"-handler"),v=u()(g,"".concat(g,"-up"),(0,d.Z)({},"".concat(g,"-up-disabled"),i)),y=u()(g,"".concat(g,"-down"),(0,d.Z)({},"".concat(g,"-down-disabled"),l)),b=function(){return f.current.push((0,I.Z)(h))},x={unselectable:"on",role:"button",onMouseUp:b,onMouseLeave:b};return r.createElement("div",{className:"".concat(g,"-wrap")},r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){m(e,!0)},"aria-label":"Increase Value","aria-disabled":i,className:v}),n||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){m(e,!1)},"aria-label":"Decrease Value","aria-disabled":l,className:y}),o||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function D(e){var t="number"==typeof e?k(e):b(e).fullStr;return t.includes(".")?b(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var L=n(55041),Z=function(){var e=(0,r.useRef)(0),t=function(){I.Z.cancel(e.current)};return(0,r.useEffect)(function(){return t},[]),function(n){t(),e.current=(0,I.Z)(function(){n()})}},z=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","wheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur"],B=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],F=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},H=function(e){var t=C(e);return t.isInvalidate()?null:t},q=r.forwardRef(function(e,t){var n,o,i,l=e.prefixCls,s=void 0===l?"rc-input-number":l,c=e.className,m=e.style,g=e.min,v=e.max,y=e.step,b=void 0===y?1:y,x=e.defaultValue,E=e.value,O=e.disabled,_=e.readOnly,A=e.upHandler,M=e.downHandler,I=e.keyboard,L=e.wheel,B=e.controls,q=(e.classNames,e.stringMode),W=e.parser,U=e.formatter,K=e.precision,$=e.decimalSeparator,V=e.onChange,X=e.onInput,G=e.onPressEnter,Y=e.onStep,Q=e.changeOnBlur,J=void 0===Q||Q,ee=(0,h.Z)(e,z),et="".concat(s,"-input"),en=r.useRef(null),er=r.useState(!1),eo=(0,p.Z)(er,2),ea=eo[0],ei=eo[1],el=r.useRef(!1),es=r.useRef(!1),ec=r.useRef(!1),eu=r.useState(function(){return C(null!=E?E:x)}),ed=(0,p.Z)(eu,2),ef=ed[0],ep=ed[1],eh=r.useCallback(function(e,t){return t?void 0:K>=0?K:Math.max(w(e),w(b))},[K,b]),em=r.useCallback(function(e){var t=String(e);if(W)return W(t);var n=t;return $&&(n=n.replace($,".")),n.replace(/[^\w.-]+/g,"")},[W,$]),eg=r.useRef(""),ev=r.useCallback(function(e,t){if(U)return U(e,{userTyping:t,input:String(eg.current)});var n="number"==typeof e?k(e):e;if(!t){var r=eh(n,t);S(n)&&($||r>=0)&&(n=j(n,$||".",r))}return n},[U,eh,$]),ey=r.useState(function(){var e=null!=x?x:E;return ef.isInvalidate()&&["string","number"].includes((0,f.Z)(e))?Number.isNaN(e)?"":e:ev(ef.toString(),!1)}),eb=(0,p.Z)(ey,2),ex=eb[0],ew=eb[1];function ek(e,t){ew(ev(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}eg.current=ex;var eS=r.useMemo(function(){return H(v)},[v,K]),eE=r.useMemo(function(){return H(g)},[g,K]),eO=r.useMemo(function(){return!(!eS||!ef||ef.isInvalidate())&&eS.lessEquals(ef)},[eS,ef]),eC=r.useMemo(function(){return!(!eE||!ef||ef.isInvalidate())&&ef.lessEquals(eE)},[eE,ef]),ej=(n=en.current,o=(0,r.useRef)(null),[function(){try{var e=n.selectionStart,t=n.selectionEnd,r=n.value,a=r.substring(0,e),i=r.substring(t);o.current={start:e,end:t,value:r,beforeTxt:a,afterTxt:i}}catch(e){}},function(){if(n&&o.current&&ea)try{var e=n.value,t=o.current,r=t.beforeTxt,a=t.afterTxt,i=t.start,l=e.length;if(e.endsWith(a))l=e.length-o.current.afterTxt.length;else if(e.startsWith(r))l=r.length;else{var s=r[i-1],c=e.indexOf(s,i-1);-1!==c&&(l=c+1)}n.setSelectionRange(l,l)}catch(e){(0,T.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),e_=(0,p.Z)(ej,2),eP=e_[0],eN=e_[1],eT=function(e){return eS&&!e.lessEquals(eS)?eS:eE&&!eE.lessEquals(e)?eE:null},eA=function(e){return!eT(e)},eM=function(e,t){var n=e,r=eA(n)||n.isEmpty();if(n.isEmpty()||t||(n=eT(n)||n,r=!0),!_&&!O&&r){var o,a=n.toString(),i=eh(a,t);return i>=0&&!eA(n=C(j(a,".",i)))&&(n=C(j(a,".",i,!0))),n.equals(ef)||(o=n,void 0===E&&ep(o),null==V||V(n.isEmpty()?null:F(q,n)),void 0===E&&ek(n,t)),n}return ef},eI=Z(),eR=function e(t){if(eP(),eg.current=t,ew(t),!es.current){var n=C(em(t));n.isNaN()||eM(n,!0)}null==X||X(t),eI(function(){var n=t;W||(n=t.replace(/。/g,".")),n!==t&&e(n)})},eD=function(e){if((!e||!eO)&&(e||!eC)){el.current=!1;var t,n=C(ec.current?D(b):b);e||(n=n.negate());var r=eM((ef||C(0)).add(n.toString()),!1);null==Y||Y(F(q,r),{offset:ec.current?D(b):b,type:e?"up":"down"}),null===(t=en.current)||void 0===t||t.focus()}},eL=function(e){var t=C(em(ex)),n=t;n=t.isNaN()?eM(ef,e):eM(t,e),void 0!==E?ek(ef,!1):n.isNaN()||ek(n,!1)};return r.useEffect(function(){var e=function(e){!1!==L&&(eD(e.deltaY<0),e.preventDefault())},t=en.current;if(t)return t.addEventListener("wheel",e),function(){return t.removeEventListener("wheel",e)}},[eD]),(0,P.o)(function(){ef.isInvalidate()||ek(ef,!1)},[K,U]),(0,P.o)(function(){var e=C(E);ep(e);var t=C(em(ex));e.equals(t)&&el.current&&!U||ek(e,el.current)},[E]),(0,P.o)(function(){U&&eN()},[ex]),r.createElement("div",{className:u()(s,c,(i={},(0,d.Z)(i,"".concat(s,"-focused"),ea),(0,d.Z)(i,"".concat(s,"-disabled"),O),(0,d.Z)(i,"".concat(s,"-readonly"),_),(0,d.Z)(i,"".concat(s,"-not-a-number"),ef.isNaN()),(0,d.Z)(i,"".concat(s,"-out-of-range"),!ef.isInvalidate()&&!eA(ef)),i)),style:m,onFocus:function(){ei(!0)},onBlur:function(){J&&eL(!1),ei(!1),el.current=!1},onKeyDown:function(e){var t=e.key,n=e.shiftKey;el.current=!0,ec.current=n,"Enter"===t&&(es.current||(el.current=!1),eL(!1),null==G||G(e)),!1!==I&&!es.current&&["Up","ArrowUp","Down","ArrowDown"].includes(t)&&(eD("Up"===t||"ArrowUp"===t),e.preventDefault())},onKeyUp:function(){el.current=!1,ec.current=!1},onCompositionStart:function(){es.current=!0},onCompositionEnd:function(){es.current=!1,eR(en.current.value)},onBeforeInput:function(){el.current=!0}},(void 0===B||B)&&r.createElement(R,{prefixCls:s,upNode:A,downNode:M,upDisabled:eO,downDisabled:eC,onStep:eD}),r.createElement("div",{className:"".concat(et,"-wrap")},r.createElement("input",(0,a.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":g,"aria-valuemax":v,"aria-valuenow":ef.isInvalidate()?null:ef.toString(),step:b},ee,{ref:(0,N.sQ)(en,t),className:et,value:ex,onChange:function(e){eR(e.target.value)},disabled:O,readOnly:_}))))}),W=r.forwardRef(function(e,t){var n=e.disabled,o=e.style,i=e.prefixCls,l=e.value,s=e.prefix,c=e.suffix,u=e.addonBefore,d=e.addonAfter,f=e.className,p=e.classNames,m=(0,h.Z)(e,B),g=r.useRef(null);return r.createElement(_.Q,{className:f,triggerFocus:function(e){g.current&&(0,L.nH)(g.current,e)},prefixCls:i,value:l,disabled:n,style:o,prefix:s,suffix:c,addonAfter:d,addonBefore:u,classNames:p,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}},r.createElement(q,(0,a.Z)({prefixCls:i,disabled:n,ref:(0,N.sQ)(g,t),className:null==p?void 0:p.input},m)))});W.displayName="InputNumber";var U=n(12757),K=n(71744),$=n(13959),V=n(86586),X=n(64024),G=n(33759),Y=n(39109),Q=n(56250),J=n(65658),ee=n(352),et=n(31282),en=n(37433),er=n(65265),eo=n(12918),ea=n(17691),ei=n(80669),el=n(3104),es=n(36360);let ec=(e,t)=>{let{componentCls:n,borderRadiusSM:r,borderRadiusLG:o}=e,a="lg"===t?o:r;return{["&-".concat(t)]:{["".concat(n,"-handler-wrap")]:{borderStartEndRadius:a,borderEndEndRadius:a},["".concat(n,"-handler-up")]:{borderStartEndRadius:a},["".concat(n,"-handler-down")]:{borderEndEndRadius:a}}}},eu=e=>{let{componentCls:t,lineWidth:n,lineType:r,borderRadius:o,fontSizeLG:a,controlHeightLG:i,controlHeightSM:l,colorError:s,paddingInlineSM:c,paddingBlockSM:u,paddingBlockLG:d,paddingInlineLG:f,colorTextDescription:p,motionDurationMid:h,handleHoverColor:m,paddingInline:g,paddingBlock:v,handleBg:y,handleActiveBg:b,colorTextDisabled:x,borderRadiusSM:w,borderRadiusLG:k,controlWidth:S,handleOpacity:E,handleBorderColor:O,filledHandleBg:C,lineHeightLG:j,calc:_}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.ik)(e)),{display:"inline-block",width:S,margin:0,padding:0,borderRadius:o}),(0,er.qG)(e,{["".concat(t,"-handler-wrap")]:{background:y,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O)}}})),(0,er.H8)(e,{["".concat(t,"-handler-wrap")]:{background:C,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O)}},"&:focus-within":{["".concat(t,"-handler-wrap")]:{background:y}}})),(0,er.Mu)(e)),{"&-rtl":{direction:"rtl",["".concat(t,"-input")]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:a,lineHeight:j,borderRadius:k,["input".concat(t,"-input")]:{height:_(i).sub(_(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(d)," ").concat((0,ee.bf)(f))}},"&-sm":{padding:0,borderRadius:w,["input".concat(t,"-input")]:{height:_(l).sub(_(n).mul(2)).equal(),padding:"".concat((0,ee.bf)(u)," ").concat((0,ee.bf)(c))}},"&-out-of-range":{["".concat(t,"-input-wrap")]:{input:{color:s}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),(0,et.s7)(e)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",["".concat(t,"-affix-wrapper")]:{width:"100%"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:k,fontSize:e.fontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:w}}},(0,er.ir)(e)),(0,er.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),["&-disabled ".concat(t,"-input")]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,eo.Wf)(e)),{width:"100%",padding:"".concat((0,ee.bf)(v)," ").concat((0,ee.bf)(g)),textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:"all ".concat(h," linear"),appearance:"textfield",fontSize:"inherit"}),(0,et.nz)(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[t]:Object.assign(Object.assign(Object.assign({["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{opacity:1},["".concat(t,"-handler-wrap")]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleWidth,height:"100%",borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,opacity:E,display:"flex",flexDirection:"column",alignItems:"stretch",transition:"opacity ".concat(h," linear ").concat(h),["".concat(t,"-handler")]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},["".concat(t,"-handler")]:{height:"50%",overflow:"hidden",color:p,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:"".concat((0,ee.bf)(n)," ").concat(r," ").concat(O),transition:"all ".concat(h," linear"),"&:active":{background:b},"&:hover":{height:"60%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{color:m}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,eo.Ro)()),{color:p,transition:"all ".concat(h," linear"),userSelect:"none"})},["".concat(t,"-handler-up")]:{borderStartEndRadius:o},["".concat(t,"-handler-down")]:{borderEndEndRadius:o}},ec(e,"lg")),ec(e,"sm")),{"&-disabled, &-readonly":{["".concat(t,"-handler-wrap")]:{display:"none"},["".concat(t,"-input")]:{color:"inherit"}},["\n ".concat(t,"-handler-up-disabled,\n ").concat(t,"-handler-down-disabled\n ")]:{cursor:"not-allowed"},["\n ".concat(t,"-handler-up-disabled:hover &-handler-up-inner,\n ").concat(t,"-handler-down-disabled:hover &-handler-down-inner\n ")]:{color:x}})}]},ed=e=>{let{componentCls:t,paddingBlock:n,paddingInline:r,inputAffixPadding:o,controlWidth:a,borderRadiusLG:i,borderRadiusSM:l,paddingInlineLG:s,paddingInlineSM:c,paddingBlockLG:u,paddingBlockSM:d}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign({["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(n)," 0")}},(0,et.ik)(e)),{position:"relative",display:"inline-flex",width:a,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:i,paddingInlineStart:s,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(u)," 0")}},"&-sm":{borderRadius:l,paddingInlineStart:c,["input".concat(t,"-input")]:{padding:"".concat((0,ee.bf)(d)," 0")}},["&:not(".concat(t,"-disabled):hover")]:{zIndex:1},"&-focused, &:focus":{zIndex:1},["&-disabled > ".concat(t,"-disabled")]:{background:"transparent"},["> div".concat(t)]:{width:"100%",border:"none",outline:"none",["&".concat(t,"-focused")]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t,"-handler-wrap")]:{zIndex:2},[t]:{color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:r,marginInlineStart:o}}})}};var ef=(0,ei.I$)("InputNumber",e=>{let t=(0,el.TS)(e,(0,en.e)(e));return[eu(t),ed(t),(0,ea.c)(t)]},e=>{var t;let n=null!==(t=e.handleVisible)&&void 0!==t?t:"auto";return Object.assign(Object.assign({},(0,en.T)(e)),{controlWidth:90,handleWidth:e.controlHeightSM-2*e.lineWidth,handleFontSize:e.fontSize/2,handleVisible:n,handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,filledHandleBg:new es.C(e.colorFillSecondary).onBackground(e.colorBgContainer).toHexString(),handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder,handleOpacity:!0===n?1:0})},{unitless:{handleOpacity:!0}}),ep=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eh=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a}=r.useContext(K.E_),i=r.useRef(null);r.useImperativeHandle(t,()=>i.current);let{className:l,rootClassName:c,size:d,disabled:f,prefixCls:p,addonBefore:h,addonAfter:m,prefix:g,bordered:v,readOnly:y,status:b,controls:x,variant:w}=e,k=ep(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls","variant"]),S=n("input-number",p),E=(0,X.Z)(S),[O,C,j]=ef(S,E),{compactSize:_,compactItemClassnames:P}=(0,J.ri)(S,a),N=r.createElement(s,{className:"".concat(S,"-handler-up-inner")}),T=r.createElement(o.Z,{className:"".concat(S,"-handler-down-inner")});"object"==typeof x&&(N=void 0===x.upIcon?N:r.createElement("span",{className:"".concat(S,"-handler-up-inner")},x.upIcon),T=void 0===x.downIcon?T:r.createElement("span",{className:"".concat(S,"-handler-down-inner")},x.downIcon));let{hasFeedback:A,status:M,isFormItemInput:I,feedbackIcon:R}=r.useContext(Y.aM),D=(0,U.F)(M,b),L=(0,G.Z)(e=>{var t;return null!==(t=null!=d?d:_)&&void 0!==t?t:e}),Z=r.useContext(V.Z),[z,B]=(0,Q.Z)(w,v),F=A&&r.createElement(r.Fragment,null,R),H=u()({["".concat(S,"-lg")]:"large"===L,["".concat(S,"-sm")]:"small"===L,["".concat(S,"-rtl")]:"rtl"===a,["".concat(S,"-in-form-item")]:I},C),q="".concat(S,"-group");return O(r.createElement(W,Object.assign({ref:i,disabled:null!=f?f:Z,className:u()(j,E,l,c,P),upHandler:N,downHandler:T,prefixCls:S,readOnly:y,controls:"boolean"==typeof x?x:void 0,prefix:g,suffix:F,addonAfter:m&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},m)),addonBefore:h&&r.createElement(J.BR,null,r.createElement(Y.Ux,{override:!0,status:!0},h)),classNames:{input:H,variant:u()({["".concat(S,"-").concat(z)]:B},(0,U.Z)(S,D,A)),affixWrapper:u()({["".concat(S,"-affix-wrapper-sm")]:"small"===L,["".concat(S,"-affix-wrapper-lg")]:"large"===L,["".concat(S,"-affix-wrapper-rtl")]:"rtl"===a},C),wrapper:u()({["".concat(q,"-rtl")]:"rtl"===a},C),groupWrapper:u()({["".concat(S,"-group-wrapper-sm")]:"small"===L,["".concat(S,"-group-wrapper-lg")]:"large"===L,["".concat(S,"-group-wrapper-rtl")]:"rtl"===a,["".concat(S,"-group-wrapper-").concat(z)]:B},(0,U.Z)("".concat(S,"-group-wrapper"),D,A),C)}},k)))});eh._InternalPanelDoNotUseOrYouWillBeFired=e=>r.createElement($.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},r.createElement(eh,Object.assign({},e)));var em=eh},65863:function(e,t,n){"use strict";n.d(t,{Z:function(){return k},n:function(){return w}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2027),l=n(28791),s=n(12757),c=n(71744),u=n(86586),d=n(33759),f=n(39109),p=n(65658),h=n(39164),m=n(31282),g=n(64024),v=n(56250),y=n(39725),b=e=>{let t;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?t=e:e&&(t={clearIcon:r.createElement(y.Z,null)}),t},x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function w(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n){let t=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var k=(0,r.forwardRef)((e,t)=>{var n;let{prefixCls:o,bordered:y=!0,status:w,size:k,disabled:S,onBlur:E,onFocus:O,suffix:C,allowClear:j,addonAfter:_,addonBefore:P,className:N,style:T,styles:A,rootClassName:M,onChange:I,classNames:R,variant:D}=e,L=x(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:Z,direction:z,input:B}=r.useContext(c.E_),F=Z("input",o),H=(0,r.useRef)(null),q=(0,g.Z)(F),[W,U,K]=(0,m.ZP)(F,q),{compactSize:$,compactItemClassnames:V}=(0,p.ri)(F,z),X=(0,d.Z)(e=>{var t;return null!==(t=null!=k?k:$)&&void 0!==t?t:e}),G=r.useContext(u.Z),{status:Y,hasFeedback:Q,feedbackIcon:J}=(0,r.useContext)(f.aM),ee=(0,s.F)(Y,w),et=!!(e.prefix||e.suffix||e.allowClear||e.showCount)||!!Q;(0,r.useRef)(et);let en=(0,h.Z)(H,!0),er=(Q||C)&&r.createElement(r.Fragment,null,C,Q&&J),eo=b(j),[ea,ei]=(0,v.Z)(D,y);return W(r.createElement(i.Z,Object.assign({ref:(0,l.sQ)(t,H),prefixCls:F,autoComplete:null==B?void 0:B.autoComplete},L,{disabled:null!=S?S:G,onBlur:e=>{en(),null==E||E(e)},onFocus:e=>{en(),null==O||O(e)},style:Object.assign(Object.assign({},null==B?void 0:B.style),T),styles:Object.assign(Object.assign({},null==B?void 0:B.styles),A),suffix:er,allowClear:eo,className:a()(N,M,K,q,V,null==B?void 0:B.className),onChange:e=>{en(),null==I||I(e)},addonAfter:_&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},_)),addonBefore:P&&r.createElement(p.BR,null,r.createElement(f.Ux,{override:!0,status:!0},P)),classNames:Object.assign(Object.assign(Object.assign({},R),null==B?void 0:B.classNames),{input:a()({["".concat(F,"-sm")]:"small"===X,["".concat(F,"-lg")]:"large"===X,["".concat(F,"-rtl")]:"rtl"===z},null==R?void 0:R.input,null===(n=null==B?void 0:B.classNames)||void 0===n?void 0:n.input,U),variant:a()({["".concat(F,"-").concat(ea)]:ei},(0,s.Z)(F,ee)),affixWrapper:a()({["".concat(F,"-affix-wrapper-sm")]:"small"===X,["".concat(F,"-affix-wrapper-lg")]:"large"===X,["".concat(F,"-affix-wrapper-rtl")]:"rtl"===z},U),wrapper:a()({["".concat(F,"-group-rtl")]:"rtl"===z},U),groupWrapper:a()({["".concat(F,"-group-wrapper-sm")]:"small"===X,["".concat(F,"-group-wrapper-lg")]:"large"===X,["".concat(F,"-group-wrapper-rtl")]:"rtl"===z,["".concat(F,"-group-wrapper-").concat(ea)]:ei},(0,s.Z)("".concat(F,"-group-wrapper"),ee,Q),U)})})))})},90464:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r,o=n(2265),a=n(39725),i=n(36760),l=n.n(i),s=n(1119),c=n(11993),u=n(31686),d=n(83145),f=n(26365),p=n(6989),h=n(2027),m=n(96032),g=n(55041),v=n(50506),y=n(41154),b=n(31474),x=n(27380),w=n(53346),k=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],S={},E=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],O=o.forwardRef(function(e,t){var n=e.prefixCls,a=(e.onPressEnter,e.defaultValue),i=e.value,d=e.autoSize,h=e.onResize,m=e.className,g=e.style,O=e.disabled,C=e.onChange,j=(e.onInternalAutoSize,(0,p.Z)(e,E)),_=(0,v.Z)(a,{value:i,postState:function(e){return null!=e?e:""}}),P=(0,f.Z)(_,2),N=P[0],T=P[1],A=o.useRef();o.useImperativeHandle(t,function(){return{textArea:A.current}});var M=o.useMemo(function(){return d&&"object"===(0,y.Z)(d)?[d.minRows,d.maxRows]:[]},[d]),I=(0,f.Z)(M,2),R=I[0],D=I[1],L=!!d,Z=function(){try{if(document.activeElement===A.current){var e=A.current,t=e.selectionStart,n=e.selectionEnd,r=e.scrollTop;A.current.setSelectionRange(t,n),A.current.scrollTop=r}}catch(e){}},z=o.useState(2),B=(0,f.Z)(z,2),F=B[0],H=B[1],q=o.useState(),W=(0,f.Z)(q,2),U=W[0],K=W[1],$=function(){H(0)};(0,x.Z)(function(){L&&$()},[i,R,D,L]),(0,x.Z)(function(){if(0===F)H(1);else if(1===F){var e=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&S[n])return S[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),i=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l={sizingStyle:k.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),paddingSize:a,borderSize:i,boxSizing:o};return t&&n&&(S[n]=l),l}(e,n),l=i.paddingSize,s=i.borderSize,c=i.boxSizing,u=i.sizingStyle;r.setAttribute("style","".concat(u,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=e.value||e.placeholder||"";var d=void 0,f=void 0,p=r.scrollHeight;if("border-box"===c?p+=s:"content-box"===c&&(p-=l),null!==o||null!==a){r.value=" ";var h=r.scrollHeight-l;null!==o&&(d=h*o,"border-box"===c&&(d=d+l+s),p=Math.max(d,p)),null!==a&&(f=h*a,"border-box"===c&&(f=f+l+s),t=p>f?"":"hidden",p=Math.min(f,p))}var m={height:p,overflowY:t,resize:"none"};return d&&(m.minHeight=d),f&&(m.maxHeight=f),m}(A.current,!1,R,D);H(2),K(e)}else Z()},[F]);var V=o.useRef(),X=function(){w.Z.cancel(V.current)};o.useEffect(function(){return X},[]);var G=(0,u.Z)((0,u.Z)({},g),L?U:null);return(0===F||1===F)&&(G.overflowY="hidden",G.overflowX="hidden"),o.createElement(b.Z,{onResize:function(e){2===F&&(null==h||h(e),d&&(X(),V.current=(0,w.Z)(function(){$()})))},disabled:!(d||h)},o.createElement("textarea",(0,s.Z)({},j,{ref:A,style:G,className:l()(n,m,(0,c.Z)({},"".concat(n,"-disabled"),O)),disabled:O,value:N,onChange:function(e){T(e.target.value),null==C||C(e)}})))}),C=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize"],j=o.forwardRef(function(e,t){var n,r,a,i=e.defaultValue,y=e.value,b=e.onFocus,x=e.onBlur,w=e.onChange,k=e.allowClear,S=e.maxLength,E=e.onCompositionStart,j=e.onCompositionEnd,_=e.suffix,P=e.prefixCls,N=void 0===P?"rc-textarea":P,T=e.showCount,A=e.count,M=e.className,I=e.style,R=e.disabled,D=e.hidden,L=e.classNames,Z=e.styles,z=e.onResize,B=(0,p.Z)(e,C),F=(0,v.Z)(i,{value:y,defaultValue:i}),H=(0,f.Z)(F,2),q=H[0],W=H[1],U=null==q?"":String(q),K=o.useState(!1),$=(0,f.Z)(K,2),V=$[0],X=$[1],G=o.useRef(!1),Y=o.useState(null),Q=(0,f.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,o.useRef)(null),en=function(){var e;return null===(e=et.current)||void 0===e?void 0:e.textArea},er=function(){en().focus()};(0,o.useImperativeHandle)(t,function(){return{resizableTextArea:et.current,focus:er,blur:function(){en().blur()}}}),(0,o.useEffect)(function(){X(function(e){return!R&&e})},[R]);var eo=o.useState(null),ea=(0,f.Z)(eo,2),ei=ea[0],el=ea[1];o.useEffect(function(){if(ei){var e;(e=en()).setSelectionRange.apply(e,(0,d.Z)(ei))}},[ei]);var es=(0,m.Z)(A,T),ec=null!==(n=es.max)&&void 0!==n?n:S,eu=Number(ec)>0,ed=es.strategy(U),ef=!!ec&&ed>ec,ep=function(e,t){var n=t;!G.current&&es.exceedFormatter&&es.max&&es.strategy(t)>es.max&&(n=es.exceedFormatter(t,{max:es.max}),t!==n&&el([en().selectionStart||0,en().selectionEnd||0])),W(n),(0,g.rJ)(e.currentTarget,e,w,n)},eh=_;es.show&&(a=es.showFormatter?es.showFormatter({value:U,count:ed,maxLength:ec}):"".concat(ed).concat(eu?" / ".concat(ec):""),eh=o.createElement(o.Fragment,null,eh,o.createElement("span",{className:l()("".concat(N,"-data-count"),null==L?void 0:L.count),style:null==Z?void 0:Z.count},a)));var em=!B.autoSize&&!T&&!k;return o.createElement(h.Q,{value:U,allowClear:k,handleReset:function(e){W(""),er(),(0,g.rJ)(en(),e,w)},suffix:eh,prefixCls:N,classNames:(0,u.Z)((0,u.Z)({},L),{},{affixWrapper:l()(null==L?void 0:L.affixWrapper,(r={},(0,c.Z)(r,"".concat(N,"-show-count"),T),(0,c.Z)(r,"".concat(N,"-textarea-allow-clear"),k),r))}),disabled:R,focused:V,className:l()(M,ef&&"".concat(N,"-out-of-range")),style:(0,u.Z)((0,u.Z)({},I),J&&!em?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof a?a:void 0}},hidden:D},o.createElement(O,(0,s.Z)({},B,{maxLength:S,onKeyDown:function(e){var t=B.onPressEnter,n=B.onKeyDown;"Enter"===e.key&&t&&t(e),null==n||n(e)},onChange:function(e){ep(e,e.target.value)},onFocus:function(e){X(!0),null==b||b(e)},onBlur:function(e){X(!1),null==x||x(e)},onCompositionStart:function(e){G.current=!0,null==E||E(e)},onCompositionEnd:function(e){G.current=!1,ep(e,e.currentTarget.value),null==j||j(e)},className:l()(null==L?void 0:L.textarea),style:(0,u.Z)((0,u.Z)({},null==Z?void 0:Z.textarea),{},{resize:null==I?void 0:I.resize}),disabled:R,prefixCls:N,onResize:function(e){var t;null==z||z(e),null!==(t=en())&&void 0!==t&&t.style.height&&ee(!0)},ref:et})))}),_=n(12757),P=n(71744),N=n(86586),T=n(33759),A=n(39109),M=n(65863),I=n(31282),R=n(64024),D=n(56250),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Z=(0,o.forwardRef)((e,t)=>{var n;let r;let{prefixCls:i,bordered:s=!0,size:c,disabled:u,status:d,allowClear:f,classNames:p,rootClassName:h,className:m,variant:g}=e,v=L(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","variant"]),{getPrefixCls:y,direction:b}=o.useContext(P.E_),x=(0,T.Z)(c),w=o.useContext(N.Z),{status:k,hasFeedback:S,feedbackIcon:E}=o.useContext(A.aM),O=(0,_.F)(k,d),C=o.useRef(null);o.useImperativeHandle(t,()=>{var e;return{resizableTextArea:null===(e=C.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;(0,M.n)(null===(n=null===(t=C.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.blur()}}});let Z=y("input",i);"object"==typeof f&&(null==f?void 0:f.clearIcon)?r=f:f&&(r={clearIcon:o.createElement(a.Z,null)});let z=(0,R.Z)(Z),[B,F,H]=(0,I.ZP)(Z,z),[q,W]=(0,D.Z)(g,s);return B(o.createElement(j,Object.assign({},v,{disabled:null!=u?u:w,allowClear:r,className:l()(H,z,m,h),classNames:Object.assign(Object.assign({},p),{textarea:l()({["".concat(Z,"-sm")]:"small"===x,["".concat(Z,"-lg")]:"large"===x},F,null==p?void 0:p.textarea),variant:l()({["".concat(Z,"-").concat(q)]:W},(0,_.Z)(Z,O)),affixWrapper:l()("".concat(Z,"-textarea-affix-wrapper"),{["".concat(Z,"-affix-wrapper-rtl")]:"rtl"===b,["".concat(Z,"-affix-wrapper-sm")]:"small"===x,["".concat(Z,"-affix-wrapper-lg")]:"large"===x,["".concat(Z,"-textarea-show-count")]:e.showCount||(null===(n=e.count)||void 0===n?void 0:n.show)},F)}),prefixCls:Z,suffix:S&&o.createElement("span",{className:"".concat(Z,"-textarea-suffix")},E),ref:C})))})},39164:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e,t){let n=(0,r.useRef)([]),o=()=>{n.current.push(setTimeout(()=>{var t,n,r,o;(null===(t=e.current)||void 0===t?void 0:t.input)&&(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))==="password"&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(o=e.current)||void 0===o||o.input.removeAttribute("value"))}))};return(0,r.useEffect)(()=>(t&&o(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),o}},64482:function(e,t,n){"use strict";n.d(t,{default:function(){return _}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),l=n(39109),s=n(31282),c=n(65863),u=n(97416),d=n(6520),f=n(18694),p=n(28791),h=n(39164),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let g=e=>e?r.createElement(d.Z,null):r.createElement(u.Z,null),v={click:"onClick",hover:"onMouseOver"},y=r.forwardRef((e,t)=>{let{visibilityToggle:n=!0}=e,o="object"==typeof n&&void 0!==n.visible,[l,s]=(0,r.useState)(()=>!!o&&n.visible),u=(0,r.useRef)(null);r.useEffect(()=>{o&&s(n.visible)},[o,n]);let d=(0,h.Z)(u),y=()=>{let{disabled:t}=e;t||(l&&d(),s(e=>{var t;let r=!e;return"object"==typeof n&&(null===(t=n.onVisibleChange)||void 0===t||t.call(n,r)),r}))},{className:b,prefixCls:x,inputPrefixCls:w,size:k}=e,S=m(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:E}=r.useContext(i.E_),O=E("input",w),C=E("input-password",x),j=n&&(t=>{let{action:n="click",iconRender:o=g}=e,a=v[n]||"",i=o(l);return r.cloneElement(r.isValidElement(i)?i:r.createElement("span",null,i),{[a]:y,className:"".concat(t,"-icon"),key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}})})(C),_=a()(C,b,{["".concat(C,"-").concat(k)]:!!k}),P=Object.assign(Object.assign({},(0,f.Z)(S,["suffix","iconRender","visibilityToggle"])),{type:l?"text":"password",className:_,prefixCls:O,suffix:j});return k&&(P.size=k),r.createElement(c.Z,Object.assign({ref:(0,p.sQ)(t,u)},P))});var b=n(29436),x=n(19722),w=n(73002),k=n(33759),S=n(65658),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O=r.forwardRef((e,t)=>{let n;let{prefixCls:o,inputPrefixCls:l,className:s,size:u,suffix:d,enterButton:f=!1,addonAfter:h,loading:m,disabled:g,onSearch:v,onChange:y,onCompositionStart:O,onCompositionEnd:C}=e,j=E(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:_,direction:P}=r.useContext(i.E_),N=r.useRef(!1),T=_("input-search",o),A=_("input",l),{compactSize:M}=(0,S.ri)(T,P),I=(0,k.Z)(e=>{var t;return null!==(t=null!=u?u:M)&&void 0!==t?t:e}),R=r.useRef(null),D=e=>{var t;document.activeElement===(null===(t=R.current)||void 0===t?void 0:t.input)&&e.preventDefault()},L=e=>{var t,n;v&&v(null===(n=null===(t=R.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},Z="boolean"==typeof f?r.createElement(b.Z,null):null,z="".concat(T,"-button"),B=f||{},F=B.type&&!0===B.type.__ANT_BUTTON;n=F||"button"===B.type?(0,x.Tm)(B,Object.assign({onMouseDown:D,onClick:e=>{var t,n;null===(n=null===(t=null==B?void 0:B.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),L(e)},key:"enterButton"},F?{className:z,size:I}:{})):r.createElement(w.ZP,{className:z,type:f?"primary":void 0,size:I,disabled:g,key:"enterButton",onMouseDown:D,onClick:L,loading:m,icon:Z},f),h&&(n=[n,(0,x.Tm)(h,{key:"addonAfter"})]);let H=a()(T,{["".concat(T,"-rtl")]:"rtl"===P,["".concat(T,"-").concat(I)]:!!I,["".concat(T,"-with-button")]:!!f},s);return r.createElement(c.Z,Object.assign({ref:(0,p.sQ)(R,t),onPressEnter:e=>{N.current||m||L(e)}},j,{size:I,onCompositionStart:e=>{N.current=!0,null==O||O(e)},onCompositionEnd:e=>{N.current=!1,null==C||C(e)},prefixCls:A,addonAfter:n,suffix:d,onChange:e=>{e&&e.target&&"click"===e.type&&v&&v(e.target.value,e,{source:"clear"}),y&&y(e)},className:H,disabled:g}))});var C=n(90464);let j=c.Z;j.Group=e=>{let{getPrefixCls:t,direction:n}=(0,r.useContext)(i.E_),{prefixCls:o,className:c}=e,u=t("input-group",o),d=t("input"),[f,p]=(0,s.ZP)(d),h=a()(u,{["".concat(u,"-lg")]:"large"===e.size,["".concat(u,"-sm")]:"small"===e.size,["".concat(u,"-compact")]:e.compact,["".concat(u,"-rtl")]:"rtl"===n},p,c),m=(0,r.useContext)(l.aM),g=(0,r.useMemo)(()=>Object.assign(Object.assign({},m),{isFormItemInput:!1}),[m]);return f(r.createElement("span",{className:h,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},r.createElement(l.aM.Provider,{value:g},e.children)))},j.Search=O,j.TextArea=C.Z,j.Password=y;var _=j},31282:function(e,t,n){"use strict";n.d(t,{ik:function(){return p},nz:function(){return u},s7:function(){return h},x0:function(){return f}});var r=n(352),o=n(12918),a=n(17691),i=n(80669),l=n(3104),s=n(37433),c=n(65265);let u=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=e=>{let{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:a}=e;return{padding:"".concat((0,r.bf)(t)," ").concat((0,r.bf)(a)),fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:o}},f=e=>({padding:"".concat((0,r.bf)(e.paddingBlockSM)," ").concat((0,r.bf)(e.paddingInlineSM)),fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),p=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:"".concat((0,r.bf)(e.paddingBlock)," ").concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationMid)},u(e.colorTextPlaceholder)),{"textarea&":{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:"all ".concat(e.motionDurationSlow,", height 0s"),resize:"vertical"},"&-lg":Object.assign({},d(e)),"&-sm":Object.assign({},f(e)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),h=e=>{let{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},["&-lg ".concat(t,", &-lg > ").concat(t,"-group-addon")]:Object.assign({},d(e)),["&-sm ".concat(t,", &-sm > ").concat(t,"-group-addon")]:Object.assign({},f(e)),["&-lg ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightLG},["&-sm ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightSM},["> ".concat(t)]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},["".concat(t,"-group")]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:"0 ".concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationSlow),lineHeight:1,["".concat(n,"-select")]:{margin:"".concat((0,r.bf)(e.calc(e.paddingBlock).add(1).mul(-1).equal())," ").concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),["&".concat(n,"-select-single:not(").concat(n,"-select-customize-input):not(").concat(n,"-pagination-size-changer)")]:{["".concat(n,"-select-selector")]:{backgroundColor:"inherit",border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),boxShadow:"none"}},"&-open, &-focused":{["".concat(n,"-select-selector")]:{color:e.colorPrimary}}},["".concat(n,"-cascader-picker")]:{margin:"-9px ".concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),backgroundColor:"transparent",["".concat(n,"-cascader-input")]:{textAlign:"start",border:0,boxShadow:"none"}}}},["".concat(t)]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,["".concat(t,"-search-with-button &")]:{zIndex:0}}},["> ".concat(t,":first-child, ").concat(t,"-group-addon:first-child")]:{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,"-affix-wrapper")]:{["&:not(:first-child) ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0},["&:not(:last-child) ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,":last-child, ").concat(t,"-group-addon:last-child")]:{borderStartStartRadius:0,borderEndStartRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["".concat(t,"-affix-wrapper")]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(t,"-search &")]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},["&:not(:first-child), ".concat(t,"-search &:not(:first-child)")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&".concat(t,"-group-compact")]:Object.assign(Object.assign({display:"block"},(0,o.dF)()),{["".concat(t,"-group-addon, ").concat(t,"-group-wrap, > ").concat(t)]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},["\n & > ".concat(t,"-affix-wrapper,\n & > ").concat(t,"-number-affix-wrapper,\n & > ").concat(n,"-picker-range\n ")]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},["".concat(t)]:{float:"none"},["& > ".concat(n,"-select > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete ").concat(t,",\n & > ").concat(n,"-cascader-picker ").concat(t,",\n & > ").concat(t,"-group-wrapper ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},["& > ".concat(n,"-select-focused")]:{zIndex:1},["& > ".concat(n,"-select > ").concat(n,"-select-arrow")]:{zIndex:1},["& > *:first-child,\n & > ".concat(n,"-select:first-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete:first-child ").concat(t,",\n & > ").concat(n,"-cascader-picker:first-child ").concat(t)]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},["& > *:last-child,\n & > ".concat(n,"-select:last-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-cascader-picker:last-child ").concat(t,",\n & > ").concat(n,"-cascader-picker-focused:last-child ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},["& > ".concat(n,"-select-auto-complete ").concat(t)]:{verticalAlign:"top"},["".concat(t,"-group-wrapper + ").concat(t,"-group-wrapper")]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),["".concat(t,"-affix-wrapper")]:{borderRadius:0}},["".concat(t,"-group-wrapper:not(:last-child)")]:{["&".concat(t,"-search > ").concat(t,"-group")]:{["& > ".concat(t,"-group-addon > ").concat(t,"-search-button")]:{borderRadius:0},["& > ".concat(t)]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},m=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:a}=e,i=a(n).sub(a(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),p(e)),(0,c.qG)(e)),(0,c.H8)(e)),(0,c.Mu)(e)),{'&[type="color"]':{height:e.controlHeight,["&".concat(t,"-lg")]:{height:e.controlHeightLG},["&".concat(t,"-sm")]:{height:n,paddingTop:i,paddingBottom:i}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},g=e=>{let{componentCls:t}=e;return{["".concat(t,"-clear-icon")]:{margin:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:hover":{color:e.colorTextTertiary},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:"0 ".concat((0,r.bf)(e.inputAffixPadding))}}}},v=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:a,colorIconHover:i,iconCls:l}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign(Object.assign(Object.assign({},p(e)),{display:"inline-flex",["&:not(".concat(t,"-disabled):hover")]:{zIndex:1,["".concat(t,"-search-with-button &")]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},["> input".concat(t)]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t)]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),g(e)),{["".concat(l).concat(t,"-password-icon")]:{color:a,cursor:"pointer",transition:"all ".concat(o),"&:hover":{color:i}}})}},y=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{["".concat(t,"-group")]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),h(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:r}}},(0,c.ir)(e)),(0,c.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},b=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-search");return{[r]:{["".concat(t)]:{"&:hover, &:focus":{borderColor:e.colorPrimaryHover,["+ ".concat(t,"-group-addon ").concat(r,"-button:not(").concat(n,"-btn-primary)")]:{borderInlineStartColor:e.colorPrimaryHover}}},["".concat(t,"-affix-wrapper")]:{borderRadius:0},["".concat(t,"-lg")]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal({unit:!1})},["> ".concat(t,"-group")]:{["> ".concat(t,"-group-addon:last-child")]:{insetInlineStart:-1,padding:0,border:0,["".concat(r,"-button")]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius,borderEndStartRadius:0,boxShadow:"none"},["".concat(r,"-button:not(").concat(n,"-btn-primary)")]:{color:e.colorTextDescription,"&:hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},["&".concat(n,"-btn-loading::before")]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},["".concat(r,"-button")]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},["&-large ".concat(r,"-button")]:{height:e.controlHeightLG},["&-small ".concat(r,"-button")]:{height:e.controlHeightSM},"&-rtl":{direction:"rtl"},["&".concat(t,"-compact-item")]:{["&:not(".concat(t,"-compact-last-item)")]:{["".concat(t,"-group-addon")]:{["".concat(t,"-search-button")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},["&:not(".concat(t,"-compact-first-item)")]:{["".concat(t,",").concat(t,"-affix-wrapper")]:{borderRadius:0}},["> ".concat(t,"-group-addon ").concat(t,"-search-button,\n > ").concat(t,",\n ").concat(t,"-affix-wrapper")]:{"&:hover,&:focus,&:active":{zIndex:2}},["> ".concat(t,"-affix-wrapper-focused")]:{zIndex:2}}}}},x=e=>{let{componentCls:t,paddingLG:n}=e,r="".concat(t,"-textarea");return{[r]:{position:"relative","&-show-count":{["> ".concat(t)]:{height:"100%"},["".concat(t,"-data-count")]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{["> ".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(r,"-has-feedback")]:{["".concat(t)]:{paddingInlineEnd:n}},["&-affix-wrapper".concat(t,"-affix-wrapper")]:{padding:0,["> textarea".concat(t)]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent","&:focus":{boxShadow:"none !important"}},["".concat(t,"-suffix")]:{margin:0,"> *:not(:last-child)":{marginInline:0},["".concat(t,"-clear-icon")]:{position:"absolute",insetInlineEnd:e.paddingXS,insetBlockStart:e.paddingXS},["".concat(r,"-suffix")]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}},w=e=>{let{componentCls:t}=e;return{["".concat(t,"-out-of-range")]:{["&, & input, & textarea, ".concat(t,"-show-count-suffix, ").concat(t,"-data-count")]:{color:e.colorError}}}};t.ZP=(0,i.I$)("Input",e=>{let t=(0,l.TS)(e,(0,s.e)(e));return[m(t),x(t),v(t),y(t),b(t),w(t),(0,a.c)(t)]},s.T)},37433:function(e,t,n){"use strict";n.d(t,{T:function(){return a},e:function(){return o}});var r=n(3104);function o(e){return(0,r.TS)(e,{inputAffixPadding:e.paddingXXS})}let a=e=>{let{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:a,controlHeightLG:i,fontSizeLG:l,lineHeightLG:s,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:h,controlOutlineWidth:m,controlOutline:g,colorErrorOutline:v,colorWarningOutline:y,colorBgContainer:b}=e;return{paddingBlock:Math.max(Math.round((t-n*r)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((a-n*r)/2*10)/10-o,0),paddingBlockLG:Math.ceil((i-l*s)/2*10)/10-o,paddingInline:c-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:f,activeBorderColor:h,hoverBorderColor:p,activeShadow:"0 0 0 ".concat(m,"px ").concat(g),errorActiveShadow:"0 0 0 ".concat(m,"px ").concat(v),warningActiveShadow:"0 0 0 ".concat(m,"px ").concat(y),hoverBg:b,activeBg:b,inputFontSize:n,inputFontSizeLG:l,inputFontSizeSM:n}}},65265:function(e,t,n){"use strict";n.d(t,{$U:function(){return l},H8:function(){return m},Mu:function(){return f},S5:function(){return v},Xy:function(){return i},ir:function(){return d},qG:function(){return c}});var r=n(352),o=n(3104);let a=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),i=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover:not([disabled])":Object.assign({},a((0,o.TS)(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),l=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),s=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},l(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),c=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},l(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),s(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),s(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),u=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),d=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.addonBg,border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},u(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),u(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group-addon")]:Object.assign({},i(e))}})}),f=(e,t)=>({"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},["&".concat(e.componentCls,"-disabled, &[disabled]")]:{color:e.colorTextDisabled}},t)}),p=(e,t)=>({background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null==t?void 0:t.inputColor},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}),h=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},p(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),m=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.colorPrimary})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),h(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),h(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),g=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{background:t.addonBg,color:t.addonColor}}}),v=e=>({"&-filled":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary},["".concat(e.componentCls,"-filled:not(:focus):not(:focus-within)")]:{"&:not(:first-child)":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)},"&:not(:last-child)":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}}}},g(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),g(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:last-child":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)}}}})})},19226:function(e,t,n){"use strict";n.d(t,{default:function(){return O}});var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),l=n(18694),s=n(71744),c=n(80856),u=n(45287),d=n(92239),f=n(352),p=n(80669),h=e=>{let{componentCls:t,bodyBg:n,lightSiderBg:r,lightTriggerBg:o,lightTriggerColor:a}=e;return{["".concat(t,"-sider-light")]:{background:r,["".concat(t,"-sider-trigger")]:{color:a,background:o},["".concat(t,"-sider-zero-width-trigger")]:{color:a,background:o,border:"1px solid ".concat(n),borderInlineStart:0}}}};let m=e=>{let{antCls:t,componentCls:n,colorText:r,triggerColor:o,footerBg:a,triggerBg:i,headerHeight:l,headerPadding:s,headerColor:c,footerPadding:u,triggerHeight:d,zeroTriggerHeight:p,zeroTriggerWidth:m,motionDurationMid:g,motionDurationSlow:v,fontSize:y,borderRadius:b,bodyBg:x,headerBg:w,siderBg:k}=e;return{[n]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:x,"&, *":{boxSizing:"border-box"},["&".concat(n,"-has-sider")]:{flexDirection:"row",["> ".concat(n,", > ").concat(n,"-content")]:{width:0}},["".concat(n,"-header, &").concat(n,"-footer")]:{flex:"0 0 auto"},["".concat(n,"-sider")]:{position:"relative",minWidth:0,background:k,transition:"all ".concat(g,", background 0s"),"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,["".concat(t,"-menu").concat(t,"-menu-inline-collapsed")]:{width:"auto"}},"&-has-trigger":{paddingBottom:d},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:d,color:o,lineHeight:(0,f.bf)(d),textAlign:"center",background:i,cursor:"pointer",transition:"all ".concat(g)},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:l,insetInlineEnd:e.calc(m).mul(-1).equal(),zIndex:1,width:m,height:p,color:o,fontSize:e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:k,borderStartStartRadius:0,borderStartEndRadius:b,borderEndEndRadius:b,borderEndStartRadius:0,cursor:"pointer",transition:"background ".concat(v," ease"),"&::after":{position:"absolute",inset:0,background:"transparent",transition:"all ".concat(v),content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:e.calc(m).mul(-1).equal(),borderStartStartRadius:b,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:b}}}}},h(e)),{"&-rtl":{direction:"rtl"}}),["".concat(n,"-header")]:{height:l,padding:s,color:c,lineHeight:(0,f.bf)(l),background:w,["".concat(t,"-menu")]:{lineHeight:"inherit"}},["".concat(n,"-footer")]:{padding:u,color:r,fontSize:y,background:a},["".concat(n,"-content")]:{flex:"auto",minHeight:0}}};var g=(0,p.I$)("Layout",e=>[m(e)],e=>{let{colorBgLayout:t,controlHeight:n,controlHeightLG:r,colorText:o,controlHeightSM:a,marginXXS:i,colorTextLightSolid:l,colorBgContainer:s}=e,c=1.25*r;return{colorBgHeader:"#001529",colorBgBody:t,colorBgTrigger:"#002140",bodyBg:t,headerBg:"#001529",headerHeight:2*n,headerPadding:"0 ".concat(c,"px"),headerColor:o,footerPadding:"".concat(a,"px ").concat(c,"px"),footerBg:t,siderBg:"#001529",triggerHeight:r+2*i,triggerBg:"#002140",triggerColor:l,zeroTriggerWidth:r,zeroTriggerHeight:r,lightSiderBg:s,lightTriggerBg:s,lightTriggerColor:o}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function y(e){let{suffixCls:t,tagName:n,displayName:r}=e;return e=>o.forwardRef((r,a)=>o.createElement(e,Object.assign({ref:a,suffixCls:t,tagName:n},r)))}let b=o.forwardRef((e,t)=>{let{prefixCls:n,suffixCls:r,className:a,tagName:l}=e,c=v(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:u}=o.useContext(s.E_),d=u("layout",n),[f,p,h]=g(d),m=r?"".concat(d,"-").concat(r):d;return f(o.createElement(l,Object.assign({className:i()(n||m,a,p,h),ref:t},c)))}),x=o.forwardRef((e,t)=>{let{direction:n}=o.useContext(s.E_),[a,f]=o.useState([]),{prefixCls:p,className:h,rootClassName:m,children:y,hasSider:b,tagName:x,style:w}=e,k=v(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),S=(0,l.Z)(k,["suffixCls"]),{getPrefixCls:E,layout:O}=o.useContext(s.E_),C=E("layout",p),j="boolean"==typeof b?b:!!a.length||(0,u.Z)(y).some(e=>e.type===d.Z),[_,P,N]=g(C),T=i()(C,{["".concat(C,"-has-sider")]:j,["".concat(C,"-rtl")]:"rtl"===n},null==O?void 0:O.className,h,m,P,N),A=o.useMemo(()=>({siderHook:{addSider:e=>{f(t=>[].concat((0,r.Z)(t),[e]))},removeSider:e=>{f(t=>t.filter(t=>t!==e))}}}),[]);return _(o.createElement(c.V.Provider,{value:A},o.createElement(x,Object.assign({ref:t,className:T,style:Object.assign(Object.assign({},null==O?void 0:O.style),w)},S),y)))}),w=y({tagName:"div",displayName:"Layout"})(x),k=y({suffixCls:"header",tagName:"header",displayName:"Header"})(b),S=y({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(b),E=y({suffixCls:"content",tagName:"main",displayName:"Content"})(b);w.Header=k,w.Footer=S,w.Content=E,w.Sider=d.Z,w._InternalSiderContext=d.D;var O=w},14301:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var r=n(2265),o=n(36760),a=n.n(o);let i=e=>e?"function"==typeof e?e():e:null;var l=n(68710),s=n(71744),c=n(89970),u=n(5769),d=n(12918),f=n(691),p=n(88260),h=n(53454),m=n(80669),g=n(3104),v=n(34442);let y=e=>{let{componentCls:t,popoverColor:n,titleMinWidth:r,fontWeightStrong:o,innerPadding:a,boxShadowSecondary:i,colorTextHeading:l,borderRadiusLG:s,zIndexPopup:c,titleMarginBottom:u,colorBgElevated:f,popoverBg:h,titleBorderBottom:m,innerContentPadding:g,titlePadding:v}=e;return[{[t]:Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:c,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":f,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},["".concat(t,"-content")]:{position:"relative"},["".concat(t,"-inner")]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:s,boxShadow:i,padding:a},["".concat(t,"-title")]:{minWidth:r,marginBottom:u,color:l,fontWeight:o,borderBottom:m,padding:v},["".concat(t,"-inner-content")]:{color:n,padding:g}})},(0,p.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(t,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",["".concat(t,"-content")]:{display:"inline-block"}}}]},b=e=>{let{componentCls:t}=e;return{[t]:h.i.map(n=>{let r=e["".concat(n,"6")];return{["&".concat(t,"-").concat(n)]:{"--antd-arrow-background-color":r,["".concat(t,"-inner")]:{backgroundColor:r},["".concat(t,"-arrow")]:{background:"transparent"}}}})}};var x=(0,m.I$)("Popover",e=>{let{colorBgElevated:t,colorText:n}=e,r=(0,g.TS)(e,{popoverBg:t,popoverColor:n});return[y(r),b(r),(0,f._y)(r,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:n,fontHeight:r,padding:o,wireframe:a,zIndexPopupBase:i,borderRadiusLG:l,marginXS:s,lineType:c,colorSplit:u,paddingSM:d}=e,f=n-r;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:i+30},(0,v.w)(e)),(0,p.wZ)({contentRadius:l,limitVerticalRadius:!0})),{innerPadding:a?0:12,titleMarginBottom:a?0:s,titlePadding:a?"".concat(f/2,"px ").concat(o,"px ").concat(f/2-t,"px"):0,titleBorderBottom:a?"".concat(t,"px ").concat(c," ").concat(u):"none",innerContentPadding:a?"".concat(d,"px ").concat(o,"px"):0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]}),w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let k=(e,t,n)=>t||n?r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(e,"-title")},i(t)),r.createElement("div",{className:"".concat(e,"-inner-content")},i(n))):null,S=e=>{let{hashId:t,prefixCls:n,className:o,style:i,placement:l="top",title:s,content:c,children:d}=e;return r.createElement("div",{className:a()(t,n,"".concat(n,"-pure"),"".concat(n,"-placement-").concat(l),o),style:i},r.createElement("div",{className:"".concat(n,"-arrow")}),r.createElement(u.G,Object.assign({},e,{className:t,prefixCls:n}),d||k(n,s,c)))};var 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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O=e=>{let{title:t,content:n,prefixCls:o}=e;return r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(o,"-title")},i(t)),r.createElement("div",{className:"".concat(o,"-inner-content")},i(n)))},C=r.forwardRef((e,t)=>{let{prefixCls:n,title:o,content:i,overlayClassName:u,placement:d="top",trigger:f="hover",mouseEnterDelay:p=.1,mouseLeaveDelay:h=.1,overlayStyle:m={}}=e,g=E(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:v}=r.useContext(s.E_),y=v("popover",n),[b,w,k]=x(y),S=v(),C=a()(u,w,k);return b(r.createElement(c.Z,Object.assign({placement:d,trigger:f,mouseEnterDelay:p,mouseLeaveDelay:h,overlayStyle:m},g,{prefixCls:y,overlayClassName:C,ref:t,overlay:o||i?r.createElement(O,{prefixCls:y,title:o,content:i}):null,transitionName:(0,l.m)(S,"zoom-big",g.transitionName),"data-popover-inject":!0})))});C._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,className:n}=e,o=w(e,["prefixCls","className"]),{getPrefixCls:i}=r.useContext(s.E_),l=i("popover",t),[c,u,d]=x(l);return c(r.createElement(S,Object.assign({},o,{prefixCls:l,hashId:u,className:a()(n,d)})))};var j=C},29967:function(e,t,n){"use strict";n.d(t,{ZP:function(){return R}});var r=n(2265),o=n(36760),a=n.n(o),i=n(50506),l=n(18242),s=n(71744),c=n(33759);let u=r.createContext(null),d=u.Provider,f=r.createContext(null),p=f.Provider;var h=n(20873),m=n(28791),g=n(6694),v=n(34709),y=n(86586),b=n(39109),x=n(352),w=n(12918),k=n(80669),S=n(3104);let E=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-group");return{[r]:Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(r,"-rtl")]:{direction:"rtl"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},O=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:r,radioSize:o,motionDurationSlow:a,motionDurationMid:i,motionEaseInOutCirc:l,colorBgContainer:s,colorBorder:c,lineWidth:u,colorBgContainerDisabled:d,colorTextDisabled:f,paddingXS:p,dotColorDisabled:h,lineType:m,radioColor:g,radioBgColor:v,calc:y}=e,b="".concat(t,"-inner"),k=y(o).sub(y(4).mul(2)),S=y(1).mul(o).equal();return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,w.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer",["&".concat(t,"-wrapper-rtl")]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,x.bf)(u)," ").concat(m," ").concat(r),borderRadius:"50%",visibility:"hidden",content:'""'},[t]:Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(b)]:{borderColor:r},["".concat(t,"-input:focus-visible + ").concat(b)]:Object.assign({},(0,w.oN)(e)),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:S,height:S,marginBlockStart:y(1).mul(o).div(-2).equal(),marginInlineStart:y(1).mul(o).div(-2).equal(),backgroundColor:g,borderBlockStart:0,borderInlineStart:0,borderRadius:S,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(l),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:S,height:S,backgroundColor:s,borderColor:c,borderStyle:"solid",borderWidth:u,borderRadius:"50%",transition:"all ".concat(i)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[b]:{borderColor:r,backgroundColor:v,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(o).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(l)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[b]:{backgroundColor:d,borderColor:c,cursor:"not-allowed","&::after":{backgroundColor:h}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[b]:{"&::after":{transform:"scale(".concat(y(k).div(o).equal({unit:!1}),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},C=e=>{let{buttonColor:t,controlHeight:n,componentCls:r,lineWidth:o,lineType:a,colorBorder:i,motionDurationSlow:l,motionDurationMid:s,buttonPaddingInline:c,fontSize:u,buttonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:h,paddingXS:m,borderRadius:g,borderRadiusSM:v,borderRadiusLG:y,buttonCheckedBg:b,buttonSolidCheckedColor:k,colorTextDisabled:S,colorBgContainerDisabled:E,buttonCheckedBgDisabled:O,buttonCheckedColorDisabled:C,colorPrimary:j,colorPrimaryHover:_,colorPrimaryActive:P,buttonSolidCheckedBg:N,buttonSolidCheckedHoverBg:T,buttonSolidCheckedActiveBg:A,calc:M}=e;return{["".concat(r,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:u,lineHeight:(0,x.bf)(M(n).sub(M(o).mul(2)).equal()),background:d,border:"".concat((0,x.bf)(o)," ").concat(a," ").concat(i),borderBlockStartWidth:M(o).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:o,cursor:"pointer",transition:["color ".concat(s),"background ".concat(s),"box-shadow ".concat(s)].join(","),a:{color:t},["> ".concat(r,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:M(o).mul(-1).equal(),insetInlineStart:M(o).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:o,paddingInline:0,backgroundColor:i,transition:"background-color ".concat(l),content:'""'}},"&:first-child":{borderInlineStart:"".concat((0,x.bf)(o)," ").concat(a," ").concat(i),borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g},"&:first-child:last-child":{borderRadius:g},["".concat(r,"-group-large &")]:{height:p,fontSize:f,lineHeight:(0,x.bf)(M(p).sub(M(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:y,borderEndStartRadius:y},"&:last-child":{borderStartEndRadius:y,borderEndEndRadius:y}},["".concat(r,"-group-small &")]:{height:h,paddingInline:M(m).sub(o).equal(),paddingBlock:0,lineHeight:(0,x.bf)(M(h).sub(M(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:j},"&:has(:focus-visible)":Object.assign({},(0,w.oN)(e)),["".concat(r,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(r,"-button-wrapper-disabled)")]:{zIndex:1,color:j,background:b,borderColor:j,"&::before":{backgroundColor:j},"&:first-child":{borderColor:j},"&:hover":{color:_,borderColor:_,"&::before":{backgroundColor:_}},"&:active":{color:P,borderColor:P,"&::before":{backgroundColor:P}}},["".concat(r,"-group-solid &-checked:not(").concat(r,"-button-wrapper-disabled)")]:{color:k,background:N,borderColor:N,"&:hover":{color:k,background:T,borderColor:T},"&:active":{color:k,background:A,borderColor:A}},"&-disabled":{color:S,backgroundColor:E,borderColor:i,cursor:"not-allowed","&:first-child, &:hover":{color:S,backgroundColor:E,borderColor:i}},["&-disabled".concat(r,"-button-wrapper-checked")]:{color:C,backgroundColor:O,borderColor:i,boxShadow:"none"}}}};var j=(0,k.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,r="0 0 0 ".concat((0,x.bf)(n)," ").concat(t),o=(0,S.TS)(e,{radioFocusShadow:r,radioButtonFocusShadow:r});return[E(o),O(o),C(o)]},e=>{let{wireframe:t,padding:n,marginXS:r,lineWidth:o,fontSizeLG:a,colorText:i,colorBgContainer:l,colorTextDisabled:s,controlItemBgActiveDisabled:c,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:h}=e;return{radioSize:a,dotSize:t?a-8:a-(4+o)*2,dotColorDisabled:s,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:l,buttonCheckedBg:l,buttonColor:i,buttonCheckedBgDisabled:c,buttonCheckedColorDisabled:s,buttonPaddingInline:n-o,wrapperMarginInlineEnd:r,radioColor:t?d:h,radioBgColor:t?l:d}},{unitless:{radioSize:!0,dotSize:!0}}),_=n(64024),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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=r.forwardRef((e,t)=>{var n,o;let i=r.useContext(u),l=r.useContext(f),{getPrefixCls:c,direction:d,radio:p}=r.useContext(s.E_),x=r.useRef(null),w=(0,m.sQ)(t,x),{isFormItemInput:k}=r.useContext(b.aM),{prefixCls:S,className:E,rootClassName:O,children:C,style:N,title:T}=e,A=P(e,["prefixCls","className","rootClassName","children","style","title"]),M=c("radio",S),I="button"===((null==i?void 0:i.optionType)||l),R=I?"".concat(M,"-button"):M,D=(0,_.Z)(M),[L,Z,z]=j(M,D),B=Object.assign({},A),F=r.useContext(y.Z);i&&(B.name=i.name,B.onChange=t=>{var n,r;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(r=null==i?void 0:i.onChange)||void 0===r||r.call(i,t)},B.checked=e.value===i.value,B.disabled=null!==(n=B.disabled)&&void 0!==n?n:i.disabled),B.disabled=null!==(o=B.disabled)&&void 0!==o?o:F;let H=a()("".concat(R,"-wrapper"),{["".concat(R,"-wrapper-checked")]:B.checked,["".concat(R,"-wrapper-disabled")]:B.disabled,["".concat(R,"-wrapper-rtl")]:"rtl"===d,["".concat(R,"-wrapper-in-form-item")]:k},null==p?void 0:p.className,E,O,Z,z,D);return L(r.createElement(g.Z,{component:"Radio",disabled:B.disabled},r.createElement("label",{className:H,style:Object.assign(Object.assign({},null==p?void 0:p.style),N),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:T},r.createElement(h.Z,Object.assign({},B,{className:a()(B.className,!I&&v.A),type:"radio",prefixCls:R,ref:w})),void 0!==C?r.createElement("span",null,C):null)))}),T=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:o}=r.useContext(s.E_),[u,f]=(0,i.Z)(e.defaultValue,{value:e.value}),{prefixCls:p,className:h,rootClassName:m,options:g,buttonStyle:v="outline",disabled:y,children:b,size:x,style:w,id:k,onMouseEnter:S,onMouseLeave:E,onFocus:O,onBlur:C}=e,P=n("radio",p),T="".concat(P,"-group"),A=(0,_.Z)(P),[M,I,R]=j(P,A),D=b;g&&g.length>0&&(D=g.map(e=>"string"==typeof e||"number"==typeof e?r.createElement(N,{key:e.toString(),prefixCls:P,disabled:y,value:e,checked:u===e},e):r.createElement(N,{key:"radio-group-value-options-".concat(e.value),prefixCls:P,disabled:e.disabled||y,value:e.value,checked:u===e.value,title:e.title,style:e.style,id:e.id,required:e.required},e.label)));let L=(0,c.Z)(x),Z=a()(T,"".concat(T,"-").concat(v),{["".concat(T,"-").concat(L)]:L,["".concat(T,"-rtl")]:"rtl"===o},h,m,I,R,A);return M(r.createElement("div",Object.assign({},(0,l.Z)(e,{aria:!0,data:!0}),{className:Z,style:w,onMouseEnter:S,onMouseLeave:E,onFocus:O,onBlur:C,id:k,ref:t}),r.createElement(d,{value:{onChange:t=>{let n=t.target.value;"value"in e||f(n);let{onChange:r}=e;r&&n!==u&&r(t)},value:u,disabled:e.disabled,name:e.name,optionType:e.optionType}},D)))});var A=r.memo(T),M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},I=r.forwardRef((e,t)=>{let{getPrefixCls:n}=r.useContext(s.E_),{prefixCls:o}=e,a=M(e,["prefixCls"]),i=n("radio",o);return r.createElement(p,{value:"button"},r.createElement(N,Object.assign({prefixCls:i},a,{type:"radio",ref:t})))});N.Button=I,N.Group=A,N.__ANT_RADIO=!0;var R=N},47451:function(e,t,n){"use strict";var r=n(10295);t.Z=r.Z},87908:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(2265),o=n(36760),a=n.n(o),i=n(18694),l=n(19722),s=n(71744),c=n(352),u=n(12918),d=n(80669),f=n(3104);let p=new c.E4("antSpinMove",{to:{opacity:1}}),h=new c.E4("antRotate",{to:{transform:"rotate(405deg)"}}),m=e=>{let{componentCls:t,calc:n}=e;return{["".concat(t)]:Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:"transform ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOutCirc),"&-spinning":{position:"static",display:"inline-block",opacity:1},["".concat(t,"-text")]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:"all ".concat(e.motionDurationMid),"&-show":{opacity:1,visibility:"visible"},["".concat(t,"-dot ").concat(t,"-dot-item")]:{backgroundColor:e.colorWhite},["".concat(t,"-text")]:{color:e.colorTextLightSolid}},"&-nested-loading":{position:"relative",["> div > ".concat(t)]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,["".concat(t,"-dot")]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},["".concat(t,"-text")]:{position:"absolute",top:"50%",width:"100%",textShadow:"0 1px 2px ".concat(e.colorBgContainer)},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{["".concat(t,"-dot")]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},["".concat(t,"-text")]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{["".concat(t,"-dot")]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},["".concat(t,"-text")]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},["&".concat(t,"-show-text ").concat(t,"-dot")]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},["".concat(t,"-container")]:{position:"relative",transition:"opacity ".concat(e.motionDurationSlow),"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:"all ".concat(e.motionDurationSlow),content:'""',pointerEvents:"none"}},["".concat(t,"-blur")]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},["".concat(t,"-dot")]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),backgroundColor:e.colorPrimary,borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:p,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:h,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&-sm ".concat(t,"-dot")]:{fontSize:e.dotSizeSM,i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},["&-lg ".concat(t,"-dot")]:{fontSize:e.dotSizeLG,i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},["&".concat(t,"-show-text ").concat(t,"-text")]:{display:"block"}})}};var g=(0,d.I$)("Spin",e=>[m((0,f.TS)(e,{spinDotDefault:e.colorTextDescription}))],e=>{let{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:.35*t,dotSizeLG:n}}),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let y=null,b=e=>{let{prefixCls:t,spinning:n=!0,delay:o=0,className:c,rootClassName:u,size:d="default",tip:f,wrapperClassName:p,style:h,children:m,fullscreen:b}=e,x=v(e,["prefixCls","spinning","delay","className","rootClassName","size","tip","wrapperClassName","style","children","fullscreen"]),{getPrefixCls:w}=r.useContext(s.E_),k=w("spin",t),[S,E,O]=g(k),[C,j]=r.useState(()=>n&&(!n||!o||!!isNaN(Number(o))));r.useEffect(()=>{if(n){var e;let t=function(e,t,n){var r,o=n||{},a=o.noTrailing,i=void 0!==a&&a,l=o.noLeading,s=void 0!==l&&l,c=o.debounceMode,u=void 0===c?void 0:c,d=!1,f=0;function p(){r&&clearTimeout(r)}function h(){for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];var l=this,c=Date.now()-f;function h(){f=Date.now(),t.apply(l,o)}function m(){r=void 0}!d&&(s||!u||r||h(),p(),void 0===u&&c>e?s?(f=Date.now(),i||(r=setTimeout(u?m:h,e))):h():!0!==i&&(r=setTimeout(u?m:h,void 0===u?e-c:e)))}return h.cancel=function(e){var t=(e||{}).upcomingOnly;p(),d=!(void 0!==t&&t)},h}(o,()=>{j(!0)},{debounceMode:!1!==(void 0!==(e=({}).atBegin)&&e)});return t(),()=>{var e;null===(e=null==t?void 0:t.cancel)||void 0===e||e.call(t)}}j(!1)},[o,n]);let _=r.useMemo(()=>void 0!==m&&!b,[m,b]),{direction:P,spin:N}=r.useContext(s.E_),T=a()(k,null==N?void 0:N.className,{["".concat(k,"-sm")]:"small"===d,["".concat(k,"-lg")]:"large"===d,["".concat(k,"-spinning")]:C,["".concat(k,"-show-text")]:!!f,["".concat(k,"-fullscreen")]:b,["".concat(k,"-fullscreen-show")]:b&&C,["".concat(k,"-rtl")]:"rtl"===P},c,u,E,O),A=a()("".concat(k,"-container"),{["".concat(k,"-blur")]:C}),M=(0,i.Z)(x,["indicator"]),I=Object.assign(Object.assign({},null==N?void 0:N.style),h),R=r.createElement("div",Object.assign({},M,{style:I,className:T,"aria-live":"polite","aria-busy":C}),function(e,t){let{indicator:n}=t,o="".concat(e,"-dot");return null===n?null:(0,l.l$)(n)?(0,l.Tm)(n,{className:a()(n.props.className,o)}):(0,l.l$)(y)?(0,l.Tm)(y,{className:a()(y.props.className,o)}):r.createElement("span",{className:a()(o,"".concat(e,"-dot-spin"))},r.createElement("i",{className:"".concat(e,"-dot-item"),key:1}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:2}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:3}),r.createElement("i",{className:"".concat(e,"-dot-item"),key:4}))}(k,e),f&&(_||b)?r.createElement("div",{className:"".concat(k,"-text")},f):null);return S(_?r.createElement("div",Object.assign({},M,{className:a()("".concat(k,"-nested-loading"),p,E,O)}),C&&r.createElement("div",{key:"loading"},R),r.createElement("div",{className:A,key:"container"},m)):R)};b.setDefaultIndicator=e=>{y=e};var x=b},76122:function(e,t,n){"use strict";n.d(t,{N:function(){return r}});let r=e=>({color:e.colorLink,textDecoration:"none",outline:"none",cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}})},63709:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var r=n(2265),o=n(61935),a=n(36760),i=n.n(a),l=n(1119),s=n(11993),c=n(26365),u=n(6989),d=n(50506),f=n(95814),p=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],h=r.forwardRef(function(e,t){var n,o=e.prefixCls,a=void 0===o?"rc-switch":o,h=e.className,m=e.checked,g=e.defaultChecked,v=e.disabled,y=e.loadingIcon,b=e.checkedChildren,x=e.unCheckedChildren,w=e.onClick,k=e.onChange,S=e.onKeyDown,E=(0,u.Z)(e,p),O=(0,d.Z)(!1,{value:m,defaultValue:g}),C=(0,c.Z)(O,2),j=C[0],_=C[1];function P(e,t){var n=j;return v||(_(n=e),null==k||k(n,t)),n}var N=i()(a,h,(n={},(0,s.Z)(n,"".concat(a,"-checked"),j),(0,s.Z)(n,"".concat(a,"-disabled"),v),n));return r.createElement("button",(0,l.Z)({},E,{type:"button",role:"switch","aria-checked":j,disabled:v,className:N,ref:t,onKeyDown:function(e){e.which===f.Z.LEFT?P(!1,e):e.which===f.Z.RIGHT&&P(!0,e),null==S||S(e)},onClick:function(e){var t=P(!j,e);null==w||w(t,e)}}),y,r.createElement("span",{className:"".concat(a,"-inner")},r.createElement("span",{className:"".concat(a,"-inner-checked")},b),r.createElement("span",{className:"".concat(a,"-inner-unchecked")},x)))});h.displayName="Switch";var m=n(6694),g=n(71744),v=n(86586),y=n(33759),b=n(352),x=n(36360),w=n(12918),k=n(80669),S=n(3104);let E=e=>{let{componentCls:t,trackHeightSM:n,trackPadding:r,trackMinWidthSM:o,innerMinMarginSM:a,innerMaxMarginSM:i,handleSizeSM:l,calc:s}=e,c="".concat(t,"-inner"),u=(0,b.bf)(s(l).add(s(r).mul(2)).equal()),d=(0,b.bf)(s(i).mul(2).equal());return{[t]:{["&".concat(t,"-small")]:{minWidth:o,height:n,lineHeight:(0,b.bf)(n),["".concat(t,"-inner")]:{paddingInlineStart:i,paddingInlineEnd:a,["".concat(c,"-checked")]:{marginInlineStart:"calc(-100% + ".concat(u," - ").concat(d,")"),marginInlineEnd:"calc(100% - ".concat(u," + ").concat(d,")")},["".concat(c,"-unchecked")]:{marginTop:s(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},["".concat(t,"-handle")]:{width:l,height:l},["".concat(t,"-loading-icon")]:{top:s(s(l).sub(e.switchLoadingIconSize)).div(2).equal(),fontSize:e.switchLoadingIconSize},["&".concat(t,"-checked")]:{["".concat(t,"-inner")]:{paddingInlineStart:a,paddingInlineEnd:i,["".concat(c,"-checked")]:{marginInlineStart:0,marginInlineEnd:0},["".concat(c,"-unchecked")]:{marginInlineStart:"calc(100% - ".concat(u," + ").concat(d,")"),marginInlineEnd:"calc(-100% + ".concat(u," - ").concat(d,")")}},["".concat(t,"-handle")]:{insetInlineStart:"calc(100% - ".concat((0,b.bf)(s(l).add(r).equal()),")")}},["&:not(".concat(t,"-disabled):active")]:{["&:not(".concat(t,"-checked) ").concat(c)]:{["".concat(c,"-unchecked")]:{marginInlineStart:s(e.marginXXS).div(2).equal(),marginInlineEnd:s(e.marginXXS).mul(-1).div(2).equal()}},["&".concat(t,"-checked ").concat(c)]:{["".concat(c,"-checked")]:{marginInlineStart:s(e.marginXXS).mul(-1).div(2).equal(),marginInlineEnd:s(e.marginXXS).div(2).equal()}}}}}}},O=e=>{let{componentCls:t,handleSize:n,calc:r}=e;return{[t]:{["".concat(t,"-loading-icon").concat(e.iconCls)]:{position:"relative",top:r(r(n).sub(e.fontSize)).div(2).equal(),color:e.switchLoadingIconColor,verticalAlign:"top"},["&".concat(t,"-checked ").concat(t,"-loading-icon")]:{color:e.switchColor}}}},C=e=>{let{componentCls:t,trackPadding:n,handleBg:r,handleShadow:o,handleSize:a,calc:i}=e,l="".concat(t,"-handle");return{[t]:{[l]:{position:"absolute",top:n,insetInlineStart:n,width:a,height:a,transition:"all ".concat(e.switchDuration," ease-in-out"),"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:r,borderRadius:i(a).div(2).equal(),boxShadow:o,transition:"all ".concat(e.switchDuration," ease-in-out"),content:'""'}},["&".concat(t,"-checked ").concat(l)]:{insetInlineStart:"calc(100% - ".concat((0,b.bf)(i(a).add(n).equal()),")")},["&:not(".concat(t,"-disabled):active")]:{["".concat(l,"::before")]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},["&".concat(t,"-checked ").concat(l,"::before")]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},j=e=>{let{componentCls:t,trackHeight:n,trackPadding:r,innerMinMargin:o,innerMaxMargin:a,handleSize:i,calc:l}=e,s="".concat(t,"-inner"),c=(0,b.bf)(l(i).add(l(r).mul(2)).equal()),u=(0,b.bf)(l(a).mul(2).equal());return{[t]:{[s]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:a,paddingInlineEnd:o,transition:"padding-inline-start ".concat(e.switchDuration," ease-in-out, padding-inline-end ").concat(e.switchDuration," ease-in-out"),["".concat(s,"-checked, ").concat(s,"-unchecked")]:{display:"block",color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:"margin-inline-start ".concat(e.switchDuration," ease-in-out, margin-inline-end ").concat(e.switchDuration," ease-in-out"),pointerEvents:"none"},["".concat(s,"-checked")]:{marginInlineStart:"calc(-100% + ".concat(c," - ").concat(u,")"),marginInlineEnd:"calc(100% - ".concat(c," + ").concat(u,")")},["".concat(s,"-unchecked")]:{marginTop:l(n).mul(-1).equal(),marginInlineStart:0,marginInlineEnd:0}},["&".concat(t,"-checked ").concat(s)]:{paddingInlineStart:o,paddingInlineEnd:a,["".concat(s,"-checked")]:{marginInlineStart:0,marginInlineEnd:0},["".concat(s,"-unchecked")]:{marginInlineStart:"calc(100% - ".concat(c," + ").concat(u,")"),marginInlineEnd:"calc(-100% + ".concat(c," - ").concat(u,")")}},["&:not(".concat(t,"-disabled):active")]:{["&:not(".concat(t,"-checked) ").concat(s)]:{["".concat(s,"-unchecked")]:{marginInlineStart:l(r).mul(2).equal(),marginInlineEnd:l(r).mul(-1).mul(2).equal()}},["&".concat(t,"-checked ").concat(s)]:{["".concat(s,"-checked")]:{marginInlineStart:l(r).mul(-1).mul(2).equal(),marginInlineEnd:l(r).mul(2).equal()}}}}}},_=e=>{let{componentCls:t,trackHeight:n,trackMinWidth:r}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:r,height:n,lineHeight:"".concat((0,b.bf)(n)),verticalAlign:"middle",background:e.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),userSelect:"none",["&:hover:not(".concat(t,"-disabled)")]:{background:e.colorTextTertiary}}),(0,w.Qy)(e)),{["&".concat(t,"-checked")]:{background:e.switchColor,["&:hover:not(".concat(t,"-disabled)")]:{background:e.colorPrimaryHover}},["&".concat(t,"-loading, &").concat(t,"-disabled")]:{cursor:"not-allowed",opacity:e.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},["&".concat(t,"-rtl")]:{direction:"rtl"}})}};var P=(0,k.I$)("Switch",e=>{let t=(0,S.TS)(e,{switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchLoadingIconSize:e.calc(e.fontSizeIcon).mul(.75).equal(),switchLoadingIconColor:"rgba(0, 0, 0, ".concat(e.opacityLoading,")"),switchHandleActiveInset:"-30%"});return[_(t),j(t),C(t),O(t),E(t)]},e=>{let{fontSize:t,lineHeight:n,controlHeight:r,colorWhite:o}=e,a=t*n,i=r/2,l=a-4,s=i-4;return{trackHeight:a,trackHeightSM:i,trackMinWidth:2*l+8,trackMinWidthSM:2*s+4,trackPadding:2,handleBg:o,handleSize:l,handleSizeSM:s,handleShadow:"0 2px 4px 0 ".concat(new x.C("#00230b").setAlpha(.2).toRgbString()),innerMinMargin:l/2,innerMaxMargin:l+2+4,innerMinMarginSM:s/2,innerMaxMarginSM:s+2+4}}),N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let T=r.forwardRef((e,t)=>{let{prefixCls:n,size:a,disabled:l,loading:s,className:c,rootClassName:u,style:f,checked:p,value:b,defaultChecked:x,defaultValue:w,onChange:k}=e,S=N(e,["prefixCls","size","disabled","loading","className","rootClassName","style","checked","value","defaultChecked","defaultValue","onChange"]),[E,O]=(0,d.Z)(!1,{value:null!=p?p:b,defaultValue:null!=x?x:w}),{getPrefixCls:C,direction:j,switch:_}=r.useContext(g.E_),T=r.useContext(v.Z),A=(null!=l?l:T)||s,M=C("switch",n),I=r.createElement("div",{className:"".concat(M,"-handle")},s&&r.createElement(o.Z,{className:"".concat(M,"-loading-icon")})),[R,D,L]=P(M),Z=(0,y.Z)(a),z=i()(null==_?void 0:_.className,{["".concat(M,"-small")]:"small"===Z,["".concat(M,"-loading")]:s,["".concat(M,"-rtl")]:"rtl"===j},c,u,D,L),B=Object.assign(Object.assign({},null==_?void 0:_.style),f);return R(r.createElement(m.Z,{component:"Switch"},r.createElement(h,Object.assign({},S,{checked:E,onChange:function(){O(arguments.length<=0?void 0:arguments[0]),null==k||k.apply(void 0,arguments)},prefixCls:M,className:z,style:B,disabled:A,ref:t,loadingIcon:I}))))});T.__ANT_SWITCH=!0;var A=T},72188:function(e,t,n){"use strict";n.d(t,{Z:function(){return oe}});var r,o,a=n(2265),i={},l="rc-table-internal-hook",s=n(26365),c=n(58525),u=n(27380),d=n(16671),f=n(54887);function p(e){var t=a.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,r=e.children,o=a.useRef(n);o.current=n;var i=a.useState(function(){return{getValue:function(){return o.current},listeners:new Set}}),l=(0,s.Z)(i,1)[0];return(0,u.Z)(function(){(0,f.unstable_batchedUpdates)(function(){l.listeners.forEach(function(e){e(n)})})},[n]),a.createElement(t.Provider,{value:l},r)},defaultValue:e}}function h(e,t){var n=(0,c.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),r=a.useContext(null==e?void 0:e.Context),o=r||{},i=o.listeners,l=o.getValue,f=a.useRef();f.current=n(r?l():null==e?void 0:e.defaultValue);var p=a.useState({}),h=(0,s.Z)(p,2)[1];return(0,u.Z)(function(){if(r)return i.add(e),function(){i.delete(e)};function e(e){var t=n(e);(0,d.Z)(f.current,t,!0)||h({})}},[r]),f.current}var m=n(1119),g=n(28791);function v(){var e=a.createContext(null);function t(){return a.useContext(e)}return{makeImmutable:function(n,r){var o=(0,g.Yr)(n),i=function(i,l){var s=o?{ref:l}:{},c=a.useRef(0),u=a.useRef(i);return null!==t()?a.createElement(n,(0,m.Z)({},i,s)):((!r||r(u.current,i))&&(c.current+=1),u.current=i,a.createElement(e.Provider,{value:c.current},a.createElement(n,(0,m.Z)({},i,s))))};return o?a.forwardRef(i):i},responseImmutable:function(e,n){var r=(0,g.Yr)(e),o=function(n,o){return t(),a.createElement(e,(0,m.Z)({},n,r?{ref:o}:{}))};return r?a.memo(a.forwardRef(o),n):a.memo(o,n)},useImmutableMark:t}}var y=v();y.makeImmutable,y.responseImmutable,y.useImmutableMark;var b=v(),x=b.makeImmutable,w=b.responseImmutable,k=b.useImmutableMark,S=p();a.memo(function(){var e,t,n,r,o,i=(t=a.useRef(0),t.current+=1,n=a.useRef(void 0),r=[],Object.keys(e||{}).map(function(t){var o;(null==e?void 0:e[t])!==(null===(o=n.current)||void 0===o?void 0:o[t])&&r.push(t)}),n.current=e,o=a.useRef([]),r.length&&(o.current=r),a.useDebugValue(t.current),a.useDebugValue(o.current.join(", ")),t.current);return a.createElement("h1",null,"Render Times: ",i)}).displayName="RenderBlock";var E=n(41154),O=n(31686),C=n(11993),j=n(36760),_=n.n(j),P=n(6397),N=n(16847),T=n(32559),A=a.createContext({renderWithProps:!1});function M(e){var t=[],n={};return e.forEach(function(e){for(var r=e||{},o=r.key,a=r.dataIndex,i=o||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[i];)i="".concat(i,"_next");n[i]=!0,t.push(i)}),t}var I=n(74126),R=function(e){var t,n=e.ellipsis,r=e.rowType,o=e.children,i=!0===n?{showTitle:!0}:n;return i&&(i.showTitle||"header"===r)&&("string"==typeof o||"number"==typeof o?t=o.toString():a.isValidElement(o)&&"string"==typeof o.props.children&&(t=o.props.children)),t},D=a.memo(function(e){var t,n,r,o,i,l,c,u,f,p,g=e.component,v=e.children,y=e.ellipsis,b=e.scope,x=e.prefixCls,w=e.className,j=e.align,T=e.record,M=e.render,D=e.dataIndex,L=e.renderIndex,Z=e.shouldCellUpdate,z=e.index,B=e.rowType,F=e.colSpan,H=e.rowSpan,q=e.fixLeft,W=e.fixRight,U=e.firstFixLeft,K=e.lastFixLeft,$=e.firstFixRight,V=e.lastFixRight,X=e.appendNode,G=e.additionalProps,Y=void 0===G?{}:G,Q=e.isSticky,J="".concat(x,"-cell"),ee=h(S,["supportSticky","allColumnsFixedLeft"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,er=(t=a.useContext(A),n=k(),(0,P.Z)(function(){if(null!=v)return[v];var e=null==D||""===D?[]:Array.isArray(D)?D:[D],n=(0,N.Z)(T,e),r=n,o=void 0;if(M){var i=M(n,T,L);!i||"object"!==(0,E.Z)(i)||Array.isArray(i)||a.isValidElement(i)?r=i:(r=i.children,o=i.props,t.renderWithProps=!0)}return[r,o]},[n,T,v,D,M,L],function(e,n){if(Z){var r=(0,s.Z)(e,2)[1];return Z((0,s.Z)(n,2)[1],r)}return!!t.renderWithProps||!(0,d.Z)(e,n,!0)})),eo=(0,s.Z)(er,2),ea=eo[0],ei=eo[1],el={},es="number"==typeof q&&et,ec="number"==typeof W&&et;es&&(el.position="sticky",el.left=q),ec&&(el.position="sticky",el.right=W);var eu=null!==(r=null!==(o=null!==(i=null==ei?void 0:ei.colSpan)&&void 0!==i?i:Y.colSpan)&&void 0!==o?o:F)&&void 0!==r?r:1,ed=null!==(l=null!==(c=null!==(u=null==ei?void 0:ei.rowSpan)&&void 0!==u?u:Y.rowSpan)&&void 0!==c?c:H)&&void 0!==l?l:1,ef=h(S,function(e){var t,n;return[(t=ed||1,n=e.hoverStartRow,z<=e.hoverEndRow&&z+t-1>=n),e.onHover]}),ep=(0,s.Z)(ef,2),eh=ep[0],em=ep[1],eg=(0,I.zX)(function(e){var t;T&&em(z,z+ed-1),null==Y||null===(t=Y.onMouseEnter)||void 0===t||t.call(Y,e)}),ev=(0,I.zX)(function(e){var t;T&&em(-1,-1),null==Y||null===(t=Y.onMouseLeave)||void 0===t||t.call(Y,e)});if(0===eu||0===ed)return null;var ey=null!==(f=Y.title)&&void 0!==f?f:R({rowType:B,ellipsis:y,children:ea}),eb=_()(J,w,(p={},(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)(p,"".concat(J,"-fix-left"),es&&et),"".concat(J,"-fix-left-first"),U&&et),"".concat(J,"-fix-left-last"),K&&et),"".concat(J,"-fix-left-all"),K&&en&&et),"".concat(J,"-fix-right"),ec&&et),"".concat(J,"-fix-right-first"),$&&et),"".concat(J,"-fix-right-last"),V&&et),"".concat(J,"-ellipsis"),y),"".concat(J,"-with-append"),X),"".concat(J,"-fix-sticky"),(es||ec)&&Q&&et),(0,C.Z)(p,"".concat(J,"-row-hover"),!ei&&eh)),Y.className,null==ei?void 0:ei.className),ex={};j&&(ex.textAlign=j);var ew=(0,O.Z)((0,O.Z)((0,O.Z)((0,O.Z)({},el),Y.style),ex),null==ei?void 0:ei.style),ek=ea;return"object"!==(0,E.Z)(ek)||Array.isArray(ek)||a.isValidElement(ek)||(ek=null),y&&(K||$)&&(ek=a.createElement("span",{className:"".concat(J,"-content")},ek)),a.createElement(g,(0,m.Z)({},ei,Y,{className:eb,style:ew,title:ey,scope:b,onMouseEnter:eg,onMouseLeave:ev,colSpan:1!==eu?eu:null,rowSpan:1!==ed?ed:null}),X,ek)});function L(e,t,n,r,o,a){var i,l,s=n[e]||{},c=n[t]||{};"left"===s.fixed?i=r.left["rtl"===o?t:e]:"right"===c.fixed&&(l=r.right["rtl"===o?e:t]);var u=!1,d=!1,f=!1,p=!1,h=n[t+1],m=n[e-1],g=!(null!=a&&a.children);return"rtl"===o?void 0!==i?p=!(m&&"left"===m.fixed)&&g:void 0!==l&&(f=!(h&&"right"===h.fixed)&&g):void 0!==i?u=!(h&&"left"===h.fixed)&&g:void 0!==l&&(d=!(m&&"right"===m.fixed)&&g),{fixLeft:i,fixRight:l,lastFixLeft:u,firstFixRight:d,lastFixRight:f,firstFixLeft:p,isSticky:r.isSticky}}var Z=a.createContext({}),z=n(6989),B=["children"];function F(e){return e.children}F.Row=function(e){var t=e.children,n=(0,z.Z)(e,B);return a.createElement("tr",n,t)},F.Cell=function(e){var t=e.className,n=e.index,r=e.children,o=e.colSpan,i=void 0===o?1:o,l=e.rowSpan,s=e.align,c=h(S,["prefixCls","direction"]),u=c.prefixCls,d=c.direction,f=a.useContext(Z),p=f.scrollColumnIndex,g=f.stickyOffsets,v=f.flattenColumns,y=f.columns,b=n+i-1+1===p?i+1:i,x=L(n,n+b-1,v,g,d,null==y?void 0:y[n]);return a.createElement(D,(0,m.Z)({className:t,index:n,component:"td",prefixCls:u,record:null,dataIndex:null,align:s,colSpan:b,rowSpan:l,render:function(){return r}},x))};var H=w(function(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,o=e.columns,i=h(S,"prefixCls"),l=r.length-1,s=r[l],c=a.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:null!=s&&s.scrollbar?l:null,columns:o}},[s,r,l,n,o]);return a.createElement(Z.Provider,{value:c},a.createElement("tfoot",{className:"".concat(i,"-summary")},t))}),q=n(31474),W=n(2857),U=n(10281),K=n(3208),$=n(18242);function V(e,t,n,r){return a.useMemo(function(){if(null!=n&&n.size){for(var o=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,r,o,a,i,l){t.push({record:n,indent:r,index:l});var s=i(n),c=null==a?void 0:a.has(s);if(n&&Array.isArray(n[o])&&c)for(var u=0;u<n[o].length;u+=1)e(t,n[o][u],r+1,o,a,i,u)}(o,e[a],0,t,n,r,a);return o}return null==e?void 0:e.map(function(e,t){return{record:e,indent:0,index:t}})},[e,t,n,r])}function X(e,t,n,r){var o,a=h(S,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),i=a.flattenColumns,l=a.expandableType,s=a.expandedKeys,c=a.childrenColumnName,u=a.onTriggerExpand,d=a.rowExpandable,f=a.onRow,p=a.expandRowByClick,m=a.rowClassName,g="nest"===l,v="row"===l&&(!d||d(e)),y=v||g,b=s&&s.has(t),x=c&&e&&e[c],w=(0,I.zX)(u),k=null==f?void 0:f(e,n),E=null==k?void 0:k.onClick;"string"==typeof m?o=m:"function"==typeof m&&(o=m(e,n,r));var C=M(i);return(0,O.Z)((0,O.Z)({},a),{},{columnsKey:C,nestExpandable:g,expanded:b,hasNestChildren:x,record:e,onTriggerExpand:w,rowSupportExpand:v,expandable:y,rowProps:(0,O.Z)((0,O.Z)({},k),{},{className:_()(o,null==k?void 0:k.className),onClick:function(t){p&&y&&u(e,t);for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];null==E||E.apply(void 0,[t].concat(r))}})})}var G=function(e){var t=e.prefixCls,n=e.children,r=e.component,o=e.cellComponent,i=e.className,l=e.expanded,s=e.colSpan,c=e.isEmpty,u=h(S,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),d=u.scrollbarSize,f=u.fixHeader,p=u.fixColumn,m=u.componentWidth,g=u.horizonScroll,v=n;return(c?g&&m:p)&&(v=a.createElement("div",{style:{width:m-(f?d:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(t,"-expanded-row-fixed")},v)),a.createElement(r,{className:i,style:{display:l?null:"none"}},a.createElement(D,{component:o,prefixCls:t,colSpan:s},v))};function Y(e,t,n,r,o){var i,l,s=e.record,c=e.prefixCls,u=e.columnsKey,d=e.fixedInfoList,f=e.expandIconColumnIndex,p=e.nestExpandable,h=e.indentSize,m=e.expandIcon,g=e.expanded,v=e.hasNestChildren,y=e.onTriggerExpand,b=u[n],x=d[n];return n===(f||0)&&p&&(i=a.createElement(a.Fragment,null,a.createElement("span",{style:{paddingLeft:"".concat(h*r,"px")},className:"".concat(c,"-row-indent indent-level-").concat(r)}),m({prefixCls:c,expanded:g,expandable:v,record:s,onExpand:y}))),t.onCell&&(l=t.onCell(s,o)),{key:b,fixedInfo:x,appendCellNode:i,additionalCellProps:l||{}}}function Q(e){var t,n=e.className,r=e.style,o=e.record,i=e.index,l=e.renderIndex,s=e.rowKey,c=e.indent,u=void 0===c?0:c,d=e.rowComponent,f=e.cellComponent,p=e.scopeCellComponent,h=X(o,s,i,u),g=h.prefixCls,v=h.flattenColumns,y=h.expandedRowClassName,b=h.expandedRowRender,x=h.rowProps,w=h.expanded,k=h.rowSupportExpand,S=a.useRef(!1);S.current||(S.current=w);var E=a.createElement(d,(0,m.Z)({},x,{"data-row-key":s,className:_()(n,"".concat(g,"-row"),"".concat(g,"-row-level-").concat(u),null==x?void 0:x.className),style:(0,O.Z)((0,O.Z)({},r),null==x?void 0:x.style)}),v.map(function(e,t){var n=e.render,r=e.dataIndex,s=e.className,c=Y(h,e,t,u,i),d=c.key,v=c.fixedInfo,y=c.appendCellNode,b=c.additionalCellProps;return a.createElement(D,(0,m.Z)({className:s,ellipsis:e.ellipsis,align:e.align,scope:e.rowScope,component:e.rowScope?p:f,prefixCls:g,key:d,record:o,index:i,renderIndex:l,dataIndex:r,render:n,shouldCellUpdate:e.shouldCellUpdate},v,{appendNode:y,additionalProps:b}))}));if(k&&(S.current||w)){var C=b(o,i,u+1,w),j=y&&y(o,i,u);t=a.createElement(G,{expanded:w,className:_()("".concat(g,"-expanded-row"),"".concat(g,"-expanded-row-level-").concat(u+1),j),prefixCls:g,component:d,cellComponent:f,colSpan:v.length,isEmpty:!1},C)}return a.createElement(a.Fragment,null,E,t)}Q.displayName="BodyRow";var J=w(Q);function ee(e){var t=e.columnKey,n=e.onColumnResize,r=a.useRef();return a.useEffect(function(){r.current&&n(t,r.current.offsetWidth)},[]),a.createElement(q.Z,{data:t},a.createElement("td",{ref:r,style:{padding:0,border:0,height:0}},a.createElement("div",{style:{height:0,overflow:"hidden"}},"\xa0")))}function et(e){var t=e.prefixCls,n=e.columnsKey,r=e.onColumnResize;return a.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),style:{height:0,fontSize:0}},a.createElement(q.Z.Collection,{onBatchResize:function(e){e.forEach(function(e){r(e.data,e.size.offsetWidth)})}},n.map(function(e){return a.createElement(ee,{key:e,columnKey:e,onColumnResize:r})})))}function en(e){var t,n=e.data,r=e.measureColumnWidth,o=h(S,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),i=o.prefixCls,l=o.getComponent,s=o.onColumnResize,c=o.flattenColumns,u=o.getRowKey,d=o.expandedKeys,f=o.childrenColumnName,p=o.emptyNode,m=V(n,f,d,u),g=a.useRef({renderWithProps:!1}),v=l(["body","wrapper"],"tbody"),y=l(["body","row"],"tr"),b=l(["body","cell"],"td"),x=l(["body","cell"],"th");t=n.length?m.map(function(e,t){var n=e.record,r=e.indent,o=e.index,i=u(n,t);return a.createElement(J,{key:i,rowKey:i,record:n,index:t,renderIndex:o,rowComponent:y,cellComponent:b,scopeCellComponent:x,getRowKey:u,indent:r})}):a.createElement(G,{expanded:!0,className:"".concat(i,"-placeholder"),prefixCls:i,component:y,cellComponent:b,colSpan:c.length,isEmpty:!0},p);var w=M(c);return a.createElement(A.Provider,{value:g.current},a.createElement(v,{className:"".concat(i,"-tbody")},r&&a.createElement(et,{prefixCls:i,columnsKey:w,onColumnResize:s}),t))}en.displayName="Body";var er=w(en),eo=["expandable"],ea="RC_TABLE_INTERNAL_COL_DEFINE",ei=["columnType"],el=function(e){for(var t=e.colWidths,n=e.columns,r=e.columCount,o=[],i=r||n.length,l=!1,s=i-1;s>=0;s-=1){var c=t[s],u=n&&n[s],d=u&&u[ea];if(c||d||l){var f=d||{},p=(f.columnType,(0,z.Z)(f,ei));o.unshift(a.createElement("col",(0,m.Z)({key:s,style:{width:c}},p))),l=!0}}return a.createElement("colgroup",null,o)},es=n(83145),ec=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"],eu=a.forwardRef(function(e,t){var n=e.className,r=e.noData,o=e.columns,i=e.flattenColumns,l=e.colWidths,s=e.columCount,c=e.stickyOffsets,u=e.direction,d=e.fixHeader,f=e.stickyTopOffset,p=e.stickyBottomOffset,m=e.stickyClassName,v=e.onScroll,y=e.maxContentScroll,b=e.children,x=(0,z.Z)(e,ec),w=h(S,["prefixCls","scrollbarSize","isSticky"]),k=w.prefixCls,E=w.scrollbarSize,j=w.isSticky,P=j&&!d?0:E,N=a.useRef(null),T=a.useCallback(function(e){(0,g.mH)(t,e),(0,g.mH)(N,e)},[]);a.useEffect(function(){var e;function t(e){var t=e.currentTarget,n=e.deltaX;n&&(v({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}return null===(e=N.current)||void 0===e||e.addEventListener("wheel",t),function(){var e;null===(e=N.current)||void 0===e||e.removeEventListener("wheel",t)}},[]);var A=a.useMemo(function(){return i.every(function(e){return e.width})},[i]),M=i[i.length-1],I={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(k,"-cell-scrollbar")}}},R=(0,a.useMemo)(function(){return P?[].concat((0,es.Z)(o),[I]):o},[P,o]),D=(0,a.useMemo)(function(){return P?[].concat((0,es.Z)(i),[I]):i},[P,i]),L=(0,a.useMemo)(function(){var e=c.right,t=c.left;return(0,O.Z)((0,O.Z)({},c),{},{left:"rtl"===u?[].concat((0,es.Z)(t.map(function(e){return e+P})),[0]):t,right:"rtl"===u?e:[].concat((0,es.Z)(e.map(function(e){return e+P})),[0]),isSticky:j})},[P,c,j]),Z=(0,a.useMemo)(function(){for(var e=[],t=0;t<s;t+=1){var n=l[t];if(void 0===n)return null;e[t]=n}return e},[l.join("_"),s]);return a.createElement("div",{style:(0,O.Z)({overflow:"hidden"},j?{top:f,bottom:p}:{}),ref:T,className:_()(n,(0,C.Z)({},m,!!m))},a.createElement("table",{style:{tableLayout:"fixed",visibility:r||Z?null:"hidden"}},(!r||!y||A)&&a.createElement(el,{colWidths:Z?[].concat((0,es.Z)(Z),[P]):[],columCount:s+1,columns:D}),b((0,O.Z)((0,O.Z)({},x),{},{stickyOffsets:L,columns:R,flattenColumns:D}))))});eu.displayName="FixedHolder";var ed=a.memo(eu);function ef(e){var t,n=e.cells,r=e.stickyOffsets,o=e.flattenColumns,i=e.rowComponent,l=e.cellComponent,s=e.tdCellComponent,c=e.onHeaderRow,u=e.index,d=h(S,["prefixCls","direction"]),f=d.prefixCls,p=d.direction;c&&(t=c(n.map(function(e){return e.column}),u));var g=M(n.map(function(e){return e.column}));return a.createElement(i,t,n.map(function(e,t){var n,i=e.column,c=L(e.colStart,e.colEnd,o,r,p,i);return i&&i.onHeaderCell&&(n=e.column.onHeaderCell(i)),a.createElement(D,(0,m.Z)({},e,{scope:i.title?e.colSpan>1?"colgroup":"col":null,ellipsis:i.ellipsis,align:i.align,component:i.title?l:s,prefixCls:f,key:g[t]},c,{additionalProps:n,rowType:"header"}))}))}ef.displayName="HeaderRow";var ep=w(function(e){var t=e.stickyOffsets,n=e.columns,r=e.flattenColumns,o=e.onHeaderRow,i=h(S,["prefixCls","getComponent"]),l=i.prefixCls,s=i.getComponent,c=a.useMemo(function(){return function(e){var t=[];!function e(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[o]=t[o]||[];var a=r;return n.filter(Boolean).map(function(n){var r={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},i=1,l=n.children;return l&&l.length>0&&(i=e(l,a,o+1).reduce(function(e,t){return e+t},0),r.hasSubColumns=!0),"colSpan"in n&&(i=n.colSpan),"rowSpan"in n&&(r.rowSpan=n.rowSpan),r.colSpan=i,r.colEnd=r.colStart+i-1,t[o].push(r),a+=i,i})}(e,0);for(var n=t.length,r=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},o=0;o<n;o+=1)r(o);return t}(n)},[n]),u=s(["header","wrapper"],"thead"),d=s(["header","row"],"tr"),f=s(["header","cell"],"th"),p=s(["header","cell"],"td");return a.createElement(u,{className:"".concat(l,"-thead")},c.map(function(e,n){return a.createElement(ef,{key:n,flattenColumns:r,cells:e,stickyOffsets:t,rowComponent:d,cellComponent:f,tdCellComponent:p,onHeaderRow:o,index:n})}))}),eh=n(45287);function em(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var eg=["children"],ev=["fixed"];function ey(e){return(0,eh.Z)(e).filter(function(e){return a.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,r=n.children,o=(0,z.Z)(n,eg),a=(0,O.Z)({key:t},o);return r&&(a.children=ey(r)),a})}function eb(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,E.Z)(e)}).reduce(function(e,n,r){var o=n.fixed,a=!0===o?"left":o,i="".concat(t,"-").concat(r),l=n.children;return l&&l.length>0?[].concat((0,es.Z)(e),(0,es.Z)(eb(l,i).map(function(e){return(0,O.Z)({fixed:a},e)}))):[].concat((0,es.Z)(e),[(0,O.Z)((0,O.Z)({key:i},n),{},{fixed:a})])},[])}var ex=function(e,t){var n=e.prefixCls,r=e.columns,o=e.children,l=e.expandable,c=e.expandedKeys,u=e.columnTitle,d=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,h=e.rowExpandable,m=e.expandIconColumnIndex,g=e.direction,v=e.expandRowByClick,y=e.columnWidth,b=e.fixed,x=e.scrollWidth,w=e.clientWidth,k=a.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,E.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,O.Z)((0,O.Z)({},t),{},{children:e(n)}):t})}((r||ey(o)||[]).slice())},[r,o]),S=a.useMemo(function(){if(l){var e,t=k.slice();if(!t.includes(i)){var r=m||0;r>=0&&t.splice(r,0,i)}var o=t.indexOf(i);t=t.filter(function(e,t){return e!==i||t===o});var s=k[o];e=("left"===b||b)&&!m?"left":("right"===b||b)&&m===k.length?"right":s?s.fixed:null;var g=(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},ea,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",u),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",y),"render",function(e,t,r){var o=d(t,r),i=p({prefixCls:n,expanded:c.has(o),expandable:!h||h(t),record:t,onExpand:f});return v?a.createElement("span",{onClick:function(e){return e.stopPropagation()}},i):i});return t.map(function(e){return e===i?g:e})}return k.filter(function(e){return e!==i})},[l,k,d,c,p,g]),j=a.useMemo(function(){var e=S;return t&&(e=t(e)),e.length||(e=[{render:function(){return null}}]),e},[t,S,g]),_=a.useMemo(function(){return"rtl"===g?eb(j).map(function(e){var t=e.fixed,n=(0,z.Z)(e,ev),r=t;return"left"===t?r="right":"right"===t&&(r="left"),(0,O.Z)({fixed:r},n)}):eb(j)},[j,g,x]),P=a.useMemo(function(){if(x&&x>0){var e=0,t=0;_.forEach(function(n){var r=em(x,n.width);r?e+=r:t+=1});var n=Math.max(x,w),r=Math.max(n-e,t),o=t,a=r/t,i=0,l=_.map(function(e){var t=(0,O.Z)({},e),n=em(x,t.width);if(n)t.width=n;else{var l=Math.floor(a);t.width=1===o?r:l,r-=l,o-=1}return i+=t.width,t});if(i<n){var s=n/i;r=n,l.forEach(function(e,t){var n=Math.floor(e.width*s);e.width=t===l.length-1?r:n,r-=n})}return[l,Math.max(i,n)]}return[_,x]},[_,x,w]),N=(0,s.Z)(P,2);return[j,N[0],N[1]]};function ew(e){var t=e.prefixCls,n=e.record,r=e.onExpand,o=e.expanded,i=e.expandable,l="".concat(t,"-row-expand-icon");return i?a.createElement("span",{className:_()(l,(0,C.Z)((0,C.Z)({},"".concat(t,"-row-expanded"),o),"".concat(t,"-row-collapsed"),!o)),onClick:function(e){r(n,e),e.stopPropagation()}}):a.createElement("span",{className:_()(l,"".concat(t,"-row-spaced"))})}function ek(e){var t=(0,a.useRef)(e),n=(0,a.useState)({}),r=(0,s.Z)(n,2)[1],o=(0,a.useRef)(null),i=(0,a.useRef)([]);return(0,a.useEffect)(function(){return function(){o.current=null}},[]),[t.current,function(e){i.current.push(e);var n=Promise.resolve();o.current=n,n.then(function(){if(o.current===n){var e=i.current,a=t.current;i.current=[],e.forEach(function(e){t.current=e(t.current)}),o.current=null,a!==t.current&&r({})}})}]}var eS=(0,n(94981).Z)()?window:null,eE=function(e){var t=e.className,n=e.children;return a.createElement("div",{className:t},n)};function eO(e,t,n,r){var o=f.unstable_batchedUpdates?function(e){f.unstable_batchedUpdates(n,e)}:n;return null!=e&&e.addEventListener&&e.addEventListener(t,o,r),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,o,r)}}}function eC(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}var ej=a.forwardRef(function(e,t){var n,r,o=e.scrollBodyRef,i=e.onScroll,l=e.offsetScroll,c=e.container,u=h(S,"prefixCls"),d=(null===(n=o.current)||void 0===n?void 0:n.scrollWidth)||0,f=(null===(r=o.current)||void 0===r?void 0:r.clientWidth)||0,p=d&&f/d*f,m=a.useRef(),g=ek({scrollLeft:0,isHiddenScrollBar:!1}),v=(0,s.Z)(g,2),y=v[0],b=v[1],x=a.useRef({delta:0,x:0}),w=a.useState(!1),k=(0,s.Z)(w,2),E=k[0],j=k[1],P=function(){j(!1)},N=function(e){var t,n=(e||(null===(t=window)||void 0===t?void 0:t.event)).buttons;if(!E||0===n){E&&j(!1);return}var r=x.current.x+e.pageX-x.current.x-x.current.delta;r<=0&&(r=0),r+p>=f&&(r=f-p),i({scrollLeft:r/f*(d+2)}),x.current.x=e.pageX},T=function(){if(o.current){var e=eC(o.current).top,t=e+o.current.offsetHeight,n=c===window?document.documentElement.scrollTop+window.innerHeight:eC(c).top+c.clientHeight;t-(0,K.Z)()<=n||e>=n-l?b(function(e){return(0,O.Z)((0,O.Z)({},e),{},{isHiddenScrollBar:!0})}):b(function(e){return(0,O.Z)((0,O.Z)({},e),{},{isHiddenScrollBar:!1})})}},A=function(e){b(function(t){return(0,O.Z)((0,O.Z)({},t),{},{scrollLeft:e/d*f||0})})};return(a.useImperativeHandle(t,function(){return{setScrollLeft:A}}),a.useEffect(function(){var e=eO(document.body,"mouseup",P,!1),t=eO(document.body,"mousemove",N,!1);return T(),function(){e.remove(),t.remove()}},[p,E]),a.useEffect(function(){var e=eO(c,"scroll",T,!1),t=eO(window,"resize",T,!1);return function(){e.remove(),t.remove()}},[c]),a.useEffect(function(){y.isHiddenScrollBar||b(function(e){var t=o.current;return t?(0,O.Z)((0,O.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[y.isHiddenScrollBar]),d<=f||!p||y.isHiddenScrollBar)?null:a.createElement("div",{style:{height:(0,K.Z)(),width:f,bottom:l},className:"".concat(u,"-sticky-scroll")},a.createElement("div",{onMouseDown:function(e){e.persist(),x.current.delta=e.pageX-y.scrollLeft,x.current.x=0,j(!0),e.preventDefault()},ref:m,className:_()("".concat(u,"-sticky-scroll-bar"),(0,C.Z)({},"".concat(u,"-sticky-scroll-bar-active"),E)),style:{width:"".concat(p,"px"),transform:"translate3d(".concat(y.scrollLeft,"px, 0, 0)")}}))}),e_="rc-table",eP=[],eN={};function eT(){return"No Data"}var eA=a.forwardRef(function(e,t){var n,r=(0,O.Z)({rowKey:"key",prefixCls:e_,emptyText:eT},e),o=r.prefixCls,i=r.className,u=r.rowClassName,f=r.style,p=r.data,h=r.rowKey,g=r.scroll,v=r.tableLayout,y=r.direction,b=r.title,x=r.footer,w=r.summary,k=r.caption,j=r.id,T=r.showHeader,A=r.components,I=r.emptyText,R=r.onRow,D=r.onHeaderRow,Z=r.internalHooks,B=r.transformColumns,V=r.internalRefs,X=r.tailor,G=r.getContainerWidth,Y=r.sticky,Q=p||eP,J=!!Q.length,ee=Z===l,et=a.useCallback(function(e,t){return(0,N.Z)(A,e)||t},[A]),en=a.useMemo(function(){return"function"==typeof h?h:function(e){return e&&e[h]}},[h]),ea=et(["body"]),ei=(tH=a.useState(-1),tW=(tq=(0,s.Z)(tH,2))[0],tU=tq[1],tK=a.useState(-1),tV=(t$=(0,s.Z)(tK,2))[0],tX=t$[1],[tW,tV,a.useCallback(function(e,t){tU(e),tX(t)},[])]),ec=(0,s.Z)(ei,3),eu=ec[0],ef=ec[1],eh=ec[2],em=(tJ=(tY=r.expandable,tQ=(0,z.Z)(r,eo),!1===(tG="expandable"in r?(0,O.Z)((0,O.Z)({},tQ),tY):tQ).showExpandColumn&&(tG.expandIconColumnIndex=-1),tG).expandIcon,t0=tG.expandedRowKeys,t1=tG.defaultExpandedRowKeys,t2=tG.defaultExpandAllRows,t6=tG.expandedRowRender,t4=tG.onExpand,t3=tG.onExpandedRowsChange,t5=tG.childrenColumnName||"children",t8=a.useMemo(function(){return t6?"row":!!(r.expandable&&r.internalHooks===l&&r.expandable.__PARENT_RENDER_ICON__||Q.some(function(e){return e&&"object"===(0,E.Z)(e)&&e[t5]}))&&"nest"},[!!t6,Q]),t7=a.useState(function(){if(t1)return t1;if(t2){var e;return e=[],function t(n){(n||[]).forEach(function(n,r){e.push(en(n,r)),t(n[t5])})}(Q),e}return[]}),ne=(t9=(0,s.Z)(t7,2))[0],nt=t9[1],nn=a.useMemo(function(){return new Set(t0||ne||[])},[t0,ne]),nr=a.useCallback(function(e){var t,n=en(e,Q.indexOf(e)),r=nn.has(n);r?(nn.delete(n),t=(0,es.Z)(nn)):t=[].concat((0,es.Z)(nn),[n]),nt(t),t4&&t4(!r,e),t3&&t3(t)},[en,nn,Q,t4,t3]),[tG,t8,nn,tJ||ew,t5,nr]),eg=(0,s.Z)(em,6),ev=eg[0],ey=eg[1],eb=eg[2],eO=eg[3],eC=eg[4],eA=eg[5],eM=null==g?void 0:g.x,eI=a.useState(0),eR=(0,s.Z)(eI,2),eD=eR[0],eL=eR[1],eZ=ex((0,O.Z)((0,O.Z)((0,O.Z)({},r),ev),{},{expandable:!!ev.expandedRowRender,columnTitle:ev.columnTitle,expandedKeys:eb,getRowKey:en,onTriggerExpand:eA,expandIcon:eO,expandIconColumnIndex:ev.expandIconColumnIndex,direction:y,scrollWidth:ee&&X&&"number"==typeof eM?eM:null,clientWidth:eD}),ee?B:null),ez=(0,s.Z)(eZ,3),eB=ez[0],eF=ez[1],eH=ez[2],eq=null!=eH?eH:eM,eW=a.useMemo(function(){return{columns:eB,flattenColumns:eF}},[eB,eF]),eU=a.useRef(),eK=a.useRef(),e$=a.useRef(),eV=a.useRef();a.useImperativeHandle(t,function(){return{nativeElement:eU.current,scrollTo:function(e){var t;if(e$.current instanceof HTMLElement){var n=e.index,r=e.top,o=e.key;if(r)null===(a=e$.current)||void 0===a||a.scrollTo({top:r});else{var a,i,l=null!=o?o:en(Q[n]);null===(i=e$.current.querySelector('[data-row-key="'.concat(l,'"]')))||void 0===i||i.scrollIntoView()}}else null!==(t=e$.current)&&void 0!==t&&t.scrollTo&&e$.current.scrollTo(e)}}});var eX=a.useRef(),eG=a.useState(!1),eY=(0,s.Z)(eG,2),eQ=eY[0],eJ=eY[1],e0=a.useState(!1),e1=(0,s.Z)(e0,2),e2=e1[0],e6=e1[1],e4=ek(new Map),e3=(0,s.Z)(e4,2),e5=e3[0],e8=e3[1],e7=M(eF).map(function(e){return e5.get(e)}),e9=a.useMemo(function(){return e7},[e7.join("_")]),te=(no=eF.length,(0,a.useMemo)(function(){for(var e=[],t=[],n=0,r=0,o=0;o<no;o+=1)if("rtl"===y){t[o]=r,r+=e9[o]||0;var a=no-o-1;e[a]=n,n+=e9[a]||0}else{e[o]=n,n+=e9[o]||0;var i=no-o-1;t[i]=r,r+=e9[i]||0}return{left:e,right:t}},[e9,no,y])),tt=g&&null!=g.y,tn=g&&null!=eq||!!ev.fixed,tr=tn&&eF.some(function(e){return e.fixed}),to=a.useRef(),ta=(nl=void 0===(ni=(na="object"===(0,E.Z)(Y)?Y:{}).offsetHeader)?0:ni,nc=void 0===(ns=na.offsetSummary)?0:ns,nd=void 0===(nu=na.offsetScroll)?0:nu,np=(void 0===(nf=na.getContainer)?function(){return eS}:nf)()||eS,a.useMemo(function(){var e=!!Y;return{isSticky:e,stickyClassName:e?"".concat(o,"-sticky-holder"):"",offsetHeader:nl,offsetSummary:nc,offsetScroll:nd,container:np}},[nd,nl,nc,o,np])),ti=ta.isSticky,tl=ta.offsetHeader,ts=ta.offsetSummary,tc=ta.offsetScroll,tu=ta.stickyClassName,td=ta.container,tf=a.useMemo(function(){return null==w?void 0:w(Q)},[w,Q]),tp=(tt||ti)&&a.isValidElement(tf)&&tf.type===F&&tf.props.fixed;tt&&(nm={overflowY:"scroll",maxHeight:g.y}),tn&&(nh={overflowX:"auto"},tt||(nm={overflowY:"hidden"}),ng={width:!0===eq?"auto":eq,minWidth:"100%"});var th=a.useCallback(function(e,t){(0,W.Z)(eU.current)&&e8(function(n){if(n.get(e)!==t){var r=new Map(n);return r.set(e,t),r}return n})},[]),tm=function(e){var t=(0,a.useRef)(null),n=(0,a.useRef)();function r(){window.clearTimeout(n.current)}return(0,a.useEffect)(function(){return r},[]),[function(e){t.current=e,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)},function(){return t.current}]}(0),tg=(0,s.Z)(tm,2),tv=tg[0],ty=tg[1];function tb(e,t){t&&("function"==typeof t?t(e):t.scrollLeft!==e&&(t.scrollLeft=e,t.scrollLeft!==e&&setTimeout(function(){t.scrollLeft=e},0)))}var tx=(0,c.Z)(function(e){var t,n=e.currentTarget,r=e.scrollLeft,o="rtl"===y,a="number"==typeof r?r:n.scrollLeft,i=n||eN;ty()&&ty()!==i||(tv(i),tb(a,eK.current),tb(a,e$.current),tb(a,eX.current),tb(a,null===(t=to.current)||void 0===t?void 0:t.setScrollLeft));var l=n||eK.current;if(l){var s=l.scrollWidth,c=l.clientWidth;if(s===c){eJ(!1),e6(!1);return}o?(eJ(-a<s-c),e6(-a>0)):(eJ(a>0),e6(a<s-c))}}),tw=function(){tn&&e$.current?tx({currentTarget:e$.current}):(eJ(!1),e6(!1))},tk=a.useRef(!1);a.useEffect(function(){tk.current&&tw()},[tn,p,eB.length]),a.useEffect(function(){tk.current=!0},[]);var tS=a.useState(0),tE=(0,s.Z)(tS,2),tO=tE[0],tC=tE[1],tj=a.useState(!0),t_=(0,s.Z)(tj,2),tP=t_[0],tN=t_[1];a.useEffect(function(){X&&ee||(e$.current instanceof Element?tC((0,K.o)(e$.current).width):tC((0,K.o)(eV.current).width)),tN((0,U.G)("position","sticky"))},[]),a.useEffect(function(){ee&&V&&(V.body.current=e$.current)});var tT=a.useCallback(function(e){return a.createElement(a.Fragment,null,a.createElement(ep,e),"top"===tp&&a.createElement(H,e,tf))},[tp,tf]),tA=a.useCallback(function(e){return a.createElement(H,e,tf)},[tf]),tM=et(["table"],"table"),tI=a.useMemo(function(){return v||(tr?"max-content"===eq?"auto":"fixed":tt||ti||eF.some(function(e){return e.ellipsis})?"fixed":"auto")},[tt,tr,eF,v,ti]),tR={colWidths:e9,columCount:eF.length,stickyOffsets:te,onHeaderRow:D,fixHeader:tt,scroll:g},tD=a.useMemo(function(){return J?null:"function"==typeof I?I():I},[J,I]),tL=a.createElement(er,{data:Q,measureColumnWidth:tt||tn||ti}),tZ=a.createElement(el,{colWidths:eF.map(function(e){return e.width}),columns:eF}),tz=null!=k?a.createElement("caption",{className:"".concat(o,"-caption")},k):void 0,tB=(0,$.Z)(r,{data:!0}),tF=(0,$.Z)(r,{aria:!0});if(tt||ti){"function"==typeof ea?(ny=ea(Q,{scrollbarSize:tO,ref:e$,onScroll:tx}),tR.colWidths=eF.map(function(e,t){var n=e.width,r=t===eF.length-1?n-tO:n;return"number"!=typeof r||Number.isNaN(r)?0:r})):ny=a.createElement("div",{style:(0,O.Z)((0,O.Z)({},nh),nm),onScroll:tx,ref:e$,className:_()("".concat(o,"-body"))},a.createElement(tM,(0,m.Z)({style:(0,O.Z)((0,O.Z)({},ng),{},{tableLayout:tI})},tF),tz,tZ,tL,!tp&&tf&&a.createElement(H,{stickyOffsets:te,flattenColumns:eF,columns:eB},tf)));var tH,tq,tW,tU,tK,t$,tV,tX,tG,tY,tQ,tJ,t0,t1,t2,t6,t4,t3,t5,t8,t7,t9,ne,nt,nn,nr,no,na,ni,nl,ns,nc,nu,nd,nf,np,nh,nm,ng,nv,ny,nb=(0,O.Z)((0,O.Z)((0,O.Z)({noData:!Q.length,maxContentScroll:tn&&"max-content"===eq},tR),eW),{},{direction:y,stickyClassName:tu,onScroll:tx});nv=a.createElement(a.Fragment,null,!1!==T&&a.createElement(ed,(0,m.Z)({},nb,{stickyTopOffset:tl,className:"".concat(o,"-header"),ref:eK}),tT),ny,tp&&"top"!==tp&&a.createElement(ed,(0,m.Z)({},nb,{stickyBottomOffset:ts,className:"".concat(o,"-summary"),ref:eX}),tA),ti&&e$.current&&e$.current instanceof Element&&a.createElement(ej,{ref:to,offsetScroll:tc,scrollBodyRef:e$,onScroll:tx,container:td}))}else nv=a.createElement("div",{style:(0,O.Z)((0,O.Z)({},nh),nm),className:_()("".concat(o,"-content")),onScroll:tx,ref:e$},a.createElement(tM,(0,m.Z)({style:(0,O.Z)((0,O.Z)({},ng),{},{tableLayout:tI})},tF),tz,tZ,!1!==T&&a.createElement(ep,(0,m.Z)({},tR,eW)),tL,tf&&a.createElement(H,{stickyOffsets:te,flattenColumns:eF,columns:eB},tf)));var nx=a.createElement("div",(0,m.Z)({className:_()(o,i,(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},"".concat(o,"-rtl"),"rtl"===y),"".concat(o,"-ping-left"),eQ),"".concat(o,"-ping-right"),e2),"".concat(o,"-layout-fixed"),"fixed"===v),"".concat(o,"-fixed-header"),tt),"".concat(o,"-fixed-column"),tr),"".concat(o,"-scroll-horizontal"),tn),"".concat(o,"-has-fix-left"),eF[0]&&eF[0].fixed),"".concat(o,"-has-fix-right"),eF[eF.length-1]&&"right"===eF[eF.length-1].fixed)),style:f,id:j,ref:eU},tB),b&&a.createElement(eE,{className:"".concat(o,"-title")},b(Q)),a.createElement("div",{ref:eV,className:"".concat(o,"-container")},nv),x&&a.createElement(eE,{className:"".concat(o,"-footer")},x(Q)));tn&&(nx=a.createElement(q.Z,{onResize:function(e){var t=e.width,n=eU.current?eU.current.offsetWidth:t;ee&&G&&eU.current&&(n=G(eU.current,n)||n),n!==eD&&(tw(),eL(n))}},nx));var nw=(n=eF.map(function(e,t){return L(t,t,eF,te,y,null==eB?void 0:eB[t])}),(0,P.Z)(function(){return n},[n],function(e,t){return!(0,d.Z)(e,t)})),nk=a.useMemo(function(){return{scrollX:eq,prefixCls:o,getComponent:et,scrollbarSize:tO,direction:y,fixedInfoList:nw,isSticky:ti,supportSticky:tP,componentWidth:eD,fixHeader:tt,fixColumn:tr,horizonScroll:tn,tableLayout:tI,rowClassName:u,expandedRowClassName:ev.expandedRowClassName,expandIcon:eO,expandableType:ey,expandRowByClick:ev.expandRowByClick,expandedRowRender:ev.expandedRowRender,onTriggerExpand:eA,expandIconColumnIndex:ev.expandIconColumnIndex,indentSize:ev.indentSize,allColumnsFixedLeft:eF.every(function(e){return"left"===e.fixed}),emptyNode:tD,columns:eB,flattenColumns:eF,onColumnResize:th,hoverStartRow:eu,hoverEndRow:ef,onHover:eh,rowExpandable:ev.rowExpandable,onRow:R,getRowKey:en,expandedKeys:eb,childrenColumnName:eC}},[eq,o,et,tO,y,nw,ti,tP,eD,tt,tr,tn,tI,u,ev.expandedRowClassName,eO,ey,ev.expandRowByClick,ev.expandedRowRender,eA,ev.expandIconColumnIndex,ev.indentSize,tD,eB,eF,th,eu,ef,eh,ev.rowExpandable,R,en,eb,eC]);return a.createElement(S.Provider,{value:nk},nx)}),eM=x(eA,void 0);eM.EXPAND_COLUMN=i,eM.INTERNAL_HOOKS=l,eM.Column=function(e){return null},eM.ColumnGroup=function(e){return null},eM.Summary=F;var eI=n(48625),eR=p(null),eD=p(null),eL=function(e){var t,n=e.rowInfo,r=e.column,o=e.colIndex,i=e.indent,l=e.index,s=e.renderIndex,c=e.record,u=e.style,d=e.className,f=e.inverse,p=e.getHeight,g=r.render,v=r.dataIndex,y=r.className,b=r.width,x=h(eD,["columnsOffset"]).columnsOffset,w=Y(n,r,o,i,l),k=w.key,S=w.fixedInfo,E=w.appendCellNode,C=w.additionalCellProps,j=C.style,P=C.colSpan,N=void 0===P?1:P,T=C.rowSpan,A=void 0===T?1:T,M=x[(t=o-1)+(N||1)]-(x[t]||0),I=(0,O.Z)((0,O.Z)((0,O.Z)({},j),u),{},{flex:"0 0 ".concat(M,"px"),width:"".concat(M,"px"),marginRight:N>1?b-M:0,pointerEvents:"auto"}),R=a.useMemo(function(){return f?A<=1:0===N||0===A||A>1},[A,N,f]);R?I.visibility="hidden":f&&(I.height=null==p?void 0:p(A));var L={};return(0===A||0===N)&&(L.rowSpan=1,L.colSpan=1),a.createElement(D,(0,m.Z)({className:_()(y,d),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:"div",prefixCls:n.prefixCls,key:k,record:c,index:l,renderIndex:s,dataIndex:v,render:R?function(){return null}:g,shouldCellUpdate:r.shouldCellUpdate},S,{appendNode:E,additionalProps:(0,O.Z)((0,O.Z)({},C),{},{style:I},L)}))},eZ=["data","index","className","rowKey","style","extra","getHeight"],ez=w(a.forwardRef(function(e,t){var n,r=e.data,o=e.index,i=e.className,l=e.rowKey,s=e.style,c=e.extra,u=e.getHeight,d=(0,z.Z)(e,eZ),f=r.record,p=r.indent,g=r.index,v=h(S,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),y=v.scrollX,b=v.flattenColumns,x=v.prefixCls,w=v.fixColumn,k=v.componentWidth,E=X(f,l,o,p),j=E.rowSupportExpand,P=E.expanded,N=E.rowProps,T=E.expandedRowRender,A=E.expandedRowClassName;if(j&&P){var M=T(f,o,p+1,P),I=null==A?void 0:A(f,o,p),R={};w&&(R={style:(0,C.Z)({},"--virtual-width","".concat(k,"px"))});var L="".concat(x,"-expanded-row-cell");n=a.createElement("div",{className:_()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(p+1),I)},a.createElement(D,{component:"div",prefixCls:x,className:_()(L,(0,C.Z)({},"".concat(L,"-fixed"),w)),additionalProps:R},M))}var Z=(0,O.Z)((0,O.Z)({},s),{},{width:y});c&&(Z.position="absolute",Z.pointerEvents="none");var B=a.createElement("div",(0,m.Z)({},N,d,{ref:j?null:t,className:_()(i,"".concat(x,"-row"),null==N?void 0:N.className,(0,C.Z)({},"".concat(x,"-row-extra"),c)),style:(0,O.Z)((0,O.Z)({},Z),null==N?void 0:N.style)}),b.map(function(e,t){return a.createElement(eL,{key:t,rowInfo:E,column:e,colIndex:t,indent:p,index:o,renderIndex:g,record:f,inverse:c,getHeight:u})}));return j?a.createElement("div",{ref:t},B,n):B})),eB=w(a.forwardRef(function(e,t){var n,r=e.data,o=e.onScroll,i=h(S,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","emptyNode","scrollX"]),l=i.flattenColumns,c=i.onColumnResize,u=i.getRowKey,d=i.expandedKeys,f=i.prefixCls,p=i.childrenColumnName,g=i.emptyNode,v=i.scrollX,y=h(eR),b=y.sticky,x=y.scrollY,w=y.listItemHeight,k=a.useRef(),O=V(r,p,d,u),C=a.useMemo(function(){var e=0;return l.map(function(t){var n=t.width,r=t.key;return e+=n,[r,n,e]})},[l]),j=a.useMemo(function(){return C.map(function(e){return e[2]})},[C]);a.useEffect(function(){C.forEach(function(e){var t=(0,s.Z)(e,2);c(t[0],t[1])})},[C]),a.useImperativeHandle(t,function(){var e={scrollTo:function(e){var t;null===(t=k.current)||void 0===t||t.scrollTo(e)}};return Object.defineProperty(e,"scrollLeft",{get:function(){var e;return(null===(e=k.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=k.current)||void 0===t||t.scrollTo({left:e})}}),e});var P=function(e,t){var n=null===(o=O[t])||void 0===o?void 0:o.record,r=e.onCell;if(r){var o,a,i=r(n,t);return null!==(a=null==i?void 0:i.rowSpan)&&void 0!==a?a:1}return 1},N=a.useMemo(function(){return{columnsOffset:j}},[j]),T="".concat(f,"-tbody");if(O.length){var A={};b&&(A.position="sticky",A.bottom=0,"object"===(0,E.Z)(b)&&b.offsetScroll&&(A.bottom=b.offsetScroll)),n=a.createElement(eI.Z,{fullHeight:!1,ref:k,styles:{horizontalScrollBar:A},className:_()(T,"".concat(T,"-virtual")),height:x,itemHeight:w||24,data:O,itemKey:function(e){return u(e.record)},scrollWidth:v,onVirtualScroll:function(e){o({scrollLeft:e.x})},extraRender:function(e){var t=e.start,n=e.end,r=e.getSize,o=e.offsetY;if(n<0)return null;for(var i=l.filter(function(e){return 0===P(e,t)}),s=t,c=function(e){if(!(i=i.filter(function(t){return 0===P(t,e)})).length)return s=e,1},d=t;d>=0&&!c(d);d-=1);for(var f=l.filter(function(e){return 1!==P(e,n)}),p=n,h=function(e){if(!(f=f.filter(function(t){return 1!==P(t,e)})).length)return p=Math.max(e-1,n),1},m=n;m<O.length&&!h(m);m+=1);for(var g=[],v=function(e){if(!O[e])return 1;l.some(function(t){return P(t,e)>1})&&g.push(e)},y=s;y<=p;y+=1)if(v(y))continue;return g.map(function(e){var t=O[e],n=u(t.record,e),i=r(n);return a.createElement(ez,{key:e,data:t,rowKey:n,index:e,style:{top:-o+i.top},extra:!0,getHeight:function(t){var o=e+t-1,a=r(n,u(O[o].record,o));return a.bottom-a.top}})})}},function(e,t,n){var r=u(e.record,t);return a.createElement(ez,(0,m.Z)({data:e,rowKey:r,index:t},n))})}else n=a.createElement("div",{className:_()("".concat(f,"-placeholder"))},a.createElement(D,{component:"div",prefixCls:f},g));return a.createElement(eD.Provider,{value:N},n)})),eF=function(e,t){var n=t.ref,r=t.onScroll;return a.createElement(eB,{ref:n,data:e,onScroll:r})},eH=a.forwardRef(function(e,t){var n=e.columns,r=e.scroll,o=e.sticky,i=e.prefixCls,s=void 0===i?e_:i,c=e.className,u=e.listItemHeight,d=e.components,f=r||{},p=f.x,h=f.y;"number"!=typeof p&&(p=1),"number"!=typeof h&&(h=500);var g=a.useMemo(function(){return{sticky:o,scrollY:h,listItemHeight:u}},[o,h,u]);return a.createElement(eR.Provider,{value:g},a.createElement(eM,(0,m.Z)({},e,{className:_()(c,"".concat(s,"-virtual")),scroll:(0,O.Z)((0,O.Z)({},r),{},{x:p}),components:(0,O.Z)((0,O.Z)({},d),{},{body:eF}),columns:n,internalHooks:l,tailor:!0,ref:t})))});x(eH,void 0);var eq=n(70464),eW=n(76405),eU=n(25049),eK=n(63496),e$=n(15354),eV=n(15900),eX=a.createContext(null),eG=a.memo(function(e){for(var t,n=e.prefixCls,r=e.level,o=e.isStart,i=e.isEnd,l="".concat(n,"-indent-unit"),s=[],c=0;c<r;c+=1)s.push(a.createElement("span",{key:c,className:_()(l,(t={},(0,C.Z)(t,"".concat(l,"-start"),o[c]),(0,C.Z)(t,"".concat(l,"-end"),i[c]),t))}));return a.createElement("span",{"aria-hidden":"true",className:"".concat(n,"-indent")},s)}),eY=n(18694),eQ=["children"];function eJ(e,t){return"".concat(e,"-").concat(t)}function e0(e,t){return null!=e?e:t}function e1(e){var t=e||{},n=t.title,r=t._title,o=t.key,a=t.children,i=n||"title";return{title:i,_title:r||[i],key:o||"key",children:a||"children"}}function e2(e){return function e(t){return(0,eh.Z)(t).map(function(t){if(!(t&&t.type&&t.type.isTreeNode))return(0,T.ZP)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,r=t.props,o=r.children,a=(0,z.Z)(r,eQ),i=(0,O.Z)({key:n},a),l=e(o);return l.length&&(i.children=l),i}).filter(function(e){return e})}(e)}function e6(e,t,n){var r=e1(n),o=r._title,a=r.key,i=r.children,l=new Set(!0===t?[]:t),s=[];return!function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(c,u){for(var d,f=eJ(r?r.pos:"0",u),p=e0(c[a],f),h=0;h<o.length;h+=1){var m=o[h];if(void 0!==c[m]){d=c[m];break}}var g=(0,O.Z)((0,O.Z)({},(0,eY.Z)(c,[].concat((0,es.Z)(o),[a,i]))),{},{title:d,key:p,parent:r,pos:f,children:null,data:c,isStart:[].concat((0,es.Z)(r?r.isStart:[]),[0===u]),isEnd:[].concat((0,es.Z)(r?r.isEnd:[]),[u===n.length-1])});return s.push(g),!0===t||l.has(p)?g.children=e(c[i]||[],g):g.children=[],g})}(e),s}function e4(e){var t,n,r,o,a,i,l,s,c,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=d.initWrapper,p=d.processEntity,h=d.onProcessFinished,m=d.externalGetKey,g=d.childrenPropName,v=d.fieldNames,y=arguments.length>2?arguments[2]:void 0,b={},x={},w={posEntities:b,keyEntities:x};return f&&(w=f(w)||w),t=function(e){var t=e.node,n=e.index,r=e.pos,o=e.key,a=e.parentPos,i=e.level,l={node:t,nodes:e.nodes,index:n,key:o,pos:r,level:i},s=e0(o,r);b[r]=l,x[s]=l,l.parent=b[a],l.parent&&(l.parent.children=l.parent.children||[],l.parent.children.push(l)),p&&p(l,w)},n={externalGetKey:m||y,childrenPropName:g,fieldNames:v},a=(o=("object"===(0,E.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,i=o.externalGetKey,s=(l=e1(o.fieldNames)).key,c=l.children,u=a||c,i?"string"==typeof i?r=function(e){return e[i]}:"function"==typeof i&&(r=function(e){return i(e)}):r=function(e,t){return e0(e[s],t)},function n(o,a,i,l){var s=o?o[u]:e,c=o?eJ(i.pos,a):"0",d=o?[].concat((0,es.Z)(l),[o]):[];if(o){var f=r(o,c);t({node:o,index:a,pos:c,key:f,parentPos:i.node?i.pos:null,level:i.level+1,nodes:d})}s&&s.forEach(function(e,t){n(e,t,{node:o,pos:c,level:i?i.level+1:-1},d)})}(null),h&&h(w),w}function e3(e,t){var n=t.expandedKeys,r=t.selectedKeys,o=t.loadedKeys,a=t.loadingKeys,i=t.checkedKeys,l=t.halfCheckedKeys,s=t.dragOverNodeKey,c=t.dropPosition,u=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==r.indexOf(e),loaded:-1!==o.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==i.indexOf(e),halfChecked:-1!==l.indexOf(e),pos:String(u?u.pos:""),dragOver:s===e&&0===c,dragOverGapTop:s===e&&-1===c,dragOverGapBottom:s===e&&1===c}}function e5(e){var t=e.data,n=e.expanded,r=e.selected,o=e.checked,a=e.loaded,i=e.loading,l=e.halfChecked,s=e.dragOver,c=e.dragOverGapTop,u=e.dragOverGapBottom,d=e.pos,f=e.active,p=e.eventKey,h=(0,O.Z)((0,O.Z)({},t),{},{expanded:n,selected:r,checked:o,loaded:a,loading:i,halfChecked:l,dragOver:s,dragOverGapTop:c,dragOverGapBottom:u,pos:d,active:f,key:p});return"props"in h||Object.defineProperty(h,"props",{get:function(){return(0,T.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),h}var e8=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e7="open",e9="close",te=function(e){(0,e$.Z)(n,e);var t=(0,eV.Z)(n);function n(){var e;(0,eW.Z)(this,n);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={dragNodeHighlight:!1},e.selectHandle=void 0,e.cacheIndent=void 0,e.onSelectorClick=function(t){(0,e.props.context.onNodeClick)(t,e5(e.props)),e.isSelectable()?e.onSelect(t):e.onCheck(t)},e.onSelectorDoubleClick=function(t){(0,e.props.context.onNodeDoubleClick)(t,e5(e.props))},e.onSelect=function(t){e.isDisabled()||(0,e.props.context.onNodeSelect)(t,e5(e.props))},e.onCheck=function(t){if(!e.isDisabled()){var n=e.props,r=n.disableCheckbox,o=n.checked,a=e.props.context.onNodeCheck;e.isCheckable()&&!r&&a(t,e5(e.props),!o)}},e.onMouseEnter=function(t){(0,e.props.context.onNodeMouseEnter)(t,e5(e.props))},e.onMouseLeave=function(t){(0,e.props.context.onNodeMouseLeave)(t,e5(e.props))},e.onContextMenu=function(t){(0,e.props.context.onNodeContextMenu)(t,e5(e.props))},e.onDragStart=function(t){var n=e.props.context.onNodeDragStart;t.stopPropagation(),e.setState({dragNodeHighlight:!0}),n(t,(0,eK.Z)(e));try{t.dataTransfer.setData("text/plain","")}catch(e){}},e.onDragEnter=function(t){var n=e.props.context.onNodeDragEnter;t.preventDefault(),t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragOver=function(t){var n=e.props.context.onNodeDragOver;t.preventDefault(),t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragLeave=function(t){var n=e.props.context.onNodeDragLeave;t.stopPropagation(),n(t,(0,eK.Z)(e))},e.onDragEnd=function(t){var n=e.props.context.onNodeDragEnd;t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,eK.Z)(e))},e.onDrop=function(t){var n=e.props.context.onNodeDrop;t.preventDefault(),t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,(0,eK.Z)(e))},e.onExpand=function(t){var n=e.props,r=n.loading,o=n.context.onNodeExpand;r||o(t,e5(e.props))},e.setSelectHandle=function(t){e.selectHandle=t},e.getNodeState=function(){var t=e.props.expanded;return e.isLeaf()?null:t?e7:e9},e.hasChildren=function(){var t=e.props.eventKey;return!!((e.props.context.keyEntities[t]||{}).children||[]).length},e.isLeaf=function(){var t=e.props,n=t.isLeaf,r=t.loaded,o=e.props.context.loadData,a=e.hasChildren();return!1!==n&&(n||!o&&!a||o&&r&&!a)},e.isDisabled=function(){var t=e.props.disabled;return!!(e.props.context.disabled||t)},e.isCheckable=function(){var t=e.props.checkable,n=e.props.context.checkable;return!!n&&!1!==t&&n},e.syncLoadData=function(t){var n=t.expanded,r=t.loading,o=t.loaded,a=e.props.context,i=a.loadData,l=a.onNodeLoad;!r&&(!i||!n||e.isLeaf()||e.hasChildren()||o||l(e5(e.props)))},e.isDraggable=function(){var t=e.props,n=t.data,r=t.context.draggable;return!!(r&&(!r.nodeDraggable||r.nodeDraggable(n)))},e.renderDragHandler=function(){var t=e.props.context,n=t.draggable,r=t.prefixCls;return(null==n?void 0:n.icon)?a.createElement("span",{className:"".concat(r,"-draggable-icon")},n.icon):null},e.renderSwitcherIconDom=function(t){var n=e.props.switcherIcon,r=e.props.context.switcherIcon,o=n||r;return"function"==typeof o?o((0,O.Z)((0,O.Z)({},e.props),{},{isLeaf:t})):o},e.renderSwitcher=function(){var t=e.props.expanded,n=e.props.context.prefixCls;if(e.isLeaf()){var r=e.renderSwitcherIconDom(!0);return!1!==r?a.createElement("span",{className:_()("".concat(n,"-switcher"),"".concat(n,"-switcher-noop"))},r):null}var o=_()("".concat(n,"-switcher"),"".concat(n,"-switcher_").concat(t?e7:e9)),i=e.renderSwitcherIconDom(!1);return!1!==i?a.createElement("span",{onClick:e.onExpand,className:o},i):null},e.renderCheckbox=function(){var t=e.props,n=t.checked,r=t.halfChecked,o=t.disableCheckbox,i=e.props.context.prefixCls,l=e.isDisabled(),s=e.isCheckable();return s?a.createElement("span",{className:_()("".concat(i,"-checkbox"),n&&"".concat(i,"-checkbox-checked"),!n&&r&&"".concat(i,"-checkbox-indeterminate"),(l||o)&&"".concat(i,"-checkbox-disabled")),onClick:e.onCheck},"boolean"!=typeof s?s:null):null},e.renderIcon=function(){var t=e.props.loading,n=e.props.context.prefixCls;return a.createElement("span",{className:_()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(e.getNodeState()||"docu"),t&&"".concat(n,"-icon_loading"))})},e.renderSelector=function(){var t,n,r=e.state.dragNodeHighlight,o=e.props,i=o.title,l=void 0===i?"---":i,s=o.selected,c=o.icon,u=o.loading,d=o.data,f=e.props.context,p=f.prefixCls,h=f.showIcon,m=f.icon,g=f.loadData,v=f.titleRender,y=e.isDisabled(),b="".concat(p,"-node-content-wrapper");if(h){var x=c||m;t=x?a.createElement("span",{className:_()("".concat(p,"-iconEle"),"".concat(p,"-icon__customize"))},"function"==typeof x?x(e.props):x):e.renderIcon()}else g&&u&&(t=e.renderIcon());n="function"==typeof l?l(d):v?v(d):l;var w=a.createElement("span",{className:"".concat(p,"-title")},n);return a.createElement("span",{ref:e.setSelectHandle,title:"string"==typeof l?l:"",className:_()("".concat(b),"".concat(b,"-").concat(e.getNodeState()||"normal"),!y&&(s||r)&&"".concat(p,"-node-selected")),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onContextMenu:e.onContextMenu,onClick:e.onSelectorClick,onDoubleClick:e.onSelectorDoubleClick},t,w,e.renderDropIndicator())},e.renderDropIndicator=function(){var t=e.props,n=t.disabled,r=t.eventKey,o=e.props.context,a=o.draggable,i=o.dropLevelOffset,l=o.dropPosition,s=o.prefixCls,c=o.indent,u=o.dropIndicatorRender,d=o.dragOverNodeKey,f=o.direction,p=null!=c?c:e.cacheIndent;return e.cacheIndent=c,!n&&a&&d===r?u({dropPosition:l,dropLevelOffset:i,indent:p,prefixCls:s,direction:f}):null},e}return(0,eU.Z)(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var e=this.props.selectable,t=this.props.context.selectable;return"boolean"==typeof e?e:t}},{key:"render",value:function(){var e,t=this.props,n=t.eventKey,r=t.className,o=t.style,i=t.dragOver,l=t.dragOverGapTop,s=t.dragOverGapBottom,c=t.isLeaf,u=t.isStart,d=t.isEnd,f=t.expanded,p=t.selected,h=t.checked,g=t.halfChecked,v=t.loading,y=t.domRef,b=t.active,x=(t.data,t.onMouseMove),w=t.selectable,k=(0,z.Z)(t,e8),S=this.props.context,E=S.prefixCls,O=S.filterTreeNode,j=S.keyEntities,P=S.dropContainerKey,N=S.dropTargetKey,T=S.draggingNodeKey,A=this.isDisabled(),M=(0,$.Z)(k,{aria:!0,data:!0}),I=(j[n]||{}).level,R=d[d.length-1],D=this.isDraggable(),L=!A&&D,Z=T===n;return a.createElement("div",(0,m.Z)({ref:y,className:_()(r,"".concat(E,"-treenode"),(e={},(0,C.Z)(e,"".concat(E,"-treenode-disabled"),A),(0,C.Z)(e,"".concat(E,"-treenode-switcher-").concat(f?"open":"close"),!c),(0,C.Z)(e,"".concat(E,"-treenode-checkbox-checked"),h),(0,C.Z)(e,"".concat(E,"-treenode-checkbox-indeterminate"),g),(0,C.Z)(e,"".concat(E,"-treenode-selected"),p),(0,C.Z)(e,"".concat(E,"-treenode-loading"),v),(0,C.Z)(e,"".concat(E,"-treenode-active"),b),(0,C.Z)(e,"".concat(E,"-treenode-leaf-last"),R),(0,C.Z)(e,"".concat(E,"-treenode-draggable"),D),(0,C.Z)(e,"dragging",Z),(0,C.Z)(e,"drop-target",N===n),(0,C.Z)(e,"drop-container",P===n),(0,C.Z)(e,"drag-over",!A&&i),(0,C.Z)(e,"drag-over-gap-top",!A&&l),(0,C.Z)(e,"drag-over-gap-bottom",!A&&s),(0,C.Z)(e,"filter-node",O&&O(e5(this.props))),e)),style:o,draggable:L,"aria-grabbed":Z,onDragStart:L?this.onDragStart:void 0,onDragEnter:D?this.onDragEnter:void 0,onDragOver:D?this.onDragOver:void 0,onDragLeave:D?this.onDragLeave:void 0,onDrop:D?this.onDrop:void 0,onDragEnd:D?this.onDragEnd:void 0,onMouseMove:x},void 0!==w?{"aria-selected":!!w}:void 0,M),a.createElement(eG,{prefixCls:E,level:I,isStart:u,isEnd:d}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(a.Component),tt=function(e){return a.createElement(eX.Consumer,null,function(t){return a.createElement(te,(0,m.Z)({},e,{context:t}))})};function tn(e,t){if(!e)return[];var n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function tr(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function to(e){return e.split("-")}function ta(e,t,n,r,o,a,i,l,s,c){var u,d,f=e.clientX,p=e.clientY,h=e.target.getBoundingClientRect(),m=h.top,g=h.height,v=(("rtl"===c?-1:1)*(((null==o?void 0:o.x)||0)-f)-12)/r,y=l[n.props.eventKey];if(p<m+g/2){var b=i.findIndex(function(e){return e.key===y.key});y=l[i[b<=0?0:b-1].key]}var x=y.key,w=y,k=y.key,S=0,E=0;if(!s.includes(x))for(var O=0;O<v;O+=1)if(function(e){if(e.parent){var t=to(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}(y))y=y.parent,E+=1;else break;var C=t.props.data,j=y.node,_=!0;return 0===Number((u=to(y.pos))[u.length-1])&&0===y.level&&p<m+g/2&&a({dragNode:C,dropNode:j,dropPosition:-1})&&y.key===n.props.eventKey?S=-1:(w.children||[]).length&&s.includes(k)?a({dragNode:C,dropNode:j,dropPosition:0})?S=0:_=!1:0===E?v>-1.5?a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1:a({dragNode:C,dropNode:j,dropPosition:0})?S=0:a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1:a({dragNode:C,dropNode:j,dropPosition:1})?S=1:_=!1,{dropPosition:S,dropLevelOffset:E,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:k,dropContainerKey:0===S?null:(null===(d=y.parent)||void 0===d?void 0:d.key)||null,dropAllowed:_}}function ti(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function tl(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,E.Z)(e))return(0,T.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function ts(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(r){if(!n.has(r)){var o=t[r];if(o){n.add(r);var a=o.parent;!o.node.disabled&&a&&e(a.key)}}}(e)}),(0,es.Z)(n)}function tc(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function tu(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,o=t.checkable;return!!(n||r)||!1===o}function td(e,t,n,r){var o,a=[];o=r||tu;var i=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),l=new Map,s=0;return Object.keys(n).forEach(function(e){var t=n[e],r=t.level,o=l.get(r);o||(o=new Set,l.set(r,o)),o.add(t),s=Math.max(s,r)}),(0,T.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,r){for(var o=new Set(e),a=new Set,i=0;i<=n;i+=1)(t.get(i)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,i=void 0===a?[]:a;o.has(t)&&!r(n)&&i.filter(function(e){return!r(e.node)}).forEach(function(e){o.add(e.key)})});for(var l=new Set,s=n;s>=0;s-=1)(t.get(s)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||l.has(e.parent.key))){if(r(e.parent.node)){l.add(t.key);return}var n=!0,i=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=o.has(t);n&&!r&&(n=!1),!i&&(r||a.has(t))&&(i=!0)}),n&&o.add(t.key),i&&a.add(t.key),l.add(t.key)}});return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(tc(a,o))}}(i,l,s,o):function(e,t,n,r,o){for(var a=new Set(e),i=new Set(t),l=0;l<=r;l+=1)(n.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,r=e.children,l=void 0===r?[]:r;a.has(t)||i.has(t)||o(n)||l.filter(function(e){return!o(e.node)}).forEach(function(e){a.delete(e.key)})});i=new Set;for(var s=new Set,c=r;c>=0;c-=1)(n.get(c)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||s.has(e.parent.key))){if(o(e.parent.node)){s.add(t.key);return}var n=!0,r=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=a.has(t);n&&!o&&(n=!1),!r&&(o||i.has(t))&&(r=!0)}),n||a.delete(t.key),r&&i.add(t.key),s.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(tc(i,a))}}(i,t.halfCheckedKeys,l,s,o)}tt.displayName="TreeNode",tt.isTreeNode=1;var tf=n(50506),tp=n(13613),th=n(61994),tm=n(80795),tg=n(29967);let tv={},ty="SELECT_ALL",tb="SELECT_INVERT",tx="SELECT_NONE",tw=[],tk=(e,t)=>{let n=[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&(n=[].concat((0,es.Z)(n),(0,es.Z)(tk(e,t[e]))))}),n};var tS=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:r,defaultSelectedRowKeys:o,getCheckboxProps:i,onChange:l,onSelect:s,onSelectAll:c,onSelectInvert:u,onSelectNone:d,onSelectMultiple:f,columnWidth:p,type:h,selections:m,fixed:g,renderCell:v,hideSelectAll:y,checkStrictly:b=!0}=t||{},{prefixCls:x,data:w,pageData:k,getRecordByKey:S,getRowKey:E,expandType:O,childrenColumnName:C,locale:j,getPopupContainer:P}=e,N=(0,tp.ln)("Table"),[T,A]=function(e){let[t,n]=(0,a.useState)(null);return[(0,a.useCallback)((r,o,a)=>{let i=null!=t?t:r,l=Math.max(i||0,r),s=o.slice(Math.min(i||0,r),l+1).map(t=>e(t)),c=s.some(e=>!a.has(e)),u=[];return s.forEach(e=>{c?(a.has(e)||u.push(e),a.add(e)):(a.delete(e),u.push(e))}),n(c?l:null),u},[t]),e=>{n(e)}]}(e=>e),[M,I]=(0,tf.Z)(r||o||tw,{value:r}),R=a.useRef(new Map),D=(0,a.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=S(e);!n&&R.current.has(e)&&(n=R.current.get(e)),t.set(e,n)}),R.current=t}},[S,n]);a.useEffect(()=>{D(M)},[M]);let{keyEntities:L}=(0,a.useMemo)(()=>{if(b)return{keyEntities:null};let e=w;if(n){let t=new Set(w.map((e,t)=>E(e,t))),n=Array.from(R.current).reduce((e,n)=>{let[r,o]=n;return t.has(r)?e:e.concat(o)},[]);e=[].concat((0,es.Z)(e),(0,es.Z)(n))}return e4(e,{externalGetKey:E,childrenPropName:C})},[w,E,b,C,n]),Z=(0,a.useMemo)(()=>tk(C,k),[C,k]),z=(0,a.useMemo)(()=>{let e=new Map;return Z.forEach((t,n)=>{let r=E(t,n),o=(i?i(t):null)||{};e.set(r,o)}),e},[Z,E,i]),B=(0,a.useCallback)(e=>{var t;return!!(null===(t=z.get(E(e)))||void 0===t?void 0:t.disabled)},[z,E]),[F,H]=(0,a.useMemo)(()=>{if(b)return[M||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=td(M,!0,L,B);return[e||[],t]},[M,b,L,B]),q=(0,a.useMemo)(()=>new Set("radio"===h?F.slice(0,1):F),[F,h]),W=(0,a.useMemo)(()=>"radio"===h?new Set:new Set(H),[H,h]);a.useEffect(()=>{t||I(tw)},[!!t]);let U=(0,a.useCallback)((e,t)=>{let r,o;D(e),n?(r=e,o=e.map(e=>R.current.get(e))):(r=[],o=[],e.forEach(e=>{let t=S(e);void 0!==t&&(r.push(e),o.push(t))})),I(r),null==l||l(r,o,{type:t})},[I,S,l,n]),K=(0,a.useCallback)((e,t,n,r)=>{if(s){let o=n.map(e=>S(e));s(S(e),t,o,r)}U(n,"single")},[s,S,U]),$=(0,a.useMemo)(()=>!m||y?null:(!0===m?[ty,tb,tx]:m).map(e=>e===ty?{key:"all",text:j.selectionAll,onSelect(){U(w.map((e,t)=>E(e,t)).filter(e=>{let t=z.get(e);return!(null==t?void 0:t.disabled)||q.has(e)}),"all")}}:e===tb?{key:"invert",text:j.selectInvert,onSelect(){let e=new Set(q);k.forEach((t,n)=>{let r=E(t,n),o=z.get(r);(null==o?void 0:o.disabled)||(e.has(r)?e.delete(r):e.add(r))});let t=Array.from(e);u&&(N.deprecated(!1,"onSelectInvert","onChange"),u(t)),U(t,"invert")}}:e===tx?{key:"none",text:j.selectNone,onSelect(){null==d||d(),U(Array.from(q).filter(e=>{let t=z.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null===(t=e.onSelect)||void 0===t||t.call.apply(t,[e].concat(r)),A(null)}})),[m,q,k,E,u,U]);return[(0,a.useCallback)(e=>{var n;let r,o,i;if(!t)return e.filter(e=>e!==tv);let l=(0,es.Z)(e),s=new Set(q),u=Z.map(E).filter(e=>!z.get(e).disabled),d=u.every(e=>s.has(e)),w=u.some(e=>s.has(e));if("radio"!==h){let e;if($){let t={getPopupContainer:P,items:$.map((e,t)=>{let{key:n,text:r,onSelect:o}=e;return{key:null!=n?n:t,onClick:()=>{null==o||o(u)},label:r}})};e=a.createElement("div",{className:"".concat(x,"-selection-extra")},a.createElement(tm.Z,{menu:t,getPopupContainer:P},a.createElement("span",null,a.createElement(eq.Z,null))))}let t=Z.map((e,t)=>{let n=E(e,t),r=z.get(n)||{};return Object.assign({checked:s.has(n)},r)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===Z.length,i=n&&t.every(e=>{let{checked:t}=e;return t}),l=n&&t.some(e=>{let{checked:t}=e;return t});o=a.createElement(th.Z,{checked:n?i:!!Z.length&&d,indeterminate:n?!i&&l:!d&&w,onChange:()=>{let e=[];d?u.forEach(t=>{s.delete(t),e.push(t)}):u.forEach(t=>{s.has(t)||(s.add(t),e.push(t))});let t=Array.from(s);null==c||c(!d,t.map(e=>S(e)),e.map(e=>S(e))),U(t,"all"),A(null)},disabled:0===Z.length||n,"aria-label":e?"Custom selection":"Select all",skipGroup:!0}),r=!y&&a.createElement("div",{className:"".concat(x,"-selection")},o,e)}if(i="radio"===h?(e,t,n)=>{let r=E(t,n),o=s.has(r);return{node:a.createElement(tg.ZP,Object.assign({},z.get(r),{checked:o,onClick:e=>e.stopPropagation(),onChange:e=>{s.has(r)||K(r,!0,[r],e.nativeEvent)}})),checked:o}}:(e,t,n)=>{var r;let o;let i=E(t,n),l=s.has(i),c=W.has(i),d=z.get(i);return o="nest"===O?c:null!==(r=null==d?void 0:d.indeterminate)&&void 0!==r?r:c,{node:a.createElement(th.Z,Object.assign({},d,{indeterminate:o,checked:l,skipGroup:!0,onClick:e=>e.stopPropagation(),onChange:e=>{let{nativeEvent:t}=e,{shiftKey:n}=t,r=u.findIndex(e=>e===i),o=F.some(e=>u.includes(e));if(n&&b&&o){let e=T(r,u,s),t=Array.from(s);null==f||f(!l,t.map(e=>S(e)),e.map(e=>S(e))),U(t,"multiple")}else if(b){let e=l?tn(F,i):tr(F,i);K(i,!l,e,t)}else{let{checkedKeys:e,halfCheckedKeys:n}=td([].concat((0,es.Z)(F),[i]),!0,L,B),r=e;if(l){let t=new Set(e);t.delete(i),r=td(Array.from(t),{checked:!1,halfCheckedKeys:n},L,B).checkedKeys}K(i,!l,r,t)}l?A(null):A(r)}})),checked:l}},!l.includes(tv)){if(0===l.findIndex(e=>{var t;return(null===(t=e[ea])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=l;l=[e,tv].concat((0,es.Z)(t))}else l=[tv].concat((0,es.Z)(l))}let k=l.indexOf(tv),C=(l=l.filter((e,t)=>e!==tv||t===k))[k-1],j=l[k+1],N=g;void 0===N&&((null==j?void 0:j.fixed)!==void 0?N=j.fixed:(null==C?void 0:C.fixed)!==void 0&&(N=C.fixed)),N&&C&&(null===(n=C[ea])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===C.fixed&&(C.fixed=N);let M=_()("".concat(x,"-selection-col"),{["".concat(x,"-selection-col-with-dropdown")]:m&&"checkbox"===h}),I={fixed:N,width:p,className:"".concat(x,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(o):t.columnTitle:r,render:(e,t,n)=>{let{node:r,checked:o}=i(e,t,n);return v?v(o,t,n,r):r},onCell:t.onCell,[ea]:{className:M}};return l.map(e=>e===tv?I:e)},[E,Z,t,F,q,W,p,$,O,z,f,K,B]),q]},tE=n(53346);function tO(e){return null!=e&&e===e.window}var tC=n(71744),tj=n(91086),t_=n(64024),tP=n(33759),tN=n(28617),tT=n(13823),tA={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},tM=n(55015),tI=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:tA}))}),tR={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},tD=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:tR}))}),tL=n(15327),tZ=n(77565),tz=n(95814),tB={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},tF=["10","20","50","100"],tH=function(e){var t=e.pageSizeOptions,n=void 0===t?tF:t,r=e.locale,o=e.changeSize,i=e.pageSize,l=e.goButton,c=e.quickGo,u=e.rootPrefixCls,d=e.selectComponentClass,f=e.selectPrefixCls,p=e.disabled,h=e.buildOptionText,m=a.useState(""),g=(0,s.Z)(m,2),v=g[0],y=g[1],b=function(){return!v||Number.isNaN(v)?void 0:Number(v)},x="function"==typeof h?h:function(e){return"".concat(e," ").concat(r.items_per_page)},w=function(e){""!==v&&(e.keyCode===tz.Z.ENTER||"click"===e.type)&&(y(""),null==c||c(b()))},k="".concat(u,"-options");if(!o&&!c)return null;var S=null,E=null,O=null;if(o&&d){var C=(n.some(function(e){return e.toString()===i.toString()})?n:n.concat([i.toString()]).sort(function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))})).map(function(e,t){return a.createElement(d.Option,{key:t,value:e.toString()},x(e))});S=a.createElement(d,{disabled:p,prefixCls:f,showSearch:!1,className:"".concat(k,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(i||n[0]).toString(),onChange:function(e){null==o||o(Number(e))},getPopupContainer:function(e){return e.parentNode},"aria-label":r.page_size,defaultOpen:!1},C)}return c&&(l&&(O="boolean"==typeof l?a.createElement("button",{type:"button",onClick:w,onKeyUp:w,disabled:p,className:"".concat(k,"-quick-jumper-button")},r.jump_to_confirm):a.createElement("span",{onClick:w,onKeyUp:w},l)),E=a.createElement("div",{className:"".concat(k,"-quick-jumper")},r.jump_to,a.createElement("input",{disabled:p,type:"text",value:v,onChange:function(e){y(e.target.value)},onKeyUp:w,onBlur:function(e){!l&&""!==v&&(y(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(u,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(u,"-item"))>=0)||null==c||c(b()))},"aria-label":r.page}),r.page,O)),a.createElement("li",{className:k},S,E)},tq=function(e){var t,n=e.rootPrefixCls,r=e.page,o=e.active,i=e.className,l=e.showTitle,s=e.onClick,c=e.onKeyPress,u=e.itemRender,d="".concat(n,"-item"),f=_()(d,"".concat(d,"-").concat(r),(t={},(0,C.Z)(t,"".concat(d,"-active"),o),(0,C.Z)(t,"".concat(d,"-disabled"),!r),t),i),p=u(r,"page",a.createElement("a",{rel:"nofollow"},r));return p?a.createElement("li",{title:l?String(r):null,className:f,onClick:function(){s(r)},onKeyDown:function(e){c(e,s,r)},tabIndex:0},p):null},tW=function(e,t,n){return n};function tU(){}function tK(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function t$(e,t,n){return Math.floor((n-1)/(void 0===e?t:e))+1}var tV=function(e){var t,n,r,o,i,l=e.prefixCls,c=void 0===l?"rc-pagination":l,u=e.selectPrefixCls,d=e.className,f=e.selectComponentClass,p=e.current,h=e.defaultCurrent,g=e.total,v=void 0===g?0:g,y=e.pageSize,b=e.defaultPageSize,x=e.onChange,w=void 0===x?tU:x,k=e.hideOnSinglePage,S=e.showPrevNextJumpers,E=e.showQuickJumper,j=e.showLessItems,P=e.showTitle,N=void 0===P||P,T=e.onShowSizeChange,A=void 0===T?tU:T,M=e.locale,I=void 0===M?tB:M,R=e.style,D=e.totalBoundaryShowSizeChanger,L=e.disabled,Z=e.simple,z=e.showTotal,B=e.showSizeChanger,F=e.pageSizeOptions,H=e.itemRender,q=void 0===H?tW:H,W=e.jumpPrevIcon,U=e.jumpNextIcon,K=e.prevIcon,V=e.nextIcon,X=a.useRef(null),G=(0,tf.Z)(10,{value:y,defaultValue:void 0===b?10:b}),Y=(0,s.Z)(G,2),Q=Y[0],J=Y[1],ee=(0,tf.Z)(1,{value:p,defaultValue:void 0===h?1:h,postState:function(e){return Math.max(1,Math.min(e,t$(void 0,Q,v)))}}),et=(0,s.Z)(ee,2),en=et[0],er=et[1],eo=a.useState(en),ea=(0,s.Z)(eo,2),ei=ea[0],el=ea[1];(0,a.useEffect)(function(){el(en)},[en]);var es=Math.max(1,en-(j?3:5)),ec=Math.min(t$(void 0,Q,v),en+(j?3:5));function eu(t,n){var r=t||a.createElement("button",{type:"button","aria-label":n,className:"".concat(c,"-item-link")});return"function"==typeof t&&(r=a.createElement(t,(0,O.Z)({},e))),r}function ed(e){var t=e.target.value,n=t$(void 0,Q,v);return""===t?t:Number.isNaN(Number(t))?ei:t>=n?n:Number(t)}var ef=v>Q&&E;function ep(e){var t=ed(e);switch(t!==ei&&el(t),e.keyCode){case tz.Z.ENTER:eh(t);break;case tz.Z.UP:eh(t-1);break;case tz.Z.DOWN:eh(t+1)}}function eh(e){if(tK(e)&&e!==en&&tK(v)&&v>0&&!L){var t=t$(void 0,Q,v),n=e;return e>t?n=t:e<1&&(n=1),n!==ei&&el(n),er(n),null==w||w(n,Q),n}return en}var em=en>1,eg=en<t$(void 0,Q,v),ev=null!=B?B:v>(void 0===D?50:D);function ey(){em&&eh(en-1)}function eb(){eg&&eh(en+1)}function ex(){eh(es)}function ew(){eh(ec)}function ek(e,t){if("Enter"===e.key||e.charCode===tz.Z.ENTER||e.keyCode===tz.Z.ENTER){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];t.apply(void 0,r)}}function eS(e){("click"===e.type||e.keyCode===tz.Z.ENTER)&&eh(ei)}var eE=null,eO=(0,$.Z)(e,{aria:!0,data:!0}),eC=z&&a.createElement("li",{className:"".concat(c,"-total-text")},z(v,[0===v?0:(en-1)*Q+1,en*Q>v?v:en*Q])),ej=null,e_=t$(void 0,Q,v);if(k&&v<=Q)return null;var eP=[],eN={rootPrefixCls:c,onClick:eh,onKeyPress:ek,showTitle:N,itemRender:q,page:-1},eT=en-1>0?en-1:0,eA=en+1<e_?en+1:e_,eM=E&&E.goButton,eI=eM,eR=null;Z&&(eM&&(eI="boolean"==typeof eM?a.createElement("button",{type:"button",onClick:eS,onKeyUp:eS},I.jump_to_confirm):a.createElement("span",{onClick:eS,onKeyUp:eS},eM),eI=a.createElement("li",{title:N?"".concat(I.jump_to).concat(en,"/").concat(e_):null,className:"".concat(c,"-simple-pager")},eI)),eR=a.createElement("li",{title:N?"".concat(en,"/").concat(e_):null,className:"".concat(c,"-simple-pager")},a.createElement("input",{type:"text",value:ei,disabled:L,onKeyDown:function(e){(e.keyCode===tz.Z.UP||e.keyCode===tz.Z.DOWN)&&e.preventDefault()},onKeyUp:ep,onChange:ep,onBlur:function(e){eh(ed(e))},size:3}),a.createElement("span",{className:"".concat(c,"-slash")},"/"),e_));var eD=j?1:2;if(e_<=3+2*eD){e_||eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:"noPager",page:1,className:"".concat(c,"-item-disabled")})));for(var eL=1;eL<=e_;eL+=1)eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:eL,page:eL,active:en===eL})))}else{var eZ=j?I.prev_3:I.prev_5,ez=j?I.next_3:I.next_5,eB=q(es,"jump-prev",eu(W,"prev page")),eF=q(ec,"jump-next",eu(U,"next page"));(void 0===S||S)&&(eE=eB?a.createElement("li",{title:N?eZ:null,key:"prev",onClick:ex,tabIndex:0,onKeyDown:function(e){ek(e,ex)},className:_()("".concat(c,"-jump-prev"),(0,C.Z)({},"".concat(c,"-jump-prev-custom-icon"),!!W))},eB):null,ej=eF?a.createElement("li",{title:N?ez:null,key:"next",onClick:ew,tabIndex:0,onKeyDown:function(e){ek(e,ew)},className:_()("".concat(c,"-jump-next"),(0,C.Z)({},"".concat(c,"-jump-next-custom-icon"),!!U))},eF):null);var eH=Math.max(1,en-eD),eq=Math.min(en+eD,e_);en-1<=eD&&(eq=1+2*eD),e_-en<=eD&&(eH=e_-2*eD);for(var eW=eH;eW<=eq;eW+=1)eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:eW,page:eW,active:en===eW})));if(en-1>=2*eD&&3!==en&&(eP[0]=a.cloneElement(eP[0],{className:_()("".concat(c,"-item-after-jump-prev"),eP[0].props.className)}),eP.unshift(eE)),e_-en>=2*eD&&en!==e_-2){var eU=eP[eP.length-1];eP[eP.length-1]=a.cloneElement(eU,{className:_()("".concat(c,"-item-before-jump-next"),eU.props.className)}),eP.push(ej)}1!==eH&&eP.unshift(a.createElement(tq,(0,m.Z)({},eN,{key:1,page:1}))),eq!==e_&&eP.push(a.createElement(tq,(0,m.Z)({},eN,{key:e_,page:e_})))}var eK=(t=q(eT,"prev",eu(K,"prev page")),a.isValidElement(t)?a.cloneElement(t,{disabled:!em}):t);if(eK){var e$=!em||!e_;eK=a.createElement("li",{title:N?I.prev_page:null,onClick:ey,tabIndex:e$?null:0,onKeyDown:function(e){ek(e,ey)},className:_()("".concat(c,"-prev"),(0,C.Z)({},"".concat(c,"-disabled"),e$)),"aria-disabled":e$},eK)}var eV=(n=q(eA,"next",eu(V,"next page")),a.isValidElement(n)?a.cloneElement(n,{disabled:!eg}):n);eV&&(Z?(o=!eg,i=em?0:null):i=(o=!eg||!e_)?null:0,eV=a.createElement("li",{title:N?I.next_page:null,onClick:eb,tabIndex:i,onKeyDown:function(e){ek(e,eb)},className:_()("".concat(c,"-next"),(0,C.Z)({},"".concat(c,"-disabled"),o)),"aria-disabled":o},eV));var eX=_()(c,d,(r={},(0,C.Z)(r,"".concat(c,"-simple"),Z),(0,C.Z)(r,"".concat(c,"-disabled"),L),r));return a.createElement("ul",(0,m.Z)({className:eX,style:R,ref:X},eO),eC,eK,Z?eR:eP,eV,a.createElement(tH,{locale:I,rootPrefixCls:c,disabled:L,selectComponentClass:f,selectPrefixCls:void 0===u?"rc-select":u,changeSize:ev?function(e){var t=t$(e,Q,v),n=en>t&&0!==t?t:en;J(e),el(n),null==A||A(en,e),er(n),null==w||w(n,e)}:null,pageSize:Q,pageSizeOptions:F,quickGo:ef?eh:null,goButton:eI}))},tX=n(96257),tG=n(55274),tY=n(52787);let tQ=e=>a.createElement(tY.default,Object.assign({},e,{showSearch:!0,size:"small"})),tJ=e=>a.createElement(tY.default,Object.assign({},e,{showSearch:!0,size:"middle"}));tQ.Option=tY.default.Option,tJ.Option=tY.default.Option;var t0=n(352),t1=n(31282),t2=n(37433),t6=n(12918),t4=n(3104),t3=n(80669),t5=n(65265);let t8=e=>{let{componentCls:t}=e;return{["".concat(t,"-disabled")]:{"&, &:hover":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},["&".concat(t,"-disabled")]:{cursor:"not-allowed",["".concat(t,"-item")]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},["".concat(t,"-item-link")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},["".concat(t,"-simple&")]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},["".concat(t,"-simple-pager")]:{color:e.colorTextDisabled},["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{["".concat(t,"-item-link-icon")]:{opacity:0},["".concat(t,"-item-ellipsis")]:{opacity:1}}},["&".concat(t,"-simple")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&".concat(t,"-disabled ").concat(t,"-item-link")]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},t7=e=>{let{componentCls:t}=e;return{["&".concat(t,"-mini ").concat(t,"-total-text, &").concat(t,"-mini ").concat(t,"-simple-pager")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-item")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.calc(e.itemSizeSM).sub(2).equal())},["&".concat(t,"-mini:not(").concat(t,"-disabled) ").concat(t,"-item:not(").concat(t,"-item-active)")]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},["&".concat(t,"-mini ").concat(t,"-prev, &").concat(t,"-mini ").concat(t,"-next")]:{minWidth:e.itemSizeSM,height:e.itemSizeSM,margin:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini:not(").concat(t,"-disabled)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover ").concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["\n &".concat(t,"-mini ").concat(t,"-prev ").concat(t,"-item-link,\n &").concat(t,"-mini ").concat(t,"-next ").concat(t,"-item-link\n ")]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}},["&".concat(t,"-mini ").concat(t,"-jump-prev, &").concat(t,"-mini ").concat(t,"-jump-next")]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:(0,t0.bf)(e.itemSizeSM)},["&".concat(t,"-mini ").concat(t,"-options")]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),input:Object.assign(Object.assign({},(0,t1.x0)(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},t9=e=>{let{componentCls:t}=e;return{["\n &".concat(t,"-simple ").concat(t,"-prev,\n &").concat(t,"-simple ").concat(t,"-next\n ")]:{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM),verticalAlign:"top",["".concat(t,"-item-link")]:{height:e.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSizeSM,lineHeight:(0,t0.bf)(e.itemSizeSM)}}},["&".concat(t,"-simple ").concat(t,"-simple-pager")]:{display:"inline-block",height:e.itemSizeSM,marginInlineEnd:e.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:e.marginXS,padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),textAlign:"center",backgroundColor:e.itemInputBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadius,outline:"none",transition:"border-color ".concat(e.motionDurationMid),color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:"".concat((0,t0.bf)(e.inputOutlineOffset)," 0 ").concat((0,t0.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}}}},ne=e=>{let{componentCls:t}=e;return{["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{outline:0,["".concat(t,"-item-container")]:{position:"relative",["".concat(t,"-item-link-icon")]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:"all ".concat(e.motionDurationMid),"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},["".concat(t,"-item-ellipsis")]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:"all ".concat(e.motionDurationMid)}},"&:hover":{["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}}},["\n ".concat(t,"-prev,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{marginInlineEnd:e.marginXS},["\n ".concat(t,"-prev,\n ").concat(t,"-next,\n ").concat(t,"-jump-prev,\n ").concat(t,"-jump-next\n ")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:"".concat((0,t0.bf)(e.itemSize)),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:"all ".concat(e.motionDurationMid)},["".concat(t,"-prev, ").concat(t,"-next")]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},["".concat(t,"-item-link")]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:"none",transition:"all ".concat(e.motionDurationMid)},["&:hover ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextHover},["&:active ".concat(t,"-item-link")]:{backgroundColor:e.colorBgTextActive},["&".concat(t,"-disabled:hover")]:{["".concat(t,"-item-link")]:{backgroundColor:"transparent"}}},["".concat(t,"-slash")]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},["".concat(t,"-options")]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:(0,t0.bf)(e.controlHeight),verticalAlign:"top",input:Object.assign(Object.assign(Object.assign({},(0,t1.ik)(e)),(0,t5.$U)(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},(0,t5.Xy)(e)),width:e.calc(e.controlHeightLG).mul(1.25).equal(),height:e.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},nt=e=>{let{componentCls:t}=e;return{["".concat(t,"-item")]:{display:"inline-block",minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:"0 ".concat((0,t0.bf)(e.paginationItemPaddingInline)),color:e.colorText,"&:hover":{textDecoration:"none"}},["&:not(".concat(t,"-item-active)")]:{"&:hover":{transition:"all ".concat(e.motionDurationMid),backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.colorPrimary},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.colorPrimaryHover}}}}},nn=e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,t6.Wf)(e)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},["".concat(t,"-total-text")]:{display:"inline-block",height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:(0,t0.bf)(e.calc(e.itemSize).sub(2).equal()),verticalAlign:"middle"}}),nt(e)),ne(e)),t9(e)),t7(e)),t8(e)),{["@media only screen and (max-width: ".concat(e.screenLG,"px)")]:{["".concat(t,"-item")]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},["@media only screen and (max-width: ".concat(e.screenSM,"px)")]:{["".concat(t,"-options")]:{display:"none"}}}),["&".concat(e.componentCls,"-rtl")]:{direction:"rtl"}}},nr=e=>{let{componentCls:t}=e;return{["".concat(t,":not(").concat(t,"-disabled)")]:{["".concat(t,"-item")]:Object.assign({},(0,t6.Qy)(e)),["".concat(t,"-jump-prev, ").concat(t,"-jump-next")]:{"&:focus-visible":Object.assign({["".concat(t,"-item-link-icon")]:{opacity:1},["".concat(t,"-item-ellipsis")]:{opacity:0}},(0,t6.oN)(e))},["".concat(t,"-prev, ").concat(t,"-next")]:{["&:focus-visible ".concat(t,"-item-link")]:Object.assign({},(0,t6.oN)(e))}}}},no=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},(0,t2.T)(e)),na=e=>(0,t4.TS)(e,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginXXS,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,t2.e)(e));var ni=(0,t3.I$)("Pagination",e=>{let t=na(e);return[nn(t),nr(t)]},no),nl=n(29961);let ns=e=>{let{componentCls:t}=e;return{["".concat(t).concat(t,"-bordered").concat(t,"-disabled:not(").concat(t,"-mini)")]:{"&, &:hover":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},"&:focus-visible":{["".concat(t,"-item-link")]:{borderColor:e.colorBorder}},["".concat(t,"-item, ").concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,["&:hover:not(".concat(t,"-item-active)")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},["&".concat(t,"-item-active")]:{backgroundColor:e.itemActiveBgDisabled}},["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},["".concat(t,"-item-link")]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},["".concat(t).concat(t,"-bordered:not(").concat(t,"-mini)")]:{["".concat(t,"-prev, ").concat(t,"-next")]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},["".concat(t,"-item-link")]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},["&:hover ".concat(t,"-item-link")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},["&".concat(t,"-disabled")]:{["".concat(t,"-item-link")]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},["".concat(t,"-item")]:{backgroundColor:e.itemBg,border:"".concat((0,t0.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),["&:hover:not(".concat(t,"-item-active)")]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}};var nc=(0,t3.bk)(["Pagination","bordered"],e=>[ns(na(e))],no),nu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},nd=e=>{let{prefixCls:t,selectPrefixCls:n,className:r,rootClassName:o,style:i,size:l,locale:s,selectComponentClass:c,responsive:u,showSizeChanger:d}=e,f=nu(e,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:p}=(0,tN.Z)(u),[,h]=(0,nl.ZP)(),{getPrefixCls:m,direction:g,pagination:v={}}=a.useContext(tC.E_),y=m("pagination",t),[b,x,w]=ni(y),k=null!=d?d:v.showSizeChanger,S=a.useMemo(()=>{let e=a.createElement("span",{className:"".concat(y,"-item-ellipsis")},"•••"),t=a.createElement("button",{className:"".concat(y,"-item-link"),type:"button",tabIndex:-1},"rtl"===g?a.createElement(tZ.Z,null):a.createElement(tL.Z,null));return{prevIcon:t,nextIcon:a.createElement("button",{className:"".concat(y,"-item-link"),type:"button",tabIndex:-1},"rtl"===g?a.createElement(tL.Z,null):a.createElement(tZ.Z,null)),jumpPrevIcon:a.createElement("a",{className:"".concat(y,"-item-link")},a.createElement("div",{className:"".concat(y,"-item-container")},"rtl"===g?a.createElement(tD,{className:"".concat(y,"-item-link-icon")}):a.createElement(tI,{className:"".concat(y,"-item-link-icon")}),e)),jumpNextIcon:a.createElement("a",{className:"".concat(y,"-item-link")},a.createElement("div",{className:"".concat(y,"-item-container")},"rtl"===g?a.createElement(tI,{className:"".concat(y,"-item-link-icon")}):a.createElement(tD,{className:"".concat(y,"-item-link-icon")}),e))}},[g,y]),[E]=(0,tG.Z)("Pagination",tX.Z),O=Object.assign(Object.assign({},E),s),C=(0,tP.Z)(l),j="small"===C||!!(p&&!C&&u),P=m("select",n),N=_()({["".concat(y,"-mini")]:j,["".concat(y,"-rtl")]:"rtl"===g,["".concat(y,"-bordered")]:h.wireframe},null==v?void 0:v.className,r,o,x,w),T=Object.assign(Object.assign({},null==v?void 0:v.style),i);return b(a.createElement(a.Fragment,null,h.wireframe&&a.createElement(nc,{prefixCls:y}),a.createElement(tV,Object.assign({},S,f,{style:T,prefixCls:y,selectPrefixCls:P,className:N,selectComponentClass:c||(j?tQ:tJ),locale:O,showSizeChanger:k}))))},nf=n(87908);function np(e,t){return"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t}function nh(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}function nm(e,t){return"function"==typeof e?e(t):e}var ng={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},nv=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:ng}))}),ny=n(51646),nb=n(73002),nx=n(85180),nw=n(45937),nk=n(88208);function nS(e){if(null==e)throw TypeError("Cannot destructure "+e)}var nE=n(47970),nO=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],nC=function(e,t){var n,r,o,i,l,c=e.className,d=e.style,f=e.motion,p=e.motionNodes,h=e.motionType,g=e.onMotionStart,v=e.onMotionEnd,y=e.active,b=e.treeNodeRequiredProps,x=(0,z.Z)(e,nO),w=a.useState(!0),k=(0,s.Z)(w,2),S=k[0],E=k[1],O=a.useContext(eX).prefixCls,C=p&&"hide"!==h;(0,u.Z)(function(){p&&C!==S&&E(C)},[p]);var j=a.useRef(!1),P=function(){p&&!j.current&&(j.current=!0,v())};return(n=function(){p&&g()},r=a.useState(!1),i=(o=(0,s.Z)(r,2))[0],l=o[1],(0,u.Z)(function(){if(i)return n(),function(){P()}},[i]),(0,u.Z)(function(){return l(!0),function(){l(!1)}},[]),p)?a.createElement(nE.ZP,(0,m.Z)({ref:t,visible:S},f,{motionAppear:"show"===h,onVisibleChanged:function(e){C===e&&P()}}),function(e,t){var n=e.className,r=e.style;return a.createElement("div",{ref:t,className:_()("".concat(O,"-treenode-motion"),n),style:r},p.map(function(e){var t=(0,m.Z)({},(nS(e.data),e.data)),n=e.title,r=e.key,o=e.isStart,i=e.isEnd;delete t.children;var l=e3(r,b);return a.createElement(tt,(0,m.Z)({},t,l,{title:n,active:y,data:e.data,key:r,isStart:o,isEnd:i}))}))}):a.createElement(tt,(0,m.Z)({domRef:t,className:c,style:d},x,{active:y}))};nC.displayName="MotionTreeNode";var nj=a.forwardRef(nC);function n_(e,t,n){var r=e.findIndex(function(e){return e.key===n}),o=e[r+1],a=t.findIndex(function(e){return e.key===n});if(o){var i=t.findIndex(function(e){return e.key===o.key});return t.slice(a+1,i)}return t.slice(a+1)}var nP=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],nN={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},nT=function(){},nA="RC_TREE_MOTION_".concat(Math.random()),nM={key:nA},nI={key:nA,level:0,index:0,pos:"0",node:nM,nodes:[nM]},nR={parent:null,children:[],pos:nI.pos,data:nM,title:null,key:nA,isStart:[],isEnd:[]};function nD(e,t,n,r){return!1!==t&&n?e.slice(0,Math.ceil(n/r)+1):e}function nL(e){return e0(e.key,e.pos)}var nZ=a.forwardRef(function(e,t){var n=e.prefixCls,r=e.data,o=(e.selectable,e.checkable,e.expandedKeys),i=e.selectedKeys,l=e.checkedKeys,c=e.loadedKeys,d=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,h=e.disabled,g=e.dragging,v=e.dragOverNodeKey,y=e.dropPosition,b=e.motion,x=e.height,w=e.itemHeight,k=e.virtual,S=e.focusable,E=e.activeItem,O=e.focused,C=e.tabIndex,j=e.onKeyDown,_=e.onFocus,P=e.onBlur,N=e.onActiveChange,T=e.onListChangeStart,A=e.onListChangeEnd,M=(0,z.Z)(e,nP),I=a.useRef(null),R=a.useRef(null);a.useImperativeHandle(t,function(){return{scrollTo:function(e){I.current.scrollTo(e)},getIndentWidth:function(){return R.current.offsetWidth}}});var D=a.useState(o),L=(0,s.Z)(D,2),Z=L[0],B=L[1],F=a.useState(r),H=(0,s.Z)(F,2),q=H[0],W=H[1],U=a.useState(r),K=(0,s.Z)(U,2),$=K[0],V=K[1],X=a.useState([]),G=(0,s.Z)(X,2),Y=G[0],Q=G[1],J=a.useState(null),ee=(0,s.Z)(J,2),et=ee[0],en=ee[1],er=a.useRef(r);function eo(){var e=er.current;W(e),V(e),Q([]),en(null),A()}er.current=r,(0,u.Z)(function(){B(o);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,r=t.length;if(1!==Math.abs(n-r))return{add:!1,key:null};function o(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var r=t.filter(function(e){return!n.has(e)});return 1===r.length?r[0]:null}return n<r?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}(Z,o);if(null!==e.key){if(e.add){var t=q.findIndex(function(t){return t.key===e.key}),n=nD(n_(q,r,e.key),k,x,w),a=q.slice();a.splice(t+1,0,nR),V(a),Q(n),en("show")}else{var i=r.findIndex(function(t){return t.key===e.key}),l=nD(n_(r,q,e.key),k,x,w),s=r.slice();s.splice(i+1,0,nR),V(s),Q(l),en("hide")}}else q!==r&&(W(r),V(r))},[o,r]),a.useEffect(function(){g||eo()},[g]);var ea=b?$:r,ei={expandedKeys:o,selectedKeys:i,loadedKeys:c,loadingKeys:d,checkedKeys:l,halfCheckedKeys:f,dragOverNodeKey:v,dropPosition:y,keyEntities:p};return a.createElement(a.Fragment,null,O&&E&&a.createElement("span",{style:nN,"aria-live":"assertive"},function(e){for(var t=String(e.data.key),n=e;n.parent;)n=n.parent,t="".concat(n.data.key," > ").concat(t);return t}(E)),a.createElement("div",null,a.createElement("input",{style:nN,disabled:!1===S||h,tabIndex:!1!==S?C:null,onKeyDown:j,onFocus:_,onBlur:P,value:"",onChange:nT,"aria-label":"for screen reader"})),a.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},a.createElement("div",{className:"".concat(n,"-indent")},a.createElement("div",{ref:R,className:"".concat(n,"-indent-unit")}))),a.createElement(eI.Z,(0,m.Z)({},M,{data:ea,itemKey:nL,height:x,fullHeight:!1,virtual:k,itemHeight:w,prefixCls:"".concat(n,"-list"),ref:I,onVisibleChange:function(e,t){var n=new Set(e);t.filter(function(e){return!n.has(e)}).some(function(e){return nL(e)===nA})&&eo()}}),function(e){var t=e.pos,n=(0,m.Z)({},(nS(e.data),e.data)),r=e.title,o=e.key,i=e.isStart,l=e.isEnd,s=e0(o,t);delete n.key,delete n.children;var c=e3(s,ei);return a.createElement(nj,(0,m.Z)({},n,c,{title:r,active:!!E&&o===E.key,pos:t,data:e.data,isStart:i,isEnd:l,motion:b,motionNodes:o===nA?Y:null,motionType:et,onMotionStart:T,onMotionEnd:eo,treeNodeRequiredProps:ei,onMouseMove:function(){N(null)}}))}))});nZ.displayName="NodeList";var nz=function(e){(0,e$.Z)(n,e);var t=(0,eV.Z)(n);function n(){var e;(0,eW.Z)(this,n);for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).destroyed=!1,e.delayedDragEnterLogic=void 0,e.loadingRetryTimes={},e.state={keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:e1()},e.dragStartMousePosition=null,e.dragNode=void 0,e.currentMouseOverDroppableNodeKey=null,e.listRef=a.createRef(),e.onNodeDragStart=function(t,n){var r,o=e.state,a=o.expandedKeys,i=o.keyEntities,l=e.props.onDragStart,s=n.props.eventKey;e.dragNode=n,e.dragStartMousePosition={x:t.clientX,y:t.clientY};var c=tn(a,s);e.setState({draggingNodeKey:s,dragChildrenKeys:(r=[],function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,o=t.children;r.push(n),e(o)})}(i[s].children),r),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(c),window.addEventListener("dragend",e.onWindowDragEnd),null==l||l({event:t,node:e5(n.props)})},e.onNodeDragEnter=function(t,n){var r=e.state,o=r.expandedKeys,a=r.keyEntities,i=r.dragChildrenKeys,l=r.flattenNodes,s=r.indent,c=e.props,u=c.onDragEnter,d=c.onExpand,f=c.allowDrop,p=c.direction,h=n.props,m=h.pos,g=h.eventKey,v=(0,eK.Z)(e).dragNode;if(e.currentMouseOverDroppableNodeKey!==g&&(e.currentMouseOverDroppableNodeKey=g),!v){e.resetDragState();return}var y=ta(t,v,n,s,e.dragStartMousePosition,f,l,a,o,p),b=y.dropPosition,x=y.dropLevelOffset,w=y.dropTargetKey,k=y.dropContainerKey,S=y.dropTargetPos,E=y.dropAllowed,O=y.dragOverNodeKey;if(-1!==i.indexOf(w)||!E||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),v.props.eventKey!==n.props.eventKey&&(t.persist(),e.delayedDragEnterLogic[m]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var r=(0,es.Z)(o),i=a[n.props.eventKey];i&&(i.children||[]).length&&(r=tr(o,n.props.eventKey)),"expandedKeys"in e.props||e.setExpandedKeys(r),null==d||d(r,{node:e5(n.props),expanded:!0,nativeEvent:t.nativeEvent})}},800)),v.props.eventKey===w&&0===x)){e.resetDragState();return}e.setState({dragOverNodeKey:O,dropPosition:b,dropLevelOffset:x,dropTargetKey:w,dropContainerKey:k,dropTargetPos:S,dropAllowed:E}),null==u||u({event:t,node:e5(n.props),expandedKeys:o})},e.onNodeDragOver=function(t,n){var r=e.state,o=r.dragChildrenKeys,a=r.flattenNodes,i=r.keyEntities,l=r.expandedKeys,s=r.indent,c=e.props,u=c.onDragOver,d=c.allowDrop,f=c.direction,p=(0,eK.Z)(e).dragNode;if(p){var h=ta(t,p,n,s,e.dragStartMousePosition,d,a,i,l,f),m=h.dropPosition,g=h.dropLevelOffset,v=h.dropTargetKey,y=h.dropContainerKey,b=h.dropAllowed,x=h.dropTargetPos,w=h.dragOverNodeKey;-1===o.indexOf(v)&&b&&(p.props.eventKey===v&&0===g?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():m===e.state.dropPosition&&g===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&y===e.state.dropContainerKey&&x===e.state.dropTargetPos&&b===e.state.dropAllowed&&w===e.state.dragOverNodeKey||e.setState({dropPosition:m,dropLevelOffset:g,dropTargetKey:v,dropContainerKey:y,dropTargetPos:x,dropAllowed:b,dragOverNodeKey:w}),null==u||u({event:t,node:e5(n.props)}))}},e.onNodeDragLeave=function(t,n){e.currentMouseOverDroppableNodeKey!==n.props.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var r=e.props.onDragLeave;null==r||r({event:t,node:e5(n.props)})},e.onWindowDragEnd=function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDragEnd=function(t,n){var r=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==r||r({event:t,node:e5(n.props)}),e.dragNode=null,window.removeEventListener("dragend",e.onWindowDragEnd)},e.onNodeDrop=function(t,n){var r,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,i=a.dragChildrenKeys,l=a.dropPosition,s=a.dropTargetKey,c=a.dropTargetPos;if(a.dropAllowed){var u=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==s){var d=(0,O.Z)((0,O.Z)({},e3(s,e.getTreeNodeRequiredProps())),{},{active:(null===(r=e.getActiveItem())||void 0===r?void 0:r.key)===s,data:e.state.keyEntities[s].node}),f=-1!==i.indexOf(s);(0,T.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=to(c),h={event:t,node:e5(d),dragNode:e.dragNode?e5(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(i),dropToGap:0!==l,dropPosition:l+Number(p[p.length-1])};o||null==u||u(h),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(t,n){var r=e.state,o=r.expandedKeys,a=r.flattenNodes,i=n.expanded,l=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var s=a.filter(function(e){return e.key===l})[0],c=e5((0,O.Z)((0,O.Z)({},e3(l,e.getTreeNodeRequiredProps())),{},{data:s.data}));e.setExpandedKeys(i?tn(o,l):tr(o,l)),e.onNodeExpand(t,c)}},e.onNodeClick=function(t,n){var r=e.props,o=r.onClick;"click"===r.expandAction&&e.triggerExpandActionExpand(t,n),null==o||o(t,n)},e.onNodeDoubleClick=function(t,n){var r=e.props,o=r.onDoubleClick;"doubleClick"===r.expandAction&&e.triggerExpandActionExpand(t,n),null==o||o(t,n)},e.onNodeSelect=function(t,n){var r=e.state.selectedKeys,o=e.state,a=o.keyEntities,i=o.fieldNames,l=e.props,s=l.onSelect,c=l.multiple,u=n.selected,d=n[i.key],f=!u,p=(r=f?c?tr(r,d):[d]:tn(r,d)).map(function(e){var t=a[e];return t?t.node:null}).filter(function(e){return e});e.setUncontrolledState({selectedKeys:r}),null==s||s(r,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,r){var o,a=e.state,i=a.keyEntities,l=a.checkedKeys,s=a.halfCheckedKeys,c=e.props,u=c.checkStrictly,d=c.onCheck,f=n.key,p={event:"check",node:n,checked:r,nativeEvent:t.nativeEvent};if(u){var h=r?tr(l,f):tn(l,f);o={checked:h,halfChecked:tn(s,f)},p.checkedNodes=h.map(function(e){return i[e]}).filter(function(e){return e}).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:h})}else{var m=td([].concat((0,es.Z)(l),[f]),!0,i),g=m.checkedKeys,v=m.halfCheckedKeys;if(!r){var y=new Set(g);y.delete(f);var b=td(Array.from(y),{checked:!1,halfCheckedKeys:v},i);g=b.checkedKeys,v=b.halfCheckedKeys}o=g,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=v,g.forEach(function(e){var t=i[e];if(t){var n=t.node,r=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:r})}}),e.setUncontrolledState({checkedKeys:g},!1,{halfCheckedKeys:v})}null==d||d(o,p)},e.onNodeLoad=function(t){var n=t.key,r=new Promise(function(r,o){e.setState(function(a){var i=a.loadedKeys,l=a.loadingKeys,s=void 0===l?[]:l,c=e.props,u=c.loadData,d=c.onLoad;return u&&-1===(void 0===i?[]:i).indexOf(n)&&-1===s.indexOf(n)?(u(t).then(function(){var o=tr(e.state.loadedKeys,n);null==d||d(o,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:o}),e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),r()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:tn(e.loadingKeys,n)}}),e.loadingRetryTimes[n]=(e.loadingRetryTimes[n]||0)+1,e.loadingRetryTimes[n]>=10){var a=e.state.loadedKeys;(0,T.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:tr(a,n)}),r()}o(t)}),{loadingKeys:tr(s,n)}):null})});return r.catch(function(){}),r},e.onNodeMouseEnter=function(t,n){var r=e.props.onMouseEnter;null==r||r({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var r=e.props.onMouseLeave;null==r||r({event:t,node:n})},e.onNodeContextMenu=function(t,n){var r=e.props.onRightClick;r&&(t.preventDefault(),r({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t||t.apply(void 0,r)},e.onBlur=function(){var t=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t||t.apply(void 0,r)},e.getTreeNodeRequiredProps=function(){var t=e.state;return{expandedKeys:t.expandedKeys||[],selectedKeys:t.selectedKeys||[],loadedKeys:t.loadedKeys||[],loadingKeys:t.loadingKeys||[],checkedKeys:t.checkedKeys||[],halfCheckedKeys:t.halfCheckedKeys||[],dragOverNodeKey:t.dragOverNodeKey,dropPosition:t.dropPosition,keyEntities:t.keyEntities}},e.setExpandedKeys=function(t){var n=e.state,r=e6(n.treeData,t,n.fieldNames);e.setUncontrolledState({expandedKeys:t,flattenNodes:r},!0)},e.onNodeExpand=function(t,n){var r=e.state.expandedKeys,o=e.state,a=o.listChanging,i=o.fieldNames,l=e.props,s=l.onExpand,c=l.loadData,u=n.expanded,d=n[i.key];if(!a){var f=r.indexOf(d),p=!u;if((0,T.ZP)(u&&-1!==f||!u&&-1===f,"Expand state not sync with index check"),r=p?tr(r,d):tn(r,d),e.setExpandedKeys(r),null==s||s(r,{node:n,expanded:p,nativeEvent:t.nativeEvent}),p&&c){var h=e.onNodeLoad(n);h&&h.then(function(){var t=e6(e.state.treeData,r,i);e.setUncontrolledState({flattenNodes:t})}).catch(function(){var t=tn(e.state.expandedKeys,d);e.setExpandedKeys(t)})}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout(function(){e.setUncontrolledState({listChanging:!1})})},e.onActiveChange=function(t){var n=e.state.activeKey,r=e.props,o=r.onActiveChange,a=r.itemScrollOffset;n!==t&&(e.setState({activeKey:t}),null!==t&&e.scrollTo({key:t,offset:void 0===a?0:a}),null==o||o(t))},e.getActiveItem=function(){var t=e.state,n=t.activeKey,r=t.flattenNodes;return null===n?null:r.find(function(e){return e.key===n})||null},e.offsetActiveKey=function(t){var n=e.state,r=n.flattenNodes,o=n.activeKey,a=r.findIndex(function(e){return e.key===o});-1===a&&t<0&&(a=r.length),a=(a+t+r.length)%r.length;var i=r[a];if(i){var l=i.key;e.onActiveChange(l)}else e.onActiveChange(null)},e.onKeyDown=function(t){var n=e.state,r=n.activeKey,o=n.expandedKeys,a=n.checkedKeys,i=n.fieldNames,l=e.props,s=l.onKeyDown,c=l.checkable,u=l.selectable;switch(t.which){case tz.Z.UP:e.offsetActiveKey(-1),t.preventDefault();break;case tz.Z.DOWN:e.offsetActiveKey(1),t.preventDefault()}var d=e.getActiveItem();if(d&&d.data){var f=e.getTreeNodeRequiredProps(),p=!1===d.data.isLeaf||!!(d.data[i.children]||[]).length,h=e5((0,O.Z)((0,O.Z)({},e3(r,f)),{},{data:d.data,active:!0}));switch(t.which){case tz.Z.LEFT:p&&o.includes(r)?e.onNodeExpand({},h):d.parent&&e.onActiveChange(d.parent.key),t.preventDefault();break;case tz.Z.RIGHT:p&&!o.includes(r)?e.onNodeExpand({},h):d.children&&d.children.length&&e.onActiveChange(d.children[0].key),t.preventDefault();break;case tz.Z.ENTER:case tz.Z.SPACE:!c||h.disabled||!1===h.checkable||h.disableCheckbox?c||!u||h.disabled||!1===h.selectable||e.onNodeSelect({},h):e.onNodeCheck({},h,!a.includes(r))}}null==s||s(t)},e.setUncontrolledState=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var o=!1,a=!0,i={};Object.keys(t).forEach(function(n){if(n in e.props){a=!1;return}o=!0,i[n]=t[n]}),o&&(!n||a)&&e.setState((0,O.Z)((0,O.Z)({},i),r))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return(0,eU.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t,n=this.state,r=n.focused,o=n.flattenNodes,i=n.keyEntities,l=n.draggingNodeKey,s=n.activeKey,c=n.dropLevelOffset,u=n.dropContainerKey,d=n.dropTargetKey,f=n.dropPosition,p=n.dragOverNodeKey,h=n.indent,g=this.props,v=g.prefixCls,y=g.className,b=g.style,x=g.showLine,w=g.focusable,k=g.tabIndex,S=g.selectable,O=g.showIcon,j=g.icon,P=g.switcherIcon,N=g.draggable,T=g.checkable,A=g.checkStrictly,M=g.disabled,I=g.motion,R=g.loadData,D=g.filterTreeNode,L=g.height,Z=g.itemHeight,z=g.virtual,B=g.titleRender,F=g.dropIndicatorRender,H=g.onContextMenu,q=g.onScroll,W=g.direction,U=g.rootClassName,K=g.rootStyle,V=(0,$.Z)(this.props,{aria:!0,data:!0});return N&&(t="object"===(0,E.Z)(N)?N:"function"==typeof N?{nodeDraggable:N}:{}),a.createElement(eX.Provider,{value:{prefixCls:v,selectable:S,showIcon:O,icon:j,switcherIcon:P,draggable:t,draggingNodeKey:l,checkable:T,checkStrictly:A,disabled:M,keyEntities:i,dropLevelOffset:c,dropContainerKey:u,dropTargetKey:d,dropPosition:f,dragOverNodeKey:p,indent:h,direction:W,dropIndicatorRender:F,loadData:R,filterTreeNode:D,titleRender:B,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},a.createElement("div",{role:"tree",className:_()(v,y,U,(e={},(0,C.Z)(e,"".concat(v,"-show-line"),x),(0,C.Z)(e,"".concat(v,"-focused"),r),(0,C.Z)(e,"".concat(v,"-active-focused"),null!==s),e)),style:K},a.createElement(nZ,(0,m.Z)({ref:this.listRef,prefixCls:v,style:b,data:o,disabled:M,selectable:S,checkable:!!T,motion:I,dragging:null!==l,height:L,itemHeight:Z,virtual:z,focusable:w,focused:r,tabIndex:void 0===k?0:k,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:H,onScroll:q},this.getTreeNodeRequiredProps(),V))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,r,o=t.prevProps,a={prevProps:e};function i(t){return!o&&t in e||o&&o[t]!==e[t]}var l=t.fieldNames;if(i("fieldNames")&&(l=e1(e.fieldNames),a.fieldNames=l),i("treeData")?n=e.treeData:i("children")&&((0,T.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=e2(e.children)),n){a.treeData=n;var s=e4(n,{fieldNames:l});a.keyEntities=(0,O.Z)((0,C.Z)({},nA,nI),s.keyEntities)}var c=a.keyEntities||t.keyEntities;if(i("expandedKeys")||o&&i("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!o&&e.defaultExpandParent?ts(e.expandedKeys,c):e.expandedKeys;else if(!o&&e.defaultExpandAll){var u=(0,O.Z)({},c);delete u[nA],a.expandedKeys=Object.keys(u).map(function(e){return u[e].key})}else!o&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?ts(e.defaultExpandedKeys,c):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var d=e6(n||t.treeData,a.expandedKeys||t.expandedKeys,l);a.flattenNodes=d}if(e.selectable&&(i("selectedKeys")?a.selectedKeys=ti(e.selectedKeys,e):!o&&e.defaultSelectedKeys&&(a.selectedKeys=ti(e.defaultSelectedKeys,e))),e.checkable&&(i("checkedKeys")?r=tl(e.checkedKeys)||{}:!o&&e.defaultCheckedKeys?r=tl(e.defaultCheckedKeys)||{}:n&&(r=tl(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),r)){var f=r,p=f.checkedKeys,h=void 0===p?[]:p,m=f.halfCheckedKeys,g=void 0===m?[]:m;if(!e.checkStrictly){var v=td(h,!0,c);h=v.checkedKeys,g=v.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=g}return i("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(a.Component);nz.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:o.top=0,o.left=-n*r;break;case 1:o.bottom=0,o.left=-n*r;break;case 0:o.bottom=0,o.left=r}return a.createElement("div",{style:o})},allowDrop:function(){return!0},expandAction:!1},nz.TreeNode=tt;var nB={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},nF=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nB}))}),nH={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nq=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nH}))}),nW={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nU=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nW}))}),nK={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},n$=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:nK}))}),nV=n(68710),nX=n(23159),nG=n(63074);let nY=new t0.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nQ=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nJ=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,t0.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),n0=(e,t)=>{let{treeCls:n,treeNodeCls:r,treeNodePadding:o,titleHeight:a,nodeSelectedBg:i,nodeHoverBg:l}=t,s=t.paddingXS;return{[n]:Object.assign(Object.assign({},(0,t6.Wf)(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),["&".concat(n,"-rtl")]:{["".concat(n,"-switcher")]:{"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(90deg)"}}}}},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:Object.assign({},(0,t6.oN)(t)),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(r,".dragging")]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:nY,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},["".concat(r)]:{display:"flex",alignItems:"flex-start",padding:"0 0 ".concat((0,t0.bf)(o)," 0"),outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{["".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(r,"-disabled).filter-node ").concat(n,"-title")]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",visibility:"visible",opacity:.2,transition:"opacity ".concat(t.motionDurationSlow),["".concat(r,":hover &")]:{opacity:.45}},["&".concat(r,"-disabled")]:{["".concat(n,"-draggable-icon")]:{visibility:"hidden"}}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:a}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nQ(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,margin:0,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),borderRadius:t.borderRadius,"&-noop":{cursor:"unset"},["&:not(".concat(n,"-switcher-noop):hover")]:{backgroundColor:t.colorBgTextHover},"&_close":{["".concat(n,"-switcher-icon")]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-checkbox")]:{top:"initial",marginInlineEnd:s,alignSelf:"flex-start",marginTop:t.marginXXS},["".concat(n,"-node-content-wrapper, ").concat(n,"-checkbox + span")]:{position:"relative",zIndex:"auto",minHeight:a,margin:0,padding:"0 ".concat((0,t0.bf)(t.calc(t.paddingXS).div(2).equal())),color:"inherit",lineHeight:"".concat((0,t0.bf)(a)),background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s"),"&:hover":{backgroundColor:l},["&".concat(n,"-node-selected")]:{backgroundColor:i},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,lineHeight:"".concat((0,t0.bf)(a)),textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(n,"-node-content-wrapper")]:Object.assign({lineHeight:"".concat((0,t0.bf)(a)),userSelect:"none"},nJ(e,t)),["".concat(r,".drop-container")]:{"> [draggable]":{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)}},"&-show-line":{["".concat(n,"-indent")]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end":{"&:before":{display:"none"}}}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(r,"-leaf-last")]:{["".concat(n,"-switcher")]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:"".concat((0,t0.bf)(t.calc(a).div(2).equal())," !important")}}}}})}},n1=e=>{let{treeCls:t,treeNodeCls:n,treeNodePadding:r,directoryNodeSelectedBg:o,directoryNodeSelectedColor:a}=e;return{["".concat(t).concat(t,"-directory")]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,transition:"background-color ".concat(e.motionDurationMid),content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},["".concat(t,"-switcher")]:{transition:"color ".concat(e.motionDurationMid)},["".concat(t,"-node-content-wrapper")]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},["&".concat(t,"-node-selected")]:{color:a,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:o},["".concat(t,"-switcher")]:{color:a},["".concat(t,"-node-content-wrapper")]:{color:a,background:"transparent"}}}}}},n2=(e,t)=>{let n=".".concat(e),r=t.calc(t.paddingXS).div(2).equal(),o=(0,t4.TS)(t,{treeCls:n,treeNodeCls:"".concat(n,"-treenode"),treeNodePadding:r});return[n0(e,o),n1(o)]},n6=e=>{let{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}};var n4=(0,t3.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nX.C2)("".concat(n,"-checkbox"),e)},n2(n,e),(0,nG.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},n6(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})});function n3(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:o,direction:i="ltr"}=e,l="ltr"===i?"left":"right",s={[l]:-n*o+4,["ltr"===i?"right":"left"]:0};switch(t){case -1:s.top=-3;break;case 1:s.bottom=-3;break;default:s.bottom=-3,s[l]=o+4}return a.createElement("div",{style:s,className:"".concat(r,"-drop-indicator")})}var n5={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},n8=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:n5}))}),n7=n(61935),n9={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},re=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:n9}))}),rt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},rn=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rt}))}),rr=n(19722),ro=e=>{let t;let{prefixCls:n,switcherIcon:r,treeNodeProps:o,showLine:i}=e,{isLeaf:l,expanded:s,loading:c}=o;if(c)return a.createElement(n7.Z,{className:"".concat(n,"-switcher-loading-icon")});if(i&&"object"==typeof i&&(t=i.showLeafIcon),l){if(!i)return null;if("boolean"!=typeof t&&t){let e="function"==typeof t?t(o):t;return(0,rr.l$)(e)?(0,rr.Tm)(e,{className:_()(e.props.className||"","".concat(n,"-switcher-line-custom-icon"))}):e}return t?a.createElement(nF,{className:"".concat(n,"-switcher-line-icon")}):a.createElement("span",{className:"".concat(n,"-switcher-leaf-line")})}let u="".concat(n,"-switcher-icon"),d="function"==typeof r?r(o):r;return(0,rr.l$)(d)?(0,rr.Tm)(d,{className:_()(d.props.className||"",u)}):void 0!==d?d:i?s?a.createElement(re,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(rn,{className:"".concat(n,"-switcher-line-icon")}):a.createElement(n8,{className:u})};let ra=a.forwardRef((e,t)=>{var n;let{getPrefixCls:r,direction:o,virtual:i,tree:l}=a.useContext(tC.E_),{prefixCls:s,className:c,showIcon:u=!1,showLine:d,switcherIcon:f,blockNode:p=!1,children:h,checkable:m=!1,selectable:g=!0,draggable:v,motion:y,style:b}=e,x=r("tree",s),w=r(),k=null!=y?y:Object.assign(Object.assign({},(0,nV.Z)(w)),{motionAppear:!1}),S=Object.assign(Object.assign({},e),{checkable:m,selectable:g,showIcon:u,motion:k,blockNode:p,showLine:!!d,dropIndicatorRender:n3}),[E,O,C]=n4(x),[,j]=(0,nl.ZP)(),P=j.paddingXS/2+((null===(n=j.Tree)||void 0===n?void 0:n.titleHeight)||j.controlHeightSM),N=a.useMemo(()=>{if(!v)return!1;let e={};switch(typeof v){case"function":e.nodeDraggable=v;break;case"object":e=Object.assign({},v)}return!1!==e.icon&&(e.icon=e.icon||a.createElement(n$,null)),e},[v]);return E(a.createElement(nz,Object.assign({itemHeight:P,ref:t,virtual:i},S,{style:Object.assign(Object.assign({},null==l?void 0:l.style),b),prefixCls:x,className:_()({["".concat(x,"-icon-hide")]:!u,["".concat(x,"-block-node")]:p,["".concat(x,"-unselectable")]:!g,["".concat(x,"-rtl")]:"rtl"===o},null==l?void 0:l.className,c,O,C),direction:o,checkable:m?a.createElement("span",{className:"".concat(x,"-checkbox-inner")}):m,selectable:g,switcherIcon:e=>a.createElement(ro,{prefixCls:x,switcherIcon:f,treeNodeProps:e,showLine:d}),draggable:N}),h))});function ri(e,t,n){let{key:r,children:o}=n;e.forEach(function(e){let a=e[r],i=e[o];!1!==t(a,e)&&ri(i||[],t,n)})}(r=o||(o={}))[r.None=0]="None",r[r.Start=1]="Start",r[r.End=2]="End";var rl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function rs(e){let{isLeaf:t,expanded:n}=e;return t?a.createElement(nF,null):n?a.createElement(nq,null):a.createElement(nU,null)}function rc(e){let{treeData:t,children:n}=e;return t||e2(n)}let ru=a.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:i}=e,l=rl(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let s=a.useRef(),c=a.useRef(),u=()=>{let{keyEntities:e}=e4(rc(l));return n?Object.keys(e):r?ts(l.expandedKeys||i||[],e):l.expandedKeys||i},[d,f]=a.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[p,h]=a.useState(()=>u());a.useEffect(()=>{"selectedKeys"in l&&f(l.selectedKeys)},[l.selectedKeys]),a.useEffect(()=>{"expandedKeys"in l&&h(l.expandedKeys)},[l.expandedKeys]);let{getPrefixCls:m,direction:g}=a.useContext(tC.E_),{prefixCls:v,className:y,showIcon:b=!0,expandAction:x="click"}=l,w=rl(l,["prefixCls","className","showIcon","expandAction"]),k=m("tree",v),S=_()("".concat(k,"-directory"),{["".concat(k,"-directory-rtl")]:"rtl"===g},y);return a.createElement(ra,Object.assign({icon:rs,ref:t,blockNode:!0},w,{showIcon:b,expandAction:x,prefixCls:k,className:S,expandedKeys:p,selectedKeys:d,onSelect:(e,t)=>{var n;let r;let{multiple:a,fieldNames:i}=l,{node:u,nativeEvent:d}=t,{key:h=""}=u,m=rc(l),g=Object.assign(Object.assign({},t),{selected:!0}),v=(null==d?void 0:d.ctrlKey)||(null==d?void 0:d.metaKey),y=null==d?void 0:d.shiftKey;a&&v?(r=e,s.current=h,c.current=r):a&&y?r=Array.from(new Set([].concat((0,es.Z)(c.current||[]),(0,es.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:r,endKey:a,fieldNames:i}=e,l=[],s=o.None;return r&&r===a?[r]:r&&a?(ri(t,e=>{if(s===o.End)return!1;if(e===r||e===a){if(l.push(e),s===o.None)s=o.Start;else if(s===o.Start)return s=o.End,!1}else s===o.Start&&l.push(e);return n.includes(e)},e1(i)),l):[]}({treeData:m,expandedKeys:p,startKey:h,endKey:s.current,fieldNames:i}))))):(r=[h],s.current=h,c.current=r),g.selectedNodes=function(e,t,n){let r=(0,es.Z)(t),o=[];return ri(e,(e,t)=>{let n=r.indexOf(e);return -1!==n&&(o.push(t),r.splice(n,1)),!!r.length},e1(n)),o}(m,r,i),null===(n=l.onSelect)||void 0===n||n.call(l,r,g),"selectedKeys"in l||f(r)},onExpand:(e,t)=>{var n;return"expandedKeys"in l||h(e),null===(n=l.onExpand)||void 0===n?void 0:n.call(l,e,t)}}))});ra.DirectoryTree=ru,ra.TreeNode=tt;var rd=n(29436),rf=n(64482),rp=function(e){let{value:t,onChange:n,filterSearch:r,tablePrefixCls:o,locale:i}=e;return r?a.createElement("div",{className:"".concat(o,"-filter-dropdown-search")},a.createElement(rf.default,{prefix:a.createElement(rd.Z,null),placeholder:i.filterSearchPlaceholder,onChange:n,value:t,htmlSize:1,className:"".concat(o,"-filter-dropdown-search-input")})):null};let rh=e=>{let{keyCode:t}=e;t===tz.Z.ENTER&&e.stopPropagation()},rm=a.forwardRef((e,t)=>a.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:rh,ref:t},e.children));function rg(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:r}=e;t.push(n),r&&(t=[].concat((0,es.Z)(t),(0,es.Z)(rg(r))))}),t}function rv(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var ry=function(e){var t,n;let r,o;let{tablePrefixCls:i,prefixCls:l,column:s,dropdownPrefixCls:c,columnKey:u,filterMultiple:f,filterMode:p="menu",filterSearch:h=!1,filterState:m,triggerFilter:g,locale:v,children:y,getPopupContainer:b,rootClassName:x}=e,{filterDropdownOpen:w,onFilterDropdownOpenChange:k,filterResetToDefaultFilteredValue:S,defaultFilteredValue:E,filterDropdownVisible:O,onFilterDropdownVisibleChange:C}=s,[j,P]=a.useState(!1),N=!!(m&&((null===(t=m.filteredKeys)||void 0===t?void 0:t.length)||m.forceFiltered)),T=e=>{P(e),null==k||k(e),null==C||C(e)},A=null!==(n=null!=w?w:O)&&void 0!==n?n:j,M=null==m?void 0:m.filteredKeys,[I,R]=function(e){let t=a.useRef(e),n=(0,ny.Z)();return[()=>t.current,e=>{t.current=e,n()}]}(M||[]),D=e=>{let{selectedKeys:t}=e;R(t)};a.useEffect(()=>{j&&D({selectedKeys:M||[]})},[M]);let[L,Z]=a.useState([]),[z,B]=a.useState(""),F=e=>{let{value:t}=e.target;B(t)};a.useEffect(()=>{j||B("")},[j]);let H=e=>{let t=e&&e.length?e:null;if(null===t&&(!m||!m.filteredKeys)||(0,d.Z)(t,null==m?void 0:m.filteredKeys,!0))return null;g({column:s,key:u,filteredKeys:t})},q=()=>{T(!1),H(I())},W=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&H([]),t&&T(!1),B(""),S?R((E||[]).map(e=>String(e))):R([])},U=_()({["".concat(c,"-menu-without-submenu")]:!(s.filters||[]).some(e=>{let{children:t}=e;return t})}),K=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),r={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(r.children=K({filters:e.children})),r})},$=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>$(e)))||[]})};if("function"==typeof s.filterDropdown)r=s.filterDropdown({prefixCls:"".concat(c,"-custom"),setSelectedKeys:e=>D({selectedKeys:e}),selectedKeys:I(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&T(!1),H(I())},clearFilters:W,filters:s.filters,visible:A,close:()=>{T(!1)}});else if(s.filterDropdown)r=s.filterDropdown;else{let e=I()||[];r=a.createElement(a.Fragment,null,0===(s.filters||[]).length?a.createElement(nx.Z,{image:nx.Z.PRESENTED_IMAGE_SIMPLE,description:v.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):"tree"===p?a.createElement(a.Fragment,null,a.createElement(rp,{filterSearch:h,value:z,onChange:F,tablePrefixCls:i,locale:v}),a.createElement("div",{className:"".concat(i,"-filter-dropdown-tree")},f?a.createElement(th.Z,{checked:e.length===rg(s.filters).length,indeterminate:e.length>0&&e.length<rg(s.filters).length,className:"".concat(i,"-filter-dropdown-checkall"),onChange:e=>{e.target.checked?R(rg(null==s?void 0:s.filters).map(e=>String(e))):R([])}},v.filterCheckall):null,a.createElement(ra,{checkable:!0,selectable:!1,blockNode:!0,multiple:f,checkStrictly:!f,className:"".concat(c,"-menu"),onCheck:(e,t)=>{let{node:n,checked:r}=t;f?D({selectedKeys:e}):D({selectedKeys:r&&n.key?[n.key]:[]})},checkedKeys:e,selectedKeys:e,showIcon:!1,treeData:K({filters:s.filters}),autoExpandParent:!0,defaultExpandAll:!0,filterTreeNode:z.trim()?e=>"function"==typeof h?h(z,$(e)):rv(z,e.title):void 0}))):a.createElement(a.Fragment,null,a.createElement(rp,{filterSearch:h,value:z,onChange:F,tablePrefixCls:i,locale:v}),a.createElement(nw.Z,{selectable:!0,multiple:f,prefixCls:"".concat(c,"-menu"),className:U,onSelect:D,onDeselect:D,selectedKeys:e,getPopupContainer:b,openKeys:L,onOpenChange:e=>{Z(e)},items:function e(t){let{filters:n,prefixCls:r,filteredKeys:o,filterMultiple:i,searchValue:l,filterSearch:s}=t;return n.map((t,n)=>{let c=String(t.value);if(t.children)return{key:c||n,label:t.text,popupClassName:"".concat(r,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:r,filteredKeys:o,filterMultiple:i,searchValue:l,filterSearch:s})};let u=i?th.Z:tg.ZP,d={key:void 0!==t.value?c:n,label:a.createElement(a.Fragment,null,a.createElement(u,{checked:o.includes(c)}),a.createElement("span",null,t.text))};return l.trim()?"function"==typeof s?s(l,t)?d:null:rv(l,t.text)?d:null:d})}({filters:s.filters||[],filterSearch:h,prefixCls:l,filteredKeys:I(),filterMultiple:f,searchValue:z})})),a.createElement("div",{className:"".concat(l,"-dropdown-btns")},a.createElement(nb.ZP,{type:"link",size:"small",disabled:S?(0,d.Z)((E||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>W()},v.filterReset),a.createElement(nb.ZP,{type:"primary",size:"small",onClick:q},v.filterConfirm)))}s.filterDropdown&&(r=a.createElement(nk.J,{selectable:void 0},r)),o="function"==typeof s.filterIcon?s.filterIcon(N):s.filterIcon?s.filterIcon:a.createElement(nv,null);let{direction:V}=a.useContext(tC.E_);return a.createElement("div",{className:"".concat(l,"-column")},a.createElement("span",{className:"".concat(i,"-column-title")},y),a.createElement(tm.Z,{dropdownRender:()=>a.createElement(rm,{className:"".concat(l,"-dropdown")},r),trigger:["click"],open:A,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==M&&R(M||[]),T(e),e||s.filterDropdown||q())},getPopupContainer:b,placement:"rtl"===V?"bottomLeft":"bottomRight",rootClassName:x},a.createElement("span",{role:"button",tabIndex:-1,className:_()("".concat(l,"-trigger"),{active:N}),onClick:e=>{e.stopPropagation()}},o)))};function rb(e,t,n){let r=[];return(e||[]).forEach((e,o)=>{var a;let i=nh(o,n);if(e.filters||"filterDropdown"in e||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;"filterDropdown"in e||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),r.push({column:e,key:np(e,i),filteredKeys:t,forceFiltered:e.filtered})}else r.push({column:e,key:np(e,i),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(r=[].concat((0,es.Z)(r),(0,es.Z)(rb(e.children,t,i))))}),r}function rx(e){let t={};return e.forEach(e=>{let{key:n,filteredKeys:r,column:o}=e,{filters:a,filterDropdown:i}=o;if(i)t[n]=r||null;else if(Array.isArray(r)){let e=rg(a);t[n]=e.filter(e=>r.includes(String(e)))}else t[n]=null}),t}function rw(e,t){return t.reduce((e,t)=>{let{column:{onFilter:n,filters:r},filteredKeys:o}=t;return n&&o&&o.length?e.filter(e=>o.some(t=>{let o=rg(r),a=o.findIndex(e=>String(e)===String(t));return n(-1!==a?o[a]:t,e)})):e},e)}let rk=e=>e.flatMap(e=>"children"in e?[e].concat((0,es.Z)(rk(e.children||[]))):[e]);var rS=function(e){let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,onFilterChange:o,getPopupContainer:i,locale:l,rootClassName:s}=e;(0,tp.ln)("Table");let c=a.useMemo(()=>rk(r||[]),[r]),[u,d]=a.useState(()=>rb(c,!0)),f=a.useMemo(()=>{let e=rb(c,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(c||[]).map((e,t)=>np(e,nh(t)));return u.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=c[e.findIndex(e=>e===t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[c,u]),p=a.useMemo(()=>rx(f),[f]),h=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),d(t),o(rx(t),t)};return[e=>(function e(t,n,r,o,i,l,s,c,u){return r.map((r,d)=>{let f=nh(d,c),{filterMultiple:p=!0,filterMode:h,filterSearch:m}=r,g=r;if(g.filters||g.filterDropdown){let e=np(g,f),c=o.find(t=>{let{key:n}=t;return e===n});g=Object.assign(Object.assign({},g),{title:o=>a.createElement(ry,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:g,columnKey:e,filterState:c,filterMultiple:p,filterMode:h,filterSearch:m,triggerFilter:l,locale:i,getPopupContainer:s,rootClassName:u},nm(r.title,o))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:e(t,n,g.children,o,i,l,s,f,u)})),g})})(t,n,e,f,l,h,i,void 0,s),f,p]},rE=function(){let e=Object.assign({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t<arguments.length;t++){let n=t<0||arguments.length<=t?void 0:arguments[t];n&&Object.keys(n).forEach(t=>{let r=n[t];void 0!==r&&(e[t]=r)})}return e},rO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},rC=function(e,t,n){let r=n&&"object"==typeof n?n:{},{total:o=0}=r,i=rO(r,["total"]),[l,s]=(0,a.useState)(()=>({current:"defaultCurrent"in i?i.defaultCurrent:1,pageSize:"defaultPageSize"in i?i.defaultPageSize:10})),c=rE(l,i,{total:o>0?o:e}),u=Math.ceil((o||e)/c.pageSize);c.current>u&&(c.current=u||1);let d=(e,t)=>{s({current:null!=e?e:1,pageSize:t||c.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},c),{onChange:(e,r)=>{var o;n&&(null===(o=n.onChange)||void 0===o||o.call(n,e,r)),d(e,r),t(e,r||(null==c?void 0:c.pageSize))}}),d]},rj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},r_=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rj}))}),rP={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},rN=a.forwardRef(function(e,t){return a.createElement(tM.Z,(0,m.Z)({},e,{ref:t,icon:rP}))}),rT=n(89970);let rA="ascend",rM="descend";function rI(e){return"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple}function rR(e){return"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare}function rD(e,t,n){let r=[];function o(e,t){r.push({column:e,key:np(e,t),multiplePriority:rI(e),sortOrder:e.sortOrder})}return(e||[]).forEach((e,a)=>{let i=nh(a,n);e.children?("sortOrder"in e&&o(e,i),r=[].concat((0,es.Z)(r),(0,es.Z)(rD(e.children,t,i)))):e.sorter&&("sortOrder"in e?o(e,i):t&&e.defaultSortOrder&&r.push({column:e,key:np(e,i),multiplePriority:rI(e),sortOrder:e.defaultSortOrder}))}),r}function rL(e){let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function rZ(e){let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(rL);return 0===t.length&&e.length?Object.assign(Object.assign({},rL(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function rz(e,t,n){let r=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),o=e.slice(),a=r.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return rR(t)&&n});return a.length?o.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let{column:{sorter:r},sortOrder:o}=a[n],i=rR(r);if(i&&o){let n=i(e,t,o);if(0!==n)return o===rA?n:-n}}return 0}).map(e=>{let r=e[n];return r?Object.assign(Object.assign({},e),{[n]:rz(r,t,n)}):e}):o}var rB=x(eA,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),rF=x(eH,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),rH=n(36360),rq=e=>{let{componentCls:t,lineWidth:n,lineType:r,tableBorderColor:o,tableHeaderBg:a,tablePaddingVertical:i,tablePaddingHorizontal:l,calc:s}=e,c="".concat((0,t0.bf)(n)," ").concat(r," ").concat(o),u=(e,r,o)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(s(r).mul(-1).equal()),"\n ").concat((0,t0.bf)(s(s(o).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:c,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:c,borderTop:c,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:c},"> thead":{"> tr:not(:last-child) > th":{borderBottom:c},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:c}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(s(i).mul(-1).equal())," ").concat((0,t0.bf)(s(s(l).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:c,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},u("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),u("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:c,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,t0.bf)(n)," 0 ").concat((0,t0.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:c}}}},rW=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},t6.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},rU=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},rK=n(76122),r$=e=>{let{componentCls:t,antCls:n,motionDurationSlow:r,lineWidth:o,paddingXS:a,lineType:i,tableBorderColor:l,tableExpandIconBg:s,tableExpandColumnWidth:c,borderRadius:u,tablePaddingVertical:d,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:h,expandIconMarginTop:m,expandIconSize:g,expandIconHalfInner:v,expandIconScale:y,calc:b}=e,x="".concat((0,t0.bf)(o)," ").concat(i," ").concat(l),w=b(h).sub(o).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:c},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,rK.N)(e)),{position:"relative",float:"left",boxSizing:"border-box",width:g,height:g,padding:0,color:"inherit",lineHeight:(0,t0.bf)(g),background:s,border:x,borderRadius:u,transform:"scale(".concat(y,")"),transition:"all ".concat(r),userSelect:"none","&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(r," ease-out"),content:'""'},"&::before":{top:v,insetInlineEnd:w,insetInlineStart:w,height:o},"&::after":{top:w,bottom:w,insetInlineStart:v,width:o,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:m,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"auto"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,t0.bf)(b(d).mul(-1).equal())," ").concat((0,t0.bf)(b(f).mul(-1).equal())),padding:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(f))}}}},rV=e=>{let{componentCls:t,antCls:n,iconCls:r,tableFilterDropdownWidth:o,tableFilterDropdownSearchWidth:a,paddingXXS:i,paddingXS:l,colorText:s,lineWidth:c,lineType:u,tableBorderColor:d,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:h,borderRadius:m,motionDurationSlow:g,colorTextDescription:v,colorPrimary:y,tableHeaderFilterActiveBg:b,colorTextDisabled:x,tableFilterDropdownBg:w,tableFilterDropdownHeight:k,controlItemBgHover:S,controlItemBgActive:E,boxShadowSecondary:O,filterDropdownMenuBg:C,calc:j}=e,_="".concat(n,"-dropdown"),P="".concat(t,"-filter-dropdown"),N="".concat(n,"-tree"),T="".concat((0,t0.bf)(c)," ").concat(u," ").concat(d);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:j(i).mul(-1).equal(),marginInline:"".concat((0,t0.bf)(i)," ").concat((0,t0.bf)(j(h).div(2).mul(-1).equal())),padding:"0 ".concat((0,t0.bf)(i)),color:f,fontSize:p,borderRadius:m,cursor:"pointer",transition:"all ".concat(g),"&:hover":{color:v,background:b},"&.active":{color:y}}}},{["".concat(n,"-dropdown")]:{[P]:Object.assign(Object.assign({},(0,t6.Wf)(e)),{minWidth:o,backgroundColor:w,borderRadius:m,boxShadow:O,overflow:"hidden",["".concat(_,"-menu")]:{maxHeight:k,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:C,"&:empty::after":{display:"block",padding:"".concat((0,t0.bf)(l)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(P,"-tree")]:{paddingBlock:"".concat((0,t0.bf)(l)," 0"),paddingInline:l,[N]:{padding:0},["".concat(N,"-treenode ").concat(N,"-node-content-wrapper:hover")]:{backgroundColor:S},["".concat(N,"-treenode-checkbox-checked ").concat(N,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(P,"-search")]:{padding:l,borderBottom:T,"&-input":{input:{minWidth:a},[r]:{color:x}}},["".concat(P,"-checkall")]:{width:"100%",marginBottom:i,marginInlineStart:i},["".concat(P,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,t0.bf)(j(l).sub(c).equal())," ").concat((0,t0.bf)(l)),overflow:"hidden",borderTop:T}})}},{["".concat(n,"-dropdown ").concat(P,", ").concat(P,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:l,color:s},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},rX=e=>{let{componentCls:t,lineWidth:n,colorSplit:r,motionDurationSlow:o,zIndexTableFixed:a,tableBg:i,zIndexTableSticky:l,calc:s}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:i},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:s(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:s(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:s(l).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(o),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(r)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(r)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(r)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(r)}}}}},rG=e=>{let{componentCls:t,antCls:n,margin:r}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,t0.bf)(r)," 0")},["".concat(t,"-pagination")]:{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"> *":{flex:"none"},"&-left":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-right":{justifyContent:"flex-end"}}}}},rY=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,t0.bf)(n)," ").concat((0,t0.bf)(n))}}}}},rQ=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},rJ=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSizeIcon:o,padding:a,paddingXS:i,headerIconColor:l,headerIconHoverColor:s,tableSelectionColumnWidth:c,tableSelectedRowBg:u,tableSelectedRowHoverBg:d,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:h}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:c,["&".concat(t,"-selection-col-with-dropdown")]:{width:h(c).add(o).add(h(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:h(c).add(h(i).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:h(c).add(o).add(h(a).div(4)).add(h(i).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:e.zIndexTableFixed+1},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,t0.bf)(h(p).div(4).equal()),[r]:{color:l,fontSize:o,verticalAlign:"baseline","&:hover":{color:s}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:u,"&-row-hover":{background:d}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},r0=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:r}=e,o=(e,o,a,i)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:i,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,t0.bf)(o)," ").concat((0,t0.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,t0.bf)(r(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,t0.bf)(r(o).mul(-1).equal())," ").concat((0,t0.bf)(r(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,t0.bf)(r(o).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(r(n).sub(a).equal())," ").concat((0,t0.bf)(r(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,t0.bf)(r(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},o("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),o("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},r1=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:r,headerIconColor:o,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:o,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:r,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},r2=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:r,tableScrollThumbBgHover:o,tableScrollThumbSize:a,tableScrollBg:i,zIndexTableSticky:l,stickyScrollBarBorderRadius:s,lineWidth:c,lineType:u,tableBorderColor:d}=e,f="".concat((0,t0.bf)(c)," ").concat(u," ").concat(d);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:l,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,t0.bf)(a)," !important"),zIndex:l,display:"flex",alignItems:"center",background:i,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:r,borderRadius:s,transition:"all ".concat(e.motionDurationSlow,", transform none"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:o}}}}}}},r6=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:r,calc:o}=e,a="".concat((0,t0.bf)(n)," ").concat(e.lineType," ").concat(r);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,t0.bf)(o(n).mul(-1).equal())," 0 ").concat(r)}}}},r4=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:r,lineType:o,tableBorderColor:a,calc:i}=e,l="".concat((0,t0.bf)(r)," ").concat(o," ").concat(a),s="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-row")]:{display:"flex",boxSizing:"border-box",width:"100%"},["".concat(t,"-cell")]:{borderBottom:l,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(s).concat(s,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,t0.bf)(r),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:l,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:l,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:i(r).mul(-1).equal(),borderInlineStart:l}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:l,borderBottom:l}}}}}};let r3=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:r,tablePaddingHorizontal:o,tableExpandColumnWidth:a,lineWidth:i,lineType:l,tableBorderColor:s,tableFontSize:c,tableBg:u,tableRadius:d,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:h,tableHeaderCellSplitColor:m,tableFooterTextColor:g,tableFooterBg:v,calc:y}=e,b="".concat((0,t0.bf)(i)," ").concat(l," ").concat(s);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%"},(0,t6.dF)()),{[t]:Object.assign(Object.assign({},(0,t6.Wf)(e)),{fontSize:c,background:u,borderRadius:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(d)," 0 0")}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,t0.bf)(d)," ").concat((0,t0.bf)(d)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:h,borderBottom:b,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:m,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:b,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,t0.bf)(y(r).mul(-1).equal()),marginInline:"".concat((0,t0.bf)(y(a).sub(o).equal()),"\n ").concat((0,t0.bf)(y(o).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottom:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:h,borderBottom:b,transition:"background ".concat(p," ease")}}},["".concat(t,"-footer")]:{padding:"".concat((0,t0.bf)(r)," ").concat((0,t0.bf)(o)),color:g,background:v}})}};var r5=(0,t3.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:r,controlInteractiveSize:o,headerBg:a,headerColor:i,headerSortActiveBg:l,headerSortHoverBg:s,bodySortBg:c,rowHoverBg:u,rowSelectedBg:d,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:h,cellPaddingInline:m,cellPaddingBlockMD:g,cellPaddingInlineMD:v,cellPaddingBlockSM:y,cellPaddingInlineSM:b,borderColor:x,footerBg:w,footerColor:k,headerBorderRadius:S,cellFontSize:E,cellFontSizeMD:O,cellFontSizeSM:C,headerSplitColor:j,fixedHeaderSortActiveBg:_,headerFilterHoverBg:P,filterDropdownBg:N,expandIconBg:T,selectionColumnWidth:A,stickyScrollBarBg:M,calc:I}=e,R=(0,t4.TS)(e,{tableFontSize:E,tableBg:r,tableRadius:S,tablePaddingVertical:h,tablePaddingHorizontal:m,tablePaddingVerticalMiddle:g,tablePaddingHorizontalMiddle:v,tablePaddingVerticalSmall:y,tablePaddingHorizontalSmall:b,tableBorderColor:x,tableHeaderTextColor:i,tableHeaderBg:a,tableFooterTextColor:k,tableFooterBg:w,tableHeaderCellSplitColor:j,tableHeaderSortBg:l,tableHeaderSortHoverBg:s,tableBodySortBg:c,tableFixedHeaderSortActiveBg:_,tableHeaderFilterActiveBg:P,tableFilterDropdownBg:N,tableRowHoverBg:u,tableSelectedRowBg:d,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:3,tableFontSizeMiddle:O,tableFontSizeSmall:C,tableSelectionColumnWidth:A,tableExpandIconBg:T,tableExpandColumnWidth:I(o).add(I(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:M,tableScrollThumbBgHover:t,tableScrollBg:n});return[r3(R),rG(R),r6(R),r1(R),rV(R),rq(R),rY(R),r$(R),r6(R),rU(R),rJ(R),rX(R),r2(R),rW(R),r0(R),rQ(R),r4(R)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:r,colorFillSecondary:o,colorFillContent:a,controlItemBgActive:i,controlItemBgActiveHover:l,padding:s,paddingSM:c,paddingXS:u,colorBorderSecondary:d,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:h,fontSize:m,fontSizeSM:g,lineHeight:v,lineWidth:y,colorIcon:b,colorIconHover:x,opacityLoading:w,controlInteractiveSize:k}=e,S=new rH.C(o).onBackground(n).toHexShortString(),E=new rH.C(a).onBackground(n).toHexShortString(),O=new rH.C(t).onBackground(n).toHexShortString(),C=new rH.C(b),j=new rH.C(x),_=k/2-y,P=2*_+3*y;return{headerBg:O,headerColor:r,headerSortActiveBg:S,headerSortHoverBg:E,bodySortBg:O,rowHoverBg:O,rowSelectedBg:i,rowSelectedHoverBg:l,rowExpandedBg:t,cellPaddingBlock:s,cellPaddingInline:s,cellPaddingBlockMD:c,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:d,headerBorderRadius:f,footerBg:O,footerColor:r,cellFontSize:m,cellFontSizeMD:m,cellFontSizeSM:m,headerSplitColor:d,fixedHeaderSortActiveBg:S,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:h,stickyScrollBarBorderRadius:100,expandIconMarginTop:(m*v-3*y)/2-Math.ceil((1.4*g-3*y)/2),headerIconColor:C.clone().setAlpha(C.getAlpha()*w).toRgbString(),headerIconHoverColor:j.clone().setAlpha(j.getAlpha()*w).toRgbString(),expandIconHalfInner:_,expandIconSize:P,expandIconScale:k/P}},{unitless:{expandIconScale:!0}});let r8=[];var r7=a.forwardRef((e,t)=>{var n,r;let o,i,s;let{prefixCls:c,className:u,rootClassName:d,style:f,size:p,bordered:h,dropdownPrefixCls:m,dataSource:g,pagination:v,rowSelection:y,rowKey:b="key",rowClassName:x,columns:w,children:k,childrenColumnName:S,onChange:E,getPopupContainer:O,loading:C,expandIcon:j,expandable:P,expandedRowRender:N,expandIconColumnIndex:T,indentSize:A,scroll:M,sortDirections:I,locale:R,showSorterTooltip:D=!0,virtual:L}=e;(0,tp.ln)("Table");let Z=a.useMemo(()=>w||ey(k),[w,k]),z=a.useMemo(()=>Z.some(e=>e.responsive),[Z]),B=(0,tN.Z)(z),F=a.useMemo(()=>{let e=new Set(Object.keys(B).filter(e=>B[e]));return Z.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[Z,B]),H=(0,eY.Z)(e,["className","style","columns"]),{locale:q=tT.Z,direction:W,table:U,renderEmpty:K,getPrefixCls:$,getPopupContainer:V}=a.useContext(tC.E_),X=(0,tP.Z)(p),G=Object.assign(Object.assign({},q.Table),R),Y=g||r8,Q=$("table",c),J=$("dropdown",m),[,ee]=(0,nl.ZP)(),et=(0,t_.Z)(Q),[en,er,eo]=r5(Q,et),ea=Object.assign({childrenColumnName:S,expandIconColumnIndex:T},P),{childrenColumnName:ei="children"}=ea,el=a.useMemo(()=>Y.some(e=>null==e?void 0:e[ei])?"nest":N||P&&P.expandedRowRender?"row":null,[Y]),ec={body:a.useRef()},eu=a.useRef(null),ed=a.useRef(null);n=()=>Object.assign(Object.assign({},ed.current),{nativeElement:eu.current}),(0,a.useImperativeHandle)(t,()=>{let e=n(),{nativeElement:t}=e;return"undefined"!=typeof Proxy?new Proxy(t,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(t._antProxy=t._antProxy||{},Object.keys(e).forEach(n=>{if(!(n in t._antProxy)){let r=t[n];t._antProxy[n]=r,t[n]=e[n]}}),t)});let ef=a.useMemo(()=>"function"==typeof b?b:e=>null==e?void 0:e[b],[b]),[ep]=function(e,t,n){let r=a.useRef({});return[function(o){if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){let o=new Map;!function e(r){r.forEach((r,a)=>{let i=n(r,a);o.set(i,r),r&&"object"==typeof r&&t in r&&e(r[t]||[])})}(e),r.current={data:e,childrenColumnName:t,kvMap:o,getRowKey:n}}return r.current.kvMap.get(o)}]}(Y,ei,ef),eh={},em=function(e,t){var n,r,o;let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Object.assign(Object.assign({},eh),e);a&&(null===(n=eh.resetPagination)||void 0===n||n.call(eh),(null===(r=i.pagination)||void 0===r?void 0:r.current)&&(i.pagination.current=1),v&&v.onChange&&v.onChange(1,null===(o=i.pagination)||void 0===o?void 0:o.pageSize)),M&&!1!==M.scrollToFirstRowOnChange&&ec.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:r,duration:o=450}=t,a=n(),i=function(e,t){var n,r;if("undefined"==typeof window)return 0;let o=t?"scrollTop":"scrollLeft",a=0;return tO(e)?a=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?a=e.documentElement[o]:e instanceof HTMLElement?a=e[o]:e&&(a=e[o]),e&&!tO(e)&&"number"!=typeof a&&(a=null===(r=(null!==(n=e.ownerDocument)&&void 0!==n?n:e).documentElement)||void 0===r?void 0:r[o]),a}(a,!0),l=Date.now(),s=()=>{let t=Date.now()-l,n=function(e,t,n,r){let o=n-t;return(e/=r/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t}(t>o?o:t,i,e,o);tO(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,t<o?(0,tE.Z)(s):"function"==typeof r&&r()};(0,tE.Z)(s)}(0,{getContainer:()=>ec.body.current}),null==E||E(i.pagination,i.filters,i.sorter,{currentDataSource:rw(rz(Y,i.sorterStates,ei),i.filterStates),action:t})},[eg,ev,eb,ex]=function(e){let{prefixCls:t,mergedColumns:n,onSorterChange:r,sortDirections:o,tableLocale:i,showSorterTooltip:l}=e,[s,c]=a.useState(rD(n,!0)),u=a.useMemo(()=>{let e=!0,t=rD(n,!1);if(!t.length)return s;let r=[];function o(t){e?r.push(t):r.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(o(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),o(t))}),r},[n,s]),d=a.useMemo(()=>{let e=u.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:e,sortColumn:e[0]&&e[0].column,sortOrder:e[0]&&e[0].order}},[u]);function f(e){let t;c(t=!1!==e.multiplePriority&&u.length&&!1!==u[0].multiplePriority?[].concat((0,es.Z)(u.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),r(rZ(t),t)}return[e=>(function e(t,n,r,o,i,l,s,c){return(n||[]).map((n,u)=>{let d=nh(u,c),f=n;if(f.sorter){let e;let c=f.sortDirections||i,u=void 0===f.showSorterTooltip?s:f.showSorterTooltip,p=np(f,d),h=r.find(e=>{let{key:t}=e;return t===p}),m=h?h.sortOrder:null,g=m?c[c.indexOf(m)+1]:c[0];if(n.sortIcon)e=n.sortIcon({sortOrder:m});else{let n=c.includes(rA)&&a.createElement(rN,{className:_()("".concat(t,"-column-sorter-up"),{active:m===rA})}),r=c.includes(rM)&&a.createElement(r_,{className:_()("".concat(t,"-column-sorter-down"),{active:m===rM})});e=a.createElement("span",{className:_()("".concat(t,"-column-sorter"),{["".concat(t,"-column-sorter-full")]:!!(n&&r)})},a.createElement("span",{className:"".concat(t,"-column-sorter-inner"),"aria-hidden":"true"},n,r))}let{cancelSort:v,triggerAsc:y,triggerDesc:b}=l||{},x=v;g===rM?x=b:g===rA&&(x=y);let w="object"==typeof u?Object.assign({title:x},u):{title:x};f=Object.assign(Object.assign({},f),{className:_()(f.className,{["".concat(t,"-column-sort")]:m}),title:r=>{let o=a.createElement("div",{className:"".concat(t,"-column-sorters")},a.createElement("span",{className:"".concat(t,"-column-title")},nm(n.title,r)),e);return u?a.createElement(rT.Z,Object.assign({},w),o):o},onHeaderCell:e=>{let r=n.onHeaderCell&&n.onHeaderCell(e)||{},a=r.onClick,i=r.onKeyDown;r.onClick=e=>{o({column:n,key:p,sortOrder:g,multiplePriority:rI(n)}),null==a||a(e)},r.onKeyDown=e=>{e.keyCode===tz.Z.ENTER&&(o({column:n,key:p,sortOrder:g,multiplePriority:rI(n)}),null==i||i(e))};let l=function(e,t){let n=nm(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n}(n.title,{}),s=null==l?void 0:l.toString();return m?r["aria-sort"]="ascend"===m?"ascending":"descending":r["aria-label"]=s||"",r.className=_()(r.className,"".concat(t,"-column-has-sorters")),r.tabIndex=0,n.ellipsis&&(r.title=(null!=l?l:"").toString()),r}})}return"children"in f&&(f=Object.assign(Object.assign({},f),{children:e(t,f.children,r,o,i,l,s,d)})),f})})(t,e,u,f,o,i,l),u,d,()=>rZ(u)]}({prefixCls:Q,mergedColumns:F,onSorterChange:(e,t)=>{em({sorter:e,sorterStates:t},"sort",!1)},sortDirections:I||["ascend","descend"],tableLocale:G,showSorterTooltip:D}),ew=a.useMemo(()=>rz(Y,ev,ei),[Y,ev]);eh.sorter=ex(),eh.sorterStates=ev;let[ek,eS,eE]=rS({prefixCls:Q,locale:G,dropdownPrefixCls:J,mergedColumns:F,onFilterChange:(e,t)=>{em({filters:e,filterStates:t},"filter",!0)},getPopupContainer:O||V,rootClassName:_()(d,et)}),eO=rw(ew,eS);eh.filters=eE,eh.filterStates=eS;let[eC]=(r=a.useMemo(()=>{let e={};return Object.keys(eE).forEach(t=>{null!==eE[t]&&(e[t]=eE[t])}),Object.assign(Object.assign({},eb),{filters:e})},[eb,eE]),[a.useCallback(e=>(function e(t,n){return t.map(t=>{let r=Object.assign({},t);return r.title=nm(t.title,n),"children"in r&&(r.children=e(r.children,n)),r})})(e,r),[r])]),[ej,e_]=rC(eO.length,(e,t)=>{em({pagination:Object.assign(Object.assign({},eh.pagination),{current:e,pageSize:t})},"paginate")},v);eh.pagination=!1===v?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let r=e[t];"function"!=typeof r&&(n[t]=r)}),n}(ej,v),eh.resetPagination=e_;let eP=a.useMemo(()=>{if(!1===v||!ej.pageSize)return eO;let{current:e=1,total:t,pageSize:n=10}=ej;return eO.length<t?eO.length>n?eO.slice((e-1)*n,e*n):eO:eO.slice((e-1)*n,e*n)},[!!v,eO,ej&&ej.current,ej&&ej.pageSize,ej&&ej.total]),[eN,eT]=tS({prefixCls:Q,data:eO,pageData:eP,getRowKey:ef,getRecordByKey:ep,expandType:el,childrenColumnName:ei,locale:G,getPopupContainer:O||V},y);ea.__PARENT_RENDER_ICON__=ea.expandIcon,ea.expandIcon=ea.expandIcon||j||function(e){let{prefixCls:t,onExpand:n,record:r,expanded:o,expandable:i}=e,l="".concat(t,"-row-expand-icon");return a.createElement("button",{type:"button",onClick:e=>{n(r,e),e.stopPropagation()},className:_()(l,{["".concat(l,"-spaced")]:!i,["".concat(l,"-expanded")]:i&&o,["".concat(l,"-collapsed")]:i&&!o}),"aria-label":o?G.collapse:G.expand,"aria-expanded":o})},"nest"===el&&void 0===ea.expandIconColumnIndex?ea.expandIconColumnIndex=y?1:0:ea.expandIconColumnIndex>0&&y&&(ea.expandIconColumnIndex-=1),"number"!=typeof ea.indentSize&&(ea.indentSize="number"==typeof A?A:15);let eA=a.useCallback(e=>eC(eN(ek(eg(e)))),[eg,ek,eN]);if(!1!==v&&(null==ej?void 0:ej.total)){let e;e=ej.size?ej.size:"small"===X||"middle"===X?"small":void 0;let t=t=>a.createElement(nd,Object.assign({},ej,{className:_()("".concat(Q,"-pagination ").concat(Q,"-pagination-").concat(t),ej.className),size:e})),n="rtl"===W?"left":"right",{position:r}=ej;if(null!==r&&Array.isArray(r)){let e=r.find(e=>e.includes("top")),a=r.find(e=>e.includes("bottom")),l=r.every(e=>"none"==="".concat(e));e||a||l||(i=t(n)),e&&(o=t(e.toLowerCase().replace("top",""))),a&&(i=t(a.toLowerCase().replace("bottom","")))}else i=t(n)}"boolean"==typeof C?s={spinning:C}:"object"==typeof C&&(s=Object.assign({spinning:!0},C));let eM=_()(eo,et,"".concat(Q,"-wrapper"),null==U?void 0:U.className,{["".concat(Q,"-wrapper-rtl")]:"rtl"===W},u,d,er),eI=Object.assign(Object.assign({},null==U?void 0:U.style),f),eR=R&&R.emptyText||(null==K?void 0:K("Table"))||a.createElement(tj.Z,{componentName:"Table"}),eD={},eL=a.useMemo(()=>{let{fontSize:e,lineHeight:t,padding:n,paddingXS:r,paddingSM:o}=ee,a=Math.floor(e*t);switch(X){case"large":return 2*n+a;case"small":return 2*r+a;default:return 2*o+a}},[ee,X]);return L&&(eD.listItemHeight=eL),en(a.createElement("div",{ref:eu,className:eM,style:eI},a.createElement(nf.Z,Object.assign({spinning:!1},s),o,a.createElement(L?rF:rB,Object.assign({},eD,H,{ref:ed,columns:F,direction:W,expandable:ea,prefixCls:Q,className:_()({["".concat(Q,"-middle")]:"middle"===X,["".concat(Q,"-small")]:"small"===X,["".concat(Q,"-bordered")]:h,["".concat(Q,"-empty")]:0===Y.length},eo,et,er),data:eP,rowKey:ef,rowClassName:(e,t,n)=>{let r;return r="function"==typeof x?_()(x(e,t,n)):_()(x),_()({["".concat(Q,"-row-selected")]:eT.has(ef(e,t))},r)},emptyText:eR,internalHooks:l,internalRefs:ec,transformColumns:eA,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(Q,"-container")),r=t;if(n){let e=getComputedStyle(n);r=t-parseInt(e.borderLeftWidth,10)-parseInt(e.borderRightWidth,10)}return r}})),i)))});let r9=a.forwardRef((e,t)=>{let n=a.useRef(0);return n.current+=1,a.createElement(r7,Object.assign({},e,{ref:t,_renderTimes:n.current}))});r9.SELECTION_COLUMN=tv,r9.EXPAND_COLUMN=i,r9.SELECTION_ALL=ty,r9.SELECTION_INVERT=tb,r9.SELECTION_NONE=tx,r9.Column=function(e){return null},r9.ColumnGroup=function(e){return null},r9.Summary=F;var oe=r9},93192:function(e,t,n){"use strict";n.d(t,{default:function(){return ef}});var r=n(2265),o=n(9738),a=n(23639),i=n(1119),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},s=n(55015),c=r.forwardRef(function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:l}))}),u=n(36760),d=n.n(u),f=n(49211),p=n.n(f),h=n(31474),m=n(45287),g=n(27380),v=n(50506),y=n(18694),b=n(28791),x=n(10281),w=n(95814),k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let S={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},E=r.forwardRef((e,t)=>{let{style:n,noStyle:o,disabled:a}=e,i=k(e,["style","noStyle","disabled"]),l={};return o||(l=Object.assign({},S)),a&&(l.pointerEvents="none"),l=Object.assign(Object.assign({},l),n),r.createElement("div",Object.assign({role:"button",tabIndex:0,ref:t},i,{onKeyDown:e=>{let{keyCode:t}=e;t===w.Z.ENTER&&e.preventDefault()},onKeyUp:t=>{let{keyCode:n}=t,{onClick:r}=e;n===w.Z.ENTER&&r&&r()},style:l}))});var O=n(71744),C=n(55274),j=n(89970),_={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"},P=r.forwardRef(function(e,t){return r.createElement(s.Z,(0,i.Z)({},e,{ref:t,icon:_}))}),N=n(19722),T=n(90464),A=n(76122),M=n(80669),I=n(31373),R=n(352);let D=(e,t,n,r)=>{let{titleMarginBottom:o,fontWeightStrong:a}=r;return{marginBottom:o,color:n,fontWeight:a,fontSize:e,lineHeight:t}},L=e=>{let t={};return[1,2,3,4,5].forEach(n=>{t["\n h".concat(n,"&,\n div&-h").concat(n,",\n div&-h").concat(n," > textarea,\n h").concat(n,"\n ")]=D(e["fontSizeHeading".concat(n)],e["lineHeightHeading".concat(n)],e.colorTextHeading,e)}),t},Z=e=>{let{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},(0,A.N)(e)),{textDecoration:e.linkDecoration,"&:active, &:hover":{textDecoration:e.linkHoverDecoration},["&[disabled], &".concat(t,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},z=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:I.EV[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),B=e=>{let{componentCls:t,paddingSM:n}=e;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),marginTop:e.calc(n).mul(-1).equal(),marginBottom:"calc(1em - ".concat((0,R.bf)(n),")")},["".concat(t,"-edit-content-confirm")]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorTextDescription,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},F=e=>({["".concat(e.componentCls,"-copy-success")]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},["".concat(e.componentCls,"-copy-icon-only")]:{marginInlineStart:0}}),H=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-single-line":{whiteSpace:"nowrap"},"&-ellipsis-single-line":{overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),q=e=>{let{componentCls:t,titleMarginTop:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,["&".concat(t,"-secondary")]:{color:e.colorTextDescription},["&".concat(t,"-success")]:{color:e.colorSuccess},["&".concat(t,"-warning")]:{color:e.colorWarning},["&".concat(t,"-danger")]:{color:e.colorError,"a&:active, a&:focus":{color:e.colorErrorActive},"a&:hover":{color:e.colorErrorHover}},["&".concat(t,"-disabled")]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},L(e)),{["\n & + h1".concat(t,",\n & + h2").concat(t,",\n & + h3").concat(t,",\n & + h4").concat(t,",\n & + h5").concat(t,"\n ")]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),z(e)),Z(e)),{["\n ".concat(t,"-expand,\n ").concat(t,"-edit,\n ").concat(t,"-copy\n ")]:Object.assign(Object.assign({},(0,A.N)(e)),{marginInlineStart:e.marginXXS})}),B(e)),F(e)),H()),{"&-rtl":{direction:"rtl"}})}};var W=(0,M.I$)("Typography",e=>[q(e)],()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"})),U=e=>{let{prefixCls:t,"aria-label":n,className:o,style:a,direction:i,maxLength:l,autoSize:s=!0,value:c,onSave:u,onCancel:f,onEnd:p,component:h,enterIcon:m=r.createElement(P,null)}=e,g=r.useRef(null),v=r.useRef(!1),y=r.useRef(),[b,x]=r.useState(c);r.useEffect(()=>{x(c)},[c]),r.useEffect(()=>{if(g.current&&g.current.resizableTextArea){let{textArea:e}=g.current.resizableTextArea;e.focus();let{length:t}=e.value;e.setSelectionRange(t,t)}},[]);let k=()=>{u(b.trim())},S=h?"".concat(t,"-").concat(h):"",[E,O,C]=W(t),j=d()(t,"".concat(t,"-edit-content"),{["".concat(t,"-rtl")]:"rtl"===i},o,S,O,C);return E(r.createElement("div",{className:j,style:a},r.createElement(T.Z,{ref:g,maxLength:l,value:b,onChange:e=>{let{target:t}=e;x(t.value.replace(/[\n\r]/g,""))},onKeyDown:e=>{let{keyCode:t}=e;v.current||(y.current=t)},onKeyUp:e=>{let{keyCode:t,ctrlKey:n,altKey:r,metaKey:o,shiftKey:a}=e;y.current!==t||v.current||n||r||o||a||(t===w.Z.ENTER?(k(),null==p||p()):t===w.Z.ESC&&f())},onCompositionStart:()=>{v.current=!0},onCompositionEnd:()=>{v.current=!1},onBlur:()=>{k()},"aria-label":n,rows:1,autoSize:s}),null!==m?(0,N.Tm)(m,{className:"".concat(t,"-edit-content-confirm")}):null))};function K(e,t){return r.useMemo(()=>{let n=!!e;return[n,Object.assign(Object.assign({},t),n&&"object"==typeof e?e:null)]},[e])}var $=(e,t)=>{let n=r.useRef(!1);r.useEffect(()=>{n.current?e():n.current=!0},t)},V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let X=r.forwardRef((e,t)=>{let{prefixCls:n,component:o="article",className:a,rootClassName:i,setContentRef:l,children:s,direction:c,style:u}=e,f=V(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:p,direction:h,typography:m}=r.useContext(O.E_),g=t;l&&(g=(0,b.sQ)(t,l));let v=p("typography",n),[y,x,w]=W(v),k=d()(v,null==m?void 0:m.className,{["".concat(v,"-rtl")]:"rtl"===(null!=c?c:h)},a,i,x,w),S=Object.assign(Object.assign({},null==m?void 0:m.style),u);return y(r.createElement(o,Object.assign({className:k,style:S,ref:g},f),s))});function G(e){let t=typeof e;return"string"===t||"number"===t}function Y(e,t){let n=0,r=[];for(let o=0;o<e.length;o+=1){if(n===t)return r;let a=e[o],i=n+(G(a)?String(a).length:1);if(i>t){let e=t-n;return r.push(String(a).slice(0,e)),r}r.push(a),n=i}return e}var Q=e=>{let{enabledMeasure:t,children:n,text:o,width:a,fontSize:i,rows:l,onEllipsis:s}=e,[[c,u,d],f]=r.useState([0,0,0]),[p,h]=r.useState(0),[v,y]=r.useState(0),[b,x]=r.useState(0),w=r.useRef(null),k=r.useRef(null),S=r.useMemo(()=>(0,m.Z)(o),[o]),E=r.useMemo(()=>{let e;return e=0,S.forEach(t=>{G(t)?e+=String(t).length:e+=1}),e},[S]),O=r.useMemo(()=>t&&3===v?n(Y(S,u),u<E):p&&4!==v&&t?n(Y(S,p),p<E):n(S,!1),[t,v,n,S,u,E]);(0,g.Z)(()=>{t&&a&&i&&E&&(y(1),f([0,Math.ceil(E/2),E]))},[t,a,i,o,E,l]),(0,g.Z)(()=>{var e;1===v&&x((null===(e=w.current)||void 0===e?void 0:e.offsetHeight)||0)},[v]),(0,g.Z)(()=>{var e,t;if(b){if(1===v)((null===(e=k.current)||void 0===e?void 0:e.offsetHeight)||0)<=l*b?(y(4),s(!1)):y(2);else if(2===v){if(c!==d){let e=(null===(t=k.current)||void 0===t?void 0:t.offsetHeight)||0,n=l*b,r=c,o=d;c===d-1?o=c:e<=n?r=u:o=u;let a=Math.ceil((r+o)/2);f([r,a,o])}else y(3),h(u),s(!0)}}},[v,c,d,l,b]);let C=(e,t,n)=>r.createElement("span",{"aria-hidden":!0,ref:t,style:Object.assign({position:"fixed",display:"block",left:0,top:0,zIndex:-9999,visibility:"hidden",pointerEvents:"none",fontSize:2*Math.ceil(i/2)},n)},e);return r.createElement(r.Fragment,null,O,t&&3!==v&&4!==v&&r.createElement(r.Fragment,null,C("lg",w,{wordBreak:"keep-all",whiteSpace:"nowrap"}),C(1===v?n(S,!1):n(Y(S,u),!0),k,{width:a,whiteSpace:"normal",margin:0,padding:0})))},J=e=>{let{enabledEllipsis:t,isEllipsis:n,children:o,tooltipProps:a}=e;return(null==a?void 0:a.title)&&t?r.createElement(j.Z,Object.assign({open:!!n&&void 0},a),o):o},ee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function et(e,t,n){return!0===e||void 0===e?t:e||n&&t}function en(e){return!1===e?[!1,!1]:Array.isArray(e)?e:[e]}let er=r.forwardRef((e,t)=>{var n,i,l;let{prefixCls:s,className:u,style:f,type:w,disabled:k,children:S,ellipsis:_,editable:P,copyable:N,component:T,title:A}=e,M=ee(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:I,direction:R}=r.useContext(O.E_),[D]=(0,C.Z)("Text"),L=r.useRef(null),Z=r.useRef(null),z=I("typography",s),B=(0,y.Z)(M,["mark","code","delete","underline","strong","keyboard","italic"]),[F,H]=K(P),[q,W]=(0,v.Z)(!1,{value:H.editing}),{triggerType:V=["icon"]}=H,G=e=>{var t;e&&(null===(t=H.onStart)||void 0===t||t.call(H)),W(e)};$(()=>{var e;q||null===(e=Z.current)||void 0===e||e.focus()},[q]);let Y=e=>{null==e||e.preventDefault(),G(!0)},[er,eo]=K(N),[ea,ei]=r.useState(!1),el=r.useRef(null),es={};eo.format&&(es.format=eo.format);let ec=()=>{el.current&&clearTimeout(el.current)},eu=e=>{var t;null==e||e.preventDefault(),null==e||e.stopPropagation(),p()(eo.text||String(S)||"",es),ei(!0),ec(),el.current=setTimeout(()=>{ei(!1)},3e3),null===(t=eo.onCopy)||void 0===t||t.call(eo,e)};r.useEffect(()=>ec,[]);let[ed,ef]=r.useState(!1),[ep,eh]=r.useState(!1),[em,eg]=r.useState(!1),[ev,ey]=r.useState(!1),[eb,ex]=r.useState(!1),[ew,ek]=r.useState(!0),[eS,eE]=K(_,{expandable:!1}),eO=eS&&!em,{rows:eC=1}=eE,ej=r.useMemo(()=>!eO||void 0!==eE.suffix||eE.onEllipsis||eE.expandable||F||er,[eO,eE,F,er]);(0,g.Z)(()=>{eS&&!ej&&(ef((0,x.G)("webkitLineClamp")),eh((0,x.G)("textOverflow")))},[ej,eS]);let e_=r.useMemo(()=>!ej&&(1===eC?ep:ed),[ej,ep,ed]),eP=eO&&(e_?eb:ev),eN=eO&&1===eC&&e_,eT=eO&&eC>1&&e_,eA=e=>{var t;eg(!0),null===(t=eE.onExpand)||void 0===t||t.call(eE,e)},[eM,eI]=r.useState(0),[eR,eD]=r.useState(0),eL=e=>{var t;ey(e),ev!==e&&(null===(t=eE.onEllipsis)||void 0===t||t.call(eE,e))};r.useEffect(()=>{let e=L.current;if(eS&&e_&&e){let t=eT?e.offsetHeight<e.scrollHeight:e.offsetWidth<e.scrollWidth;eb!==t&&ex(t)}},[eS,e_,S,eT,ew,eM]),r.useEffect(()=>{let e=L.current;if("undefined"==typeof IntersectionObserver||!e||!e_||!eO)return;let t=new IntersectionObserver(()=>{ek(!!e.offsetParent)});return t.observe(e),()=>{t.disconnect()}},[e_,eO]);let eZ={};eZ=!0===eE.tooltip?{title:null!==(n=H.text)&&void 0!==n?n:S}:r.isValidElement(eE.tooltip)?{title:eE.tooltip}:"object"==typeof eE.tooltip?Object.assign({title:null!==(i=H.text)&&void 0!==i?i:S},eE.tooltip):{title:eE.tooltip};let ez=r.useMemo(()=>{let e=e=>["string","number"].includes(typeof e);return!eS||e_?void 0:e(H.text)?H.text:e(S)?S:e(A)?A:e(eZ.title)?eZ.title:void 0},[eS,e_,A,eZ.title,eP]);if(q)return r.createElement(U,{value:null!==(l=H.text)&&void 0!==l?l:"string"==typeof S?S:"",onSave:e=>{var t;null===(t=H.onChange)||void 0===t||t.call(H,e),G(!1)},onCancel:()=>{var e;null===(e=H.onCancel)||void 0===e||e.call(H),G(!1)},onEnd:H.onEnd,prefixCls:z,className:u,style:f,direction:R,component:T,maxLength:H.maxLength,autoSize:H.autoSize,enterIcon:H.enterIcon});let eB=()=>{let e;let{expandable:t,symbol:n}=eE;return t?(e=n||(null==D?void 0:D.expand),r.createElement("a",{key:"expand",className:"".concat(z,"-expand"),onClick:eA,"aria-label":null==D?void 0:D.expand},e)):null},eF=()=>{if(!F)return;let{icon:e,tooltip:t}=H,n=(0,m.Z)(t)[0]||(null==D?void 0:D.edit),o="string"==typeof n?n:"";return V.includes("icon")?r.createElement(j.Z,{key:"edit",title:!1===t?"":n},r.createElement(E,{ref:Z,className:"".concat(z,"-edit"),onClick:Y,"aria-label":o},e||r.createElement(c,{role:"button"}))):null},eH=()=>{if(!er)return null;let{tooltips:e,icon:t}=eo,n=en(e),i=en(t),l=ea?et(n[1],null==D?void 0:D.copied):et(n[0],null==D?void 0:D.copy),s=ea?null==D?void 0:D.copied:null==D?void 0:D.copy,c="string"==typeof l?l:s;return r.createElement(j.Z,{key:"copy",title:l},r.createElement(E,{className:d()("".concat(z,"-copy"),{["".concat(z,"-copy-success")]:ea,["".concat(z,"-copy-icon-only")]:null==S}),onClick:eu,"aria-label":c},ea?et(i[1],r.createElement(o.Z,null),!0):et(i[0],r.createElement(a.Z,null),!0)))},eq=e=>[e&&eB(),eF(),eH()],eW=e=>[e&&r.createElement("span",{"aria-hidden":!0,key:"ellipsis"},"..."),eE.suffix,eq(e)];return r.createElement(h.Z,{onResize:(e,t)=>{var n;let{offsetWidth:r}=e;eI(r),eD(parseInt(null===(n=window.getComputedStyle)||void 0===n?void 0:n.call(window,t).fontSize,10)||0)},disabled:!eO},n=>r.createElement(J,{tooltipProps:eZ,enabledEllipsis:eO,isEllipsis:eP},r.createElement(X,Object.assign({className:d()({["".concat(z,"-").concat(w)]:w,["".concat(z,"-disabled")]:k,["".concat(z,"-ellipsis")]:eS,["".concat(z,"-single-line")]:eO&&1===eC,["".concat(z,"-ellipsis-single-line")]:eN,["".concat(z,"-ellipsis-multiple-line")]:eT},u),prefixCls:s,style:Object.assign(Object.assign({},f),{WebkitLineClamp:eT?eC:void 0}),component:T,ref:(0,b.sQ)(n,L,t),direction:R,onClick:V.includes("text")?Y:void 0,"aria-label":null==ez?void 0:ez.toString(),title:A},B),r.createElement(Q,{enabledMeasure:eO&&!e_,text:S,rows:eC,width:eM,fontSize:eR,onEllipsis:eL},(t,n)=>{let o=t;return t.length&&n&&ez&&(o=r.createElement("span",{key:"show-content","aria-hidden":!0},o)),function(e,t){let{mark:n,code:o,underline:a,delete:i,strong:l,keyboard:s,italic:c}=e,u=t;function d(e,t){t&&(u=r.createElement(e,{},u))}return d("strong",l),d("u",a),d("del",i),d("code",o),d("mark",n),d("kbd",s),d("i",c),u}(e,r.createElement(r.Fragment,null,o,eW(n)))}))))});var eo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let ea=r.forwardRef((e,t)=>{var{ellipsis:n,rel:o}=e,a=eo(e,["ellipsis","rel"]);let i=Object.assign(Object.assign({},a),{rel:void 0===o&&"_blank"===a.target?"noopener noreferrer":o});return delete i.navigate,r.createElement(er,Object.assign({},i,{ref:t,ellipsis:!!n,component:"a"}))}),ei=r.forwardRef((e,t)=>r.createElement(er,Object.assign({ref:t},e,{component:"div"})));var el=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},es=r.forwardRef((e,t)=>{var{ellipsis:n}=e,o=el(e,["ellipsis"]);let a=r.useMemo(()=>n&&"object"==typeof n?(0,y.Z)(n,["expandable","rows"]):n,[n]);return r.createElement(er,Object.assign({ref:t},o,{ellipsis:a,component:"span"}))}),ec=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eu=[1,2,3,4,5],ed=r.forwardRef((e,t)=>{let n;let{level:o=1}=e,a=ec(e,["level"]);return n=eu.includes(o)?"h".concat(o):"h1",r.createElement(er,Object.assign({ref:t},a,{component:n}))});X.Text=es,X.Link=ea,X.Title=ed,X.Paragraph=ei;var ef=X},85010:function(e,t,n){"use strict";n.d(t,{default:function(){return eT}});var r=n(2265),o=n(83145),a=n(54887),i=n(36760),l=n.n(i),s=n(1119),c=n(76405),u=n(25049),d=n(63496),f=n(15354),p=n(15900),h=n(11993),m=n(31686),g=n(6989),v=n(73129),y=n(41154),b=n(54580),x=n(18242),w=n(32559),k=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){var n=r.toLowerCase(),i=t.toLowerCase(),l=[i];return(".jpg"===i||".jpeg"===i)&&(l=[".jpg",".jpeg"]),l.some(function(e){return n.endsWith(e)})}return/\/\*$/.test(t)?a===t.replace(/\/.*$/,""):o===t||!!/^\w+$/.test(t)&&((0,w.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(t,"'.Skip for check.")),!0)})}return!0};function S(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}var E=function(e,t,n){var r=function e(r,o){if(r){if(r.path=o||"",r.isFile)r.file(function(e){n(e)&&(r.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))});else if(r.isDirectory){var a,i,l;a=function(t){t.forEach(function(t){e(t,"".concat(o).concat(r.name,"/"))})},i=r.createReader(),l=[],function e(){i.readEntries(function(t){var n=Array.prototype.slice.apply(t);l=l.concat(n),n.length?e():a(l)})}()}}};e.forEach(function(e){r(e.webkitGetAsEntry())})},O=+new Date,C=0;function j(){return"rc-upload-".concat(O,"-").concat(++C)}var _=["component","prefixCls","className","classNames","disabled","id","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],P=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){(0,c.Z)(this,n);for(var e,r,a=arguments.length,i=Array(a),l=0;l<a;l++)i[l]=arguments[l];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,d.Z)(e),"state",{uid:j()}),(0,h.Z)((0,d.Z)(e),"reqs",{}),(0,h.Z)((0,d.Z)(e),"fileInput",void 0),(0,h.Z)((0,d.Z)(e),"_isMounted",void 0),(0,h.Z)((0,d.Z)(e),"onChange",function(t){var n=e.props,r=n.accept,a=n.directory,i=t.target.files,l=(0,o.Z)(i).filter(function(e){return!a||k(e,r)});e.uploadFiles(l),e.reset()}),(0,h.Z)((0,d.Z)(e),"onClick",function(t){var n=e.fileInput;if(n){var r=t.target,o=e.props.onClick;r&&"BUTTON"===r.tagName&&(n.parentNode.focus(),r.blur()),n.click(),o&&o(t)}}),(0,h.Z)((0,d.Z)(e),"onKeyDown",function(t){"Enter"===t.key&&e.onClick(t)}),(0,h.Z)((0,d.Z)(e),"onFileDrop",function(t){var n=e.props.multiple;if(t.preventDefault(),"dragover"!==t.type){if(e.props.directory)E(Array.prototype.slice.call(t.dataTransfer.items),e.uploadFiles,function(t){return k(t,e.props.accept)});else{var r=(0,o.Z)(t.dataTransfer.files).filter(function(t){return k(t,e.props.accept)});!1===n&&(r=r.slice(0,1)),e.uploadFiles(r)}}}),(0,h.Z)((0,d.Z)(e),"uploadFiles",function(t){var n=(0,o.Z)(t);Promise.all(n.map(function(t){return t.uid=j(),e.processFile(t,n)})).then(function(t){var n=e.props.onBatchStart;null==n||n(t.map(function(e){return{file:e.origin,parsedFile:e.parsedFile}})),t.filter(function(e){return null!==e.parsedFile}).forEach(function(t){e.post(t)})})}),(0,h.Z)((0,d.Z)(e),"processFile",(r=(0,b.Z)((0,v.Z)().mark(function t(n,r){var o,a,i,l,s,c,u,d,f;return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.props.beforeUpload,a=n,!o){t.next=14;break}return t.prev=3,t.next=6,o(n,r);case 6:a=t.sent,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),a=!1;case 12:if(!1!==a){t.next=14;break}return t.abrupt("return",{origin:n,parsedFile:null,action:null,data:null});case 14:if("function"!=typeof(i=e.props.action)){t.next=21;break}return t.next=18,i(n);case 18:l=t.sent,t.next=22;break;case 21:l=i;case 22:if("function"!=typeof(s=e.props.data)){t.next=29;break}return t.next=26,s(n);case 26:c=t.sent,t.next=30;break;case 29:c=s;case 30:return(u=("object"===(0,y.Z)(a)||"string"==typeof a)&&a?a:n)instanceof File?d=u:d=new File([u],n.name,{type:n.type}),(f=d).uid=n.uid,t.abrupt("return",{origin:n,data:c,parsedFile:f,action:l});case 35:case"end":return t.stop()}},t,null,[[3,9]])})),function(e,t){return r.apply(this,arguments)})),(0,h.Z)((0,d.Z)(e),"saveFileInput",function(t){e.fileInput=t}),e}return(0,u.Z)(n,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(e){var t=this,n=e.data,r=e.origin,o=e.action,a=e.parsedFile;if(this._isMounted){var i=this.props,l=i.onStart,s=i.customRequest,c=i.name,u=i.headers,d=i.withCredentials,f=i.method,p=r.uid;l(r),this.reqs[p]=(s||function(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(t){var r=e.data[t];if(Array.isArray(r)){r.forEach(function(e){n.append("".concat(t,"[]"),e)});return}n.append(t,r)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300){var n;return e.onError(((n=Error("cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"))).status=t.status,n.method=e.method,n.url=e.action,n),S(t))}return e.onSuccess(S(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return null!==r["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(e){null!==r[e]&&t.setRequestHeader(e,r[e])}),t.send(n),{abort:function(){t.abort()}}})({action:o,filename:c,data:n,file:a,headers:u,withCredentials:d,method:f||"post",onProgress:function(e){var n=t.props.onProgress;null==n||n(e,a)},onSuccess:function(e,n){var r=t.props.onSuccess;null==r||r(e,a,n),delete t.reqs[p]},onError:function(e,n){var r=t.props.onError;null==r||r(e,n,a),delete t.reqs[p]}})}}},{key:"reset",value:function(){this.setState({uid:j()})}},{key:"abort",value:function(e){var t=this.reqs;if(e){var n=e.uid?e.uid:e;t[n]&&t[n].abort&&t[n].abort(),delete t[n]}else Object.keys(t).forEach(function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]})}},{key:"render",value:function(){var e,t=this.props,n=t.component,o=t.prefixCls,a=t.className,i=t.classNames,c=t.disabled,u=t.id,d=t.style,f=t.styles,p=t.multiple,v=t.accept,y=t.capture,b=t.children,w=t.directory,k=t.openFileDialogOnClick,S=t.onMouseEnter,E=t.onMouseLeave,O=t.hasControlInside,C=(0,g.Z)(t,_),j=l()((e={},(0,h.Z)(e,o,!0),(0,h.Z)(e,"".concat(o,"-disabled"),c),(0,h.Z)(e,a,a),e)),P=c?{}:{onClick:k?this.onClick:function(){},onKeyDown:k?this.onKeyDown:function(){},onMouseEnter:S,onMouseLeave:E,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:O?void 0:"0"};return r.createElement(n,(0,s.Z)({},P,{className:j,role:O?void 0:"button",style:d}),r.createElement("input",(0,s.Z)({},(0,x.Z)(C,{aria:!0,data:!0}),{id:u,disabled:c,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:(0,m.Z)({display:"none"},(void 0===f?{}:f).input),className:(void 0===i?{}:i).input,accept:v},w?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},{multiple:p,onChange:this.onChange},null!=y?{capture:y}:{})),b)}}]),n}(r.Component);function N(){}var T=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;(0,c.Z)(this,n);for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return e=t.call.apply(t,[this].concat(o)),(0,h.Z)((0,d.Z)(e),"uploader",void 0),(0,h.Z)((0,d.Z)(e),"saveUploader",function(t){e.uploader=t}),e}return(0,u.Z)(n,[{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){return r.createElement(P,(0,s.Z)({},this.props,{ref:this.saveUploader}))}}]),n}(r.Component);(0,h.Z)(T,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:N,onError:N,onSuccess:N,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});var A=n(50506),M=n(71744),I=n(86586),R=n(55274),D=n(13823),L=n(12918),Z=n(63074),z=n(80669),B=n(3104),F=n(352),H=e=>{let{componentCls:t,iconCls:n}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-drag")]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:"".concat((0,F.bf)(e.lineWidth)," dashed ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),[t]:{padding:e.padding},["".concat(t,"-btn")]:{display:"table",width:"100%",height:"100%",outline:"none",borderRadius:e.borderRadiusLG,"&:focus-visible":{outline:"".concat((0,F.bf)(e.lineWidthFocus)," solid ").concat(e.colorPrimaryBorder)}},["".concat(t,"-drag-container")]:{display:"table-cell",verticalAlign:"middle"},["\n &:not(".concat(t,"-disabled):hover,\n &-hover:not(").concat(t,"-disabled)\n ")]:{borderColor:e.colorPrimaryHover},["p".concat(t,"-drag-icon")]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},["p".concat(t,"-text")]:{margin:"0 0 ".concat((0,F.bf)(e.marginXXS)),color:e.colorTextHeading,fontSize:e.fontSizeLG},["p".concat(t,"-hint")]:{color:e.colorTextDescription,fontSize:e.fontSize},["&".concat(t,"-disabled")]:{["p".concat(t,"-drag-icon ").concat(n,",\n p").concat(t,"-text,\n p").concat(t,"-hint\n ")]:{color:e.colorTextDisabled}}}}}},q=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSize:o,lineHeight:a,calc:i}=e,l="".concat(t,"-list-item"),s="".concat(l,"-actions"),c="".concat(l,"-action"),u=e.fontHeightSM;return{["".concat(t,"-wrapper")]:{["".concat(t,"-list")]:Object.assign(Object.assign({},(0,L.dF)()),{lineHeight:e.lineHeight,[l]:{position:"relative",height:i(e.lineHeight).mul(o).equal(),marginTop:e.marginXS,fontSize:o,display:"flex",alignItems:"center",transition:"background-color ".concat(e.motionDurationSlow),"&:hover":{backgroundColor:e.controlItemBgHover},["".concat(l,"-name")]:Object.assign(Object.assign({},L.vS),{padding:"0 ".concat((0,F.bf)(e.paddingXS)),lineHeight:a,flex:"auto",transition:"all ".concat(e.motionDurationSlow)}),[s]:{[c]:{opacity:0},[r]:{color:e.actionsColor,transition:"all ".concat(e.motionDurationSlow)},["\n ".concat(c,":focus-visible,\n &.picture ").concat(c,"\n ")]:{opacity:1},["".concat(c).concat(n,"-btn")]:{height:u,border:0,lineHeight:1}},["".concat(t,"-icon ").concat(r)]:{color:e.colorTextDescription,fontSize:o},["".concat(l,"-progress")]:{position:"absolute",bottom:e.calc(e.uploadProgressOffset).mul(-1).equal(),width:"100%",paddingInlineStart:i(o).add(e.paddingXS).equal(),fontSize:o,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},["".concat(l,":hover ").concat(c)]:{opacity:1},["".concat(l,"-error")]:{color:e.colorError,["".concat(l,"-name, ").concat(t,"-icon ").concat(r)]:{color:e.colorError},[s]:{["".concat(r,", ").concat(r,":hover")]:{color:e.colorError},[c]:{opacity:1}}},["".concat(t,"-list-item-container")]:{transition:"opacity ".concat(e.motionDurationSlow,", height ").concat(e.motionDurationSlow),"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},W=n(11699);let U=new F.E4("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),K=new F.E4("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var $=e=>{let{componentCls:t}=e,n="".concat(t,"-animate-inline");return[{["".concat(t,"-wrapper")]:{["".concat(n,"-appear, ").concat(n,"-enter, ").concat(n,"-leave")]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},["".concat(n,"-appear, ").concat(n,"-enter")]:{animationName:U},["".concat(n,"-leave")]:{animationName:K}}},{["".concat(t,"-wrapper")]:(0,W.J$)(e)},U,K]},V=n(31373);let X=e=>{let{componentCls:t,iconCls:n,uploadThumbnailSize:r,uploadProgressOffset:o,calc:a}=e,i="".concat(t,"-list"),l="".concat(i,"-item");return{["".concat(t,"-wrapper")]:{["\n ".concat(i).concat(i,"-picture,\n ").concat(i).concat(i,"-picture-card,\n ").concat(i).concat(i,"-picture-circle\n ")]:{[l]:{position:"relative",height:a(r).add(a(e.lineWidth).mul(2)).add(a(e.paddingXS).mul(2)).equal(),padding:e.paddingXS,border:"".concat((0,F.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},["".concat(l,"-thumbnail")]:Object.assign(Object.assign({},L.vS),{width:r,height:r,lineHeight:(0,F.bf)(a(r).add(e.paddingSM).equal()),textAlign:"center",flex:"none",[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),["".concat(l,"-progress")]:{bottom:o,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingSM).mul(2).equal()),")"),marginTop:0,paddingInlineStart:a(r).add(e.paddingXS).equal()}},["".concat(l,"-error")]:{borderColor:e.colorError,["".concat(l,"-thumbnail ").concat(n)]:{["svg path[fill='".concat(V.iN[0],"']")]:{fill:e.colorErrorBg},["svg path[fill='".concat(V.iN.primary,"']")]:{fill:e.colorError}}},["".concat(l,"-uploading")]:{borderStyle:"dashed",["".concat(l,"-name")]:{marginBottom:o}}},["".concat(i).concat(i,"-picture-circle ").concat(l)]:{["&, &::before, ".concat(l,"-thumbnail")]:{borderRadius:"50%"}}}}},G=e=>{let{componentCls:t,iconCls:n,fontSizeLG:r,colorTextLightSolid:o,calc:a}=e,i="".concat(t,"-list"),l="".concat(i,"-item"),s=e.uploadPicCardSize;return{["\n ".concat(t,"-wrapper").concat(t,"-picture-card-wrapper,\n ").concat(t,"-wrapper").concat(t,"-picture-circle-wrapper\n ")]:Object.assign(Object.assign({},(0,L.dF)()),{display:"inline-block",width:"100%",["".concat(t).concat(t,"-select")]:{width:s,height:s,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:"".concat((0,F.bf)(e.lineWidth)," dashed ").concat(e.colorBorder),borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color ".concat(e.motionDurationSlow),["> ".concat(t)]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},["&:not(".concat(t,"-disabled):hover")]:{borderColor:e.colorPrimary}},["".concat(i).concat(i,"-picture-card, ").concat(i).concat(i,"-picture-circle")]:{["".concat(i,"-item-container")]:{display:"inline-block",width:s,height:s,marginBlock:"0 ".concat((0,F.bf)(e.marginXS)),marginInline:"0 ".concat((0,F.bf)(e.marginXS)),verticalAlign:"top"},"&::after":{display:"none"},[l]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),height:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),backgroundColor:e.colorBgMask,opacity:0,transition:"all ".concat(e.motionDurationSlow),content:'" "'}},["".concat(l,":hover")]:{["&::before, ".concat(l,"-actions")]:{opacity:1}},["".concat(l,"-actions")]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:"all ".concat(e.motionDurationSlow),["\n ".concat(n,"-eye,\n ").concat(n,"-download,\n ").concat(n,"-delete\n ")]:{zIndex:10,width:r,margin:"0 ".concat((0,F.bf)(e.marginXXS)),fontSize:r,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),color:o,"&:hover":{color:o},svg:{verticalAlign:"baseline"}}},["".concat(l,"-thumbnail, ").concat(l,"-thumbnail img")]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},["".concat(l,"-name")]:{display:"none",textAlign:"center"},["".concat(l,"-file + ").concat(l,"-name")]:{position:"absolute",bottom:e.margin,display:"block",width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")")},["".concat(l,"-uploading")]:{["&".concat(l)]:{backgroundColor:e.colorFillAlter},["&::before, ".concat(n,"-eye, ").concat(n,"-download, ").concat(n,"-delete")]:{display:"none"}},["".concat(l,"-progress")]:{bottom:e.marginXL,width:"calc(100% - ".concat((0,F.bf)(a(e.paddingXS).mul(2).equal()),")"),paddingInlineStart:0}}}),["".concat(t,"-wrapper").concat(t,"-picture-circle-wrapper")]:{["".concat(t).concat(t,"-select")]:{borderRadius:"50%"}}}};var Y=e=>{let{componentCls:t}=e;return{["".concat(t,"-rtl")]:{direction:"rtl"}}};let Q=e=>{let{componentCls:t,colorTextDisabled:n}=e;return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,L.Wf)(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},["".concat(t,"-select")]:{display:"inline-block"},["".concat(t,"-disabled")]:{color:n,cursor:"not-allowed"}})}};var J=(0,z.I$)("Upload",e=>{let{fontSizeHeading3:t,fontHeight:n,lineWidth:r,controlHeightLG:o,calc:a}=e,i=(0,B.TS)(e,{uploadThumbnailSize:a(t).mul(2).equal(),uploadProgressOffset:a(a(n).div(2)).add(r).equal(),uploadPicCardSize:a(o).mul(2.55).equal()});return[Q(i),H(i),X(i),G(i),q(i),$(i),Y(i),(0,Z.Z)(i)]},e=>({actionsColor:e.colorTextDescription})),ee={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:e}}]}},name:"file",theme:"twotone"},et=n(55015),en=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:ee}))}),er=n(61935),eo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},ea=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:eo}))}),ei={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:e}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:e}}]}},name:"picture",theme:"twotone"},el=r.forwardRef(function(e,t){return r.createElement(et.Z,(0,s.Z)({},e,{ref:t,icon:ei}))}),es=n(47970),ec=n(51646),eu=n(68710),ed=n(19722),ef=n(73002);function ep(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function eh(e,t){let n=(0,o.Z)(t),r=n.findIndex(t=>{let{uid:n}=t;return n===e.uid});return -1===r?n.push(e):n[r]=e,n}function em(e,t){let n=void 0!==e.uid?"uid":"name";return t.filter(t=>t[n]===e[n])[0]}let eg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[""])[0]},ev=e=>0===e.indexOf("image/"),ey=e=>{if(e.type&&!e.thumbUrl)return ev(e.type);let t=e.thumbUrl||e.url||"",n=eg(t);return!!(/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n))||!/^data:/.test(t)&&!n};function eb(e){return new Promise(t=>{if(!e.type||!ev(e.type)){t("");return}let n=document.createElement("canvas");n.width=200,n.height=200,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(200,"px; height: ").concat(200,"px; z-index: 9999; display: none;"),document.body.appendChild(n);let r=n.getContext("2d"),o=new Image;if(o.onload=()=>{let{width:e,height:a}=o,i=200,l=200,s=0,c=0;e>a?c=-((l=200/e*a)-i)/2:s=-((i=200/a*e)-l)/2,r.drawImage(o,s,c,i,l);let u=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(o.src),t(u)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){let t=new FileReader;t.onload=()=>{t.result&&(o.src=t.result)},t.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){let n=new FileReader;n.onload=()=>{n.result&&t(n.result)},n.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)})}var ex=n(26349),ew=n(73879),ek=n(6520),eS=n(68565),eE=n(89970);let eO=r.forwardRef((e,t)=>{var n,o;let{prefixCls:a,className:i,style:s,locale:c,listType:u,file:d,items:f,progress:p,iconRender:h,actionIconRender:m,itemRender:g,isImgUrl:v,showPreviewIcon:y,showRemoveIcon:b,showDownloadIcon:x,previewIcon:w,removeIcon:k,downloadIcon:S,onPreview:E,onDownload:O,onClose:C}=e,{status:j}=d,[_,P]=r.useState(j);r.useEffect(()=>{"removed"!==j&&P(j)},[j]);let[N,T]=r.useState(!1);r.useEffect(()=>{let e=setTimeout(()=>{T(!0)},300);return()=>{clearTimeout(e)}},[]);let A=h(d),I=r.createElement("div",{className:"".concat(a,"-icon")},A);if("picture"===u||"picture-card"===u||"picture-circle"===u){if("uploading"!==_&&(d.thumbUrl||d.url)){let e=(null==v?void 0:v(d))?r.createElement("img",{src:d.thumbUrl||d.url,alt:d.name,className:"".concat(a,"-list-item-image"),crossOrigin:d.crossOrigin}):A,t=l()("".concat(a,"-list-item-thumbnail"),{["".concat(a,"-list-item-file")]:v&&!v(d)});I=r.createElement("a",{className:t,onClick:e=>E(d,e),href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer"},e)}else{let e=l()("".concat(a,"-list-item-thumbnail"),{["".concat(a,"-list-item-file")]:"uploading"!==_});I=r.createElement("div",{className:e},A)}}let R=l()("".concat(a,"-list-item"),"".concat(a,"-list-item-").concat(_)),D="string"==typeof d.linkProps?JSON.parse(d.linkProps):d.linkProps,L=b?m(("function"==typeof k?k(d):k)||r.createElement(ex.Z,null),()=>C(d),a,c.removeFile,!0):null,Z=x&&"done"===_?m(("function"==typeof S?S(d):S)||r.createElement(ew.Z,null),()=>O(d),a,c.downloadFile):null,z="picture-card"!==u&&"picture-circle"!==u&&r.createElement("span",{key:"download-delete",className:l()("".concat(a,"-list-item-actions"),{picture:"picture"===u})},Z,L),B=l()("".concat(a,"-list-item-name")),F=d.url?[r.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:B,title:d.name},D,{href:d.url,onClick:e=>E(d,e)}),d.name),z]:[r.createElement("span",{key:"view",className:B,onClick:e=>E(d,e),title:d.name},d.name),z],H=y&&(d.url||d.thumbUrl)?r.createElement("a",{href:d.url||d.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>E(d,e),title:c.previewFile},"function"==typeof w?w(d):w||r.createElement(ek.Z,null)):null,q=("picture-card"===u||"picture-circle"===u)&&"uploading"!==_&&r.createElement("span",{className:"".concat(a,"-list-item-actions")},H,"done"===_&&Z,L),{getPrefixCls:W}=r.useContext(M.E_),U=W(),K=r.createElement("div",{className:R},I,F,q,N&&r.createElement(es.ZP,{motionName:"".concat(U,"-fade"),visible:"uploading"===_,motionDeadline:2e3},e=>{let{className:t}=e,n="percent"in d?r.createElement(eS.Z,Object.assign({},p,{type:"line",percent:d.percent,"aria-label":d["aria-label"],"aria-labelledby":d["aria-labelledby"]})):null;return r.createElement("div",{className:l()("".concat(a,"-list-item-progress"),t)},n)})),$=d.response&&"string"==typeof d.response?d.response:(null===(n=d.error)||void 0===n?void 0:n.statusText)||(null===(o=d.error)||void 0===o?void 0:o.message)||c.uploadError,V="error"===_?r.createElement(eE.Z,{title:$,getPopupContainer:e=>e.parentNode},K):K;return r.createElement("div",{className:l()("".concat(a,"-list-item-container"),i),style:s,ref:t},g?g(V,d,f,{download:O.bind(null,d),preview:E.bind(null,d),remove:C.bind(null,d)}):V)}),eC=r.forwardRef((e,t)=>{let{listType:n="text",previewFile:a=eb,onPreview:i,onDownload:s,onRemove:c,locale:u,iconRender:d,isImageUrl:f=ey,prefixCls:p,items:h=[],showPreviewIcon:m=!0,showRemoveIcon:g=!0,showDownloadIcon:v=!1,removeIcon:y,previewIcon:b,downloadIcon:x,progress:w={size:[-1,2],showInfo:!1},appendAction:k,appendActionVisible:S=!0,itemRender:E,disabled:O}=e,C=(0,ec.Z)(),[j,_]=r.useState(!1);r.useEffect(()=>{("picture"===n||"picture-card"===n||"picture-circle"===n)&&(h||[]).forEach(e=>{"undefined"!=typeof document&&"undefined"!=typeof window&&window.FileReader&&window.File&&(e.originFileObj instanceof File||e.originFileObj instanceof Blob)&&void 0===e.thumbUrl&&(e.thumbUrl="",a&&a(e.originFileObj).then(t=>{e.thumbUrl=t||"",C()}))})},[n,h,a]),r.useEffect(()=>{_(!0)},[]);let P=(e,t)=>{if(i)return null==t||t.preventDefault(),i(e)},N=e=>{"function"==typeof s?s(e):e.url&&window.open(e.url)},T=e=>{null==c||c(e)},A=e=>{if(d)return d(e,n);let t="uploading"===e.status,o=f&&f(e)?r.createElement(el,null):r.createElement(en,null),a=t?r.createElement(er.Z,null):r.createElement(ea,null);return"picture"===n?a=t?r.createElement(er.Z,null):o:("picture-card"===n||"picture-circle"===n)&&(a=t?u.uploading:o),a},I=(e,t,n,o,a)=>{let i={type:"text",size:"small",title:o,onClick:n=>{t(),(0,ed.l$)(e)&&e.props.onClick&&e.props.onClick(n)},className:"".concat(n,"-list-item-action")};if(a&&(i.disabled=O),(0,ed.l$)(e)){let t=(0,ed.Tm)(e,Object.assign(Object.assign({},e.props),{onClick:()=>{}}));return r.createElement(ef.ZP,Object.assign({},i,{icon:t}))}return r.createElement(ef.ZP,Object.assign({},i),r.createElement("span",null,e))};r.useImperativeHandle(t,()=>({handlePreview:P,handleDownload:N}));let{getPrefixCls:R}=r.useContext(M.E_),D=R("upload",p),L=R(),Z=l()("".concat(D,"-list"),"".concat(D,"-list-").concat(n)),z=(0,o.Z)(h.map(e=>({key:e.uid,file:e}))),B={motionDeadline:2e3,motionName:"".concat(D,"-").concat("picture-card"===n||"picture-circle"===n?"animate-inline":"animate"),keys:z,motionAppear:j},F=r.useMemo(()=>{let e=Object.assign({},(0,eu.Z)(L));return delete e.onAppearEnd,delete e.onEnterEnd,delete e.onLeaveEnd,e},[L]);return"picture-card"!==n&&"picture-circle"!==n&&(B=Object.assign(Object.assign({},F),B)),r.createElement("div",{className:Z},r.createElement(es.V4,Object.assign({},B,{component:!1}),e=>{let{key:t,file:o,className:a,style:i}=e;return r.createElement(eO,{key:t,locale:u,prefixCls:D,className:a,style:i,file:o,items:h,progress:w,listType:n,isImgUrl:f,showPreviewIcon:m,showRemoveIcon:g,showDownloadIcon:v,removeIcon:y,previewIcon:b,downloadIcon:x,iconRender:A,actionIconRender:I,itemRender:E,onPreview:P,onDownload:N,onClose:T})}),k&&r.createElement(es.ZP,Object.assign({},B,{visible:S,forceRender:!0}),e=>{let{className:t,style:n}=e;return(0,ed.Tm)(k,e=>({className:l()(e.className,t),style:Object.assign(Object.assign(Object.assign({},n),{pointerEvents:t?"none":void 0}),e.style)}))}))}),ej="__LIST_IGNORE_".concat(Date.now(),"__"),e_=r.forwardRef((e,t)=>{let n;let{fileList:i,defaultFileList:s,onRemove:c,showUploadList:u=!0,listType:d="text",onPreview:f,onDownload:p,onChange:h,onDrop:m,previewFile:g,disabled:v,locale:y,iconRender:b,isImageUrl:x,progress:w,prefixCls:k,className:S,type:E="select",children:O,style:C,itemRender:j,maxCount:_,data:P={},multiple:N=!1,hasControlInside:L=!0,action:Z="",accept:z="",supportServerRender:B=!0,rootClassName:F}=e,H=r.useContext(I.Z),q=null!=v?v:H,[W,U]=(0,A.Z)(s||[],{value:i,postState:e=>null!=e?e:[]}),[K,$]=r.useState("drop"),V=r.useRef(null);r.useMemo(()=>{let e=Date.now();(i||[]).forEach((t,n)=>{t.uid||Object.isFrozen(t)||(t.uid="__AUTO__".concat(e,"_").concat(n,"__"))})},[i]);let X=(e,t,n)=>{let r=(0,o.Z)(t),i=!1;1===_?r=r.slice(-1):_&&(i=r.length>_,r=r.slice(0,_)),(0,a.flushSync)(()=>{U(r)});let l={file:e,fileList:r};n&&(l.event=n),(!i||r.some(t=>t.uid===e.uid))&&(0,a.flushSync)(()=>{null==h||h(l)})},G=e=>{let t=e.filter(e=>!e.file[ej]);if(!t.length)return;let n=t.map(e=>ep(e.file)),r=(0,o.Z)(W);n.forEach(e=>{r=eh(e,r)}),n.forEach((e,n)=>{let o=e;if(t[n].parsedFile)e.status="uploading";else{let t;let{originFileObj:n}=e;try{t=new File([n],n.name,{type:n.type})}catch(e){(t=new Blob([n],{type:n.type})).name=n.name,t.lastModifiedDate=new Date,t.lastModified=new Date().getTime()}t.uid=e.uid,o=t}X(o,r)})},Y=(e,t,n)=>{try{"string"==typeof e&&(e=JSON.parse(e))}catch(e){}if(!em(t,W))return;let r=ep(t);r.status="done",r.percent=100,r.response=e,r.xhr=n;let o=eh(r,W);X(r,o)},Q=(e,t)=>{if(!em(t,W))return;let n=ep(t);n.status="uploading",n.percent=e.percent;let r=eh(n,W);X(n,r,e)},ee=(e,t,n)=>{if(!em(n,W))return;let r=ep(n);r.error=e,r.response=t,r.status="error";let o=eh(r,W);X(r,o)},et=e=>{let t;Promise.resolve("function"==typeof c?c(e):c).then(n=>{var r;if(!1===n)return;let o=function(e,t){let n=void 0!==e.uid?"uid":"name",r=t.filter(t=>t[n]!==e[n]);return r.length===t.length?null:r}(e,W);o&&(t=Object.assign(Object.assign({},e),{status:"removed"}),null==W||W.forEach(e=>{let n=void 0!==t.uid?"uid":"name";e[n]!==t[n]||Object.isFrozen(e)||(e.status="removed")}),null===(r=V.current)||void 0===r||r.abort(t),X(t,o))})},en=e=>{$(e.type),"drop"===e.type&&(null==m||m(e))};r.useImperativeHandle(t,()=>({onBatchStart:G,onSuccess:Y,onProgress:Q,onError:ee,fileList:W,upload:V.current}));let{getPrefixCls:er,direction:eo,upload:ea}=r.useContext(M.E_),ei=er("upload",k),el=Object.assign(Object.assign({onBatchStart:G,onError:ee,onProgress:Q,onSuccess:Y},e),{data:P,multiple:N,action:Z,accept:z,supportServerRender:B,prefixCls:ei,disabled:q,beforeUpload:(t,n)=>{var r,o,a,i;return r=void 0,o=void 0,a=void 0,i=function*(){let{beforeUpload:r,transformFile:o}=e,a=t;if(r){let e=yield r(t,n);if(!1===e)return!1;if(delete t[ej],e===ej)return Object.defineProperty(t,ej,{value:!0,configurable:!0}),!1;"object"==typeof e&&e&&(a=e)}return o&&(a=yield o(a)),a},new(a||(a=Promise))(function(e,t){function n(e){try{s(i.next(e))}catch(e){t(e)}}function l(e){try{s(i.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof a?r:new a(function(e){e(r)})).then(n,l)}s((i=i.apply(r,o||[])).next())})},onChange:void 0,hasControlInside:L});delete el.className,delete el.style,(!O||q)&&delete el.id;let es="".concat(ei,"-wrapper"),[ec,eu,ed]=J(ei,es),[ef]=(0,R.Z)("Upload",D.Z.Upload),{showRemoveIcon:eg,showPreviewIcon:ev,showDownloadIcon:ey,removeIcon:eb,previewIcon:ex,downloadIcon:ew}="boolean"==typeof u?{}:u,ek=void 0===eg?!q:!!eg,eS=(e,t)=>u?r.createElement(eC,{prefixCls:ei,listType:d,items:W,previewFile:g,onPreview:f,onDownload:p,onRemove:et,showRemoveIcon:ek,showPreviewIcon:ev,showDownloadIcon:ey,removeIcon:eb,previewIcon:ex,downloadIcon:ew,iconRender:b,locale:Object.assign(Object.assign({},ef),y),isImageUrl:x,progress:w,appendAction:e,appendActionVisible:t,itemRender:j,disabled:q}):e,eE=l()(es,S,F,eu,ed,null==ea?void 0:ea.className,{["".concat(ei,"-rtl")]:"rtl"===eo,["".concat(ei,"-picture-card-wrapper")]:"picture-card"===d,["".concat(ei,"-picture-circle-wrapper")]:"picture-circle"===d}),eO=Object.assign(Object.assign({},null==ea?void 0:ea.style),C);if("drag"===E){let e=l()(eu,ei,"".concat(ei,"-drag"),{["".concat(ei,"-drag-uploading")]:W.some(e=>"uploading"===e.status),["".concat(ei,"-drag-hover")]:"dragover"===K,["".concat(ei,"-disabled")]:q,["".concat(ei,"-rtl")]:"rtl"===eo});return ec(r.createElement("span",{className:eE},r.createElement("div",{className:e,style:eO,onDrop:en,onDragOver:en,onDragLeave:en},r.createElement(T,Object.assign({},el,{ref:V,className:"".concat(ei,"-btn")}),r.createElement("div",{className:"".concat(ei,"-drag-container")},O))),eS()))}let e_=l()(ei,"".concat(ei,"-select"),{["".concat(ei,"-disabled")]:q}),eP=(n=O?void 0:{display:"none"},r.createElement("div",{className:e_,style:n},r.createElement(T,Object.assign({},el,{ref:V}))));return ec("picture-card"===d||"picture-circle"===d?r.createElement("span",{className:eE},eS(eP,!!O)):r.createElement("span",{className:eE},eP,eS()))});var eP=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eN=r.forwardRef((e,t)=>{var{style:n,height:o,hasControlInside:a=!1}=e,i=eP(e,["style","height","hasControlInside"]);return r.createElement(e_,Object.assign({ref:t,hasControlInside:a},i,{type:"drag",style:Object.assign(Object.assign({},n),{height:o})}))});e_.Dragger=eN,e_.LIST_IGNORE=ej;var eT=e_},49211:function(e,t,n){"use strict";var r=n(99623),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,i,l,s,c,u,d,f=!1;t||(t={}),i=t.debug||!1;try{if(s=r(),c=document.createRange(),u=document.getSelection(),(d=document.createElement("span")).textContent=e,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),void 0===n.clipboardData){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=o[t.format]||o.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),c.selectNodeContents(d),u.addRange(c),!document.execCommand("copy"))throw Error("copy command was unsuccessful");f=!0}catch(r){i&&console.error("unable to copy using execCommand: ",r),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(r){i&&console.error("unable to copy using clipboardData: ",r),i&&console.error("falling back to prompt"),n="message"in t?t.message:"Copy to clipboard: #{key}, Enter",a=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",l=n.replace(/#{\s*key\s*}/g,a),window.prompt(l,e)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(c):u.removeAllRanges()),d&&document.body.removeChild(d),s()}return f}},7656:function(e,t,n){"use strict";function r(e,t){if(t.length<e)throw TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}n.d(t,{Z:function(){return r}})},47869:function(e,t,n){"use strict";function r(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n.d(t,{Z:function(){return r}})},7366:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(41154),o=n(25721),a=n(55463),i=n(99735),l=n(7656),s=n(47869);function c(e,t){if((0,l.Z)(2,arguments),!t||"object"!==(0,r.Z)(t))return new Date(NaN);var n=t.years?(0,s.Z)(t.years):0,c=t.months?(0,s.Z)(t.months):0,u=t.weeks?(0,s.Z)(t.weeks):0,d=t.days?(0,s.Z)(t.days):0,f=t.hours?(0,s.Z)(t.hours):0,p=t.minutes?(0,s.Z)(t.minutes):0,h=t.seconds?(0,s.Z)(t.seconds):0,m=(0,i.Z)(e),g=c||n?(0,a.Z)(m,c+12*n):m;return new Date((d||u?(0,o.Z)(g,d+7*u):g).getTime()+1e3*(h+60*(p+60*f)))}},25721:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47869),o=n(99735),a=n(7656);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e),i=(0,r.Z)(t);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}},55463:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47869),o=n(99735),a=n(7656);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e),i=(0,r.Z)(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),s=new Date(n.getTime());return(s.setMonth(n.getMonth()+i+1,0),l>=s.getDate())?s:(n.setFullYear(s.getFullYear(),s.getMonth(),l),n)}},99735:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(41154),o=n(7656);function a(e){(0,o.Z)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,r.Z)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):(("string"==typeof e||"[object String]"===t)&&"undefined"!=typeof console&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}},61134:function(e,t,n){var r;!function(o){"use strict";var a,i={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},l=!0,s="[DecimalError] ",c=s+"Invalid argument: ",u=s+"Exponent out of range: ",d=Math.floor,f=Math.pow,p=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=d(1286742750677284.5),m={};function g(e,t){var n,r,o,a,i,s,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),l?C(t,f):t;if(c=e.d,u=t.d,i=e.e,o=t.e,c=c.slice(),a=i-o){for(a<0?(r=c,a=-a,s=u.length):(r=u,o=i,s=c.length),a>(s=(i=Math.ceil(f/7))>s?i+1:s+1)&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for((s=c.length)-(a=u.length)<0&&(a=s,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/1e7|0,c[a]%=1e7;for(n&&(c.unshift(n),++o),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=o,l?C(t,f):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(c+e)}function y(e){var t,n,r,o=e.length-1,a="",i=e[0];if(o>0){for(a+=i,t=1;t<o;t++)(n=7-(r=e[t]+"").length)&&(a+=S(n)),a+=r;(n=7-(r=(i=e[t])+"").length)&&(a+=S(n))}else if(0===i)return"0";for(;i%10==0;)i/=10;return a+i}m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},m.comparedTo=m.cmp=function(e){var t,n,r,o;if(e=new this.constructor(e),this.s!==e.s)return this.s||-e.s;if(this.e!==e.e)return this.e>e.e^this.s<0?1:-1;for(t=0,n=(r=this.d.length)<(o=e.d.length)?r:o;t<n;++t)if(this.d[t]!==e.d[t])return this.d[t]>e.d[t]^this.s<0?1:-1;return r===o?0:r>o^this.s<0?1:-1},m.decimalPlaces=m.dp=function(){var e=this.d.length-1,t=(e-this.e)*7;if(e=this.d[e])for(;e%10==0;e/=10)t--;return t<0?0:t},m.dividedBy=m.div=function(e){return b(this,new this.constructor(e))},m.dividedToIntegerBy=m.idiv=function(e){var t=this.constructor;return C(b(this,new t(e),0,1),t.precision)},m.equals=m.eq=function(e){return!this.cmp(e)},m.exponent=function(){return w(this)},m.greaterThan=m.gt=function(e){return this.cmp(e)>0},m.greaterThanOrEqualTo=m.gte=function(e){return this.cmp(e)>=0},m.isInteger=m.isint=function(){return this.e>this.d.length-2},m.isNegative=m.isneg=function(){return this.s<0},m.isPositive=m.ispos=function(){return this.s>0},m.isZero=function(){return 0===this.s},m.lessThan=m.lt=function(e){return 0>this.cmp(e)},m.lessThanOrEqualTo=m.lte=function(e){return 1>this.cmp(e)},m.logarithm=m.log=function(e){var t,n=this.constructor,r=n.precision,o=r+5;if(void 0===e)e=new n(10);else if((e=new n(e)).s<1||e.eq(a))throw Error(s+"NaN");if(this.s<1)throw Error(s+(this.s?"NaN":"-Infinity"));return this.eq(a)?new n(0):(l=!1,t=b(E(this,o),E(e,o),o),l=!0,C(t,r))},m.minus=m.sub=function(e){return e=new this.constructor(e),this.s==e.s?j(this,e):g(this,(e.s=-e.s,e))},m.modulo=m.mod=function(e){var t,n=this.constructor,r=n.precision;if(!(e=new n(e)).s)throw Error(s+"NaN");return this.s?(l=!1,t=b(this,e,0,1).times(e),l=!0,this.minus(t)):C(new n(this),r)},m.naturalExponential=m.exp=function(){return x(this)},m.naturalLogarithm=m.ln=function(){return E(this)},m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},m.plus=m.add=function(e){return e=new this.constructor(e),this.s==e.s?g(this,e):j(this,(e.s=-e.s,e))},m.precision=m.sd=function(e){var t,n,r;if(void 0!==e&&!!e!==e&&1!==e&&0!==e)throw Error(c+e);if(t=w(this)+1,n=7*(r=this.d.length-1)+1,r=this.d[r]){for(;r%10==0;r/=10)n--;for(r=this.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},m.squareRoot=m.sqrt=function(){var e,t,n,r,o,a,i,c=this.constructor;if(this.s<1){if(!this.s)return new c(0);throw Error(s+"NaN")}for(e=w(this),l=!1,0==(o=Math.sqrt(+this))||o==1/0?(((t=y(this.d)).length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=d((e+1)/2)-(e<0||e%2),r=new c(t=o==1/0?"5e"+e:(t=o.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new c(o.toString()),o=i=(n=c.precision)+3;;)if(r=(a=r).plus(b(this,a,i+2)).times(.5),y(a.d).slice(0,i)===(t=y(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),o==i&&"4999"==t){if(C(a,n+1,0),a.times(a).eq(this)){r=a;break}}else if("9999"!=t)break;i+=4}return l=!0,C(r,n)},m.times=m.mul=function(e){var t,n,r,o,a,i,s,c,u,d=this.constructor,f=this.d,p=(e=new d(e)).d;if(!this.s||!e.s)return new d(0);for(e.s*=this.s,n=this.e+e.e,(c=f.length)<(u=p.length)&&(a=f,f=p,p=a,i=c,c=u,u=i),a=[],r=i=c+u;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,o=c+r;o>r;)s=a[o]+p[r]*f[o-r-1]+t,a[o--]=s%1e7|0,t=s/1e7|0;a[o]=(a[o]+t)%1e7|0}for(;!a[--i];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,l?C(e,d.precision):e},m.toDecimalPlaces=m.todp=function(e,t){var n=this,r=n.constructor;return(n=new r(n),void 0===e)?n:(v(e,0,1e9),void 0===t?t=r.rounding:v(t,0,8),C(n,e+w(n)+1,t))},m.toExponential=function(e,t){var n,r=this,o=r.constructor;return void 0===e?n=_(r,!0):(v(e,0,1e9),void 0===t?t=o.rounding:v(t,0,8),n=_(r=C(new o(r),e+1,t),!0,e+1)),n},m.toFixed=function(e,t){var n,r,o=this.constructor;return void 0===e?_(this):(v(e,0,1e9),void 0===t?t=o.rounding:v(t,0,8),n=_((r=C(new o(this),e+w(this)+1,t)).abs(),!1,e+w(r)+1),this.isneg()&&!this.isZero()?"-"+n:n)},m.toInteger=m.toint=function(){var e=this.constructor;return C(new e(this),w(this)+1,e.rounding)},m.toNumber=function(){return+this},m.toPower=m.pow=function(e){var t,n,r,o,i,c,u=this,f=u.constructor,p=+(e=new f(e));if(!e.s)return new f(a);if(!(u=new f(u)).s){if(e.s<1)throw Error(s+"Infinity");return u}if(u.eq(a))return u;if(r=f.precision,e.eq(a))return C(u,r);if(c=(t=e.e)>=(n=e.d.length-1),i=u.s,c){if((n=p<0?-p:p)<=9007199254740991){for(o=new f(a),t=Math.ceil(r/7+4),l=!1;n%2&&P((o=o.times(u)).d,t),0!==(n=d(n/2));)P((u=u.times(u)).d,t);return l=!0,e.s<0?new f(a).div(o):C(o,r)}}else if(i<0)throw Error(s+"NaN");return i=i<0&&1&e.d[Math.max(t,n)]?-1:1,u.s=1,l=!1,o=e.times(E(u,r+12)),l=!0,(o=x(o)).s=i,o},m.toPrecision=function(e,t){var n,r,o=this,a=o.constructor;return void 0===e?(n=w(o),r=_(o,n<=a.toExpNeg||n>=a.toExpPos)):(v(e,1,1e9),void 0===t?t=a.rounding:v(t,0,8),n=w(o=C(new a(o),e,t)),r=_(o,e<=n||n<=a.toExpNeg,e)),r},m.toSignificantDigits=m.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(v(e,1,1e9),void 0===t?t=n.rounding:v(t,0,8)),C(new n(this),e,t)},m.toString=m.valueOf=m.val=m.toJSON=function(){var e=w(this),t=this.constructor;return _(this,e<=t.toExpNeg||e>=t.toExpPos)};var b=function(){function e(e,t){var n,r=0,o=e.length;for(e=e.slice();o--;)n=e[o]*t+r,e[o]=n%1e7|0,r=n/1e7|0;return r&&e.unshift(r),e}function t(e,t,n,r){var o,a;if(n!=r)a=n>r?1:-1;else for(o=a=0;o<n;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=1e7*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,o,a,i){var l,c,u,d,f,p,h,m,g,v,y,b,x,k,S,E,O,j,_=r.constructor,P=r.s==o.s?1:-1,N=r.d,T=o.d;if(!r.s)return new _(r);if(!o.s)throw Error(s+"Division by zero");for(u=0,c=r.e-o.e,O=T.length,S=N.length,m=(h=new _(P)).d=[];T[u]==(N[u]||0);)++u;if(T[u]>(N[u]||0)&&--c,(b=null==a?a=_.precision:i?a+(w(r)-w(o))+1:a)<0)return new _(0);if(b=b/7+2|0,u=0,1==O)for(d=0,T=T[0],b++;(u<S||d)&&b--;u++)x=1e7*d+(N[u]||0),m[u]=x/T|0,d=x%T|0;else{for((d=1e7/(T[0]+1)|0)>1&&(T=e(T,d),N=e(N,d),O=T.length,S=N.length),k=O,v=(g=N.slice(0,O)).length;v<O;)g[v++]=0;(j=T.slice()).unshift(0),E=T[0],T[1]>=1e7/2&&++E;do d=0,(l=t(T,g,O,v))<0?(y=g[0],O!=v&&(y=1e7*y+(g[1]||0)),(d=y/E|0)>1?(d>=1e7&&(d=1e7-1),p=(f=e(T,d)).length,v=g.length,1==(l=t(f,g,p,v))&&(d--,n(f,O<p?j:T,p))):(0==d&&(l=d=1),f=T.slice()),(p=f.length)<v&&f.unshift(0),n(g,f,v),-1==l&&(v=g.length,(l=t(T,g,O,v))<1&&(d++,n(g,O<v?j:T,v))),v=g.length):0===l&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[v++]=N[k]||0:(g=[N[k]],v=1);while((k++<S||void 0!==g[0])&&b--)}return m[0]||m.shift(),h.e=c,C(h,i?a+w(h)+1:a)}}();function x(e,t){var n,r,o,i,s,c=0,d=0,p=e.constructor,h=p.precision;if(w(e)>16)throw Error(u+w(e));if(!e.s)return new p(a);for(null==t?(l=!1,s=h):s=t,i=new p(.03125);e.abs().gte(.1);)e=e.times(i),d+=5;for(s+=Math.log(f(2,d))/Math.LN10*2+5|0,n=r=o=new p(a),p.precision=s;;){if(r=C(r.times(e),s),n=n.times(++c),y((i=o.plus(b(r,n,s))).d).slice(0,s)===y(o.d).slice(0,s)){for(;d--;)o=C(o.times(o),s);return p.precision=h,null==t?(l=!0,C(o,h)):o}o=i}}function w(e){for(var t=7*e.e,n=e.d[0];n>=10;n/=10)t++;return t}function k(e,t,n){if(t>e.LN10.sd())throw l=!0,n&&(e.precision=n),Error(s+"LN10 precision limit exceeded");return C(new e(e.LN10),t)}function S(e){for(var t="";e--;)t+="0";return t}function E(e,t){var n,r,o,i,c,u,d,f,p,h=1,m=e,g=m.d,v=m.constructor,x=v.precision;if(m.s<1)throw Error(s+(m.s?"NaN":"-Infinity"));if(m.eq(a))return new v(0);if(null==t?(l=!1,f=x):f=t,m.eq(10))return null==t&&(l=!0),k(v,f);if(f+=10,v.precision=f,r=(n=y(g)).charAt(0),!(15e14>Math.abs(i=w(m))))return d=k(v,f+2,x).times(i+""),m=E(new v(r+"."+n.slice(1)),f-10).plus(d),v.precision=x,null==t?(l=!0,C(m,x)):m;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=y((m=m.times(e)).d)).charAt(0),h++;for(i=w(m),r>1?(m=new v("0."+n),i++):m=new v(r+"."+n.slice(1)),u=c=m=b(m.minus(a),m.plus(a),f),p=C(m.times(m),f),o=3;;){if(c=C(c.times(p),f),y((d=u.plus(b(c,new v(o),f))).d).slice(0,f)===y(u.d).slice(0,f))return u=u.times(2),0!==i&&(u=u.plus(k(v,f+2,x).times(i+""))),u=b(u,new v(h),f),v.precision=x,null==t?(l=!0,C(u,x)):u;u=d,o+=2}}function O(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(o=t.length;48===t.charCodeAt(o-1);)--o;if(t=t.slice(r,o)){if(o-=r,n=n-r-1,e.e=d(n/7),e.d=[],r=(n+1)%7,n<0&&(r+=7),r<o){for(r&&e.d.push(+t.slice(0,r)),o-=7;r<o;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=o;for(;r--;)t+="0";if(e.d.push(+t),l&&(e.e>h||e.e<-h))throw Error(u+n)}else e.s=0,e.e=0,e.d=[0];return e}function C(e,t,n){var r,o,a,i,s,c,p,m,g=e.d;for(i=1,a=g[0];a>=10;a/=10)i++;if((r=t-i)<0)r+=7,o=t,p=g[m=0];else{if((m=Math.ceil((r+1)/7))>=(a=g.length))return e;for(i=1,p=a=g[m];a>=10;a/=10)i++;r%=7,o=r-7+i}if(void 0!==n&&(s=p/(a=f(10,i-o-1))%10|0,c=t<0||void 0!==g[m+1]||p%a,c=n<4?(s||c)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||c||6==n&&(r>0?o>0?p/f(10,i-o):0:g[m-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return c?(a=w(e),g.length=1,t=t-a-1,g[0]=f(10,(7-t%7)%7),e.e=d(-t/7)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(0==r?(g.length=m,a=1,m--):(g.length=m+1,a=f(10,7-r),g[m]=o>0?(p/f(10,i-o)%f(10,o)|0)*a:0),c)for(;;){if(0==m){1e7==(g[0]+=a)&&(g[0]=1,++e.e);break}if(g[m]+=a,1e7!=g[m])break;g[m--]=0,a=1}for(r=g.length;0===g[--r];)g.pop();if(l&&(e.e>h||e.e<-h))throw Error(u+w(e));return e}function j(e,t){var n,r,o,a,i,s,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),l?C(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),i=u-r){for((d=i<0)?(n=c,i=-i,s=f.length):(n=f,r=u,s=c.length),i>(o=Math.max(Math.ceil(h/7),s)+2)&&(i=o,n.length=1),n.reverse(),o=i;o--;)n.push(0);n.reverse()}else{for((d=(o=c.length)<(s=f.length))&&(s=o),o=0;o<s;o++)if(c[o]!=f[o]){d=c[o]<f[o];break}i=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),s=c.length,o=f.length-s;o>0;--o)c[s++]=0;for(o=f.length;o>i;){if(c[--o]<f[o]){for(a=o;a&&0===c[--a];)c[a]=1e7-1;--c[a],c[o]+=1e7}c[o]-=f[o]}for(;0===c[--s];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(t.d=c,t.e=r,l?C(t,h):t):new p(0)}function _(e,t,n){var r,o=w(e),a=y(e.d),i=a.length;return t?(n&&(r=n-i)>0?a=a.charAt(0)+"."+a.slice(1)+S(r):i>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(o<0?"e":"e+")+o):o<0?(a="0."+S(-o-1)+a,n&&(r=n-i)>0&&(a+=S(r))):o>=i?(a+=S(o+1-i),n&&(r=n-o-1)>0&&(a=a+"."+S(r))):((r=o+1)<i&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-i)>0&&(o+1===i&&(a+="."),a+=S(r))),e.s<0?"-"+a:a}function P(e,t){if(e.length>t)return e.length=t,!0}function N(e){if(!e||"object"!=typeof e)throw Error(s+"Object expected");var t,n,r,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<o.length;t+=3)if(void 0!==(r=e[n=o[t]])){if(d(r)===r&&r>=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(c+n+": "+r)}if(void 0!==(r=e[n="LN10"])){if(r==Math.LN10)this[n]=new this(r);else throw Error(c+n+": "+r)}return this}(i=function e(t){var n,r,o;function a(e){if(!(this instanceof a))return new a(e);if(this.constructor=a,e instanceof a){this.s=e.s,this.e=e.e,this.d=(e=e.d)?e.slice():e;return}if("number"==typeof e){if(0*e!=0)throw Error(c+e);if(e>0)this.s=1;else if(e<0)e=-e,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(e===~~e&&e<1e7){this.e=0,this.d=[e];return}return O(this,e.toString())}if("string"!=typeof e)throw Error(c+e);if(45===e.charCodeAt(0)?(e=e.slice(1),this.s=-1):this.s=1,p.test(e))O(this,e);else throw Error(c+e)}if(a.prototype=m,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=e,a.config=a.set=N,void 0===t&&(t={}),t)for(n=0,o=["precision","rounding","toExpNeg","toExpPos","LN10"];n<o.length;)t.hasOwnProperty(r=o[n++])||(t[r]=this[r]);return a.config(t),a}(i)).default=i.Decimal=i,a=new i(1),void 0!==(r=(function(){return i}).call(t,n,t,e))&&(e.exports=r)}(0)},84617:function(e,t,n){"use strict";var r=n(9973);t.__esModule=!0,t.default=function(e,t){e.classList?e.classList.add(t):(0,o.default)(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))};var o=r(n(98598));e.exports=t.default},98598:function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")},e.exports=t.default},67973:function(e){"use strict";function t(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}e.exports=function(e,n){e.classList?e.classList.remove(n):"string"==typeof e.className?e.className=t(e.className,n):e.setAttribute("class",t(e.className&&e.className.baseVal||"",n))}},77625:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,i){if("function"!=typeof r)throw TypeError("The listener must be a function");var l=new o(r,a||e,i),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],l]:e._events[s].push(l):(e._events[s]=l,e._eventsCount++),e}function i(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),l.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},l.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,a=r.length,i=Array(a);o<a;o++)i[o]=r[o].fn;return i},l.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},l.prototype.emit=function(e,t,r,o,a,i){var l=n?n+e:e;if(!this._events[l])return!1;var s,c,u=this._events[l],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,a),!0;case 6:return u.fn.call(u.context,t,r,o,a,i),!0}for(c=1,s=Array(d-1);c<d;c++)s[c-1]=arguments[c];u.fn.apply(u.context,s)}else{var f,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,o);break;default:if(!s)for(f=1,s=Array(d-1);f<d;f++)s[f-1]=arguments[f];u[c].fn.apply(u[c].context,s)}}return!0},l.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},l.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},l.prototype.removeListener=function(e,t,r,o){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return i(this,a),this;var l=this._events[a];if(l.fn)l.fn!==t||o&&!l.once||r&&l.context!==r||i(this,a);else{for(var s=0,c=[],u=l.length;s<u;s++)(l[s].fn!==t||o&&!l[s].once||r&&l[s].context!==r)&&c.push(l[s]);c.length?this._events[a]=1===c.length?c[0]:c:i(this,a)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l},6500:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},i=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!a)return!1;for(r in e);return void 0===r||t.call(e,r)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(t=arguments[f],null!=t)for(n in t)r=s(d,n),d!==(o=s(t,n))&&(h&&o&&(i(o)||(c=a(o)))?(c?(c=!1,u=r&&a(r)?r:[]):u=r&&i(r)?r:{},l(d,{name:n,newValue:e(h,u,o)})):void 0!==o&&l(d,{name:n,newValue:o}));return d}},80662:function(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g;function c(e){return e?e.replace(s,""):""}e.exports=function(e,s){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];s=s||{};var u=1,d=1;function f(e){var t=e.match(n);t&&(u+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(r),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=s.source}h.prototype.content=e;var m=[];function g(t){var n=Error(s.source+":"+u+":"+d+": "+t);if(n.reason=t,n.filename=s.source,n.line=u,n.column=d,n.source=e,s.silent)m.push(n);else throw n}function v(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function y(e){var t;for(e=e||[];t=b();)!1!==t&&e.push(t);return e}function b(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return d+=2,f(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}return v(r),function(){var e,n=[];for(y(n);e=function(){var e=p(),n=v(o);if(n){if(b(),!v(a))return g("property missing ':'");var r=v(i),s=e({type:"declaration",property:c(n[0].replace(t,"")),value:r?c(r[0].replace(t,"")):""});return v(l),s}}();)!1!==e&&(n.push(e),y(n));return n}()}},94975:function(e,t,n){var r=n(39866)(n(74288),"DataView");e.exports=r},9855:function(e,t,n){var r=n(43596),o=n(35907),a=n(35355),i=n(39870),l=n(73372);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},99078:function(e,t,n){var r=n(62285),o=n(28706),a=n(63717),i=n(78410),l=n(13368);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},88675:function(e,t,n){var r=n(39866)(n(74288),"Map");e.exports=r},76219:function(e,t,n){var r=n(38764),o=n(78615),a=n(83391),i=n(53483),l=n(74724);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=l,e.exports=s},69308:function(e,t,n){var r=n(39866)(n(74288),"Promise");e.exports=r},41497:function(e,t,n){var r=n(39866)(n(74288),"Set");e.exports=r},11549:function(e,t,n){var r=n(76219),o=n(54351),a=n(16096);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},85885:function(e,t,n){var r=n(99078),o=n(84092),a=n(31663),i=n(69135),l=n(39552),s=n(63960);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=a,c.prototype.get=i,c.prototype.has=l,c.prototype.set=s,e.exports=c},23910:function(e,t,n){var r=n(74288).Symbol;e.exports=r},80098:function(e,t,n){var r=n(74288).Uint8Array;e.exports=r},10880:function(e,t,n){var r=n(39866)(n(74288),"WeakMap");e.exports=r},60493:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},78897:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}},42774:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},26685:function(e,t,n){var r=n(47909);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},56883:function(e){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},28579:function(e,t,n){var r=n(89772),o=n(56569),a=n(25614),i=n(98051),l=n(84257),s=n(9792),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),u=!n&&o(e),d=!n&&!u&&i(e),f=!n&&!u&&!d&&s(e),p=n||u||d||f,h=p?r(e.length,String):[],m=h.length;for(var g in e)(t||c.call(e,g))&&!(p&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||l(g,m)))&&h.push(g);return h}},73819:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},73817:function(e){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},25253:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},53417:function(e){e.exports=function(e){return e.split("")}},24457:function(e,t,n){var r=n(37560);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},83023:function(e,t,n){var r=n(4521);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},67676:function(e,t,n){var r=n(98060),o=n(97930)(r);e.exports=o},28935:function(e,t,n){var r=n(67676);e.exports=function(e,t){var n=!0;return r(e,function(e,r,o){return n=!!t(e,r,o)}),n}},67646:function(e,t,n){var r=n(78371);e.exports=function(e,t,n){for(var o=-1,a=e.length;++o<a;){var i=e[o],l=t(i);if(null!=l&&(void 0===s?l==l&&!r(l):n(l,s)))var s=l,c=i}return c}},8235:function(e){e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return -1}},72569:function(e,t,n){var r=n(73817),o=n(37134);e.exports=function e(t,n,a,i,l){var s=-1,c=t.length;for(a||(a=o),l||(l=[]);++s<c;){var u=t[s];n>0&&a(u)?n>1?e(u,n-1,a,i,l):r(l,u):i||(l[l.length]=u)}return l}},63321:function(e,t,n){var r=n(33023)();e.exports=r},98060:function(e,t,n){var r=n(63321),o=n(43228);e.exports=function(e,t){return e&&r(e,t,o)}},92167:function(e,t,n){var r=n(67906),o=n(70235);e.exports=function(e,t){t=r(t,e);for(var n=0,a=t.length;null!=e&&n<a;)e=e[o(t[n++])];return n&&n==a?e:void 0}},36452:function(e,t,n){var r=n(73817),o=n(25614);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},54506:function(e,t,n){var r=n(23910),o=n(4479),a=n(80910),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},58905:function(e){e.exports=function(e,t){return e>t}},93012:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},47909:function(e,t,n){var r=n(8235),o=n(31953),a=n(35281);e.exports=function(e,t,n){return t==t?a(e,t,n):r(e,o,n)}},90370:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},56318:function(e,t,n){var r=n(6791),o=n(10303);e.exports=function e(t,n,a,i,l){return t===n||(null!=t&&null!=n&&(o(t)||o(n))?r(t,n,a,i,e,l):t!=t&&n!=n)}},6791:function(e,t,n){var r=n(85885),o=n(97638),a=n(88030),i=n(64974),l=n(81690),s=n(25614),c=n(98051),u=n(9792),d="[object Arguments]",f="[object Array]",p="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,m,g,v){var y=s(e),b=s(t),x=y?f:l(e),w=b?f:l(t);x=x==d?p:x,w=w==d?p:w;var k=x==p,S=w==p,E=x==w;if(E&&c(e)){if(!c(t))return!1;y=!0,k=!1}if(E&&!k)return v||(v=new r),y||u(e)?o(e,t,n,m,g,v):a(e,t,x,n,m,g,v);if(!(1&n)){var O=k&&h.call(e,"__wrapped__"),C=S&&h.call(t,"__wrapped__");if(O||C){var j=O?e.value():e,_=C?t.value():t;return v||(v=new r),g(j,_,n,m,v)}}return!!E&&(v||(v=new r),i(e,t,n,m,g,v))}},62538:function(e,t,n){var r=n(85885),o=n(56318);e.exports=function(e,t,n,a){var i=n.length,l=i,s=!a;if(null==e)return!l;for(e=Object(e);i--;){var c=n[i];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<l;){var u=(c=n[i])[0],d=e[u],f=c[1];if(s&&c[2]){if(void 0===d&&!(u in e))return!1}else{var p=new r;if(a)var h=a(d,f,u,e,t,p);if(!(void 0===h?o(f,d,3,a,p):h))return!1}}return!0}},31953:function(e){e.exports=function(e){return e!=e}},57595:function(e,t,n){var r=n(86757),o=n(79551),a=n(28302),i=n(1292),l=/^\[object .+?Constructor\]$/,s=Object.prototype,c=Function.prototype.toString,u=s.hasOwnProperty,d=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?d:l).test(i(e))}},59332:function(e,t,n){var r=n(54506),o=n(13973),a=n(10303),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},88157:function(e,t,n){var r=n(25569),o=n(51501),a=n(79586),i=n(25614),l=n(22350);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):l(e)}},4578:function(e,t,n){var r=n(35365),o=n(77184),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},20121:function(e){e.exports=function(e,t){return e<t}},24240:function(e,t,n){var r=n(67676),o=n(5629);e.exports=function(e,t){var n=-1,a=o(e)?Array(e.length):[];return r(e,function(e,r,o){a[++n]=t(e,r,o)}),a}},25569:function(e,t,n){var r=n(62538),o=n(58424),a=n(47073);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},51501:function(e,t,n){var r=n(56318),o=n(13735),a=n(17764),i=n(67352),l=n(45669),s=n(47073),c=n(70235);e.exports=function(e,t){return i(e)&&l(t)?s(c(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},84046:function(e,t,n){var r=n(73819),o=n(92167),a=n(88157),i=n(24240),l=n(89200),s=n(23305),c=n(80701),u=n(79586),d=n(25614);e.exports=function(e,t,n){t=t.length?r(t,function(e){return d(e)?function(t){return o(t,1===e.length?e[0]:e)}:e}):[u];var f=-1;return t=r(t,s(a)),l(i(e,function(e,n,o){return{criteria:r(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,n)})}},18155:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},73584:function(e,t,n){var r=n(92167);e.exports=function(e){return function(t){return r(t,e)}}},19608:function(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,o,a){for(var i=-1,l=n(t((r-e)/(o||1)),0),s=Array(l);l--;)s[a?l:++i]=e,e+=o;return s}},44843:function(e,t,n){var r=n(79586),o=n(49478),a=n(98796);e.exports=function(e,t){return a(o(e,t,r),e+"")}},9810:function(e,t,n){var r=n(92353),o=n(4521),a=n(79586),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;e.exports=i},99558:function(e){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+t];return a}},12327:function(e,t,n){var r=n(67676);e.exports=function(e,t){var n;return r(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}},89200:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},89772:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},65020:function(e,t,n){var r=n(23910),o=n(73819),a=n(25614),i=n(78371),l=1/0,s=r?r.prototype:void 0,c=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-l?"-0":n}},41087:function(e,t,n){var r=n(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},23305:function(e){e.exports=function(e){return function(t){return e(t)}}},13826:function(e,t,n){var r=n(11549),o=n(26685),a=n(56883),i=n(65734),l=n(57600),s=n(27794);e.exports=function(e,t,n){var c=-1,u=o,d=e.length,f=!0,p=[],h=p;if(n)f=!1,u=a;else if(d>=200){var m=t?null:l(e);if(m)return s(m);f=!1,u=i,h=new r}else h=t?[]:p;e:for(;++c<d;){var g=e[c],v=t?t(g):g;if(g=n||0!==g?g:0,f&&v==v){for(var y=h.length;y--;)if(h[y]===v)continue e;t&&h.push(v),p.push(g)}else u(h,v,n)||(h!==p&&h.push(v),p.push(g))}return p}},65734:function(e){e.exports=function(e,t){return e.has(t)}},67906:function(e,t,n){var r=n(25614),o=n(67352),a=n(39365),i=n(3641);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},91684:function(e,t,n){var r=n(99558);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},1536:function(e,t,n){var r=n(78371);e.exports=function(e,t){if(e!==t){var n=void 0!==e,o=null===e,a=e==e,i=r(e),l=void 0!==t,s=null===t,c=t==t,u=r(t);if(!s&&!u&&!i&&e>t||i&&l&&c&&!s&&!u||o&&l&&c||!n&&c||!a)return 1;if(!o&&!i&&!u&&e<t||u&&n&&a&&!o&&!i||s&&n&&a||!l&&a||!c)return -1}return 0}},80701:function(e,t,n){var r=n(1536);e.exports=function(e,t,n){for(var o=-1,a=e.criteria,i=t.criteria,l=a.length,s=n.length;++o<l;){var c=r(a[o],i[o]);if(c){if(o>=s)return c;return c*("desc"==n[o]?-1:1)}}return e.index-t.index}},92077:function(e,t,n){var r=n(74288)["__core-js_shared__"];e.exports=r},97930:function(e,t,n){var r=n(5629);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,l=Object(n);(t?i--:++i<a)&&!1!==o(l[i],i,l););return n}}},33023:function(e){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),l=i.length;l--;){var s=i[e?l:++o];if(!1===n(a[s],s,a))break}return t}}},80675:function(e,t,n){var r=n(91684),o=n(14503),a=n(88551),i=n(3641);e.exports=function(e){return function(t){var n=o(t=i(t))?a(t):void 0,l=n?n[0]:t.charAt(0),s=n?r(n,1).join(""):t.slice(1);return l[e]()+s}}},82602:function(e,t,n){var r=n(88157),o=n(5629),a=n(43228);e.exports=function(e){return function(t,n,i){var l=Object(t);if(!o(t)){var s=r(n,3);t=a(t),n=function(e){return s(l[e],e,l)}}var c=e(t,n,i);return c>-1?l[s?t[c]:c]:void 0}}},35464:function(e,t,n){var r=n(19608),o=n(49639),a=n(175);e.exports=function(e){return function(t,n,i){return i&&"number"!=typeof i&&o(t,n,i)&&(n=i=void 0),t=a(t),void 0===n?(n=t,t=0):n=a(n),i=void 0===i?t<n?1:-1:a(i),r(t,n,i,e)}}},57600:function(e,t,n){var r=n(41497),o=n(93810),a=n(27794),i=r&&1/a(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=i},4521:function(e,t,n){var r=n(39866),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},97638:function(e,t,n){var r=n(11549),o=n(25253),a=n(65734);e.exports=function(e,t,n,i,l,s){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var h=-1,m=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++h<u;){var v=e[h],y=t[h];if(i)var b=c?i(y,v,h,t,e,s):i(v,y,h,e,t,s);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!o(t,function(e,t){if(!a(g,t)&&(v===e||l(v,e,n,i,s)))return g.push(t)})){m=!1;break}}else if(!(v===y||l(v,y,n,i,s))){m=!1;break}}return s.delete(e),s.delete(t),m}},88030:function(e,t,n){var r=n(23910),o=n(80098),a=n(37560),i=n(97638),l=n(22523),s=n(27794),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new o(e),new o(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=l;case"[object Set]":var h=1&r;if(p||(p=s),e.size!=t.size&&!h)break;var m=f.get(e);if(m)return m==t;r|=2,f.set(e,t);var g=i(p(e),p(t),r,c,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},64974:function(e,t,n){var r=n(28529),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,l){var s=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!s)return!1;for(var d=u;d--;){var f=c[d];if(!(s?f in t:o.call(t,f)))return!1}var p=l.get(e),h=l.get(t);if(p&&h)return p==t&&h==e;var m=!0;l.set(e,t),l.set(t,e);for(var g=s;++d<u;){var v=e[f=c[d]],y=t[f];if(a)var b=s?a(y,v,f,t,e,l):a(v,y,f,e,t,l);if(!(void 0===b?v===y||i(v,y,n,a,l):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(m=!1)}return l.delete(e),l.delete(t),m}},17071:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},28529:function(e,t,n){var r=n(36452),o=n(80466),a=n(43228);e.exports=function(e){return r(e,a,o)}},1507:function(e,t,n){var r=n(7545);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},58424:function(e,t,n){var r=n(45669),o=n(43228);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},39866:function(e,t,n){var r=n(57595),o=n(3138);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},62602:function(e,t,n){var r=n(45070)(Object.getPrototypeOf,Object);e.exports=r},4479:function(e,t,n){var r=n(23910),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,l=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[l]=n:delete e[l]),o}},80466:function(e,t,n){var r=n(42774),o=n(55716),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,l=i?function(e){return null==e?[]:r(i(e=Object(e)),function(t){return a.call(e,t)})}:o;e.exports=l},81690:function(e,t,n){var r=n(94975),o=n(88675),a=n(69308),i=n(41497),l=n(10880),s=n(54506),c=n(1292),u="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=c(r),g=c(o),v=c(a),y=c(i),b=c(l),x=s;(r&&x(new r(new ArrayBuffer(1)))!=h||o&&x(new o)!=u||a&&x(a.resolve())!=d||i&&x(new i)!=f||l&&x(new l)!=p)&&(x=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case m:return h;case g:return u;case v:return d;case y:return f;case b:return p}return t}),e.exports=x},3138:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},59592:function(e,t,n){var r=n(67906),o=n(56569),a=n(25614),i=n(84257),l=n(13973),s=n(70235);e.exports=function(e,t,n){t=r(t,e);for(var c=-1,u=t.length,d=!1;++c<u;){var f=s(t[c]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&l(u)&&i(f,u)&&(a(e)||o(e))}},14503:function(e){var t=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},43596:function(e,t,n){var r=n(20453);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},35907:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},35355:function(e,t,n){var r=n(20453),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},39870:function(e,t,n){var r=n(20453),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},73372:function(e,t,n){var r=n(20453);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},37134:function(e,t,n){var r=n(23910),o=n(56569),a=n(25614),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||o(e)||!!(i&&e&&e[i])}},84257:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},49639:function(e,t,n){var r=n(37560),o=n(5629),a=n(84257),i=n(28302);e.exports=function(e,t,n){if(!i(n))return!1;var l=typeof t;return("number"==l?!!(o(n)&&a(t,n.length)):"string"==l&&t in n)&&r(n[t],e)}},67352:function(e,t,n){var r=n(25614),o=n(78371),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||o(e))||i.test(e)||!a.test(e)||null!=t&&e in Object(t)}},7545:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},79551:function(e,t,n){var r,o=n(92077),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},35365:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},45669:function(e,t,n){var r=n(28302);e.exports=function(e){return e==e&&!r(e)}},62285:function(e){e.exports=function(){this.__data__=[],this.size=0}},28706:function(e,t,n){var r=n(24457),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},63717:function(e,t,n){var r=n(24457);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},78410:function(e,t,n){var r=n(24457);e.exports=function(e){return r(this.__data__,e)>-1}},13368:function(e,t,n){var r=n(24457);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},38764:function(e,t,n){var r=n(9855),o=n(99078),a=n(88675);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},78615:function(e,t,n){var r=n(1507);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},83391:function(e,t,n){var r=n(1507);e.exports=function(e){return r(this,e).get(e)}},53483:function(e,t,n){var r=n(1507);e.exports=function(e){return r(this,e).has(e)}},74724:function(e,t,n){var r=n(1507);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},22523:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},47073:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},23787:function(e,t,n){var r=n(50967);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},20453:function(e,t,n){var r=n(39866)(Object,"create");e.exports=r},77184:function(e,t,n){var r=n(45070)(Object.keys,Object);e.exports=r},39931:function(e,t,n){e=n.nmd(e);var r=n(17071),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,l=function(){try{var e=a&&a.require&&a.require("util").types;if(e)return e;return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},45070:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},49478:function(e,t,n){var r=n(60493),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var a=arguments,i=-1,l=o(a.length-t,0),s=Array(l);++i<l;)s[i]=a[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=a[i];return c[t]=n(s),r(e,this,c)}}},74288:function(e,t,n){var r=n(17071),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},54351:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},16096:function(e){e.exports=function(e){return this.__data__.has(e)}},27794:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},98796:function(e,t,n){var r=n(9810),o=n(31610)(r);e.exports=o},31610:function(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var o=t(),a=16-(o-r);if(r=o,a>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},84092:function(e,t,n){var r=n(99078);e.exports=function(){this.__data__=new r,this.size=0}},31663:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},69135:function(e){e.exports=function(e){return this.__data__.get(e)}},39552:function(e){e.exports=function(e){return this.__data__.has(e)}},63960:function(e,t,n){var r=n(99078),o=n(88675),a=n(76219);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},35281:function(e){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return -1}},88551:function(e,t,n){var r=n(53417),o=n(14503),a=n(26364);e.exports=function(e){return o(e)?a(e):r(e)}},39365:function(e,t,n){var r=n(23787),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)}),t});e.exports=i},70235:function(e,t,n){var r=n(78371),o=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}},1292:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5035:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},26364:function(e){var t="\ud800-\udfff",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\ud83c[\udffb-\udfff]",o="[^"+t+"]",a="(?:\ud83c[\udde6-\uddff]){2}",i="[\ud800-\udbff][\udc00-\udfff]",l="(?:"+n+"|"+r+")?",s="[\\ufe0e\\ufe0f]?",c="(?:\\u200d(?:"+[o,a,i].join("|")+")"+s+l+")*",u=RegExp(r+"(?="+r+")|(?:"+[o+n+"?",n,a,i,"["+t+"]"].join("|")+")"+(s+l+c),"g");e.exports=function(e){return e.match(u)||[]}},92353:function(e){e.exports=function(e){return function(){return e}}},7310:function(e,t,n){var r=n(28302),o=n(11121),a=n(6660),i=Math.max,l=Math.min;e.exports=function(e,t,n){var s,c,u,d,f,p,h=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=s,r=c;return s=c=void 0,h=t,d=e.apply(r,n)}function b(e){var n=e-p,r=e-h;return void 0===p||n>=t||n<0||g&&r>=u}function x(){var e,n,r,a=o();if(b(a))return w(a);f=setTimeout(x,(e=a-p,n=a-h,r=t-e,g?l(r,u-n):r))}function w(e){return(f=void 0,v&&s)?y(e):(s=c=void 0,d)}function k(){var e,n=o(),r=b(n);if(s=arguments,c=this,p=n,r){if(void 0===f)return h=e=p,f=setTimeout(x,t),m?y(e):d;if(g)return clearTimeout(f),f=setTimeout(x,t),y(p)}return void 0===f&&(f=setTimeout(x,t)),d}return t=a(t)||0,r(n)&&(m=!!n.leading,u=(g="maxWait"in n)?i(a(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),k.cancel=function(){void 0!==f&&clearTimeout(f),h=0,s=p=c=f=void 0},k.flush=function(){return void 0===f?d:w(o())},k}},37560:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},32242:function(e,t,n){var r=n(78897),o=n(28935),a=n(88157),i=n(25614),l=n(49639);e.exports=function(e,t,n){var s=i(e)?r:o;return n&&l(e,t,n)&&(t=void 0),s(e,a(t,3))}},84173:function(e,t,n){var r=n(82602)(n(12152));e.exports=r},12152:function(e,t,n){var r=n(8235),o=n(88157),a=n(85759),i=Math.max;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return -1;var s=null==n?0:a(n);return s<0&&(s=i(l+s,0)),r(e,o(t,3),s)}},11314:function(e,t,n){var r=n(72569),o=n(89238);e.exports=function(e,t){return r(o(e,t),1)}},13735:function(e,t,n){var r=n(92167);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},17764:function(e,t,n){var r=n(93012),o=n(59592);e.exports=function(e,t){return null!=e&&o(e,t,r)}},79586:function(e){e.exports=function(e){return e}},56569:function(e,t,n){var r=n(90370),o=n(10303),a=Object.prototype,i=a.hasOwnProperty,l=a.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!l.call(e,"callee")};e.exports=s},25614:function(e){var t=Array.isArray;e.exports=t},5629:function(e,t,n){var r=n(86757),o=n(13973);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},24342:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return!0===e||!1===e||o(e)&&"[object Boolean]"==r(e)}},98051:function(e,t,n){e=n.nmd(e);var r=n(74288),o=n(7406),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,l=i&&i.exports===a?r.Buffer:void 0,s=l?l.isBuffer:void 0;e.exports=s||o},21652:function(e,t,n){var r=n(56318);e.exports=function(e,t){return r(e,t)}},86757:function(e,t,n){var r=n(54506),o=n(28302);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},13973:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},82559:function(e,t,n){var r=n(22345);e.exports=function(e){return r(e)&&e!=+e}},77571:function(e){e.exports=function(e){return null==e}},22345:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"number"==typeof e||o(e)&&"[object Number]"==r(e)}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},90231:function(e,t,n){var r=n(54506),o=n(62602),a=n(10303),i=Object.prototype,l=Function.prototype.toString,s=i.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},42715:function(e,t,n){var r=n(54506),o=n(25614),a=n(10303);e.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&"[object String]"==r(e)}},78371:function(e,t,n){var r=n(54506),o=n(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},9792:function(e,t,n){var r=n(59332),o=n(23305),a=n(39931),i=a&&a.isTypedArray,l=i?o(i):r;e.exports=l},43228:function(e,t,n){var r=n(28579),o=n(4578),a=n(5629);e.exports=function(e){return a(e)?r(e):o(e)}},86185:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},89238:function(e,t,n){var r=n(73819),o=n(88157),a=n(24240),i=n(25614);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},41443:function(e,t,n){var r=n(83023),o=n(98060),a=n(88157);e.exports=function(e,t){var n={};return t=a(t,3),o(e,function(e,o,a){r(n,o,t(e,o,a))}),n}},95645:function(e,t,n){var r=n(67646),o=n(58905),a=n(79586);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},35802:function(e,t,n){var r=n(67646),o=n(58905),a=n(88157);e.exports=function(e,t){return e&&e.length?r(e,a(t,2),o):void 0}},50967:function(e,t,n){var r=n(76219);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},99008:function(e,t,n){var r=n(67646),o=n(20121),a=n(79586);e.exports=function(e){return e&&e.length?r(e,a,o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),a=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),a):void 0}},93810:function(e){e.exports=function(){}},11121:function(e,t,n){var r=n(74288);e.exports=function(){return r.Date.now()}},22350:function(e,t,n){var r=n(18155),o=n(73584),a=n(67352),i=n(70235);e.exports=function(e){return a(e)?r(i(e)):o(e)}},99676:function(e,t,n){var r=n(35464)();e.exports=r},33645:function(e,t,n){var r=n(25253),o=n(88157),a=n(12327),i=n(25614),l=n(49639);e.exports=function(e,t,n){var s=i(e)?r:a;return n&&l(e,t,n)&&(t=void 0),s(e,o(t,3))}},34935:function(e,t,n){var r=n(72569),o=n(84046),a=n(44843),i=n(49639),l=a(function(e,t){if(null==e)return[];var n=t.length;return n>1&&i(e,t[0],t[1])?t=[]:n>2&&i(t[0],t[1],t[2])&&(t=[t[0]]),o(e,r(t,1),[])});e.exports=l},55716:function(e){e.exports=function(){return[]}},7406:function(e){e.exports=function(){return!1}},37065:function(e,t,n){var r=n(7310),o=n(28302);e.exports=function(e,t,n){var a=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(n)&&(a="leading"in n?!!n.leading:a,i="trailing"in n?!!n.trailing:i),r(e,t,{leading:a,maxWait:t,trailing:i})}},175:function(e,t,n){var r=n(6660),o=1/0;e.exports=function(e){return e?(e=r(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},85759:function(e,t,n){var r=n(175);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},6660:function(e,t,n){var r=n(41087),o=n(28302),a=n(78371),i=0/0,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return i;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):l.test(e)?i:+e}},3641:function(e,t,n){var r=n(65020);e.exports=function(e){return null==e?"":r(e)}},47230:function(e,t,n){var r=n(88157),o=n(13826);e.exports=function(e,t){return e&&e.length?o(e,r(t,2)):[]}},75551:function(e,t,n){var r=n(80675)("toUpperCase");e.exports=r},30401:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},40875:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22135:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},64935:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},96362:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},87769:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},42208:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},29202:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},54001:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},21047:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},96137:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},80221:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},70525:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},76865:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},49663:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},95805:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},11239:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},96434:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,a=s(e),i=a[0],l=a[1],c=new o((i+l)*3/4-l),u=0,d=l>0?i-4:i;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,a=[],i=0,l=r-o;i<l;i+=16383)a.push(function(e,t,r){for(var o,a=[],i=t;i<r;i+=3)a.push(n[(o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]))>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}(e,i,i+16383>l?l:i+16383));return 1===o?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===o&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,l=a.length;i<l;++i)n[i]=a[i],r[a.charCodeAt(i)]=i;function s(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},72:function(e,t,n){"use strict";var r=n(675),o=n(783),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!l.isEncoding(t))throw TypeError("Unknown encoding: "+t);var n=0|p(e,t),r=i(n),o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(P(e,SharedArrayBuffer)||e&&P(e.buffer,SharedArrayBuffer)))return function(e,t,n){var r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),l.prototype),r}(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);var o=function(e){if(l.isBuffer(e)){var t,n=0|f(e.length),r=i(n);return 0===r.length||e.copy(r,0,0,n),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?i(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),i(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),n=i(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function f(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return O(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(o)return r?-1:O(e).length;t=(""+t).toLowerCase(),o=!0}}function h(e,t,n){var o,a,i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",a=t;a<n;++a)o+=N[e[a]];return o}(this,t,n);case"utf8":case"utf-8":return y(this,t,n);case"ascii":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}(this,t,n);case"base64":return o=t,a=n,0===o&&a===this.length?r.fromByteArray(this):r.fromByteArray(this.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),o="",a=0;a<r.length;a+=2)o+=String.fromCharCode(r[a]+256*r[a+1]);return o}(this,t,n);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,o){var a;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),(a=n=+n)!=a&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return -1;n=e.length-1}else if(n<0){if(!o)return -1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var a,i=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;i=2,l/=2,s/=2,n/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var u=-1;for(a=n;a<l;a++)if(c(e,a)===c(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===s)return u*i}else -1!==u&&(a-=a-u),u=-1}else for(n+s>l&&(n=l-s),a=n;a>=0;a--){for(var d=!0,f=0;f<s;f++)if(c(e,a+f)!==c(t,f)){d=!1;break}if(d)return a}return -1}function y(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var a,i,l,s,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:(192&(a=e[o+1]))==128&&(s=(31&c)<<6|63&a)>127&&(u=s);break;case 3:a=e[o+1],i=e[o+2],(192&a)==128&&(192&i)==128&&(s=(15&c)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:a=e[o+1],i=e[o+2],l=e[o+3],(192&a)==128&&(192&i)==128&&(192&l)==128&&(s=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&l)>65535&&s<1114112&&(u=s)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}function b(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function x(e,t,n,r,o,a){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function w(e,t,n,r,o,a){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function k(e,t,n,r,a){return t=+t,n>>>=0,a||w(e,t,n,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,n,r,23,4),n+4}function S(e,t,n,r,a){return t=+t,n>>>=0,a||w(e,t,n,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,n,r,52,8),n+8}t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=2147483647,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return s(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return(c(e),e<=0)?i(e):void 0!==t?"string"==typeof n?i(e).fill(t,n):i(e).fill(t):i(e)},l.allocUnsafe=function(e){return u(e)},l.allocUnsafeSlow=function(e){return u(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(P(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),P(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;var n,r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(P(a,Uint8Array)&&(a=l.from(a)),!l.isBuffer(a))throw TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?y(this,0,e):h.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,o){if(P(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var a=o-r,i=n-t,s=Math.min(a,i),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){a=c[d],i=u[d];break}return a<i?-1:i<a?1:0},l.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,a,i,l,s,c,u,d,f,p,h,m,g=this.length-t;if((void 0===n||n>g)&&(n=g),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var v=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var a=t.length;r>a/2&&(r=a/2);for(var i=0;i<r;++i){var l=parseInt(t.substr(2*i,2),16);if(l!=l)break;e[n+i]=l}return i}(this,e,t,n);case"utf8":case"utf-8":return s=t,c=n,_(O(e,this.length-s),this,s,c);case"ascii":return u=t,d=n,_(C(e),this,u,d);case"latin1":case"binary":return o=this,a=e,i=t,l=n,_(C(a),o,i,l);case"base64":return f=t,p=n,_(j(e),this,f,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h=t,m=n,_(function(e,t){for(var n,r,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o.push(n%256),o.push(r);return o}(e,this.length-h),this,h,m);default:if(v)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),v=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||b(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r},l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||b(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||b(e,t,this.length);for(var r=this[e],o=1,a=0;++a<t&&(o*=256);)r+=this[e+a]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||b(e,t,this.length);for(var r=t,o=1,a=this[e+--r];r>0&&(o*=256);)a+=this[e+--r]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var o=Math.pow(2,8*n)-1;x(this,e,t,n,o,0)}var a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){var o=Math.pow(2,8*n)-1;x(this,e,t,n,o,0)}var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);x(this,e,t,n,o-1,-o)}var a=0,i=1,l=0;for(this[t]=255&e;++a<n&&(i*=256);)e<0&&0===l&&0!==this[t+a-1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);x(this,e,t,n,o-1,-o)}var a=n-1,i=1,l=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=(e/i>>0)-l&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return S(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return S(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var a=o-1;a>=0;--a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return o},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var o,a=e.charCodeAt(0);("utf8"===r&&a<128||"latin1"===r)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var i=l.isBuffer(e)?e:l.from(e,r),s=i.length;if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=i[o%s]}return this};var E=/[^+/0-9A-Za-z-_]/g;function O(e,t){t=t||1/0;for(var n,r=e.length,o=null,a=[],i=0;i<r;++i){if((n=e.charCodeAt(i))>55295&&n<57344){if(!o){if(n>56319||i+1===r){(t-=3)>-1&&a.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return a}function C(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function j(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function _(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length)&&!(o>=e.length);++o)t[o+n]=e[o];return o}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var N=function(){for(var e="0123456789abcdef",t=Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)t[r+o]=e[n]+e[o];return t}()},783:function(e,t){t.read=function(e,t,n,r,o){var a,i,l=8*o-r-1,s=(1<<l)-1,c=s>>1,u=-7,d=n?o-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=l;u>0;a=256*a+e[t+d],d+=f,u-=8);for(i=a&(1<<-u)-1,a>>=-u,u+=r;u>0;i=256*i+e[t+d],d+=f,u-=8);if(0===a)a=1-c;else{if(a===s)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,r),a-=c}return(p?-1:1)*i*Math.pow(2,a-r)},t.write=function(e,t,n,r,o,a){var i,l,s,c=8*a-o-1,u=(1<<c)-1,d=u>>1,f=23===o?5960464477539062e-23:0,p=r?0:a-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(l=isNaN(t)?1:0,i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),i+d>=1?t+=f/s:t+=f*Math.pow(2,1-d),t*s>=2&&(i++,s/=2),i+d>=u?(l=0,i=u):i+d>=1?(l=(t*s-1)*Math.pow(2,o),i+=d):(l=t*Math.pow(2,d-1)*Math.pow(2,o),i=0));o>=8;e[n+p]=255&l,p+=h,l/=256,o-=8);for(i=i<<o|l,c+=o;c>0;e[n+p]=255&i,p+=h,i/=256,c-=8);e[n+p-h]|=128*m}}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}},i=!0;try{t[e](a,a.exports,r),i=!1}finally{i&&delete n[e]}return a.exports}r.ab="//";var o=r(72);e.exports=o}()},24601:function(){},15452:function(e,t){var n,r,o;r=[],void 0!==(o="function"==typeof(n=function e(){var t,n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{},r=!n.document&&!!n.postMessage,o=n.IS_PAPA_WORKER||!1,a={},i=0,l={};function s(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new p(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<r){let t=this._config.newline;t||(a=this._config.quoteChar||'"',t=this._handle.guessLineEndings(e,a)),e=[...e.split(t).slice(r)].join(t)}this.isFirstChunk&&w(this._config.beforeFirstChunk)&&void 0!==(a=this._config.beforeFirstChunk(e))&&(e=a),this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e,a=(this._partialLine="",this._handle.parse(r,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,this._finished||(this._partialLine=r.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),r=this._finished||this._config.preview&&this._rowCount>=this._config.preview,o)n.postMessage({results:a,workerId:l.WORKER_ID,finished:r});else if(w(this._config.chunk)&&!t){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!r||!w(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),r||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){w(this._config.error)?this._config.error(e):o&&this._config.error&&n.postMessage({workerId:l.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=l.RemoteChunkSize),s.call(this,e),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),r||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var e,n,o=this._config.downloadRequestHeaders;for(n in o)t.setRequestHeader(n,o[n])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}r&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function u(e){(e=e||{}).chunkSize||(e.chunkSize=l.LocalChunkSize),s.call(this,e);var t,n,r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,o=(this._config.chunkSize&&(o=Math.min(this._start+this._config.chunkSize,this._input.size),e=n.call(e,this._start,o)),t.readAsText(e,this._config.encoding));r||this._chunkLoaded({target:{result:o}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function d(e){var t;s.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,n;if(!this._finished)return t=(e=this._config.chunkSize)?(n=t.substring(0,e),t.substring(e)):(n=t,""),this._finished=!t,this.parseChunk(n)}}function f(e){s.call(this,e=e||{});var t=[],n=!0,r=!1;this.pause=function(){s.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){s.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=x(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=x(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=x(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=x(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function p(e){var t,n,r,o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,s=this,c=0,u=0,d=!1,f=!1,p=[],g={data:[],errors:[],meta:{}};function v(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function y(){if(g&&r&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),r=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!v(e)})),x()){if(g){if(Array.isArray(g.data[0])){for(var t,n=0;x()&&n<g.data.length;n++)g.data[n].forEach(o);g.data.splice(0,1)}else g.data.forEach(o)}function o(t,n){w(e.transformHeader)&&(t=e.transformHeader(t,n)),p.push(t)}}function s(t,n){for(var r=e.header?{}:[],o=0;o<t.length;o++){let n,c;var l=o,s=t[o],s=(n=l=e.header?o>=p.length?"__parsed_extra":p[o]:l,c=s=e.transform?e.transform(s,l):s,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[n]&&(e.dynamicTyping[n]=e.dynamicTypingFunction(n)),!0===(e.dynamicTyping[n]||e.dynamicTyping))?"true"===c||"TRUE"===c||"false"!==c&&"FALSE"!==c&&((e=>{if(a.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(c)?parseFloat(c):i.test(c)?new Date(c):""===c?null:c):c);"__parsed_extra"===l?(r[l]=r[l]||[],r[l].push(s)):r[l]=s}return e.header&&(o>p.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+p.length+" fields but parsed "+o,u+n):o<p.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+p.length+" fields but parsed "+o,u+n)),r}g&&(e.header||e.dynamicTyping||e.transform)&&(t=1,!g.data.length||Array.isArray(g.data[0])?(g.data=g.data.map(s),t=g.data.length):g.data=s(g.data,0),e.header&&g.meta&&(g.meta.fields=p),u+=t)}function x(){return e.header&&0===p.length}function k(e,t,n,r){e={type:e,code:t,message:n},void 0!==r&&(e.row=r),g.errors.push(e)}w(e.step)&&(o=e.step,e.step=function(t){g=t,x()?y():(y(),0!==g.data.length&&(c+=t.data.length,e.preview&&c>e.preview?n.abort():(g.data=g.data[0],o(g,s))))}),this.parse=function(o,a,i){var s=e.quoteChar||'"',s=(e.newline||(e.newline=this.guessLineEndings(o,s)),r=!1,e.delimiter?w(e.delimiter)&&(e.delimiter=e.delimiter(o),g.meta.delimiter=e.delimiter):((s=((t,n,r,o,a)=>{var i,s,c,u;a=a||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var d=0;d<a.length;d++){for(var f,p=a[d],h=0,g=0,y=0,b=(c=void 0,new m({comments:o,delimiter:p,newline:n,preview:10}).parse(t)),x=0;x<b.data.length;x++)r&&v(b.data[x])?y++:(g+=f=b.data[x].length,void 0===c?c=f:0<f&&(h+=Math.abs(f-c),c=f));0<b.data.length&&(g/=b.data.length-y),(void 0===s||h<=s)&&(void 0===u||u<g)&&1.99<g&&(s=h,i=p,u=g)}return{successful:!!(e.delimiter=i),bestDelimiter:i}})(o,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=s.bestDelimiter:(r=!0,e.delimiter=l.DefaultDelimiter),g.meta.delimiter=e.delimiter),b(e));return e.preview&&e.header&&s.preview++,t=o,g=(n=new m(s)).parse(t,a,i),y(),d?{meta:{paused:!0}}:g||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,n.abort(),t=w(e.chunk)?"":t.substring(n.getCharIndex())},this.resume=function(){s.streamer._halted?(d=!1,s.streamer.parseChunk(t,!0)):setTimeout(s.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,n.abort(),g.meta.aborted=!0,w(e.complete)&&e.complete(g),t=""},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=RegExp(h(t)+"([^]*?)"+h(t),"gm"),n=(e=e.replace(t,"")).split("\r"),t=e.split("\n"),e=1<t.length&&t[0].length<n[0].length;if(1===n.length||e)return"\n";for(var r=0,o=0;o<n.length;o++)"\n"===n[o][0]&&r++;return r>=n.length/2?"\r\n":"\r"}}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,n=e.newline,r=e.comments,o=e.step,a=e.preview,i=e.fastMode,s=null,c=!1,u=null==e.quoteChar?'"':e.quoteChar,d=u;if(void 0!==e.escapeChar&&(d=e.escapeChar),("string"!=typeof t||-1<l.BAD_DELIMITERS.indexOf(t))&&(t=","),r===t)throw Error("Comment character same as delimiter");!0===r?r="#":("string"!=typeof r||-1<l.BAD_DELIMITERS.indexOf(r))&&(r=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var f=0,p=!1;this.parse=function(l,m,g){if("string"!=typeof l)throw Error("Input must be a string");var v=l.length,y=t.length,b=n.length,x=r.length,k=w(o),S=[],E=[],O=[],C=f=0;if(!l)return Z();if(i||!1!==i&&-1===l.indexOf(u)){for(var j=l.split(n),_=0;_<j.length;_++){if(O=j[_],f+=O.length,_!==j.length-1)f+=n.length;else if(g)break;if(!r||O.substring(0,x)!==r){if(k){if(S=[],I(O.split(t)),z(),p)return Z()}else I(O.split(t));if(a&&a<=_)return S=S.slice(0,a),Z(!0)}}return Z()}for(var P=l.indexOf(t,f),N=l.indexOf(n,f),T=RegExp(h(d)+h(u),"g"),A=l.indexOf(u,f);;)if(l[f]===u)for(A=f,f++;;){if(-1===(A=l.indexOf(u,A+1)))return g||E.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:S.length,index:f}),D();if(A===v-1)return D(l.substring(f,A).replace(T,u));if(u===d&&l[A+1]===d)A++;else if(u===d||0===A||l[A-1]!==d){-1!==P&&P<A+1&&(P=l.indexOf(t,A+1));var M=R(-1===(N=-1!==N&&N<A+1?l.indexOf(n,A+1):N)?P:Math.min(P,N));if(l.substr(A+1+M,y)===t){O.push(l.substring(f,A).replace(T,u)),l[f=A+1+M+y]!==u&&(A=l.indexOf(u,f)),P=l.indexOf(t,f),N=l.indexOf(n,f);break}if(M=R(N),l.substring(A+1+M,A+1+M+b)===n){if(O.push(l.substring(f,A).replace(T,u)),L(A+1+M+b),P=l.indexOf(t,f),A=l.indexOf(u,f),k&&(z(),p))return Z();if(a&&S.length>=a)return Z(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:S.length,index:f}),A++}}else if(r&&0===O.length&&l.substring(f,f+x)===r){if(-1===N)return Z();f=N+b,N=l.indexOf(n,f),P=l.indexOf(t,f)}else if(-1!==P&&(P<N||-1===N))O.push(l.substring(f,P)),f=P+y,P=l.indexOf(t,f);else{if(-1===N)break;if(O.push(l.substring(f,N)),L(N+b),k&&(z(),p))return Z();if(a&&S.length>=a)return Z(!0)}return D();function I(e){S.push(e),C=f}function R(e){return -1!==e&&(e=l.substring(A+1,e))&&""===e.trim()?e.length:0}function D(e){return g||(void 0===e&&(e=l.substring(f)),O.push(e),f=v,I(O),k&&z()),Z()}function L(e){f=e,I(O),O=[],N=l.indexOf(n,f)}function Z(r){if(e.header&&!m&&S.length&&!c){var o=S[0],a={},i=new Set(o);let t=!1;for(let n=0;n<o.length;n++){let r=o[n];if(a[r=w(e.transformHeader)?e.transformHeader(r,n):r]){let e,l=a[r];for(;e=r+"_"+l,l++,i.has(e););i.add(e),o[n]=e,a[r]++,t=!0,(s=null===s?{}:s)[e]=r}else a[r]=1,o[n]=r;i.add(r)}t&&console.warn("Duplicate headers found and renamed."),c=!0}return{data:S,errors:E,meta:{delimiter:t,linebreak:n,aborted:p,truncated:!!r,cursor:C+(m||0),renamedHeaders:s}}}function z(){o(Z()),S=[],E=[]}},this.abort=function(){p=!0},this.getCharIndex=function(){return f}}function g(e){var t=e.data,n=a[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var o={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(w(n.userStep)){for(var i=0;i<t.results.data.length&&(n.userStep({data:t.results.data[i],errors:t.results.errors,meta:t.results.meta},o),!r);i++);delete t.results}else w(n.userChunk)&&(n.userChunk(t.results,o,t.file),delete t.results)}t.finished&&!r&&v(t.workerId,t.results)}function v(e,t){var n=a[e];w(n.userComplete)&&n.userComplete(t),n.terminate(),delete a[e]}function y(){throw Error("Not implemented.")}function b(e){if("object"!=typeof e||null===e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=b(e[t]);return n}function x(e,t){return function(){e.apply(t,arguments)}}function w(e){return"function"==typeof e}return l.parse=function(t,r){var o,s,p,h=(r=r||{}).dynamicTyping||!1;if(w(h)&&(r.dynamicTypingFunction=h,h={}),r.dynamicTyping=h,r.transform=!!w(r.transform)&&r.transform,!r.worker||!l.WORKERS_SUPPORTED){let e;return h=null,l.NODE_STREAM_INPUT,"string"==typeof t?(t=65279!==(e=t).charCodeAt(0)?e:e.slice(1),h=new(r.download?c:d)(r)):!0===t.readable&&w(t.read)&&w(t.on)?h=new f(r):(n.File&&t instanceof File||t instanceof Object)&&(h=new u(r)),h.stream(t)}(h=!!l.WORKERS_SUPPORTED&&(s=n.URL||n.webkitURL||null,p=e.toString(),o=l.BLOB_URL||(l.BLOB_URL=s.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",p,")();"],{type:"text/javascript"}))),(o=new n.Worker(o)).onmessage=g,o.id=i++,a[o.id]=o)).userStep=r.step,h.userChunk=r.chunk,h.userComplete=r.complete,h.userError=r.error,r.step=w(r.step),r.chunk=w(r.chunk),r.complete=w(r.complete),r.error=w(r.error),delete r.worker,h.postMessage({input:t,config:r,workerId:h.id})},l.unparse=function(e,t){var n=!1,r=!0,o=",",a="\r\n",i='"',s=i+i,c=!1,u=null,d=!1,f=((()=>{if("object"==typeof t){if("string"!=typeof t.delimiter||l.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(o=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(c=t.skipEmptyLines),"string"==typeof t.newline&&(a=t.newline),"string"==typeof t.quoteChar&&(i=t.quoteChar),"boolean"==typeof t.header&&(r=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(s=t.escapeChar+i),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),RegExp(h(i),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,c);if("object"==typeof e[0])return p(u||Object.keys(e[0]),e,c)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),p(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function p(e,t,n){var i="",l=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),s=!Array.isArray(t[0]);if(l&&r){for(var c=0;c<e.length;c++)0<c&&(i+=o),i+=m(e[c],c);0<t.length&&(i+=a)}for(var u=0;u<t.length;u++){var d=(l?e:t[u]).length,f=!1,p=l?0===Object.keys(t[u]).length:0===t[u].length;if(n&&!l&&(f="greedy"===n?""===t[u].join("").trim():1===t[u].length&&0===t[u][0].length),"greedy"===n&&l){for(var h=[],g=0;g<d;g++){var v=s?e[g]:g;h.push(t[u][v])}f=""===h.join("").trim()}if(!f){for(var y=0;y<d;y++){0<y&&!p&&(i+=o);var b=l&&s?e[y]:y;i+=m(t[u][b],y)}u<t.length-1&&(!n||0<d&&!p)&&(i+=a)}}return i}function m(e,t){var r,a;return null==e?"":e.constructor===Date?JSON.stringify(e).slice(1,25):(a=!1,d&&"string"==typeof e&&d.test(e)&&(e="'"+e,a=!0),r=e.toString().replace(f,s),(a=a||!0===n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1})(r,l.BAD_DELIMITERS)||-1<r.indexOf(o)||" "===r.charAt(0)||" "===r.charAt(r.length-1))?i+r+i:r)}},l.RECORD_SEP="\x1e",l.UNIT_SEP="\x1f",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r","\n",'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!r&&!!n.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=m,l.ParserHandle=p,l.NetworkStreamer=c,l.FileStreamer=u,l.StringStreamer=d,l.ReadableStreamStreamer=f,n.jQuery&&((t=n.jQuery).fn.parse=function(e){var r=e.config||{},o=[];return this.each(function(e){if(!("INPUT"===t(this).prop("tagName").toUpperCase()&&"file"===t(this).attr("type").toLowerCase()&&n.FileReader)||!this.files||0===this.files.length)return!0;for(var a=0;a<this.files.length;a++)o.push({file:this.files[a],inputElem:this,instanceConfig:t.extend({},r)})}),a(),this;function a(){if(0===o.length)w(e.complete)&&e.complete();else{var n,r,a,s,c=o[0];if(w(e.before)){var u=e.before(c.file,c.inputElem);if("object"==typeof u){if("abort"===u.action)return n="AbortError",r=c.file,a=c.inputElem,s=u.reason,void(w(e.error)&&e.error({name:n},r,a,s));if("skip"===u.action)return void i();"object"==typeof u.config&&(c.instanceConfig=t.extend(c.instanceConfig,u.config))}else if("skip"===u)return void i()}var d=c.instanceConfig.complete;c.instanceConfig.complete=function(e){w(d)&&d(e,c.file,c.inputElem),i()},l.parse(c.file,c.instanceConfig)}}function i(){o.splice(0,1),a()}}),o&&(n.onmessage=function(e){e=e.data,void 0===l.WORKER_ID&&e&&(l.WORKER_ID=e.workerId),"string"==typeof e.input?n.postMessage({workerId:l.WORKER_ID,results:l.parse(e.input,e.config),finished:!0}):(n.File&&e.input instanceof File||e.input instanceof Object)&&(e=l.parse(e.input,e.config))&&n.postMessage({workerId:l.WORKER_ID,results:e,finished:!0})}),(c.prototype=Object.create(s.prototype)).constructor=c,(u.prototype=Object.create(s.prototype)).constructor=u,(d.prototype=Object.create(d.prototype)).constructor=d,(f.prototype=Object.create(s.prototype)).constructor=f,l})?n.apply(t,r):n)&&(e.exports=o)},48049:function(e,t,n){"use strict";var r=n(14397);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},40718:function(e,t,n){e.exports=n(48049)()},14397:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},96032:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(6989),o=n(31686),a=n(41154),i=n(2265),l=["show"];function s(e,t){return i.useMemo(function(){var n={};t&&(n.show="object"===(0,a.Z)(t)&&t.formatter?t.formatter:!!t);var i=n=(0,o.Z)((0,o.Z)({},n),e),s=i.show,c=(0,r.Z)(i,l);return(0,o.Z)((0,o.Z)({},c),{},{show:!!s,showFormatter:"function"==typeof s?s:void 0,strategy:c.strategy||function(e){return e.length}})},[e,t])}},2027:function(e,t,n){"use strict";n.d(t,{Q:function(){return d},Z:function(){return b}});var r=n(31686),o=n(1119),a=n(11993),i=n(41154),l=n(36760),s=n.n(l),c=n(2265),u=n(55041),d=function(e){var t=e.inputElement,n=e.children,l=e.prefixCls,d=e.prefix,f=e.suffix,p=e.addonBefore,h=e.addonAfter,m=e.className,g=e.style,v=e.disabled,y=e.readOnly,b=e.focused,x=e.triggerFocus,w=e.allowClear,k=e.value,S=e.handleReset,E=e.hidden,O=e.classes,C=e.classNames,j=e.dataAttrs,_=e.styles,P=e.components,N=null!=n?n:t,T=(null==P?void 0:P.affixWrapper)||"span",A=(null==P?void 0:P.groupWrapper)||"span",M=(null==P?void 0:P.wrapper)||"span",I=(null==P?void 0:P.groupAddon)||"span",R=(0,c.useRef)(null),D=(0,u.X3)(e),L=(0,c.cloneElement)(N,{value:k,className:s()(N.props.className,!D&&(null==C?void 0:C.variant))||null});if(D){var Z=null;if(w){var z,B,F,H,q=!v&&!y&&k,W="".concat(l,"-clear-icon"),U="object"===(0,i.Z)(w)&&null!=w&&w.clearIcon?w.clearIcon:"✖";Z=c.createElement("span",{onClick:S,onMouseDown:function(e){return e.preventDefault()},className:s()(W,(H={},(0,a.Z)(H,"".concat(W,"-hidden"),!q),(0,a.Z)(H,"".concat(W,"-has-suffix"),!!f),H)),role:"button",tabIndex:-1},U)}var K="".concat(l,"-affix-wrapper"),$=s()(K,(F={},(0,a.Z)(F,"".concat(l,"-disabled"),v),(0,a.Z)(F,"".concat(K,"-disabled"),v),(0,a.Z)(F,"".concat(K,"-focused"),b),(0,a.Z)(F,"".concat(K,"-readonly"),y),(0,a.Z)(F,"".concat(K,"-input-with-clear-btn"),f&&w&&k),F),null==O?void 0:O.affixWrapper,null==C?void 0:C.affixWrapper,null==C?void 0:C.variant),V=(f||w)&&c.createElement("span",{className:s()("".concat(l,"-suffix"),null==C?void 0:C.suffix),style:null==_?void 0:_.suffix},Z,f);L=c.createElement(T,(0,o.Z)({className:$,style:null==_?void 0:_.affixWrapper,onClick:function(e){var t;null!==(t=R.current)&&void 0!==t&&t.contains(e.target)&&(null==x||x())}},null==j?void 0:j.affixWrapper,{ref:R}),d&&c.createElement("span",{className:s()("".concat(l,"-prefix"),null==C?void 0:C.prefix),style:null==_?void 0:_.prefix},d),L,V)}if((0,u.He)(e)){var X="".concat(l,"-group"),G="".concat(X,"-addon"),Y="".concat(X,"-wrapper"),Q=s()("".concat(l,"-wrapper"),X,null==O?void 0:O.wrapper,null==C?void 0:C.wrapper),J=s()(Y,(0,a.Z)({},"".concat(Y,"-disabled"),v),null==O?void 0:O.group,null==C?void 0:C.groupWrapper);L=c.createElement(A,{className:J},c.createElement(M,{className:Q},p&&c.createElement(I,{className:G},p),L,h&&c.createElement(I,{className:G},h)))}return c.cloneElement(L,{className:s()(null===(z=L.props)||void 0===z?void 0:z.className,m)||null,style:(0,r.Z)((0,r.Z)({},null===(B=L.props)||void 0===B?void 0:B.style),g),hidden:E})},f=n(83145),p=n(26365),h=n(6989),m=n(50506),g=n(18694),v=n(96032),y=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],b=(0,c.forwardRef)(function(e,t){var n,i=e.autoComplete,l=e.onChange,b=e.onFocus,x=e.onBlur,w=e.onPressEnter,k=e.onKeyDown,S=e.prefixCls,E=void 0===S?"rc-input":S,O=e.disabled,C=e.htmlSize,j=e.className,_=e.maxLength,P=e.suffix,N=e.showCount,T=e.count,A=e.type,M=e.classes,I=e.classNames,R=e.styles,D=e.onCompositionStart,L=e.onCompositionEnd,Z=(0,h.Z)(e,y),z=(0,c.useState)(!1),B=(0,p.Z)(z,2),F=B[0],H=B[1],q=(0,c.useRef)(!1),W=(0,c.useRef)(null),U=function(e){W.current&&(0,u.nH)(W.current,e)},K=(0,m.Z)(e.defaultValue,{value:e.value}),$=(0,p.Z)(K,2),V=$[0],X=$[1],G=null==V?"":String(V),Y=(0,c.useState)(null),Q=(0,p.Z)(Y,2),J=Q[0],ee=Q[1],et=(0,v.Z)(T,N),en=et.max||_,er=et.strategy(G),eo=!!en&&er>en;(0,c.useImperativeHandle)(t,function(){return{focus:U,blur:function(){var e;null===(e=W.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=W.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=W.current)||void 0===e||e.select()},input:W.current}}),(0,c.useEffect)(function(){H(function(e){return(!e||!O)&&e})},[O]);var ea=function(e,t,n){var r,o,a=t;if(!q.current&&et.exceedFormatter&&et.max&&et.strategy(t)>et.max)a=et.exceedFormatter(t,{max:et.max}),t!==a&&ee([(null===(r=W.current)||void 0===r?void 0:r.selectionStart)||0,(null===(o=W.current)||void 0===o?void 0:o.selectionEnd)||0]);else if("compositionEnd"===n.source)return;X(a),W.current&&(0,u.rJ)(W.current,e,l,a)};(0,c.useEffect)(function(){if(J){var e;null===(e=W.current)||void 0===e||e.setSelectionRange.apply(e,(0,f.Z)(J))}},[J]);var ei=eo&&"".concat(E,"-out-of-range");return c.createElement(d,(0,o.Z)({},Z,{prefixCls:E,className:s()(j,ei),handleReset:function(e){X(""),U(),W.current&&(0,u.rJ)(W.current,e,l)},value:G,focused:F,triggerFocus:U,suffix:function(){var e=Number(en)>0;if(P||et.show){var t=et.showFormatter?et.showFormatter({value:G,count:er,maxLength:en}):"".concat(er).concat(e?" / ".concat(en):"");return c.createElement(c.Fragment,null,et.show&&c.createElement("span",{className:s()("".concat(E,"-show-count-suffix"),(0,a.Z)({},"".concat(E,"-show-count-has-suffix"),!!P),null==I?void 0:I.count),style:(0,r.Z)({},null==R?void 0:R.count)},t),P)}return null}(),disabled:O,classes:M,classNames:I,styles:R}),(n=(0,g.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames"]),c.createElement("input",(0,o.Z)({autoComplete:i},n,{onChange:function(e){ea(e,e.target.value,{source:"change"})},onFocus:function(e){H(!0),null==b||b(e)},onBlur:function(e){H(!1),null==x||x(e)},onKeyDown:function(e){w&&"Enter"===e.key&&w(e),null==k||k(e)},className:s()(E,(0,a.Z)({},"".concat(E,"-disabled"),O),null==I?void 0:I.input),style:null==R?void 0:R.input,ref:W,size:C,type:void 0===A?"text":A,onCompositionStart:function(e){q.current=!0,null==D||D(e)},onCompositionEnd:function(e){q.current=!1,ea(e,e.currentTarget.value,{source:"compositionEnd"}),null==L||L(e)}}))))})},55041:function(e,t,n){"use strict";function r(e){return!!(e.addonBefore||e.addonAfter)}function o(e){return!!(e.prefix||e.suffix||e.allowClear)}function a(e,t,n,r){if(n){var o=t;if("click"===t.type){var a=e.cloneNode(!0);o=Object.create(t,{target:{value:a},currentTarget:{value:a}}),a.value="",n(o);return}if("file"!==e.type&&void 0!==r){var i=e.cloneNode(!0);o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value=r,n(o);return}n(o)}}function i(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}n.d(t,{He:function(){return r},X3:function(){return o},nH:function(){return i},rJ:function(){return a}})},10281:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(94981),o=function(e){if((0,r.Z)()&&window.document.documentElement){var t=Array.isArray(e)?e:[e],n=window.document.documentElement;return t.some(function(e){return e in n.style})}return!1},a=function(e,t){if(!o(e))return!1;var n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function i(e,t){return Array.isArray(e)||void 0===t?o(e):a(e,t)}},6337:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=l(n(2265)),a=l(n(49211)),i=["text","onCopy","options","children"];function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(s,e);var t,n,l=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=f(s);return e=t?Reflect.construct(n,arguments,f(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return d(e)}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return p(d(e=l.call.apply(l,[this].concat(n))),"onClick",function(t){var n=e.props,r=n.text,i=n.onCopy,l=n.children,s=n.options,c=o.default.Children.only(l),u=(0,a.default)(r,s);i&&i(r,u),c&&c.props&&"function"==typeof c.props.onClick&&c.props.onClick(t)}),e}return n=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),r=o.default.Children.only(t);return o.default.cloneElement(r,c(c({},n),{},{onClick:this.onClick}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,n),Object.defineProperty(s,"prototype",{writable:!1}),s}(o.default.PureComponent);t.CopyToClipboard=h,p(h,"defaultProps",{onCopy:void 0,options:void 0})},29233:function(e,t,n){"use strict";var r=n(6337).CopyToClipboard;r.CopyToClipboard=r,e.exports=r},13126:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),m=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope"),t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isFragment=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case l:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case m:case h:case s:return e;default:return t}}case o:return t}}}(e)===a}},82558:function(e,t,n){"use strict";e.exports=n(13126)},52181:function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState((function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}).bind(this))}function a(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function i(e){var t=e.prototype;if(!t||!t.isReactComponent)throw Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,i=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?i="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(i="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==i||null!==l)throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+(e.displayName||e.name)+" uses "+("function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()")+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==i?"\n "+i:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks");if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=a;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:function(){return i}}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},59221:function(e,t,n){"use strict";n.d(t,{ZP:function(){return eB},bO:function(){return U}});var r=n(2265),o=n(40718),a=n.n(o),i=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty;function c(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function u(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);var o=r.cache,a=o.get(t),i=o.get(n);if(a&&i)return a===n&&i===t;o.set(t,n),o.set(n,t);var l=e(t,n,r);return o.delete(t),o.delete(n),l}}function d(e){return i(e).concat(l(e))}var f=Object.hasOwn||function(e,t){return s.call(e,t)};function p(e,t){return e||t?e===t:e===t||e!=e&&t!=t}var h="_owner",m=Object.getOwnPropertyDescriptor,g=Object.keys;function v(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function y(e,t){return p(e.getTime(),t.getTime())}function b(e,t,n){if(e.size!==t.size)return!1;for(var r,o,a={},i=e.entries(),l=0;(r=i.next())&&!r.done;){for(var s=t.entries(),c=!1,u=0;(o=s.next())&&!o.done;){var d=r.value,f=d[0],p=d[1],h=o.value,m=h[0],g=h[1];!c&&!a[u]&&(c=n.equals(f,m,l,u,e,t,n)&&n.equals(p,g,f,m,e,t,n))&&(a[u]=!0),u++}if(!c)return!1;l++}return!0}function x(e,t,n){var r,o=g(e),a=o.length;if(g(t).length!==a)return!1;for(;a-- >0;)if((r=o[a])===h&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!f(t,r)||!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function w(e,t,n){var r,o,a,i=d(e),l=i.length;if(d(t).length!==l)return!1;for(;l-- >0;)if((r=i[l])===h&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!f(t,r)||!n.equals(e[r],t[r],r,r,e,t,n)||(o=m(e,r),a=m(t,r),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function k(e,t){return p(e.valueOf(),t.valueOf())}function S(e,t){return e.source===t.source&&e.flags===t.flags}function E(e,t,n){if(e.size!==t.size)return!1;for(var r,o,a={},i=e.values();(r=i.next())&&!r.done;){for(var l=t.values(),s=!1,c=0;(o=l.next())&&!o.done;)!s&&!a[c]&&(s=n.equals(r.value,o.value,r.value,o.value,e,t,n))&&(a[c]=!0),c++;if(!s)return!1}return!0}function O(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var C=Array.isArray,j="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,_=Object.assign,P=Object.prototype.toString.call.bind(Object.prototype.toString),N=T();function T(e){void 0===e&&(e={});var t,n,r,o,a,i,l,s,d,f=e.circular,p=e.createInternalComparator,h=e.createState,m=e.strict,g=(n=(t=function(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,o={areArraysEqual:r?w:v,areDatesEqual:y,areMapsEqual:r?c(b,w):b,areObjectsEqual:r?w:x,arePrimitiveWrappersEqual:k,areRegExpsEqual:S,areSetsEqual:r?c(E,w):E,areTypedArraysEqual:r?w:O};if(n&&(o=_({},o,n(o))),t){var a=u(o.areArraysEqual),i=u(o.areMapsEqual),l=u(o.areObjectsEqual),s=u(o.areSetsEqual);o=_({},o,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:l,areSetsEqual:s})}return o}(e)).areArraysEqual,r=t.areDatesEqual,o=t.areMapsEqual,a=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,l=t.areRegExpsEqual,s=t.areSetsEqual,d=t.areTypedArraysEqual,function(e,t,c){if(e===t)return!0;if(null==e||null==t||"object"!=typeof e||"object"!=typeof t)return e!=e&&t!=t;var u=e.constructor;if(u!==t.constructor)return!1;if(u===Object)return a(e,t,c);if(C(e))return n(e,t,c);if(null!=j&&j(e))return d(e,t,c);if(u===Date)return r(e,t,c);if(u===RegExp)return l(e,t,c);if(u===Map)return o(e,t,c);if(u===Set)return s(e,t,c);var f=P(e);return"[object Date]"===f?r(e,t,c):"[object RegExp]"===f?l(e,t,c):"[object Map]"===f?o(e,t,c):"[object Set]"===f?s(e,t,c):"[object Object]"===f?"function"!=typeof e.then&&"function"!=typeof t.then&&a(e,t,c):"[object Arguments]"===f?a(e,t,c):("[object Boolean]"===f||"[object Number]"===f||"[object String]"===f)&&i(e,t,c)}),N=p?p(g):function(e,t,n,r,o,a,i){return g(e,t,i)};return function(e){var t=e.circular,n=e.comparator,r=e.createState,o=e.equals,a=e.strict;if(r)return function(e,i){var l=r(),s=l.cache;return n(e,i,{cache:void 0===s?t?new WeakMap:void 0:s,equals:o,meta:l.meta,strict:a})};if(t)return function(e,t){return n(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:a})};var i={cache:void 0,equals:o,meta:void 0,strict:a};return function(e,t){return n(e,t,i)}}({circular:void 0!==f&&f,comparator:g,createState:h,equals:N,strict:void 0!==m&&m})}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;requestAnimationFrame(function r(o){if(n<0&&(n=o),o-n>t)e(o),n=-1;else{var a;a=r,"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(a)}})}function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(e,t,n){var r;return(r=function(e,t){if("object"!==R(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==R(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===R(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}T({strict:!0}),T({circular:!0}),T({circular:!0,strict:!0}),T({createInternalComparator:function(){return p}}),T({strict:!0,createInternalComparator:function(){return p}}),T({circular:!0,createInternalComparator:function(){return p}}),T({circular:!0,createInternalComparator:function(){return p},strict:!0});var z=["Webkit","Moz","O","ms"],B=["-webkit-","-moz-","-o-","-ms-"],F=["transform","transformOrigin","transition"],H=function(e){return e},q=function(e,t){if(-1===F.indexOf(e))return Z({},e,Number.isNaN(t)?0:t);var n="transition"===e,r=e.replace(/(\w)/,function(e){return e.toUpperCase()}),o=t;return z.reduce(function(e,a,i){return n&&(o=t.replace(/(transform|transform-origin)/gim,"".concat(B[i],"$1"))),L(L({},e),{},Z({},a+r,o))},{})},W=function(e,t){return Object.keys(t).reduce(function(n,r){return L(L({},n),{},Z({},r,e(r,t[r])))},{})},U=function(e){return Object.keys(e).reduce(function(e,t){return L(L({},e),q(t,e[t]))},e)},K=function(e,t,n){return e.map(function(e){return"".concat(e.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())})," ").concat(t,"ms ").concat(n)}).join(",")},$=function(e,t,n,r,o,a,i,l){};function V(e,t){if(e){if("string"==typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var G=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},Y=function(e,t){return e.map(function(e,n){return e*Math.pow(t,n)}).reduce(function(e,t){return e+t})},Q=function(e,t){return function(n){return Y(G(e,t),n)}},J=function(){for(var e,t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=r[0],i=r[1],l=r[2],s=r[3];if(1===r.length)switch(r[0]){case"linear":a=0,i=0,l=1,s=1;break;case"ease":a=.25,i=.1,l=.25,s=1;break;case"ease-in":a=.42,i=0,l=1,s=1;break;case"ease-out":a=.42,i=0,l=.58,s=1;break;case"ease-in-out":a=0,i=0,l=.58,s=1;break;default:var c=r[0].split("(");if("cubic-bezier"===c[0]&&4===c[1].split(")")[0].split(",").length){var u,d=function(e){if(Array.isArray(e))return e}(u=c[1].split(")")[0].split(",").map(function(e){return parseFloat(e)}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),4!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(u,4)||V(u,4)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a=d[0],i=d[1],l=d[2],s=d[3]}else $(!1,"[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s",r)}$([a,l,i,s].every(function(e){return"number"==typeof e&&e>=0&&e<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",r);var f=Q(a,l),p=Q(i,s),h=(e=a,t=l,function(n){var r;return Y([].concat(function(e){if(Array.isArray(e))return X(e)}(r=G(e,t).map(function(e,t){return e*t}).slice(1))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||V(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),n)}),m=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var o,a=f(n)-t,i=h(n);if(1e-4>Math.abs(a-t)||i<1e-4)break;n=(o=n-a/i)>1?1:o<0?0:o}return p(n)};return m.isStepper=!1,m},ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,n=void 0===t?100:t,r=e.damping,o=void 0===r?8:r,a=e.dt,i=void 0===a?17:a,l=function(e,t,r){var a=r+(-(e-t)*n-r*o)*i/1e3,l=r*i/1e3+e;return 1e-4>Math.abs(l-t)&&1e-4>Math.abs(a)?[t,0]:[l,a]};return l.isStepper=!0,l.dt=i,l},et=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0];if("string"==typeof r)switch(r){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return J(r);case"spring":return ee();default:if("cubic-bezier"===r.split("(")[0])return J(r);$(!1,"[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s",t)}return"function"==typeof r?r:($(!1,"[configEasing]: first argument type should be function or string, instead received %s",t),null)};function en(e){return(en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function er(e){return function(e){if(Array.isArray(e))return es(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||el(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach(function(t){ei(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ei(e,t,n){var r;return(r=function(e,t){if("object"!==en(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==en(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===en(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function el(e,t){if(e){if("string"==typeof e)return es(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return es(e,t)}}function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ec=function(e,t,n){return e+(t-e)*n},eu=function(e){return e.from!==e.to},ed=function e(t,n,r){var o=W(function(e,n){if(eu(n)){var r,o=function(e){if(Array.isArray(e))return e}(r=t(n.from,n.to,n.velocity))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(r,2)||el(r,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o[1];return ea(ea({},n),{},{from:a,velocity:i})}return n},n);return r<1?W(function(e,t){return eu(t)?ea(ea({},t),{},{velocity:ec(t.velocity,o[e].velocity,r),from:ec(t.from,o[e].from,r)}):t},n):e(t,o,r-1)},ef=function(e,t,n,r,o){var a,i,l=[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})}),s=l.reduce(function(n,r){return ea(ea({},n),{},ei({},r,[e[r],t[r]]))},{}),c=l.reduce(function(n,r){return ea(ea({},n),{},ei({},r,{from:e[r],velocity:0,to:t[r]}))},{}),u=-1,d=function(){return null};return d=n.isStepper?function(r){a||(a=r);var i=(r-a)/n.dt;c=ed(n,c,i),o(ea(ea(ea({},e),t),W(function(e,t){return t.from},c))),a=r,Object.values(c).filter(eu).length&&(u=requestAnimationFrame(d))}:function(a){i||(i=a);var l=(a-i)/r,c=W(function(e,t){return ec.apply(void 0,er(t).concat([n(l)]))},s);if(o(ea(ea(ea({},e),t),c)),l<1)u=requestAnimationFrame(d);else{var f=W(function(e,t){return ec.apply(void 0,er(t).concat([n(1)]))},s);o(ea(ea(ea({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(u)}}};function ep(e){return(ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eh=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function em(e){return function(e){if(Array.isArray(e))return eg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return eg(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ev(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ey(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ev(Object(n),!0).forEach(function(t){eb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ev(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eb(e,t,n){return(t=ex(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ex(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ep(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ep(t)?t:String(t)}function ew(e,t){return(ew=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ek(e,t){if(t&&("object"===ep(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eS(e)}function eS(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eE(e){return(eE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var eO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ew(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eE(a);return e=t?Reflect.construct(n,arguments,eE(this).constructor):n.apply(this,arguments),ek(this,e)});function a(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a);var n,r=(n=o.call(this,e,t)).props,i=r.isActive,l=r.attributeName,s=r.from,c=r.to,u=r.steps,d=r.children,f=r.duration;if(n.handleStyleChange=n.handleStyleChange.bind(eS(n)),n.changeStyle=n.changeStyle.bind(eS(n)),!i||f<=0)return n.state={style:{}},"function"==typeof d&&(n.state={style:c}),ek(n);if(u&&u.length)n.state={style:u[0].style};else if(s){if("function"==typeof d)return n.state={style:s},ek(n);n.state={style:l?eb({},l,s):s}}else n.state={style:{}};return n}return n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,o=t.attributeName,a=t.shouldReAnimate,i=t.to,l=t.from,s=this.state.style;if(r){if(!n){var c={style:o?eb({},o,i):i};this.state&&s&&(o&&s[o]!==i||!o&&s!==i)&&this.setState(c);return}if(!N(e.to,i)||!e.canBegin||!e.isActive){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?l:e.to;if(this.state&&s){var f={style:o?eb({},o,d):d};(o&&[o]!==d||!o&&s!==d)&&this.setState(f)}this.runAnimation(ey(ey({},this.props),{},{from:d,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"runJSAnimation",value:function(e){var t=this,n=e.from,r=e.to,o=e.duration,a=e.easing,i=e.begin,l=e.onAnimationEnd,s=e.onAnimationStart,c=ef(n,r,et(a),o,this.changeStyle);this.manager.start([s,i,function(){t.stopJSAnimation=c()},o,l])}},{key:"runStepAnimation",value:function(e){var t=this,n=e.steps,r=e.begin,o=e.onAnimationStart,a=n[0],i=a.style,l=a.duration;return this.manager.start([o].concat(em(n.reduce(function(e,r,o){if(0===o)return e;var a=r.duration,i=r.easing,l=void 0===i?"ease":i,s=r.style,c=r.properties,u=r.onAnimationEnd,d=o>0?n[o-1]:r,f=c||Object.keys(s);if("function"==typeof l||"spring"===l)return[].concat(em(e),[t.runJSAnimation.bind(t,{from:d.style,to:s,duration:a,easing:l}),a]);var p=K(f,a,l),h=ey(ey(ey({},d.style),s),{},{transition:p});return[].concat(em(e),[h,a,u]).filter(H)},[i,Math.max(void 0===l?0:l,r)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){if(!this.manager){var t,n,r;this.manager=(t=function(){return null},n=!1,r=function e(r){if(!n){if(Array.isArray(r)){if(!r.length)return;var o=function(e){if(Array.isArray(e))return e}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return I(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,void 0)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=o[0],i=o.slice(1);if("number"==typeof a){A(e.bind(null,i),a);return}e(a),A(e.bind(null,i));return}"object"===M(r)&&t(r),"function"==typeof r&&r()}},{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}})}var o=e.begin,a=e.duration,i=e.attributeName,l=e.to,s=e.easing,c=e.onAnimationStart,u=e.onAnimationEnd,d=e.steps,f=e.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),"function"==typeof s||"function"==typeof f||"spring"===s){this.runJSAnimation(e);return}if(d.length>1){this.runStepAnimation(e);return}var h=i?eb({},i,l):l,m=K(Object.keys(h),a,s);p.start([c,o,ey(ey({},h),{},{transition:m}),a,u])}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration),o=(e.attributeName,e.easing,e.isActive),a=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eh)),i=r.Children.count(t),l=U(this.state.style);if("function"==typeof t)return t(l);if(!o||0===i||n<=0)return t;var s=function(e){var t=e.props,n=t.style,o=t.className;return(0,r.cloneElement)(e,ey(ey({},a),{},{style:ey(ey({},void 0===n?{}:n),l),className:o}))};return 1===i?s(r.Children.only(t)):r.createElement("div",null,r.Children.map(t,function(e){return s(e)}))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ex(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);eO.displayName="Animate",eO.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},eO.propTypes={from:a().oneOfType([a().object,a().string]),to:a().oneOfType([a().object,a().string]),attributeName:a().string,duration:a().number,begin:a().number,easing:a().oneOfType([a().string,a().func]),steps:a().arrayOf(a().shape({duration:a().number.isRequired,style:a().object.isRequired,easing:a().oneOfType([a().oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),a().func]),properties:a().arrayOf("string"),onAnimationEnd:a().func})),children:a().oneOfType([a().node,a().func]),isActive:a().bool,canBegin:a().bool,onAnimationEnd:a().func,shouldReAnimate:a().bool,onAnimationStart:a().func,onAnimationReStart:a().func};var eC=n(30719),ej=["children","appearOptions","enterOptions","leaveOptions"];function e_(e){return(e_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eP(){return(eP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eN(Object(n),!0).forEach(function(t){eR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eA(e,t){return(eA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eM(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eI(e){return(eI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eR(e,t,n){return(t=eD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eD(e){var t=function(e,t){if("object"!==e_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==e_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===e_(t)?t:String(t)}void 0===Number.isFinite&&(Number.isFinite=function(e){return"number"==typeof e&&isFinite(e)});var eL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.steps,n=e.duration;return t&&t.length?t.reduce(function(e,t){return e+(Number.isFinite(t.duration)&&t.duration>0?t.duration:0)},0):Number.isFinite(n)?n:0},eZ=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eA(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=eI(a);return e=t?Reflect.construct(n,arguments,eI(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===e_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return eM(e)}(this,e)});function a(){var e;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),eR(eM(e=o.call(this)),"handleEnter",function(t,n){var r=e.props,o=r.appearOptions,a=r.enterOptions;e.handleStyleActive(n?o:a)}),eR(eM(e),"handleExit",function(){var t=e.props.leaveOptions;e.handleStyleActive(t)}),e.state={isActive:!1},e}return n=[{key:"handleStyleActive",value:function(e){if(e){var t=e.onAnimationEnd?function(){e.onAnimationEnd()}:null;this.setState(eT(eT({},e),{},{onAnimationEnd:t,isActive:!0}))}}},{key:"parseTimeout",value:function(){var e=this.props,t=e.appearOptions,n=e.enterOptions,r=e.leaveOptions;return eL(t)+eL(n)+eL(r)}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,o=(t.appearOptions,t.enterOptions,t.leaveOptions,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,ej));return r.createElement(eC.Transition,eP({},o,{onEnter:this.handleEnter,onExit:this.handleExit,timeout:this.parseTimeout()}),function(){return r.createElement(eO,e.state,r.Children.only(n))})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eD(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.Component);function ez(e){var t=e.component,n=e.children,o=e.appear,a=e.enter,i=e.leave;return r.createElement(eC.TransitionGroup,{component:t},r.Children.map(n,function(e,t){return r.createElement(eZ,{appearOptions:o,enterOptions:a,leaveOptions:i,key:"child-".concat(t)},e)}))}eZ.propTypes={appearOptions:a().object,enterOptions:a().object,leaveOptions:a().object,children:a().element},ez.propTypes={appear:a().object,enter:a().object,leave:a().object,children:a().oneOfType([a().array,a().element]),component:a().any},ez.defaultProps={component:"span"};var eB=eO},94263:function(e,t){"use strict";t.Z={'code[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",maxHeight:"inherit",height:"inherit",padding:"0 1em",display:"block",overflow:"auto"},'pre[class*="language-"]':{color:"black",background:"none",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",position:"relative",margin:".5em 0",overflow:"visible",padding:"1px",backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em"},'pre[class*="language-"] > code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}},33664:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,function(e){if(!e||!e.__esModule){var t={};if(null!=e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}t.default=e}}(n(40718));var r=l(n(84617)),o=l(n(67973)),a=l(n(2265)),i=l(n(20536));function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n(32601);var c=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return(0,r.default)(e,t)})},u=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return(0,o.default)(e,t)})},d=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).onEnter=function(e,n){var r=t.getClassNames(n?"appear":"enter").className;t.removeClasses(e,"exit"),c(e,r),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.getClassNames(n?"appear":"enter").activeClassName;t.reflowAndAddClass(e,r),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.getClassNames("appear").doneClassName,o=t.getClassNames("enter").doneClassName;t.removeClasses(e,n?"appear":"enter"),c(e,n?r+" "+o:o),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.getClassNames("exit").className;t.removeClasses(e,"appear"),t.removeClasses(e,"enter"),c(e,n),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.getClassNames("exit").activeClassName;t.reflowAndAddClass(e,n),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.getClassNames("exit").doneClassName;t.removeClasses(e,"exit"),c(e,n),t.props.onExited&&t.props.onExited(e)},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,o=r?(r&&n?n+"-":"")+e:n[e],a=r?o+"-active":n[e+"Active"],i=r?o+"-done":n[e+"Done"];return{className:o,activeClassName:a,doneClassName:i}},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.removeClasses=function(e,t){var n=this.getClassNames(t),r=n.className,o=n.activeClassName,a=n.doneClassName;r&&u(e,r),o&&u(e,o),a&&u(e,a)},n.reflowAndAddClass=function(e,t){t&&(e&&e.scrollTop,c(e,t))},n.render=function(){var e=s({},this.props);return delete e.classNames,a.default.createElement(i.default,s({},e,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(a.default.Component);d.defaultProps={classNames:""},d.propTypes={},t.default=d,e.exports=t.default},31601:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,i(n(40718));var r=i(n(2265)),o=n(54887),a=i(n(38244));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){for(var t,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).handleEnter=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEnter",0,n)},t.handleEntering=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntering",0,n)},t.handleEntered=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onEntered",0,n)},t.handleExit=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExit",1,n)},t.handleExiting=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExiting",1,n)},t.handleExited=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.handleLifecycle("onExited",1,n)},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.handleLifecycle=function(e,t,n){var a,i=this.props.children,l=r.default.Children.toArray(i)[t];l.props[e]&&(a=l.props)[e].apply(a,n),this.props[e]&&this.props[e]((0,o.findDOMNode)(this))},n.render=function(){var e=this.props,t=e.children,n=e.in,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["children","in"]),i=r.default.Children.toArray(t),l=i[0],s=i[1];return delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,r.default.createElement(a.default,o,n?r.default.cloneElement(l,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):r.default.cloneElement(s,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},t}(r.default.Component);l.propTypes={},t.default=l,e.exports=t.default},20536:function(e,t,n){"use strict";t.__esModule=!0,t.default=t.EXITING=t.ENTERED=t.ENTERING=t.EXITED=t.UNMOUNTED=void 0;var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}}return t.default=e,t}(n(40718)),o=l(n(2265)),a=l(n(54887)),i=n(52181);function l(e){return e&&e.__esModule?e:{default:e}}n(32601);var s="unmounted";t.UNMOUNTED=s;var c="exited";t.EXITED=c;var u="entering";t.ENTERING=u;var d="entered";t.ENTERED=d;var f="exiting";t.EXITING=f;var p=function(e){function t(t,n){r=e.call(this,t,n)||this;var r,o,a=n.transitionGroup,i=a&&!a.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?i?(o=c,r.appearStatus=u):o=d:o=t.unmountOnExit||t.mountOnEnter?s:c,r.state={status:o},r.nextCallback=null,r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===s?{status:c}:null},n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==u&&n!==d&&(t=u):(n===u||n===d)&&(t=f)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t){this.cancelNextCallback();var n=a.default.findDOMNode(this);t===u?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===c&&this.setState({status:s})},n.performEnter=function(e,t){var n=this,r=this.props.enter,o=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,a=this.getTimeouts(),i=o?a.appear:a.enter;if(!t&&!r){this.safeSetState({status:d},function(){n.props.onEntered(e)});return}this.props.onEnter(e,o),this.safeSetState({status:u},function(){n.props.onEntering(e,o),n.onTransitionEnd(e,i,function(){n.safeSetState({status:d},function(){n.props.onEntered(e,o)})})})},n.performExit=function(e){var t=this,n=this.props.exit,r=this.getTimeouts();if(!n){this.safeSetState({status:c},function(){t.props.onExited(e)});return}this.props.onExit(e),this.safeSetState({status:f},function(){t.props.onExiting(e),t.onTransitionEnd(e,r.exit,function(){t.safeSetState({status:c},function(){t.props.onExited(e)})})})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t,n){this.setNextCallback(n);var r=null==t&&!this.props.addEndListener;if(!e||r){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)},n.render=function(){var e=this.state.status;if(e===s)return null;var t=this.props,n=t.children,r=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"==typeof n)return n(e,r);var a=o.default.Children.only(n);return o.default.cloneElement(a,r)},t}(o.default.Component);function h(){}p.contextTypes={transitionGroup:r.object},p.childContextTypes={transitionGroup:function(){}},p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},p.UNMOUNTED=0,p.EXITED=1,p.ENTERING=2,p.ENTERED=3,p.EXITING=4;var m=(0,i.polyfill)(p);t.default=m},38244:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=l(n(40718)),o=l(n(2265)),a=n(52181),i=n(28710);function l(e){return e&&e.__esModule?e:{default:e}}function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var u=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},d=function(e){function t(t,n){var r,o=(r=e.call(this,t,n)||this).handleExited.bind(c(c(r)));return r.state={handleExited:o,firstRender:!0},r}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n=t.prototype;return n.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},n.componentDidMount=function(){this.appeared=!0,this.mounted=!0},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?(0,i.getInitialChildMapping)(e,r):(0,i.getNextChildMapping)(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=(0,i.getChildMapping)(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=s({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(o[n]=e[n]);return o}(e,["component","childFactory"]),a=u(this.state.children).map(n);return(delete r.appear,delete r.enter,delete r.exit,null===t)?a:o.default.createElement(t,r,a)},t}(o.default.Component);d.childContextTypes={transitionGroup:r.default.object.isRequired},d.propTypes={},d.defaultProps={component:"div",childFactory:function(e){return e}};var f=(0,a.polyfill)(d);t.default=f,e.exports=t.default},30719:function(e,t,n){"use strict";var r=l(n(33664)),o=l(n(31601)),a=l(n(38244)),i=l(n(20536));function l(e){return e&&e.__esModule?e:{default:e}}e.exports={Transition:i.default,TransitionGroup:a.default,ReplaceTransition:o.default,CSSTransition:r.default}},28710:function(e,t,n){"use strict";t.__esModule=!0,t.getChildMapping=o,t.mergeChildMappings=a,t.getInitialChildMapping=function(e,t){return o(e.children,function(n){return(0,r.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:i(n,"appear",e),enter:i(n,"enter",e),exit:i(n,"exit",e)})})},t.getNextChildMapping=function(e,t,n){var l=o(e.children),s=a(t,l);return Object.keys(s).forEach(function(o){var a=s[o];if((0,r.isValidElement)(a)){var c=o in t,u=o in l,d=t[o],f=(0,r.isValidElement)(d)&&!d.props.in;u&&(!c||f)?s[o]=(0,r.cloneElement)(a,{onExited:n.bind(null,a),in:!0,exit:i(a,"exit",e),enter:i(a,"enter",e)}):u||!c||f?u&&c&&(0,r.isValidElement)(d)&&(s[o]=(0,r.cloneElement)(a,{onExited:n.bind(null,a),in:d.props.in,exit:i(a,"exit",e),enter:i(a,"enter",e)})):s[o]=(0,r.cloneElement)(a,{in:!1})}}),s};var r=n(2265);function o(e,t){var n=Object.create(null);return e&&r.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=t&&(0,r.isValidElement)(e)?t(e):e}),n}function a(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,o=Object.create(null),a=[];for(var i in e)i in t?a.length&&(o[i]=a,a=[]):a.push(i);var l={};for(var s in t){if(o[s])for(r=0;r<o[s].length;r++){var c=o[s][r];l[o[s][r]]=n(c)}l[s]=n(s)}for(r=0;r<a.length;r++)l[a[r]]=n(a[r]);return l}function i(e,t,n){return null!=n[t]?n[t]:e.props[t]}},32601:function(e,t,n){"use strict";var r;t.__esModule=!0,t.classNamesShape=t.timeoutsShape=void 0,(r=n(40718))&&r.__esModule,t.timeoutsShape=null,t.classNamesShape=null},31699:function(e,t,n){"use strict";n.d(t,{$:function(){return Z}});var r=n(2265),o=n(87602),a=n(59221),i=n(21652),l=n.n(i),s=n(77571),c=n.n(s),u=n(9841),d=n(13137),f=n(20407),p=n(58772),h=n(16630),m=n(82944),g=n(34067),v=n(85355),y=n(41637),b=n(11638);function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var w=["x","y"];function k(){return(k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){var n=e.x,r=e.y,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,w),a=parseInt("".concat(n),10),i=parseInt("".concat(r),10),l=parseInt("".concat(t.height||o.height),10),s=parseInt("".concat(t.width||o.width),10);return E(E(E(E(E({},t),o),a?{x:a}:{}),i?{y:i}:{}),{},{height:l,width:s,name:t.name,radius:t.radius})}function C(e){return r.createElement(b.bn,k({shapeType:"rectangle",propTransformer:O,activeClassName:"recharts-active-bar"},e))}var j=["value","background"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(f,e);var t,n,i,s=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=R(f);return e=t?Reflect.construct(n,arguments,R(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return I(e)}(this,e)});function f(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,f);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return D(I(e=s.call.apply(s,[this].concat(n))),"state",{isAnimationFinished:!1}),D(I(e),"id",(0,h.EL)("recharts-bar-")),D(I(e),"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),D(I(e),"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return n=[{key:"renderRectanglesStatically",value:function(e){var t=this,n=this.props,o=n.shape,a=n.dataKey,i=n.activeIndex,l=n.activeBar,s=(0,m.L6)(this.props,!1);return e&&e.map(function(e,n){var c=n===i,d=T(T(T({},s),e),{},{isActive:c,option:c?l:o,index:n,dataKey:a,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return r.createElement(u.m,P({className:"recharts-bar-rectangle"},(0,y.bw)(t.props,e,n),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),r.createElement(C,d))})}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,n=t.data,o=t.layout,i=t.isAnimationActive,l=t.animationBegin,s=t.animationDuration,c=t.animationEasing,d=t.animationId,f=this.state.prevData;return r.createElement(a.ZP,{begin:l,duration:s,isActive:i,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var a=t.t,i=n.map(function(e,t){var n=f&&f[t];if(n){var r=(0,h.k4)(n.x,e.x),i=(0,h.k4)(n.y,e.y),l=(0,h.k4)(n.width,e.width),s=(0,h.k4)(n.height,e.height);return T(T({},e),{},{x:r(a),y:i(a),width:l(a),height:s(a)})}if("horizontal"===o){var c=(0,h.k4)(0,e.height)(a);return T(T({},e),{},{y:e.y+e.height-c,height:c})}var u=(0,h.k4)(0,e.width)(a);return T(T({},e),{},{width:u})});return r.createElement(u.m,null,e.renderRectanglesStatically(i))})}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!l()(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:"renderBackground",value:function(){var e=this,t=this.props,n=t.data,o=t.dataKey,a=t.activeIndex,i=(0,m.L6)(this.props.background,!1);return n.map(function(t,n){t.value;var l=t.background,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,j);if(!l)return null;var c=T(T(T(T(T({},s),{},{fill:"#eee"},l),i),(0,y.bw)(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:o,index:n,key:"background-bar-".concat(n),className:"recharts-bar-background-rectangle"});return r.createElement(C,P({option:e.props.background,isActive:n===a},c))})}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.data,a=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,m.NN)(s,d.W);if(!c)return null;var f="vertical"===l?o[0].height/2:o[0].width/2,p=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:(0,v.F$)(e,t)}};return r.createElement(u.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:o,xAxis:a,yAxis:i,layout:l,offset:f,dataPointFormatter:p})}))}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.data,a=e.className,i=e.xAxis,l=e.yAxis,s=e.left,d=e.top,f=e.width,h=e.height,m=e.isAnimationActive,g=e.background,v=e.id;if(t||!n||!n.length)return null;var y=this.state.isAnimationFinished,b=(0,o.Z)("recharts-bar",a),x=i&&i.allowDataOverflow,w=l&&l.allowDataOverflow,k=x||w,S=c()(v)?this.id:v;return r.createElement(u.m,{className:b},x||w?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(S)},r.createElement("rect",{x:x?s:s-f/2,y:w?d:d-h/2,width:x?f:2*f,height:w?h:2*h}))):null,r.createElement(u.m,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,S),(!m||y)&&p.e.renderCallByParent(this.props,n))}}],i=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],n&&A(f.prototype,n),i&&A(f,i),Object.defineProperty(f,"prototype",{writable:!1}),f}(r.PureComponent);D(Z,"displayName","Bar"),D(Z,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!0,isAnimationActive:!g.x.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),D(Z,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,o=e.bandSize,a=e.xAxis,i=e.yAxis,l=e.xAxisTicks,s=e.yAxisTicks,c=e.stackedData,u=e.dataStartIndex,d=e.displayedData,p=e.offset,g=(0,v.Bu)(r,n);if(!g)return null;var y=t.layout,b=n.props,x=b.dataKey,w=b.children,k=b.minPointSize,S="horizontal"===y?i:a,E=c?S.scale.domain():null,O=(0,v.Yj)({numericAxis:S}),C=(0,m.NN)(w,f.b),j=d.map(function(e,t){var r,d,f,p,m,b;if(c?r=(0,v.Vv)(c[u+t],E):Array.isArray(r=(0,v.F$)(e,x))||(r=[O,r]),"horizontal"===y){var w,S=[i.scale(r[0]),i.scale(r[1])],j=S[0],_=S[1];d=(0,v.Fy)({axis:a,ticks:l,bandSize:o,offset:g.offset,entry:e,index:t}),f=null!==(w=null!=_?_:j)&&void 0!==w?w:void 0,p=g.size;var P=j-_;if(m=Number.isNaN(P)?0:P,b={x:d,y:i.y,width:p,height:i.height},Math.abs(k)>0&&Math.abs(m)<Math.abs(k)){var N=(0,h.uY)(m||k)*(Math.abs(k)-Math.abs(m));f-=N,m+=N}}else{var A=[a.scale(r[0]),a.scale(r[1])],M=A[0],I=A[1];if(d=M,f=(0,v.Fy)({axis:i,ticks:s,bandSize:o,offset:g.offset,entry:e,index:t}),p=I-M,m=g.size,b={x:a.x,y:f,width:a.width,height:m},Math.abs(k)>0&&Math.abs(p)<Math.abs(k)){var R=(0,h.uY)(p||k)*(Math.abs(k)-Math.abs(p));p+=R}}return T(T(T({},e),{},{x:d,y:f,width:p,height:m,value:c?r:r[1],payload:e,background:b},C&&C[t]&&C[t].props),{},{tooltipPayload:[(0,v.Qo)(n,e)],tooltipPosition:{x:d+p/2,y:f+m/2}})});return T({data:j,layout:y},p)})},80285:function(e,t,n){"use strict";n.d(t,{O:function(){return N}});var r=n(2265),o=n(86757),a=n.n(o),i=n(13735),l=n.n(i),s=n(87602),c=n(46485),u=n(9841),d=n(58811),f=n(26680),p=n(16630),h=n(41637),m=n(82944),g=n(78242),v=["viewBox"],y=["viewBox"],b=["ticks"];function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(){return(w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function E(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==x(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===x(t)?t:String(t)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(k,e);var t,n,o,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=j(k);return e=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function k(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,k),(t=i.call(this,e)).state={fontSize:"",letterSpacing:""},t}return n=[{key:"shouldComponentUpdate",value:function(e,t){var n=e.viewBox,r=E(e,v),o=this.props,a=o.viewBox,i=E(o,y);return!(0,c.w)(n,a)||!(0,c.w)(r,i)||!(0,c.w)(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,n,r,o,a,i,l=this.props,s=l.x,c=l.y,u=l.width,d=l.height,f=l.orientation,h=l.tickSize,m=l.mirror,g=l.tickMargin,v=m?-1:1,y=e.tickSize||h,b=(0,p.hj)(e.tickCoord)?e.tickCoord:e.coordinate;switch(f){case"top":t=n=e.coordinate,i=(r=(o=c+ +!m*d)-v*y)-v*g,a=b;break;case"left":r=o=e.coordinate,a=(t=(n=s+ +!m*u)-v*y)-v*g,i=b;break;case"right":r=o=e.coordinate,a=(t=(n=s+ +m*u)+v*y)+v*g,i=b;break;default:t=n=e.coordinate,i=(r=(o=c+ +m*d)+v*y)+v*g,a=b}return{line:{x1:t,y1:r,x2:n,y2:o},tick:{x:a,y:i}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,n=t.orientation,r=t.mirror;switch(n){case"left":e=r?"start":"end";break;case"right":e=r?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,n=e.mirror,r="end";switch(t){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.orientation,c=e.mirror,u=e.axisLine,d=S(S(S({},(0,m.L6)(this.props,!1)),(0,m.L6)(u,!1)),{},{fill:"none"});if("top"===i||"bottom"===i){var f=+("top"===i&&!c||"bottom"===i&&c);d=S(S({},d),{},{x1:t,y1:n+f*a,x2:t+o,y2:n+f*a})}else{var p=+("left"===i&&!c||"right"===i&&c);d=S(S({},d),{},{x1:t+p*o,y1:n,x2:t+p*o,y2:n+a})}return r.createElement("line",w({},d,{className:(0,s.Z)("recharts-cartesian-axis-line",l()(u,"className"))}))}},{key:"renderTicks",value:function(e,t,n){var o=this,i=this.props,c=i.tickLine,d=i.stroke,f=i.tick,p=i.tickFormatter,v=i.unit,y=(0,g.f)(S(S({},this.props),{},{ticks:e}),t,n),b=this.getTickTextAnchor(),x=this.getTickVerticalAnchor(),E=(0,m.L6)(this.props,!1),O=(0,m.L6)(f,!1),C=S(S({},E),{},{fill:"none"},(0,m.L6)(c,!1)),j=y.map(function(e,t){var n=o.getTickLineCoord(e),i=n.line,m=n.tick,g=S(S(S(S({textAnchor:b,verticalAnchor:x},E),{},{stroke:"none",fill:d},O),m),{},{index:t,payload:e,visibleTicksCount:y.length,tickFormatter:p});return r.createElement(u.m,w({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},(0,h.bw)(o.props,e,t)),c&&r.createElement("line",w({},C,i,{className:(0,s.Z)("recharts-cartesian-axis-tick-line",l()(c,"className"))})),f&&k.renderTickItem(f,g,"".concat(a()(p)?p(e.value,t):e.value).concat(v||"")))});return r.createElement("g",{className:"recharts-cartesian-axis-ticks"},j)}},{key:"render",value:function(){var e=this,t=this.props,n=t.axisLine,o=t.width,i=t.height,l=t.ticksGenerator,c=t.className;if(t.hide)return null;var d=this.props,p=d.ticks,h=E(d,b),m=p;return(a()(l)&&(m=l(p&&p.length>0?this.props:h)),o<=0||i<=0||!m||!m.length)?null:r.createElement(u.m,{className:(0,s.Z)("recharts-cartesian-axis",c),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),f._.renderCallByParent(this.props))}}],o=[{key:"renderTickItem",value:function(e,t,n){return r.isValidElement(e)?r.cloneElement(e,t):a()(e)?e(t):r.createElement(d.x,w({},t,{className:"recharts-cartesian-axis-tick-value"}),n)}}],n&&O(k.prototype,n),o&&O(k,o),Object.defineProperty(k,"prototype",{writable:!1}),k}(r.Component);_(N,"displayName","CartesianAxis"),_(N,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"})},56940:function(e,t,n){"use strict";n.d(t,{q:function(){return P}});var r=n(2265),o=n(86757),a=n.n(o),i=n(1175),l=n(16630),s=n(82944),c=n(85355),u=n(78242),d=n(80285),f=n(25739),p=["x1","y1","x2","y2","key"],h=["offset"];function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var x=function(e){var t=e.fill;if(!t||"none"===t)return null;var n=e.fillOpacity,o=e.x,a=e.y,i=e.width,l=e.height;return r.createElement("rect",{x:o,y:a,width:i,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function w(e,t){var n;if(r.isValidElement(e))n=r.cloneElement(e,t);else if(a()(e))n=e(t);else{var o=t.x1,i=t.y1,l=t.x2,c=t.y2,u=t.key,d=b(t,p),f=(0,s.L6)(d,!1),m=(f.offset,b(f,h));n=r.createElement("line",y({},m,{x1:o,y1:i,x2:l,y2:c,fill:"none",key:u}))}return n}function k(e){var t=e.x,n=e.width,o=e.horizontal,a=void 0===o||o,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(r,o){return w(a,v(v({},e),{},{x1:t,y1:r,x2:t+n,y2:r,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function S(e){var t=e.y,n=e.height,o=e.vertical,a=void 0===o||o,i=e.verticalPoints;if(!a||!i||!i.length)return null;var l=i.map(function(r,o){return w(a,v(v({},e),{},{x1:r,y1:t,x2:r,y2:t+n,key:"line-".concat(o),index:o}))});return r.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function E(e){var t=e.horizontalFill,n=e.fillOpacity,o=e.x,a=e.y,i=e.width,l=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(void 0===c||c)||!t||!t.length)return null;var u=s.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,s){var c=u[s+1]?u[s+1]-e:a+l-e;if(c<=0)return null;var d=s%t.length;return r.createElement("rect",{key:"react-".concat(s),y:e,x:o,height:c,width:i,stroke:"none",fill:t[d],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function O(e){var t=e.vertical,n=e.verticalFill,o=e.fillOpacity,a=e.x,i=e.y,l=e.width,s=e.height,c=e.verticalPoints;if(!(void 0===t||t)||!n||!n.length)return null;var u=c.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,t){var c=u[t+1]?u[t+1]-e:a+l-e;if(c<=0)return null;var d=t%n.length;return r.createElement("rect",{key:"react-".concat(t),x:e,y:i,width:c,height:s,stroke:"none",fill:n[d],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return r.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var C=function(e,t){var n=e.xAxis,r=e.width,o=e.height,a=e.offset;return(0,c.Rf)((0,u.f)(v(v(v({},d.O.defaultProps),n),{},{ticks:(0,c.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),a.left,a.left+a.width,t)},j=function(e,t){var n=e.yAxis,r=e.width,o=e.height,a=e.offset;return(0,c.Rf)((0,u.f)(v(v(v({},d.O.defaultProps),n),{},{ticks:(0,c.uY)(n,!0),viewBox:{x:0,y:0,width:r,height:o}})),a.top,a.top+a.height,t)},_={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function P(e){var t,n,o,s,c,u,d=(0,f.zn)(),p=(0,f.Mw)(),h=(0,f.qD)(),g=v(v({},e),{},{stroke:null!==(t=e.stroke)&&void 0!==t?t:_.stroke,fill:null!==(n=e.fill)&&void 0!==n?n:_.fill,horizontal:null!==(o=e.horizontal)&&void 0!==o?o:_.horizontal,horizontalFill:null!==(s=e.horizontalFill)&&void 0!==s?s:_.horizontalFill,vertical:null!==(c=e.vertical)&&void 0!==c?c:_.vertical,verticalFill:null!==(u=e.verticalFill)&&void 0!==u?u:_.verticalFill}),b=g.x,w=g.y,P=g.width,N=g.height,T=g.xAxis,A=g.yAxis,M=g.syncWithTicks,I=g.horizontalValues,R=g.verticalValues;if(!(0,l.hj)(P)||P<=0||!(0,l.hj)(N)||N<=0||!(0,l.hj)(b)||b!==+b||!(0,l.hj)(w)||w!==+w)return null;var D=g.verticalCoordinatesGenerator||C,L=g.horizontalCoordinatesGenerator||j,Z=g.horizontalPoints,z=g.verticalPoints;if((!Z||!Z.length)&&a()(L)){var B=I&&I.length,F=L({yAxis:A?v(v({},A),{},{ticks:B?I:A.ticks}):void 0,width:d,height:p,offset:h},!!B||M);(0,i.Z)(Array.isArray(F),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(m(F),"]")),Array.isArray(F)&&(Z=F)}if((!z||!z.length)&&a()(D)){var H=R&&R.length,q=D({xAxis:T?v(v({},T),{},{ticks:H?R:T.ticks}):void 0,width:d,height:p,offset:h},!!H||M);(0,i.Z)(Array.isArray(q),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(m(q),"]")),Array.isArray(q)&&(z=q)}return r.createElement("g",{className:"recharts-cartesian-grid"},r.createElement(x,{fill:g.fill,fillOpacity:g.fillOpacity,x:g.x,y:g.y,width:g.width,height:g.height}),r.createElement(k,y({},g,{offset:h,horizontalPoints:Z})),r.createElement(S,y({},g,{offset:h,verticalPoints:z})),r.createElement(E,y({},g,{horizontalPoints:Z})),r.createElement(O,y({},g,{verticalPoints:z})))}P.displayName="CartesianGrid"},13137:function(e,t,n){"use strict";n.d(t,{W:function(){return u}});var r=n(2265),o=n(69398),a=n(9841),i=n(82944),l=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e){var t=e.offset,n=e.layout,u=e.width,d=e.dataKey,f=e.data,p=e.dataPointFormatter,h=e.xAxis,m=e.yAxis,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,l),v=(0,i.L6)(g,!1);"x"===e.direction&&"number"!==h.type&&(0,o.Z)(!1);var y=f.map(function(e){var o,i,l=p(e,d),f=l.x,g=l.y,y=l.value,b=l.errorVal;if(!b)return null;var x=[];if(Array.isArray(b)){var w=function(e){if(Array.isArray(e))return e}(b)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(b,2)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,2)}}(b,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=w[0],i=w[1]}else o=i=b;if("vertical"===n){var k=h.scale,S=g+t,E=S+u,O=S-u,C=k(y-o),j=k(y+i);x.push({x1:j,y1:E,x2:j,y2:O}),x.push({x1:C,y1:S,x2:j,y2:S}),x.push({x1:C,y1:E,x2:C,y2:O})}else if("horizontal"===n){var _=m.scale,P=f+t,N=P-u,T=P+u,A=_(y-o),M=_(y+i);x.push({x1:N,y1:M,x2:T,y2:M}),x.push({x1:P,y1:A,x2:P,y2:M}),x.push({x1:N,y1:A,x2:T,y2:A})}return r.createElement(a.m,s({className:"recharts-errorBar",key:"bar-".concat(x.map(function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))},v),x.map(function(e){return r.createElement("line",s({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))}))});return r.createElement(a.m,{className:"recharts-errorBars"},y)}u.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},u.displayName="ErrorBar"},54061:function(e,t,n){"use strict";n.d(t,{x:function(){return I}});var r=n(2265),o=n(59221),a=n(86757),i=n.n(a),l=n(77571),s=n.n(l),c=n(21652),u=n.n(c),d=n(87602),f=n(57165),p=n(81889),h=n(9841),m=n(58772),g=n(13137),v=n(16630),y=n(82944),b=n(34067),x=n(85355),w=["type","layout","connectNulls","ref"];function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(){return(S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach(function(t){A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return j(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,M(r.key),r)}}function P(e,t){return(P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function N(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t,n){return(t=M(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}var I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&P(e,t)}(c,e);var t,n,a,l=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=T(c);return e=t?Reflect.construct(n,arguments,T(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return N(e)}(this,e)});function c(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,c);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return A(N(e=l.call.apply(l,[this].concat(n))),"state",{isAnimationFinished:!0,totalLength:0}),A(N(e),"generateSimpleStrokeDasharray",function(e,t){return"".concat(t,"px ").concat(e-t,"px")}),A(N(e),"getStrokeDasharray",function(t,n,r){var o=r.reduce(function(e,t){return e+t});if(!o)return e.generateSimpleStrokeDasharray(n,t);for(var a=t%o,i=n-t,l=[],s=0,u=0;s<r.length;u+=r[s],++s)if(u+r[s]>a){l=[].concat(C(r.slice(0,s)),[a-u]);break}var d=l.length%2==0?[0,i]:[i];return[].concat(C(c.repeat(r,Math.floor(t/o))),C(l),d).map(function(e){return"".concat(e,"px")}).join(", ")}),A(N(e),"id",(0,v.EL)("recharts-line-")),A(N(e),"pathRef",function(t){e.mainCurve=t}),A(N(e),"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),A(N(e),"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return n=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,o=n.points,a=n.xAxis,i=n.yAxis,l=n.layout,s=n.children,c=(0,y.NN)(s,g.W);if(!c)return null;var u=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:(0,x.F$)(e.payload,t)}};return r.createElement(h.m,{clipPath:e?"url(#clipPath-".concat(t,")"):null},c.map(function(e){return r.cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:o,xAxis:a,yAxis:i,layout:l,dataPointFormatter:u})}))}},{key:"renderDots",value:function(e,t,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.dot,i=o.points,l=o.dataKey,s=(0,y.L6)(this.props,!1),u=(0,y.L6)(a,!0),d=i.map(function(e,t){var n=O(O(O({key:"dot-".concat(t),r:3},s),u),{},{value:e.value,dataKey:l,cx:e.x,cy:e.y,index:t,payload:e.payload});return c.renderDotItem(a,n)}),f={clipPath:e?"url(#clipPath-".concat(t?"":"dots-").concat(n,")"):null};return r.createElement(h.m,S({className:"recharts-line-dots",key:"dots"},f),d)}},{key:"renderCurveStatically",value:function(e,t,n,o){var a=this.props,i=a.type,l=a.layout,s=a.connectNulls,c=(a.ref,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(a,w)),u=O(O(O({},(0,y.L6)(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},o),{},{type:i,layout:l,connectNulls:s});return r.createElement(f.H,S({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,a=this.props,i=a.points,l=a.strokeDasharray,s=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,p=a.animateNewValues,h=a.width,m=a.height,g=this.state,y=g.prevPoints,b=g.totalLength;return r.createElement(o.ZP,{begin:c,duration:u,isActive:s,easing:d,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o,a=r.t;if(y){var s=y.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(y[n]){var r=y[n],o=(0,v.k4)(r.x,e.x),i=(0,v.k4)(r.y,e.y);return O(O({},e),{},{x:o(a),y:i(a)})}if(p){var l=(0,v.k4)(2*h,e.x),c=(0,v.k4)(m/2,e.y);return O(O({},e),{},{x:l(a),y:c(a)})}return O(O({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var u=(0,v.k4)(0,b)(a);if(l){var d="".concat(l).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});o=n.getStrokeDasharray(u,b,d)}else o=n.generateSimpleStrokeDasharray(b,u);return n.renderCurveStatically(i,e,t,{strokeDasharray:o})})}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,o=n.isAnimationActive,a=this.state,i=a.prevPoints,l=a.totalLength;return o&&r&&r.length&&(!i&&l>0||!u()(i,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,o=t.dot,a=t.points,i=t.className,l=t.xAxis,c=t.yAxis,u=t.top,f=t.left,p=t.width,g=t.height,v=t.isAnimationActive,b=t.id;if(n||!a||!a.length)return null;var x=this.state.isAnimationFinished,w=1===a.length,k=(0,d.Z)("recharts-line",i),S=l&&l.allowDataOverflow,E=c&&c.allowDataOverflow,O=S||E,C=s()(b)?this.id:b,j=null!==(e=(0,y.L6)(o,!1))&&void 0!==e?e:{r:3,strokeWidth:2},_=j.r,P=j.strokeWidth,N=((0,y.$k)(o)?o:{}).clipDot,T=void 0===N||N,A=2*(void 0===_?3:_)+(void 0===P?2:P);return r.createElement(h.m,{className:k},S||E?r.createElement("defs",null,r.createElement("clipPath",{id:"clipPath-".concat(C)},r.createElement("rect",{x:S?f:f-p/2,y:E?u:u-g/2,width:S?p:2*p,height:E?g:2*g})),!T&&r.createElement("clipPath",{id:"clipPath-dots-".concat(C)},r.createElement("rect",{x:f-A/2,y:u-A/2,width:p+A,height:g+A}))):null,!w&&this.renderCurve(O,C),this.renderErrorBar(O,C),(w||o)&&this.renderDots(O,T,C),(!v||x)&&m.e.renderCallByParent(this.props,a))}}],a=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!=0?[].concat(C(e),[0]):e,r=[],o=0;o<t;++o)r=[].concat(C(r),C(n));return r}},{key:"renderDotItem",value:function(e,t){var n;if(r.isValidElement(e))n=r.cloneElement(e,t);else if(i()(e))n=e(t);else{var o=(0,d.Z)("recharts-line-dot",e?e.className:"");n=r.createElement(p.o,S({},t,{className:o}))}return n}}],n&&_(c.prototype,n),a&&_(c,a),Object.defineProperty(c,"prototype",{writable:!1}),c}(r.PureComponent);A(I,"displayName","Line"),A(I,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!b.x.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),A(I,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,i=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout;return O({points:c.map(function(e,t){var c=(0,x.F$)(e,i);return"horizontal"===d?{x:(0,x.Hv)({axis:n,ticks:o,bandSize:l,entry:e,index:t}),y:s()(c)?null:r.scale(c),value:c,payload:e}:{x:s()(c)?null:n.scale(c),y:(0,x.Hv)({axis:r,ticks:a,bandSize:l,entry:e,index:t}),value:c,payload:e}}),layout:d},u)})},97059:function(e,t,n){"use strict";n.d(t,{K:function(){return c}});var r=n(2265),o=n(87602),a=n(25739),i=n(80285),l=n(85355);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=function(e){var t=e.xAxisId,n=(0,a.zn)(),c=(0,a.Mw)(),u=(0,a.bH)(t);return null==u?null:r.createElement(i.O,s({},u,{className:(0,o.Z)("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:n,height:c},ticksGenerator:function(e){return(0,l.uY)(e,!0)}}))};c.displayName="XAxis",c.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0}},62994:function(e,t,n){"use strict";n.d(t,{B:function(){return c}});var r=n(2265),o=n(87602),a=n(25739),i=n(80285),l=n(85355);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var c=function(e){var t=e.yAxisId,n=(0,a.zn)(),c=(0,a.Mw)(),u=(0,a.Ud)(t);return null==u?null:r.createElement(i.O,s({},u,{className:(0,o.Z)("recharts-".concat(u.axisType," ").concat(u.axisType),u.className),viewBox:{x:0,y:0,width:n,height:c},ticksGenerator:function(e){return(0,l.uY)(e,!0)}}))};c.displayName="YAxis",c.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1}},78242:function(e,t,n){"use strict";n.d(t,{f:function(){return h}});var r=n(86757),o=n.n(r),a=n(16630),i=n(4094),l=n(34067),s=n(25311);function c(e,t,n){if(t<1)return[];if(1===t&&void 0===n)return e;for(var r=[],o=0;o<e.length;o+=t){if(void 0!==n&&!0!==n(e[o]))return;r.push(e[o])}return r}function u(e,t,n,r,o){if(e*t<e*r||e*t>e*o)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-o)<=0}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){var r,d,f,h,m,g=e.tick,v=e.ticks,y=e.viewBox,b=e.minTickGap,x=e.orientation,w=e.interval,k=e.tickFormatter,S=e.unit,E=e.angle;if(!v||!v.length||!g)return[];if((0,a.hj)(w)||l.x.isSsr)return c(v,("number"==typeof w&&(0,a.hj)(w)?w:0)+1);var O="top"===x||"bottom"===x?"width":"height",C=S&&"width"===O?(0,i.xE)(S,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=function(e,r){var a,l,c=o()(k)?k(e.value,r):e.value;return"width"===O?(l={width:(a=(0,i.xE)(c,{fontSize:t,letterSpacing:n})).width+C.width,height:a.height+C.height},(0,s.xE)(l,E)):(0,i.xE)(c,{fontSize:t,letterSpacing:n})[O]},_=v.length>=2?(0,a.uY)(v[1].coordinate-v[0].coordinate):1,P=(r="width"===O,d=y.x,f=y.y,h=y.width,m=y.height,1===_?{start:r?d:f,end:r?d+h:f+m}:{start:r?d+h:f+m,end:r?d:f});return"equidistantPreserveStart"===w?function(e,t,n,r,o){for(var a,i=(r||[]).slice(),l=t.start,s=t.end,d=0,f=1,p=l;f<=i.length;)if(a=function(){var t,a=null==r?void 0:r[d];if(void 0===a)return{v:c(r,f)};var i=d,h=function(){return void 0===t&&(t=n(a,i)),t},m=a.coordinate,g=0===d||u(e,m,h,p,s);g||(d=0,p=l,f+=1),g&&(p=m+e*(h()/2+o),d+=f)}())return a.v;return[]}(_,P,j,v,b):("preserveStart"===w||"preserveStartEnd"===w?function(e,t,n,r,o,a){var i=(r||[]).slice(),l=i.length,s=t.start,c=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-c);i[l-1]=d=p(p({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),u(e,d.tickCoord,function(){return f},s,c)&&(c=d.tickCoord-e*(f/2+o),i[l-1]=p(p({},d),{},{isShow:!0}))}for(var m=a?l-1:l,g=function(t){var r,a=i[t],l=function(){return void 0===r&&(r=n(a,t)),r};if(0===t){var d=e*(a.coordinate-e*l()/2-s);i[t]=a=p(p({},a),{},{tickCoord:d<0?a.coordinate-d*e:a.coordinate})}else i[t]=a=p(p({},a),{},{tickCoord:a.coordinate});u(e,a.tickCoord,l,s,c)&&(s=a.tickCoord+e*(l()/2+o),i[t]=p(p({},a),{},{isShow:!0}))},v=0;v<m;v++)g(v);return i}(_,P,j,v,b,"preserveStartEnd"===w):function(e,t,n,r,o){for(var a=(r||[]).slice(),i=a.length,l=t.start,s=t.end,c=function(t){var r,c=a[t],d=function(){return void 0===r&&(r=n(c,t)),r};if(t===i-1){var f=e*(c.coordinate+e*d()/2-s);a[t]=c=p(p({},c),{},{tickCoord:f>0?c.coordinate-f*e:c.coordinate})}else a[t]=c=p(p({},c),{},{tickCoord:c.coordinate});u(e,c.tickCoord,d,l,s)&&(s=c.tickCoord-e*(d()/2+o),a[t]=p(p({},c),{},{isShow:!0}))},d=i-1;d>=0;d--)c(d);return a}(_,P,j,v,b)).filter(function(e){return e.isShow})}},93765:function(e,t,n){"use strict";n.d(t,{z:function(){return tx}});var r=n(2265),o=n(77571),a=n.n(o),i=n(86757),l=n.n(i),s=n(99676),c=n.n(s),u=n(13735),d=n.n(u),f=n(34935),p=n.n(f),h=n(37065),m=n.n(h),g=n(84173),v=n.n(g),y=n(32242),b=n.n(y),x=n(87602),w=n(69398),k=n(48777),S=n(9841),E=n(8147),O=n(22190),C=n(81889),j=n(73649),_=n(82944),P=n(55284),N=n(58811),T=n(85355),A=n(16630);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t,n){var r;return(r=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===M(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var L=["Webkit","Moz","O","ms"],Z=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=L.reduce(function(e,r){return R(R({},e),{},D({},r+n,t))},{});return r[e]=t,r};function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(){return(B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach(function(t){$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,V(r.key),r)}}function W(e,t){return(W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function U(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t,n){return(t=V(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e){var t=function(e,t){if("object"!==z(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==z(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===z(t)?t:String(t)}var X=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,o=e.x,a=e.width,i=e.travellerWidth;if(!t||!t.length)return{};var l=t.length,s=(0,P.x)().domain(c()(0,l)).range([o,o+a-i]),u=s.domain().map(function(e){return s(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:s(n),endX:s(r),scale:s,scaleValues:u}},G=function(e){return e.changedTouches&&!!e.changedTouches.length},Y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(i,e);var t,n,o,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=K(i);return e=t?Reflect.construct(n,arguments,K(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===z(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return U(e)}(this,e)});function i(e){var t;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),$(U(t=a.call(this,e)),"handleDrag",function(e){t.leaveTimer&&(clearTimeout(t.leaveTimer),t.leaveTimer=null),t.state.isTravellerMoving?t.handleTravellerMove(e):t.state.isSlideMoving&&t.handleSlideDrag(e)}),$(U(t),"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleDrag(e.changedTouches[0])}),$(U(t),"handleDragEnd",function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=t.props,n=e.endIndex,r=e.onDragEnd,o=e.startIndex;null==r||r({endIndex:n,startIndex:o})}),t.detachDragEndListener()}),$(U(t),"handleLeaveWrapper",function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))}),$(U(t),"handleEnterSlideOrTraveller",function(){t.setState({isTextActive:!0})}),$(U(t),"handleLeaveSlideOrTraveller",function(){t.setState({isTextActive:!1})}),$(U(t),"handleSlideDragStart",function(e){var n=G(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:n.pageX}),t.attachDragEndListener()}),t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(U(t),"startX"),endX:t.handleTravellerDragStart.bind(U(t),"endX")},t.state={},t}return n=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,n=e.endX,r=this.state.scaleValues,o=this.props,a=o.gap,l=o.data.length-1,s=i.getIndexInRange(r,Math.min(t,n)),c=i.getIndexInRange(r,Math.max(t,n));return{startIndex:s-s%a,endIndex:c===l?l:c-c%a}}},{key:"getTextOfTick",value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,o=t.dataKey,a=(0,T.F$)(n[e],o,e);return l()(r)?r(a,e):a}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,o=t.endX,a=this.props,i=a.x,l=a.width,s=a.travellerWidth,c=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,i+l-s-o,i+l-s-r):f<0&&(f=Math.max(f,i-r,i-o));var p=this.getIndex({startX:r+f,endX:o+f});(p.startIndex!==c||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:o+f,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var n=G(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,n=this.state,r=n.brushMoveStartX,o=n.movingTravellerId,a=n.endX,i=n.startX,l=this.state[o],s=this.props,c=s.x,u=s.width,d=s.travellerWidth,f=s.onChange,p=s.gap,h=s.data,m={startX:this.state.startX,endX:this.state.endX},g=e.pageX-r;g>0?g=Math.min(g,c+u-d-l):g<0&&(g=Math.max(g,c-l)),m[o]=l+g;var v=this.getIndex(m),y=v.startIndex,b=v.endIndex,x=function(){var e=h.length-1;return"startX"===o&&(a>i?y%p==0:b%p==0)||a<i&&b===e||"endX"===o&&(a>i?b%p==0:y%p==0)||a>i&&b===e};this.setState(($(t={},o,l+g),$(t,"brushMoveStartX",e.pageX),t),function(){f&&x()&&f(v)})}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var n=this,r=this.state,o=r.scaleValues,a=r.startX,i=r.endX,l=this.state[t],s=o.indexOf(l);if(-1!==s){var c=s+e;if(-1!==c&&!(c>=o.length)){var u=o[c];"startX"===t&&u>=i||"endX"===t&&u<=a||this.setState($({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.fill,l=e.stroke;return r.createElement("rect",{stroke:l,fill:i,x:t,y:n,width:o,height:a})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,i=e.data,l=e.children,s=e.padding,c=r.Children.only(l);return c?r.cloneElement(c,{x:t,y:n,width:o,height:a,margin:s,compact:!0,data:i}):null}},{key:"renderTravellerLayer",value:function(e,t){var n=this,o=this.props,a=o.y,l=o.travellerWidth,s=o.height,c=o.traveller,u=o.ariaLabel,d=o.data,f=o.startIndex,p=o.endIndex,h=Math.max(e,this.props.x),m=H(H({},(0,_.L6)(this.props,!1)),{},{x:h,y:a,width:l,height:s}),g=u||"Min value: ".concat(d[f].name,", Max value: ").concat(d[p].name);return r.createElement(S.m,{tabIndex:0,role:"slider","aria-label":g,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),n.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,t))},onFocus:function(){n.setState({isTravellerFocused:!0})},onBlur:function(){n.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},i.renderTraveller(c,m))}},{key:"renderSlide",value:function(e,t){var n=this.props,o=n.y,a=n.height,i=n.stroke,l=n.travellerWidth;return r.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:i,fillOpacity:.2,x:Math.min(e,t)+l,y:o,width:Math.max(Math.abs(t-e)-l,0),height:a})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,o=e.y,a=e.height,i=e.travellerWidth,l=e.stroke,s=this.state,c=s.startX,u=s.endX,d={pointerEvents:"none",fill:l};return r.createElement(S.m,{className:"recharts-brush-texts"},r.createElement(N.x,B({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,u)-5,y:o+a/2},d),this.getTextOfTick(t)),r.createElement(N.x,B({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,u)+i+5,y:o+a/2},d),this.getTextOfTick(n)))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.className,o=e.children,a=e.x,i=e.y,l=e.width,s=e.height,c=e.alwaysShowText,u=this.state,d=u.startX,f=u.endX,p=u.isTextActive,h=u.isSlideMoving,m=u.isTravellerMoving,g=u.isTravellerFocused;if(!t||!t.length||!(0,A.hj)(a)||!(0,A.hj)(i)||!(0,A.hj)(l)||!(0,A.hj)(s)||l<=0||s<=0)return null;var v=(0,x.Z)("recharts-brush",n),y=1===r.Children.count(o),b=Z("userSelect","none");return r.createElement(S.m,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),y&&this.renderPanorama(),this.renderSlide(d,f),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(f,"endX"),(p||h||m||g||c)&&this.renderText())}}],o=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,n=e.y,o=e.width,a=e.height,i=e.stroke,l=Math.floor(n+a/2)-1;return r.createElement(r.Fragment,null,r.createElement("rect",{x:t,y:n,width:o,height:a,fill:i,stroke:"none"}),r.createElement("line",{x1:t+1,y1:l,x2:t+o-1,y2:l,fill:"none",stroke:"#fff"}),r.createElement("line",{x1:t+1,y1:l+2,x2:t+o-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):i.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var n=e.data,r=e.width,o=e.x,a=e.travellerWidth,i=e.updateId,l=e.startIndex,s=e.endIndex;if(n!==t.prevData||i!==t.prevUpdateId)return H({prevData:n,prevTravellerWidth:a,prevUpdateId:i,prevX:o,prevWidth:r},n&&n.length?X({data:n,width:r,x:o,travellerWidth:a,startIndex:l,endIndex:s}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||o!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([o,o+r-a]);var c=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:i,prevX:o,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:c}}return null}},{key:"getIndexInRange",value:function(e,t){for(var n=e.length,r=0,o=n-1;o-r>1;){var a=Math.floor((r+o)/2);e[a]>t?o=a:r=a}return t>=e[o]?o:r}}],n&&q(i.prototype,n),o&&q(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}(r.PureComponent);$(Y,"displayName","Brush"),$(Y,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Q=n(4094),J=n(38569),ee=n(26680),et=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r="extendDomain"),r===t},en=n(25311),er=n(1175);function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ea(){return(ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function el(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eo(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eo(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var es=function(e){var t=e.x,n=e.y,r=e.xAxis,o=e.yAxis,a=(0,en.Ky)({x:r.scale,y:o.scale}),i=a.apply({x:t,y:n},{bandAware:!0});return et(e,"discard")&&!a.isInRange(i)?null:i};function ec(e){var t=e.x,n=e.y,o=e.r,a=e.alwaysShow,i=e.clipPathId,l=(0,A.P2)(t),s=(0,A.P2)(n);if((0,er.Z)(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!l||!s)return null;var c=es(e);if(!c)return null;var u=c.x,d=c.y,f=e.shape,p=e.className,h=el(el({clipPath:et(e,"hidden")?"url(#".concat(i,")"):void 0},(0,_.L6)(e,!0)),{},{cx:u,cy:d});return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-dot",p)},ec.renderDot(f,h),ee._.renderCallByParent(e,{x:u-o,y:d-o,width:2*o,height:2*o}))}ec.displayName="ReferenceDot",ec.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1},ec.renderDot=function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):r.createElement(C.o,ea({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))};var eu=n(33645),ed=n.n(eu),ef=n(25739);function ep(e){return(ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function em(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eh(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==ep(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ep(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ep(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ev(){return(ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ey=function(e,t,n,r,o,a,i,l,s){var c=o.x,u=o.y,d=o.width,f=o.height;if(n){var p=s.y,h=e.y.apply(p,{position:a});if(et(s,"discard")&&!e.y.isInRange(h))return null;var m=[{x:c+d,y:h},{x:c,y:h}];return"left"===l?m.reverse():m}if(t){var g=s.x,v=e.x.apply(g,{position:a});if(et(s,"discard")&&!e.x.isInRange(v))return null;var y=[{x:v,y:u+f},{x:v,y:u}];return"top"===i?y.reverse():y}if(r){var b=s.segment.map(function(t){return e.apply(t,{position:a})});return et(s,"discard")&&ed()(b,function(t){return!e.isInRange(t)})?null:b}return null};function eb(e){var t,n,o=e.x,a=e.y,i=e.segment,s=e.xAxisId,c=e.yAxisId,u=e.shape,d=e.className,f=e.alwaysShow,p=(0,ef.sp)(),h=(0,ef.bH)(s),m=(0,ef.Ud)(c),g=(0,ef.d2)();if(!p||!g)return null;(0,er.Z)(void 0===f,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=ey((0,en.Ky)({x:h.scale,y:m.scale}),(0,A.P2)(o),(0,A.P2)(a),i&&2===i.length,g,e.position,h.orientation,m.orientation,e);if(!v)return null;var y=function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(v,2)||function(e,t){if(e){if("string"==typeof e)return eg(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eg(e,2)}}(v,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],w=b.x,k=b.y,E=y[1],O=E.x,C=E.y,j=em(em({clipPath:et(e,"hidden")?"url(#".concat(p,")"):void 0},(0,_.L6)(e,!0)),{},{x1:w,y1:k,x2:O,y2:C});return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-line",d)},(t=u,n=j,r.isValidElement(t)?r.cloneElement(t,n):l()(t)?t(n):r.createElement("line",ev({},n,{className:"recharts-reference-line-line"}))),ee._.renderCallByParent(e,(0,en._b)({x1:w,y1:k,x2:O,y2:C})))}function ex(e){return(ex="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ew(){return(ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ek(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==ex(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ex(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ex(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}eb.displayName="ReferenceLine",eb.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"};var eE=function(e,t,n,r,o){var a=o.x1,i=o.x2,l=o.y1,s=o.y2,c=o.xAxis,u=o.yAxis;if(!c||!u)return null;var d=(0,en.Ky)({x:c.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(l,{position:"start"}):d.y.rangeMin},p={x:t?d.x.apply(i,{position:"end"}):d.x.rangeMax,y:r?d.y.apply(s,{position:"end"}):d.y.rangeMax};return!et(o,"discard")||d.isInRange(f)&&d.isInRange(p)?(0,en.O1)(f,p):null};function eO(e){var t=e.x1,n=e.x2,o=e.y1,a=e.y2,i=e.className,l=e.alwaysShow,s=e.clipPathId;(0,er.Z)(void 0===l,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var c=(0,A.P2)(t),u=(0,A.P2)(n),d=(0,A.P2)(o),f=(0,A.P2)(a),p=e.shape;if(!c&&!u&&!d&&!f&&!p)return null;var h=eE(c,u,d,f,e);if(!h&&!p)return null;var m=et(e,"hidden")?"url(#".concat(s,")"):void 0;return r.createElement(S.m,{className:(0,x.Z)("recharts-reference-area",i)},eO.renderRect(p,eS(eS({clipPath:m},(0,_.L6)(e,!0)),h)),ee._.renderCallByParent(e,h))}function eC(e){return function(e){if(Array.isArray(e))return ej(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ej(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ej(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}eO.displayName="ReferenceArea",eO.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1},eO.renderRect=function(e,t){return r.isValidElement(e)?r.cloneElement(e,t):l()(e)?e(t):r.createElement(j.A,ew({},t,{className:"recharts-reference-area-rect"}))};var e_=function(e,t,n,r,o){var a=(0,_.NN)(e,eb),i=(0,_.NN)(e,ec),l=[].concat(eC(a),eC(i)),s=(0,_.NN)(e,eO),c="".concat(r,"Id"),u=r[0],d=t;if(l.length&&(d=l.reduce(function(e,t){if(t.props[c]===n&&et(t.props,"extendDomain")&&(0,A.hj)(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),s.length){var f="".concat(u,"1"),p="".concat(u,"2");d=s.reduce(function(e,t){if(t.props[c]===n&&et(t.props,"extendDomain")&&(0,A.hj)(t.props[f])&&(0,A.hj)(t.props[p])){var r=t.props[f],o=t.props[p];return[Math.min(e[0],r,o),Math.max(e[1],r,o)]}return e},d)}return o&&o.length&&(d=o.reduce(function(e,t){return(0,A.hj)(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},eP=n(39206),eN=n(46485),eT=n(77625),eA=new(n.n(eT)()),eM="recharts.syncMouseEvents",eI=n(41637);function eR(e){return(eR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eD(e,t,n){return(t=eL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eL(e){var t=function(e,t){if("object"!==eR(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eR(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eR(t)?t:String(t)}var eZ=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),eD(this,"activeIndex",0),eD(this,"coordinateList",[]),eD(this,"layout","horizontal")}return e=[{key:"setDetails",value:function(e){var t,n=e.coordinateList,r=void 0===n?null:n,o=e.container,a=void 0===o?null:o,i=e.layout,l=void 0===i?null:i,s=e.offset,c=void 0===s?null:s,u=e.mouseHandlerCallback,d=void 0===u?null:u;this.coordinateList=null!==(t=null!=r?r:this.coordinateList)&&void 0!==t?t:[],this.container=null!=a?a:this.container,this.layout=null!=l?l:this.layout,this.offset=null!=c?c:this.offset,this.mouseHandlerCallback=null!=d?d:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"setIndex",value:function(e){this.activeIndex=e}},{key:"spoofMouse",value:function(){if("horizontal"===this.layout&&0!==this.coordinateList.length){var e,t,n=this.container.getBoundingClientRect(),r=n.x,o=n.y,a=n.height,i=this.coordinateList[this.activeIndex].coordinate,l=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,s=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,c=o+this.offset.top+a/2+s;this.mouseHandlerCallback({pageX:r+i+l,pageY:c})}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eL(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),ez=n(11638),eB=n(57165);function eF(e){return(eF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var eH=["x","y","top","left","width","height","className"];function eq(){return(eq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var eU=function(e){var t=e.x,n=void 0===t?0:t,o=e.y,a=void 0===o?0:o,i=e.top,l=void 0===i?0:i,s=e.left,c=void 0===s?0:s,u=e.width,d=void 0===u?0:u,f=e.height,p=void 0===f?0:f,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eW(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eF(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eF(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eF(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({x:n,y:a,top:l,left:c,width:d,height:p},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eH));return(0,A.hj)(n)&&(0,A.hj)(a)&&(0,A.hj)(d)&&(0,A.hj)(p)&&(0,A.hj)(l)&&(0,A.hj)(c)?r.createElement("path",eq({},(0,_.L6)(m,!0),{className:(0,x.Z)("recharts-cross",h),d:"M".concat(n,",").concat(l,"v").concat(p,"M").concat(c,",").concat(a,"h").concat(d)})):null};function eK(e){var t=e.cx,n=e.cy,r=e.radius,o=e.startAngle,a=e.endAngle;return{points:[(0,eP.op)(t,n,r,o),(0,eP.op)(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:o,endAngle:a}}var e$=n(60474);function eV(e){return(eV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function eX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eX(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==eV(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eV(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eV(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eY(e){var t,n,o=e.element,a=e.tooltipEventType,i=e.isActive,l=e.activeCoordinate,s=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,p=e.chartName;if(!o||!o.props.cursor||!i||!l||"ScatterChart"!==p&&"axis"!==a)return null;var h=eB.H;if("ScatterChart"===p)n=l,h=eU;else if("BarChart"===p)t=d/2,n={stroke:"none",fill:"#ccc",x:"horizontal"===f?l.x-t:c.left+.5,y:"horizontal"===f?c.top+.5:l.y-t,width:"horizontal"===f?d:c.width-1,height:"horizontal"===f?c.height-1:d},h=j.A;else if("radial"===f){var m=eK(l),g=m.cx,v=m.cy,y=m.radius;n={cx:g,cy:v,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:y,outerRadius:y},h=e$.L}else n={points:function(e,t,n){var r,o,a,i;if("horizontal"===e)a=r=t.x,o=n.top,i=n.top+n.height;else if("vertical"===e)i=o=t.y,r=n.left,a=n.left+n.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return eK(t);var l=t.cx,s=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.angle,f=(0,eP.op)(l,s,c,d),p=(0,eP.op)(l,s,u,d);r=f.x,o=f.y,a=p.x,i=p.y}return[{x:r,y:o},{x:a,y:i}]}(f,l,c)},h=eB.H;var b=eG(eG(eG(eG({stroke:"#ccc",pointerEvents:"none"},c),n),(0,_.L6)(o.props.cursor,!1)),{},{payload:s,payloadIndex:u,className:"recharts-tooltip-cursor"});return(0,r.isValidElement)(o.props.cursor)?(0,r.cloneElement)(o.props.cursor,b):(0,r.createElement)(h,b)}var eQ=["item"],eJ=["children","className","width","height","style","compact","title","desc"];function e0(e){return(e0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e1(){return(e1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function e2(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||e7(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e6(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function e4(e,t){return(e4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function e3(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e5(e){return(e5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e8(e){return function(e){if(Array.isArray(e))return e9(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||e7(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e7(e,t){if(e){if("string"==typeof e)return e9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e9(e,t)}}function e9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach(function(t){tn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tn(e,t,n){return(t=tr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tr(e){var t=function(e,t){if("object"!==e0(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==e0(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===e0(t)?t:String(t)}var to={xAxis:["bottom","top"],yAxis:["left","right"]},ta={width:"100%",height:"100%"},ti={x:0,y:0};function tl(e){return e}var ts=function(e,t,n,r){var o=t.find(function(e){return e&&e.index===n});if(o){if("horizontal"===e)return{x:o.coordinate,y:r.y};if("vertical"===e)return{x:r.x,y:o.coordinate};if("centric"===e){var a=o.coordinate,i=r.radius;return tt(tt(tt({},r),(0,eP.op)(r.cx,r.cy,i,a)),{},{angle:a,radius:i})}var l=o.coordinate,s=r.angle;return tt(tt(tt({},r),(0,eP.op)(r.cx,r.cy,l,s)),{},{angle:s,radius:l})}return ti},tc=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,o=t.dataEndIndex,a=(null!=n?n:[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(e8(e),e8(n)):e},[]);return a.length>0?a:e&&e.length&&(0,A.hj)(r)&&(0,A.hj)(o)?e.slice(r,o+1):[]};function tu(e){return"number"===e?[0,"auto"]:void 0}var td=function(e,t,n,r){var o=e.graphicalItems,a=e.tooltipAxis,i=tc(t,e);return n<0||!o||!o.length||n>=i.length?null:o.reduce(function(o,l){var s,c,u=null!==(s=l.props.data)&&void 0!==s?s:t;if(u&&e.dataStartIndex+e.dataEndIndex!==0&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),a.dataKey&&!a.allowDuplicatedCategory){var d=void 0===u?i:u;c=(0,A.Ap)(d,a.dataKey,r)}else c=u&&u[n]||i[n];return c?[].concat(e8(o),[(0,T.Qo)(l,c)]):o},[])},tf=function(e,t,n,r){var o=r||{x:e.chartX,y:e.chartY},a="horizontal"===n?o.x:"vertical"===n?o.y:"centric"===n?o.angle:o.radius,i=e.orderedTooltipTicks,l=e.tooltipAxis,s=e.tooltipTicks,c=(0,T.VO)(a,i,s,l);if(c>=0&&s){var u=s[c]&&s[c].value,d=td(e,t,c,u),f=ts(n,i,c,o);return{activeTooltipIndex:c,activeLabel:u,activePayload:d,activeCoordinate:f}}return null},tp=function(e,t){var n=t.axes,r=t.graphicalItems,o=t.axisType,i=t.axisIdKey,l=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,d=e.layout,f=e.children,p=e.stackOffset,h=(0,T.NA)(d,o);return n.reduce(function(t,n){var m=n.props,g=m.type,v=m.dataKey,y=m.allowDataOverflow,b=m.allowDuplicatedCategory,x=m.scale,w=m.ticks,k=m.includeHidden,S=n.props[i];if(t[S])return t;var E=tc(e.data,{graphicalItems:r.filter(function(e){return e.props[i]===S}),dataStartIndex:s,dataEndIndex:u}),O=E.length;(function(e,t,n){if("number"===n&&!0===t&&Array.isArray(e)){var r=null==e?void 0:e[0],o=null==e?void 0:e[1];if(r&&o&&(0,A.hj)(r)&&(0,A.hj)(o))return!0}return!1})(n.props.domain,y,g)&&(_=(0,T.LG)(n.props.domain,null,y),h&&("number"===g||"auto"!==x)&&(N=(0,T.gF)(E,v,"category")));var C=tu(g);if(!_||0===_.length){var j,_,P,N,M,I=null!==(M=n.props.domain)&&void 0!==M?M:C;if(v){if(_=(0,T.gF)(E,v,g),"category"===g&&h){var R=(0,A.bv)(_);b&&R?(P=_,_=c()(0,O)):b||(_=(0,T.ko)(I,_,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(e8(e),[t])},[]))}else if("category"===g)_=b?_.filter(function(e){return""!==e&&!a()(e)}):(0,T.ko)(I,_,n).reduce(function(e,t){return e.indexOf(t)>=0||""===t||a()(t)?e:[].concat(e8(e),[t])},[]);else if("number"===g){var D=(0,T.ZI)(E,r.filter(function(e){return e.props[i]===S&&(k||!e.props.hide)}),v,o,d);D&&(_=D)}h&&("number"===g||"auto"!==x)&&(N=(0,T.gF)(E,v,"category"))}else _=h?c()(0,O):l&&l[S]&&l[S].hasStack&&"number"===g?"expand"===p?[0,1]:(0,T.EB)(l[S].stackGroups,s,u):(0,T.s6)(E,r.filter(function(e){return e.props[i]===S&&(k||!e.props.hide)}),g,d,!0);"number"===g?(_=e_(f,_,S,o,w),I&&(_=(0,T.LG)(I,_,y))):"category"===g&&I&&_.every(function(e){return I.indexOf(e)>=0})&&(_=I)}return tt(tt({},t),{},tn({},S,tt(tt({},n.props),{},{axisType:o,domain:_,categoricalDomain:N,duplicateDomain:P,originalDomain:null!==(j=n.props.domain)&&void 0!==j?j:C,isCategorical:h,layout:d})))},{})},th=function(e,t){var n=t.graphicalItems,r=t.Axis,o=t.axisType,a=t.axisIdKey,i=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,u=e.layout,f=e.children,p=tc(e.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:s}),h=p.length,m=(0,T.NA)(u,o),g=-1;return n.reduce(function(e,t){var v,y=t.props[a],b=tu("number");return e[y]?e:(g++,v=m?c()(0,h):i&&i[y]&&i[y].hasStack?e_(f,v=(0,T.EB)(i[y].stackGroups,l,s),y,o):e_(f,v=(0,T.LG)(b,(0,T.s6)(p,n.filter(function(e){return e.props[a]===y&&!e.props.hide}),"number",u),r.defaultProps.allowDataOverflow),y,o),tt(tt({},e),{},tn({},y,tt(tt({axisType:o},r.defaultProps),{},{hide:!0,orientation:d()(to,"".concat(o,".").concat(g%2),null),domain:v,originalDomain:b,isCategorical:m,layout:u}))))},{})},tm=function(e,t){var n=t.axisType,r=void 0===n?"xAxis":n,o=t.AxisComp,a=t.graphicalItems,i=t.stackGroups,l=t.dataStartIndex,s=t.dataEndIndex,c=e.children,u="".concat(r,"Id"),d=(0,_.NN)(c,o),f={};return d&&d.length?f=tp(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:l,dataEndIndex:s}):a&&a.length&&(f=th(e,{Axis:o,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:l,dataEndIndex:s})),f},tg=function(e){var t=(0,A.Kt)(e),n=(0,T.uY)(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:p()(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:(0,T.zT)(t,n)}},tv=function(e){var t=e.children,n=e.defaultShowTooltip,r=(0,_.sP)(t,Y),o=0,a=0;return e.data&&0!==e.data.length&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(o=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},ty=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},tb=function(e,t){var n=e.props,r=e.graphicalItems,o=e.xAxisMap,a=void 0===o?{}:o,i=e.yAxisMap,l=void 0===i?{}:i,s=n.width,c=n.height,u=n.children,f=n.margin||{},p=(0,_.sP)(u,Y),h=(0,_.sP)(u,O.D),m=Object.keys(l).reduce(function(e,t){var n=l[t],r=n.orientation;return n.mirror||n.hide?e:tt(tt({},e),{},tn({},r,e[r]+n.width))},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return n.mirror||n.hide?e:tt(tt({},e),{},tn({},r,d()(e,"".concat(r))+n.height))},{top:f.top||0,bottom:f.bottom||0}),v=tt(tt({},g),m),y=v.bottom;p&&(v.bottom+=p.props.height||Y.defaultProps.height),h&&t&&(v=(0,T.By)(v,r,n,t));var b=s-v.left-v.right,x=c-v.top-v.bottom;return tt(tt({brushBottom:y},v),{},{width:Math.max(b,0),height:Math.max(x,0)})},tx=function(e){var t,n=e.chartName,o=e.GraphicalChild,i=e.defaultTooltipEventType,s=void 0===i?"axis":i,c=e.validateTooltipEventTypes,u=void 0===c?["axis"]:c,f=e.axisComponents,p=e.legendContent,h=e.formatAxisMap,g=e.defaultProps,y=function(e,t){var n=t.graphicalItems,r=t.stackGroups,o=t.offset,i=t.updateId,l=t.dataStartIndex,s=t.dataEndIndex,c=e.barSize,u=e.layout,d=e.barGap,p=e.barCategoryGap,h=e.maxBarSize,m=ty(u),g=m.numericAxisName,v=m.cateAxisName,y=!!n&&!!n.length&&n.some(function(e){var t=(0,_.Gf)(e&&e.type);return t&&t.indexOf("Bar")>=0})&&(0,T.pt)({barSize:c,stackGroups:r}),b=[];return n.forEach(function(n,c){var m,x=tc(e.data,{graphicalItems:[n],dataStartIndex:l,dataEndIndex:s}),k=n.props,S=k.dataKey,E=k.maxBarSize,O=n.props["".concat(g,"Id")],C=n.props["".concat(v,"Id")],j=f.reduce(function(e,r){var o,a=t["".concat(r.axisType,"Map")],i=n.props["".concat(r.axisType,"Id")];a&&a[i]||"zAxis"===r.axisType||(0,w.Z)(!1);var l=a[i];return tt(tt({},e),{},(tn(o={},r.axisType,l),tn(o,"".concat(r.axisType,"Ticks"),(0,T.uY)(l)),o))},{}),P=j[v],N=j["".concat(v,"Ticks")],A=r&&r[O]&&r[O].hasStack&&(0,T.O3)(n,r[O].stackGroups),M=(0,_.Gf)(n.type).indexOf("Bar")>=0,I=(0,T.zT)(P,N),R=[];if(M){var D,L,Z=a()(E)?h:E,z=null!==(D=null!==(L=(0,T.zT)(P,N,!0))&&void 0!==L?L:Z)&&void 0!==D?D:0;R=(0,T.qz)({barGap:d,barCategoryGap:p,bandSize:z!==I?z:I,sizeList:y[C],maxBarSize:Z}),z!==I&&(R=R.map(function(e){return tt(tt({},e),{},{position:tt(tt({},e.position),{},{offset:e.position.offset-z/2})})}))}var B=n&&n.type&&n.type.getComposedData;B&&b.push({props:tt(tt({},B(tt(tt({},j),{},{displayedData:x,props:e,dataKey:S,item:n,bandSize:I,barPosition:R,offset:o,stackedData:A,layout:u,dataStartIndex:l,dataEndIndex:s}))),{},(tn(m={key:n.key||"item-".concat(c)},g,j[g]),tn(m,v,j[v]),tn(m,"animationId",i),m)),childIndex:(0,_.$R)(n,e.children),item:n})}),b},O=function(e,t){var r=e.props,a=e.dataStartIndex,i=e.dataEndIndex,l=e.updateId;if(!(0,_.TT)({props:r}))return null;var s=r.children,c=r.layout,u=r.stackOffset,d=r.data,p=r.reverseStackOrder,m=ty(c),g=m.numericAxisName,v=m.cateAxisName,b=(0,_.NN)(s,o),x=(0,T.wh)(d,b,"".concat(g,"Id"),"".concat(v,"Id"),u,p),w=f.reduce(function(e,t){var n="".concat(t.axisType,"Map");return tt(tt({},e),{},tn({},n,tm(r,tt(tt({},t),{},{graphicalItems:b,stackGroups:t.axisType===g&&x,dataStartIndex:a,dataEndIndex:i}))))},{}),k=tb(tt(tt({},w),{},{props:r,graphicalItems:b}),null==t?void 0:t.legendBBox);Object.keys(w).forEach(function(e){w[e]=h(r,w[e],k,e.replace("Map",""),n)});var S=tg(w["".concat(v,"Map")]),E=y(r,tt(tt({},w),{},{dataStartIndex:a,dataEndIndex:i,updateId:l,graphicalItems:b,stackGroups:x,offset:k}));return tt(tt({formattedGraphicalItems:E,graphicalItems:b,offset:k,stackGroups:x},S),w)};return t=function(e){(function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&e4(e,t)})(c,e);var t,o,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=e5(c);return e=t?Reflect.construct(n,arguments,e5(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===e0(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return e3(e)}(this,e)});function c(e){var t,o,s;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,c),tn(e3(s=i.call(this,e)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),tn(e3(s),"accessibilityManager",new eZ),tn(e3(s),"handleLegendBBoxUpdate",function(e){if(e){var t=s.state,n=t.dataStartIndex,r=t.dataEndIndex,o=t.updateId;s.setState(tt({legendBBox:e},O({props:s.props,dataStartIndex:n,dataEndIndex:r,updateId:o},tt(tt({},s.state),{},{legendBBox:e}))))}}),tn(e3(s),"handleReceiveSyncEvent",function(e,t,n){s.props.syncId===e&&(n!==s.eventEmitterSymbol||"function"==typeof s.props.syncMethod)&&s.applySyncEvent(t)}),tn(e3(s),"handleBrushChange",function(e){var t=e.startIndex,n=e.endIndex;if(t!==s.state.dataStartIndex||n!==s.state.dataEndIndex){var r=s.state.updateId;s.setState(function(){return tt({dataStartIndex:t,dataEndIndex:n},O({props:s.props,dataStartIndex:t,dataEndIndex:n,updateId:r},s.state))}),s.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),tn(e3(s),"handleMouseEnter",function(e){var t=s.getMouseInfo(e);if(t){var n=tt(tt({},t),{},{isTooltipActive:!0});s.setState(n),s.triggerSyncEvent(n);var r=s.props.onMouseEnter;l()(r)&&r(n,e)}}),tn(e3(s),"triggeredAfterMouseMove",function(e){var t=s.getMouseInfo(e),n=t?tt(tt({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};s.setState(n),s.triggerSyncEvent(n);var r=s.props.onMouseMove;l()(r)&&r(n,e)}),tn(e3(s),"handleItemMouseEnter",function(e){s.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),tn(e3(s),"handleItemMouseLeave",function(){s.setState(function(){return{isTooltipActive:!1}})}),tn(e3(s),"handleMouseMove",function(e){e.persist(),s.throttleTriggeredAfterMouseMove(e)}),tn(e3(s),"handleMouseLeave",function(e){var t={isTooltipActive:!1};s.setState(t),s.triggerSyncEvent(t);var n=s.props.onMouseLeave;l()(n)&&n(t,e)}),tn(e3(s),"handleOuterEvent",function(e){var t,n=(0,_.Bh)(e),r=d()(s.props,"".concat(n));n&&l()(r)&&r(null!==(t=/.*touch.*/i.test(n)?s.getMouseInfo(e.changedTouches[0]):s.getMouseInfo(e))&&void 0!==t?t:{},e)}),tn(e3(s),"handleClick",function(e){var t=s.getMouseInfo(e);if(t){var n=tt(tt({},t),{},{isTooltipActive:!0});s.setState(n),s.triggerSyncEvent(n);var r=s.props.onClick;l()(r)&&r(n,e)}}),tn(e3(s),"handleMouseDown",function(e){var t=s.props.onMouseDown;l()(t)&&t(s.getMouseInfo(e),e)}),tn(e3(s),"handleMouseUp",function(e){var t=s.props.onMouseUp;l()(t)&&t(s.getMouseInfo(e),e)}),tn(e3(s),"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),tn(e3(s),"handleTouchStart",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseDown(e.changedTouches[0])}),tn(e3(s),"handleTouchEnd",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseUp(e.changedTouches[0])}),tn(e3(s),"triggerSyncEvent",function(e){void 0!==s.props.syncId&&eA.emit(eM,s.props.syncId,e,s.eventEmitterSymbol)}),tn(e3(s),"applySyncEvent",function(e){var t=s.props,n=t.layout,r=t.syncMethod,o=s.state.updateId,a=e.dataStartIndex,i=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)s.setState(tt({dataStartIndex:a,dataEndIndex:i},O({props:s.props,dataStartIndex:a,dataEndIndex:i,updateId:o},s.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,c=e.chartY,u=e.activeTooltipIndex,d=s.state,f=d.offset,p=d.tooltipTicks;if(!f)return;if("function"==typeof r)u=r(p,e);else if("value"===r){u=-1;for(var h=0;h<p.length;h++)if(p[h].value===e.activeLabel){u=h;break}}var m=tt(tt({},f),{},{x:f.left,y:f.top}),g=Math.min(l,m.x+m.width),v=Math.min(c,m.y+m.height),y=p[u]&&p[u].value,b=td(s.state,s.props.data,u),x=p[u]?{x:"horizontal"===n?p[u].coordinate:g,y:"horizontal"===n?v:p[u].coordinate}:ti;s.setState(tt(tt({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else s.setState(e)}),tn(e3(s),"renderCursor",function(e){var t,o=s.state,a=o.isTooltipActive,i=o.activeCoordinate,l=o.activePayload,c=o.offset,u=o.activeTooltipIndex,d=o.tooltipAxisBandSize,f=s.getTooltipEventType(),p=null!==(t=e.props.active)&&void 0!==t?t:a,h=s.props.layout,m=e.key||"_recharts-cursor";return r.createElement(eY,{key:m,activeCoordinate:i,activePayload:l,activeTooltipIndex:u,chartName:n,element:e,isActive:p,layout:h,offset:c,tooltipAxisBandSize:d,tooltipEventType:f})}),tn(e3(s),"renderPolarAxis",function(e,t,n){var o=d()(e,"type.axisType"),a=d()(s.state,"".concat(o,"Map")),i=a&&a[e.props["".concat(o,"Id")]];return(0,r.cloneElement)(e,tt(tt({},i),{},{className:o,key:e.key||"".concat(t,"-").concat(n),ticks:(0,T.uY)(i,!0)}))}),tn(e3(s),"renderGrid",function(e){var t=s.state,n=t.xAxisMap,o=t.yAxisMap,a=t.offset,i=(0,A.Kt)(n),l=v()(o,function(e){return b()(e.domain,Number.isFinite)})||(0,A.Kt)(o),c=e.props||{};return(0,r.cloneElement)(e,{key:e.key||"grid",x:(0,A.hj)(c.x)?c.x:a.left,y:(0,A.hj)(c.y)?c.y:a.top,width:(0,A.hj)(c.width)?c.width:a.width,height:(0,A.hj)(c.height)?c.height:a.height,xAxis:i,yAxis:l,verticalCoordinatesGenerator:c.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:c.horizontalCoordinatesGenerator})}),tn(e3(s),"renderPolarGrid",function(e){var t=e.props,n=t.radialLines,o=t.polarAngles,a=t.polarRadius,i=s.state,l=i.radiusAxisMap,c=i.angleAxisMap,u=(0,A.Kt)(l),d=(0,A.Kt)(c),f=d.cx,p=d.cy,h=d.innerRadius,m=d.outerRadius;return(0,r.cloneElement)(e,{polarAngles:Array.isArray(o)?o:(0,T.uY)(d,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:(0,T.uY)(u,!0).map(function(e){return e.coordinate}),cx:f,cy:p,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:n})}),tn(e3(s),"renderLegend",function(){var e=s.state.formattedGraphicalItems,t=s.props,n=t.children,o=t.width,a=t.height,i=s.props.margin||{},l=o-(i.left||0)-(i.right||0),c=(0,J.z)({children:n,formattedGraphicalItems:e,legendWidth:l,legendContent:p});if(!c)return null;var u=c.item,d=e6(c,eQ);return(0,r.cloneElement)(u,tt(tt({},d),{},{chartWidth:o,chartHeight:a,margin:i,onBBoxUpdate:s.handleLegendBBoxUpdate}))}),tn(e3(s),"renderTooltip",function(){var e,t=s.props.children,n=(0,_.sP)(t,E.u);if(!n)return null;var o=s.state,a=o.isTooltipActive,i=o.activeCoordinate,l=o.activePayload,c=o.activeLabel,u=o.offset,d=null!==(e=n.props.active)&&void 0!==e?e:a;return(0,r.cloneElement)(n,{viewBox:tt(tt({},u),{},{x:u.left,y:u.top}),active:d,label:c,payload:d?l:[],coordinate:i})}),tn(e3(s),"renderBrush",function(e){var t=s.props,n=t.margin,o=t.data,a=s.state,i=a.offset,l=a.dataStartIndex,c=a.dataEndIndex,u=a.updateId;return(0,r.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:(0,T.DO)(s.handleBrushChange,e.props.onChange),data:o,x:(0,A.hj)(e.props.x)?e.props.x:i.left,y:(0,A.hj)(e.props.y)?e.props.y:i.top+i.height+i.brushBottom-(n.bottom||0),width:(0,A.hj)(e.props.width)?e.props.width:i.width,startIndex:l,endIndex:c,updateId:"brush-".concat(u)})}),tn(e3(s),"renderReferenceElement",function(e,t,n){if(!e)return null;var o=e3(s).clipPathId,a=s.state,i=a.xAxisMap,l=a.yAxisMap,c=a.offset,u=e.props,d=u.xAxisId,f=u.yAxisId;return(0,r.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(n),xAxis:i[d],yAxis:l[f],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:o})}),tn(e3(s),"renderActivePoints",function(e){var t=e.item,n=e.activePoint,r=e.basePoint,o=e.childIndex,a=e.isRange,i=[],l=t.props.key,s=t.item.props,u=s.activeDot,d=tt(tt({index:o,dataKey:s.dataKey,cx:n.x,cy:n.y,r:4,fill:(0,T.fk)(t.item),strokeWidth:2,stroke:"#fff",payload:n.payload,value:n.value,key:"".concat(l,"-activePoint-").concat(o)},(0,_.L6)(u,!1)),(0,eI.Ym)(u));return i.push(c.renderActiveDot(u,d)),r?i.push(c.renderActiveDot(u,tt(tt({},d),{},{cx:r.x,cy:r.y,key:"".concat(l,"-basePoint-").concat(o)}))):a&&i.push(null),i}),tn(e3(s),"renderGraphicChild",function(e,t,n){var o=s.filterFormatItem(e,t,n);if(!o)return null;var i=s.getTooltipEventType(),l=s.state,c=l.isTooltipActive,u=l.tooltipAxis,d=l.activeTooltipIndex,f=l.activeLabel,p=s.props.children,h=(0,_.sP)(p,E.u),m=o.props,g=m.points,v=m.isRange,y=m.baseLine,b=o.item.props,x=b.activeDot,w=b.hide,k=b.activeBar,S=b.activeShape,O={};"axis"!==i&&h&&"click"===h.props.trigger?O={onClick:(0,T.DO)(s.handleItemMouseEnter,e.props.onClick)}:"axis"!==i&&(O={onMouseLeave:(0,T.DO)(s.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:(0,T.DO)(s.handleItemMouseEnter,e.props.onMouseEnter)});var C=(0,r.cloneElement)(e,tt(tt({},o.props),O));if(!w&&c&&h&&(x||k||S)){if(d>=0){if(u.dataKey&&!u.allowDuplicatedCategory){var j="function"==typeof u.dataKey?function(e){return"function"==typeof u.dataKey?u.dataKey(e.payload):null}:"payload.".concat(u.dataKey.toString());N=(0,A.Ap)(g,j,f),M=v&&y&&(0,A.Ap)(y,j,f)}else N=null==g?void 0:g[d],M=v&&y&&y[d];if(S||k){var P=void 0!==e.props.activeIndex?e.props.activeIndex:d;return[(0,r.cloneElement)(e,tt(tt(tt({},o.props),O),{},{activeIndex:P})),null,null]}if(!a()(N))return[C].concat(e8(s.renderActivePoints({item:o,activePoint:N,basePoint:M,childIndex:d,isRange:v})))}else{var N,M,I,R=(null!==(I=s.getItemByXY(s.state.activeCoordinate))&&void 0!==I?I:{graphicalItem:C}).graphicalItem,D=R.item,L=void 0===D?e:D,Z=R.childIndex,z=tt(tt(tt({},o.props),O),{},{activeIndex:Z});return[(0,r.cloneElement)(L,z),null,null]}}return v?[C,null,null]:[C,null]}),tn(e3(s),"renderCustomized",function(e,t,n){return(0,r.cloneElement)(e,tt(tt({key:"recharts-customized-".concat(n)},s.props),s.state))}),tn(e3(s),"renderMap",{CartesianGrid:{handler:s.renderGrid,once:!0},ReferenceArea:{handler:s.renderReferenceElement},ReferenceLine:{handler:tl},ReferenceDot:{handler:s.renderReferenceElement},XAxis:{handler:tl},YAxis:{handler:tl},Brush:{handler:s.renderBrush,once:!0},Bar:{handler:s.renderGraphicChild},Line:{handler:s.renderGraphicChild},Area:{handler:s.renderGraphicChild},Radar:{handler:s.renderGraphicChild},RadialBar:{handler:s.renderGraphicChild},Scatter:{handler:s.renderGraphicChild},Pie:{handler:s.renderGraphicChild},Funnel:{handler:s.renderGraphicChild},Tooltip:{handler:s.renderCursor,once:!0},PolarGrid:{handler:s.renderPolarGrid,once:!0},PolarAngleAxis:{handler:s.renderPolarAxis},PolarRadiusAxis:{handler:s.renderPolarAxis},Customized:{handler:s.renderCustomized}}),s.clipPathId="".concat(null!==(t=e.id)&&void 0!==t?t:(0,A.EL)("recharts"),"-clip"),s.throttleTriggeredAfterMouseMove=m()(s.triggeredAfterMouseMove,null!==(o=e.throttleDelay)&&void 0!==o?o:1e3/60),s.state={},s}return o=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,o=e.layout,a=(0,_.sP)(t,E.u);if(a){var i=a.props.defaultIndex;if("number"==typeof i&&!(i<0)&&!(i>this.state.tooltipTicks.length)){var l=this.state.tooltipTicks[i]&&this.state.tooltipTicks[i].value,s=td(this.state,n,i,l),c=this.state.tooltipTicks[i].coordinate,u=(this.state.offset.top+r)/2,d="horizontal"===o?{x:c,y:u}:{y:c,x:u},f=this.state.formattedGraphicalItems.find(function(e){return"Scatter"===e.item.type.name});f&&(d=tt(tt({},d),f.props.points[i].tooltipPosition),s=f.props.points[i].tooltipPayload);var p={activeTooltipIndex:i,isTooltipActive:!0,activeLabel:l,activePayload:s,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(i)}}}},{key:"getSnapshotBeforeUpdate",value:function(e,t){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin){var n,r;this.accessibilityManager.setDetails({offset:{left:null!==(n=this.props.margin.left)&&void 0!==n?n:0,top:null!==(r=this.props.margin.top)&&void 0!==r?r:0}})}return null}},{key:"componentDidUpdate",value:function(e){(0,_.rL)([(0,_.sP)(e.children,E.u)],[(0,_.sP)(this.props.children,E.u)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=(0,_.sP)(this.props.children,E.u);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return u.indexOf(t)>=0?t:s}return s}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=(0,Q.os)(n),o={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,i=this.inRange(o.chartX,o.chartY,a);if(!i)return null;var l=this.state,s=l.xAxisMap,c=l.yAxisMap;if("axis"!==this.getTooltipEventType()&&s&&c){var u=(0,A.Kt)(s).scale,d=(0,A.Kt)(c).scale,f=u&&u.invert?u.invert(o.chartX):null,p=d&&d.invert?d.invert(o.chartY):null;return tt(tt({},o),{},{xValue:f,yValue:p})}var h=tf(this.state,this.props.data,this.props.layout,i);return h?tt(tt({},o),h):null}},{key:"inRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.props.layout,o=e/n,a=t/n;if("horizontal"===r||"vertical"===r){var i=this.state.offset;return o>=i.left&&o<=i.left+i.width&&a>=i.top&&a<=i.top+i.height?{x:o,y:a}:null}var l=this.state,s=l.angleAxisMap,c=l.radiusAxisMap;if(s&&c){var u=(0,A.Kt)(s);return(0,eP.z3)({x:o,y:a},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=(0,_.sP)(e,E.u),r={};return n&&"axis"===t&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),tt(tt({},(0,eI.Ym)(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){eA.on(eM,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eA.removeListener(eM,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,o=0,a=r.length;o<a;o++){var i=r[o];if(i.item===e||i.props.key===e.key||t===(0,_.Gf)(i.item.type)&&n===i.childIndex)return i}return null}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,o=t.top,a=t.height,i=t.width;return r.createElement("defs",null,r.createElement("clipPath",{id:e},r.createElement("rect",{x:n,y:o,height:a,width:i})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e2(t,2),r=n[0],o=n[1];return tt(tt({},e),{},tn({},r,o.scale))},{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=e2(t,2),r=n[0],o=n[1];return tt(tt({},e),{},tn({},r,o.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var o=0,a=n.length;o<a;o++){var i=n[o],l=i.props,s=i.item,c=(0,_.Gf)(s.type);if("Bar"===c){var u=(l.data||[]).find(function(t){return(0,j.X)(e,t)});if(u)return{graphicalItem:i,payload:u}}else if("RadialBar"===c){var d=(l.data||[]).find(function(t){return(0,eP.z3)(e,t)});if(d)return{graphicalItem:i,payload:d}}else if((0,ez.lT)(i,r)||(0,ez.V$)(i,r)||(0,ez.w7)(i,r)){var f=(0,ez.a3)({graphicalItem:i,activeTooltipItem:r,itemData:s.props.data}),p=void 0===s.props.activeIndex?f:s.props.activeIndex;return{graphicalItem:tt(tt({},i),{},{childIndex:p}),payload:(0,ez.w7)(i,r)?s.props.data[f]:i.props.data[f]}}}return null}},{key:"render",value:function(){var e,t,n=this;if(!(0,_.TT)(this))return null;var o=this.props,a=o.children,i=o.className,l=o.width,s=o.height,c=o.style,u=o.compact,d=o.title,f=o.desc,p=e6(o,eJ),h=(0,_.L6)(p,!1);if(u)return r.createElement(k.T,e1({},h,{width:l,height:s,title:d,desc:f}),this.renderClipPath(),(0,_.eu)(a,this.renderMap));this.props.accessibilityLayer&&(h.tabIndex=null!==(e=this.props.tabIndex)&&void 0!==e?e:0,h.role=null!==(t=this.props.role)&&void 0!==t?t:"img",h.onKeyDown=function(e){n.accessibilityManager.keyboardEvent(e)},h.onFocus=function(){n.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return r.createElement(ef.br,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},r.createElement("div",e1({className:(0,x.Z)("recharts-wrapper",i),style:tt({position:"relative",cursor:"default",width:l,height:s},c)},m,{ref:function(e){n.container=e},role:"region"}),r.createElement(k.T,e1({},h,{width:l,height:s,title:d,desc:f,style:ta}),this.renderClipPath(),(0,_.eu)(a,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tr(r.key),r)}}(c.prototype,o),Object.defineProperty(c,"prototype",{writable:!1}),c}(r.Component),tn(t,"displayName",n),tn(t,"defaultProps",tt({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},g)),tn(t,"getDerivedStateFromProps",function(e,t){var n=e.dataKey,r=e.data,o=e.children,i=e.width,l=e.height,s=e.layout,c=e.stackOffset,u=e.margin,d=t.dataStartIndex,f=t.dataEndIndex;if(void 0===t.updateId){var p=tv(e);return tt(tt(tt({},p),{},{updateId:0},O(tt(tt({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:i,prevHeight:l,prevLayout:s,prevStackOffset:c,prevMargin:u,prevChildren:o})}if(n!==t.prevDataKey||r!==t.prevData||i!==t.prevWidth||l!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!(0,eN.w)(u,t.prevMargin)){var h=tv(e),m={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=tt(tt({},tf(t,r,s)),{},{updateId:t.updateId+1}),v=tt(tt(tt({},h),m),g);return tt(tt(tt({},v),O(tt({props:e},v),t)),{},{prevDataKey:n,prevData:r,prevWidth:i,prevHeight:l,prevLayout:s,prevStackOffset:c,prevMargin:u,prevChildren:o})}if(!(0,_.rL)(o,t.prevChildren)){var y,b,x,w,k=(0,_.sP)(o,Y),S=k&&null!==(y=null===(b=k.props)||void 0===b?void 0:b.startIndex)&&void 0!==y?y:d,E=k&&null!==(x=null===(w=k.props)||void 0===w?void 0:w.endIndex)&&void 0!==x?x:f,C=a()(r)||S!==d||E!==f?t.updateId+1:t.updateId;return tt(tt({updateId:C},O(tt(tt({props:e},t),{},{updateId:C,dataStartIndex:S,dataEndIndex:E}),t)),{},{prevChildren:o,dataStartIndex:S,dataEndIndex:E})}return null}),tn(t,"renderActiveDot",function(e,t){var n;return n=(0,r.isValidElement)(e)?(0,r.cloneElement)(e,t):l()(e)?e(t):r.createElement(C.o,t),r.createElement(S.m,{className:"recharts-active-dot",key:t.key},n)}),t}},20407:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});var r=function(e){return null};r.displayName="Cell"},26680:function(e,t,n){"use strict";n.d(t,{_:function(){return O}});var r=n(2265),o=n(77571),a=n.n(o),i=n(86757),l=n.n(i),s=n(28302),c=n.n(s),u=n(87602),d=n(58811),f=n(82944),p=n(16630),h=n(39206);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var g=["offset"];function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==m(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var w=function(e){var t=e.value,n=e.formatter,r=a()(e.children)?t:e.children;return l()(n)?n(r):r},k=function(e,t,n){var o,i,l=e.position,s=e.viewBox,c=e.offset,d=e.className,f=s.cx,m=s.cy,g=s.innerRadius,v=s.outerRadius,y=s.startAngle,b=s.endAngle,w=s.clockWise,k=(g+v)/2,S=(0,p.uY)(b-y)*Math.min(Math.abs(b-y),360),E=S>=0?1:-1;"insideStart"===l?(o=y+E*c,i=w):"insideEnd"===l?(o=b-E*c,i=!w):"end"===l&&(o=b+E*c,i=w),i=S<=0?i:!i;var O=(0,h.op)(f,m,k,o),C=(0,h.op)(f,m,k,o+(i?1:-1)*359),j="M".concat(O.x,",").concat(O.y,"\n A").concat(k,",").concat(k,",0,1,").concat(i?0:1,",\n ").concat(C.x,",").concat(C.y),_=a()(e.id)?(0,p.EL)("recharts-radial-line-"):e.id;return r.createElement("text",x({},n,{dominantBaseline:"central",className:(0,u.Z)("recharts-radial-bar-label",d)}),r.createElement("defs",null,r.createElement("path",{id:_,d:j})),r.createElement("textPath",{xlinkHref:"#".concat(_)},t))},S=function(e){var t=e.viewBox,n=e.offset,r=e.position,o=t.cx,a=t.cy,i=t.innerRadius,l=t.outerRadius,s=(t.startAngle+t.endAngle)/2;if("outside"===r){var c=(0,h.op)(o,a,l+n,s),u=c.x;return{x:u,y:c.y,textAnchor:u>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var d=(0,h.op)(o,a,(i+l)/2,s);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}},E=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,o=e.position,a=t.x,i=t.y,l=t.width,s=t.height,u=s>=0?1:-1,d=u*r,f=u>0?"end":"start",h=u>0?"start":"end",m=l>=0?1:-1,g=m*r,v=m>0?"end":"start",y=m>0?"start":"end";if("top"===o)return b(b({},{x:a+l/2,y:i-u*r,textAnchor:"middle",verticalAnchor:f}),n?{height:Math.max(i-n.y,0),width:l}:{});if("bottom"===o)return b(b({},{x:a+l/2,y:i+s+d,textAnchor:"middle",verticalAnchor:h}),n?{height:Math.max(n.y+n.height-(i+s),0),width:l}:{});if("left"===o){var x={x:a-g,y:i+s/2,textAnchor:v,verticalAnchor:"middle"};return b(b({},x),n?{width:Math.max(x.x-n.x,0),height:s}:{})}if("right"===o){var w={x:a+l+g,y:i+s/2,textAnchor:y,verticalAnchor:"middle"};return b(b({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:s}:{})}var k=n?{width:l,height:s}:{};return"insideLeft"===o?b({x:a+g,y:i+s/2,textAnchor:y,verticalAnchor:"middle"},k):"insideRight"===o?b({x:a+l-g,y:i+s/2,textAnchor:v,verticalAnchor:"middle"},k):"insideTop"===o?b({x:a+l/2,y:i+d,textAnchor:"middle",verticalAnchor:h},k):"insideBottom"===o?b({x:a+l/2,y:i+s-d,textAnchor:"middle",verticalAnchor:f},k):"insideTopLeft"===o?b({x:a+g,y:i+d,textAnchor:y,verticalAnchor:h},k):"insideTopRight"===o?b({x:a+l-g,y:i+d,textAnchor:v,verticalAnchor:h},k):"insideBottomLeft"===o?b({x:a+g,y:i+s-d,textAnchor:y,verticalAnchor:f},k):"insideBottomRight"===o?b({x:a+l-g,y:i+s-d,textAnchor:v,verticalAnchor:f},k):c()(o)&&((0,p.hj)(o.x)||(0,p.hU)(o.x))&&((0,p.hj)(o.y)||(0,p.hU)(o.y))?b({x:a+(0,p.h1)(o.x,l),y:i+(0,p.h1)(o.y,s),textAnchor:"end",verticalAnchor:"end"},k):b({x:a+l/2,y:i+s/2,textAnchor:"middle",verticalAnchor:"middle"},k)};function O(e){var t,n=e.offset,o=b({offset:void 0===n?5:n},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,g)),i=o.viewBox,s=o.position,c=o.value,h=o.children,m=o.content,v=o.className,y=o.textBreakAll;if(!i||a()(c)&&a()(h)&&!(0,r.isValidElement)(m)&&!l()(m))return null;if((0,r.isValidElement)(m))return(0,r.cloneElement)(m,o);if(l()(m)){if(t=(0,r.createElement)(m,o),(0,r.isValidElement)(t))return t}else t=w(o);var O="cx"in i&&(0,p.hj)(i.cx),C=(0,f.L6)(o,!0);if(O&&("insideStart"===s||"insideEnd"===s||"end"===s))return k(o,t,C);var j=O?S(o):E(o);return r.createElement(d.x,x({className:(0,u.Z)("recharts-label",void 0===v?"":v)},C,j,{breakAll:y}),t)}O.displayName="Label";var C=function(e){var t=e.cx,n=e.cy,r=e.angle,o=e.startAngle,a=e.endAngle,i=e.r,l=e.radius,s=e.innerRadius,c=e.outerRadius,u=e.x,d=e.y,f=e.top,h=e.left,m=e.width,g=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if((0,p.hj)(m)&&(0,p.hj)(g)){if((0,p.hj)(u)&&(0,p.hj)(d))return{x:u,y:d,width:m,height:g};if((0,p.hj)(f)&&(0,p.hj)(h))return{x:f,y:h,width:m,height:g}}return(0,p.hj)(u)&&(0,p.hj)(d)?{x:u,y:d,width:0,height:0}:(0,p.hj)(t)&&(0,p.hj)(n)?{cx:t,cy:n,startAngle:o||r||0,endAngle:a||r||0,innerRadius:s||0,outerRadius:c||l||i||0,clockWise:v}:e.viewBox?e.viewBox:{}};O.parseViewBox=C,O.renderCallByParent=function(e,t){var n,o,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&a&&!e.label)return null;var i=e.children,s=C(e),u=(0,f.NN)(i,O).map(function(e,n){return(0,r.cloneElement)(e,{viewBox:t||s,key:"label-".concat(n)})});return a?[(n=e.label,o=t||s,n?!0===n?r.createElement(O,{key:"label-implicit",viewBox:o}):(0,p.P2)(n)?r.createElement(O,{key:"label-implicit",viewBox:o,value:n}):(0,r.isValidElement)(n)?n.type===O?(0,r.cloneElement)(n,{key:"label-implicit",viewBox:o}):r.createElement(O,{key:"label-implicit",content:n,viewBox:o}):l()(n)?r.createElement(O,{key:"label-implicit",content:n,viewBox:o}):c()(n)?r.createElement(O,x({viewBox:o},n,{key:"label-implicit"})):null:null)].concat(function(e){if(Array.isArray(e))return v(e)}(u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e,t){if(e){if("string"==typeof e)return v(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,void 0)}}(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):u}},58772:function(e,t,n){"use strict";n.d(t,{e:function(){return O}});var r=n(2265),o=n(77571),a=n.n(o),i=n(28302),l=n.n(i),s=n(86757),c=n.n(s),u=n(86185),d=n.n(u),f=n(26680),p=n(9841),h=n(82944),m=n(85355);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var v=["valueAccessor"],y=["data","dataKey","clockWise","id","textBreakAll"];function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var E=function(e){return Array.isArray(e.value)?d()(e.value):e.value};function O(e){var t=e.valueAccessor,n=void 0===t?E:t,o=S(e,v),i=o.data,l=o.dataKey,s=o.clockWise,c=o.id,u=o.textBreakAll,d=S(o,y);return i&&i.length?r.createElement(p.m,{className:"recharts-label-list"},i.map(function(e,t){var o=a()(l)?n(e,t):(0,m.F$)(e&&e.payload,l),i=a()(c)?{}:{id:"".concat(c,"-").concat(t)};return r.createElement(f._,x({},(0,h.L6)(e,!0),d,i,{parentViewBox:e.parentViewBox,value:o,textBreakAll:u,viewBox:f._.parseViewBox(a()(s)?e:k(k({},e),{},{clockWise:s})),key:"label-".concat(t),index:t}))})):null}O.displayName="LabelList",O.renderCallByParent=function(e,t){var n,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!e||!e.children&&o&&!e.label)return null;var a=e.children,i=(0,h.NN)(a,O).map(function(e,n){return(0,r.cloneElement)(e,{data:t,key:"labelList-".concat(n)})});return o?[(n=e.label)?!0===n?r.createElement(O,{key:"labelList-implicit",data:t}):r.isValidElement(n)||c()(n)?r.createElement(O,{key:"labelList-implicit",data:t,content:n}):l()(n)?r.createElement(O,x({data:t},n,{key:"labelList-implicit"})):null:null].concat(function(e){if(Array.isArray(e))return b(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return b(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,void 0)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):i}},22190:function(e,t,n){"use strict";n.d(t,{D:function(){return A}});var r=n(2265),o=n(86757),a=n.n(o),i=n(87602),l=n(1175),s=n(48777),c=n(14870),u=n(41637);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(){return(f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(y,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=m(y);return e=t?Reflect.construct(n,arguments,m(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function y(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,y),o.apply(this,arguments)}return n=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,n=32/6,o=32/3,a=e.inactive?t:e.color;if("plainline"===e.type)return r.createElement("line",{strokeWidth:4,fill:"none",stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:16,x2:32,y2:16,className:"recharts-legend-icon"});if("line"===e.type)return r.createElement("path",{strokeWidth:4,fill:"none",stroke:a,d:"M0,".concat(16,"h").concat(o,"\n A").concat(n,",").concat(n,",0,1,1,").concat(2*o,",").concat(16,"\n H").concat(32,"M").concat(2*o,",").concat(16,"\n A").concat(n,",").concat(n,",0,1,1,").concat(o,",").concat(16),className:"recharts-legend-icon"});if("rect"===e.type)return r.createElement("path",{stroke:"none",fill:a,d:"M0,".concat(4,"h").concat(32,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(r.isValidElement(e.legendIcon)){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);return delete i.legendIcon,r.cloneElement(e.legendIcon,i)}return r.createElement(c.v,{fill:a,cx:16,cy:16,size:32,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,n=t.payload,o=t.iconSize,c=t.layout,d=t.formatter,p=t.inactiveColor,h={x:0,y:0,width:32,height:32},m={display:"horizontal"===c?"inline-block":"block",marginRight:10},v={display:"inline-block",verticalAlign:"middle",marginRight:4};return n.map(function(t,n){var c,y=t.formatter||d,b=(0,i.Z)((g(c={"recharts-legend-item":!0},"legend-item-".concat(n),!0),g(c,"inactive",t.inactive),c));if("none"===t.type)return null;var x=a()(t.value)?null:t.value;(0,l.Z)(!a()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var w=t.inactive?p:t.color;return r.createElement("li",f({className:b,style:m,key:"legend-item-".concat(n)},(0,u.bw)(e.props,t,n)),r.createElement(s.T,{width:o,height:o,viewBox:h,style:v},e.renderIcon(t)),r.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},y?y(x,t,n):x))})}},{key:"render",value:function(){var e=this.props,t=e.payload,n=e.layout,o=e.align;return t&&t.length?r.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===n?o:"left"}},this.renderItems()):null}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}(y.prototype,n),Object.defineProperty(y,"prototype",{writable:!1}),y}(r.PureComponent);g(y,"displayName","Legend"),g(y,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var b=n(16630),x=n(93528);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k=["ref"];function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,N(r.key),r)}}function C(e,t){return(C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){var t=function(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===w(t)?t:String(t)}function T(e){return e.value}var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(i,e);var t,n,o,a=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=_(i);return e=t?Reflect.construct(n,arguments,_(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return j(e)}(this,e)});function i(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return P(j(e=a.call.apply(a,[this].concat(n))),"lastBoundingBox",{width:-1,height:-1}),e}return n=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){return this.wrapperNode&&this.wrapperNode.getBoundingClientRect?this.wrapperNode.getBoundingClientRect():null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var t=this.wrapperNode.getBoundingClientRect();(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t))}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?E({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,n,r=this.props,o=r.layout,a=r.align,i=r.verticalAlign,l=r.margin,s=r.chartWidth,c=r.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===a&&"vertical"===o?{left:((s||0)-this.getBBoxSnapshot().width)/2}:"right"===a?{right:l&&l.right||0}:{left:l&&l.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(n="middle"===i?{top:((c||0)-this.getBBoxSnapshot().height)/2}:"bottom"===i?{bottom:l&&l.bottom||0}:{top:l&&l.top||0}),E(E({},t),n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.content,o=t.width,a=t.height,i=t.wrapperStyle,l=t.payloadUniqBy,s=t.payload,c=E(E({position:"absolute",width:o||"auto",height:a||"auto"},this.getDefaultPosition(i)),i);return r.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(t){e.wrapperNode=t}},function(e,t){if(r.isValidElement(e))return r.cloneElement(e,t);if("function"==typeof e)return r.createElement(e,t);t.ref;var n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,k);return r.createElement(y,n)}(n,E(E({},this.props),{},{payload:(0,x.z)(s,l,T)})))}}],o=[{key:"getWithHeight",value:function(e,t){var n=e.props.layout;return"vertical"===n&&(0,b.hj)(e.props.height)?{height:e.props.height}:"horizontal"===n?{width:e.props.width||t}:null}}],n&&O(i.prototype,n),o&&O(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}(r.PureComponent);P(A,"displayName","Legend"),P(A,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"})},47625:function(e,t,n){"use strict";n.d(t,{h:function(){return m}});var r=n(87602),o=n(2265),a=n(37065),i=n.n(a),l=n(82558),s=n(16630),c=n(1175),u=n(82944);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m=(0,o.forwardRef)(function(e,t){var n,a=e.aspect,d=e.initialDimension,f=void 0===d?{width:-1,height:-1}:d,m=e.width,g=void 0===m?"100%":m,v=e.height,y=void 0===v?"100%":v,b=e.minWidth,x=void 0===b?0:b,w=e.minHeight,k=e.maxHeight,S=e.children,E=e.debounce,O=void 0===E?0:E,C=e.id,j=e.className,_=e.onResize,P=e.style,N=(0,o.useRef)(null),T=(0,o.useRef)();T.current=_,(0,o.useImperativeHandle)(t,function(){return Object.assign(N.current,{get current(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current}})});var A=function(e){if(Array.isArray(e))return e}(n=(0,o.useState)({containerWidth:f.width,containerHeight:f.height}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(n,2)||function(e,t){if(e){if("string"==typeof e)return h(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,2)}}(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),M=A[0],I=A[1],R=(0,o.useCallback)(function(e,t){I(function(n){var r=Math.round(e),o=Math.round(t);return n.containerWidth===r&&n.containerHeight===o?n:{containerWidth:r,containerHeight:o}})},[]);(0,o.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,o=n.height;R(r,o),null===(t=T.current)||void 0===t||t.call(T,r,o)};O>0&&(e=i()(e,O,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=N.current.getBoundingClientRect();return R(n.width,n.height),t.observe(N.current),function(){t.disconnect()}},[R,O]);var D=(0,o.useMemo)(function(){var e=M.containerWidth,t=M.containerHeight;if(e<0||t<0)return null;(0,c.Z)((0,s.hU)(g)||(0,s.hU)(y),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",g,y),(0,c.Z)(!a||a>0,"The aspect(%s) must be greater than zero.",a);var n=(0,s.hU)(g)?e:g,r=(0,s.hU)(y)?t:y;a&&a>0&&(n?r=n/a:r&&(n=r*a),k&&r>k&&(r=k)),(0,c.Z)(n>0||r>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",n,r,g,y,x,w,a);var i=!Array.isArray(S)&&(0,l.isElement)(S)&&(0,u.Gf)(S.type).endsWith("Chart");return o.Children.map(S,function(e){return(0,l.isElement)(e)?(0,o.cloneElement)(e,p({width:n,height:r},i?{style:p({height:"100%",width:"100%",maxHeight:r,maxWidth:n},e.props.style)}:{})):e})},[a,S,y,k,w,x,M,g]);return o.createElement("div",{id:C?"".concat(C):void 0,className:(0,r.Z)("recharts-responsive-container",j),style:p(p({},void 0===P?{}:P),{},{width:g,height:y,minWidth:x,minHeight:w,maxHeight:k}),ref:N},D)})},58811:function(e,t,n){"use strict";n.d(t,{x:function(){return L}});var r=n(2265),o=n(77571),a=n.n(o),i=n(87602),l=n(16630),s=n(34067),c=n(82944),u=n(4094);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}(r.key),r)}}var m=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,g=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,v=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,y=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,b={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},x=Object.keys(b),w=function(){var e,t;function n(e,t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this.num=e,this.unit=t,this.num=e,this.unit=t,Number.isNaN(e)&&(this.unit=""),""===t||v.test(t)||(this.num=NaN,this.unit=""),x.includes(t)&&(this.num=e*b[t],this.unit="px")}return e=[{key:"add",value:function(e){return this.unit!==e.unit?new n(NaN,""):new n(this.num+e.num,this.unit)}},{key:"subtract",value:function(e){return this.unit!==e.unit?new n(NaN,""):new n(this.num-e.num,this.unit)}},{key:"multiply",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(NaN,""):new n(this.num*e.num,this.unit||e.unit)}},{key:"divide",value:function(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new n(NaN,""):new n(this.num/e.num,this.unit||e.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],t=[{key:"parse",value:function(e){var t,r=f(null!==(t=y.exec(e))&&void 0!==t?t:[],3),o=r[1],a=r[2];return new n(parseFloat(o),null!=a?a:"")}}],e&&h(n.prototype,e),t&&h(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();function k(e){if(e.includes("NaN"))return"NaN";for(var t=e;t.includes("*")||t.includes("/");){var n,r=f(null!==(n=m.exec(t))&&void 0!==n?n:[],4),o=r[1],a=r[2],i=r[3],l=w.parse(null!=o?o:""),s=w.parse(null!=i?i:""),c="*"===a?l.multiply(s):l.divide(s);if(c.isNaN())return"NaN";t=t.replace(m,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,d=f(null!==(u=g.exec(t))&&void 0!==u?u:[],4),p=d[1],h=d[2],v=d[3],y=w.parse(null!=p?p:""),b=w.parse(null!=v?v:""),x="+"===h?y.add(b):y.subtract(b);if(x.isNaN())return"NaN";t=t.replace(g,x.toString())}return t}var S=/\(([^()]*)\)/;function E(e){var t=function(e){try{var t;return t=e.replace(/\s+/g,""),t=function(e){for(var t=e;t.includes("(");){var n=f(S.exec(t),2)[1];t=t.replace(S,k(n))}return t}(t),t=k(t)}catch(e){return"NaN"}}(e.slice(5,-1));return"NaN"===t?"":t}var O=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],C=["dx","dy","angle","className","breakAll"];function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var T=/[ \f\n\r\t\v\u2028\u2029]+/,A=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var o=[];a()(t)||(o=n?t.toString().split(""):t.toString().split(T));var i=o.map(function(e){return{word:e,width:(0,u.xE)(e,r).width}}),l=n?0:(0,u.xE)("\xa0",r).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch(e){return null}},M=function(e,t,n,r,o){var a,i=e.maxLines,s=e.children,c=e.style,u=e.breakAll,d=(0,l.hj)(i),f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(function(e,t){var a=t.word,i=t.width,l=e[e.length-1];return l&&(null==r||o||l.width+i+n<Number(r))?(l.words.push(a),l.width+=i+n):e.push({words:[a],width:i}),e},[])},p=f(t);if(!d)return p;for(var h=function(e){var t=f(A({breakAll:u,style:c,children:s.slice(0,e)+"…"}).wordsWithComputedWidth);return[t.length>i||t.reduce(function(e,t){return e.width>t.width?e:t}).width>Number(r),t]},m=0,g=s.length-1,v=0;m<=g&&v<=s.length-1;){var y=Math.floor((m+g)/2),b=P(h(y-1),2),x=b[0],w=b[1],k=P(h(y),1)[0];if(x||k||(m=y+1),x&&k&&(g=y-1),!x&&k){a=w;break}v++}return a||p},I=function(e){return[{words:a()(e)?[]:e.toString().split(T)}]},R=function(e){var t=e.width,n=e.scaleToFit,r=e.children,o=e.style,a=e.breakAll,i=e.maxLines;if((t||n)&&!s.x.isSsr){var l=A({breakAll:a,children:r,style:o});return l?M({breakAll:a,children:r,maxLines:i,style:o},l.wordsWithComputedWidth,l.spaceWidth,t,n):I(r)}return I(r)},D="#808080",L=function(e){var t,n=e.x,o=void 0===n?0:n,a=e.y,s=void 0===a?0:a,u=e.lineHeight,d=void 0===u?"1em":u,f=e.capHeight,p=void 0===f?"0.71em":f,h=e.scaleToFit,m=void 0!==h&&h,g=e.textAnchor,v=e.verticalAnchor,y=e.fill,b=void 0===y?D:y,x=_(e,O),w=(0,r.useMemo)(function(){return R({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:m,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,m,x.style,x.width]),k=x.dx,S=x.dy,P=x.angle,N=x.className,T=x.breakAll,A=_(x,C);if(!(0,l.P2)(o)||!(0,l.P2)(s))return null;var M=o+((0,l.hj)(k)?k:0),I=s+((0,l.hj)(S)?S:0);switch(void 0===v?"end":v){case"start":t=E("calc(".concat(p,")"));break;case"middle":t=E("calc(".concat((w.length-1)/2," * -").concat(d," + (").concat(p," / 2))"));break;default:t=E("calc(".concat(w.length-1," * -").concat(d,")"))}var L=[];if(m){var Z=w[0].width,z=x.width;L.push("scale(".concat(((0,l.hj)(z)?z/Z:1)/Z,")"))}return P&&L.push("rotate(".concat(P,", ").concat(M,", ").concat(I,")")),L.length&&(A.transform=L.join(" ")),r.createElement("text",j({},(0,c.L6)(A,!0),{x:M,y:I,className:(0,i.Z)("recharts-text",N),textAnchor:void 0===g?"start":g,fill:b.includes("url")?D:b}),w.map(function(e,n){var o=e.words.join(T?"":" ");return r.createElement("tspan",{x:M,dy:0===n?t:d,key:o},o)}))}},8147:function(e,t,n){"use strict";n.d(t,{u:function(){return F}});var r=n(2265),o=n(34935),a=n.n(o),i=n(77571),l=n.n(i),s=n(87602),c=n(16630);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==u(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===u(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e){return Array.isArray(e)&&(0,c.P2)(e[0])&&(0,c.P2)(e[1])?e.join(" ~ "):e}var m=function(e){var t=e.separator,n=void 0===t?" : ":t,o=e.contentStyle,i=e.itemStyle,u=void 0===i?{}:i,f=e.labelStyle,m=e.payload,g=e.formatter,v=e.itemSorter,y=e.wrapperClassName,b=e.labelClassName,x=e.label,w=e.labelFormatter,k=p({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},void 0===o?{}:o),S=p({margin:0},void 0===f?{}:f),E=!l()(x),O=E?x:"",C=(0,s.Z)("recharts-default-tooltip",y),j=(0,s.Z)("recharts-tooltip-label",b);return E&&w&&null!=m&&(O=w(x,m)),r.createElement("div",{className:C,style:k},r.createElement("p",{className:j,style:S},r.isValidElement(O)?O:"".concat(O)),function(){if(m&&m.length){var e=(v?a()(m,v):m).map(function(e,t){if("none"===e.type)return null;var o=p({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},u),a=e.formatter||g||h,i=e.value,l=e.name,s=i,f=l;if(a&&null!=s&&null!=f){var v=a(i,l,e,t,m);if(Array.isArray(v)){var y=function(e){if(Array.isArray(e))return e}(v)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(v,2)||function(e,t){if(e){if("string"==typeof e)return d(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,2)}}(v,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s=y[0],f=y[1]}else s=v}return r.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:o},(0,c.P2)(f)?r.createElement("span",{className:"recharts-tooltip-item-name"},f):null,(0,c.P2)(f)?r.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,r.createElement("span",{className:"recharts-tooltip-item-value"},s),r.createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))});return r.createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())},g=n(59221);function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t,n){var r;return(r=function(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==v(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===v(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b="recharts-tooltip-wrapper",x={visibility:"hidden"};function w(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,o=e.offsetTopLeft,a=e.position,i=e.reverseDirection,l=e.tooltipDimension,s=e.viewBox,u=e.viewBoxDimension;if(a&&(0,c.hj)(a[r]))return a[r];var d=n[r]-l-o,f=n[r]+o;return t[r]?i[r]?d:f:i[r]?d<s[r]?Math.max(f,s[r]):Math.max(d,s[r]):f+l>s[r]+u?Math.max(d,s[r]):Math.max(f,s[r])}function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function O(e,t){return(O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function C(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==k(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===k(t)?t:String(t)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=j(a);return e=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return C(e)}(this,e)});function a(){var e;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a);for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return _(C(e=o.call.apply(o,[this].concat(n))),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),_(C(e),"lastBoundingBox",{width:-1,height:-1}),_(C(e),"handleKeyDown",function(t){if("Escape"===t.key){var n,r,o,a;e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(n=null===(r=e.props.coordinate)||void 0===r?void 0:r.x)&&void 0!==n?n:0,y:null!==(o=null===(a=e.props.coordinate)||void 0===a?void 0:a.y)&&void 0!==o?o:0}})}}),e}return n=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.lastBoundingBox.width)>1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height)}else(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)!==this.state.dismissedAtCoordinate.x||(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var e,t,n,o,a,i,l,u,d,f,p,h,m,v,k,S,O,C,j,_,P,N=this,T=this.props,A=T.active,M=T.allowEscapeViewBox,I=T.animationDuration,R=T.animationEasing,D=T.children,L=T.coordinate,Z=T.hasPayload,z=T.isAnimationActive,B=T.offset,F=T.position,H=T.reverseDirection,q=T.useTranslate3d,W=T.viewBox,U=T.wrapperStyle,K=(v=(e={allowEscapeViewBox:M,coordinate:L,offsetTopLeft:B,position:F,reverseDirection:H,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:q,viewBox:W}).allowEscapeViewBox,k=e.coordinate,S=e.offsetTopLeft,O=e.position,C=e.reverseDirection,j=e.tooltipBox,_=e.useTranslate3d,P=e.viewBox,j.height>0&&j.width>0&&k?(n=(t={translateX:h=w({allowEscapeViewBox:v,coordinate:k,key:"x",offsetTopLeft:S,position:O,reverseDirection:C,tooltipDimension:j.width,viewBox:P,viewBoxDimension:P.width}),translateY:m=w({allowEscapeViewBox:v,coordinate:k,key:"y",offsetTopLeft:S,position:O,reverseDirection:C,tooltipDimension:j.height,viewBox:P,viewBoxDimension:P.height}),useTranslate3d:_}).translateX,o=t.translateY,a=t.useTranslate3d,p=(0,g.bO)({transform:a?"translate3d(".concat(n,"px, ").concat(o,"px, 0)"):"translate(".concat(n,"px, ").concat(o,"px)")})):p=x,{cssProperties:p,cssClasses:(u=(i={translateX:h,translateY:m,coordinate:k}).coordinate,d=i.translateX,f=i.translateY,(0,s.Z)(b,(y(l={},"".concat(b,"-right"),(0,c.hj)(d)&&u&&(0,c.hj)(u.x)&&d>=u.x),y(l,"".concat(b,"-left"),(0,c.hj)(d)&&u&&(0,c.hj)(u.x)&&d<u.x),y(l,"".concat(b,"-bottom"),(0,c.hj)(f)&&u&&(0,c.hj)(u.y)&&f>=u.y),y(l,"".concat(b,"-top"),(0,c.hj)(f)&&u&&(0,c.hj)(u.y)&&f<u.y),l)))}),$=K.cssClasses,V=K.cssProperties,X=E(E(E({},z&&A&&(0,g.bO)({transition:"transform ".concat(I,"ms ").concat(R)})),V),{},{pointerEvents:"none",visibility:!this.state.dismissed&&A&&Z?"visible":"hidden",position:"absolute",top:0,left:0},U);return r.createElement("div",{tabIndex:-1,role:"dialog",className:$,style:X,ref:function(e){N.wrapperNode=e}},D)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,P(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent),T=n(34067),A=n(93528);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t){return(D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Z(e,t,n){return(t=z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e){var t=function(e,t){if("object"!==M(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===M(t)?t:String(t)}function B(e){return e.dataKey}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}(a,e);var t,n,o=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,n=L(a);return e=t?Reflect.construct(n,arguments,L(this).constructor):n.apply(this,arguments),function(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return n=[{key:"render",value:function(){var e,t=this,n=this.props,o=n.active,a=n.allowEscapeViewBox,i=n.animationDuration,l=n.animationEasing,s=n.content,c=n.coordinate,u=n.filterNull,d=n.isAnimationActive,f=n.offset,p=n.payload,h=n.payloadUniqBy,g=n.position,v=n.reverseDirection,y=n.useTranslate3d,b=n.viewBox,x=n.wrapperStyle,w=null!=p?p:[];u&&w.length&&(w=(0,A.z)(p.filter(function(e){return null!=e.value&&(!0!==e.hide||t.props.includeHidden)}),h,B));var k=w.length>0;return r.createElement(N,{allowEscapeViewBox:a,animationDuration:i,animationEasing:l,isAnimationActive:d,active:o,coordinate:c,hasPayload:k,offset:f,position:g,reverseDirection:v,useTranslate3d:y,viewBox:b,wrapperStyle:x},(e=R(R({},this.props),{},{payload:w}),r.isValidElement(s)?r.cloneElement(s,e):"function"==typeof s?r.createElement(s,e):r.createElement(m,e)))}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,z(r.key),r)}}(a.prototype,n),Object.defineProperty(a,"prototype",{writable:!1}),a}(r.PureComponent);Z(F,"displayName","Tooltip"),Z(F,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!T.x.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}})},9841:function(e,t,n){"use strict";n.d(t,{m:function(){return s}});var r=n(2265),o=n(87602),a=n(82944),i=["children","className"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=r.forwardRef(function(e,t){var n=e.children,s=e.className,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),u=(0,o.Z)("recharts-layer",s);return r.createElement("g",l({className:u},(0,a.L6)(c,!0),{ref:t}),n)})},48777:function(e,t,n){"use strict";n.d(t,{T:function(){return s}});var r=n(2265),o=n(87602),a=n(82944),i=["children","width","height","viewBox","className","style","title","desc"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e){var t=e.children,n=e.width,s=e.height,c=e.viewBox,u=e.className,d=e.style,f=e.title,p=e.desc,h=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,i),m=c||{width:n,height:s,x:0,y:0},g=(0,o.Z)("recharts-surface",u);return r.createElement("svg",l({},(0,a.L6)(h,!0,"svg"),{className:g,width:n,height:s,style:d,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),r.createElement("title",null,f),r.createElement("desc",null,p),t)}},25739:function(e,t,n){"use strict";n.d(t,{br:function(){return h},Mw:function(){return w},zn:function(){return x},sp:function(){return m},qD:function(){return b},d2:function(){return y},bH:function(){return g},Ud:function(){return v}});var r=n(2265),o=n(69398),a=n(50967),i=n.n(a)()(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),l=(0,r.createContext)(void 0),s=(0,r.createContext)(void 0),c=(0,r.createContext)(void 0),u=(0,r.createContext)({}),d=(0,r.createContext)(void 0),f=(0,r.createContext)(0),p=(0,r.createContext)(0),h=function(e){var t=e.state,n=t.xAxisMap,o=t.yAxisMap,a=t.offset,h=e.clipPathId,m=e.children,g=e.width,v=e.height,y=i(a);return r.createElement(l.Provider,{value:n},r.createElement(s.Provider,{value:o},r.createElement(u.Provider,{value:a},r.createElement(c.Provider,{value:y},r.createElement(d.Provider,{value:h},r.createElement(f.Provider,{value:v},r.createElement(p.Provider,{value:g},m)))))))},m=function(){return(0,r.useContext)(d)},g=function(e){var t=(0,r.useContext)(l);null!=t||(0,o.Z)(!1);var n=t[e];return null!=n||(0,o.Z)(!1),n},v=function(e){var t=(0,r.useContext)(s);null!=t||(0,o.Z)(!1);var n=t[e];return null!=n||(0,o.Z)(!1),n},y=function(){return(0,r.useContext)(c)},b=function(){return(0,r.useContext)(u)},x=function(){return(0,r.useContext)(p)},w=function(){return(0,r.useContext)(f)}},57165:function(e,t,n){"use strict";n.d(t,{H:function(){return $}});var r=n(2265);function o(){}function a(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function i(e){this._context=e}function l(e){this._context=e}function s(e){this._context=e}i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:a(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},l.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},s.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:a(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class c{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function u(e){this._context=e}function d(e){this._context=e}function f(e){return new d(e)}function p(e,t,n){var r=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(r||o<0&&-0),i=(n-e._y1)/(o||r<0&&-0);return((a<0?-1:1)+(i<0?-1:1))*Math.min(Math.abs(a),Math.abs(i),.5*Math.abs((a*o+i*r)/(r+o)))||0}function h(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function m(e,t,n){var r=e._x0,o=e._y0,a=e._x1,i=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,o+l*t,a-l,i-l*n,a,i)}function g(e){this._context=e}function v(e){this._context=new y(e)}function y(e){this._context=e}function b(e){this._context=e}function x(e){var t,n,r=e.length-1,o=Array(r),a=Array(r),i=Array(r);for(o[0]=0,a[0]=2,i[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,i[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,i[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=o[t]/a[t-1],a[t]-=n,i[t]-=n*i[t-1];for(o[r-1]=i[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(i[t]-o[t+1])/a[t];for(t=0,a[r-1]=(e[r]+o[r-1])/2;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function w(e,t){this._context=e,this._t=t}u.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:m(this,this._t0,h(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,m(this,h(this,n=p(this,e,t)),n);break;default:m(this,this._t0,n=p(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(v.prototype=Object.create(g.prototype)).point=function(e,t){g.prototype.point.call(this,t,e)},y.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,a){this._context.bezierCurveTo(t,e,r,n,a,o)}},b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=x(e),o=x(t),a=0,i=1;i<n;++a,++i)this._context.bezierCurveTo(r[0][a],o[0][a],r[1][a],o[1][a],e[i],t[i])}(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var k=n(22516),S=n(76115),E=n(67790);function O(e){return e[0]}function C(e){return e[1]}function j(e,t){var n=(0,S.Z)(!0),r=null,o=f,a=null,i=(0,E.d)(l);function l(l){var s,c,u,d=(l=(0,k.Z)(l)).length,f=!1;for(null==r&&(a=o(u=i())),s=0;s<=d;++s)!(s<d&&n(c=l[s],s,l))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(c,s,l),+t(c,s,l));if(u)return a=null,u+""||null}return e="function"==typeof e?e:void 0===e?O:(0,S.Z)(e),t="function"==typeof t?t:void 0===t?C:(0,S.Z)(t),l.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),l):e},l.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),l):t},l.defined=function(e){return arguments.length?(n="function"==typeof e?e:(0,S.Z)(!!e),l):n},l.curve=function(e){return arguments.length?(o=e,null!=r&&(a=o(r)),l):o},l.context=function(e){return arguments.length?(null==e?r=a=null:a=o(r=e),l):r},l}function _(e,t,n){var r=null,o=(0,S.Z)(!0),a=null,i=f,l=null,s=(0,E.d)(c);function c(c){var u,d,f,p,h,m=(c=(0,k.Z)(c)).length,g=!1,v=Array(m),y=Array(m);for(null==a&&(l=i(h=s())),u=0;u<=m;++u){if(!(u<m&&o(p=c[u],u,c))===g){if(g=!g)d=u,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),f=u-1;f>=d;--f)l.point(v[f],y[f]);l.lineEnd(),l.areaEnd()}}g&&(v[u]=+e(p,u,c),y[u]=+t(p,u,c),l.point(r?+r(p,u,c):v[u],n?+n(p,u,c):y[u]))}if(h)return l=null,h+""||null}function u(){return j().defined(o).curve(i).context(a)}return e="function"==typeof e?e:void 0===e?O:(0,S.Z)(+e),t="function"==typeof t?t:void 0===t?(0,S.Z)(0):(0,S.Z)(+t),n="function"==typeof n?n:void 0===n?C:(0,S.Z)(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:(0,S.Z)(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:(0,S.Z)(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:(0,S.Z)(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:(0,S.Z)(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(o="function"==typeof e?e:(0,S.Z)(!!e),c):o},c.curve=function(e){return arguments.length?(i=e,null!=a&&(l=i(a)),c):i},c.context=function(e){return arguments.length?(null==e?a=l=null:l=i(a=e),c):a},c}var P=n(75551),N=n.n(P),T=n(86757),A=n.n(T),M=n(87602),I=n(41637),R=n(82944),D=n(16630);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(){return(Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==L(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==L(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===L(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var F={curveBasisClosed:function(e){return new l(e)},curveBasisOpen:function(e){return new s(e)},curveBasis:function(e){return new i(e)},curveBumpX:function(e){return new c(e,!0)},curveBumpY:function(e){return new c(e,!1)},curveLinearClosed:function(e){return new u(e)},curveLinear:f,curveMonotoneX:function(e){return new g(e)},curveMonotoneY:function(e){return new v(e)},curveNatural:function(e){return new b(e)},curveStep:function(e){return new w(e,.5)},curveStepAfter:function(e){return new w(e,1)},curveStepBefore:function(e){return new w(e,0)}},H=function(e){return e.x===+e.x&&e.y===+e.y},q=function(e){return e.x},W=function(e){return e.y},U=function(e,t){if(A()(e))return e;var n="curve".concat(N()(e));return("curveMonotone"===n||"curveBump"===n)&&t?F["".concat(n).concat("vertical"===t?"Y":"X")]:F[n]||f},K=function(e){var t,n=e.type,r=e.points,o=void 0===r?[]:r,a=e.baseLine,i=e.layout,l=e.connectNulls,s=void 0!==l&&l,c=U(void 0===n?"linear":n,i),u=s?o.filter(function(e){return H(e)}):o;if(Array.isArray(a)){var d=s?a.filter(function(e){return H(e)}):a,f=u.map(function(e,t){return B(B({},e),{},{base:d[t]})});return(t="vertical"===i?_().y(W).x1(q).x0(function(e){return e.base.x}):_().x(q).y1(W).y0(function(e){return e.base.y})).defined(H).curve(c),t(f)}return(t="vertical"===i&&(0,D.hj)(a)?_().y(W).x1(q).x0(a):(0,D.hj)(a)?_().x(q).y1(W).y0(a):j().x(q).y(W)).defined(H).curve(c),t(u)},$=function(e){var t=e.className,n=e.points,o=e.path,a=e.pathRef;if((!n||!n.length)&&!o)return null;var i=n&&n.length?K(e):o;return r.createElement("path",Z({},(0,R.L6)(e,!1),(0,I.Ym)(e),{className:(0,M.Z)("recharts-curve",t),d:i,ref:a}))}},81889:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(2265),o=n(87602),a=n(41637),i=n(82944);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var s=function(e){var t=e.cx,n=e.cy,s=e.r,c=e.className,u=(0,o.Z)("recharts-dot",c);return t===+t&&n===+n&&s===+s?r.createElement("circle",l({},(0,i.L6)(e,!1),(0,a.Ym)(e),{className:u,cx:t,cy:n,r:s})):null}},73649:function(e,t,n){"use strict";n.d(t,{A:function(){return m},X:function(){return p}});var r=n(2265),o=n(87602),a=n(59221),i=n(82944);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e,t,n,r,o){var a,i=Math.min(Math.abs(n)/2,Math.abs(r)/2),l=r>=0?1:-1,s=n>=0?1:-1,c=r>=0&&n>=0||r<0&&n<0?1:0;if(i>0&&o instanceof Array){for(var u=[0,0,0,0],d=0;d<4;d++)u[d]=o[d]>i?i:o[d];a="M".concat(e,",").concat(t+l*u[0]),u[0]>0&&(a+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+s*u[0],",").concat(t)),a+="L ".concat(e+n-s*u[1],",").concat(t),u[1]>0&&(a+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,",\n ").concat(e+n,",").concat(t+l*u[1])),a+="L ".concat(e+n,",").concat(t+r-l*u[2]),u[2]>0&&(a+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,",\n ").concat(e+n-s*u[2],",").concat(t+r)),a+="L ".concat(e+s*u[3],",").concat(t+r),u[3]>0&&(a+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,",\n ").concat(e,",").concat(t+r-l*u[3])),a+="Z"}else if(i>0&&o===+o&&o>0){var f=Math.min(i,o);a="M ".concat(e,",").concat(t+l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+s*f,",").concat(t,"\n L ").concat(e+n-s*f,",").concat(t,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n,",").concat(t+l*f,"\n L ").concat(e+n,",").concat(t+r-l*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n-s*f,",").concat(t+r,"\n L ").concat(e+s*f,",").concat(t+r,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e,",").concat(t+r-l*f," Z")}else a="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return a},p=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,o=t.x,a=t.y,i=t.width,l=t.height;return!!(Math.abs(i)>0&&Math.abs(l)>0)&&n>=Math.min(o,o+i)&&n<=Math.max(o,o+i)&&r>=Math.min(a,a+l)&&r<=Math.max(a,a+l)},h={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},m=function(e){var t,n=d(d({},h),e),l=(0,r.useRef)(),u=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(-1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,2)||function(e,t){if(e){if("string"==typeof e)return c(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=u[0],m=u[1];(0,r.useEffect)(function(){if(l.current&&l.current.getTotalLength)try{var e=l.current.getTotalLength();e&&m(e)}catch(e){}},[]);var g=n.x,v=n.y,y=n.width,b=n.height,x=n.radius,w=n.className,k=n.animationEasing,S=n.animationDuration,E=n.animationBegin,O=n.isAnimationActive,C=n.isUpdateAnimationActive;if(g!==+g||v!==+v||y!==+y||b!==+b||0===y||0===b)return null;var j=(0,o.Z)("recharts-rectangle",w);return C?r.createElement(a.ZP,{canBegin:p>0,from:{width:y,height:b,x:g,y:v},to:{width:y,height:b,x:g,y:v},duration:S,animationEasing:k,isActive:C},function(e){var t=e.width,o=e.height,c=e.x,u=e.y;return r.createElement(a.ZP,{canBegin:p>0,from:"0px ".concat(-1===p?1:p,"px"),to:"".concat(p,"px 0px"),attributeName:"strokeDasharray",begin:E,duration:S,isActive:O,easing:k},r.createElement("path",s({},(0,i.L6)(n,!0),{className:j,d:f(c,u,t,o,x),ref:l})))}):r.createElement("path",s({},(0,i.L6)(n,!0),{className:j,d:f(g,v,y,b,x)}))}},60474:function(e,t,n){"use strict";n.d(t,{L:function(){return g}});var r=n(2265),o=n(87602),a=n(82944),i=n(39206),l=n(16630);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=function(e){var t=e.cx,n=e.cy,r=e.radius,o=e.angle,a=e.sign,l=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,u=s*(l?1:-1)+r,d=Math.asin(s/u)/i.Wk,f=c?o:o+a*d;return{center:(0,i.op)(t,n,u,f),circleTangency:(0,i.op)(t,n,r,f),lineTangency:(0,i.op)(t,n,u*Math.cos(d*i.Wk),c?o-a*d:o),theta:d}},p=function(e){var t,n=e.cx,r=e.cy,o=e.innerRadius,a=e.outerRadius,s=e.startAngle,c=(t=e.endAngle,(0,l.uY)(t-s)*Math.min(Math.abs(t-s),359.999)),u=s+c,d=(0,i.op)(n,r,a,s),f=(0,i.op)(n,r,a,u),p="M ".concat(d.x,",").concat(d.y,"\n A ").concat(a,",").concat(a,",0,\n ").concat(+(Math.abs(c)>180),",").concat(+(s>u),",\n ").concat(f.x,",").concat(f.y,"\n ");if(o>0){var h=(0,i.op)(n,r,o,s),m=(0,i.op)(n,r,o,u);p+="L ".concat(m.x,",").concat(m.y,"\n A ").concat(o,",").concat(o,",0,\n ").concat(+(Math.abs(c)>180),",").concat(+(s<=u),",\n ").concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(n,",").concat(r," Z");return p},h=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,i=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,d=(0,l.uY)(u-c),h=f({cx:t,cy:n,radius:o,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),m=h.circleTangency,g=h.lineTangency,v=h.theta,y=f({cx:t,cy:n,radius:o,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:s}),b=y.circleTangency,x=y.lineTangency,w=y.theta,k=s?Math.abs(c-u):Math.abs(c-u)-v-w;if(k<0)return i?"M ".concat(g.x,",").concat(g.y,"\n a").concat(a,",").concat(a,",0,0,1,").concat(2*a,",0\n a").concat(a,",").concat(a,",0,0,1,").concat(-(2*a),",0\n "):p({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:c,endAngle:u});var S="M ".concat(g.x,",").concat(g.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,"\n A").concat(o,",").concat(o,",0,").concat(+(k>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(x.x,",").concat(x.y,"\n ");if(r>0){var E=f({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),O=E.circleTangency,C=E.lineTangency,j=E.theta,_=f({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),P=_.circleTangency,N=_.lineTangency,T=_.theta,A=s?Math.abs(c-u):Math.abs(c-u)-j-T;if(A<0&&0===a)return"".concat(S,"L").concat(t,",").concat(n,"Z");S+="L".concat(N.x,",").concat(N.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,"\n A").concat(r,",").concat(r,",0,").concat(+(A>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,"\n A").concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(C.x,",").concat(C.y,"Z")}else S+="L".concat(t,",").concat(n,"Z");return S},m={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},g=function(e){var t,n=d(d({},m),e),i=n.cx,s=n.cy,u=n.innerRadius,f=n.outerRadius,g=n.cornerRadius,v=n.forceCornerRadius,y=n.cornerIsExternal,b=n.startAngle,x=n.endAngle,w=n.className;if(f<u||b===x)return null;var k=(0,o.Z)("recharts-sector",w),S=f-u,E=(0,l.h1)(g,S,0,!0);return t=E>0&&360>Math.abs(b-x)?h({cx:i,cy:s,innerRadius:u,outerRadius:f,cornerRadius:Math.min(E,S/2),forceCornerRadius:v,cornerIsExternal:y,startAngle:b,endAngle:x}):p({cx:i,cy:s,innerRadius:u,outerRadius:f,startAngle:b,endAngle:x}),r.createElement("path",c({},(0,a.L6)(n,!0),{className:k,d:t,role:"img"}))}},14870:function(e,t,n){"use strict";n.d(t,{v:function(){return M}});var r=n(2265),o=n(75551),a=n.n(o);let i=Math.cos,l=Math.sin,s=Math.sqrt,c=Math.PI,u=2*c;var d={draw(e,t){let n=s(t/c);e.moveTo(n,0),e.arc(0,0,n,0,u)}};let f=s(1/3),p=2*f,h=l(c/10)/l(7*c/10),m=l(u/10)*h,g=-i(u/10)*h,v=s(3),y=s(3)/2,b=1/s(12),x=(b/2+1)*3;var w=n(76115),k=n(67790);s(3),s(3);var S=n(87602),E=n(82944);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var C=["type","size","sizeType"];function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==O(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==O(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===O(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var N={symbolCircle:d,symbolCross:{draw(e,t){let n=s(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},symbolDiamond:{draw(e,t){let n=s(t/p),r=n*f;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},symbolSquare:{draw(e,t){let n=s(t),r=-n/2;e.rect(r,r,n,n)}},symbolStar:{draw(e,t){let n=s(.8908130915292852*t),r=m*n,o=g*n;e.moveTo(0,-n),e.lineTo(r,o);for(let t=1;t<5;++t){let a=u*t/5,s=i(a),c=l(a);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*o,c*r+s*o)}e.closePath()}},symbolTriangle:{draw(e,t){let n=-s(t/(3*v));e.moveTo(0,2*n),e.lineTo(-v*n,-n),e.lineTo(v*n,-n),e.closePath()}},symbolWye:{draw(e,t){let n=s(t/x),r=n/2,o=n*b,a=n*b+n,i=-r;e.moveTo(r,o),e.lineTo(r,a),e.lineTo(i,a),e.lineTo(-.5*r-y*o,y*r+-.5*o),e.lineTo(-.5*r-y*a,y*r+-.5*a),e.lineTo(-.5*i-y*a,y*i+-.5*a),e.lineTo(-.5*r+y*o,-.5*o-y*r),e.lineTo(-.5*r+y*a,-.5*a-y*r),e.lineTo(-.5*i+y*a,-.5*a-y*i),e.closePath()}}},T=Math.PI/180,A=function(e,t,n){if("area"===t)return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var r=18*T;return 1.25*e*e*(Math.tan(r)-Math.tan(2*r)*Math.pow(Math.tan(r),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},M=function(e){var t,n=e.type,o=void 0===n?"circle":n,i=e.size,l=void 0===i?64:i,s=e.sizeType,c=void 0===s?"area":s,u=P(P({},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,C)),{},{type:o,size:l,sizeType:c}),f=u.className,p=u.cx,h=u.cy,m=(0,E.L6)(u,!0);return p===+p&&h===+h&&l===+l?r.createElement("path",j({},m,{className:(0,S.Z)("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(h,")"),d:(t=N["symbol".concat(a()(o))]||d,(function(e,t){let n=null,r=(0,k.d)(o);function o(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return e="function"==typeof e?e:(0,w.Z)(e||d),t="function"==typeof t?t:(0,w.Z)(void 0===t?64:+t),o.type=function(t){return arguments.length?(e="function"==typeof t?t:(0,w.Z)(t),o):e},o.size=function(e){return arguments.length?(t="function"==typeof e?e:(0,w.Z)(+e),o):t},o.context=function(e){return arguments.length?(n=null==e?null:e,o):n},o})().type(t).size(A(l,c,o))())})):null};M.registerSymbol=function(e,t){N["symbol".concat(a()(e))]=t}},11638:function(e,t,n){"use strict";n.d(t,{bn:function(){return A},a3:function(){return z},lT:function(){return M},V$:function(){return I},w7:function(){return R}});var r=n(2265),o=n(86757),a=n.n(o),i=n(90231),l=n.n(i),s=n(24342),c=n.n(s),u=n(21652),d=n.n(u),f=n(73649),p=n(87602),h=n(59221),m=n(82944);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(){return(v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==g(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===g(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var w=function(e,t,n,r,o){var a=n-r;return"M ".concat(e,",").concat(t)+"L ".concat(e+n,",").concat(t)+"L ".concat(e+n-a/2,",").concat(t+o)+"L ".concat(e+n-a/2-r,",").concat(t+o)+"L ".concat(e,",").concat(t," Z")},k={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},S=function(e){var t,n=x(x({},k),e),o=(0,r.useRef)(),a=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(-1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,2)||function(e,t){if(e){if("string"==typeof e)return y(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],l=a[1];(0,r.useEffect)(function(){if(o.current&&o.current.getTotalLength)try{var e=o.current.getTotalLength();e&&l(e)}catch(e){}},[]);var s=n.x,c=n.y,u=n.upperWidth,d=n.lowerWidth,f=n.height,g=n.className,b=n.animationEasing,S=n.animationDuration,E=n.animationBegin,O=n.isUpdateAnimationActive;if(s!==+s||c!==+c||u!==+u||d!==+d||f!==+f||0===u&&0===d||0===f)return null;var C=(0,p.Z)("recharts-trapezoid",g);return O?r.createElement(h.ZP,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:f,x:s,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:s,y:c},duration:S,animationEasing:b,isActive:O},function(e){var t=e.upperWidth,a=e.lowerWidth,l=e.height,s=e.x,c=e.y;return r.createElement(h.ZP,{canBegin:i>0,from:"0px ".concat(-1===i?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:E,duration:S,easing:b},r.createElement("path",v({},(0,m.L6)(n,!0),{className:C,d:w(s,c,t,a,l),ref:o})))}):r.createElement("g",null,r.createElement("path",v({},(0,m.L6)(n,!0),{className:C,d:w(s,c,u,d,f)})))},E=n(60474),O=n(9841),C=n(14870),j=["option","shapeType","propTransformer","activeClassName","isActive"];function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function T(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return r.createElement(f.A,n);case"trapezoid":return r.createElement(S,n);case"sector":return r.createElement(E.L,n);case"symbols":if("symbols"===t)return r.createElement(C.v,n);break;default:return null}}function A(e){var t,n=e.option,o=e.shapeType,i=e.propTransformer,s=e.activeClassName,u=e.isActive,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,j);if((0,r.isValidElement)(n))t=(0,r.cloneElement)(n,N(N({},d),(0,r.isValidElement)(n)?n.props:n));else if(a()(n))t=n(d);else if(l()(n)&&!c()(n)){var f=(void 0===i?function(e,t){return N(N({},t),e)}:i)(n,d);t=r.createElement(T,{shapeType:o,elementProps:f})}else t=r.createElement(T,{shapeType:o,elementProps:d});return u?r.createElement(O.m,{className:void 0===s?"recharts-active-shape":s},t):t}function M(e,t){return null!=t&&"trapezoids"in e.props}function I(e,t){return null!=t&&"sectors"in e.props}function R(e,t){return null!=t&&"points"in e.props}function D(e,t){var n,r,o=e.x===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.x)||e.x===t.x,a=e.y===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.y)||e.y===t.y;return o&&a}function L(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Z(e,t){var n=e.x===t.x,r=e.y===t.y,o=e.z===t.z;return n&&r&&o}function z(e){var t,n,r,o=e.activeTooltipItem,a=e.graphicalItem,i=e.itemData,l=(M(a,o)?t="trapezoids":I(a,o)?t="sectors":R(a,o)&&(t="points"),t),s=M(a,o)?null===(n=o.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:I(a,o)?null===(r=o.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:R(a,o)?o.payload:{},c=i.filter(function(e,t){var n=d()(s,e),r=a.props[l].filter(function(e){var t;return(M(a,o)?t=D:I(a,o)?t=L:R(a,o)&&(t=Z),t)(e,o)}),i=a.props[l].indexOf(r[r.length-1]);return n&&t===i});return i.indexOf(c[c.length-1])}},25311:function(e,t,n){"use strict";n.d(t,{Ky:function(){return w},O1:function(){return y},_b:function(){return b},t9:function(){return v},xE:function(){return k}});var r=n(41443),o=n.n(r),a=n(32242),i=n.n(a),l=n(85355),s=n(82944),c=n(16630),u=n(31699);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var v=function(e,t,n,r,o){var a=e.width,i=e.height,d=e.layout,f=e.children,p=Object.keys(t),g={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:i-n.bottom,bottomMirror:i-n.bottom},v=!!(0,s.sP)(f,u.$);return p.reduce(function(a,i){var s,u,f,p,y,b=t[i],x=b.orientation,w=b.domain,k=b.padding,S=void 0===k?{}:k,E=b.mirror,O=b.reversed,C="".concat(x).concat(E?"Mirror":"");if("number"===b.type&&("gap"===b.padding||"no-gap"===b.padding)){var j=w[1]-w[0],_=1/0,P=b.categoricalDomain.sort();P.forEach(function(e,t){t>0&&(_=Math.min((e||0)-(P[t-1]||0),_))});var N=_/j,T="vertical"===b.layout?n.height:n.width;if("gap"===b.padding&&(s=N*T/2),"no-gap"===b.padding){var A=(0,c.h1)(e.barCategoryGap,N*T),M=N*T/2;s=M-A-(M-A)/T*A}}u="xAxis"===r?[n.left+(S.left||0)+(s||0),n.left+n.width-(S.right||0)-(s||0)]:"yAxis"===r?"horizontal"===d?[n.top+n.height-(S.bottom||0),n.top+(S.top||0)]:[n.top+(S.top||0)+(s||0),n.top+n.height-(S.bottom||0)-(s||0)]:b.range,O&&(u=[u[1],u[0]]);var I=(0,l.Hq)(b,o,v),R=I.scale,D=I.realScaleType;R.domain(w).range(u),(0,l.zF)(R);var L=(0,l.g$)(R,h(h({},b),{},{realScaleType:D}));"xAxis"===r?(y="top"===x&&!E||"bottom"===x&&E,f=n.left,p=g[C]-y*b.height):"yAxis"===r&&(y="left"===x&&!E||"right"===x&&E,f=g[C]-y*b.width,p=n.top);var Z=h(h(h({},b),L),{},{realScaleType:D,x:f,y:p,scale:R,width:"xAxis"===r?n.width:b.width,height:"yAxis"===r?n.height:b.height});return Z.bandSize=(0,l.zT)(Z,L),b.hide||"xAxis"!==r?b.hide||(g[C]+=(y?-1:1)*Z.width):g[C]+=(y?-1:1)*Z.height,h(h({},a),{},m({},i,Z))},{})},y=function(e,t){var n=e.x,r=e.y,o=t.x,a=t.y;return{x:Math.min(n,o),y:Math.min(r,a),width:Math.abs(o-n),height:Math.abs(a-r)}},b=function(e){return y({x:e.x1,y:e.y1},{x:e.x2,y:e.y2})},x=function(){var e,t;function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),this.scale=e}return e=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=t.position;if(void 0!==e){if(r)switch(r){case"start":default:return this.scale(e);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o;case"end":var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a}if(n){var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],t=[{key:"create",value:function(e){return new n(e)}}],e&&f(n.prototype,e),t&&f(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();m(x,"EPS",1e-4);var w=function(e){var t=Object.keys(e).reduce(function(t,n){return h(h({},t),{},m({},n,x.create(e[n])))},{});return h(h({},t),{},{apply:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware,a=n.position;return o()(e,function(e,n){return t[n].apply(e,{bandAware:r,position:a})})},isInRange:function(e){return i()(e,function(e,n){return t[n].isInRange(e)})}})},k=function(e){var t=e.width,n=e.height,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(r%180+180)%180*Math.PI/180,a=Math.atan(n/t);return Math.abs(o>a&&o<Math.PI-a?n/Math.sin(o):t/Math.cos(o))}},85355:function(e,t,n){"use strict";n.d(t,{By:function(){return r4},VO:function(){return r0},zF:function(){return oo},DO:function(){return on},Bu:function(){return oa},zT:function(){return ob},qz:function(){return r6},pt:function(){return r2},Yj:function(){return op},Fy:function(){return of},Hv:function(){return od},Rf:function(){return r9},gF:function(){return rJ},s6:function(){return r8},EB:function(){return om},fk:function(){return r1},wh:function(){return oc},O3:function(){return oh},uY:function(){return oe},g$:function(){return ou},Qo:function(){return ow},F$:function(){return rQ},NA:function(){return r7},ko:function(){return ox},ZI:function(){return r5},Hq:function(){return or},LG:function(){return oy},Vv:function(){return oi}});var r,o,a,i,l,s,c,u={};n.r(u),n.d(u,{scaleBand:function(){return d.Z},scaleDiverging:function(){return function e(){var t=eR(nQ()(eg));return t.copy=function(){return nX(t,e())},eS.O.apply(t,arguments)}},scaleDivergingLog:function(){return function e(){var t=eW(nQ()).domain([.1,1,10]);return t.copy=function(){return nX(t,e()).base(t.base())},eS.O.apply(t,arguments)}},scaleDivergingPow:function(){return nJ},scaleDivergingSqrt:function(){return n0},scaleDivergingSymlog:function(){return function e(){var t=e$(nQ());return t.copy=function(){return nX(t,e()).constant(t.constant())},eS.O.apply(t,arguments)}},scaleIdentity:function(){return function e(t){var n;function r(e){return null==e||isNaN(e=+e)?n:e}return r.invert=r,r.domain=r.range=function(e){return arguments.length?(t=Array.from(e,eh),r):t.slice()},r.unknown=function(e){return arguments.length?(n=e,r):n},r.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,eh):[0,1],eR(r)}},scaleImplicit:function(){return eV.O},scaleLinear:function(){return eD},scaleLog:function(){return function e(){let t=eW(ew()).domain([1,10]);return t.copy=()=>ex(t,e()).base(t.base()),eS.o.apply(t,arguments),t}},scaleOrdinal:function(){return eV.Z},scalePoint:function(){return d.x},scalePow:function(){return eJ},scaleQuantile:function(){return function e(){var t,n=[],r=[],o=[];function a(){var e=0,t=Math.max(1,r.length);for(o=Array(t-1);++e<t;)o[e-1]=function(e,t,n=S){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,a=Math.floor(o),i=+n(e[a],a,e);return i+(+n(e[a+1],a+1,e)-i)*(o-a)}}(n,e/t);return i}function i(e){return null==e||isNaN(e=+e)?t:r[O(o,e)]}return i.invertExtent=function(e){var t=r.indexOf(e);return t<0?[NaN,NaN]:[t>0?o[t-1]:n[0],t<o.length?o[t]:n[n.length-1]]},i.domain=function(e){if(!arguments.length)return n.slice();for(let t of(n=[],e))null==t||isNaN(t=+t)||n.push(t);return n.sort(b),a()},i.range=function(e){return arguments.length?(r=Array.from(e),a()):r.slice()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.quantiles=function(){return o.slice()},i.copy=function(){return e().domain(n).range(r).unknown(t)},eS.o.apply(i,arguments)}},scaleQuantize:function(){return function e(){var t,n=0,r=1,o=1,a=[.5],i=[0,1];function l(e){return null!=e&&e<=e?i[O(a,e,0,o)]:t}function s(){var e=-1;for(a=Array(o);++e<o;)a[e]=((e+1)*r-(e-o)*n)/(o+1);return l}return l.domain=function(e){return arguments.length?([n,r]=e,n=+n,r=+r,s()):[n,r]},l.range=function(e){return arguments.length?(o=(i=Array.from(e)).length-1,s()):i.slice()},l.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,a[0]]:t>=o?[a[o-1],r]:[a[t-1],a[t]]},l.unknown=function(e){return arguments.length&&(t=e),l},l.thresholds=function(){return a.slice()},l.copy=function(){return e().domain([n,r]).range(i).unknown(t)},eS.o.apply(eR(l),arguments)}},scaleRadial:function(){return function e(){var t,n=ek(),r=[0,1],o=!1;function a(e){var r,a=Math.sign(r=n(e))*Math.sqrt(Math.abs(r));return isNaN(a)?t:o?Math.round(a):a}return a.invert=function(e){return n.invert(e1(e))},a.domain=function(e){return arguments.length?(n.domain(e),a):n.domain()},a.range=function(e){return arguments.length?(n.range((r=Array.from(e,eh)).map(e1)),a):r.slice()},a.rangeRound=function(e){return a.range(e).round(!0)},a.round=function(e){return arguments.length?(o=!!e,a):o},a.clamp=function(e){return arguments.length?(n.clamp(e),a):n.clamp()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e(n.domain(),r).round(o).clamp(n.clamp()).unknown(t)},eS.o.apply(a,arguments),eR(a)}},scaleSequential:function(){return function e(){var t=eR(nV()(eg));return t.copy=function(){return nX(t,e())},eS.O.apply(t,arguments)}},scaleSequentialLog:function(){return function e(){var t=eW(nV()).domain([1,10]);return t.copy=function(){return nX(t,e()).base(t.base())},eS.O.apply(t,arguments)}},scaleSequentialPow:function(){return nG},scaleSequentialQuantile:function(){return function e(){var t=[],n=eg;function r(e){if(null!=e&&!isNaN(e=+e))return n((O(t,e,1)-1)/(t.length-1))}return r.domain=function(e){if(!arguments.length)return t.slice();for(let n of(t=[],e))null==n||isNaN(n=+n)||t.push(n);return t.sort(b),r},r.interpolator=function(e){return arguments.length?(n=e,r):n},r.range=function(){return t.map((e,r)=>n(r/(t.length-1)))},r.quantiles=function(e){return Array.from({length:e+1},(n,r)=>(function(e,t,n){if(!(!(r=(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,void 0))).length)||isNaN(t=+t))){if(t<=0||r<2)return e6(e);if(t>=1)return e2(e);var r,o=(r-1)*t,a=Math.floor(o),i=e2((function e(t,n,r=0,o=1/0,a){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),o=Math.floor(Math.min(t.length-1,o)),!(r<=n&&n<=o))return t;for(a=void 0===a?e4:function(e=b){if(e===b)return e4;if("function"!=typeof e)throw TypeError("compare is not a function");return(t,n)=>{let r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(a);o>r;){if(o-r>600){let i=o-r+1,l=n-r+1,s=Math.log(i),c=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*c*(i-c)/i)*(l-i/2<0?-1:1),d=Math.max(r,Math.floor(n-l*c/i+u)),f=Math.min(o,Math.floor(n+(i-l)*c/i+u));e(t,n,d,f,a)}let i=t[n],l=r,s=o;for(e3(t,r,n),a(t[o],i)>0&&e3(t,r,o);l<s;){for(e3(t,l,s),++l,--s;0>a(t[l],i);)++l;for(;a(t[s],i)>0;)--s}0===a(t[r],i)?e3(t,r,s):e3(t,++s,o),s<=n&&(r=s+1),n<=s&&(o=s-1)}return t})(e,a).subarray(0,a+1));return i+(e6(e.subarray(a+1))-i)*(o-a)}})(t,r/e))},r.copy=function(){return e(n).domain(t)},eS.O.apply(r,arguments)}},scaleSequentialSqrt:function(){return nY},scaleSequentialSymlog:function(){return function e(){var t=e$(nV());return t.copy=function(){return nX(t,e()).constant(t.constant())},eS.O.apply(t,arguments)}},scaleSqrt:function(){return e0},scaleSymlog:function(){return function e(){var t=e$(ew());return t.copy=function(){return ex(t,e()).constant(t.constant())},eS.o.apply(t,arguments)}},scaleThreshold:function(){return function e(){var t,n=[.5],r=[0,1],o=1;function a(e){return null!=e&&e<=e?r[O(n,e,0,o)]:t}return a.domain=function(e){return arguments.length?(o=Math.min((n=Array.from(e)).length,r.length-1),a):n.slice()},a.range=function(e){return arguments.length?(r=Array.from(e),o=Math.min(n.length,r.length-1),a):r.slice()},a.invertExtent=function(e){var t=r.indexOf(e);return[n[t-1],n[t]]},a.unknown=function(e){return arguments.length?(t=e,a):t},a.copy=function(){return e().domain(n).range(r).unknown(t)},eS.o.apply(a,arguments)}},scaleTime:function(){return nK},scaleUtc:function(){return n$},tickFormat:function(){return eI}});var d=n(55284);let f=Math.sqrt(50),p=Math.sqrt(10),h=Math.sqrt(2);function m(e,t,n){let r,o,a;let i=(t-e)/Math.max(0,n),l=Math.floor(Math.log10(i)),s=i/Math.pow(10,l),c=s>=f?10:s>=p?5:s>=h?2:1;return(l<0?(r=Math.round(e*(a=Math.pow(10,-l)/c)),o=Math.round(t*a),r/a<e&&++r,o/a>t&&--o,a=-a):(r=Math.round(e/(a=Math.pow(10,l)*c)),o=Math.round(t/a),r*a<e&&++r,o*a>t&&--o),o<r&&.5<=n&&n<2)?m(e,t,2*n):[r,o,a]}function g(e,t,n){if(t=+t,e=+e,!((n=+n)>0))return[];if(e===t)return[e];let r=t<e,[o,a,i]=r?m(t,e,n):m(e,t,n);if(!(a>=o))return[];let l=a-o+1,s=Array(l);if(r){if(i<0)for(let e=0;e<l;++e)s[e]=-((a-e)/i);else for(let e=0;e<l;++e)s[e]=(a-e)*i}else if(i<0)for(let e=0;e<l;++e)s[e]=-((o+e)/i);else for(let e=0;e<l;++e)s[e]=(o+e)*i;return s}function v(e,t,n){return m(e=+e,t=+t,n=+n)[2]}function y(e,t,n){t=+t,e=+e,n=+n;let r=t<e,o=r?v(t,e,n):v(e,t,n);return(r?-1:1)*(o<0?-(1/o):o)}function b(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function x(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function w(e){let t,n,r;function o(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>n(e[t],r)?o=t+1:a=t}while(o<a)}return o}return 2!==e.length?(t=b,n=(t,n)=>b(e(t),n),r=(t,n)=>e(t)-n):(t=e===b||e===x?e:k,n=e,r=e),{left:o,center:function(e,t,n=0,a=e.length){let i=o(e,t,n,a-1);return i>n&&r(e[i-1],t)>-r(e[i],t)?i-1:i},right:function(e,r,o=0,a=e.length){if(o<a){if(0!==t(r,r))return a;do{let t=o+a>>>1;0>=n(e[t],r)?o=t+1:a=t}while(o<a)}return o}}}function k(){return 0}function S(e){return null===e?NaN:+e}let E=w(b),O=E.right;function C(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function j(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _(){}E.left,w(S).center;var P="\\s*([+-]?\\d+)\\s*",N="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",T="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A=/^#([0-9a-f]{3,8})$/,M=RegExp(`^rgb\\(${P},${P},${P}\\)$`),I=RegExp(`^rgb\\(${T},${T},${T}\\)$`),R=RegExp(`^rgba\\(${P},${P},${P},${N}\\)$`),D=RegExp(`^rgba\\(${T},${T},${T},${N}\\)$`),L=RegExp(`^hsl\\(${N},${T},${T}\\)$`),Z=RegExp(`^hsla\\(${N},${T},${T},${N}\\)$`),z={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function B(){return this.rgb().formatHex()}function F(){return this.rgb().formatRgb()}function H(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=A.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?q(t):3===n?new K(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?W(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?W(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=M.exec(e))?new K(t[1],t[2],t[3],1):(t=I.exec(e))?new K(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=R.exec(e))?W(t[1],t[2],t[3],t[4]):(t=D.exec(e))?W(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=L.exec(e))?Q(t[1],t[2]/100,t[3]/100,1):(t=Z.exec(e))?Q(t[1],t[2]/100,t[3]/100,t[4]):z.hasOwnProperty(e)?q(z[e]):"transparent"===e?new K(NaN,NaN,NaN,0):null}function q(e){return new K(e>>16&255,e>>8&255,255&e,1)}function W(e,t,n,r){return r<=0&&(e=t=n=NaN),new K(e,t,n,r)}function U(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof _||(o=H(o)),o)?new K((o=o.rgb()).r,o.g,o.b,o.opacity):new K:new K(e,t,n,null==r?1:r)}function K(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function $(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}`}function V(){let e=X(this.opacity);return`${1===e?"rgb(":"rgba("}${G(this.r)}, ${G(this.g)}, ${G(this.b)}${1===e?")":`, ${e})`}`}function X(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function G(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Y(e){return((e=G(e))<16?"0":"")+e.toString(16)}function Q(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ee(e,t,n,r)}function J(e){if(e instanceof ee)return new ee(e.h,e.s,e.l,e.opacity);if(e instanceof _||(e=H(e)),!e)return new ee;if(e instanceof ee)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,l=a-o,s=(a+o)/2;return l?(i=t===a?(n-r)/l+(n<r)*6:n===a?(r-t)/l+2:(t-n)/l+4,l/=s<.5?a+o:2-a-o,i*=60):l=s>0&&s<1?0:i,new ee(i,l,s,e.opacity)}function ee(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function et(e){return(e=(e||0)%360)<0?e+360:e}function en(e){return Math.max(0,Math.min(1,e||0))}function er(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function eo(e,t,n,r,o){var a=e*e,i=a*e;return((1-3*e+3*a-i)*t+(4-6*a+3*i)*n+(1+3*e+3*a-3*i)*r+i*o)/6}C(_,H,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:B,formatHex:B,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return J(this).formatHsl()},formatRgb:F,toString:F}),C(K,U,j(_,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new K(G(this.r),G(this.g),G(this.b),X(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$,formatHex:$,formatHex8:function(){return`#${Y(this.r)}${Y(this.g)}${Y(this.b)}${Y((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:V,toString:V})),C(ee,function(e,t,n,r){return 1==arguments.length?J(e):new ee(e,t,n,null==r?1:r)},j(_,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ee(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new K(er(e>=240?e-240:e+120,o,r),er(e,o,r),er(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ee(et(this.h),en(this.s),en(this.l),X(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=X(this.opacity);return`${1===e?"hsl(":"hsla("}${et(this.h)}, ${100*en(this.s)}%, ${100*en(this.l)}%${1===e?")":`, ${e})`}`}}));var ea=e=>()=>e;function ei(e,t){var n=t-e;return n?function(t){return e+t*n}:ea(isNaN(e)?t:e)}var el=function e(t){var n,r=1==(n=+(n=t))?ei:function(e,t){var r,o,a;return t-e?(r=e,o=t,r=Math.pow(r,a=n),o=Math.pow(o,a)-r,a=1/a,function(e){return Math.pow(r+e*o,a)}):ea(isNaN(e)?t:e)};function o(e,t){var n=r((e=U(e)).r,(t=U(t)).r),o=r(e.g,t.g),a=r(e.b,t.b),i=ei(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return o.gamma=e,o}(1);function es(e){return function(t){var n,r,o=t.length,a=Array(o),i=Array(o),l=Array(o);for(n=0;n<o;++n)r=U(t[n]),a[n]=r.r||0,i[n]=r.g||0,l[n]=r.b||0;return a=e(a),i=e(i),l=e(l),r.opacity=1,function(e){return r.r=a(e),r.g=i(e),r.b=l(e),r+""}}}function ec(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}es(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],a=e[r+1],i=r>0?e[r-1]:2*o-a,l=r<t-1?e[r+2]:2*a-o;return eo((n-r/t)*t,i,o,a,l)}}),es(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],a=e[r%t],i=e[(r+1)%t],l=e[(r+2)%t];return eo((n-r/t)*t,o,a,i,l)}});var eu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ed=RegExp(eu.source,"g");function ef(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?ea(t):("number"===o?ec:"string"===o?(r=H(t))?(t=r,el):function(e,t){var n,r,o,a,i,l=eu.lastIndex=ed.lastIndex=0,s=-1,c=[],u=[];for(e+="",t+="";(o=eu.exec(e))&&(a=ed.exec(t));)(i=a.index)>l&&(i=t.slice(l,i),c[s]?c[s]+=i:c[++s]=i),(o=o[0])===(a=a[0])?c[s]?c[s]+=a:c[++s]=a:(c[++s]=null,u.push({i:s,x:ec(o,a)})),l=ed.lastIndex;return l<t.length&&(i=t.slice(l),c[s]?c[s]+=i:c[++s]=i),c.length<2?u[0]?(n=u[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=u.length,function(e){for(var n,r=0;r<t;++r)c[(n=u[r]).i]=n.x(e);return c.join("")})}:t instanceof H?el:t instanceof Date?function(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,a=Array(o),i=Array(r);for(n=0;n<o;++n)a[n]=ef(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<o;++n)i[n]=a[n](e);return i}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=ef(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:ec:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}})(e,t)}function ep(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function eh(e){return+e}var em=[0,1];function eg(e){return e}function ev(e,t){var n;return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n})}function ey(e,t,n){var r=e[0],o=e[1],a=t[0],i=t[1];return o<r?(r=ev(o,r),a=n(i,a)):(r=ev(r,o),a=n(a,i)),function(e){return a(r(e))}}function eb(e,t,n){var r=Math.min(e.length,t.length)-1,o=Array(r),a=Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)o[i]=ev(e[i],e[i+1]),a[i]=n(t[i],t[i+1]);return function(t){var n=O(e,t,1,r)-1;return a[n](o[n](t))}}function ex(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ew(){var e,t,n,r,o,a,i=em,l=em,s=ef,c=eg;function u(){var e,t,n,s=Math.min(i.length,l.length);return c!==eg&&(e=i[0],t=i[s-1],e>t&&(n=e,e=t,t=n),c=function(n){return Math.max(e,Math.min(t,n))}),r=s>2?eb:ey,o=a=null,d}function d(t){return null==t||isNaN(t=+t)?n:(o||(o=r(i.map(e),l,s)))(e(c(t)))}return d.invert=function(n){return c(t((a||(a=r(l,i.map(e),ec)))(n)))},d.domain=function(e){return arguments.length?(i=Array.from(e,eh),u()):i.slice()},d.range=function(e){return arguments.length?(l=Array.from(e),u()):l.slice()},d.rangeRound=function(e){return l=Array.from(e),s=ep,u()},d.clamp=function(e){return arguments.length?(c=!!e||eg,u()):c!==eg},d.interpolate=function(e){return arguments.length?(s=e,u()):s},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function ek(){return ew()(eg,eg)}var eS=n(89999),eE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eO(e){var t;if(!(t=eE.exec(e)))throw Error("invalid format: "+e);return new eC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function eC(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ej(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function e_(e){return(e=ej(Math.abs(e)))?e[1]:NaN}function eP(e,t){var n=ej(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+Array(o-r.length+2).join("0")}eO.prototype=eC.prototype,eC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var eN={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eP(100*e,t),r:eP,s:function(e,t){var n=ej(e,t);if(!n)return e+"";var o=n[0],a=n[1],i=a-(r=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,l=o.length;return i===l?o:i>l?o+Array(i-l+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+Array(1-i).join("0")+ej(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function eT(e){return e}var eA=Array.prototype.map,eM=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function eI(e,t,n,r){var o,l,s=y(e,t,n);switch((r=eO(null==r?",f":r)).type){case"s":var c=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(l=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(e_(c)/3)))-e_(Math.abs(s))))||(r.precision=l),i(r,c);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(l=Math.max(0,e_(Math.abs(Math.max(Math.abs(e),Math.abs(t)))-(o=Math.abs(o=s)))-e_(o))+1)||(r.precision=l-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(l=Math.max(0,-e_(Math.abs(s))))||(r.precision=l-("%"===r.type)*2)}return a(r)}function eR(e){var t=e.domain;return e.ticks=function(e){var n=t();return g(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return eI(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,a=t(),i=0,l=a.length-1,s=a[i],c=a[l],u=10;for(c<s&&(o=s,s=c,c=o,o=i,i=l,l=o);u-- >0;){if((o=v(s,c,n))===r)return a[i]=s,a[l]=c,t(a);if(o>0)s=Math.floor(s/o)*o,c=Math.ceil(c/o)*o;else if(o<0)s=Math.ceil(s*o)/o,c=Math.floor(c*o)/o;else break;r=o}return e},e}function eD(){var e=ek();return e.copy=function(){return ex(e,eD())},eS.o.apply(e,arguments),eR(e)}function eL(e,t){e=e.slice();var n,r=0,o=e.length-1,a=e[r],i=e[o];return i<a&&(n=r,r=o,o=n,n=a,a=i,i=n),e[r]=t.floor(a),e[o]=t.ceil(i),e}function eZ(e){return Math.log(e)}function ez(e){return Math.exp(e)}function eB(e){return-Math.log(-e)}function eF(e){return-Math.exp(-e)}function eH(e){return isFinite(e)?+("1e"+e):e<0?0:e}function eq(e){return(t,n)=>-e(-t,n)}function eW(e){let t,n;let r=e(eZ,ez),o=r.domain,i=10;function l(){var a,l;return t=(a=i)===Math.E?Math.log:10===a&&Math.log10||2===a&&Math.log2||(a=Math.log(a),e=>Math.log(e)/a),n=10===(l=i)?eH:l===Math.E?Math.exp:e=>Math.pow(l,e),o()[0]<0?(t=eq(t),n=eq(n),e(eB,eF)):e(eZ,ez),r}return r.base=function(e){return arguments.length?(i=+e,l()):i},r.domain=function(e){return arguments.length?(o(e),l()):o()},r.ticks=e=>{let r,a;let l=o(),s=l[0],c=l[l.length-1],u=c<s;u&&([s,c]=[c,s]);let d=t(s),f=t(c),p=null==e?10:+e,h=[];if(!(i%1)&&f-d<p){if(d=Math.floor(d),f=Math.ceil(f),s>0){for(;d<=f;++d)for(r=1;r<i;++r)if(!((a=d<0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}}else for(;d<=f;++d)for(r=i-1;r>=1;--r)if(!((a=d>0?r/n(-d):r*n(d))<s)){if(a>c)break;h.push(a)}2*h.length<p&&(h=g(s,c,p))}else h=g(d,f,Math.min(f-d,p)).map(n);return u?h.reverse():h},r.tickFormat=(e,o)=>{if(null==e&&(e=10),null==o&&(o=10===i?"s":","),"function"!=typeof o&&(i%1||null!=(o=eO(o)).precision||(o.trim=!0),o=a(o)),e===1/0)return o;let l=Math.max(1,i*e/r.ticks().length);return e=>{let r=e/n(Math.round(t(e)));return r*i<i-.5&&(r*=i),r<=l?o(e):""}},r.nice=()=>o(eL(o(),{floor:e=>n(Math.floor(t(e))),ceil:e=>n(Math.ceil(t(e)))})),r}function eU(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function eK(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function e$(e){var t=1,n=e(eU(1),eK(t));return n.constant=function(n){return arguments.length?e(eU(t=+n),eK(t)):t},eR(n)}a=(o=function(e){var t,n,o,a=void 0===e.grouping||void 0===e.thousands?eT:(t=eA.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,a=[],i=0,l=t[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),a.push(e.substring(o-=l,o+l)),!((s+=l+1)>r));)l=t[i=(i+1)%t.length];return a.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",l=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",c=void 0===e.numerals?eT:(o=eA.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return o[+e]})}),u=void 0===e.percent?"%":e.percent+"",d=void 0===e.minus?"−":e.minus+"",f=void 0===e.nan?"NaN":e.nan+"";function p(e){var t=(e=eO(e)).fill,n=e.align,o=e.sign,p=e.symbol,h=e.zero,m=e.width,g=e.comma,v=e.precision,y=e.trim,b=e.type;"n"===b?(g=!0,b="g"):eN[b]||(void 0===v&&(v=12),y=!0,b="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var x="$"===p?i:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",w="$"===p?l:/[%p]/.test(b)?u:"",k=eN[b],S=/[defgprs%]/.test(b);function E(e){var i,l,u,p=x,E=w;if("c"===b)E=k(e)+E,e="";else{var O=(e=+e)<0||1/e<0;if(e=isNaN(e)?f:k(Math.abs(e),v),y&&(e=function(e){t:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break t;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),O&&0==+e&&"+"!==o&&(O=!1),p=(O?"("===o?o:d:"-"===o||"("===o?"":o)+p,E=("s"===b?eM[8+r/3]:"")+E+(O&&"("===o?")":""),S){for(i=-1,l=e.length;++i<l;)if(48>(u=e.charCodeAt(i))||u>57){E=(46===u?s+e.slice(i+1):e.slice(i))+E,e=e.slice(0,i);break}}}g&&!h&&(e=a(e,1/0));var C=p.length+e.length+E.length,j=C<m?Array(m-C+1).join(t):"";switch(g&&h&&(e=a(j+e,j.length?m-E.length:1/0),j=""),n){case"<":e=p+e+E+j;break;case"=":e=p+j+e+E;break;case"^":e=j.slice(0,C=j.length>>1)+p+e+E+j.slice(C);break;default:e=j+p+e+E}return c(e)}return v=void 0===v?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),E.toString=function(){return e+""},E}return{format:p,formatPrefix:function(e,t){var n=p(((e=eO(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(e_(t)/3))),o=Math.pow(10,-r),a=eM[8+r/3];return function(e){return n(o*e)+a}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,i=o.formatPrefix;var eV=n(36967);function eX(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function eG(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function eY(e){return e<0?-e*e:e*e}function eQ(e){var t=e(eg,eg),n=1;return t.exponent=function(t){return arguments.length?1==(n=+t)?e(eg,eg):.5===n?e(eG,eY):e(eX(n),eX(1/n)):n},eR(t)}function eJ(){var e=eQ(ew());return e.copy=function(){return ex(e,eJ()).exponent(e.exponent())},eS.o.apply(e,arguments),e}function e0(){return eJ.apply(null,arguments).exponent(.5)}function e1(e){return Math.sign(e)*e*e}function e2(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n<o||void 0===n&&o>=o)&&(n=o)}return n}function e6(e,t){let n;if(void 0===t)for(let t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function e4(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function e3(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}let e5=new Date,e8=new Date;function e7(e,t,n,r){function o(t){return e(t=0==arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{let t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,r,a)=>{let i;let l=[];if(n=o.ceil(n),a=null==a?1:Math.floor(a),!(n<r)||!(a>0))return l;do l.push(i=new Date(+n)),t(n,a),e(n);while(i<n&&n<r);return l},o.filter=n=>e7(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(o.count=(t,r)=>(e5.setTime(+t),e8.setTime(+r),e(e5),e(e8),Math.floor(n(e5,e8))),o.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?o.filter(r?t=>r(t)%e==0:t=>o.count(0,t)%e==0):o:null),o}let e9=e7(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);e9.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?e7(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):e9:null,e9.range;let te=e7(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());te.range;let tt=e7(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());tt.range;let tn=e7(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());tn.range;let tr=e7(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getHours());tr.range;let to=e7(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());to.range;let ta=e7(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);ta.range;let ti=e7(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);ti.range;let tl=e7(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));function ts(e){return e7(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}tl.range;let tc=ts(0),tu=ts(1),td=ts(2),tf=ts(3),tp=ts(4),th=ts(5),tm=ts(6);function tg(e){return e7(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/6048e5)}tc.range,tu.range,td.range,tf.range,tp.range,th.range,tm.range;let tv=tg(0),ty=tg(1),tb=tg(2),tx=tg(3),tw=tg(4),tk=tg(5),tS=tg(6);tv.range,ty.range,tb.range,tx.range,tw.range,tk.range,tS.range;let tE=e7(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());tE.range;let tO=e7(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());tO.range;let tC=e7(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());tC.every=e=>isFinite(e=Math.floor(e))&&e>0?e7(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,tC.range;let tj=e7(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function t_(e,t,n,r,o,a){let i=[[te,1,1e3],[te,5,5e3],[te,15,15e3],[te,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[t,1,2592e6],[t,3,7776e6],[e,1,31536e6]];function l(t,n,r){let o=Math.abs(n-t)/r,a=w(([,,e])=>e).right(i,o);if(a===i.length)return e.every(y(t/31536e6,n/31536e6,r));if(0===a)return e9.every(Math.max(y(t,n,r),1));let[l,s]=i[o/i[a-1][2]<i[a][2]/o?a-1:a];return l.every(s)}return[function(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let o=n&&"function"==typeof n.range?n:l(e,t,n),a=o?o.range(e,+t+1):[];return r?a.reverse():a},l]}tj.every=e=>isFinite(e=Math.floor(e))&&e>0?e7(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,tj.range;let[tP,tN]=t_(tj,tO,tv,tl,to,tn),[tT,tA]=t_(tC,tE,tc,ta,tr,tt);function tM(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function tI(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tR(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var tD={"-":"",_:" ",0:"0"},tL=/^\s*\d+/,tZ=/^%/,tz=/[\\^$*+?|[\]().{}]/g;function tB(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",a=o.length;return r+(a<n?Array(n-a+1).join(t)+o:o)}function tF(e){return e.replace(tz,"\\$&")}function tH(e){return RegExp("^(?:"+e.map(tF).join("|")+")","i")}function tq(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function tW(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function tU(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function tK(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function t$(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function tV(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function tX(e,t,n){var r=tL.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function tG(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function tY(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function tQ(e,t,n){var r=tL.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function tJ(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function t0(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function t1(e,t,n){var r=tL.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function t2(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function t6(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function t4(e,t,n){var r=tL.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function t3(e,t,n){var r=tL.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function t5(e,t,n){var r=tL.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function t8(e,t,n){var r=tZ.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function t7(e,t,n){var r=tL.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function t9(e,t,n){var r=tL.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ne(e,t){return tB(e.getDate(),t,2)}function nt(e,t){return tB(e.getHours(),t,2)}function nn(e,t){return tB(e.getHours()%12||12,t,2)}function nr(e,t){return tB(1+ta.count(tC(e),e),t,3)}function no(e,t){return tB(e.getMilliseconds(),t,3)}function na(e,t){return no(e,t)+"000"}function ni(e,t){return tB(e.getMonth()+1,t,2)}function nl(e,t){return tB(e.getMinutes(),t,2)}function ns(e,t){return tB(e.getSeconds(),t,2)}function nc(e){var t=e.getDay();return 0===t?7:t}function nu(e,t){return tB(tc.count(tC(e)-1,e),t,2)}function nd(e){var t=e.getDay();return t>=4||0===t?tp(e):tp.ceil(e)}function nf(e,t){return e=nd(e),tB(tp.count(tC(e),e)+(4===tC(e).getDay()),t,2)}function np(e){return e.getDay()}function nh(e,t){return tB(tu.count(tC(e)-1,e),t,2)}function nm(e,t){return tB(e.getFullYear()%100,t,2)}function ng(e,t){return tB((e=nd(e)).getFullYear()%100,t,2)}function nv(e,t){return tB(e.getFullYear()%1e4,t,4)}function ny(e,t){var n=e.getDay();return tB((e=n>=4||0===n?tp(e):tp.ceil(e)).getFullYear()%1e4,t,4)}function nb(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tB(t/60|0,"0",2)+tB(t%60,"0",2)}function nx(e,t){return tB(e.getUTCDate(),t,2)}function nw(e,t){return tB(e.getUTCHours(),t,2)}function nk(e,t){return tB(e.getUTCHours()%12||12,t,2)}function nS(e,t){return tB(1+ti.count(tj(e),e),t,3)}function nE(e,t){return tB(e.getUTCMilliseconds(),t,3)}function nO(e,t){return nE(e,t)+"000"}function nC(e,t){return tB(e.getUTCMonth()+1,t,2)}function nj(e,t){return tB(e.getUTCMinutes(),t,2)}function n_(e,t){return tB(e.getUTCSeconds(),t,2)}function nP(e){var t=e.getUTCDay();return 0===t?7:t}function nN(e,t){return tB(tv.count(tj(e)-1,e),t,2)}function nT(e){var t=e.getUTCDay();return t>=4||0===t?tw(e):tw.ceil(e)}function nA(e,t){return e=nT(e),tB(tw.count(tj(e),e)+(4===tj(e).getUTCDay()),t,2)}function nM(e){return e.getUTCDay()}function nI(e,t){return tB(ty.count(tj(e)-1,e),t,2)}function nR(e,t){return tB(e.getUTCFullYear()%100,t,2)}function nD(e,t){return tB((e=nT(e)).getUTCFullYear()%100,t,2)}function nL(e,t){return tB(e.getUTCFullYear()%1e4,t,4)}function nZ(e,t){var n=e.getUTCDay();return tB((e=n>=4||0===n?tw(e):tw.ceil(e)).getUTCFullYear()%1e4,t,4)}function nz(){return"+0000"}function nB(){return"%"}function nF(e){return+e}function nH(e){return Math.floor(+e/1e3)}function nq(e){return new Date(e)}function nW(e){return e instanceof Date?+e:+new Date(+e)}function nU(e,t,n,r,o,a,i,l,s,c){var u=ek(),d=u.invert,f=u.domain,p=c(".%L"),h=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),x=c("%Y");function w(e){return(s(e)<e?p:l(e)<e?h:i(e)<e?m:a(e)<e?g:r(e)<e?o(e)<e?v:y:n(e)<e?b:x)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,nW)):f().map(nq)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?w:c(t)},u.nice=function(e){var n=f();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?f(eL(n,e)):u},u.copy=function(){return ex(u,nU(e,t,n,r,o,a,i,l,s,c))},u}function nK(){return eS.o.apply(nU(tT,tA,tC,tE,tc,ta,tr,tt,te,s).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function n$(){return eS.o.apply(nU(tP,tN,tj,tO,tv,ti,to,tn,te,c).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function nV(){var e,t,n,r,o,a=0,i=1,l=eg,s=!1;function c(t){return null==t||isNaN(t=+t)?o:l(0===n?.5:(t=(r(t)-e)*n,s?Math.max(0,Math.min(1,t)):t))}function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,l=e(n,r),c):[l(0),l(1)]}}return c.domain=function(o){return arguments.length?([a,i]=o,e=r(a=+a),t=r(i=+i),n=e===t?0:1/(t-e),c):[a,i]},c.clamp=function(e){return arguments.length?(s=!!e,c):s},c.interpolator=function(e){return arguments.length?(l=e,c):l},c.range=u(ef),c.rangeRound=u(ep),c.unknown=function(e){return arguments.length?(o=e,c):o},function(o){return r=o,e=o(a),t=o(i),n=e===t?0:1/(t-e),c}}function nX(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function nG(){var e=eQ(nV());return e.copy=function(){return nX(e,nG()).exponent(e.exponent())},eS.O.apply(e,arguments)}function nY(){return nG.apply(null,arguments).exponent(.5)}function nQ(){var e,t,n,r,o,a,i,l=0,s=.5,c=1,u=1,d=eg,f=!1;function p(e){return isNaN(e=+e)?i:(e=.5+((e=+a(e))-t)*(u*e<u*t?r:o),d(f?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var n,r,o;return arguments.length?([n,r,o]=t,d=function(e,t){void 0===t&&(t=e,e=ef);for(var n=0,r=t.length-1,o=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(o,o=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}(e,[n,r,o]),p):[d(0),d(.5),d(1)]}}return p.domain=function(i){return arguments.length?([l,s,c]=i,e=a(l=+l),t=a(s=+s),n=a(c=+c),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),u=t<e?-1:1,p):[l,s,c]},p.clamp=function(e){return arguments.length?(f=!!e,p):f},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=h(ef),p.rangeRound=h(ep),p.unknown=function(e){return arguments.length?(i=e,p):i},function(i){return a=i,e=i(l),t=i(s),n=i(c),r=e===t?0:.5/(t-e),o=t===n?0:.5/(n-t),u=t<e?-1:1,p}}function nJ(){var e=eQ(nQ());return e.copy=function(){return nX(e,nJ()).exponent(e.exponent())},eS.O.apply(e,arguments)}function n0(){return nJ.apply(null,arguments).exponent(.5)}function n1(e,t){if((o=e.length)>1)for(var n,r,o,a=1,i=e[t[0]],l=i.length;a<o;++a)for(r=i,i=e[t[a]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}s=(l=function(e){var t=e.dateTime,n=e.date,r=e.time,o=e.periods,a=e.days,i=e.shortDays,l=e.months,s=e.shortMonths,c=tH(o),u=tq(o),d=tH(a),f=tq(a),p=tH(i),h=tq(i),m=tH(l),g=tq(l),v=tH(s),y=tq(s),b={a:function(e){return i[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:null,d:ne,e:ne,f:na,g:ng,G:ny,H:nt,I:nn,j:nr,L:no,m:ni,M:nl,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:nF,s:nH,S:ns,u:nc,U:nu,V:nf,w:np,W:nh,x:null,X:null,y:nm,Y:nv,Z:nb,"%":nB},x={a:function(e){return i[e.getUTCDay()]},A:function(e){return a[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return l[e.getUTCMonth()]},c:null,d:nx,e:nx,f:nO,g:nD,G:nZ,H:nw,I:nk,j:nS,L:nE,m:nC,M:nj,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:nF,s:nH,S:n_,u:nP,U:nN,V:nA,w:nM,W:nI,x:null,X:null,y:nR,Y:nL,Z:nz,"%":nB},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:t0,e:t0,f:t5,g:tG,G:tX,H:t2,I:t2,j:t1,L:t3,m:tJ,M:t6,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:tQ,Q:t7,s:t9,S:t4,u:tU,U:tK,V:t$,w:tW,W:tV,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:tG,Y:tX,Z:tY,"%":t8};function k(e,t){return function(n){var r,o,a,i=[],l=-1,s=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++l<c;)37===e.charCodeAt(l)&&(i.push(e.slice(s,l)),null!=(o=tD[r=e.charAt(++l)])?r=e.charAt(++l):o="e"===r?" ":"0",(a=t[r])&&(r=a(n,o)),i.push(r),s=l+1);return i.push(e.slice(s,l)),i.join("")}}function S(e,t){return function(n){var r,o,a=tR(1900,void 0,1);if(E(a,e,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!t||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(r=(o=(r=tI(tR(a.y,0,1))).getUTCDay())>4||0===o?ty.ceil(r):ty(r),r=ti.offset(r,(a.V-1)*7),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(r=(o=(r=tM(tR(a.y,0,1))).getDay())>4||0===o?tu.ceil(r):tu(r),r=ta.offset(r,(a.V-1)*7),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?tI(tR(a.y,0,1)).getUTCDay():tM(tR(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,tI(a)):tM(a)}}function E(e,t,n,r){for(var o,a,i=0,l=t.length,s=n.length;i<l;){if(r>=s)return -1;if(37===(o=t.charCodeAt(i++))){if(!(a=w[(o=t.charAt(i++))in tD?t.charAt(i++):o])||(r=a(e,n,r))<0)return -1}else if(o!=n.charCodeAt(r++))return -1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,l.parse,c=l.utcFormat,l.utcParse;var n2=n(22516),n6=n(76115);function n4(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function n3(e,t){return e[t]}function n5(e){let t=[];return t.key=e,t}var n8=n(95645),n7=n.n(n8),n9=n(99008),re=n.n(n9),rt=n(77571),rn=n.n(rt),rr=n(86757),ro=n.n(rr),ra=n(42715),ri=n.n(ra),rl=n(13735),rs=n.n(rl),rc=n(11314),ru=n.n(rc),rd=n(82559),rf=n.n(rd),rp=n(75551),rh=n.n(rp),rm=n(21652),rg=n.n(rm),rv=n(34935),ry=n.n(rv),rb=n(61134),rx=n.n(rb);function rw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var rk=function(e){return e},rS={},rE=function(e){return e===rS},rO=function(e){return function t(){return 0==arguments.length||1==arguments.length&&rE(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},rC=function(e){return function e(t,n){return 1===t?n:rO(function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];var i=o.filter(function(e){return e!==rS}).length;return i>=t?n.apply(void 0,o):e(t-i,rO(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=o.map(function(e){return rE(e)?t.shift():e});return n.apply(void 0,((function(e){if(Array.isArray(e))return rw(e)})(a)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return rw(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rw(e,void 0)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(t))}))})}(e.length,e)},rj=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},r_=rC(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),rP=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t.length)return rk;var r=t.reverse(),o=r[0],a=r.slice(1);return function(){return a.reduce(function(e,t){return t(e)},o.apply(void 0,arguments))}},rN=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},rT=function(e){var t=null,n=null;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return t&&o.every(function(e,n){return e===t[n]})?n:(t=o,n=e.apply(void 0,o))}},rA=(rC(function(e,t,n){var r=+e;return r+n*(+t-r)}),rC(function(e,t,n){var r=t-+e;return(n-e)/(r=r||1/0)}),rC(function(e,t,n){var r=t-+e;return Math.max(0,Math.min(1,(n-e)/(r=r||1/0)))}),{rangeStep:function(e,t,n){for(var r=new(rx())(e),o=0,a=[];r.lt(t)&&o<1e5;)a.push(r.toNumber()),r=r.add(n),o++;return a},getDigitCount:function(e){return 0===e?1:Math.floor(new(rx())(e).abs().log(10).toNumber())+1}});function rM(e){return function(e){if(Array.isArray(e))return rD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||rR(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}}(e,t)||rR(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rR(e,t){if(e){if("string"==typeof e)return rD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rD(e,t)}}function rD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rL(e){var t=rI(e,2),n=t[0],r=t[1],o=n,a=r;return n>r&&(o=r,a=n),[o,a]}function rZ(e,t,n){if(e.lte(0))return new(rx())(0);var r=rA.getDigitCount(e.toNumber()),o=new(rx())(10).pow(r),a=e.div(o),i=1!==r?.05:.1,l=new(rx())(Math.ceil(a.div(i).toNumber())).add(n).mul(i).mul(o);return t?l:new(rx())(Math.ceil(l))}function rz(e,t,n){var r=1,o=new(rx())(e);if(!o.isint()&&n){var a=Math.abs(e);a<1?(r=new(rx())(10).pow(rA.getDigitCount(e)-1),o=new(rx())(Math.floor(o.div(r).toNumber())).mul(r)):a>1&&(o=new(rx())(Math.floor(e)))}else 0===e?o=new(rx())(Math.floor((t-1)/2)):n||(o=new(rx())(Math.floor(e)));var i=Math.floor((t-1)/2);return rP(r_(function(e){return o.add(new(rx())(e-i).mul(r)).toNumber()}),rj)(0,t)}var rB=rT(function(e){var t=rI(e,2),n=t[0],r=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=Math.max(o,2),l=rI(rL([n,r]),2),s=l[0],c=l[1];if(s===-1/0||c===1/0){var u=c===1/0?[s].concat(rM(rj(0,o-1).map(function(){return 1/0}))):[].concat(rM(rj(0,o-1).map(function(){return-1/0})),[c]);return n>r?rN(u):u}if(s===c)return rz(s,o,a);var d=function e(t,n,r,o){var a,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new(rx())(0),tickMin:new(rx())(0),tickMax:new(rx())(0)};var l=rZ(new(rx())(n).sub(t).div(r-1),o,i),s=Math.ceil((a=t<=0&&n>=0?new(rx())(0):(a=new(rx())(t).add(n).div(2)).sub(new(rx())(a).mod(l))).sub(t).div(l).toNumber()),c=Math.ceil(new(rx())(n).sub(a).div(l).toNumber()),u=s+c+1;return u>r?e(t,n,r,o,i+1):(u<r&&(c=n>0?c+(r-u):c,s=n>0?s:s+(r-u)),{step:l,tickMin:a.sub(new(rx())(s).mul(l)),tickMax:a.add(new(rx())(c).mul(l))})}(s,c,i,a),f=d.step,p=d.tickMin,h=d.tickMax,m=rA.rangeStep(p,h.add(new(rx())(.1).mul(f)),f);return n>r?rN(m):m});rT(function(e){var t=rI(e,2),n=t[0],r=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=Math.max(o,2),l=rI(rL([n,r]),2),s=l[0],c=l[1];if(s===-1/0||c===1/0)return[n,r];if(s===c)return rz(s,o,a);var u=rZ(new(rx())(c).sub(s).div(i-1),a,0),d=rP(r_(function(e){return new(rx())(s).add(new(rx())(e).mul(u)).toNumber()}),rj)(0,i).filter(function(e){return e>=s&&e<=c});return n>r?rN(d):d});var rF=rT(function(e,t){var n=rI(e,2),r=n[0],o=n[1],a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=rI(rL([r,o]),2),l=i[0],s=i[1];if(l===-1/0||s===1/0)return[r,o];if(l===s)return[l];var c=rZ(new(rx())(s).sub(l).div(Math.max(t,2)-1),a,0),u=[].concat(rM(rA.rangeStep(new(rx())(l),new(rx())(s).sub(new(rx())(.99).mul(c)),c)),[s]);return r>o?rN(u):u}),rH=n(13137),rq=n(16630),rW=n(82944),rU=n(38569);function rK(e){return(rK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r$(Object(n),!0).forEach(function(t){rX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rX(e,t,n){var r;return(r=function(e,t){if("object"!==rK(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==rK(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===rK(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rG(e){return function(e){if(Array.isArray(e))return rY(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rY(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rY(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rQ(e,t,n){return rn()(e)||rn()(t)?n:(0,rq.P2)(t)?rs()(e,t,n):ro()(t)?t(e):n}function rJ(e,t,n,r){var o=ru()(e,function(e){return rQ(e,t)});if("number"===n){var a=o.filter(function(e){return(0,rq.hj)(e)||parseFloat(e)});return a.length?[re()(a),n7()(a)]:[1/0,-1/0]}return(r?o.filter(function(e){return!rn()(e)}):o).map(function(e){return(0,rq.P2)(e)||e instanceof Date?e:""})}var r0=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,i=null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0;if(i<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var l=o.range,s=0;s<i;s++){var c=s>0?r[s-1].coordinate:r[i-1].coordinate,u=r[s].coordinate,d=s>=i-1?r[0].coordinate:r[s+1].coordinate,f=void 0;if((0,rq.uY)(u-c)!==(0,rq.uY)(d-u)){var p=[];if((0,rq.uY)(d-u)===(0,rq.uY)(l[1]-l[0])){f=d;var h=u+l[1]-l[0];p[0]=Math.min(h,(h+c)/2),p[1]=Math.max(h,(h+c)/2)}else{f=c;var m=d+l[1]-l[0];p[0]=Math.min(u,(m+u)/2),p[1]=Math.max(u,(m+u)/2)}var g=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>g[0]&&e<=g[1]||e>=p[0]&&e<=p[1]){a=r[s].index;break}}else{var v=Math.min(c,d),y=Math.max(c,d);if(e>(v+u)/2&&e<=(y+u)/2){a=r[s].index;break}}}else for(var b=0;b<i;b++)if(0===b&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b>0&&b<i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b===i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2){a=n[b].index;break}return a},r1=function(e){var t,n=e.type.displayName,r=e.props,o=r.stroke,a=r.fill;switch(n){case"Line":t=o;break;case"Area":case"Radar":t=o&&"none"!==o?o:a;break;default:t=a}return t},r2=function(e){var t=e.barSize,n=e.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var o={},a=Object.keys(r),i=0,l=a.length;i<l;i++)for(var s=r[a[i]].stackGroups,c=Object.keys(s),u=0,d=c.length;u<d;u++){var f=s[c[u]],p=f.items,h=f.cateAxisId,m=p.filter(function(e){return(0,rW.Gf)(e.type).indexOf("Bar")>=0});if(m&&m.length){var g=m[0].props.barSize,v=m[0].props[h];o[v]||(o[v]=[]),o[v].push({item:m[0],stackList:m.slice(1),barSize:rn()(g)?t:g})}}return o},r6=function(e){var t,n=e.barGap,r=e.barCategoryGap,o=e.bandSize,a=e.sizeList,i=void 0===a?[]:a,l=e.maxBarSize,s=i.length;if(s<1)return null;var c=(0,rq.h1)(n,o,0,!0),u=[];if(i[0].barSize===+i[0].barSize){var d=!1,f=o/s,p=i.reduce(function(e,t){return e+t.barSize||0},0);(p+=(s-1)*c)>=o&&(p-=(s-1)*c,c=0),p>=o&&f>0&&(d=!0,f*=.9,p=s*f);var h={offset:((o-p)/2>>0)-c,size:0};t=i.reduce(function(e,t){var n={item:t.item,position:{offset:h.offset+h.size+c,size:d?f:t.barSize}},r=[].concat(rG(e),[n]);return h=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:h})}),r},u)}else{var m=(0,rq.h1)(r,o,0,!0);o-2*m-(s-1)*c<=0&&(c=0);var g=(o-2*m-(s-1)*c)/s;g>1&&(g>>=0);var v=l===+l?Math.min(g,l):g;t=i.reduce(function(e,t,n){var r=[].concat(rG(e),[{item:t.item,position:{offset:m+(g+c)*n+(g-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return t},r4=function(e,t,n,r){var o=n.children,a=n.width,i=n.margin,l=a-(i.left||0)-(i.right||0),s=(0,rU.z)({children:o,legendWidth:l});if(s){var c=r||{},u=c.width,d=c.height,f=s.align,p=s.verticalAlign,h=s.layout;if(("vertical"===h||"horizontal"===h&&"middle"===p)&&"center"!==f&&(0,rq.hj)(e[f]))return rV(rV({},e),{},rX({},f,e[f]+(u||0)));if(("horizontal"===h||"vertical"===h&&"center"===f)&&"middle"!==p&&(0,rq.hj)(e[p]))return rV(rV({},e),{},rX({},p,e[p]+(d||0)))}return e},r3=function(e,t,n,r,o){var a=t.props.children,i=(0,rW.NN)(a,rH.W).filter(function(e){var t;return t=e.props.direction,!!rn()(o)||("horizontal"===r?"yAxis"===o:"vertical"===r||"x"===t?"xAxis"===o:"y"!==t||"yAxis"===o)});if(i&&i.length){var l=i.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=rQ(t,n,0),o=Array.isArray(r)?[re()(r),n7()(r)]:[r,r],a=l.reduce(function(e,n){var r=rQ(t,n,0),a=o[0]-Math.abs(Array.isArray(r)?r[0]:r),i=o[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(i,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},r5=function(e,t,n,r,o){var a=t.map(function(t){return r3(e,t,n,o,r)}).filter(function(e){return!rn()(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},r8=function(e,t,n,r,o){var a=t.map(function(t){var a=t.props.dataKey;return"number"===n&&a&&r3(e,t,a,r)||rJ(e,a,n,o)});if("number"===n)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var i={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)i[t[n]]||(i[t[n]]=!0,e.push(t[n]));return e},[])},r7=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},r9=function(e,t,n,r){if(r)return e.map(function(e){return e.coordinate});var o,a,i=e.map(function(e){return e.coordinate===t&&(o=!0),e.coordinate===n&&(a=!0),e.coordinate});return o||i.push(t),a||i.push(n),i},oe=function(e,t,n){if(!e)return null;var r=e.scale,o=e.duplicateDomain,a=e.type,i=e.range,l="scaleBand"===e.realScaleType?r.bandwidth()/2:2,s=(t||n)&&"category"===a&&r.bandwidth?r.bandwidth()/l:0;return(s="angleAxis"===e.axisType&&(null==i?void 0:i.length)>=2?2*(0,rq.uY)(i[0]-i[1])*s:s,t&&(e.ticks||e.niceTicks))?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(o?o.indexOf(e):e)+s,value:e,offset:s}}).filter(function(e){return!rf()(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+s,value:e,index:t,offset:s}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+s,value:e,offset:s}}):r.domain().map(function(e,t){return{coordinate:r(e)+s,value:o?o[e]:e,index:t,offset:s}})},ot=new WeakMap,on=function(e,t){if("function"!=typeof t)return e;ot.has(e)||ot.set(e,new WeakMap);var n=ot.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},or=function(e,t,n){var r=e.scale,o=e.type,a=e.layout,i=e.axisType;if("auto"===r)return"radial"===a&&"radiusAxis"===i?{scale:d.Z(),realScaleType:"band"}:"radial"===a&&"angleAxis"===i?{scale:eD(),realScaleType:"linear"}:"category"===o&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!n)?{scale:d.x(),realScaleType:"point"}:"category"===o?{scale:d.Z(),realScaleType:"band"}:{scale:eD(),realScaleType:"linear"};if(ri()(r)){var l="scale".concat(rh()(r));return{scale:(u[l]||d.x)(),realScaleType:u[l]?l:"point"}}return ro()(r)?{scale:r}:{scale:d.x(),realScaleType:"point"}},oo=function(e){var t=e.domain();if(t&&!(t.length<=2)){var n=t.length,r=e.range(),o=Math.min(r[0],r[1])-1e-4,a=Math.max(r[0],r[1])+1e-4,i=e(t[0]),l=e(t[n-1]);(i<o||i>a||l<o||l>a)&&e.domain([t[0],t[n-1]])}},oa=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},oi=function(e,t){if(!t||2!==t.length||!(0,rq.hj)(t[0])||!(0,rq.hj)(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),o=[e[0],e[1]];return(!(0,rq.hj)(e[0])||e[0]<n)&&(o[0]=n),(!(0,rq.hj)(e[1])||e[1]>r)&&(o[1]=r),o[0]>r&&(o[0]=r),o[1]<n&&(o[1]=n),o},ol={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var o=0,a=0,i=0;i<t;++i){var l=rf()(e[i][n][1])?e[i][n][0]:e[i][n][1];l>=0?(e[i][n][0]=o,e[i][n][1]=o+l,o=e[i][n][1]):(e[i][n][0]=a,e[i][n][1]=a+l,a=e[i][n][1])}},expand:function(e,t){if((r=e.length)>0){for(var n,r,o,a=0,i=e[0].length;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}n1(e,t)}},none:n1,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,o=e[t[0]],a=o.length;r<a;++r){for(var i=0,l=0;i<n;++i)l+=e[i][r][1]||0;o[r][1]+=o[r][0]=-l/2}n1(e,t)}},wiggle:function(e,t){if((o=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,o,a=0,i=1;i<r;++i){for(var l=0,s=0,c=0;l<o;++l){for(var u=e[t[l]],d=u[i][1]||0,f=(d-(u[i-1][1]||0))/2,p=0;p<l;++p){var h=e[t[p]];f+=(h[i][1]||0)-(h[i-1][1]||0)}s+=d,c+=f*d}n[i-1][1]+=n[i-1][0]=a,s&&(a-=c/s)}n[i-1][1]+=n[i-1][0]=a,n1(e,t)}},positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var o=0,a=0;a<t;++a){var i=rf()(e[a][n][1])?e[a][n][0]:e[a][n][1];i>=0?(e[a][n][0]=o,e[a][n][1]=o+i,o=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},os=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),o=ol[n];return(function(){var e=(0,n6.Z)([]),t=n4,n=n1,r=n3;function o(o){var a,i,l=Array.from(e.apply(this,arguments),n5),s=l.length,c=-1;for(let e of o)for(a=0,++c;a<s;++a)(l[a][c]=[0,+r(e,l[a].key,c,o)]).data=e;for(a=0,i=(0,n2.Z)(t(l));a<s;++a)l[i[a]].index=a;return n(l,i),l}return o.keys=function(t){return arguments.length?(e="function"==typeof t?t:(0,n6.Z)(Array.from(t)),o):e},o.value=function(e){return arguments.length?(r="function"==typeof e?e:(0,n6.Z)(+e),o):r},o.order=function(e){return arguments.length?(t=null==e?n4:"function"==typeof e?e:(0,n6.Z)(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(n=null==e?n1:e,o):n},o})().keys(r).value(function(e,t){return+rQ(e,t,0)}).order(n4).offset(o)(e)},oc=function(e,t,n,r,o,a){if(!e)return null;var i=(a?t.reverse():t).reduce(function(e,t){var o=t.props,a=o.stackId;if(o.hide)return e;var i=t.props[n],l=e[i]||{hasStack:!1,stackGroups:{}};if((0,rq.P2)(a)){var s=l.stackGroups[a]||{numericAxisId:n,cateAxisId:r,items:[]};s.items.push(t),l.hasStack=!0,l.stackGroups[a]=s}else l.stackGroups[(0,rq.EL)("_stackId_")]={numericAxisId:n,cateAxisId:r,items:[t]};return rV(rV({},e),{},rX({},i,l))},{});return Object.keys(i).reduce(function(t,a){var l=i[a];return l.hasStack&&(l.stackGroups=Object.keys(l.stackGroups).reduce(function(t,a){var i=l.stackGroups[a];return rV(rV({},t),{},rX({},a,{numericAxisId:n,cateAxisId:r,items:i.items,stackedData:os(e,i.items,o)}))},{})),rV(rV({},t),{},rX({},a,l))},{})},ou=function(e,t){var n=t.realScaleType,r=t.type,o=t.tickCount,a=t.originalDomain,i=t.allowDecimals,l=n||t.scale;if("auto"!==l&&"linear"!==l)return null;if(o&&"number"===r&&a&&("auto"===a[0]||"auto"===a[1])){var s=e.domain();if(!s.length)return null;var c=rB(s,o,i);return e.domain([re()(c),n7()(c)]),{niceTicks:c}}return o&&"number"===r?{niceTicks:rF(e.domain(),o,i)}:null},od=function(e){var t=e.axis,n=e.ticks,r=e.bandSize,o=e.entry,a=e.index,i=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!rn()(o[t.dataKey])){var l=(0,rq.Ap)(n,"value",o[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var s=rQ(o,rn()(i)?t.dataKey:i);return rn()(s)?null:t.scale(s)},of=function(e){var t=e.axis,n=e.ticks,r=e.offset,o=e.bandSize,a=e.entry,i=e.index;if("category"===t.type)return n[i]?n[i].coordinate+r:null;var l=rQ(a,t.dataKey,t.domain[i]);return rn()(l)?null:t.scale(l)-o/2+r},op=function(e){var t=e.numericAxis,n=t.scale.domain();if("number"===t.type){var r=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return r<=0&&o>=0?0:o<0?o:r}return n[0]},oh=function(e,t){var n=e.props.stackId;if((0,rq.P2)(n)){var r=t[n];if(r){var o=r.items.indexOf(e);return o>=0?r.stackedData[o]:null}}return null},om=function(e,t,n){return Object.keys(e).reduce(function(r,o){var a=e[o].stackedData.reduce(function(e,r){var o=r.slice(t,n+1).reduce(function(e,t){return[re()(t.concat([e[0]]).filter(rq.hj)),n7()(t.concat([e[1]]).filter(rq.hj))]},[1/0,-1/0]);return[Math.min(e[0],o[0]),Math.max(e[1],o[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},og=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ov=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oy=function(e,t,n){if(ro()(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if((0,rq.hj)(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(og.test(e[0])){var o=+og.exec(e[0])[1];r[0]=t[0]-o}else ro()(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if((0,rq.hj)(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(ov.test(e[1])){var a=+ov.exec(e[1])[1];r[1]=t[1]+a}else ro()(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},ob=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var o=ry()(t,function(e){return e.coordinate}),a=1/0,i=1,l=o.length;i<l;i++){var s=o[i],c=o[i-1];a=Math.min((s.coordinate||0)-(c.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},ox=function(e,t,n){return!e||!e.length||rg()(e,rs()(n,"type.defaultProps.domain"))?t:e},ow=function(e,t){var n=e.props,r=n.dataKey,o=n.name,a=n.unit,i=n.formatter,l=n.tooltipType,s=n.chartType,c=n.hide;return rV(rV({},(0,rW.L6)(e,!1)),{},{dataKey:r,unit:a,formatter:i,name:o||r,color:r1(e),value:rQ(t,r),type:l,payload:t,chartType:s,hide:c})}},4094:function(e,t,n){"use strict";n.d(t,{os:function(){return d},xE:function(){return u}});var r=n(34067);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){var r,a;r=t,a=n[t],(r=function(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[r]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var l={widthCache:{},cacheCount:0},s={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},c="recharts_measurement_span",u=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||r.x.isSsr)return{width:0,height:0};var o=(Object.keys(t=i({},n)).forEach(function(e){t[e]||delete t[e]}),t),a=JSON.stringify({text:e,copyStyle:o});if(l.widthCache[a])return l.widthCache[a];try{var u=document.getElementById(c);u||((u=document.createElement("span")).setAttribute("id",c),u.setAttribute("aria-hidden","true"),document.body.appendChild(u));var d=i(i({},s),o);Object.assign(u.style,d),u.textContent="".concat(e);var f=u.getBoundingClientRect(),p={width:f.width,height:f.height};return l.widthCache[a]=p,++l.cacheCount>2e3&&(l.cacheCount=0,l.widthCache={}),p}catch(e){return{width:0,height:0}}},d=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}}},16630:function(e,t,n){"use strict";n.d(t,{Ap:function(){return w},EL:function(){return g},Kt:function(){return y},P2:function(){return h},bv:function(){return b},h1:function(){return v},hU:function(){return f},hj:function(){return p},k4:function(){return x},uY:function(){return d}});var r=n(42715),o=n.n(r),a=n(82559),i=n.n(a),l=n(13735),s=n.n(l),c=n(22345),u=n.n(c),d=function(e){return 0===e?0:e>0?1:-1},f=function(e){return o()(e)&&e.indexOf("%")===e.length-1},p=function(e){return u()(e)&&!i()(e)},h=function(e){return p(e)||o()(e)},m=0,g=function(e){var t=++m;return"".concat(e||"").concat(t)},v=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!p(e)&&!o()(e))return r;if(f(e)){var l=e.indexOf("%");n=t*parseFloat(e.slice(0,l))/100}else n=+e;return i()(n)&&(n=r),a&&n>t&&(n=t),n},y=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},b=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++){if(n[e[r]])return!0;n[e[r]]=!0}return!1},x=function(e,t){return p(e)&&p(t)?function(n){return e+n*(t-e)}:function(){return t}};function w(e,t,n){return e&&e.length?e.find(function(e){return e&&("function"==typeof t?t(e):s()(e,t))===n}):null}},34067:function(e,t,n){"use strict";n.d(t,{x:function(){return r}});var r={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return r[e]},set:function(e,t){if("string"==typeof e)r[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){r[t]=e[t]})}}}},1175:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var r=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o]}},39206:function(e,t,n){"use strict";n.d(t,{$4:function(){return h},Wk:function(){return f},op:function(){return p},t9:function(){return m},z3:function(){return b}});var r=n(77571),o=n.n(r),a=n(16630),i=n(85355);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){var r;return(r=function(e,t){if("object"!==l(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==l(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"===l(r)?r:String(r))in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f=Math.PI/180,p=function(e,t,n,r){return{x:e+Math.cos(-f*r)*n,y:t+Math.sin(-f*r)*n}},h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},m=function(e,t,n,r,l){var s=e.width,f=e.height,p=e.startAngle,m=e.endAngle,g=(0,a.h1)(e.cx,s,s/2),v=(0,a.h1)(e.cy,f,f/2),y=h(s,f,n),b=(0,a.h1)(e.innerRadius,y,0),x=(0,a.h1)(e.outerRadius,y,.8*y);return Object.keys(t).reduce(function(e,n){var a,s=t[n],f=s.domain,h=s.reversed;if(o()(s.range))"angleAxis"===r?a=[p,m]:"radiusAxis"===r&&(a=[b,x]),h&&(a=[a[1],a[0]]);else{var y,w=function(e){if(Array.isArray(e))return e}(y=a=s.range)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{for(a=(n=n.call(e)).next;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(y,2)||function(e,t){if(e){if("string"==typeof e)return d(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,2)}}(y,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();p=w[0],m=w[1]}var k=(0,i.Hq)(s,l),S=k.realScaleType,E=k.scale;E.domain(f).range(a),(0,i.zF)(E);var O=(0,i.g$)(E,c(c({},s),{},{realScaleType:S})),C=c(c(c({},s),O),{},{range:a,radius:x,realScaleType:S,scale:E,cx:g,cy:v,innerRadius:b,outerRadius:x,startAngle:p,endAngle:m});return c(c({},e),{},u({},n,C))},{})},g=function(e,t){var n=e.x,r=e.y;return Math.sqrt(Math.pow(n-t.x,2)+Math.pow(r-t.y,2))},v=function(e,t){var n=e.x,r=e.y,o=t.cx,a=t.cy,i=g({x:n,y:r},{x:o,y:a});if(i<=0)return{radius:i};var l=Math.acos((n-o)/i);return r>a&&(l=2*Math.PI-l),{radius:i,angle:180*l/Math.PI,angleInRadian:l}},y=function(e){var t=e.startAngle,n=e.endAngle,r=Math.min(Math.floor(t/360),Math.floor(n/360));return{startAngle:t-360*r,endAngle:n-360*r}},b=function(e,t){var n,r=v({x:e.x,y:e.y},t),o=r.radius,a=r.angle,i=t.innerRadius,l=t.outerRadius;if(o<i||o>l)return!1;if(0===o)return!0;var s=y(t),u=s.startAngle,d=s.endAngle,f=a;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;n=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;n=f>=d&&f<=u}return n?c(c({},t),{},{radius:o,angle:f+360*Math.min(Math.floor(t.startAngle/360),Math.floor(t.endAngle/360))}):null}},82944:function(e,t,n){"use strict";n.d(t,{$R:function(){return Z},$k:function(){return T},Bh:function(){return L},Gf:function(){return S},L6:function(){return M},NN:function(){return j},TT:function(){return P},eu:function(){return D},rL:function(){return I},sP:function(){return _}});var r=n(13735),o=n.n(r),a=n(77571),i=n.n(a),l=n(42715),s=n.n(l),c=n(86757),u=n.n(c),d=n(28302),f=n.n(d),p=n(2265),h=n(82558),m=n(16630),g=n(46485),v=n(41637),y=["children"],b=["children"];function x(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var k={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},S=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},E=null,O=null,C=function e(t){if(t===E&&Array.isArray(O))return O;var n=[];return p.Children.forEach(t,function(t){i()(t)||((0,h.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),O=n,E=t,n};function j(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return S(e)}):[S(t)],C(e).forEach(function(e){var t=o()(e,"type.displayName")||o()(e,"type.name");-1!==r.indexOf(t)&&n.push(e)}),n}function _(e,t){var n=j(e,t);return n&&n[0]}var P=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!!(0,m.hj)(n)&&!(n<=0)&&!!(0,m.hj)(r)&&!(r<=0)},N=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],T=function(e){return e&&"object"===w(e)&&"cx"in e&&"cy"in e&&"r"in e},A=function(e,t,n,r){var o,a=null!==(o=null===v.ry||void 0===v.ry?void 0:v.ry[r])&&void 0!==o?o:[];return!u()(e)&&(r&&a.includes(t)||v.Yh.includes(t))||n&&v.nv.includes(t)},M=function(e,t,n){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,p.isValidElement)(e)&&(r=e.props),!f()(r))return null;var o={};return Object.keys(r).forEach(function(e){var a;A(null===(a=r)||void 0===a?void 0:a[e],e,t,n)&&(o[e]=r[e])}),o},I=function e(t,n){if(t===n)return!0;var r=p.Children.count(t);if(r!==p.Children.count(n))return!1;if(0===r)return!0;if(1===r)return R(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var o=0;o<r;o++){var a=t[o],i=n[o];if(Array.isArray(a)||Array.isArray(i)){if(!e(a,i))return!1}else if(!R(a,i))return!1}return!0},R=function(e,t){if(i()(e)&&i()(t))return!0;if(!i()(e)&&!i()(t)){var n=e.props||{},r=n.children,o=x(n,y),a=t.props||{},l=a.children,s=x(a,b);if(r&&l)return(0,g.w)(o,s)&&I(r,l);if(!r&&!l)return(0,g.w)(o,s)}return!1},D=function(e,t){var n=[],r={};return C(e).forEach(function(e,o){if(e&&e.type&&s()(e.type)&&N.indexOf(e.type)>=0)n.push(e);else if(e){var a=S(e.type),i=t[a]||{},l=i.handler,c=i.once;if(l&&(!c||!r[a])){var u=l(e,a,o);n.push(u),r[a]=!0}}}),n},L=function(e){var t=e&&e.type;return t&&k[t]?k[t]:null},Z=function(e,t){return C(t).indexOf(e)}},46485:function(e,t,n){"use strict";function r(e,t){for(var n in e)if(({}).hasOwnProperty.call(e,n)&&(!({}).hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if(({}).hasOwnProperty.call(t,r)&&!({}).hasOwnProperty.call(e,r))return!1;return!0}n.d(t,{w:function(){return r}})},38569:function(e,t,n){"use strict";n.d(t,{z:function(){return c}});var r=n(22190),o=n(85355),a=n(82944);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var c=function(e){var t,n=e.children,i=e.formattedGraphicalItems,l=e.legendWidth,c=e.legendContent,u=(0,a.sP)(n,r.D);return u?(t=u.props&&u.props.payload?u.props&&u.props.payload:"children"===c?(i||[]).reduce(function(e,t){var n=t.item,r=t.props,o=r.sectors||r.data||[];return e.concat(o.map(function(e){return{type:u.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(i||[]).map(function(e){var t=e.item,n=t.props,r=n.dataKey,a=n.name,i=n.legendType;return{inactive:n.hide,dataKey:r,type:u.props.iconType||i||"square",color:(0,o.fk)(t),value:a||r,payload:t.props}}),s(s(s({},u.props),r.D.getWithHeight(u,l)),{},{payload:t,item:u})):null}},93528:function(e,t,n){"use strict";n.d(t,{z:function(){return l}});var r=n(47230),o=n.n(r),a=n(86757),i=n.n(a);function l(e,t,n){return!0===t?o()(e,n):i()(t)?o()(e,t):e}},41637:function(e,t,n){"use strict";n.d(t,{Yh:function(){return l},Ym:function(){return d},bw:function(){return f},nv:function(){return u},ry:function(){return c}});var r=n(2265),o=n(28302),a=n.n(o);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var l=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],s=["points","pathLength"],c={svg:["viewBox","children"],polygon:s,polyline:s},u=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],d=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,r.isValidElement)(e)&&(n=e.props),!a()(n))return null;var o={};return Object.keys(n).forEach(function(e){u.includes(e)&&(o[e]=t||function(t){return n[e](n,t)})}),o},f=function(e,t,n){if(!a()(e)||"object"!==i(e))return null;var r=null;return Object.keys(e).forEach(function(o){var a=e[o];u.includes(o)&&"function"==typeof a&&(r||(r={}),r[o]=function(e){return a(t,n,e),null})}),r}},52744:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(80662));t.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,o.default)(e),a="function"==typeof t;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,o=e.value;a?t(r,o,e):o&&((n=n||{})[r]=o)}}),n}},18975:function(e,t,n){"use strict";var r=n(40257);n(24601);var o=n(2265),a=o&&"object"==typeof o&&"default"in o?o:{default:o},i=void 0!==r&&r.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},s=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,o=t.optimizeForSpeed,a=void 0===o?i:o;c(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var s="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=s?s.getAttribute("content"):null}var t=e.prototype;return t.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},t.isOptimizeForSpeed=function(){return this._optimizeForSpeed},t.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},t.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},t.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},t.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},t.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var n="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){i||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},t.deleteRule=function(e){if("undefined"==typeof window){this._serverSheet.deleteRule(e);return}if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},t.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},t.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},t.makeStyleTag=function(e,t,n){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var o=document.head||document.getElementsByTagName("head")[0];return n?o.insertBefore(r,n):o.appendChild(r),r},function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,[{key:"length",get:function(){return this._rulesCount}}]),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var u=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},d={};function f(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return d[r]||(d[r]="jsx-"+u(e+"-"+n)),d[r]}function p(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return d[n]||(d[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[n]}var h=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,o=t.optimizeForSpeed,a=void 0!==o&&o;this._sheet=r||new s({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),r&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,o=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var a=o.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=a,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var o=f(r,n);return{styleId:o,rules:Array.isArray(t)?t.map(function(e){return p(o,e)}):[p(o,t)]}}return{styleId:f(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=o.createContext(null);m.displayName="StyleSheetContext";var g=a.default.useInsertionEffect||a.default.useLayoutEffect,v="undefined"!=typeof window?new h:void 0;function y(e){var t=v||o.useContext(m);return t&&("undefined"==typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}y.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},t.style=y},29:function(e,t,n){"use strict";e.exports=n(18975).style},99623:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}},9973:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},85498:function(e,t,n){"use strict";var r,o,a,i,l,s,c,u,d,f,p,h,m,g,v,y,b,x,w,k,S,E,O,C,j,_,P,N,T,A,M,I,R,D,L,Z,z,B,F,H,q,W,U,K,$,V,X,G,Y;let Q,J,ee;function et(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function en(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}n.d(t,{ZP:function(){return tF}});let er=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return er=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>255*Math.random()&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^n()&15>>+e/4).toString(16))};function eo(e){return"object"==typeof e&&null!==e&&("name"in e&&"AbortError"===e.name||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}let ea=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e){try{if("[object Error]"===Object.prototype.toString.call(e)){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class ei extends Error{}class el extends ei{constructor(e,t,n,r){super(`${el.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=t}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){return e&&r?400===e?new ed(e,t,n,r):401===e?new ef(e,t,n,r):403===e?new ep(e,t,n,r):404===e?new eh(e,t,n,r):409===e?new em(e,t,n,r):422===e?new eg(e,t,n,r):429===e?new ev(e,t,n,r):e>=500?new ey(e,t,n,r):new el(e,t,n,r):new ec({message:n,cause:ea(t)})}}class es extends el{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class ec extends el{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class eu extends ec{constructor({message:e}={}){super({message:e??"Request timed out."})}}class ed extends el{}class ef extends el{}class ep extends el{}class eh extends el{}class em extends el{}class eg extends el{}class ev extends el{}class ey extends el{}let eb=/^[a-z][a-z0-9+.-]*:/i,ex=e=>eb.test(e);function ew(e){return"object"!=typeof e?{}:e??{}}let ek=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new ei(`${e} must be an integer`);if(t<0)throw new ei(`${e} must be a positive integer`);return t},eS=e=>{try{return JSON.parse(e)}catch(e){return}},eE=e=>new Promise(t=>setTimeout(t,e)),eO={off:0,error:200,warn:300,info:400,debug:500},eC=(e,t,n)=>{if(e){if(Object.prototype.hasOwnProperty.call(eO,e))return e;eT(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(eO))}`)}};function ej(){}function e_(e,t,n){return!t||eO[e]>eO[n]?ej:t[e].bind(t)}let eP={error:ej,warn:ej,info:ej,debug:ej},eN=new WeakMap;function eT(e){let t=e.logger,n=e.logLevel??"off";if(!t)return eP;let r=eN.get(t);if(r&&r[0]===n)return r[1];let o={error:e_("error",t,n),warn:e_("warn",t,n),info:e_("info",t,n),debug:e_("debug",t,n)};return eN.set(t,[n,o]),o}let eA=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,"x-api-key"===e.toLowerCase()||"authorization"===e.toLowerCase()||"cookie"===e.toLowerCase()||"set-cookie"===e.toLowerCase()?"***":t]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),eM="0.54.0",eI=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,eR=()=>{let e="undefined"!=typeof Deno&&null!=Deno.build?"deno":"undefined"!=typeof EdgeRuntime?"edge":"[object process]"===Object.prototype.toString.call(void 0!==globalThis.process?globalThis.process:0)?"node":"unknown";if("deno"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":eL(Deno.build.os),"X-Stainless-Arch":eD(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if("node"===e)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":eL(globalThis.process.platform??"unknown"),"X-Stainless-Arch":eD(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,o=n[3]||0;return{browser:e,version:`${t}.${r}.${o}`}}}return null}();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":eM,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},eD=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",eL=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",eZ=()=>Q??(Q=eR());function ez(...e){let t=globalThis.ReadableStream;if(void 0===t)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function eB(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ez({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function eF(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function eH(e){if(null===e||"object"!=typeof e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}let eq=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function eW(e){let t;return(J??(J=(t=new globalThis.TextEncoder).encode.bind(t)))(e)}function eU(e){let t;return(ee??(ee=(t=new globalThis.TextDecoder).decode.bind(t)))(e)}class eK{constructor(){r.set(this,void 0),o.set(this,void 0),et(this,r,new Uint8Array,"f"),et(this,o,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?eW(e):e;et(this,r,function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}([en(this,r,"f"),n]),"f");let a=[];for(;null!=(t=function(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}(en(this,r,"f"),en(this,o,"f")));){if(t.carriage&&null==en(this,o,"f")){et(this,o,t.index,"f");continue}if(null!=en(this,o,"f")&&(t.index!==en(this,o,"f")+1||t.carriage)){a.push(eU(en(this,r,"f").subarray(0,en(this,o,"f")-1))),et(this,r,en(this,r,"f").subarray(en(this,o,"f")),"f"),et(this,o,null,"f");continue}let e=null!==en(this,o,"f")?t.preceding-1:t.preceding,n=eU(en(this,r,"f").subarray(0,e));a.push(n),et(this,r,en(this,r,"f").subarray(t.index),"f"),et(this,o,null,"f")}return a}flush(){return en(this,r,"f").length?this.decode("\n"):[]}}r=new WeakMap,o=new WeakMap,eK.NEWLINE_CHARS=new Set(["\n","\r"]),eK.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class e${constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new e$(async function*(){if(n)throw new ei("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of eV(e,t)){if("completion"===n.event)try{yield JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("message_start"===n.event||"message_delta"===n.event||"message_stop"===n.event||"content_block_start"===n.event||"content_block_delta"===n.event||"content_block_stop"===n.event)try{yield JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("ping"!==n.event&&"error"===n.event)throw new el(void 0,eS(n.data)??n.data,void 0,e.headers)}r=!0}catch(e){if(eo(e))return;throw e}finally{r||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;async function*r(){let t=new eK;for await(let n of eF(e))for(let e of t.decode(n))yield e;for(let e of t.flush())yield e}return new e$(async function*(){if(n)throw new ei("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let e=!1;try{for await(let t of r())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(eo(e))return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=r=>({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new e$(()=>r(e),this.controller),new e$(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this;return ez({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let o=eW(JSON.stringify(n)+"\n");t.enqueue(o)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*eV(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}let n=new eG,r=new eK;for await(let t of eX(eF(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*eX(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?eW(n):n,o=new Uint8Array(t.length+r.length);for(o.set(t),o.set(r,t.length),t=o;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class eG{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}async function eY(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:o,startTime:a}=t,i=await (async()=>{if(t.options.stream)return(eT(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass)?t.options.__streamClass.fromSSEResponse(n,t.controller):e$.fromSSEResponse(n,t.controller);if(204===n.status)return null;if(t.options.__binaryResponse)return n;let r=n.headers.get("content-type"),o=r?.split(";")[0]?.trim();return o?.includes("application/json")||o?.endsWith("+json")?eQ(await n.json(),n):await n.text()})();return eT(e).debug(`[${r}] response parsed`,eA({retryOfRequestLogID:o,url:n.url,status:n.status,body:i,durationMs:Date.now()-a})),i}function eQ(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}class eJ extends Promise{constructor(e,t,n=eY){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,a.set(this,void 0),et(this,a,e,"f")}_thenUnwrap(e){return new eJ(en(this,a,"f"),this.responsePromise,async(t,n)=>eQ(e(await this.parseResponse(t,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(en(this,a,"f"),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}a=new WeakMap;class e0{constructor(e,t,n,r){i.set(this,void 0),et(this,i,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageRequestOptions()}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new ei("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await en(this,i,"f").requestAPIList(this.constructor,e)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(i=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class e1 extends eJ{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await eY(e,t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}class e2 extends e0{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let e=this.first_id;return e?{...this.options,query:{...ew(this.options.query),before_id:e}}:null}let e=this.last_id;return e?{...this.options,query:{...ew(this.options.query),after_id:e}}:null}}let e6=()=>{if("undefined"==typeof File){let{process:e}=globalThis;throw Error("`File` is not defined as a global, which is required for file uploads."+("string"==typeof e?.versions?.node&&20>parseInt(e.versions.node.split("."))?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function e4(e,t,n){return e6(),new File(e,t??"unknown_file",n)}function e3(e){return("object"==typeof e&&null!==e&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}let e5=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],e8=async(e,t)=>({...e,body:await e9(e.body,t)}),e7=new WeakMap,e9=async(e,t)=>{if(!await function(e){let t="function"==typeof e?e:e.fetch,n=e7.get(t);if(n)return n;let r=(async()=>{try{let e="Response"in t?t.Response:(await t("data:,")).constructor,n=new FormData;if(n.toString()===await new e(n).text())return!1;return!0}catch{return!0}})();return e7.set(t,r),r}(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>tr(n,e,t))),n},te=e=>e instanceof Blob&&"name"in e,tt=e=>"object"==typeof e&&null!==e&&(e instanceof Response||e5(e)||te(e)),tn=e=>{if(tt(e))return!0;if(Array.isArray(e))return e.some(tn);if(e&&"object"==typeof e){for(let t in e)if(tn(e[t]))return!0}return!1},tr=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(n instanceof Response){let r={},o=n.headers.get("Content-Type");o&&(r={type:o}),e.append(t,e4([await n.blob()],e3(n),r))}else if(e5(n))e.append(t,e4([await new Response(eB(n)).blob()],e3(n)));else if(te(n))e.append(t,e4([n],e3(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(n=>tr(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>tr(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},to=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ta=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&to(e),ti=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob;async function tl(e,t,n){if(e6(),e=await e,t||(t=e3(e)),ta(e))return e instanceof File&&null==t&&null==n?e:e4([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(ti(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),e4(await ts(r),t,n)}let r=await ts(e);if(!n?.type){let e=r.find(e=>"object"==typeof e&&"type"in e&&e.type);"string"==typeof e&&(n={...n,type:e})}return e4(r,t,n)}async function ts(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(to(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(e5(e))for await(let n of e)t.push(...await ts(n));else{let t=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${t?`; constructor: ${t}`:""}${function(e){if("object"!=typeof e||null===e)return"";let t=Object.getOwnPropertyNames(e);return`; props: [${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`)}return t}class tc{constructor(e){this._client=e}}let tu=Symbol.for("brand.privateNullableHeaders"),td=Array.isArray,tf=e=>{let t=new Headers,n=new Set;for(let r of e){let e=new Set;for(let[o,a]of function*(e){let t;if(!e)return;if(tu in e){let{values:t,nulls:n}=e;for(let e of(yield*t.entries(),n))yield[e,null];return}let n=!1;for(let r of(e instanceof Headers?t=e.entries():td(e)?t=e:(n=!0,t=Object.entries(e??{})),t)){let e=r[0];if("string"!=typeof e)throw TypeError("expected header name to be a string");let t=td(r[1])?r[1]:[r[1]],o=!1;for(let r of t)void 0!==r&&(n&&!o&&(o=!0,yield[e,null]),yield[e,r])}}(r)){let r=o.toLowerCase();e.has(r)||(t.delete(o),e.add(r)),null===a?(t.delete(o),n.add(r)):(t.append(o,a),n.delete(r))}}return{[tu]:!0,values:t,nulls:n}};function tp(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}let th=((e=tp)=>function(t,...n){let r;if(1===t.length)return t[0];let o=!1,a=t.reduce((t,r,a)=>(/[?#]/.test(r)&&(o=!0),t+r+(a===n.length?"":(o?encodeURIComponent:e)(String(n[a])))),""),i=a.split(/[?#]/,1)[0],l=[],s=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;for(;null!==(r=s.exec(i));)l.push({start:r.index,length:r[0].length});if(l.length>0){let e=0,t=l.reduce((t,n)=>{let r=" ".repeat(n.start-e),o="^".repeat(n.length);return e=n.start+n.length,t+r+o},"");throw new ei(`Path parameters result in path with invalid segments:${a}${t}`)}return a})(tp);class tm extends tc{list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/files",e2,{query:r,...t,headers:tf([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(th`/v1/files/${e}`,{...n,headers:tf([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/files/${e}/content`,{...n,headers:tf([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/files/${e}`,{...n,headers:tf([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,t){let{betas:n,...r}=e;return this._client.post("/v1/files",e8({body:r,...t,headers:tf([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])},this._client))}}class tg extends tc{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/models/${e}?beta=true`,{...n,headers:tf([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models?beta=true",e2,{query:r,...t,headers:tf([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}class tv{constructor(e,t){this.iterator=e,this.controller=t}async *decoder(){let e=new eK;for await(let t of this.iterator)for(let n of e.decode(t))yield JSON.parse(n);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,t){if(!e.body){if(t.abort(),void 0!==globalThis.navigator&&"ReactNative"===globalThis.navigator.product)throw new ei("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new ei("Attempted to iterate over a response with no body")}return new tv(eF(e.body),t)}}class ty extends tc{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/messages/batches?beta=true",{body:r,...t,headers:tf([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/messages/batches/${e}?beta=true`,{...n,headers:tf([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",e2,{query:r,...t,headers:tf([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(th`/v1/messages/batches/${e}?beta=true`,{...n,headers:tf([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(th`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:tf([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,t={},n){let r=await this.retrieve(e);if(!r.results_url)throw new ei(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:o}=t??{};return this._client.get(r.results_url,{...n,headers:tf([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tv.fromResponse(t.response,t.controller))}}let tb=e=>{let t=0,n=[];for(;t<e.length;){let r=e[t];if("\\"===r){t++;continue}if("{"===r){n.push({type:"brace",value:"{"}),t++;continue}if("}"===r){n.push({type:"brace",value:"}"}),t++;continue}if("["===r){n.push({type:"paren",value:"["}),t++;continue}if("]"===r){n.push({type:"paren",value:"]"}),t++;continue}if(":"===r){n.push({type:"separator",value:":"}),t++;continue}if(","===r){n.push({type:"delimiter",value:","}),t++;continue}if('"'===r){let o="",a=!1;for(r=e[++t];'"'!==r;){if(t===e.length){a=!0;break}if("\\"===r){if(++t===e.length){a=!0;break}o+=r+e[t],r=e[++t]}else o+=r,r=e[++t]}r=e[++t],a||n.push({type:"string",value:o});continue}let o=/\s/;if(r&&o.test(r)){t++;continue}let a=/[0-9]/;if(r&&a.test(r)||"-"===r||"."===r){let o="";for("-"===r&&(o+=r,r=e[++t]);r&&a.test(r)||"."===r;)o+=r,r=e[++t];n.push({type:"number",value:o});continue}let i=/[a-z]/i;if(r&&i.test(r)){let o="";for(;r&&i.test(r)&&t!==e.length;)o+=r,r=e[++t];"true"==o||"false"==o||"null"===o?n.push({type:"name",value:o}):t++;continue}t++}return n},tx=e=>{if(0===e.length)return e;let t=e[e.length-1];switch(t.type){case"separator":return tx(e=e.slice(0,e.length-1));case"number":let n=t.value[t.value.length-1];if("."===n||"-"===n)return tx(e=e.slice(0,e.length-1));case"string":let r=e[e.length-2];if(r?.type==="delimiter"||r?.type==="brace"&&"{"===r.value)return tx(e=e.slice(0,e.length-1));break;case"delimiter":return tx(e=e.slice(0,e.length-1))}return e},tw=e=>{let t=[];return e.map(e=>{"brace"===e.type&&("{"===e.value?t.push("}"):t.splice(t.lastIndexOf("}"),1)),"paren"===e.type&&("["===e.value?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(t=>{"}"===t?e.push({type:"brace",value:"}"}):"]"===t&&e.push({type:"paren",value:"]"})}),e},tk=e=>{let t="";return e.map(e=>{"string"===e.type?t+='"'+e.value+'"':t+=e.value}),t},tS=e=>JSON.parse(tk(tw(tx(tb(e))))),tE="__json_buf";function tO(e){return"tool_use"===e.type||"server_tool_use"===e.type||"mcp_tool_use"===e.type}class tC{constructor(){l.add(this),this.messages=[],this.receivedMessages=[],s.set(this,void 0),this.controller=new AbortController,c.set(this,void 0),u.set(this,()=>{}),d.set(this,()=>{}),f.set(this,void 0),p.set(this,()=>{}),h.set(this,()=>{}),m.set(this,{}),g.set(this,!1),v.set(this,!1),y.set(this,!1),b.set(this,!1),x.set(this,void 0),w.set(this,void 0),E.set(this,e=>{if(et(this,v,!0,"f"),eo(e)&&(e=new es),e instanceof es)return et(this,y,!0,"f"),this._emit("abort",e);if(e instanceof ei)return this._emit("error",e);if(e instanceof Error){let t=new ei(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new ei(String(e)))}),et(this,c,new Promise((e,t)=>{et(this,u,e,"f"),et(this,d,t,"f")}),"f"),et(this,f,new Promise((e,t)=>{et(this,p,e,"f"),et(this,h,t,"f")}),"f"),en(this,c,"f").catch(()=>{}),en(this,f,"f").catch(()=>{})}get response(){return en(this,x,"f")}get request_id(){return en(this,w,"f")}async withResponse(){let e=await en(this,c,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new tC;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n){let r=new tC;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},en(this,E,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),en(this,l,"m",O).call(this);let{response:o,data:a}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(o),a))en(this,l,"m",C).call(this,e);if(a.controller.signal?.aborted)throw new es;en(this,l,"m",j).call(this)}_connected(e){this.ended||(et(this,x,e,"f"),et(this,w,e?.headers.get("request-id"),"f"),en(this,u,"f").call(this,e),this._emit("connect"))}get ended(){return en(this,g,"f")}get errored(){return en(this,v,"f")}get aborted(){return en(this,y,"f")}abort(){this.controller.abort()}on(e,t){return(en(this,m,"f")[e]||(en(this,m,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=en(this,m,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(en(this,m,"f")[e]||(en(this,m,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{et(this,b,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){et(this,b,!0,"f"),await en(this,f,"f")}get currentMessage(){return en(this,s,"f")}async finalMessage(){return await this.done(),en(this,l,"m",k).call(this)}async finalText(){return await this.done(),en(this,l,"m",S).call(this)}_emit(e,...t){if(en(this,g,"f"))return;"end"===e&&(et(this,g,!0,"f"),en(this,p,"f").call(this));let n=en(this,m,"f")[e];if(n&&(en(this,m,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];en(this,b,"f")||n?.length||Promise.reject(e),en(this,d,"f").call(this,e),en(this,h,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];en(this,b,"f")||n?.length||Promise.reject(e),en(this,d,"f").call(this,e),en(this,h,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",en(this,l,"m",k).call(this))}async _fromReadableStream(e,t){let n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),en(this,l,"m",O).call(this),this._connected(null);let r=e$.fromReadableStream(e,this.controller);for await(let e of r)en(this,l,"m",C).call(this,e);if(r.controller.signal?.aborted)throw new es;en(this,l,"m",j).call(this)}[(s=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,h=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,x=new WeakMap,w=new WeakMap,E=new WeakMap,l=new WeakSet,k=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},S=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(e=>"text"===e.type).map(e=>e.text);if(0===e.length)throw new ei("stream ended without producing a content block with type=text");return e.join(" ")},O=function(){this.ended||et(this,s,void 0,"f")},C=function(e){if(this.ended)return;let t=en(this,l,"m",_).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let n=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===n.type&&this._emit("text",e.delta.text,n.text||"");break;case"citations_delta":"text"===n.type&&this._emit("citation",e.delta.citation,n.citations??[]);break;case"input_json_delta":tO(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break;case"thinking_delta":"thinking"===n.type&&this._emit("thinking",e.delta.thinking,n.thinking);break;case"signature_delta":"thinking"===n.type&&this._emit("signature",n.signature);break;default:e.delta}break}case"message_stop":this._addMessageParam(t),this._addMessage(t,!0);break;case"content_block_stop":this._emit("contentBlock",t.content.at(-1));break;case"message_start":et(this,s,t,"f")}},j=function(){if(this.ended)throw new ei("stream has ended, this shouldn't happen");let e=en(this,s,"f");if(!e)throw new ei("request ended without sending any chunks");return et(this,s,void 0,"f"),e},_=function(e){let t=en(this,s,"f");if("message_start"===e.type){if(t)throw new ei(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new ei(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":case"content_block_stop":return t;case"message_delta":return t.container=e.delta.container,t.stop_reason=e.delta.stop_reason,t.stop_sequence=e.delta.stop_sequence,t.usage.output_tokens=e.usage.output_tokens,null!=e.usage.input_tokens&&(t.usage.input_tokens=e.usage.input_tokens),null!=e.usage.cache_creation_input_tokens&&(t.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),null!=e.usage.cache_read_input_tokens&&(t.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),null!=e.usage.server_tool_use&&(t.usage.server_tool_use=e.usage.server_tool_use),t;case"content_block_start":return t.content.push(e.content_block),t;case"content_block_delta":{let n=t.content.at(e.index);switch(e.delta.type){case"text_delta":n?.type==="text"&&(n.text+=e.delta.text);break;case"citations_delta":n?.type==="text"&&(n.citations??(n.citations=[]),n.citations.push(e.delta.citation));break;case"input_json_delta":if(n&&tO(n)){let t=n[tE]||"";if(Object.defineProperty(n,tE,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t)try{n.input=tS(t)}catch(n){let e=new ei(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${n}. JSON: ${t}`);en(this,E,"f").call(this,e)}}break;case"thinking_delta":n?.type==="thinking"&&(n.thinking+=e.delta.thinking);break;case"signature_delta":n?.type==="thinking"&&(n.signature=e.delta.signature);break;default:e.delta}return t}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on("end",()=>{for(let e of(n=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new e$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}let tj={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192},t_={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};class tP extends tc{constructor(){super(...arguments),this.batches=new ty(this._client)}create(e,t){let{betas:n,...r}=e;r.model in t_&&console.warn(`The model '${r.model}' is deprecated and will reach end-of-life on ${t_[r.model]}Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let o=this._client._options.timeout;if(!r.stream&&null==o){let e=tj[r.model]??void 0;o=this._client.calculateNonstreamingTimeout(r.max_tokens,e)}return this._client.post("/v1/messages?beta=true",{body:r,timeout:o??6e5,...t,headers:tf([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}stream(e,t){return tC.createMessage(this,e,t)}countTokens(e,t){let{betas:n,...r}=e;return this._client.post("/v1/messages/count_tokens?beta=true",{body:r,...t,headers:tf([{"anthropic-beta":[...n??[],"token-counting-2024-11-01"].toString()},t?.headers])})}}tP.Batches=ty;class tN extends tc{constructor(){super(...arguments),this.models=new tg(this._client),this.messages=new tP(this._client),this.files=new tm(this._client)}}tN.Models=tg,tN.Messages=tP,tN.Files=tm;class tT extends tc{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??6e5,...t,headers:tf([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}let tA="__json_buf";function tM(e){return"tool_use"===e.type||"server_tool_use"===e.type}class tI{constructor(){P.add(this),this.messages=[],this.receivedMessages=[],N.set(this,void 0),this.controller=new AbortController,T.set(this,void 0),A.set(this,()=>{}),M.set(this,()=>{}),I.set(this,void 0),R.set(this,()=>{}),D.set(this,()=>{}),L.set(this,{}),Z.set(this,!1),z.set(this,!1),B.set(this,!1),F.set(this,!1),H.set(this,void 0),q.set(this,void 0),K.set(this,e=>{if(et(this,z,!0,"f"),eo(e)&&(e=new es),e instanceof es)return et(this,B,!0,"f"),this._emit("abort",e);if(e instanceof ei)return this._emit("error",e);if(e instanceof Error){let t=new ei(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new ei(String(e)))}),et(this,T,new Promise((e,t)=>{et(this,A,e,"f"),et(this,M,t,"f")}),"f"),et(this,I,new Promise((e,t)=>{et(this,R,e,"f"),et(this,D,t,"f")}),"f"),en(this,T,"f").catch(()=>{}),en(this,I,"f").catch(()=>{})}get response(){return en(this,H,"f")}get request_id(){return en(this,q,"f")}async withResponse(){let e=await en(this,T,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new tI;return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n){let r=new tI;for(let e of t.messages)r._addMessageParam(e);return r._run(()=>r._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},en(this,K,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){this.receivedMessages.push(e),t&&this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),en(this,P,"m",$).call(this);let{response:o,data:a}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();for await(let e of(this._connected(o),a))en(this,P,"m",V).call(this,e);if(a.controller.signal?.aborted)throw new es;en(this,P,"m",X).call(this)}_connected(e){this.ended||(et(this,H,e,"f"),et(this,q,e?.headers.get("request-id"),"f"),en(this,A,"f").call(this,e),this._emit("connect"))}get ended(){return en(this,Z,"f")}get errored(){return en(this,z,"f")}get aborted(){return en(this,B,"f")}abort(){this.controller.abort()}on(e,t){return(en(this,L,"f")[e]||(en(this,L,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=en(this,L,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(en(this,L,"f")[e]||(en(this,L,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{et(this,F,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){et(this,F,!0,"f"),await en(this,I,"f")}get currentMessage(){return en(this,N,"f")}async finalMessage(){return await this.done(),en(this,P,"m",W).call(this)}async finalText(){return await this.done(),en(this,P,"m",U).call(this)}_emit(e,...t){if(en(this,Z,"f"))return;"end"===e&&(et(this,Z,!0,"f"),en(this,R,"f").call(this));let n=en(this,L,"f")[e];if(n&&(en(this,L,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];en(this,F,"f")||n?.length||Promise.reject(e),en(this,M,"f").call(this,e),en(this,D,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];en(this,F,"f")||n?.length||Promise.reject(e),en(this,M,"f").call(this,e),en(this,D,"f").call(this,e),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",en(this,P,"m",W).call(this))}async _fromReadableStream(e,t){let n=t?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),en(this,P,"m",$).call(this),this._connected(null);let r=e$.fromReadableStream(e,this.controller);for await(let e of r)en(this,P,"m",V).call(this,e);if(r.controller.signal?.aborted)throw new es;en(this,P,"m",X).call(this)}[(N=new WeakMap,T=new WeakMap,A=new WeakMap,M=new WeakMap,I=new WeakMap,R=new WeakMap,D=new WeakMap,L=new WeakMap,Z=new WeakMap,z=new WeakMap,B=new WeakMap,F=new WeakMap,H=new WeakMap,q=new WeakMap,K=new WeakMap,P=new WeakSet,W=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},U=function(){if(0===this.receivedMessages.length)throw new ei("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(e=>"text"===e.type).map(e=>e.text);if(0===e.length)throw new ei("stream ended without producing a content block with type=text");return e.join(" ")},$=function(){this.ended||et(this,N,void 0,"f")},V=function(e){if(this.ended)return;let t=en(this,P,"m",G).call(this,e);switch(this._emit("streamEvent",e,t),e.type){case"content_block_delta":{let n=t.content.at(-1);switch(e.delta.type){case"text_delta":"text"===n.type&&this._emit("text",e.delta.text,n.text||"");break;case"citations_delta":"text"===n.type&&this._emit("citation",e.delta.citation,n.citations??[]);break;case"input_json_delta":tM(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break;case"thinking_delta":"thinking"===n.type&&this._emit("thinking",e.delta.thinking,n.thinking);break;case"signature_delta":"thinking"===n.type&&this._emit("signature",n.signature);break;default:e.delta}break}case"message_stop":this._addMessageParam(t),this._addMessage(t,!0);break;case"content_block_stop":this._emit("contentBlock",t.content.at(-1));break;case"message_start":et(this,N,t,"f")}},X=function(){if(this.ended)throw new ei("stream has ended, this shouldn't happen");let e=en(this,N,"f");if(!e)throw new ei("request ended without sending any chunks");return et(this,N,void 0,"f"),e},G=function(e){let t=en(this,N,"f");if("message_start"===e.type){if(t)throw new ei(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!t)throw new ei(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":case"content_block_stop":return t;case"message_delta":return t.stop_reason=e.delta.stop_reason,t.stop_sequence=e.delta.stop_sequence,t.usage.output_tokens=e.usage.output_tokens,null!=e.usage.input_tokens&&(t.usage.input_tokens=e.usage.input_tokens),null!=e.usage.cache_creation_input_tokens&&(t.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),null!=e.usage.cache_read_input_tokens&&(t.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),null!=e.usage.server_tool_use&&(t.usage.server_tool_use=e.usage.server_tool_use),t;case"content_block_start":return t.content.push(e.content_block),t;case"content_block_delta":{let n=t.content.at(e.index);switch(e.delta.type){case"text_delta":n?.type==="text"&&(n.text+=e.delta.text);break;case"citations_delta":n?.type==="text"&&(n.citations??(n.citations=[]),n.citations.push(e.delta.citation));break;case"input_json_delta":if(n&&tM(n)){let t=n[tA]||"";Object.defineProperty(n,tA,{value:t+=e.delta.partial_json,enumerable:!1,writable:!0}),t&&(n.input=tS(t))}break;case"thinking_delta":n?.type==="thinking"&&(n.thinking+=e.delta.thinking);break;case"signature_delta":n?.type==="thinking"&&(n.signature=e.delta.signature);break;default:e.delta}return t}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",n=>{let r=t.shift();r?r.resolve(n):e.push(n)}),this.on("end",()=>{for(let e of(n=!0,t))e.resolve(void 0);t.length=0}),this.on("abort",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),this.on("error",e=>{for(let r of(n=!0,t))r.reject(e);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((e,n)=>t.push({resolve:e,reject:n})).then(e=>e?{value:e,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new e$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class tR extends tc{create(e,t){return this._client.post("/v1/messages/batches",{body:e,...t})}retrieve(e,t){return this._client.get(th`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",e2,{query:e,...t})}delete(e,t){return this._client.delete(th`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(th`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let n=await this.retrieve(e);if(!n.results_url)throw new ei(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...t,headers:tf([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((e,t)=>tv.fromResponse(t.response,t.controller))}}class tD extends tc{constructor(){super(...arguments),this.batches=new tR(this._client)}create(e,t){e.model in tL&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${tL[e.model]}Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let n=this._client._options.timeout;if(!e.stream&&null==n){let t=tj[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,t)}return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...t,stream:e.stream??!1})}stream(e,t){return tI.createMessage(this,e,t)}countTokens(e,t){return this._client.post("/v1/messages/count_tokens",{body:e,...t})}}let tL={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};tD.Batches=tR;class tZ extends tc{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(th`/v1/models/${e}`,{...n,headers:tf([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models",e2,{query:r,...t,headers:tf([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}let tz=e=>void 0!==globalThis.process?globalThis.process.env?.[e]?.trim()??void 0:void 0!==globalThis.Deno?globalThis.Deno.env?.get?.(e)?.trim():void 0;class tB{constructor({baseURL:e=tz("ANTHROPIC_BASE_URL"),apiKey:t=tz("ANTHROPIC_API_KEY")??null,authToken:n=tz("ANTHROPIC_AUTH_TOKEN")??null,...r}={}){Y.set(this,void 0);let o={apiKey:t,authToken:n,...r,baseURL:e||"https://api.anthropic.com"};if(!o.dangerouslyAllowBrowser&&eI())throw new ei("It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n");this.baseURL=o.baseURL,this.timeout=o.timeout??tF.DEFAULT_TIMEOUT,this.logger=o.logger??console;let a="warn";this.logLevel=a,this.logLevel=eC(o.logLevel,"ClientOptions.logLevel",this)??eC(tz("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??a,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??function(){if("undefined"!=typeof fetch)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}(),et(this,Y,eq,"f"),this._options=o,this.apiKey=t,this.authToken=n}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(!(this.apiKey&&e.get("x-api-key")||t.has("x-api-key")||this.authToken&&e.get("authorization")||t.has("authorization")))throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}authHeaders(e){return tf([this.apiKeyAuth(e),this.bearerAuth(e)])}apiKeyAuth(e){if(null!=this.apiKey)return tf([{"X-Api-Key":this.apiKey}])}bearerAuth(e){if(null!=this.authToken)return tf([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new ei(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${eM}`}defaultIdempotencyKey(){return`stainless-node-retry-${er()}`}makeStatusError(e,t,n,r){return el.generate(e,t,n,r)}buildURL(e,t){let n=new URL(ex(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return!function(e){if(!e)return!0;for(let t in e)return!1;return!0}(r)&&(t={...r,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(n.search=this.stringifyQuery(t)),n.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new ei("Streaming is strongly recommended for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(n=>({method:e,path:t,...n})))}request(e,t=null){return new eJ(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,o=r.maxRetries??this.maxRetries;null==t&&(t=o),await this.prepareOptions(r);let{req:a,url:i,timeout:l}=this.buildRequest(r,{retryCount:o-t});await this.prepareRequest(a,{url:i,options:r});let s="log_"+(16777216*Math.random()|0).toString(16).padStart(6,"0"),c=void 0===n?"":`, retryOf: ${n}`,u=Date.now();if(eT(this).debug(`[${s}] sending request`,eA({retryOfRequestLogID:n,method:r.method,url:i,options:r,headers:a.headers})),r.signal?.aborted)throw new es;let d=new AbortController,f=await this.fetchWithTimeout(i,a,l,d).catch(ea),p=Date.now();if(f instanceof Error){let e=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new es;let o=eo(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):""));if(t)return eT(this).info(`[${s}] connection ${o?"timed out":"failed"} - ${e}`),eT(this).debug(`[${s}] connection ${o?"timed out":"failed"} (${e})`,eA({retryOfRequestLogID:n,url:i,durationMs:p-u,message:f.message})),this.retryRequest(r,t,n??s);if(eT(this).info(`[${s}] connection ${o?"timed out":"failed"} - error; no more retries left`),eT(this).debug(`[${s}] connection ${o?"timed out":"failed"} (error; no more retries left)`,eA({retryOfRequestLogID:n,url:i,durationMs:p-u,message:f.message})),o)throw new eu;throw new ec({cause:f})}let h=[...f.headers.entries()].filter(([e])=>"request-id"===e).map(([e,t])=>", "+e+": "+JSON.stringify(t)).join(""),m=`[${s}${c}${h}] ${a.method} ${i} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${p-u}ms`;if(!f.ok){let e=this.shouldRetry(f);if(t&&e){let e=`retrying, ${t} attempts remaining`;return await eH(f.body),eT(this).info(`${m} - ${e}`),eT(this).debug(`[${s}] response error (${e})`,eA({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:p-u})),this.retryRequest(r,t,n??s,f.headers)}let o=e?"error; no more retries left":"error; not retryable";eT(this).info(`${m} - ${o}`);let a=await f.text().catch(e=>ea(e).message),i=eS(a),l=i?void 0:a;throw eT(this).debug(`[${s}] response error (${o})`,eA({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,message:l,durationMs:Date.now()-u})),this.makeStatusError(f.status,i,l,f.headers)}return eT(this).info(m),eT(this).debug(`[${s}] response start`,eA({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:p-u})),{response:f,options:r,controller:d,requestLogID:s,retryOfRequestLogID:n,startTime:u}}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}requestAPIList(e,t){return new e1(this,this.makeRequest(t,null,void 0),e)}async fetchWithTimeout(e,t,n,r){let{signal:o,method:a,...i}=t||{};o&&o.addEventListener("abort",()=>r.abort());let l=setTimeout(()=>r.abort(),n),s=globalThis.ReadableStream&&i.body instanceof globalThis.ReadableStream||"object"==typeof i.body&&null!==i.body&&Symbol.asyncIterator in i.body,c={signal:r.signal,...s?{duplex:"half"}:{},method:"GET",...i};a&&(c.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,c)}finally{clearTimeout(l)}}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||e.status>=500)}async retryRequest(e,t,n,r){let o;let a=r?.get("retry-after-ms");if(a){let e=parseFloat(a);Number.isNaN(e)||(o=e)}let i=r?.get("retry-after");if(i&&!o){let e=parseFloat(i);o=Number.isNaN(e)?Date.parse(i)-Date.now():1e3*e}if(!(o&&0<=o&&o<6e4)){let n=e.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(t,n)}return await eE(o),this.makeRequest(e,t-1,n)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}calculateNonstreamingTimeout(e,t){if(36e5*e/128e3>6e5||null!=t&&e>t)throw new ei("Streaming is strongly recommended for operations that may token longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}buildRequest(e,{retryCount:t=0}={}){let n={...e},{method:r,path:o,query:a}=n,i=this.buildURL(o,a);"timeout"in n&&ek("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:l,body:s}=this.buildBody({options:n}),c=this.buildHeaders({options:e,method:r,bodyHeaders:l,retryCount:t});return{req:{method:r,headers:c,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&s instanceof globalThis.ReadableStream&&{duplex:"half"},...s&&{body:s},...this.fetchOptions??{},...n.fetchOptions??{}},url:i,timeout:n.timeout}}buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let o={};this.idempotencyHeader&&"get"!==t&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=e.idempotencyKey);let a=tf([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...eZ(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(a),a.values}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=tf([t]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||"string"==typeof e&&n.values.has("content-type")||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:"object"==typeof e&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&"function"==typeof e.next)?{bodyHeaders:void 0,body:eB(e)}:en(this,Y,"f").call(this,{body:e,headers:n})}}Y=new WeakMap,tB.Anthropic=tB,tB.HUMAN_PROMPT="\n\nHuman:",tB.AI_PROMPT="\n\nAssistant:",tB.DEFAULT_TIMEOUT=6e5,tB.AnthropicError=ei,tB.APIError=el,tB.APIConnectionError=ec,tB.APIConnectionTimeoutError=eu,tB.APIUserAbortError=es,tB.NotFoundError=eh,tB.ConflictError=em,tB.RateLimitError=ev,tB.BadRequestError=ed,tB.AuthenticationError=ef,tB.InternalServerError=ey,tB.PermissionDeniedError=ep,tB.UnprocessableEntityError=eg,tB.toFile=tl;class tF extends tB{constructor(){super(...arguments),this.completions=new tT(this),this.messages=new tD(this),this.models=new tZ(this),this.beta=new tN(this)}}tF.Completions=tT,tF.Messages=tD,tF.Models=tZ,tF.Beta=tN;let{HUMAN_PROMPT:tH,AI_PROMPT:tq}=tF},21886:function(e,t,n){"use strict";let r,o;n.d(t,{p:function(){return _}});var a,i=n(2265),l=n(13323),s=n(17684),c=n(80004),u=n(93689),d=n(37863),f=n(47634),p=n(24536),h=n(40293),m=n(27847);let g=null!=(a=i.startTransition)?a:function(e){e()};var v=n(37388),y=((r=y||{})[r.Open=0]="Open",r[r.Closed=1]="Closed",r),b=((o=b||{})[o.ToggleDisclosure=0]="ToggleDisclosure",o[o.CloseDisclosure=1]="CloseDisclosure",o[o.SetButtonId=2]="SetButtonId",o[o.SetPanelId=3]="SetPanelId",o[o.LinkPanel=4]="LinkPanel",o[o.UnlinkPanel=5]="UnlinkPanel",o);let x={0:e=>({...e,disclosureState:(0,p.E)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},4:e=>!0===e.linkedPanel?e:{...e,linkedPanel:!0},5:e=>!1===e.linkedPanel?e:{...e,linkedPanel:!1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}},w=(0,i.createContext)(null);function k(e){let t=(0,i.useContext)(w);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Disclosure /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,k),t}return t}w.displayName="DisclosureContext";let S=(0,i.createContext)(null);S.displayName="DisclosureAPIContext";let E=(0,i.createContext)(null);function O(e,t){return(0,p.E)(t.type,x,e,t)}E.displayName="DisclosurePanelContext";let C=i.Fragment,j=m.AN.RenderStrategy|m.AN.Static,_=Object.assign((0,m.yV)(function(e,t){let{defaultOpen:n=!1,...r}=e,o=(0,i.useRef)(null),a=(0,u.T)(t,(0,u.h)(e=>{o.current=e},void 0===e.as||e.as===i.Fragment)),s=(0,i.useRef)(null),c=(0,i.useRef)(null),f=(0,i.useReducer)(O,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:c,panelRef:s,buttonId:null,panelId:null}),[{disclosureState:g,buttonId:v},y]=f,b=(0,l.z)(e=>{y({type:1});let t=(0,h.r)(o);if(!t||!v)return;let n=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(v):t.getElementById(v);null==n||n.focus()}),x=(0,i.useMemo)(()=>({close:b}),[b]),k=(0,i.useMemo)(()=>({open:0===g,close:b}),[g,b]);return i.createElement(w.Provider,{value:f},i.createElement(S.Provider,{value:x},i.createElement(d.up,{value:(0,p.E)(g,{0:d.ZM.Open,1:d.ZM.Closed})},(0,m.sY)({ourProps:{ref:a},theirProps:r,slot:k,defaultTag:C,name:"Disclosure"}))))}),{Button:(0,m.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-disclosure-button-".concat(n),...o}=e,[a,d]=k("Disclosure.Button"),p=(0,i.useContext)(E),h=null!==p&&p===a.panelId,g=(0,i.useRef)(null),y=(0,u.T)(g,t,h?null:a.buttonRef),b=(0,m.Y2)();(0,i.useEffect)(()=>{if(!h)return d({type:2,buttonId:r}),()=>{d({type:2,buttonId:null})}},[r,d,h]);let x=(0,l.z)(e=>{var t;if(h){if(1===a.disclosureState)return;switch(e.key){case v.R.Space:case v.R.Enter:e.preventDefault(),e.stopPropagation(),d({type:0}),null==(t=a.buttonRef.current)||t.focus()}}else switch(e.key){case v.R.Space:case v.R.Enter:e.preventDefault(),e.stopPropagation(),d({type:0})}}),w=(0,l.z)(e=>{e.key===v.R.Space&&e.preventDefault()}),S=(0,l.z)(t=>{var n;(0,f.P)(t.currentTarget)||e.disabled||(h?(d({type:0}),null==(n=a.buttonRef.current)||n.focus()):d({type:0}))}),O=(0,i.useMemo)(()=>({open:0===a.disclosureState}),[a]),C=(0,c.f)(e,g),j=h?{ref:y,type:C,onKeyDown:x,onClick:S}:{ref:y,id:r,type:C,"aria-expanded":0===a.disclosureState,"aria-controls":a.linkedPanel?a.panelId:void 0,onKeyDown:x,onKeyUp:w,onClick:S};return(0,m.sY)({mergeRefs:b,ourProps:j,theirProps:o,slot:O,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,m.yV)(function(e,t){let n=(0,s.M)(),{id:r="headlessui-disclosure-panel-".concat(n),...o}=e,[a,l]=k("Disclosure.Panel"),{close:c}=function e(t){let n=(0,i.useContext)(S);if(null===n){let n=Error("<".concat(t," /> is missing a parent <Disclosure /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(n,e),n}return n}("Disclosure.Panel"),f=(0,m.Y2)(),p=(0,u.T)(t,a.panelRef,e=>{g(()=>l({type:e?4:5}))});(0,i.useEffect)(()=>(l({type:3,panelId:r}),()=>{l({type:3,panelId:null})}),[r,l]);let h=(0,d.oJ)(),v=null!==h?(h&d.ZM.Open)===d.ZM.Open:0===a.disclosureState,y=(0,i.useMemo)(()=>({open:0===a.disclosureState,close:c}),[a,c]);return i.createElement(E.Provider,{value:a.panelId},(0,m.sY)({mergeRefs:f,ourProps:{ref:p,id:r},theirProps:o,slot:y,defaultTag:"div",features:j,visible:v,name:"Disclosure.Panel"}))})})},37388:function(e,t,n){"use strict";let r;n.d(t,{R:function(){return o}});var o=((r=o||{}).Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r)},28517:function(e,t,n){"use strict";let r,o,a,i,l;n.d(t,{R:function(){return K}});var s=n(2265),c=n(64518),u=n(31948);function d(e,t){let[n,r]=(0,s.useState)(e),o=(0,u.E)(e);return(0,c.e)(()=>r(o.current),[o,r,...t]),n}var f=n(62963),p=n(90945),h=n(13323),m=n(17684),g=n(98505),v=n(80004),y=n(93689);let b=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function x(e){var t,n;let r=null!=(t=e.innerText)?t:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let a=!1;for(let e of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),a=!0;let i=a?null!=(n=o.innerText)?n:"":r;return b.test(i)&&(i=i.replace(b,"")),i}function w(e){return[e.screenX,e.screenY]}var k=n(38198),S=n(37863),E=n(47634),O=((r=O||{})[r.First=0]="First",r[r.Previous=1]="Previous",r[r.Next=2]="Next",r[r.Last=3]="Last",r[r.Specific=4]="Specific",r[r.Nothing=5]="Nothing",r),C=n(16015),j=n(37105),_=n(56314),P=n(24536),N=n(40293),T=n(27847),A=n(37388),M=((o=M||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),I=((a=I||{})[a.Single=0]="Single",a[a.Multi=1]="Multi",a),R=((i=R||{})[i.Pointer=0]="Pointer",i[i.Other=1]="Other",i),D=((l=D||{})[l.OpenListbox=0]="OpenListbox",l[l.CloseListbox=1]="CloseListbox",l[l.GoToOption=2]="GoToOption",l[l.Search=3]="Search",l[l.ClearSearch=4]="ClearSearch",l[l.RegisterOption=5]="RegisterOption",l[l.UnregisterOption=6]="UnregisterOption",l[l.RegisterLabel=7]="RegisterLabel",l);function L(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e,n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=(0,j.z2)(t(e.options.slice()),e=>e.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return -1===o&&(o=null),{options:r,activeOptionIndex:o}}let Z={1:e=>e.dataRef.current.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.dataRef.current.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(e=>n(e.dataRef.current.value));return -1!==r&&(t=r),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||1===e.listboxState)return e;let r=L(e),o=function(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=null!=r?r:-1;switch(e.focus){case 0:for(let e=0;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 1:for(let e=o-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 2:for(let e=o+1;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 3:for(let e=n.length-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 4:for(let r=0;r<n.length;++r)if(t.resolveId(n[r],r,n)===e.id)return r;return r;case 5:return null;default:!function(e){throw Error("Unexpected object: "+e)}(e)}}(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:o,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))}),a=o?e.options.indexOf(o):-1;return -1===a||a===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:a,activationTrigger:1}},4:e=>e.dataRef.current.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=L(e,e=>[...e,n]);return null===e.activeOptionIndex&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=L(e,e=>{let n=e.findIndex(e=>e.id===t.id);return -1!==n&&e.splice(n,1),e});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},z=(0,s.createContext)(null);function B(e){let t=(0,s.useContext)(z);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Listbox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,B),t}return t}z.displayName="ListboxActionsContext";let F=(0,s.createContext)(null);function H(e){let t=(0,s.useContext)(F);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Listbox /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,H),t}return t}function q(e,t){return(0,P.E)(t.type,Z,e,t)}F.displayName="ListboxDataContext";let W=s.Fragment,U=T.AN.RenderStrategy|T.AN.Static,K=Object.assign((0,T.yV)(function(e,t){let{value:n,defaultValue:r,form:o,name:a,onChange:i,by:l=(e,t)=>e===t,disabled:u=!1,horizontal:d=!1,multiple:m=!1,...v}=e,b=d?"horizontal":"vertical",x=(0,y.T)(t),[w=m?[]:void 0,E]=(0,f.q)(n,i,r),[C,N]=(0,s.useReducer)(q,{dataRef:(0,s.createRef)(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),A=(0,s.useRef)({static:!1,hold:!1}),M=(0,s.useRef)(null),I=(0,s.useRef)(null),R=(0,s.useRef)(null),D=(0,h.z)("string"==typeof l?(e,t)=>(null==e?void 0:e[l])===(null==t?void 0:t[l]):l),L=(0,s.useCallback)(e=>(0,P.E)(Z.mode,{1:()=>w.some(t=>D(t,e)),0:()=>D(w,e)}),[w]),Z=(0,s.useMemo)(()=>({...C,value:w,disabled:u,mode:m?1:0,orientation:b,compare:D,isSelected:L,optionsPropsRef:A,labelRef:M,buttonRef:I,optionsRef:R}),[w,u,m,C]);(0,c.e)(()=>{C.dataRef.current=Z},[Z]),(0,g.O)([Z.buttonRef,Z.optionsRef],(e,t)=>{var n;N({type:1}),(0,j.sP)(t,j.tJ.Loose)||(e.preventDefault(),null==(n=Z.buttonRef.current)||n.focus())},0===Z.listboxState);let B=(0,s.useMemo)(()=>({open:0===Z.listboxState,disabled:u,value:w}),[Z,u,w]),H=(0,h.z)(e=>{let t=Z.options.find(t=>t.id===e);t&&Y(t.dataRef.current.value)}),U=(0,h.z)(()=>{if(null!==Z.activeOptionIndex){let{dataRef:e,id:t}=Z.options[Z.activeOptionIndex];Y(e.current.value),N({type:2,focus:O.Specific,id:t})}}),K=(0,h.z)(()=>N({type:0})),$=(0,h.z)(()=>N({type:1})),V=(0,h.z)((e,t,n)=>e===O.Specific?N({type:2,focus:O.Specific,id:t,trigger:n}):N({type:2,focus:e,trigger:n})),X=(0,h.z)((e,t)=>(N({type:5,id:e,dataRef:t}),()=>N({type:6,id:e}))),G=(0,h.z)(e=>(N({type:7,id:e}),()=>N({type:7,id:null}))),Y=(0,h.z)(e=>(0,P.E)(Z.mode,{0:()=>null==E?void 0:E(e),1(){let t=Z.value.slice(),n=t.findIndex(t=>D(t,e));return -1===n?t.push(e):t.splice(n,1),null==E?void 0:E(t)}})),Q=(0,h.z)(e=>N({type:3,value:e})),J=(0,h.z)(()=>N({type:4})),ee=(0,s.useMemo)(()=>({onChange:Y,registerOption:X,registerLabel:G,goToOption:V,closeListbox:$,openListbox:K,selectActiveOption:U,selectOption:H,search:Q,clearSearch:J}),[]),et=(0,s.useRef)(null),en=(0,p.G)();return(0,s.useEffect)(()=>{et.current&&void 0!==r&&en.addEventListener(et.current,"reset",()=>{null==E||E(r)})},[et,E]),s.createElement(z.Provider,{value:ee},s.createElement(F.Provider,{value:Z},s.createElement(S.up,{value:(0,P.E)(Z.listboxState,{0:S.ZM.Open,1:S.ZM.Closed})},null!=a&&null!=w&&(0,_.t)({[a]:w}).map((e,t)=>{let[n,r]=e;return s.createElement(k._,{features:k.A.Hidden,ref:0===t?e=>{var t;et.current=null!=(t=null==e?void 0:e.closest("form"))?t:null}:void 0,...(0,T.oA)({key:n,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:n,value:r})})}),(0,T.sY)({ourProps:{ref:x},theirProps:v,slot:B,defaultTag:W,name:"Listbox"}))))}),{Button:(0,T.yV)(function(e,t){var n;let r=(0,m.M)(),{id:o="headlessui-listbox-button-".concat(r),...a}=e,i=H("Listbox.Button"),l=B("Listbox.Button"),c=(0,y.T)(i.buttonRef,t),u=(0,p.G)(),f=(0,h.z)(e=>{switch(e.key){case A.R.Space:case A.R.Enter:case A.R.ArrowDown:e.preventDefault(),l.openListbox(),u.nextFrame(()=>{i.value||l.goToOption(O.First)});break;case A.R.ArrowUp:e.preventDefault(),l.openListbox(),u.nextFrame(()=>{i.value||l.goToOption(O.Last)})}}),g=(0,h.z)(e=>{e.key===A.R.Space&&e.preventDefault()}),b=(0,h.z)(e=>{if((0,E.P)(e.currentTarget))return e.preventDefault();0===i.listboxState?(l.closeListbox(),u.nextFrame(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})})):(e.preventDefault(),l.openListbox())}),x=d(()=>{if(i.labelId)return[i.labelId,o].join(" ")},[i.labelId,o]),w=(0,s.useMemo)(()=>({open:0===i.listboxState,disabled:i.disabled,value:i.value}),[i]),k={ref:c,id:o,type:(0,v.f)(e,i.buttonRef),"aria-haspopup":"listbox","aria-controls":null==(n=i.optionsRef.current)?void 0:n.id,"aria-expanded":0===i.listboxState,"aria-labelledby":x,disabled:i.disabled,onKeyDown:f,onKeyUp:g,onClick:b};return(0,T.sY)({ourProps:k,theirProps:a,slot:w,defaultTag:"button",name:"Listbox.Button"})}),Label:(0,T.yV)(function(e,t){let n=(0,m.M)(),{id:r="headlessui-listbox-label-".concat(n),...o}=e,a=H("Listbox.Label"),i=B("Listbox.Label"),l=(0,y.T)(a.labelRef,t);(0,c.e)(()=>i.registerLabel(r),[r]);let u=(0,h.z)(()=>{var e;return null==(e=a.buttonRef.current)?void 0:e.focus({preventScroll:!0})}),d=(0,s.useMemo)(()=>({open:0===a.listboxState,disabled:a.disabled}),[a]);return(0,T.sY)({ourProps:{ref:l,id:r,onClick:u},theirProps:o,slot:d,defaultTag:"label",name:"Listbox.Label"})}),Options:(0,T.yV)(function(e,t){var n;let r=(0,m.M)(),{id:o="headlessui-listbox-options-".concat(r),...a}=e,i=H("Listbox.Options"),l=B("Listbox.Options"),c=(0,y.T)(i.optionsRef,t),u=(0,p.G)(),f=(0,p.G)(),g=(0,S.oJ)(),v=null!==g?(g&S.ZM.Open)===S.ZM.Open:0===i.listboxState;(0,s.useEffect)(()=>{var e;let t=i.optionsRef.current;t&&0===i.listboxState&&t!==(null==(e=(0,N.r)(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})},[i.listboxState,i.optionsRef]);let b=(0,h.z)(e=>{switch(f.dispose(),e.key){case A.R.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),l.search(e.key);case A.R.Enter:if(e.preventDefault(),e.stopPropagation(),null!==i.activeOptionIndex){let{dataRef:e}=i.options[i.activeOptionIndex];l.onChange(e.current.value)}0===i.mode&&(l.closeListbox(),(0,C.k)().nextFrame(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case(0,P.E)(i.orientation,{vertical:A.R.ArrowDown,horizontal:A.R.ArrowRight}):return e.preventDefault(),e.stopPropagation(),l.goToOption(O.Next);case(0,P.E)(i.orientation,{vertical:A.R.ArrowUp,horizontal:A.R.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),l.goToOption(O.Previous);case A.R.Home:case A.R.PageUp:return e.preventDefault(),e.stopPropagation(),l.goToOption(O.First);case A.R.End:case A.R.PageDown:return e.preventDefault(),e.stopPropagation(),l.goToOption(O.Last);case A.R.Escape:return e.preventDefault(),e.stopPropagation(),l.closeListbox(),u.nextFrame(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})});case A.R.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(l.search(e.key),f.setTimeout(()=>l.clearSearch(),350))}}),x=d(()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.id},[i.buttonRef.current]),w=(0,s.useMemo)(()=>({open:0===i.listboxState}),[i]),k={"aria-activedescendant":null===i.activeOptionIndex||null==(n=i.options[i.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===i.mode||void 0,"aria-labelledby":x,"aria-orientation":i.orientation,id:o,onKeyDown:b,role:"listbox",tabIndex:0,ref:c};return(0,T.sY)({ourProps:k,theirProps:a,slot:w,defaultTag:"ul",features:U,visible:v,name:"Listbox.Options"})}),Option:(0,T.yV)(function(e,t){let n,r,o;let a=(0,m.M)(),{id:i="headlessui-listbox-option-".concat(a),disabled:l=!1,value:d,...f}=e,p=H("Listbox.Option"),g=B("Listbox.Option"),v=null!==p.activeOptionIndex&&p.options[p.activeOptionIndex].id===i,b=p.isSelected(d),k=(0,s.useRef)(null),S=(n=(0,s.useRef)(""),r=(0,s.useRef)(""),(0,h.z)(()=>{let e=k.current;if(!e)return"";let t=e.innerText;if(n.current===t)return r.current;let o=(function(e){let t=e.getAttribute("aria-label");if("string"==typeof t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return"string"==typeof e?e.trim():x(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return x(e).trim()})(e).trim().toLowerCase();return n.current=t,r.current=o,o})),E=(0,u.E)({disabled:l,value:d,domRef:k,get textValue(){return S()}}),j=(0,y.T)(t,k);(0,c.e)(()=>{if(0!==p.listboxState||!v||0===p.activationTrigger)return;let e=(0,C.k)();return e.requestAnimationFrame(()=>{var e,t;null==(t=null==(e=k.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}),e.dispose},[k,v,p.listboxState,p.activationTrigger,p.activeOptionIndex]),(0,c.e)(()=>g.registerOption(i,E),[E,i]);let _=(0,h.z)(e=>{if(l)return e.preventDefault();g.onChange(d),0===p.mode&&(g.closeListbox(),(0,C.k)().nextFrame(()=>{var e;return null==(e=p.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))}),P=(0,h.z)(()=>{if(l)return g.goToOption(O.Nothing);g.goToOption(O.Specific,i)}),N=(o=(0,s.useRef)([-1,-1]),{wasMoved(e){let t=w(e);return(o.current[0]!==t[0]||o.current[1]!==t[1])&&(o.current=t,!0)},update(e){o.current=w(e)}}),A=(0,h.z)(e=>N.update(e)),M=(0,h.z)(e=>{N.wasMoved(e)&&(l||v||g.goToOption(O.Specific,i,0))}),I=(0,h.z)(e=>{N.wasMoved(e)&&(l||v&&g.goToOption(O.Nothing))}),R=(0,s.useMemo)(()=>({active:v,selected:b,disabled:l}),[v,b,l]);return(0,T.sY)({ourProps:{id:i,ref:j,role:"option",tabIndex:!0===l?void 0:-1,"aria-disabled":!0===l||void 0,"aria-selected":b,disabled:void 0,onClick:_,onFocus:P,onPointerEnter:A,onMouseEnter:A,onPointerMove:M,onMouseMove:M,onPointerLeave:I,onMouseLeave:I},theirProps:f,slot:R,defaultTag:"li",name:"Listbox.Option"})})})},31492:function(e,t,n){"use strict";let r,o,a;n.d(t,{O:function(){return D}});var i=n(2265),l=n(37388),s=n(13323),c=n(17684),u=n(64518),d=n(31948),f=n(80004),p=n(93689),h=n(93394),m=n(38198);function g(e){let{onFocus:t}=e,[n,r]=(0,i.useState)(!0),o=(0,h.t)();return n?i.createElement(m._,{as:"button",type:"button",features:m.A.Focusable,onFocus:e=>{e.preventDefault();let n,a=50;n=requestAnimationFrame(function e(){if(a--<=0){n&&cancelAnimationFrame(n);return}if(t()){if(cancelAnimationFrame(n),!o.current)return;r(!1);return}n=requestAnimationFrame(e)})}}):null}var v=n(37105),y=n(24536),b=n(96822),x=n(40293),w=n(27847);let k=i.createContext(null);function S(e){let{children:t}=e,n=i.useRef({groups:new Map,get(e,t){var n;let r=this.groups.get(e);r||(r=new Map,this.groups.set(e,r));let o=null!=(n=r.get(t))?n:0;return r.set(t,o+1),[Array.from(r.keys()).indexOf(t),function(){let e=r.get(t);e>1?r.set(t,e-1):r.delete(t)}]}});return i.createElement(k.Provider,{value:n},t)}function E(e){let t=i.useContext(k);if(!t)throw Error("You must wrap your component in a <StableCollection>");let n=function(){var e,t,n;let r=null!=(n=null==(t=null==(e=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)?void 0:e.ReactCurrentOwner)?void 0:t.current)?n:null;if(!r)return Symbol();let o=[],a=r;for(;a;)o.push(a.index),a=a.return;return"$."+o.join(".")}(),[r,o]=t.current.get(e,n);return i.useEffect(()=>o,[]),r}var O=((r=O||{})[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r),C=((o=C||{})[o.Less=-1]="Less",o[o.Equal=0]="Equal",o[o.Greater=1]="Greater",o),j=((a=j||{})[a.SetSelectedIndex=0]="SetSelectedIndex",a[a.RegisterTab=1]="RegisterTab",a[a.UnregisterTab=2]="UnregisterTab",a[a.RegisterPanel=3]="RegisterPanel",a[a.UnregisterPanel=4]="UnregisterPanel",a);let _={0(e,t){var n;let r=(0,v.z2)(e.tabs,e=>e.current),o=(0,v.z2)(e.panels,e=>e.current),a=r.filter(e=>{var t;return!(null!=(t=e.current)&&t.hasAttribute("disabled"))}),i={...e,tabs:r,panels:o};if(t.index<0||t.index>r.length-1){let n=(0,y.E)(Math.sign(t.index-e.selectedIndex),{[-1]:()=>1,0:()=>(0,y.E)(Math.sign(t.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(0===a.length)return i;let o=(0,y.E)(n,{0:()=>r.indexOf(a[0]),1:()=>r.indexOf(a[a.length-1])});return{...i,selectedIndex:-1===o?e.selectedIndex:o}}let l=r.slice(0,t.index),s=[...r.slice(t.index),...l].find(e=>a.includes(e));if(!s)return i;let c=null!=(n=r.indexOf(s))?n:e.selectedIndex;return -1===c&&(c=e.selectedIndex),{...i,selectedIndex:c}},1(e,t){var n;if(e.tabs.includes(t.tab))return e;let r=e.tabs[e.selectedIndex],o=(0,v.z2)([...e.tabs,t.tab],e=>e.current),a=null!=(n=o.indexOf(r))?n:e.selectedIndex;return -1===a&&(a=e.selectedIndex),{...e,tabs:o,selectedIndex:a}},2:(e,t)=>({...e,tabs:e.tabs.filter(e=>e!==t.tab)}),3:(e,t)=>e.panels.includes(t.panel)?e:{...e,panels:(0,v.z2)([...e.panels,t.panel],e=>e.current)},4:(e,t)=>({...e,panels:e.panels.filter(e=>e!==t.panel)})},P=(0,i.createContext)(null);function N(e){let t=(0,i.useContext)(P);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Tab.Group /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,N),t}return t}P.displayName="TabsDataContext";let T=(0,i.createContext)(null);function A(e){let t=(0,i.useContext)(T);if(null===t){let t=Error("<".concat(e," /> is missing a parent <Tab.Group /> component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,A),t}return t}function M(e,t){return(0,y.E)(t.type,_,e,t)}T.displayName="TabsActionsContext";let I=i.Fragment,R=w.AN.RenderStrategy|w.AN.Static,D=Object.assign((0,w.yV)(function(e,t){var n,r;let o=(0,c.M)(),{id:a="headlessui-tabs-tab-".concat(o),...d}=e,{orientation:h,activation:m,selectedIndex:g,tabs:k,panels:S}=N("Tab"),O=A("Tab"),C=N("Tab"),j=(0,i.useRef)(null),_=(0,p.T)(j,t);(0,u.e)(()=>O.registerTab(j),[O,j]);let P=E("tabs"),T=k.indexOf(j);-1===T&&(T=P);let M=T===g,I=(0,s.z)(e=>{var t;let n=e();if(n===v.fE.Success&&"auto"===m){let e=null==(t=(0,x.r)(j))?void 0:t.activeElement,n=C.tabs.findIndex(t=>t.current===e);-1!==n&&O.change(n)}return n}),R=(0,s.z)(e=>{let t=k.map(e=>e.current).filter(Boolean);if(e.key===l.R.Space||e.key===l.R.Enter){e.preventDefault(),e.stopPropagation(),O.change(T);return}switch(e.key){case l.R.Home:case l.R.PageUp:return e.preventDefault(),e.stopPropagation(),I(()=>(0,v.jA)(t,v.TO.First));case l.R.End:case l.R.PageDown:return e.preventDefault(),e.stopPropagation(),I(()=>(0,v.jA)(t,v.TO.Last))}if(I(()=>(0,y.E)(h,{vertical:()=>e.key===l.R.ArrowUp?(0,v.jA)(t,v.TO.Previous|v.TO.WrapAround):e.key===l.R.ArrowDown?(0,v.jA)(t,v.TO.Next|v.TO.WrapAround):v.fE.Error,horizontal:()=>e.key===l.R.ArrowLeft?(0,v.jA)(t,v.TO.Previous|v.TO.WrapAround):e.key===l.R.ArrowRight?(0,v.jA)(t,v.TO.Next|v.TO.WrapAround):v.fE.Error}))===v.fE.Success)return e.preventDefault()}),D=(0,i.useRef)(!1),L=(0,s.z)(()=>{var e;D.current||(D.current=!0,null==(e=j.current)||e.focus({preventScroll:!0}),O.change(T),(0,b.Y)(()=>{D.current=!1}))}),Z=(0,s.z)(e=>{e.preventDefault()}),z=(0,i.useMemo)(()=>({selected:M}),[M]),B={ref:_,onKeyDown:R,onMouseDown:Z,onClick:L,id:a,role:"tab",type:(0,f.f)(e,j),"aria-controls":null==(r=null==(n=S[T])?void 0:n.current)?void 0:r.id,"aria-selected":M,tabIndex:M?0:-1};return(0,w.sY)({ourProps:B,theirProps:d,slot:z,defaultTag:"button",name:"Tabs.Tab"})}),{Group:(0,w.yV)(function(e,t){let{defaultIndex:n=0,vertical:r=!1,manual:o=!1,onChange:a,selectedIndex:l=null,...c}=e,f=r?"vertical":"horizontal",h=o?"manual":"auto",m=null!==l,y=(0,p.T)(t),[b,x]=(0,i.useReducer)(M,{selectedIndex:null!=l?l:n,tabs:[],panels:[]}),k=(0,i.useMemo)(()=>({selectedIndex:b.selectedIndex}),[b.selectedIndex]),E=(0,d.E)(a||(()=>{})),O=(0,d.E)(b.tabs),C=(0,i.useMemo)(()=>({orientation:f,activation:h,...b}),[f,h,b]),j=(0,s.z)(e=>(x({type:1,tab:e}),()=>x({type:2,tab:e}))),_=(0,s.z)(e=>(x({type:3,panel:e}),()=>x({type:4,panel:e}))),N=(0,s.z)(e=>{A.current!==e&&E.current(e),m||x({type:0,index:e})}),A=(0,d.E)(m?e.selectedIndex:b.selectedIndex),R=(0,i.useMemo)(()=>({registerTab:j,registerPanel:_,change:N}),[]);return(0,u.e)(()=>{x({type:0,index:null!=l?l:n})},[l]),(0,u.e)(()=>{if(void 0===A.current||b.tabs.length<=0)return;let e=(0,v.z2)(b.tabs,e=>e.current);e.some((e,t)=>b.tabs[t]!==e)&&N(e.indexOf(b.tabs[A.current]))}),i.createElement(S,null,i.createElement(T.Provider,{value:R},i.createElement(P.Provider,{value:C},C.tabs.length<=0&&i.createElement(g,{onFocus:()=>{var e,t;for(let n of O.current)if((null==(e=n.current)?void 0:e.tabIndex)===0)return null==(t=n.current)||t.focus(),!0;return!1}}),(0,w.sY)({ourProps:{ref:y},theirProps:c,slot:k,defaultTag:I,name:"Tabs"}))))}),List:(0,w.yV)(function(e,t){let{orientation:n,selectedIndex:r}=N("Tab.List"),o=(0,p.T)(t);return(0,w.sY)({ourProps:{ref:o,role:"tablist","aria-orientation":n},theirProps:e,slot:{selectedIndex:r},defaultTag:"div",name:"Tabs.List"})}),Panels:(0,w.yV)(function(e,t){let{selectedIndex:n}=N("Tab.Panels"),r=(0,p.T)(t),o=(0,i.useMemo)(()=>({selectedIndex:n}),[n]);return(0,w.sY)({ourProps:{ref:r},theirProps:e,slot:o,defaultTag:"div",name:"Tabs.Panels"})}),Panel:(0,w.yV)(function(e,t){var n,r,o,a;let l=(0,c.M)(),{id:s="headlessui-tabs-panel-".concat(l),tabIndex:d=0,...f}=e,{selectedIndex:h,tabs:g,panels:v}=N("Tab.Panel"),y=A("Tab.Panel"),b=(0,i.useRef)(null),x=(0,p.T)(b,t);(0,u.e)(()=>y.registerPanel(b),[y,b]);let k=E("panels"),S=v.indexOf(b);-1===S&&(S=k);let O=S===h,C=(0,i.useMemo)(()=>({selected:O}),[O]),j={ref:x,id:s,role:"tabpanel","aria-labelledby":null==(r=null==(n=g[S])?void 0:n.current)?void 0:r.id,tabIndex:O?d:-1};return O||null!=(o=f.unmount)&&!o||null!=(a=f.static)&&a?(0,w.sY)({ourProps:j,theirProps:f,slot:C,defaultTag:"div",features:R,visible:O,name:"Tabs.Panel"}):i.createElement(m._,{as:"span","aria-hidden":"true",...j})})})},33044:function(e,t,n){"use strict";let r;n.d(t,{u:function(){return A}});var o=n(2265),a=n(90945),i=n(13323),l=n(93394),s=n(64518),c=n(31948),u=n(72238),d=n(93689),f=n(16015),p=n(24536);function h(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e&&n.length>0&&e.classList.add(...n)}function m(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e&&n.length>0&&e.classList.remove(...n)}var g=n(37863),v=n(42120),y=n(27847);function b(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(/\s+/).filter(e=>e.length>1)}let x=(0,o.createContext)(null);x.displayName="TransitionContext";var w=((r=w||{}).Visible="visible",r.Hidden="hidden",r);let k=(0,o.createContext)(null);function S(e){return"children"in e?S(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function E(e,t){let n=(0,c.E)(e),r=(0,o.useRef)([]),s=(0,l.t)(),u=(0,a.G)(),d=(0,i.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.l4.Hidden,o=r.current.findIndex(t=>{let{el:n}=t;return n===e});-1!==o&&((0,p.E)(t,{[y.l4.Unmount](){r.current.splice(o,1)},[y.l4.Hidden](){r.current[o].state="hidden"}}),u.microTask(()=>{var e;!S(r)&&s.current&&(null==(e=n.current)||e.call(n))}))}),f=(0,i.z)(e=>{let t=r.current.find(t=>{let{el:n}=t;return n===e});return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>d(e,y.l4.Unmount)}),h=(0,o.useRef)([]),m=(0,o.useRef)(Promise.resolve()),g=(0,o.useRef)({enter:[],leave:[],idle:[]}),v=(0,i.z)((e,n,r)=>{h.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(t=>{let[n]=t;return n!==e})),null==t||t.chains.current[n].push([e,new Promise(e=>{h.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(g.current[n].map(e=>{let[t,n]=e;return n})).then(()=>e())})]),"enter"===n?m.current=m.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),b=(0,i.z)((e,t,n)=>{Promise.all(g.current[t].splice(0).map(e=>{let[t,n]=e;return n})).then(()=>{var e;null==(e=h.current.shift())||e()}).then(()=>n(t))});return(0,o.useMemo)(()=>({children:r,register:f,unregister:d,onStart:v,onStop:b,wait:m,chains:g}),[f,d,r,v,b,g,m])}function O(){}k.displayName="NestingContext";let C=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function j(e){var t;let n={};for(let r of C)n[r]=null!=(t=e[r])?t:O;return n}let _=y.AN.RenderStrategy,P=(0,y.yV)(function(e,t){let{show:n,appear:r=!1,unmount:a=!0,...l}=e,c=(0,o.useRef)(null),f=(0,d.T)(c,t);(0,u.H)();let p=(0,g.oJ)();if(void 0===n&&null!==p&&(n=(p&g.ZM.Open)===g.ZM.Open),![!0,!1].includes(n))throw Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[h,m]=(0,o.useState)(n?"visible":"hidden"),v=E(()=>{m("hidden")}),[b,w]=(0,o.useState)(!0),O=(0,o.useRef)([n]);(0,s.e)(()=>{!1!==b&&O.current[O.current.length-1]!==n&&(O.current.push(n),w(!1))},[O,n]);let C=(0,o.useMemo)(()=>({show:n,appear:r,initial:b}),[n,r,b]);(0,o.useEffect)(()=>{if(n)m("visible");else if(S(v)){let e=c.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&m("hidden")}else m("hidden")},[n,v]);let j={unmount:a},P=(0,i.z)(()=>{var t;b&&w(!1),null==(t=e.beforeEnter)||t.call(e)}),T=(0,i.z)(()=>{var t;b&&w(!1),null==(t=e.beforeLeave)||t.call(e)});return o.createElement(k.Provider,{value:v},o.createElement(x.Provider,{value:C},(0,y.sY)({ourProps:{...j,as:o.Fragment,children:o.createElement(N,{ref:f,...j,...l,beforeEnter:P,beforeLeave:T})},theirProps:{},defaultTag:o.Fragment,features:_,visible:"visible"===h,name:"Transition"})))}),N=(0,y.yV)(function(e,t){var n,r,w;let O;let{beforeEnter:C,afterEnter:P,beforeLeave:N,afterLeave:T,enter:A,enterFrom:M,enterTo:I,entered:R,leave:D,leaveFrom:L,leaveTo:Z,...z}=e,B=(0,o.useRef)(null),F=(0,d.T)(B,t),H=null==(n=z.unmount)||n?y.l4.Unmount:y.l4.Hidden,{show:q,appear:W,initial:U}=function(){let e=(0,o.useContext)(x);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[K,$]=(0,o.useState)(q?"visible":"hidden"),V=function(){let e=(0,o.useContext)(k);if(null===e)throw Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:X,unregister:G}=V;(0,o.useEffect)(()=>X(B),[X,B]),(0,o.useEffect)(()=>{if(H===y.l4.Hidden&&B.current){if(q&&"visible"!==K){$("visible");return}return(0,p.E)(K,{hidden:()=>G(B),visible:()=>X(B)})}},[K,B,X,G,q,H]);let Y=(0,c.E)({base:b(z.className),enter:b(A),enterFrom:b(M),enterTo:b(I),entered:b(R),leave:b(D),leaveFrom:b(L),leaveTo:b(Z)}),Q=(w={beforeEnter:C,afterEnter:P,beforeLeave:N,afterLeave:T},O=(0,o.useRef)(j(w)),(0,o.useEffect)(()=>{O.current=j(w)},[w]),O),J=(0,u.H)();(0,o.useEffect)(()=>{if(J&&"visible"===K&&null===B.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[B,K,J]);let ee=W&&q&&U,et=J&&(!U||W)?q?"enter":"leave":"idle",en=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[t,n]=(0,o.useState)(e),r=(0,l.t)(),a=(0,o.useCallback)(e=>{r.current&&n(t=>t|e)},[t,r]),i=(0,o.useCallback)(e=>!!(t&e),[t]);return{flags:t,addFlag:a,hasFlag:i,removeFlag:(0,o.useCallback)(e=>{r.current&&n(t=>t&~e)},[n,r]),toggleFlag:(0,o.useCallback)(e=>{r.current&&n(t=>t^e)},[n])}}(0),er=(0,i.z)(e=>(0,p.E)(e,{enter:()=>{en.addFlag(g.ZM.Opening),Q.current.beforeEnter()},leave:()=>{en.addFlag(g.ZM.Closing),Q.current.beforeLeave()},idle:()=>{}})),eo=(0,i.z)(e=>(0,p.E)(e,{enter:()=>{en.removeFlag(g.ZM.Opening),Q.current.afterEnter()},leave:()=>{en.removeFlag(g.ZM.Closing),Q.current.afterLeave()},idle:()=>{}})),ea=E(()=>{$("hidden"),G(B)},V),ei=(0,o.useRef)(!1);!function(e){let{immediate:t,container:n,direction:r,classes:o,onStart:i,onStop:u}=e,d=(0,l.t)(),g=(0,a.G)(),v=(0,c.E)(r);(0,s.e)(()=>{t&&(v.current="enter")},[t]),(0,s.e)(()=>{let e=(0,f.k)();g.add(e.dispose);let t=n.current;if(t&&"idle"!==v.current&&d.current){var r,a,l;let n,s,c,d,g,y,b;return e.dispose(),i.current(v.current),e.add((r=o.current,a="enter"===v.current,l=()=>{e.dispose(),u.current(v.current)},s=a?"enter":"leave",c=(0,f.k)(),d=void 0!==l?(n={called:!1},function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!n.called)return n.called=!0,l(...t)}):()=>{},"enter"===s&&(t.removeAttribute("hidden"),t.style.display=""),g=(0,p.E)(s,{enter:()=>r.enter,leave:()=>r.leave}),y=(0,p.E)(s,{enter:()=>r.enterTo,leave:()=>r.leaveTo}),b=(0,p.E)(s,{enter:()=>r.enterFrom,leave:()=>r.leaveFrom}),m(t,...r.base,...r.enter,...r.enterTo,...r.enterFrom,...r.leave,...r.leaveFrom,...r.leaveTo,...r.entered),h(t,...r.base,...g,...b),c.nextFrame(()=>{m(t,...r.base,...g,...b),h(t,...r.base,...g,...y),function(e,t){let n=(0,f.k)();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[a,i]=[r,o].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t}),l=a+i;if(0!==l){n.group(n=>{n.setTimeout(()=>{t(),n.dispose()},l),n.addEventListener(e,"transitionrun",e=>{e.target===e.currentTarget&&n.dispose()})});let r=n.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();n.add(()=>t()),n.dispose}(t,()=>(m(t,...r.base,...g),h(t,...r.base,...r.entered),d()))}),c.dispose)),e.dispose}},[r])}({immediate:ee,container:B,classes:Y,direction:et,onStart:(0,c.E)(e=>{ei.current=!0,ea.onStart(B,e,er)}),onStop:(0,c.E)(e=>{ei.current=!1,ea.onStop(B,e,eo),"leave"!==e||S(ea)||($("hidden"),G(B))})});let el=z;return ee?el={...el,className:(0,v.A)(z.className,...Y.current.enter,...Y.current.enterFrom)}:ei.current&&(el.className=(0,v.A)(z.className,null==(r=B.current)?void 0:r.className),""===el.className&&delete el.className),o.createElement(k.Provider,{value:ea},o.createElement(g.up,{value:(0,p.E)(K,{visible:g.ZM.Open,hidden:g.ZM.Closed})|en.flags},(0,y.sY)({ourProps:{ref:F},theirProps:el,defaultTag:"div",features:_,visible:"visible"===K,name:"Transition.Child"})))}),T=(0,y.yV)(function(e,t){let n=null!==(0,o.useContext)(x),r=null!==(0,g.oJ)();return o.createElement(o.Fragment,null,!n&&r?o.createElement(P,{ref:t,...e}):o.createElement(N,{ref:t,...e}))}),A=Object.assign(P,{Child:T,Root:P})},62963:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var r=n(2265),o=n(13323);function a(e,t,n){let[a,i]=(0,r.useState)(n),l=void 0!==e,s=(0,r.useRef)(l),c=(0,r.useRef)(!1),u=(0,r.useRef)(!1);return!l||s.current||c.current?l||!s.current||u.current||(u.current=!0,s.current=l,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(c.current=!0,s.current=l,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[l?e:a,(0,o.z)(e=>(l||i(e),null==t?void 0:t(e)))]}},90945:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var r=n(2265),o=n(16015);function a(){let[e]=(0,r.useState)(o.k);return(0,r.useEffect)(()=>()=>e.dispose(),[e]),e}},13323:function(e,t,n){"use strict";n.d(t,{z:function(){return a}});var r=n(2265),o=n(31948);let a=function(e){let t=(0,o.E)(e);return r.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current(...n)},[t])}},17684:function(e,t,n){"use strict";n.d(t,{M:function(){return s}});var r,o=n(2265),a=n(61424),i=n(64518),l=n(72238);let s=null!=(r=o.useId)?r:function(){let e=(0,l.H)(),[t,n]=o.useState(e?()=>a.O.nextId():null);return(0,i.e)(()=>{null===t&&n(a.O.nextId())},[t]),null!=t?""+t:void 0}},93394:function(e,t,n){"use strict";n.d(t,{t:function(){return a}});var r=n(2265),o=n(64518);function a(){let e=(0,r.useRef)(!1);return(0,o.e)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}},64518:function(e,t,n){"use strict";n.d(t,{e:function(){return a}});var r=n(2265),o=n(61424);let a=(e,t)=>{o.O.isServer?(0,r.useEffect)(e,t):(0,r.useLayoutEffect)(e,t)}},31948:function(e,t,n){"use strict";n.d(t,{E:function(){return a}});var r=n(2265),o=n(64518);function a(e){let t=(0,r.useRef)(e);return(0,o.e)(()=>{t.current=e},[e]),t}},98505:function(e,t,n){"use strict";n.d(t,{O:function(){return s}});var r=n(2265),o=n(37105),a=n(31948);function i(e,t,n){let o=(0,a.E)(t);(0,r.useEffect)(()=>{function t(e){o.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)},[e,n])}var l=n(3141);function s(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=(0,r.useRef)(!1);function s(n,r){if(!a.current||n.defaultPrevented)return;let i=r(n);if(null!==i&&i.getRootNode().contains(i)&&i.isConnected){for(let t of function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e)){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(i)||n.composed&&n.composedPath().includes(e))return}return(0,o.sP)(i,o.tJ.Loose)||-1===i.tabIndex||n.preventDefault(),t(n,i)}}(0,r.useEffect)(()=>{requestAnimationFrame(()=>{a.current=n})},[n]);let c=(0,r.useRef)(null);i("pointerdown",e=>{var t,n;a.current&&(c.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),i("mousedown",e=>{var t,n;a.current&&(c.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),i("click",e=>{/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0||/Android/gi.test(window.navigator.userAgent)||c.current&&(s(e,()=>c.current),c.current=null)},!0),i("touchend",e=>s(e,()=>e.target instanceof HTMLElement?e.target:null),!0),(0,l.s)("blur",e=>s(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}},80004:function(e,t,n){"use strict";n.d(t,{f:function(){return i}});var r=n(2265),o=n(64518);function a(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";if("string"==typeof n&&"button"===n.toLowerCase())return"button"}function i(e,t){let[n,i]=(0,r.useState)(()=>a(e));return(0,o.e)(()=>{i(a(e))},[e.type,e.as]),(0,o.e)(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&i("button")},[n,t]),n}},72238:function(e,t,n){"use strict";n.d(t,{H:function(){return i}});var r,o=n(2265),a=n(61424);function i(){let e;let t=(e="undefined"==typeof document,(0,(r||(r=n.t(o,2))).useSyncExternalStore)(()=>()=>{},()=>!1,()=>!e)),[i,l]=o.useState(a.O.isHandoffComplete);return i&&!1===a.O.isHandoffComplete&&l(!1),o.useEffect(()=>{!0!==i&&l(!0)},[i]),o.useEffect(()=>a.O.handoff(),[]),!t&&i}},93689:function(e,t,n){"use strict";n.d(t,{T:function(){return l},h:function(){return i}});var r=n(2265),o=n(13323);let a=Symbol();function i(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return Object.assign(e,{[a]:t})}function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=(0,r.useRef)(t);(0,r.useEffect)(()=>{i.current=t},[t]);let l=(0,o.z)(e=>{for(let t of i.current)null!=t&&("function"==typeof t?t(e):t.current=e)});return t.every(e=>null==e||(null==e?void 0:e[a]))?void 0:l}},3141:function(e,t,n){"use strict";n.d(t,{s:function(){return a}});var r=n(2265),o=n(31948);function a(e,t,n){let a=(0,o.E)(t);(0,r.useEffect)(()=>{function t(e){a.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)},[e,n])}},38198:function(e,t,n){"use strict";let r;n.d(t,{A:function(){return a},_:function(){return i}});var o=n(27847),a=((r=a||{})[r.None=1]="None",r[r.Focusable=2]="Focusable",r[r.Hidden=4]="Hidden",r);let i=(0,o.yV)(function(e,t){var n;let{features:r=1,...a}=e,i={ref:t,"aria-hidden":(2&r)==2||(null!=(n=a["aria-hidden"])?n:void 0),style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(4&r)==4&&(2&r)!=2&&{display:"none"}}};return(0,o.sY)({ourProps:i,theirProps:a,slot:{},defaultTag:"div",name:"Hidden"})})},37863:function(e,t,n){"use strict";let r;n.d(t,{ZM:function(){return i},oJ:function(){return l},up:function(){return s}});var o=n(2265);let a=(0,o.createContext)(null);a.displayName="OpenClosedContext";var i=((r=i||{})[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r);function l(){return(0,o.useContext)(a)}function s(e){let{value:t,children:n}=e;return o.createElement(a.Provider,{value:t},n)}},47634:function(e,t,n){"use strict";function r(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(null==t?void 0:t.getAttribute("disabled"))==="";return!(r&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}n.d(t,{P:function(){return r}})},42120:function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Array.from(new Set(t.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}n.d(t,{A:function(){return r}})},16015:function(e,t,n){"use strict";n.d(t,{k:function(){return function e(){let t=[],n={addEventListener:(e,t,r,o)=>(e.addEventListener(t,r,o),n.add(()=>e.removeEventListener(t,r,o))),requestAnimationFrame(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=requestAnimationFrame(...t);return n.add(()=>cancelAnimationFrame(o))},nextFrame(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.requestAnimationFrame(()=>n.requestAnimationFrame(...t))},setTimeout(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let o=setTimeout(...t);return n.add(()=>clearTimeout(o))},microTask(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];let a={current:!0};return(0,r.Y)(()=>{a.current&&t[0]()}),n.add(()=>{a.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(t){let n=e();return t(n),this.add(()=>n.dispose())},add:e=>(t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}),dispose(){for(let e of t.splice(0))e()}};return n}}});var r=n(96822)},61424:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var r=Object.defineProperty,o=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t,n)=>(o(e,"symbol"!=typeof t?t+"":t,n),n);class i{set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}constructor(){a(this,"current",this.detect()),a(this,"handoffState","pending"),a(this,"currentId",0)}}let l=new i},37105:function(e,t,n){"use strict";let r,o,a,i,l;n.d(t,{GO:function(){return h},TO:function(){return d},fE:function(){return f},jA:function(){return b},sP:function(){return g},tJ:function(){return m},z2:function(){return y}});var s=n(24536),c=n(40293);let u=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(",");var d=((r=d||{})[r.First=1]="First",r[r.Previous=2]="Previous",r[r.Next=4]="Next",r[r.Last=8]="Last",r[r.WrapAround=16]="WrapAround",r[r.NoScroll=32]="NoScroll",r),f=((o=f||{})[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o),p=((a=p||{})[a.Previous=-1]="Previous",a[a.Next=1]="Next",a);function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(u)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var m=((i=m||{})[i.Strict=0]="Strict",i[i.Loose=1]="Loose",i);function g(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e!==(null==(t=(0,c.r)(e))?void 0:t.body)&&(0,s.E)(n,{0:()=>e.matches(u),1(){let t=e;for(;null!==t;){if(t.matches(u))return!0;t=t.parentElement}return!1}})}var v=((l=v||{})[l.Keyboard=0]="Keyboard",l[l.Mouse=1]="Mouse",l);function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let a=r.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function b(e,t){var n,r,o;let{sorted:a=!0,relativeTo:i=null,skipElements:l=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,c=Array.isArray(e)?a?y(e):e:h(e);l.length>0&&c.length>1&&(c=c.filter(e=>!l.includes(e))),i=null!=i?i:s.activeElement;let u=(()=>{if(5&t)return 1;if(10&t)return -1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,c.indexOf(i))-1;if(4&t)return Math.max(0,c.indexOf(i))+1;if(8&t)return c.length-1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=32&t?{preventScroll:!0}:{},p=0,m=c.length,g;do{if(p>=m||p+m<=0)return 0;let e=d+p;if(16&t)e=(e+m)%m;else{if(e<0)return 3;if(e>=m)return 1}null==(g=c[e])||g.focus(f),p+=u}while(g!==s.activeElement);return 6&t&&null!=(o=null==(r=null==(n=g)?void 0:n.matches)?void 0:r.call(n,"textarea,input"))&&o&&g.select(),2}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0))},56314:function(e,t,n){"use strict";function r(e,t){return e?e+"["+t+"]":t}function o(e){var t,n;let r=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(r){for(let t of r.elements)if(t!==e&&("INPUT"===t.tagName&&"submit"===t.type||"BUTTON"===t.tagName&&"submit"===t.type||"INPUT"===t.nodeName&&"image"===t.type)){t.click();return}null==(n=r.requestSubmit)||n.call(r)}}n.d(t,{g:function(){return o},t:function(){return function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let[a,i]of Object.entries(t))!function t(n,o,a){if(Array.isArray(a))for(let[e,i]of a.entries())t(n,r(o,e.toString()),i);else a instanceof Date?n.push([o,a.toISOString()]):"boolean"==typeof a?n.push([o,a?"1":"0"]):"string"==typeof a?n.push([o,a]):"number"==typeof a?n.push([o,"".concat(a)]):null==a?n.push([o,""]):e(a,o,n)}(o,r(n,a),i);return o}}})},24536:function(e,t,n){"use strict";function r(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(e in t){let n=t[e];return"function"==typeof n?n(...o):n}let i=Error('Tried to handle "'.concat(e,'" but there is no handler defined. Only defined handlers are: ').concat(Object.keys(t).map(e=>'"'.concat(e,'"')).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(i,r),i}n.d(t,{E:function(){return r}})},96822:function(e,t,n){"use strict";function r(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}n.d(t,{Y:function(){return r}})},40293:function(e,t,n){"use strict";n.d(t,{r:function(){return o}});var r=n(61424);function o(e){return r.O.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}},27847:function(e,t,n){"use strict";let r,o;n.d(t,{AN:function(){return s},Y2:function(){return f},l4:function(){return c},oA:function(){return g},sY:function(){return u},yV:function(){return m}});var a=n(2265),i=n(42120),l=n(24536),s=((r=s||{})[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r),c=((o=c||{})[o.Unmount=0]="Unmount",o[o.Hidden=1]="Hidden",o);function u(e){let{ourProps:t,theirProps:n,slot:r,defaultTag:o,features:a,visible:i=!0,name:s,mergeRefs:c}=e;c=null!=c?c:p;let u=h(n,t);if(i)return d(u,r,o,s,c);let f=null!=a?a:0;if(2&f){let{static:e=!1,...t}=u;if(e)return d(t,r,o,s,c)}if(1&f){let{unmount:e=!0,...t}=u;return(0,l.E)(e?0:1,{0:()=>null,1:()=>d({...t,hidden:!0,style:{display:"none"}},r,o,s,c)})}return d(u,r,o,s,c)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,{as:l=n,children:s,refName:c="ref",...u}=v(e,["unmount","static"]),d=void 0!==e.ref?{[c]:e.ref}:{},f="function"==typeof s?s(t):s;"className"in u&&u.className&&"function"==typeof u.className&&(u.className=u.className(t));let p={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r);e&&(p["data-headlessui-state"]=n.join(" "))}if(l===a.Fragment&&Object.keys(g(u)).length>0){if(!(0,a.isValidElement)(f)||Array.isArray(f)&&f.length>1)throw Error(['Passing props on "Fragment"!',"","The current component <".concat(r,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(u).map(e=>" - ".concat(e)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>" - ".concat(e)).join("\n")].join("\n"));let e=f.props,t="function"==typeof(null==e?void 0:e.className)?function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return(0,i.A)(null==e?void 0:e.className(...n),u.className)}:(0,i.A)(null==e?void 0:e.className,u.className);return(0,a.cloneElement)(f,Object.assign({},h(f.props,g(v(u,["ref"]))),p,d,{ref:o(f.ref,d.ref)},t?{className:t}:{}))}return(0,a.createElement)(l,Object.assign({},v(u,["ref"]),l!==a.Fragment&&d,l!==a.Fragment&&p),f)}function f(){let e=(0,a.useRef)([]),t=(0,a.useCallback)(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];if(!r.every(e=>null==e))return e.current=r,t}}function p(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(e=>null==e)?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}function h(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return{};if(1===t.length)return t[0];let r={},o={};for(let e of t)for(let t in e)t.startsWith("on")&&"function"==typeof e[t]?(null!=o[t]||(o[t]=[]),o[t].push(e[t])):r[t]=e[t];if(r.disabled||r["aria-disabled"])return Object.assign(r,Object.fromEntries(Object.keys(o).map(e=>[e,void 0])));for(let e in o)Object.assign(r,{[e](t){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];for(let n of o[e]){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;n(t,...r)}}});return r}function m(e){var t;return Object.assign((0,a.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function g(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}},10900:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=o},91777:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});t.Z=o},44643:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},51853:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"}))});t.Z=o},82182:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});t.Z=o},79814:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});t.Z=o},88532:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});t.Z=o},71437:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}))});t.Z=o},82376:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))});t.Z=o},2356:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"}))});t.Z=o},15731:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},45589:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}))});t.Z=o},53410:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});t.Z=o},91126:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},22452:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});t.Z=o},23628:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))});t.Z=o},25327:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});t.Z=o},71157:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},87045:function(e,t,n){"use strict";n.d(t,{j:function(){return a}});var r=n(24112),o=n(45345),a=new class extends r.l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!o.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}}},2894:function(e,t,n){"use strict";n.d(t,{R:function(){return l},m:function(){return i}});var r=n(18238),o=n(7989),a=n(11255),i=class extends o.F{#r;#o;#a;constructor(e){super(),this.mutationId=e.mutationId,this.#o=e.mutationCache,this.#r=[],this.state=e.state||l(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#o.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#o.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){this.#a=(0,a.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#o.canRun(this)});let t="pending"===this.state.status,n=!this.#a.canStart();try{if(!t){this.#i({type:"pending",variables:e,isPaused:n}),await this.#o.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:n})}let r=await this.#a.start();return await this.#o.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#o.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#i({type:"success",data:r}),r}catch(t){try{throw await this.#o.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#o.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#i({type:"error",error:t})}}finally{this.#o.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),r.V.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#o.notify({mutation:this,type:"updated",action:e})})}};function l(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},18238:function(e,t,n){"use strict";n.d(t,{V:function(){return r}});var r=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},o=e=>setTimeout(e,0),a=r=>{t?e.push(r):o(()=>{n(r)})},i=()=>{let t=e;e=[],t.length&&o(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{--t||i()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{o=e}}}()},57853:function(e,t,n){"use strict";n.d(t,{N:function(){return a}});var r=n(24112),o=n(45345),a=new class extends r.l{#l=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!o.sk&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#l!==e&&(this.#l=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#l}}},21733:function(e,t,n){"use strict";n.d(t,{A:function(){return l},z:function(){return s}});var r=n(45345),o=n(18238),a=n(11255),i=n(7989),l=class extends i.F{#s;#c;#u;#a;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#s=function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#s,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){let n=(0,r.oE)(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(r.ZT).catch(r.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#s)}isActive(){return this.observers.some(e=>!1!==(0,r.Nc)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===r.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,r.Kp)(this.state.dataUpdatedAt,e)}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#f?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,o=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,n.signal)})},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{let e=(0,r.cG)(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return(o(n),this.#f=!1,this.options.persister)?this.options.persister(e,n,this):e(n)}};o(i),this.options.behavior?.onFetch(i,this),this.#c=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#i({type:"fetch",meta:i.fetchOptions?.meta});let l=e=>{(0,a.DV)(e)&&e.silent||this.#i({type:"error",error:e}),(0,a.DV)(e)||(this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#a=(0,a.Mz)({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(void 0===e){l(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){l(e);return}this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:l,onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#a.start()}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...s(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=e.error;if((0,a.DV)(n)&&n.revert&&this.#c)return{...this.#c,fetchStatus:"idle"};return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),o.V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function s(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,a.Kw)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}},21623:function(e,t,n){"use strict";n.d(t,{S:function(){return m}});var r=n(45345),o=n(21733),a=n(18238),i=n(24112),l=class extends i.l{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,n){let a=t.queryKey,i=t.queryHash??(0,r.Rm)(a,t),l=this.get(i);return l||(l=new o.A({cache:this,queryKey:a,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(l)),l}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){a.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,r._x)(e,t)):t}notify(e){a.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){a.V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){a.V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},s=n(2894),c=class extends i.l{constructor(e={}){super(),this.config=e,this.#h=new Set,this.#m=new Map,this.#g=0}#h;#m;#g;build(e,t,n){let r=new s.m({mutationCache:this,mutationId:++this.#g,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#h.add(e);let t=u(e);if("string"==typeof t){let n=this.#m.get(t);n?n.push(e):this.#m.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#h.delete(e)){let t=u(e);if("string"==typeof t){let n=this.#m.get(t);if(n){if(n.length>1){let t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#m.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=u(e);if("string"!=typeof t)return!0;{let n=this.#m.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=u(e);if("string"!=typeof t)return Promise.resolve();{let n=this.#m.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}}clear(){a.V.batch(()=>{this.#h.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#h.clear(),this.#m.clear()})}getAll(){return Array.from(this.#h)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,r.X7)(e,t))}notify(e){a.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return a.V.batch(()=>Promise.all(e.map(e=>e.continue().catch(r.ZT))))}};function u(e){return e.options.scope?.id}var d=n(87045),f=n(57853);function p(e){return{onFetch:(t,n)=>{let o=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],l=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,u=async()=>{let n=!1,u=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",()=>{n=!0}),t.signal)})},d=(0,r.cG)(t.options,t.fetchOptions),f=async(e,o,a)=>{if(n)return Promise.reject();if(null==o&&e.pages.length)return Promise.resolve(e);let i={queryKey:t.queryKey,pageParam:o,direction:a?"backward":"forward",meta:t.options.meta};u(i);let l=await d(i),{maxPages:s}=t.options,c=a?r.Ht:r.VX;return{pages:c(e.pages,l,s),pageParams:c(e.pageParams,o,s)}};if(a&&i.length){let e="backward"===a,t={pages:i,pageParams:l},n=(e?function(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}:h)(o,t);s=await f(t,n,e)}else{let t=e??i.length;do{let e=0===c?l[0]??o.initialPageParam:h(o,s);if(c>0&&null==e)break;s=await f(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function h(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}var m=class{#v;#o;#d;#y;#b;#x;#w;#k;constructor(e={}){this.#v=e.queryCache||new l,this.#o=e.mutationCache||new c,this.#d=e.defaultOptions||{},this.#y=new Map,this.#b=new Map,this.#x=0}mount(){this.#x++,1===this.#x&&(this.#w=d.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#v.onFocus())}),this.#k=f.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#v.onOnline())}))}unmount(){this.#x--,0===this.#x&&(this.#w?.(),this.#w=void 0,this.#k?.(),this.#k=void 0)}isFetching(e){return this.#v.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#o.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#v.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#v.build(this,t),o=n.state.data;return void 0===o?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,r.KC)(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return this.#v.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let o=this.defaultQueryOptions({queryKey:e}),a=this.#v.get(o.queryHash),i=a?.state.data,l=(0,r.SE)(t,i);if(void 0!==l)return this.#v.build(this,o).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return a.V.batch(()=>this.#v.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#v.get(t.queryHash)?.state}removeQueries(e){let t=this.#v;a.V.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#v,r={type:"active",...e};return a.V.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){let n={revert:!0,...t};return Promise.all(a.V.batch(()=>this.#v.findAll(e).map(e=>e.cancel(n)))).then(r.ZT).catch(r.ZT)}invalidateQueries(e,t={}){return a.V.batch(()=>{if(this.#v.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")return Promise.resolve();let n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(a.V.batch(()=>this.#v.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(r.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(r.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let n=this.#v.build(this,t);return n.isStaleByTime((0,r.KC)(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(r.ZT).catch(r.ZT)}fetchInfiniteQuery(e){return e.behavior=p(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(r.ZT).catch(r.ZT)}ensureInfiniteQueryData(e){return e.behavior=p(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.N.isOnline()?this.#o.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#v}getMutationCache(){return this.#o}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#y.set((0,r.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#y.values()],n={};return t.forEach(t=>{(0,r.to)(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#b.set((0,r.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#b.values()],n={};return t.forEach(t=>{(0,r.to)(e,t.mutationKey)&&(n={...n,...t.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,r.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===r.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#v.clear(),this.#o.clear()}}},7989:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(45345),o=class{#S;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.PN)(this.gcTime)&&(this.#S=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r.sk?1/0:3e5))}clearGcTimeout(){this.#S&&(clearTimeout(this.#S),this.#S=void 0)}}},11255:function(e,t,n){"use strict";n.d(t,{DV:function(){return u},Kw:function(){return s},Mz:function(){return d}});var r=n(87045),o=n(57853),a=n(16803),i=n(45345);function l(e){return Math.min(1e3*2**e,3e4)}function s(e){return(e??"online")!=="online"||o.N.isOnline()}var c=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function u(e){return e instanceof c}function d(e){let t,n=!1,u=0,d=!1,f=(0,a.O)(),p=()=>r.j.isFocused()&&("always"===e.networkMode||o.N.isOnline())&&e.canRun(),h=()=>s(e.networkMode)&&e.canRun(),m=n=>{d||(d=!0,e.onSuccess?.(n),t?.(),f.resolve(n))},g=n=>{d||(d=!0,e.onError?.(n),t?.(),f.reject(n))},v=()=>new Promise(n=>{t=e=>{(d||p())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,d||e.onContinue?.()}),y=()=>{let t;if(d)return;let r=0===u?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(m).catch(t=>{if(d)return;let r=e.retry??(i.sk?0:3),o=e.retryDelay??l,a="function"==typeof o?o(u,t):o,s=!0===r||"number"==typeof r&&u<r||"function"==typeof r&&r(u,t);if(n||!s){g(t);return}u++,e.onFail?.(u,t),(0,i._v)(a).then(()=>p()?void 0:v()).then(()=>{n?g(t):y()})})};return{promise:f,cancel:t=>{d||(g(new c(t)),e.abort?.())},continue:()=>(t?.(),f),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:h,start:()=>(h()?y():v().then(y),f)}}},24112:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},16803:function(e,t,n){"use strict";function r(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}n.d(t,{O:function(){return r}})},45345:function(e,t,n){"use strict";n.d(t,{CN:function(){return S},Ht:function(){return k},KC:function(){return s},Kp:function(){return l},Nc:function(){return c},PN:function(){return i},Rm:function(){return f},SE:function(){return a},VS:function(){return m},VX:function(){return w},X7:function(){return d},Ym:function(){return p},ZT:function(){return o},_v:function(){return b},_x:function(){return u},cG:function(){return E},oE:function(){return x},sk:function(){return r},to:function(){return h}});var r="undefined"==typeof window||"Deno"in globalThis;function o(){}function a(e,t){return"function"==typeof e?e(t):e}function i(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function s(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function u(e,t){let{type:n="all",exact:r,fetchStatus:o,predicate:a,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==f(i,t.options))return!1}else if(!h(t.queryKey,i))return!1}if("all"!==n){let e=t.isActive();if("active"===n&&!e||"inactive"===n&&e)return!1}return("boolean"!=typeof l||t.isStale()===l)&&(!o||o===t.state.fetchStatus)&&(!a||!!a(t))}function d(e,t){let{exact:n,status:r,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(p(t.options.mutationKey)!==p(a))return!1}else if(!h(t.options.mutationKey,a))return!1}return(!r||t.state.status===r)&&(!o||!!o(t))}function f(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function h(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(n=>!h(e[n],t[n]))}function m(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function g(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(void 0===t)return!0;let n=t.prototype;return!!(y(n)&&n.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return new Promise(t=>{setTimeout(t,e)})}function x(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?function e(t,n){if(t===n)return t;let r=g(t)&&g(n);if(r||v(t)&&v(n)){let o=r?t:Object.keys(t),a=o.length,i=r?n:Object.keys(n),l=i.length,s=r?[]:{},c=0;for(let a=0;a<l;a++){let l=r?a:i[a];(!r&&o.includes(l)||r)&&void 0===t[l]&&void 0===n[l]?(s[l]=void 0,c++):(s[l]=e(t[l],n[l]),s[l]===t[l]&&void 0!==t[l]&&c++)}return a===l&&c===a?t:s}return n}(e,t):t}function w(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function k(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var S=Symbol();function E(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==S?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}},19616:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(2265);let o={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class a{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...o,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function i(e,t){let[n,o]=(0,r.useState)(e),i=function(e,t){let[n]=(0,r.useState)(()=>{var n;return Object.getOwnPropertyNames(Object.getPrototypeOf(n=new a(e,t))).filter(e=>"function"==typeof n[e]).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(e[t]=r.bind(n)),e},{})});return n.setOptions(t),n}(o,t);return[n,i.maybeExecute,i]}},29827:function(e,t,n){"use strict";n.d(t,{NL:function(){return i},aH:function(){return l}});var r=n(2265),o=n(57437),a=r.createContext(void 0),i=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},l=e=>{let{client:t,children:n}=e;return r.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,o.jsx)(a.Provider,{value:t,children:n})}},21770:function(e,t,n){"use strict";n.d(t,{D:function(){return d}});var r=n(2265),o=n(2894),a=n(18238),i=n(24112),l=n(45345),s=class extends i.l{#E;#O=void 0;#C;#j;constructor(e,t){super(),this.#E=e,this.setOptions(t),this.bindMethods(),this.#_()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#E.defaultMutationOptions(e),(0,l.VS)(this.options,t)||this.#E.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#C,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.Ym)(t.mutationKey)!==(0,l.Ym)(this.options.mutationKey)?this.reset():this.#C?.state.status==="pending"&&this.#C.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#C?.removeObserver(this)}onMutationUpdate(e){this.#_(),this.#P(e)}getCurrentResult(){return this.#O}reset(){this.#C?.removeObserver(this),this.#C=void 0,this.#_(),this.#P()}mutate(e,t){return this.#j=t,this.#C?.removeObserver(this),this.#C=this.#E.getMutationCache().build(this.#E,this.options),this.#C.addObserver(this),this.#C.execute(e)}#_(){let e=this.#C?.state??(0,o.R)();this.#O={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#P(e){a.V.batch(()=>{if(this.#j&&this.hasListeners()){let t=this.#O.variables,n=this.#O.context;e?.type==="success"?(this.#j.onSuccess?.(e.data,t,n),this.#j.onSettled?.(e.data,null,t,n)):e?.type==="error"&&(this.#j.onError?.(e.error,t,n),this.#j.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach(e=>{e(this.#O)})})}},c=n(29827),u=n(51172);function d(e,t){let n=(0,c.NL)(t),[o]=r.useState(()=>new s(n,e));r.useEffect(()=>{o.setOptions(e)},[o,e]);let i=r.useSyncExternalStore(r.useCallback(e=>o.subscribe(a.V.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),l=r.useCallback((e,t)=>{o.mutate(e,t).catch(u.Z)},[o]);if(i.error&&(0,u.L)(o.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:l,mutateAsync:i.mutate}}},16593:function(e,t,n){"use strict";let r;n.d(t,{a:function(){return P}});var o=n(87045),a=n(18238),i=n(21733),l=n(24112),s=n(16803),c=n(45345),u=class extends l.l{constructor(e,t){super(),this.options=t,this.#E=e,this.#N=null,this.#T=(0,s.O)(),this.options.experimental_prefetchInRender||this.#T.reject(Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#E;#A=void 0;#M=void 0;#O=void 0;#I;#R;#T;#N;#D;#L;#Z;#z;#B;#F;#H=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#A.addObserver(this),d(this.#A,this.options)?this.#q():this.updateResult(),this.#W())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return f(this.#A,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return f(this.#A,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#U(),this.#K(),this.#A.removeObserver(this)}setOptions(e,t){let n=this.options,r=this.#A;if(this.options=this.#E.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,c.Nc)(this.options.enabled,this.#A))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#$(),this.#A.setOptions(this.options),n._defaulted&&!(0,c.VS)(this.options,n)&&this.#E.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#A,observer:this});let o=this.hasListeners();o&&p(this.#A,r,this.options,n)&&this.#q(),this.updateResult(t),o&&(this.#A!==r||(0,c.Nc)(this.options.enabled,this.#A)!==(0,c.Nc)(n.enabled,this.#A)||(0,c.KC)(this.options.staleTime,this.#A)!==(0,c.KC)(n.staleTime,this.#A))&&this.#V();let a=this.#X();o&&(this.#A!==r||(0,c.Nc)(this.options.enabled,this.#A)!==(0,c.Nc)(n.enabled,this.#A)||a!==this.#F)&&this.#G(a)}getOptimisticResult(e){let t=this.#E.getQueryCache().build(this.#E,e),n=this.createResult(t,e);return(0,c.VS)(this.getCurrentResult(),n)||(this.#O=n,this.#R=this.options,this.#I=this.#A.state),n}getCurrentResult(){return this.#O}trackResult(e,t){let n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#H.add(e)}getCurrentQuery(){return this.#A}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#E.defaultQueryOptions(e),n=this.#E.getQueryCache().build(this.#E,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#q({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#O))}#q(e){this.#$();let t=this.#A.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c.ZT)),t}#V(){this.#U();let e=(0,c.KC)(this.options.staleTime,this.#A);if(c.sk||this.#O.isStale||!(0,c.PN)(e))return;let t=(0,c.Kp)(this.#O.dataUpdatedAt,e);this.#z=setTimeout(()=>{this.#O.isStale||this.updateResult()},t+1)}#X(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#A):this.options.refetchInterval)??!1}#G(e){this.#K(),this.#F=e,!c.sk&&!1!==(0,c.Nc)(this.options.enabled,this.#A)&&(0,c.PN)(this.#F)&&0!==this.#F&&(this.#B=setInterval(()=>{(this.options.refetchIntervalInBackground||o.j.isFocused())&&this.#q()},this.#F))}#W(){this.#V(),this.#G(this.#X())}#U(){this.#z&&(clearTimeout(this.#z),this.#z=void 0)}#K(){this.#B&&(clearInterval(this.#B),this.#B=void 0)}createResult(e,t){let n;let r=this.#A,o=this.options,a=this.#O,l=this.#I,u=this.#R,f=e!==r?e.state:this.#M,{state:m}=e,g={...m},v=!1;if(t._optimisticResults){let n=this.hasListeners(),a=!n&&d(e,t),l=n&&p(e,r,t,o);(a||l)&&(g={...g,...(0,i.z)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(g.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:x}=g;if(t.select&&void 0!==g.data){if(a&&g.data===l?.data&&t.select===this.#D)n=this.#L;else try{this.#D=t.select,n=t.select(g.data),n=(0,c.oE)(a?.data,n,t),this.#L=n,this.#N=null}catch(e){this.#N=e}}else n=g.data;if(void 0!==t.placeholderData&&void 0===n&&"pending"===x){let e;if(a?.isPlaceholderData&&t.placeholderData===u?.placeholderData)e=a.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#Z?.state.data,this.#Z):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#N=null}catch(e){this.#N=e}void 0!==e&&(x="success",n=(0,c.oE)(a?.data,e,t),v=!0)}this.#N&&(y=this.#N,n=this.#L,b=Date.now(),x="error");let w="fetching"===g.fetchStatus,k="pending"===x,S="error"===x,E=k&&w,O=void 0!==n,C={status:x,fetchStatus:g.fetchStatus,isPending:k,isSuccess:"success"===x,isError:S,isInitialLoading:E,isLoading:E,data:n,dataUpdatedAt:g.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:w,isRefetching:w&&!k,isLoadingError:S&&!O,isPaused:"paused"===g.fetchStatus,isPlaceholderData:v,isRefetchError:S&&O,isStale:h(e,t),refetch:this.refetch,promise:this.#T};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===C.status?e.reject(C.error):void 0!==C.data&&e.resolve(C.data)},n=()=>{t(this.#T=C.promise=(0,s.O)())},o=this.#T;switch(o.status){case"pending":e.queryHash===r.queryHash&&t(o);break;case"fulfilled":("error"===C.status||C.data!==o.value)&&n();break;case"rejected":("error"!==C.status||C.error!==o.reason)&&n()}}return C}updateResult(e){let t=this.#O,n=this.createResult(this.#A,this.options);if(this.#I=this.#A.state,this.#R=this.options,void 0!==this.#I.data&&(this.#Z=this.#A),(0,c.VS)(n,t))return;this.#O=n;let r={};e?.listeners!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,n="function"==typeof e?e():e;if("all"===n||!n&&!this.#H.size)return!0;let r=new Set(n??this.#H);return this.options.throwOnError&&r.add("error"),Object.keys(this.#O).some(e=>this.#O[e]!==t[e]&&r.has(e))})()&&(r.listeners=!0),this.#P({...r,...e})}#$(){let e=this.#E.getQueryCache().build(this.#E,this.options);if(e===this.#A)return;let t=this.#A;this.#A=e,this.#M=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#W()}#P(e){a.V.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#O)}),this.#E.getQueryCache().notify({query:this.#A,type:"observerResultsUpdated"})})}};function d(e,t){return!1!==(0,c.Nc)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)||void 0!==e.state.data&&f(e,t,t.refetchOnMount)}function f(e,t,n){if(!1!==(0,c.Nc)(t.enabled,e)){let r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&h(e,t)}return!1}function p(e,t,n,r){return(e!==t||!1===(0,c.Nc)(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&h(e,n)}function h(e,t){return!1!==(0,c.Nc)(t.enabled,e)&&e.isStaleByTime((0,c.KC)(t.staleTime,e))}var m=n(2265),g=n(29827);n(57437);var v=m.createContext((r=!1,{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r})),y=()=>m.useContext(v),b=n(51172),x=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&!t.isReset()&&(e.retryOnMount=!1)},w=e=>{m.useEffect(()=>{e.clearReset()},[e])},k=e=>{let{result:t,errorResetBoundary:n,throwOnError:r,query:o}=e;return t.isError&&!n.isReset()&&!t.isFetching&&o&&(0,b.L)(r,[t.error,o])},S=m.createContext(!1),E=()=>m.useContext(S);S.Provider;var O=e=>{let t=e.staleTime;e.suspense&&(e.staleTime="function"==typeof t?(...e)=>Math.max(t(...e),1e3):Math.max(t??1e3,1e3),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3)))},C=(e,t)=>e.isLoading&&e.isFetching&&!t,j=(e,t)=>e?.suspense&&t.isPending,_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function P(e,t){return function(e,t,n){var r,o,i,l,s;let u=(0,g.NL)(n),d=E(),f=y(),p=u.defaultQueryOptions(e);null===(o=u.getDefaultOptions().queries)||void 0===o||null===(r=o._experimental_beforeQuery)||void 0===r||r.call(o,p),p._optimisticResults=d?"isRestoring":"optimistic",O(p),x(p,f),w(f);let h=!u.getQueryCache().get(p.queryHash),[v]=m.useState(()=>new t(u,p)),S=v.getOptimisticResult(p),P=!d&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=P?v.subscribe(a.V.batchCalls(e)):b.Z;return v.updateResult(),t},[v,P]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),m.useEffect(()=>{v.setOptions(p,{listeners:!1})},[p,v]),j(p,S))throw _(p,v,f);if(k({result:S,errorResetBoundary:f,throwOnError:p.throwOnError,query:u.getQueryCache().get(p.queryHash)}))throw S.error;if(null===(l=u.getDefaultOptions().queries)||void 0===l||null===(i=l._experimental_afterQuery)||void 0===i||i.call(l,p,S),p.experimental_prefetchInRender&&!c.sk&&C(S,d)){let e=h?_(p,v,f):null===(s=u.getQueryCache().get(p.queryHash))||void 0===s?void 0:s.promise;null==e||e.catch(b.Z).finally(()=>{v.updateResult()})}return p.notifyOnChangeProps?S:v.trackResult(S)}(e,u,t)}},51172:function(e,t,n){"use strict";function r(e,t){return"function"==typeof e?e(...t):!!e}function o(){}n.d(t,{L:function(){return r},Z:function(){return o}})},87602:function(e,t,n){"use strict";function r(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t){if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r)}return o}(e))&&(r&&(r+=" "),r+=t);return r}n.d(t,{W:function(){return r}}),t.Z=r},49096:function(e,t,n){"use strict";n.d(t,{ZD:function(){return a}});var r=n(87602);let o=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=e=>{let t=function(){for(var t,n,o=arguments.length,a=Array(o),i=0;i<o;i++)a[i]=arguments[i];return void 0!==(null==e?void 0:null===(t=e.hooks)||void 0===t?void 0:t["cx:done"])?null==e?void 0:e.hooks["cx:done"]((0,r.W)(a)):void 0!==(null==e?void 0:null===(n=e.hooks)||void 0===n?void 0:n.onComplete)?null==e?void 0:e.hooks.onComplete((0,r.W)(a)):(0,r.W)(a)};return{compose:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return e=>{let r=Object.fromEntries(Object.entries(e||{}).filter(e=>{let[t]=e;return!["class","className"].includes(t)}));return t(n.map(e=>e(r)),null==e?void 0:e.class,null==e?void 0:e.className)}},cva:e=>n=>{var r;if((null==e?void 0:e.variants)==null)return t(null==e?void 0:e.base,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:a,defaultVariants:i}=e,l=Object.keys(a).map(e=>{let t=null==n?void 0:n[e],r=null==i?void 0:i[e],l=o(t)||o(r);return a[e][l]}),s={...i,...n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r?e:{...e,[n]:r}},{})},c=null==e?void 0:null===(r=e.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e,r=s[t];return Array.isArray(n)?n.includes(r):r===n})?[...e,n,r]:e},[]);return t(null==e?void 0:e.base,l,c,null==n?void 0:n.class,null==n?void 0:n.className)},cx:t}},{compose:i,cva:l,cx:s}=a()},55284:function(e,t,n){"use strict";n.d(t,{Z:function(){return a},x:function(){return i}});var r=n(89999),o=n(36967);function a(){var e,t,n=(0,o.Z)().unknown(void 0),i=n.domain,l=n.range,s=0,c=1,u=!1,d=0,f=0,p=.5;function h(){var n=i().length,r=c<s,o=r?c:s,a=r?s:c;e=(a-o)/Math.max(1,n-d+2*f),u&&(e=Math.floor(e)),o+=(a-o-e*(n-d))*p,t=e*(1-d),u&&(o=Math.round(o),t=Math.round(t));var h=(function(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n)),a=Array(o);++r<o;)a[r]=e+r*n;return a})(n).map(function(t){return o+e*t});return l(r?h.reverse():h)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([s,c]=e,s=+s,c=+c,h()):[s,c]},n.rangeRound=function(e){return[s,c]=e,s=+s,c=+c,u=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(u=!!e,h()):u},n.padding=function(e){return arguments.length?(d=Math.min(1,f=+e),h()):d},n.paddingInner=function(e){return arguments.length?(d=Math.min(1,e),h()):d},n.paddingOuter=function(e){return arguments.length?(f=+e,h()):f},n.align=function(e){return arguments.length?(p=Math.max(0,Math.min(1,e)),h()):p},n.copy=function(){return a(i(),[s,c]).round(u).paddingInner(d).paddingOuter(f).align(p)},r.o.apply(h(),arguments)}function i(){return function e(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return e(n())},t}(a.apply(null,arguments).paddingInner(1))}},89999:function(e,t,n){"use strict";function r(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function o(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}n.d(t,{O:function(){return o},o:function(){return r}})},36967:function(e,t,n){"use strict";n.d(t,{Z:function(){return function e(){var t=new r,n=[],o=[],a=l;function s(e){let r=t.get(e);if(void 0===r){if(a!==l)return a;t.set(e,r=n.push(e)-1)}return o[r%o.length]}return s.domain=function(e){if(!arguments.length)return n.slice();for(let o of(n=[],t=new r,e))t.has(o)||t.set(o,n.push(o)-1);return s},s.range=function(e){return arguments.length?(o=Array.from(e),s):o.slice()},s.unknown=function(e){return arguments.length?(a=e,s):a},s.copy=function(){return e(n,o).unknown(a)},i.o.apply(s,arguments),s}},O:function(){return l}});class r extends Map{constructor(e,t=a){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(o(this,e))}has(e){return super.has(o(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}(this,e))}}function o({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function a(e){return null!==e&&"object"==typeof e?e.valueOf():e}var i=n(89999);let l=Symbol("implicit")},22516:function(e,t,n){"use strict";function r(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}n.d(t,{Z:function(){return r}}),Array.prototype.slice},76115:function(e,t,n){"use strict";function r(e){return function(){return e}}n.d(t,{Z:function(){return r}})},67790:function(e,t,n){"use strict";n.d(t,{d:function(){return s}});let r=Math.PI,o=2*r,a=o-1e-6;function i(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class l{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?i:function(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return i;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,o,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+o},${this._y1=+a}`}arcTo(e,t,n,o,a){if(e=+e,t=+t,n=+n,o=+o,(a=+a)<0)throw Error(`negative radius: ${a}`);let i=this._x1,l=this._y1,s=n-e,c=o-t,u=i-e,d=l-t,f=u*u+d*d;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>1e-6){if(Math.abs(d*s-c*u)>1e-6&&a){let p=n-i,h=o-l,m=s*s+c*c,g=Math.sqrt(m),v=Math.sqrt(f),y=a*Math.tan((r-Math.acos((m+f-(p*p+h*h))/(2*g*v)))/2),b=y/v,x=y/g;Math.abs(b-1)>1e-6&&this._append`L${e+b*u},${t+b*d}`,this._append`A${a},${a},0,0,${+(d*p>u*h)},${this._x1=e+x*s},${this._y1=t+x*c}`}else this._append`L${this._x1=e},${this._y1=t}`}}arc(e,t,n,i,l,s){if(e=+e,t=+t,s=!!s,(n=+n)<0)throw Error(`negative radius: ${n}`);let c=n*Math.cos(i),u=n*Math.sin(i),d=e+c,f=t+u,p=1^s,h=s?i-l:l-i;null===this._x1?this._append`M${d},${f}`:(Math.abs(this._x1-d)>1e-6||Math.abs(this._y1-f)>1e-6)&&this._append`L${d},${f}`,n&&(h<0&&(h=h%o+o),h>a?this._append`A${n},${n},0,1,${p},${e-c},${t-u}A${n},${n},0,1,${p},${this._x1=d},${this._y1=f}`:h>1e-6&&this._append`A${n},${n},0,${+(h>=r)},${p},${this._x1=e+n*Math.cos(l)},${this._y1=t+n*Math.sin(l)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function s(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new l(t)}l.prototype},14474:function(e,t,n){"use strict";n.d(t,{o:function(){return o}});class r extends Error{}function o(e,t){let n;if("string"!=typeof e)throw new r("Invalid token specified: must be a string");t||(t={});let o=!0===t.header?0:1,a=e.split(".")[o];if("string"!=typeof a)throw new r(`Invalid token specified: missing part #${o+1}`);try{n=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var n;return n=t,decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}catch(e){return atob(t)}}(a)}catch(e){throw new r(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new r(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}r.prototype.name="InvalidTokenError"},26433:function(e,t,n){"use strict";let r,o,a,i,l,s,c,u,d,f;n.d(t,{ZP:function(){return rx}});let p="RFC3986",h={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:e=>String(e)};Object.prototype.hasOwnProperty;let m=Array.isArray,g=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})();function v(e,t){if(m(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)}let y=Object.prototype.hasOwnProperty,b={brackets:e=>String(e)+"[]",comma:"comma",indices:(e,t)=>String(e)+"["+t+"]",repeat:e=>String(e)},x=Array.isArray,w=Array.prototype.push,k=function(e,t){w.apply(e,x(t)?t:[t])},S=Date.prototype.toISOString,E={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:(e,t,n,r,o)=>{if(0===e.length)return e;let a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});let i="";for(let e=0;e<a.length;e+=1024){let t=a.length>=1024?a.slice(e,e+1024):a,n=[];for(let e=0;e<t.length;++e){let r=t.charCodeAt(e);if(45===r||46===r||95===r||126===r||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||"RFC1738"===o&&(40===r||41===r)){n[n.length]=t.charAt(e);continue}if(r<128){n[n.length]=g[r];continue}if(r<2048){n[n.length]=g[192|r>>6]+g[128|63&r];continue}if(r<55296||r>=57344){n[n.length]=g[224|r>>12]+g[128|r>>6&63]+g[128|63&r];continue}e+=1,r=65536+((1023&r)<<10|1023&t.charCodeAt(e)),n[n.length]=g[240|r>>18]+g[128|r>>12&63]+g[128|r>>6&63]+g[128|63&r]}i+=n.join("")}return i},encodeValuesOnly:!1,format:p,formatter:h[p],indices:!1,serializeDate:e=>S.call(e),skipNulls:!1,strictNullHandling:!1},O={},C="4.93.0",j=!1;class _{constructor(e){this.body=e}get[Symbol.toStringTag](){return"MultipartBody"}}let P=()=>{o||function(e,t={auto:!1}){if(j)throw Error(`you must \`import 'openai/shims/${e.kind}'\` before importing anything else from openai`);if(o)throw Error(`can't \`import 'openai/shims/${e.kind}'\` after \`import 'openai/shims/${o}'\``);j=t.auto,o=e.kind,a=e.fetch,e.Request,e.Response,e.Headers,i=e.FormData,e.Blob,l=e.File,s=e.ReadableStream,c=e.getMultipartRequestOptions,u=e.getDefaultAgent,d=e.fileFromPath,f=e.isFsReadStream}(function({manuallyImported:e}={}){let t,n,r,o;let a=e?"You may need to use polyfills":`Add one of these imports before your first \`import … from 'openai'\`:- \`import 'openai/shims/node'\` (if you're running on Node)- \`import 'openai/shims/web'\` (otherwise)-`;try{t=fetch,n=Request,r=Response,o=Headers}catch(e){throw Error(`this environment is missing the following Web Fetch API type: ${e.message}. ${a}`)}return{kind:"web",fetch:t,Request:n,Response:r,Headers:o,FormData:"undefined"!=typeof FormData?FormData:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${a}`)}},Blob:"undefined"!=typeof Blob?Blob:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${a}`)}},File:"undefined"!=typeof File?File:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${a}`)}},ReadableStream:"undefined"!=typeof ReadableStream?ReadableStream:class{constructor(){throw Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${a}`)}},getMultipartRequestOptions:async(e,t)=>({...t,body:new _(e)}),getDefaultAgent:e=>void 0,fileFromPath:()=>{throw Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:e=>!1}}(),{auto:!0})};P();class N extends Error{}class T extends N{constructor(e,t,n,r){super(`${T.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.request_id=r?.["x-request-id"],this.error=t,this.code=t?.code,this.param=t?.param,this.type=t?.type}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){if(!e||!r)return new M({message:n,cause:tL(t)});let o=t?.error;return 400===e?new R(e,o,n,r):401===e?new D(e,o,n,r):403===e?new L(e,o,n,r):404===e?new Z(e,o,n,r):409===e?new z(e,o,n,r):422===e?new B(e,o,n,r):429===e?new F(e,o,n,r):e>=500?new H(e,o,n,r):new T(e,o,n,r)}}class A extends T{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class M extends T{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class I extends M{constructor({message:e}={}){super({message:e??"Request timed out."})}}class R extends T{}class D extends T{}class L extends T{}class Z extends T{}class z extends T{}class B extends T{}class F extends T{}class H extends T{}class q extends N{constructor(){super("Could not parse response content as the length limit was reached")}}class W extends N{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}var U,K,$,V,X,G,Y,Q,J,ee,et,en,er,eo,ea,ei,el,es,ec,eu,ed,ef,ep,eh,em,eg,ev,ey,eb,ex,ew,ek,eS,eE,eO,eC,ej,e_,eP,eN,eT,eA,eM,eI,eR,eD,eL,eZ,ez,eB,eF,eH,eq,eW,eU,eK,e$,eV,eX,eG,eY,eQ,eJ,e0,e1,e2=n(10536).lW,e6=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},e4=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class e3{constructor(){U.set(this,void 0),this.buffer=new Uint8Array,e6(this,U,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?new TextEncoder().encode(e):e,r=new Uint8Array(this.buffer.length+n.length);r.set(this.buffer),r.set(n,this.buffer.length),this.buffer=r;let o=[];for(;null!=(t=function(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}(this.buffer,e4(this,U,"f")));){if(t.carriage&&null==e4(this,U,"f")){e6(this,U,t.index,"f");continue}if(null!=e4(this,U,"f")&&(t.index!==e4(this,U,"f")+1||t.carriage)){o.push(this.decodeText(this.buffer.slice(0,e4(this,U,"f")-1))),this.buffer=this.buffer.slice(e4(this,U,"f")),e6(this,U,null,"f");continue}let e=null!==e4(this,U,"f")?t.preceding-1:t.preceding,n=this.decodeText(this.buffer.slice(0,e));o.push(n),this.buffer=this.buffer.slice(t.index),e6(this,U,null,"f")}return o}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==e2){if(e instanceof e2)return e.toString();if(e instanceof Uint8Array)return e2.from(e).toString();throw new N(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if("undefined"!=typeof TextDecoder){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new N(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new N("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode("\n"):[]}}function e5(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}U=new WeakMap,e3.NEWLINE_CHARS=new Set(["\n","\r"]),e3.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class e8{constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new e8(async function*(){if(n)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of e7(e,t))if(!r){if(n.data.startsWith("[DONE]")){r=!0;continue}if(null===n.event||n.event.startsWith("response.")||n.event.startsWith("transcript.")){let t;try{t=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if(t&&t.error)throw new T(void 0,t.error,void 0,tO(e.headers));yield t}else{let e;try{e=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("error"==n.event)throw new T(void 0,e.error,e.message,void 0);yield{event:n.event,data:e}}}r=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{r||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;async function*r(){let t=new e3;for await(let n of e5(e))for(let e of t.decode(n))yield e;for(let e of t.flush())yield e}return new e8(async function*(){if(n)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let e=!1;try{for await(let t of r())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=r=>({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new e8(()=>r(e),this.controller),new e8(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this,n=new TextEncoder;return new s({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:r,done:o}=await e.next();if(o)return t.close();let a=n.encode(JSON.stringify(r)+"\n");t.enqueue(a)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*e7(e,t){if(!e.body)throw t.abort(),new N("Attempted to iterate over a response with no body");let n=new te,r=new e3;for await(let t of e9(e5(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*e9(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?new TextEncoder().encode(n):n,o=new Uint8Array(t.length+r.length);for(o.set(t),o.set(r,t.length),t=o;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class te{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}var tt=n(10536).lW;let tn=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob,tr=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&to(e),to=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ta=e=>tr(e)||tn(e)||f(e);async function ti(e,t,n){var r;if(tr(e=await e))return e;if(tn(e)){let r=await e.blob();t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()??"unknown_file");let o=to(r)?[await r.arrayBuffer()]:[r];return new l(o,t,n)}let o=await tl(e);if(t||(t=(ts((r=e).name)||ts(r.filename)||ts(r.path)?.split(/[\\/]/).pop())??"unknown_file"),!n?.type){let e=o[0]?.type;"string"==typeof e&&(n={...n,type:e})}return new l(o,t,n)}async function tl(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(to(e))t.push(await e.arrayBuffer());else if(tc(e))for await(let n of e)t.push(n);else throw Error(`Unexpected data type: ${typeof e}; constructor: ${e?.constructor?.name}; props: ${function(e){let t=Object.getOwnPropertyNames(e);return`[${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`);return t}let ts=e=>"string"==typeof e?e:void 0!==tt&&e instanceof tt?String(e):void 0,tc=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],tu=e=>e&&"object"==typeof e&&e.body&&"MultipartBody"===e[Symbol.toStringTag],td=async e=>{let t=await tf(e.body);return c(t,e)},tf=async e=>{let t=new i;return await Promise.all(Object.entries(e||{}).map(([e,n])=>th(t,e,n))),t},tp=e=>{if(ta(e))return!0;if(Array.isArray(e))return e.some(tp);if(e&&"object"==typeof e){for(let t in e)if(tp(e[t]))return!0}return!1},th=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(ta(n)){let r=await ti(n);e.append(t,r)}else if(Array.isArray(n))await Promise.all(n.map(n=>th(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>th(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}};var tm=n(10536).lW,tg=n(40257),tv=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},ty=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};async function tb(e){let{response:t}=e;if(e.options.stream)return(tq("response",t.status,t.url,t.headers,t.body),e.options.__streamClass)?e.options.__streamClass.fromSSEResponse(t,e.controller):e8.fromSSEResponse(t,e.controller);if(204===t.status)return null;if(e.options.__binaryResponse)return t;let n=t.headers.get("content-type"),r=n?.split(";")[0]?.trim();if(r?.includes("application/json")||r?.endsWith("+json")){let e=await t.json();return tq("response",t.status,t.url,t.headers,e),tx(e,t)}let o=await t.text();return tq("response",t.status,t.url,t.headers,o),o}function tx(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}P();class tw extends Promise{constructor(e,t=tb){super(e=>{e(null)}),this.responsePromise=e,this.parseResponse=t}_thenUnwrap(e){return new tw(this.responsePromise,async t=>tx(e(await this.parseResponse(t),t),t.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}class tk{constructor({baseURL:e,maxRetries:t=2,timeout:n=6e5,httpAgent:r,fetch:o}){this.baseURL=e,this.maxRetries=tD("maxRetries",t),this.timeout=tD("timeout",n),this.httpAgent=r,this.fetch=o??a}authHeaders(e){return{}}defaultHeaders(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...tT(),...this.authHeaders(e)}}validateHeaders(e,t){}defaultIdempotencyKey(){return`stainless-node-retry-${tW()}`}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(async n=>{let r=n&&to(n?.body)?new DataView(await n.body.arrayBuffer()):n?.body instanceof DataView?n.body:n?.body instanceof ArrayBuffer?new DataView(n.body):n&&ArrayBuffer.isView(n?.body)?new DataView(n.body.buffer):n?.body;return{method:e,path:t,...n,body:r}}))}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}calculateContentLength(e){if("string"==typeof e){if(void 0!==tm)return tm.byteLength(e,"utf8").toString();if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e).length.toString()}else if(ArrayBuffer.isView(e))return e.byteLength.toString();return null}buildRequest(e,{retryCount:t=0}={}){let{method:n,path:r,query:o,headers:a={}}=e={...e},i=ArrayBuffer.isView(e.body)||e.__binaryRequest&&"string"==typeof e.body?e.body:tu(e.body)?e.body.body:e.body?JSON.stringify(e.body,null,2):null,l=this.calculateContentLength(i),s=this.buildURL(r,o);"timeout"in e&&tD("timeout",e.timeout),e.timeout=e.timeout??this.timeout;let c=e.httpAgent??this.httpAgent??u(s),d=e.timeout+1e3;"number"==typeof c?.options?.timeout&&d>(c.options.timeout??0)&&(c.options.timeout=d),this.idempotencyHeader&&"get"!==n&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=e.idempotencyKey);let f=this.buildHeaders({options:e,headers:a,contentLength:l,retryCount:t});return{req:{method:n,...i&&{body:i},headers:f,...c&&{agent:c},signal:e.signal??null},url:s,timeout:e.timeout}}buildHeaders({options:e,headers:t,contentLength:n,retryCount:r}){let a={};n&&(a["content-length"]=n);let i=this.defaultHeaders(e);return tF(a,i),tF(a,t),tu(e.body)&&"node"!==o&&delete a["content-type"],void 0===t$(i,"x-stainless-retry-count")&&void 0===t$(t,"x-stainless-retry-count")&&(a["x-stainless-retry-count"]=String(r)),void 0===t$(i,"x-stainless-timeout")&&void 0===t$(t,"x-stainless-timeout")&&e.timeout&&(a["x-stainless-timeout"]=String(Math.trunc(e.timeout/1e3))),this.validateHeaders(a,t),a}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}parseHeaders(e){return e?Symbol.iterator in e?Object.fromEntries(Array.from(e).map(e=>[...e])):{...e}:{}}makeStatusError(e,t,n,r){return T.generate(e,t,n,r)}request(e,t=null){return new tw(this.makeRequest(e,t))}async makeRequest(e,t){let n=await e,r=n.maxRetries??this.maxRetries;null==t&&(t=r),await this.prepareOptions(n);let{req:o,url:a,timeout:i}=this.buildRequest(n,{retryCount:r-t});if(await this.prepareRequest(o,{url:a,options:n}),tq("request",a,n,o.headers),n.signal?.aborted)throw new A;let l=new AbortController,s=await this.fetchWithTimeout(a,o,i,l).catch(tL);if(s instanceof Error){if(n.signal?.aborted)throw new A;if(t)return this.retryRequest(n,t);if("AbortError"===s.name)throw new I;throw new M({cause:s})}let c=tO(s.headers);if(!s.ok){if(t&&this.shouldRetry(s)){let e=`retrying, ${t} attempts remaining`;return tq(`response (error; ${e})`,s.status,a,c),this.retryRequest(n,t,c)}let e=await s.text().catch(e=>tL(e).message),r=tA(e),o=r?void 0:e,i=t?"(error; no more retries left)":"(error; not retryable)";throw tq(`response (error; ${i})`,s.status,a,c,o),this.makeStatusError(s.status,r,o,c)}return{response:s,options:n,controller:l}}requestAPIList(e,t){return new tE(this,this.makeRequest(t,null),e)}buildURL(e,t){let n=new URL(tI(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return tz(r)||(t={...r,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(n.search=this.stringifyQuery(t)),n.toString()}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new N(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(e,t,n,r){let{signal:o,...a}=t||{};o&&o.addEventListener("abort",()=>r.abort());let i=setTimeout(()=>r.abort(),n),l={signal:r.signal,...a};return l.method&&(l.method=l.method.toUpperCase()),this.fetch.call(void 0,e,l).finally(()=>{clearTimeout(i)})}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||e.status>=500)}async retryRequest(e,t,n){let r;let o=n?.["retry-after-ms"];if(o){let e=parseFloat(o);Number.isNaN(e)||(r=e)}let a=n?.["retry-after"];if(a&&!r){let e=parseFloat(a);r=Number.isNaN(e)?Date.parse(a)-Date.now():1e3*e}if(!(r&&0<=r&&r<6e4)){let n=e.maxRetries??this.maxRetries;r=this.calculateDefaultRetryTimeoutMillis(t,n)}return await tR(r),this.makeRequest(e,t-1)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}getUserAgent(){return`${this.constructor.name}/JS ${C}`}}class tS{constructor(e,t,n,r){K.set(this,void 0),tv(this,K,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageInfo()}async getNextPage(){let e=this.nextPageInfo();if(!e)throw new N("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");let t={...this.options};if("params"in e&&"object"==typeof t.query)t.query={...t.query,...e.params};else if("url"in e){for(let[n,r]of[...Object.entries(t.query||{}),...e.url.searchParams.entries()])e.url.searchParams.set(n,r);t.query=void 0,t.path=e.url.toString()}return await ty(this,K,"f").requestAPIList(this.constructor,t)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(K=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class tE extends tw{constructor(e,t,n){super(t,async t=>new n(e,t.response,await tb(t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}let tO=e=>new Proxy(Object.fromEntries(e.entries()),{get(e,t){let n=t.toString();return e[n.toLowerCase()]||e[n]}}),tC={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__metadata:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},tj=e=>"object"==typeof e&&null!==e&&!tz(e)&&Object.keys(e).every(e=>tB(tC,e)),t_=()=>{if("undefined"!=typeof Deno&&null!=Deno.build)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":tN(Deno.build.os),"X-Stainless-Arch":tP(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":tg.version};if("[object process]"===Object.prototype.toString.call(void 0!==tg?tg:0))return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":tN(tg.platform),"X-Stainless-Arch":tP(tg.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":tg.version};let e=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,o=n[3]||0;return{browser:e,version:`${t}.${r}.${o}`}}}return null}();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},tP=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",tN=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",tT=()=>r??(r=t_()),tA=e=>{try{return JSON.parse(e)}catch(e){return}},tM=/^[a-z][a-z0-9+.-]*:/i,tI=e=>tM.test(e),tR=e=>new Promise(t=>setTimeout(t,e)),tD=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new N(`${e} must be an integer`);if(t<0)throw new N(`${e} must be a positive integer`);return t},tL=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e)try{return Error(JSON.stringify(e))}catch{}return Error(e)},tZ=e=>void 0!==tg?tg.env?.[e]?.trim()??void 0:"undefined"!=typeof Deno?Deno.env?.get?.(e)?.trim():void 0;function tz(e){if(!e)return!0;for(let t in e)return!1;return!0}function tB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tF(e,t){for(let n in t){if(!tB(t,n))continue;let r=n.toLowerCase();if(!r)continue;let o=t[n];null===o?delete e[r]:void 0!==o&&(e[r]=o)}}let tH=new Set(["authorization","api-key"]);function tq(e,...t){void 0!==tg&&tg?.env?.DEBUG==="true"&&console.log(`OpenAI:DEBUG:${e}`,...t.map(e=>{if(!e)return e;if(e.headers){let t={...e,headers:{...e.headers}};for(let n in e.headers)tH.has(n.toLowerCase())&&(t.headers[n]="REDACTED");return t}let t=null;for(let n in e)tH.has(n.toLowerCase())&&(t??(t={...e}),t[n]="REDACTED");return t??e}))}let tW=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),tU=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,tK=e=>"function"==typeof e?.get,t$=(e,t)=>{let n=t.toLowerCase();if(tK(e)){let r=t[0]?.toUpperCase()+t.substring(1).replace(/([^\w])(\w)/g,(e,t,n)=>t+n.toUpperCase());for(let o of[t,n,t.toUpperCase(),r]){let t=e.get(o);if(t)return t}}for(let[r,o]of Object.entries(e))if(r.toLowerCase()===n){if(Array.isArray(o)){if(o.length<=1)return o[0];return console.warn(`Received ${o.length} entries for the ${t} header, using the first entry.`),o[0]}return o}},tV=e=>{if(void 0!==tm){let t=tm.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return Array.from(new Float32Array(r.buffer))}};function tX(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}class tG{constructor(e){this._client=e}}class tY extends tG{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class tQ extends tG{list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/chat/completions/${e}/messages`,t6,{query:t,...n})}}class tJ extends tS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.object=n.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class t0 extends tS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageParams(){let e=this.nextPageInfo();if(!e)return null;if("params"in e)return e.params;let t=Object.fromEntries(e.url.searchParams);return Object.keys(t).length?t:null}nextPageInfo(){let e=this.getPaginatedItems();if(!e.length)return null;let t=e[e.length-1]?.id;return t?{params:{after:t}}:null}}class t1 extends tG{constructor(){super(...arguments),this.messages=new tQ(this._client)}create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}retrieve(e,t){return this._client.get(`/chat/completions/${e}`,t)}update(e,t,n){return this._client.post(`/chat/completions/${e}`,{body:t,...n})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/chat/completions",t2,{query:e,...t})}del(e,t){return this._client.delete(`/chat/completions/${e}`,t)}}class t2 extends t0{}class t6 extends t0{}t1.ChatCompletionsPage=t2,t1.Messages=tQ;class t4 extends tG{constructor(){super(...arguments),this.completions=new t1(this._client)}}t4.Completions=t1,t4.ChatCompletionsPage=t2;class t3 extends tG{create(e,t){let n=!!e.encoding_format,r=n?e.encoding_format:"base64";n&&tq("Request","User defined encoding_format:",e.encoding_format);let o=this._client.post("/embeddings",{body:{...e,encoding_format:r},...t});return n?o:(tq("response","Decoding base64 embeddings to float32 array"),o._thenUnwrap(e=>(e&&e.data&&e.data.forEach(e=>{let t=e.embedding;e.embedding=tV(t)}),e)))}}class t5 extends tG{create(e,t){return this._client.post("/files",td({body:e,...t}))}retrieve(e,t){return this._client.get(`/files/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/files",t8,{query:e,...t})}del(e,t){return this._client.delete(`/files/${e}`,t)}content(e,t){return this._client.get(`/files/${e}/content`,{...t,headers:{Accept:"application/binary",...t?.headers},__binaryResponse:!0})}retrieveContent(e,t){return this._client.get(`/files/${e}/content`,t)}async waitForProcessing(e,{pollInterval:t=5e3,maxWait:n=18e5}={}){let r=new Set(["processed","error","deleted"]),o=Date.now(),a=await this.retrieve(e);for(;!a.status||!r.has(a.status);)if(await tR(t),a=await this.retrieve(e),Date.now()-o>n)throw new I({message:`Giving up on waiting for file ${e} to finish processing after ${n} milliseconds.`});return a}}class t8 extends t0{}t5.FileObjectsPage=t8;class t7 extends tG{createVariation(e,t){return this._client.post("/images/variations",td({body:e,...t}))}edit(e,t){return this._client.post("/images/edits",td({body:e,...t}))}generate(e,t){return this._client.post("/images/generations",{body:e,...t})}}class t9 extends tG{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:{Accept:"application/octet-stream",...t?.headers},__binaryResponse:!0})}}class ne extends tG{create(e,t){return this._client.post("/audio/transcriptions",td({body:e,...t,stream:e.stream??!1,__metadata:{model:e.model}}))}}class nt extends tG{create(e,t){return this._client.post("/audio/translations",td({body:e,...t,__metadata:{model:e.model}}))}}class nn extends tG{constructor(){super(...arguments),this.transcriptions=new ne(this._client),this.translations=new nt(this._client),this.speech=new t9(this._client)}}nn.Transcriptions=ne,nn.Translations=nt,nn.Speech=t9;class nr extends tG{create(e,t){return this._client.post("/moderations",{body:e,...t})}}class no extends tG{retrieve(e,t){return this._client.get(`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",na,e)}del(e,t){return this._client.delete(`/models/${e}`,t)}}class na extends tJ{}no.ModelsPage=na;class ni extends tG{create(e,t,n){return this._client.getAPIList(`/fine_tuning/checkpoints/${e}/permissions`,nl,{body:t,method:"post",...n})}retrieve(e,t={},n){return tj(t)?this.retrieve(e,{},t):this._client.get(`/fine_tuning/checkpoints/${e}/permissions`,{query:t,...n})}del(e,t){return this._client.delete(`/fine_tuning/checkpoints/${e}/permissions`,t)}}class nl extends tJ{}ni.PermissionCreateResponsesPage=nl;class ns extends tG{constructor(){super(...arguments),this.permissions=new ni(this._client)}}ns.Permissions=ni,ns.PermissionCreateResponsesPage=nl;class nc extends tG{list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/checkpoints`,nu,{query:t,...n})}}class nu extends t0{}nc.FineTuningJobCheckpointsPage=nu;class nd extends tG{constructor(){super(...arguments),this.checkpoints=new nc(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(`/fine_tuning/jobs/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/fine_tuning/jobs",nf,{query:e,...t})}cancel(e,t){return this._client.post(`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},n){return tj(t)?this.listEvents(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/events`,np,{query:t,...n})}}class nf extends t0{}class np extends t0{}nd.FineTuningJobsPage=nf,nd.FineTuningJobEventsPage=np,nd.Checkpoints=nc,nd.FineTuningJobCheckpointsPage=nu;class nh extends tG{constructor(){super(...arguments),this.jobs=new nd(this._client),this.checkpoints=new ns(this._client)}}nh.Jobs=nd,nh.FineTuningJobsPage=nf,nh.FineTuningJobEventsPage=np,nh.Checkpoints=ns;let nm=async e=>{let t=await Promise.allSettled(e),n=t.filter(e=>"rejected"===e.status);if(n.length){for(let e of n)console.error(e.reason);throw Error(`${n.length} promise(s) failed - see the above errors`)}let r=[];for(let e of t)"fulfilled"===e.status&&r.push(e.value);return r};class ng extends tG{create(e,t,n){return this._client.post(`/vector_stores/${e}/files`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,t,n,r){return this._client.post(`/vector_stores/${e}/files/${t}`,{body:n,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/vector_stores/${e}/files`,nv,{query:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,t,n){return this._client.delete(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){let r=await this.create(e,t,n);return await this.poll(e,r.id,n)}async poll(e,t,n){let r={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(r["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){let o=await this.retrieve(e,t,{...n,headers:r}).withResponse(),a=o.data;switch(a.status){case"in_progress":let i=5e3;if(n?.pollIntervalMs)i=n.pollIntervalMs;else{let e=o.response.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(i=t)}}await tR(i);break;case"failed":case"completed":return a}}}async upload(e,t,n){let r=await this._client.files.create({file:t,purpose:"assistants"},n);return this.create(e,{file_id:r.id},n)}async uploadAndPoll(e,t,n){let r=await this.upload(e,t,n);return await this.poll(e,r.id,n)}content(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/files/${t}/content`,ny,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class nv extends t0{}class ny extends tJ{}ng.VectorStoreFilesPage=nv,ng.FileContentResponsesPage=ny;class nb extends tG{create(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/file_batches/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}cancel(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches/${t}/cancel`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){let r=await this.create(e,t);return await this.poll(e,r.id,n)}listFiles(e,t,n={},r){return tj(n)?this.listFiles(e,t,{},n):this._client.getAPIList(`/vector_stores/${e}/file_batches/${t}/files`,nv,{query:n,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}async poll(e,t,n){let r={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(r["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){let{data:o,response:a}=await this.retrieve(e,t,{...n,headers:r}).withResponse();switch(o.status){case"in_progress":let i=5e3;if(n?.pollIntervalMs)i=n.pollIntervalMs;else{let e=a.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(i=t)}}await tR(i);break;case"failed":case"cancelled":case"completed":return o}}}async uploadAndPoll(e,{files:t,fileIds:n=[]},r){if(null==t||0==t.length)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let o=Math.min(r?.maxConcurrency??5,t.length),a=this._client,i=t.values(),l=[...n];async function s(e){for(let t of e){let e=await a.files.create({file:t,purpose:"assistants"},r);l.push(e.id)}}let c=Array(o).fill(i).map(s);return await nm(c),await this.createAndPoll(e,{file_ids:l})}}class nx extends tG{constructor(){super(...arguments),this.files=new ng(this._client),this.fileBatches=new nb(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/vector_stores/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/vector_stores",nw,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}search(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/search`,nk,{body:t,method:"post",...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class nw extends t0{}class nk extends tJ{}nx.VectorStoresPage=nw,nx.VectorStoreSearchResponsesPage=nk,nx.Files=ng,nx.VectorStoreFilesPage=nv,nx.FileContentResponsesPage=ny,nx.FileBatches=nb;class nS extends tG{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/assistants/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/assistants",nE,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class nE extends t0{}function nO(e){return"function"==typeof e.parse}nS.AssistantsPage=nE;let nC=e=>e?.role==="assistant",nj=e=>e?.role==="function",n_=e=>e?.role==="tool";var nP=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},nN=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nT{constructor(){$.add(this),this.controller=new AbortController,V.set(this,void 0),X.set(this,()=>{}),G.set(this,()=>{}),Y.set(this,void 0),Q.set(this,()=>{}),J.set(this,()=>{}),ee.set(this,{}),et.set(this,!1),en.set(this,!1),er.set(this,!1),eo.set(this,!1),nP(this,V,new Promise((e,t)=>{nP(this,X,e,"f"),nP(this,G,t,"f")}),"f"),nP(this,Y,new Promise((e,t)=>{nP(this,Q,e,"f"),nP(this,J,t,"f")}),"f"),nN(this,V,"f").catch(()=>{}),nN(this,Y,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},nN(this,$,"m",ea).bind(this))},0)}_connected(){this.ended||(nN(this,X,"f").call(this),this._emit("connect"))}get ended(){return nN(this,et,"f")}get errored(){return nN(this,en,"f")}get aborted(){return nN(this,er,"f")}abort(){this.controller.abort()}on(e,t){return(nN(this,ee,"f")[e]||(nN(this,ee,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=nN(this,ee,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(nN(this,ee,"f")[e]||(nN(this,ee,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{nP(this,eo,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){nP(this,eo,!0,"f"),await nN(this,Y,"f")}_emit(e,...t){if(nN(this,et,"f"))return;"end"===e&&(nP(this,et,!0,"f"),nN(this,Q,"f").call(this));let n=nN(this,ee,"f")[e];if(n&&(nN(this,ee,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];nN(this,eo,"f")||n?.length||Promise.reject(e),nN(this,G,"f").call(this,e),nN(this,J,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];nN(this,eo,"f")||n?.length||Promise.reject(e),nN(this,G,"f").call(this,e),nN(this,J,"f").call(this,e),this._emit("end")}}_emitFinal(){}}function nA(e){return e?.$brand==="auto-parseable-response-format"}function nM(e){return e?.$brand==="auto-parseable-tool"}function nI(e,t){let n=e.choices.map(e=>{var n;if("length"===e.finish_reason)throw new q;if("content_filter"===e.finish_reason)throw new W;return{...e,message:{...e.message,...e.message.tool_calls?{tool_calls:e.message.tool_calls?.map(e=>(function(e,t){let n=e.tools?.find(e=>e.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:nM(n)?n.$parseRaw(t.function.arguments):n?.function.strict?JSON.parse(t.function.arguments):null}}})(t,e))??void 0}:void 0,parsed:e.message.content&&!e.message.refusal?(n=e.message.content,t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(n):JSON.parse(n):null):null}}});return{...e,choices:n}}function nR(e){return!!nA(e.response_format)||(e.tools?.some(e=>nM(e)||"function"===e.type&&!0===e.function.strict)??!1)}V=new WeakMap,X=new WeakMap,G=new WeakMap,Y=new WeakMap,Q=new WeakMap,J=new WeakMap,ee=new WeakMap,et=new WeakMap,en=new WeakMap,er=new WeakMap,eo=new WeakMap,$=new WeakSet,ea=function(e){if(nP(this,en,!0,"f"),e instanceof Error&&"AbortError"===e.name&&(e=new A),e instanceof A)return nP(this,er,!0,"f"),this._emit("abort",e);if(e instanceof N)return this._emit("error",e);if(e instanceof Error){let t=new N(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new N(String(e)))};var nD=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nL extends nT{constructor(){super(...arguments),ei.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let t=e.choices[0]?.message;return t&&this._addMessage(t),e}_addMessage(e,t=!0){if("content"in e||(e.content=null),this.messages.push(e),t){if(this._emit("message",e),(nj(e)||n_(e))&&e.content)this._emit("functionCallResult",e.content);else if(nC(e)&&e.function_call)this._emit("functionCall",e.function_call);else if(nC(e)&&e.tool_calls)for(let t of e.tool_calls)"function"===t.type&&this._emit("functionCall",t.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new N("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),nD(this,ei,"m",el).call(this)}async finalMessage(){return await this.done(),nD(this,ei,"m",es).call(this)}async finalFunctionCall(){return await this.done(),nD(this,ei,"m",ec).call(this)}async finalFunctionCallResult(){return await this.done(),nD(this,ei,"m",eu).call(this)}async totalUsage(){return await this.done(),nD(this,ei,"m",ed).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let t=nD(this,ei,"m",es).call(this);t&&this._emit("finalMessage",t);let n=nD(this,ei,"m",el).call(this);n&&this._emit("finalContent",n);let r=nD(this,ei,"m",ec).call(this);r&&this._emit("finalFunctionCall",r);let o=nD(this,ei,"m",eu).call(this);null!=o&&this._emit("finalFunctionCallResult",o),this._chatCompletions.some(e=>e.usage)&&this._emit("totalUsage",nD(this,ei,"m",ed).call(this))}async _createChatCompletion(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nD(this,ei,"m",ef).call(this,t);let o=await e.chat.completions.create({...t,stream:!1},{...n,signal:this.controller.signal});return this._connected(),this._addChatCompletion(nI(o,t))}async _runChatCompletion(e,t,n){for(let e of t.messages)this._addMessage(e,!1);return await this._createChatCompletion(e,t,n)}async _runFunctions(e,t,n){let r="function",{function_call:o="auto",stream:a,...i}=t,l="string"!=typeof o&&o?.name,{maxChatCompletions:s=10}=n||{},c={};for(let e of t.functions)c[e.name||e.function.name]=e;let u=t.functions.map(e=>({name:e.name||e.function.name,parameters:e.parameters,description:e.description}));for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<s;++t){let t;let a=await this._createChatCompletion(e,{...i,function_call:o,functions:u,messages:[...this.messages]},n),s=a.choices[0]?.message;if(!s)throw new N("missing message in ChatCompletion response");if(!s.function_call)return;let{name:d,arguments:f}=s.function_call,p=c[d];if(p){if(l&&l!==d){let e=`Invalid function_call: ${JSON.stringify(d)}. ${JSON.stringify(l)} requested. Please try again`;this._addMessage({role:r,name:d,content:e});continue}}else{let e=`Invalid function_call: ${JSON.stringify(d)}. Available options are: ${u.map(e=>JSON.stringify(e.name)).join(", ")}. Please try again`;this._addMessage({role:r,name:d,content:e});continue}try{t=nO(p)?await p.parse(f):f}catch(e){this._addMessage({role:r,name:d,content:e instanceof Error?e.message:String(e)});continue}let h=await p.function(t,this),m=nD(this,ei,"m",ep).call(this,h);if(this._addMessage({role:r,name:d,content:m}),l)return}}async _runTools(e,t,n){let r="tool",{tool_choice:o="auto",stream:a,...i}=t,l="string"!=typeof o&&o?.function?.name,{maxChatCompletions:s=10}=n||{},c=t.tools.map(e=>{if(nM(e)){if(!e.$callback)throw new N("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:e.$callback,name:e.function.name,description:e.function.description||"",parameters:e.function.parameters,parse:e.$parseRaw,strict:!0}}}return e}),u={};for(let e of c)"function"===e.type&&(u[e.function.name||e.function.function.name]=e.function);let d="tools"in t?c.map(e=>"function"===e.type?{type:"function",function:{name:e.function.name||e.function.function.name,parameters:e.function.parameters,description:e.function.description,strict:e.function.strict}}:e):void 0;for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<s;++t){let t=await this._createChatCompletion(e,{...i,tool_choice:o,tools:d,messages:[...this.messages]},n),a=t.choices[0]?.message;if(!a)throw new N("missing message in ChatCompletion response");if(!a.tool_calls?.length)break;for(let e of a.tool_calls){let t;if("function"!==e.type)continue;let n=e.id,{name:o,arguments:a}=e.function,i=u[o];if(i){if(l&&l!==o){let e=`Invalid tool_call: ${JSON.stringify(o)}. ${JSON.stringify(l)} requested. Please try again`;this._addMessage({role:r,tool_call_id:n,content:e});continue}}else{let e=`Invalid tool_call: ${JSON.stringify(o)}. Available options are: ${Object.keys(u).map(e=>JSON.stringify(e)).join(", ")}. Please try again`;this._addMessage({role:r,tool_call_id:n,content:e});continue}try{t=nO(i)?await i.parse(a):a}catch(t){let e=t instanceof Error?t.message:String(t);this._addMessage({role:r,tool_call_id:n,content:e});continue}let s=await i.function(t,this),c=nD(this,ei,"m",ep).call(this,s);if(this._addMessage({role:r,tool_call_id:n,content:c}),l)return}}}}ei=new WeakSet,el=function(){return nD(this,ei,"m",es).call(this).content??null},es=function(){let e=this.messages.length;for(;e-- >0;){let t=this.messages[e];if(nC(t)){let{function_call:e,...n}=t,r={...n,content:t.content??null,refusal:t.refusal??null};return e&&(r.function_call=e),r}}throw new N("stream ended without producing a ChatCompletionMessage with role=assistant")},ec=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(nC(t)&&t?.function_call)return t.function_call;if(nC(t)&&t?.tool_calls?.length)return t.tool_calls.at(-1)?.function}},eu=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(nj(t)&&null!=t.content||n_(t)&&null!=t.content&&"string"==typeof t.content&&this.messages.some(e=>"assistant"===e.role&&e.tool_calls?.some(e=>"function"===e.type&&e.id===t.tool_call_id)))return t.content}},ed=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:t}of this._chatCompletions)t&&(e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens);return e},ef=function(e){if(null!=e.n&&e.n>1)throw new N("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},ep=function(e){return"string"==typeof e?e:void 0===e?"undefined":JSON.stringify(e)};class nZ extends nL{static runFunctions(e,t,n){let r=new nZ,o={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return r._run(()=>r._runFunctions(e,t,o)),r}static runTools(e,t,n){let r=new nZ,o={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(e,t,o)),r}_addMessage(e,t=!0){super._addMessage(e,t),nC(e)&&e.content&&this._emit("content",e.content)}}let nz={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,ALL:511};class nB extends Error{}class nF extends Error{}let nH=(e,t)=>{let n=e.length,r=0,o=e=>{throw new nB(`${e} at position ${r}`)},a=e=>{throw new nF(`${e} at position ${r}`)},i=()=>(d(),r>=n&&o("Unexpected end of input"),'"'===e[r])?l():"{"===e[r]?s():"["===e[r]?c():"null"===e.substring(r,r+4)||nz.NULL&t&&n-r<4&&"null".startsWith(e.substring(r))?(r+=4,null):"true"===e.substring(r,r+4)||nz.BOOL&t&&n-r<4&&"true".startsWith(e.substring(r))?(r+=4,!0):"false"===e.substring(r,r+5)||nz.BOOL&t&&n-r<5&&"false".startsWith(e.substring(r))?(r+=5,!1):"Infinity"===e.substring(r,r+8)||nz.INFINITY&t&&n-r<8&&"Infinity".startsWith(e.substring(r))?(r+=8,1/0):"-Infinity"===e.substring(r,r+9)||nz.MINUS_INFINITY&t&&1<n-r&&n-r<9&&"-Infinity".startsWith(e.substring(r))?(r+=9,-1/0):"NaN"===e.substring(r,r+3)||nz.NAN&t&&n-r<3&&"NaN".startsWith(e.substring(r))?(r+=3,NaN):u(),l=()=>{let i=r,l=!1;for(r++;r<n&&('"'!==e[r]||l&&"\\"===e[r-1]);)l="\\"===e[r]&&!l,r++;if('"'==e.charAt(r))try{return JSON.parse(e.substring(i,++r-Number(l)))}catch(e){a(String(e))}else if(nz.STR&t)try{return JSON.parse(e.substring(i,r-Number(l))+'"')}catch(t){return JSON.parse(e.substring(i,e.lastIndexOf("\\"))+'"')}o("Unterminated string literal")},s=()=>{r++,d();let a={};try{for(;"}"!==e[r];){if(d(),r>=n&&nz.OBJ&t)return a;let o=l();d(),r++;try{let e=i();Object.defineProperty(a,o,{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){if(nz.OBJ&t)return a;throw e}d(),","===e[r]&&r++}}catch(e){if(nz.OBJ&t)return a;o("Expected '}' at end of object")}return r++,a},c=()=>{r++;let n=[];try{for(;"]"!==e[r];)n.push(i()),d(),","===e[r]&&r++}catch(e){if(nz.ARR&t)return n;o("Expected ']' at end of array")}return r++,n},u=()=>{if(0===r){"-"===e&&nz.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e)}catch(n){if(nz.NUM&t)try{if("."===e[e.length-1])return JSON.parse(e.substring(0,e.lastIndexOf(".")));return JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch(e){}a(String(n))}}let i=r;for("-"===e[r]&&r++;e[r]&&!",]}".includes(e[r]);)r++;r!=n||nz.NUM&t||o("Unterminated number literal");try{return JSON.parse(e.substring(i,r))}catch(n){"-"===e.substring(i,r)&&nz.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e.substring(i,e.lastIndexOf("e")))}catch(e){a(String(e))}}},d=()=>{for(;r<n&&" \n\r ".includes(e[r]);)r++};return i()},nq=e=>(function(e,t=nz.ALL){if("string"!=typeof e)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return nH(e.trim(),t)})(e,nz.ALL^nz.NUM);var nW=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},nU=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nK extends nL{constructor(e){super(),eh.add(this),em.set(this,void 0),eg.set(this,void 0),ev.set(this,void 0),nW(this,em,e,"f"),nW(this,eg,[],"f")}get currentChatCompletionSnapshot(){return nU(this,ev,"f")}static fromReadableStream(e){let t=new nK(null);return t._run(()=>t._fromReadableStream(e)),t}static createChatCompletion(e,t,n){let r=new nK(t);return r._run(()=>r._runChatCompletion(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createChatCompletion(e,t,n){super._createChatCompletion;let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nU(this,eh,"m",ey).call(this);let o=await e.chat.completions.create({...t,stream:!0},{...n,signal:this.controller.signal});for await(let e of(this._connected(),o))nU(this,eh,"m",ex).call(this,e);if(o.controller.signal?.aborted)throw new A;return this._addChatCompletion(nU(this,eh,"m",eS).call(this))}async _fromReadableStream(e,t){let n;let r=t?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nU(this,eh,"m",ey).call(this),this._connected();let o=e8.fromReadableStream(e,this.controller);for await(let e of o)n&&n!==e.id&&this._addChatCompletion(nU(this,eh,"m",eS).call(this)),nU(this,eh,"m",ex).call(this,e),n=e.id;if(o.controller.signal?.aborted)throw new A;return this._addChatCompletion(nU(this,eh,"m",eS).call(this))}[(em=new WeakMap,eg=new WeakMap,ev=new WeakMap,eh=new WeakSet,ey=function(){this.ended||nW(this,ev,void 0,"f")},eb=function(e){let t=nU(this,eg,"f")[e.index];return t||(t={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},nU(this,eg,"f")[e.index]=t),t},ex=function(e){if(this.ended)return;let t=nU(this,eh,"m",eO).call(this,e);for(let n of(this._emit("chunk",e,t),e.choices)){let e=t.choices[n.index];null!=n.delta.content&&e.message?.role==="assistant"&&e.message?.content&&(this._emit("content",n.delta.content,e.message.content),this._emit("content.delta",{delta:n.delta.content,snapshot:e.message.content,parsed:e.message.parsed})),null!=n.delta.refusal&&e.message?.role==="assistant"&&e.message?.refusal&&this._emit("refusal.delta",{delta:n.delta.refusal,snapshot:e.message.refusal}),n.logprobs?.content!=null&&e.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:n.logprobs?.content,snapshot:e.logprobs?.content??[]}),n.logprobs?.refusal!=null&&e.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:n.logprobs?.refusal,snapshot:e.logprobs?.refusal??[]});let r=nU(this,eh,"m",eb).call(this,e);for(let t of(e.finish_reason&&(nU(this,eh,"m",ek).call(this,e),null!=r.current_tool_call_index&&nU(this,eh,"m",ew).call(this,e,r.current_tool_call_index)),n.delta.tool_calls??[]))r.current_tool_call_index!==t.index&&(nU(this,eh,"m",ek).call(this,e),null!=r.current_tool_call_index&&nU(this,eh,"m",ew).call(this,e,r.current_tool_call_index)),r.current_tool_call_index=t.index;for(let t of n.delta.tool_calls??[]){let n=e.message.tool_calls?.[t.index];n?.type&&(n?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:n.function?.name,index:t.index,arguments:n.function.arguments,parsed_arguments:n.function.parsed_arguments,arguments_delta:t.function?.arguments??""}):n?.type)}}},ew=function(e,t){if(nU(this,eh,"m",eb).call(this,e).done_tool_calls.has(t))return;let n=e.message.tool_calls?.[t];if(!n)throw Error("no tool call snapshot");if(!n.type)throw Error("tool call snapshot missing `type`");if("function"===n.type){let e=nU(this,em,"f")?.tools?.find(e=>"function"===e.type&&e.function.name===n.function.name);this._emit("tool_calls.function.arguments.done",{name:n.function.name,index:t,arguments:n.function.arguments,parsed_arguments:nM(e)?e.$parseRaw(n.function.arguments):e?.function.strict?JSON.parse(n.function.arguments):null})}else n.type},ek=function(e){let t=nU(this,eh,"m",eb).call(this,e);if(e.message.content&&!t.content_done){t.content_done=!0;let n=nU(this,eh,"m",eE).call(this);this._emit("content.done",{content:e.message.content,parsed:n?n.$parseRaw(e.message.content):null})}e.message.refusal&&!t.refusal_done&&(t.refusal_done=!0,this._emit("refusal.done",{refusal:e.message.refusal})),e.logprobs?.content&&!t.logprobs_content_done&&(t.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:e.logprobs.content})),e.logprobs?.refusal&&!t.logprobs_refusal_done&&(t.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:e.logprobs.refusal}))},eS=function(){if(this.ended)throw new N("stream has ended, this shouldn't happen");let e=nU(this,ev,"f");if(!e)throw new N("request ended without sending any chunks");return nW(this,ev,void 0,"f"),nW(this,eg,[],"f"),function(e,t){var n;let{id:r,choices:o,created:a,model:i,system_fingerprint:l,...s}=e;return n={...s,id:r,choices:o.map(({message:t,finish_reason:n,index:r,logprobs:o,...a})=>{if(!n)throw new N(`missing finish_reason for choice ${r}`);let{content:i=null,function_call:l,tool_calls:s,...c}=t,u=t.role;if(!u)throw new N(`missing role for choice ${r}`);if(l){let{arguments:e,name:s}=l;if(null==e)throw new N(`missing function_call.arguments for choice ${r}`);if(!s)throw new N(`missing function_call.name for choice ${r}`);return{...a,message:{content:i,function_call:{arguments:e,name:s},role:u,refusal:t.refusal??null},finish_reason:n,index:r,logprobs:o}}return s?{...a,index:r,finish_reason:n,logprobs:o,message:{...c,role:u,content:i,refusal:t.refusal??null,tool_calls:s.map((t,n)=>{let{function:o,type:a,id:i,...l}=t,{arguments:s,name:c,...u}=o||{};if(null==i)throw new N(`missing choices[${r}].tool_calls[${n}].id+`;try{t=fetch,n=Request,r=Response,o=Headers}catch(e){throw Error(`this environment is missing the following Web Fetch API type: ${e.message}. ${a}`)}return{kind:"web",fetch:t,Request:n,Response:r,Headers:o,FormData:"undefined"!=typeof FormData?FormData:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${a}`)}},Blob:"undefined"!=typeof Blob?Blob:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${a}`)}},File:"undefined"!=typeof File?File:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${a}`)}},ReadableStream:"undefined"!=typeof ReadableStream?ReadableStream:class{constructor(){throw Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${a}`)}},getMultipartRequestOptions:async(e,t)=>({...t,body:new _(e)}),getDefaultAgent:e=>void 0,fileFromPath:()=>{throw Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:e=>!1}}(),{auto:!0})};P();class N extends Error{}class T extends N{constructor(e,t,n,r){super(`${T.makeMessage(e,t,n)}`),this.status=e,this.headers=r,this.request_id=r?.["x-request-id"],this.error=t,this.code=t?.code,this.param=t?.param,this.type=t?.type}static makeMessage(e,t,n){let r=t?.message?"string"==typeof t.message?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,n,r){if(!e||!r)return new M({message:n,cause:tL(t)});let o=t?.error;return 400===e?new R(e,o,n,r):401===e?new D(e,o,n,r):403===e?new L(e,o,n,r):404===e?new Z(e,o,n,r):409===e?new z(e,o,n,r):422===e?new B(e,o,n,r):429===e?new F(e,o,n,r):e>=500?new H(e,o,n,r):new T(e,o,n,r)}}class A extends T{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class M extends T{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),t&&(this.cause=t)}}class I extends M{constructor({message:e}={}){super({message:e??"Request timed out."})}}class R extends T{}class D extends T{}class L extends T{}class Z extends T{}class z extends T{}class B extends T{}class F extends T{}class H extends T{}class q extends N{constructor(){super("Could not parse response content as the length limit was reached")}}class W extends N{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}var U,K,$,V,X,G,Y,Q,J,ee,et,en,er,eo,ea,ei,el,es,ec,eu,ed,ef,ep,eh,em,eg,ev,ey,eb,ex,ew,ek,eS,eE,eO,eC,ej,e_,eP,eN,eT,eA,eM,eI,eR,eD,eL,eZ,ez,eB,eF,eH,eq,eW,eU,eK,e$,eV,eX,eG,eY,eQ,eJ,e0,e1,e2=n(96434).Buffer,e6=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},e4=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class e3{constructor(){U.set(this,void 0),this.buffer=new Uint8Array,e6(this,U,null,"f")}decode(e){let t;if(null==e)return[];let n=e instanceof ArrayBuffer?new Uint8Array(e):"string"==typeof e?new TextEncoder().encode(e):e,r=new Uint8Array(this.buffer.length+n.length);r.set(this.buffer),r.set(n,this.buffer.length),this.buffer=r;let o=[];for(;null!=(t=function(e,t){for(let n=t??0;n<e.length;n++){if(10===e[n])return{preceding:n,index:n+1,carriage:!1};if(13===e[n])return{preceding:n,index:n+1,carriage:!0}}return null}(this.buffer,e4(this,U,"f")));){if(t.carriage&&null==e4(this,U,"f")){e6(this,U,t.index,"f");continue}if(null!=e4(this,U,"f")&&(t.index!==e4(this,U,"f")+1||t.carriage)){o.push(this.decodeText(this.buffer.slice(0,e4(this,U,"f")-1))),this.buffer=this.buffer.slice(e4(this,U,"f")),e6(this,U,null,"f");continue}let e=null!==e4(this,U,"f")?t.preceding-1:t.preceding,n=this.decodeText(this.buffer.slice(0,e));o.push(n),this.buffer=this.buffer.slice(t.index),e6(this,U,null,"f")}return o}decodeText(e){if(null==e)return"";if("string"==typeof e)return e;if(void 0!==e2){if(e instanceof e2)return e.toString();if(e instanceof Uint8Array)return e2.from(e).toString();throw new N(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if("undefined"!=typeof TextDecoder){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new N(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new N("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){return this.buffer.length?this.decode("\n"):[]}}function e5(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}U=new WeakMap,e3.NEWLINE_CHARS=new Set(["\n","\r"]),e3.NEWLINE_REGEXP=/\r\n|[\n\r]/g;class e8{constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let n=!1;return new e8(async function*(){if(n)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let r=!1;try{for await(let n of e7(e,t))if(!r){if(n.data.startsWith("[DONE]")){r=!0;continue}if(null===n.event||n.event.startsWith("response.")||n.event.startsWith("transcript.")){let t;try{t=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if(t&&t.error)throw new T(void 0,t.error,void 0,tO(e.headers));yield t}else{let e;try{e=JSON.parse(n.data)}catch(e){throw console.error("Could not parse message into JSON:",n.data),console.error("From chunk:",n.raw),e}if("error"==n.event)throw new T(void 0,e.error,e.message,void 0);yield{event:n.event,data:e}}}r=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{r||t.abort()}},t)}static fromReadableStream(e,t){let n=!1;async function*r(){let t=new e3;for await(let n of e5(e))for(let e of t.decode(n))yield e;for(let e of t.flush())yield e}return new e8(async function*(){if(n)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let e=!1;try{for await(let t of r())!e&&t&&(yield JSON.parse(t));e=!0}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;throw e}finally{e||t.abort()}},t)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=r=>({next:()=>{if(0===r.length){let r=n.next();e.push(r),t.push(r)}return r.shift()}});return[new e8(()=>r(e),this.controller),new e8(()=>r(t),this.controller)]}toReadableStream(){let e;let t=this,n=new TextEncoder;return new s({async start(){e=t[Symbol.asyncIterator]()},async pull(t){try{let{value:r,done:o}=await e.next();if(o)return t.close();let a=n.encode(JSON.stringify(r)+"\n");t.enqueue(a)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}}async function*e7(e,t){if(!e.body)throw t.abort(),new N("Attempted to iterate over a response with no body");let n=new te,r=new e3;for await(let t of e9(e5(e.body)))for(let e of r.decode(t)){let t=n.decode(e);t&&(yield t)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*e9(e){let t=new Uint8Array;for await(let n of e){let e;if(null==n)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):"string"==typeof n?new TextEncoder().encode(n):n,o=new Uint8Array(t.length+r.length);for(o.set(t),o.set(r,t.length),t=o;-1!==(e=function(e){for(let t=0;t<e.length-1;t++){if(10===e[t]&&10===e[t+1]||13===e[t]&&13===e[t+1])return t+2;if(13===e[t]&&10===e[t+1]&&t+3<e.length&&13===e[t+2]&&10===e[t+3])return t+4}return -1}(t));)yield t.slice(0,e),t=t.slice(e)}t.length>0&&(yield t)}class te{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join("\n"),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=function(e,t){let n=e.indexOf(":");return -1!==n?[e.substring(0,n),":",e.substring(n+t.length)]:[e,"",""]}(e,":");return r.startsWith(" ")&&(r=r.substring(1)),"event"===t?this.event=r:"data"===t&&this.data.push(r),null}}var tt=n(96434).Buffer;let tn=e=>null!=e&&"object"==typeof e&&"string"==typeof e.url&&"function"==typeof e.blob,tr=e=>null!=e&&"object"==typeof e&&"string"==typeof e.name&&"number"==typeof e.lastModified&&to(e),to=e=>null!=e&&"object"==typeof e&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.text&&"function"==typeof e.slice&&"function"==typeof e.arrayBuffer,ta=e=>tr(e)||tn(e)||f(e);async function ti(e,t,n){var r;if(tr(e=await e))return e;if(tn(e)){let r=await e.blob();t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()??"unknown_file");let o=to(r)?[await r.arrayBuffer()]:[r];return new l(o,t,n)}let o=await tl(e);if(t||(t=(ts((r=e).name)||ts(r.filename)||ts(r.path)?.split(/[\\/]/).pop())??"unknown_file"),!n?.type){let e=o[0]?.type;"string"==typeof e&&(n={...n,type:e})}return new l(o,t,n)}async function tl(e){let t=[];if("string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(to(e))t.push(await e.arrayBuffer());else if(tc(e))for await(let n of e)t.push(n);else throw Error(`Unexpected data type: ${typeof e}; constructor: ${e?.constructor?.name}; props: ${function(e){let t=Object.getOwnPropertyNames(e);return`[${t.map(e=>`"${e}"`).join(", ")}]`}(e)}`);return t}let ts=e=>"string"==typeof e?e:void 0!==tt&&e instanceof tt?String(e):void 0,tc=e=>null!=e&&"object"==typeof e&&"function"==typeof e[Symbol.asyncIterator],tu=e=>e&&"object"==typeof e&&e.body&&"MultipartBody"===e[Symbol.toStringTag],td=async e=>{let t=await tf(e.body);return c(t,e)},tf=async e=>{let t=new i;return await Promise.all(Object.entries(e||{}).map(([e,n])=>th(t,e,n))),t},tp=e=>{if(ta(e))return!0;if(Array.isArray(e))return e.some(tp);if(e&&"object"==typeof e){for(let t in e)if(tp(e[t]))return!0}return!1},th=async(e,t,n)=>{if(void 0!==n){if(null==n)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)e.append(t,String(n));else if(ta(n)){let r=await ti(n);e.append(t,r)}else if(Array.isArray(n))await Promise.all(n.map(n=>th(e,t+"[]",n)));else if("object"==typeof n)await Promise.all(Object.entries(n).map(([n,r])=>th(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}};var tm=n(96434).Buffer,tg=n(40257),tv=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},ty=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};async function tb(e){let{response:t}=e;if(e.options.stream)return(tq("response",t.status,t.url,t.headers,t.body),e.options.__streamClass)?e.options.__streamClass.fromSSEResponse(t,e.controller):e8.fromSSEResponse(t,e.controller);if(204===t.status)return null;if(e.options.__binaryResponse)return t;let n=t.headers.get("content-type"),r=n?.split(";")[0]?.trim();if(r?.includes("application/json")||r?.endsWith("+json")){let e=await t.json();return tq("response",t.status,t.url,t.headers,e),tx(e,t)}let o=await t.text();return tq("response",t.status,t.url,t.headers,o),o}function tx(e,t){return!e||"object"!=typeof e||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}P();class tw extends Promise{constructor(e,t=tb){super(e=>{e(null)}),this.responsePromise=e,this.parseResponse=t}_thenUnwrap(e){return new tw(this.responsePromise,async t=>tx(e(await this.parseResponse(t),t),t.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}class tk{constructor({baseURL:e,maxRetries:t=2,timeout:n=6e5,httpAgent:r,fetch:o}){this.baseURL=e,this.maxRetries=tD("maxRetries",t),this.timeout=tD("timeout",n),this.httpAgent=r,this.fetch=o??a}authHeaders(e){return{}}defaultHeaders(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...tT(),...this.authHeaders(e)}}validateHeaders(e,t){}defaultIdempotencyKey(){return`stainless-node-retry-${tW()}`}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(async n=>{let r=n&&to(n?.body)?new DataView(await n.body.arrayBuffer()):n?.body instanceof DataView?n.body:n?.body instanceof ArrayBuffer?new DataView(n.body):n&&ArrayBuffer.isView(n?.body)?new DataView(n.body.buffer):n?.body;return{method:e,path:t,...n,body:r}}))}getAPIList(e,t,n){return this.requestAPIList(t,{method:"get",path:e,...n})}calculateContentLength(e){if("string"==typeof e){if(void 0!==tm)return tm.byteLength(e,"utf8").toString();if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e).length.toString()}else if(ArrayBuffer.isView(e))return e.byteLength.toString();return null}buildRequest(e,{retryCount:t=0}={}){let{method:n,path:r,query:o,headers:a={}}=e={...e},i=ArrayBuffer.isView(e.body)||e.__binaryRequest&&"string"==typeof e.body?e.body:tu(e.body)?e.body.body:e.body?JSON.stringify(e.body,null,2):null,l=this.calculateContentLength(i),s=this.buildURL(r,o);"timeout"in e&&tD("timeout",e.timeout),e.timeout=e.timeout??this.timeout;let c=e.httpAgent??this.httpAgent??u(s),d=e.timeout+1e3;"number"==typeof c?.options?.timeout&&d>(c.options.timeout??0)&&(c.options.timeout=d),this.idempotencyHeader&&"get"!==n&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=e.idempotencyKey);let f=this.buildHeaders({options:e,headers:a,contentLength:l,retryCount:t});return{req:{method:n,...i&&{body:i},headers:f,...c&&{agent:c},signal:e.signal??null},url:s,timeout:e.timeout}}buildHeaders({options:e,headers:t,contentLength:n,retryCount:r}){let a={};n&&(a["content-length"]=n);let i=this.defaultHeaders(e);return tF(a,i),tF(a,t),tu(e.body)&&"node"!==o&&delete a["content-type"],void 0===t$(i,"x-stainless-retry-count")&&void 0===t$(t,"x-stainless-retry-count")&&(a["x-stainless-retry-count"]=String(r)),void 0===t$(i,"x-stainless-timeout")&&void 0===t$(t,"x-stainless-timeout")&&e.timeout&&(a["x-stainless-timeout"]=String(Math.trunc(e.timeout/1e3))),this.validateHeaders(a,t),a}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){}parseHeaders(e){return e?Symbol.iterator in e?Object.fromEntries(Array.from(e).map(e=>[...e])):{...e}:{}}makeStatusError(e,t,n,r){return T.generate(e,t,n,r)}request(e,t=null){return new tw(this.makeRequest(e,t))}async makeRequest(e,t){let n=await e,r=n.maxRetries??this.maxRetries;null==t&&(t=r),await this.prepareOptions(n);let{req:o,url:a,timeout:i}=this.buildRequest(n,{retryCount:r-t});if(await this.prepareRequest(o,{url:a,options:n}),tq("request",a,n,o.headers),n.signal?.aborted)throw new A;let l=new AbortController,s=await this.fetchWithTimeout(a,o,i,l).catch(tL);if(s instanceof Error){if(n.signal?.aborted)throw new A;if(t)return this.retryRequest(n,t);if("AbortError"===s.name)throw new I;throw new M({cause:s})}let c=tO(s.headers);if(!s.ok){if(t&&this.shouldRetry(s)){let e=`retrying, ${t} attempts remaining`;return tq(`response (error; ${e})`,s.status,a,c),this.retryRequest(n,t,c)}let e=await s.text().catch(e=>tL(e).message),r=tA(e),o=r?void 0:e,i=t?"(error; no more retries left)":"(error; not retryable)";throw tq(`response (error; ${i})`,s.status,a,c,o),this.makeStatusError(s.status,r,o,c)}return{response:s,options:n,controller:l}}requestAPIList(e,t){return new tE(this,this.makeRequest(t,null),e)}buildURL(e,t){let n=new URL(tI(e)?e:this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return tz(r)||(t={...r,...t}),"object"==typeof t&&t&&!Array.isArray(t)&&(n.search=this.stringifyQuery(t)),n.toString()}stringifyQuery(e){return Object.entries(e).filter(([e,t])=>void 0!==t).map(([e,t])=>{if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(null===t)return`${encodeURIComponent(e)}=`;throw new N(`Cannot stringify type ${typeof t}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(e,t,n,r){let{signal:o,...a}=t||{};o&&o.addEventListener("abort",()=>r.abort());let i=setTimeout(()=>r.abort(),n),l={signal:r.signal,...a};return l.method&&(l.method=l.method.toUpperCase()),this.fetch.call(void 0,e,l).finally(()=>{clearTimeout(i)})}shouldRetry(e){let t=e.headers.get("x-should-retry");return"true"===t||"false"!==t&&(408===e.status||409===e.status||429===e.status||e.status>=500)}async retryRequest(e,t,n){let r;let o=n?.["retry-after-ms"];if(o){let e=parseFloat(o);Number.isNaN(e)||(r=e)}let a=n?.["retry-after"];if(a&&!r){let e=parseFloat(a);r=Number.isNaN(e)?Date.parse(a)-Date.now():1e3*e}if(!(r&&0<=r&&r<6e4)){let n=e.maxRetries??this.maxRetries;r=this.calculateDefaultRetryTimeoutMillis(t,n)}return await tR(r),this.makeRequest(e,t-1)}calculateDefaultRetryTimeoutMillis(e,t){return Math.min(.5*Math.pow(2,t-e),8)*(1-.25*Math.random())*1e3}getUserAgent(){return`${this.constructor.name}/JS ${C}`}}class tS{constructor(e,t,n,r){K.set(this,void 0),tv(this,K,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){return!!this.getPaginatedItems().length&&null!=this.nextPageInfo()}async getNextPage(){let e=this.nextPageInfo();if(!e)throw new N("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");let t={...this.options};if("params"in e&&"object"==typeof t.query)t.query={...t.query,...e.params};else if("url"in e){for(let[n,r]of[...Object.entries(t.query||{}),...e.url.searchParams.entries()])e.url.searchParams.set(n,r);t.query=void 0,t.path=e.url.toString()}return await ty(this,K,"f").requestAPIList(this.constructor,t)}async *iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async *[(K=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class tE extends tw{constructor(e,t,n){super(t,async t=>new n(e,t.response,await tb(t),t.options))}async *[Symbol.asyncIterator](){for await(let e of(await this))yield e}}let tO=e=>new Proxy(Object.fromEntries(e.entries()),{get(e,t){let n=t.toString();return e[n.toLowerCase()]||e[n]}}),tC={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__metadata:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},tj=e=>"object"==typeof e&&null!==e&&!tz(e)&&Object.keys(e).every(e=>tB(tC,e)),t_=()=>{if("undefined"!=typeof Deno&&null!=Deno.build)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":tN(Deno.build.os),"X-Stainless-Arch":tP(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":"string"==typeof Deno.version?Deno.version:Deno.version?.deno??"unknown"};if("undefined"!=typeof EdgeRuntime)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":tg.version};if("[object process]"===Object.prototype.toString.call(void 0!==tg?tg:0))return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":tN(tg.platform),"X-Stainless-Arch":tP(tg.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":tg.version};let e=function(){if("undefined"==typeof navigator||!navigator)return null;for(let{key:e,pattern:t}of[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n){let t=n[1]||0,r=n[2]||0,o=n[3]||0;return{browser:e,version:`${t}.${r}.${o}`}}}return null}();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":C,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},tP=e=>"x32"===e?"x32":"x86_64"===e||"x64"===e?"x64":"arm"===e?"arm":"aarch64"===e||"arm64"===e?"arm64":e?`other:${e}`:"unknown",tN=e=>(e=e.toLowerCase()).includes("ios")?"iOS":"android"===e?"Android":"darwin"===e?"MacOS":"win32"===e?"Windows":"freebsd"===e?"FreeBSD":"openbsd"===e?"OpenBSD":"linux"===e?"Linux":e?`Other:${e}`:"Unknown",tT=()=>r??(r=t_()),tA=e=>{try{return JSON.parse(e)}catch(e){return}},tM=/^[a-z][a-z0-9+.-]*:/i,tI=e=>tM.test(e),tR=e=>new Promise(t=>setTimeout(t,e)),tD=(e,t)=>{if("number"!=typeof t||!Number.isInteger(t))throw new N(`${e} must be an integer`);if(t<0)throw new N(`${e} must be a positive integer`);return t},tL=e=>{if(e instanceof Error)return e;if("object"==typeof e&&null!==e)try{return Error(JSON.stringify(e))}catch{}return Error(e)},tZ=e=>void 0!==tg?tg.env?.[e]?.trim()??void 0:"undefined"!=typeof Deno?Deno.env?.get?.(e)?.trim():void 0;function tz(e){if(!e)return!0;for(let t in e)return!1;return!0}function tB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tF(e,t){for(let n in t){if(!tB(t,n))continue;let r=n.toLowerCase();if(!r)continue;let o=t[n];null===o?delete e[r]:void 0!==o&&(e[r]=o)}}let tH=new Set(["authorization","api-key"]);function tq(e,...t){void 0!==tg&&tg?.env?.DEBUG==="true"&&console.log(`OpenAI:DEBUG:${e}`,...t.map(e=>{if(!e)return e;if(e.headers){let t={...e,headers:{...e.headers}};for(let n in e.headers)tH.has(n.toLowerCase())&&(t.headers[n]="REDACTED");return t}let t=null;for(let n in e)tH.has(n.toLowerCase())&&(t??(t={...e}),t[n]="REDACTED");return t??e}))}let tW=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),tU=()=>"undefined"!=typeof window&&void 0!==window.document&&"undefined"!=typeof navigator,tK=e=>"function"==typeof e?.get,t$=(e,t)=>{let n=t.toLowerCase();if(tK(e)){let r=t[0]?.toUpperCase()+t.substring(1).replace(/([^\w])(\w)/g,(e,t,n)=>t+n.toUpperCase());for(let o of[t,n,t.toUpperCase(),r]){let t=e.get(o);if(t)return t}}for(let[r,o]of Object.entries(e))if(r.toLowerCase()===n){if(Array.isArray(o)){if(o.length<=1)return o[0];return console.warn(`Received ${o.length} entries for the ${t} header, using the first entry.`),o[0]}return o}},tV=e=>{if(void 0!==tm){let t=tm.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return Array.from(new Float32Array(r.buffer))}};function tX(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}class tG{constructor(e){this._client=e}}class tY extends tG{create(e,t){return this._client.post("/completions",{body:e,...t,stream:e.stream??!1})}}class tQ extends tG{list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/chat/completions/${e}/messages`,t6,{query:t,...n})}}class tJ extends tS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.object=n.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class t0 extends tS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return!1!==this.has_more&&super.hasNextPage()}nextPageParams(){let e=this.nextPageInfo();if(!e)return null;if("params"in e)return e.params;let t=Object.fromEntries(e.url.searchParams);return Object.keys(t).length?t:null}nextPageInfo(){let e=this.getPaginatedItems();if(!e.length)return null;let t=e[e.length-1]?.id;return t?{params:{after:t}}:null}}class t1 extends tG{constructor(){super(...arguments),this.messages=new tQ(this._client)}create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}retrieve(e,t){return this._client.get(`/chat/completions/${e}`,t)}update(e,t,n){return this._client.post(`/chat/completions/${e}`,{body:t,...n})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/chat/completions",t2,{query:e,...t})}del(e,t){return this._client.delete(`/chat/completions/${e}`,t)}}class t2 extends t0{}class t6 extends t0{}t1.ChatCompletionsPage=t2,t1.Messages=tQ;class t4 extends tG{constructor(){super(...arguments),this.completions=new t1(this._client)}}t4.Completions=t1,t4.ChatCompletionsPage=t2;class t3 extends tG{create(e,t){let n=!!e.encoding_format,r=n?e.encoding_format:"base64";n&&tq("Request","User defined encoding_format:",e.encoding_format);let o=this._client.post("/embeddings",{body:{...e,encoding_format:r},...t});return n?o:(tq("response","Decoding base64 embeddings to float32 array"),o._thenUnwrap(e=>(e&&e.data&&e.data.forEach(e=>{let t=e.embedding;e.embedding=tV(t)}),e)))}}class t5 extends tG{create(e,t){return this._client.post("/files",td({body:e,...t}))}retrieve(e,t){return this._client.get(`/files/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/files",t8,{query:e,...t})}del(e,t){return this._client.delete(`/files/${e}`,t)}content(e,t){return this._client.get(`/files/${e}/content`,{...t,headers:{Accept:"application/binary",...t?.headers},__binaryResponse:!0})}retrieveContent(e,t){return this._client.get(`/files/${e}/content`,t)}async waitForProcessing(e,{pollInterval:t=5e3,maxWait:n=18e5}={}){let r=new Set(["processed","error","deleted"]),o=Date.now(),a=await this.retrieve(e);for(;!a.status||!r.has(a.status);)if(await tR(t),a=await this.retrieve(e),Date.now()-o>n)throw new I({message:`Giving up on waiting for file ${e} to finish processing after ${n} milliseconds.`});return a}}class t8 extends t0{}t5.FileObjectsPage=t8;class t7 extends tG{createVariation(e,t){return this._client.post("/images/variations",td({body:e,...t}))}edit(e,t){return this._client.post("/images/edits",td({body:e,...t}))}generate(e,t){return this._client.post("/images/generations",{body:e,...t})}}class t9 extends tG{create(e,t){return this._client.post("/audio/speech",{body:e,...t,headers:{Accept:"application/octet-stream",...t?.headers},__binaryResponse:!0})}}class ne extends tG{create(e,t){return this._client.post("/audio/transcriptions",td({body:e,...t,stream:e.stream??!1,__metadata:{model:e.model}}))}}class nt extends tG{create(e,t){return this._client.post("/audio/translations",td({body:e,...t,__metadata:{model:e.model}}))}}class nn extends tG{constructor(){super(...arguments),this.transcriptions=new ne(this._client),this.translations=new nt(this._client),this.speech=new t9(this._client)}}nn.Transcriptions=ne,nn.Translations=nt,nn.Speech=t9;class nr extends tG{create(e,t){return this._client.post("/moderations",{body:e,...t})}}class no extends tG{retrieve(e,t){return this._client.get(`/models/${e}`,t)}list(e){return this._client.getAPIList("/models",na,e)}del(e,t){return this._client.delete(`/models/${e}`,t)}}class na extends tJ{}no.ModelsPage=na;class ni extends tG{create(e,t,n){return this._client.getAPIList(`/fine_tuning/checkpoints/${e}/permissions`,nl,{body:t,method:"post",...n})}retrieve(e,t={},n){return tj(t)?this.retrieve(e,{},t):this._client.get(`/fine_tuning/checkpoints/${e}/permissions`,{query:t,...n})}del(e,t){return this._client.delete(`/fine_tuning/checkpoints/${e}/permissions`,t)}}class nl extends tJ{}ni.PermissionCreateResponsesPage=nl;class ns extends tG{constructor(){super(...arguments),this.permissions=new ni(this._client)}}ns.Permissions=ni,ns.PermissionCreateResponsesPage=nl;class nc extends tG{list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/checkpoints`,nu,{query:t,...n})}}class nu extends t0{}nc.FineTuningJobCheckpointsPage=nu;class nd extends tG{constructor(){super(...arguments),this.checkpoints=new nc(this._client)}create(e,t){return this._client.post("/fine_tuning/jobs",{body:e,...t})}retrieve(e,t){return this._client.get(`/fine_tuning/jobs/${e}`,t)}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/fine_tuning/jobs",nf,{query:e,...t})}cancel(e,t){return this._client.post(`/fine_tuning/jobs/${e}/cancel`,t)}listEvents(e,t={},n){return tj(t)?this.listEvents(e,{},t):this._client.getAPIList(`/fine_tuning/jobs/${e}/events`,np,{query:t,...n})}}class nf extends t0{}class np extends t0{}nd.FineTuningJobsPage=nf,nd.FineTuningJobEventsPage=np,nd.Checkpoints=nc,nd.FineTuningJobCheckpointsPage=nu;class nh extends tG{constructor(){super(...arguments),this.jobs=new nd(this._client),this.checkpoints=new ns(this._client)}}nh.Jobs=nd,nh.FineTuningJobsPage=nf,nh.FineTuningJobEventsPage=np,nh.Checkpoints=ns;let nm=async e=>{let t=await Promise.allSettled(e),n=t.filter(e=>"rejected"===e.status);if(n.length){for(let e of n)console.error(e.reason);throw Error(`${n.length} promise(s) failed - see the above errors`)}let r=[];for(let e of t)"fulfilled"===e.status&&r.push(e.value);return r};class ng extends tG{create(e,t,n){return this._client.post(`/vector_stores/${e}/files`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}update(e,t,n,r){return this._client.post(`/vector_stores/${e}/files/${t}`,{body:n,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}list(e,t={},n){return tj(t)?this.list(e,{},t):this._client.getAPIList(`/vector_stores/${e}/files`,nv,{query:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}del(e,t,n){return this._client.delete(`/vector_stores/${e}/files/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){let r=await this.create(e,t,n);return await this.poll(e,r.id,n)}async poll(e,t,n){let r={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(r["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){let o=await this.retrieve(e,t,{...n,headers:r}).withResponse(),a=o.data;switch(a.status){case"in_progress":let i=5e3;if(n?.pollIntervalMs)i=n.pollIntervalMs;else{let e=o.response.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(i=t)}}await tR(i);break;case"failed":case"completed":return a}}}async upload(e,t,n){let r=await this._client.files.create({file:t,purpose:"assistants"},n);return this.create(e,{file_id:r.id},n)}async uploadAndPoll(e,t,n){let r=await this.upload(e,t,n);return await this.poll(e,r.id,n)}content(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/files/${t}/content`,ny,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class nv extends t0{}class ny extends tJ{}ng.VectorStoreFilesPage=nv,ng.FileContentResponsesPage=ny;class nb extends tG{create(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}retrieve(e,t,n){return this._client.get(`/vector_stores/${e}/file_batches/${t}`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}cancel(e,t,n){return this._client.post(`/vector_stores/${e}/file_batches/${t}/cancel`,{...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}async createAndPoll(e,t,n){let r=await this.create(e,t);return await this.poll(e,r.id,n)}listFiles(e,t,n={},r){return tj(n)?this.listFiles(e,t,{},n):this._client.getAPIList(`/vector_stores/${e}/file_batches/${t}/files`,nv,{query:n,...r,headers:{"OpenAI-Beta":"assistants=v2",...r?.headers}})}async poll(e,t,n){let r={...n?.headers,"X-Stainless-Poll-Helper":"true"};for(n?.pollIntervalMs&&(r["X-Stainless-Custom-Poll-Interval"]=n.pollIntervalMs.toString());;){let{data:o,response:a}=await this.retrieve(e,t,{...n,headers:r}).withResponse();switch(o.status){case"in_progress":let i=5e3;if(n?.pollIntervalMs)i=n.pollIntervalMs;else{let e=a.headers.get("openai-poll-after-ms");if(e){let t=parseInt(e);isNaN(t)||(i=t)}}await tR(i);break;case"failed":case"cancelled":case"completed":return o}}}async uploadAndPoll(e,{files:t,fileIds:n=[]},r){if(null==t||0==t.length)throw Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let o=Math.min(r?.maxConcurrency??5,t.length),a=this._client,i=t.values(),l=[...n];async function s(e){for(let t of e){let e=await a.files.create({file:t,purpose:"assistants"},r);l.push(e.id)}}let c=Array(o).fill(i).map(s);return await nm(c),await this.createAndPoll(e,{file_ids:l})}}class nx extends tG{constructor(){super(...arguments),this.files=new ng(this._client),this.fileBatches=new nb(this._client)}create(e,t){return this._client.post("/vector_stores",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/vector_stores/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/vector_stores",nw,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/vector_stores/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}search(e,t,n){return this._client.getAPIList(`/vector_stores/${e}/search`,nk,{body:t,method:"post",...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}}class nw extends t0{}class nk extends tJ{}nx.VectorStoresPage=nw,nx.VectorStoreSearchResponsesPage=nk,nx.Files=ng,nx.VectorStoreFilesPage=nv,nx.FileContentResponsesPage=ny,nx.FileBatches=nb;class nS extends tG{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}retrieve(e,t){return this._client.get(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}update(e,t,n){return this._client.post(`/assistants/${e}`,{body:t,...n,headers:{"OpenAI-Beta":"assistants=v2",...n?.headers}})}list(e={},t){return tj(e)?this.list({},e):this._client.getAPIList("/assistants",nE,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}del(e,t){return this._client.delete(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t?.headers}})}}class nE extends t0{}function nO(e){return"function"==typeof e.parse}nS.AssistantsPage=nE;let nC=e=>e?.role==="assistant",nj=e=>e?.role==="function",n_=e=>e?.role==="tool";var nP=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},nN=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nT{constructor(){$.add(this),this.controller=new AbortController,V.set(this,void 0),X.set(this,()=>{}),G.set(this,()=>{}),Y.set(this,void 0),Q.set(this,()=>{}),J.set(this,()=>{}),ee.set(this,{}),et.set(this,!1),en.set(this,!1),er.set(this,!1),eo.set(this,!1),nP(this,V,new Promise((e,t)=>{nP(this,X,e,"f"),nP(this,G,t,"f")}),"f"),nP(this,Y,new Promise((e,t)=>{nP(this,Q,e,"f"),nP(this,J,t,"f")}),"f"),nN(this,V,"f").catch(()=>{}),nN(this,Y,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},nN(this,$,"m",ea).bind(this))},0)}_connected(){this.ended||(nN(this,X,"f").call(this),this._emit("connect"))}get ended(){return nN(this,et,"f")}get errored(){return nN(this,en,"f")}get aborted(){return nN(this,er,"f")}abort(){this.controller.abort()}on(e,t){return(nN(this,ee,"f")[e]||(nN(this,ee,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=nN(this,ee,"f")[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(nN(this,ee,"f")[e]||(nN(this,ee,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{nP(this,eo,!0,"f"),"error"!==e&&this.once("error",n),this.once(e,t)})}async done(){nP(this,eo,!0,"f"),await nN(this,Y,"f")}_emit(e,...t){if(nN(this,et,"f"))return;"end"===e&&(nP(this,et,!0,"f"),nN(this,Q,"f").call(this));let n=nN(this,ee,"f")[e];if(n&&(nN(this,ee,"f")[e]=n.filter(e=>!e.once),n.forEach(({listener:e})=>e(...t))),"abort"===e){let e=t[0];nN(this,eo,"f")||n?.length||Promise.reject(e),nN(this,G,"f").call(this,e),nN(this,J,"f").call(this,e),this._emit("end");return}if("error"===e){let e=t[0];nN(this,eo,"f")||n?.length||Promise.reject(e),nN(this,G,"f").call(this,e),nN(this,J,"f").call(this,e),this._emit("end")}}_emitFinal(){}}function nA(e){return e?.$brand==="auto-parseable-response-format"}function nM(e){return e?.$brand==="auto-parseable-tool"}function nI(e,t){let n=e.choices.map(e=>{var n;if("length"===e.finish_reason)throw new q;if("content_filter"===e.finish_reason)throw new W;return{...e,message:{...e.message,...e.message.tool_calls?{tool_calls:e.message.tool_calls?.map(e=>(function(e,t){let n=e.tools?.find(e=>e.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:nM(n)?n.$parseRaw(t.function.arguments):n?.function.strict?JSON.parse(t.function.arguments):null}}})(t,e))??void 0}:void 0,parsed:e.message.content&&!e.message.refusal?(n=e.message.content,t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(n):JSON.parse(n):null):null}}});return{...e,choices:n}}function nR(e){return!!nA(e.response_format)||(e.tools?.some(e=>nM(e)||"function"===e.type&&!0===e.function.strict)??!1)}V=new WeakMap,X=new WeakMap,G=new WeakMap,Y=new WeakMap,Q=new WeakMap,J=new WeakMap,ee=new WeakMap,et=new WeakMap,en=new WeakMap,er=new WeakMap,eo=new WeakMap,$=new WeakSet,ea=function(e){if(nP(this,en,!0,"f"),e instanceof Error&&"AbortError"===e.name&&(e=new A),e instanceof A)return nP(this,er,!0,"f"),this._emit("abort",e);if(e instanceof N)return this._emit("error",e);if(e instanceof Error){let t=new N(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new N(String(e)))};var nD=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nL extends nT{constructor(){super(...arguments),ei.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let t=e.choices[0]?.message;return t&&this._addMessage(t),e}_addMessage(e,t=!0){if("content"in e||(e.content=null),this.messages.push(e),t){if(this._emit("message",e),(nj(e)||n_(e))&&e.content)this._emit("functionCallResult",e.content);else if(nC(e)&&e.function_call)this._emit("functionCall",e.function_call);else if(nC(e)&&e.tool_calls)for(let t of e.tool_calls)"function"===t.type&&this._emit("functionCall",t.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new N("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),nD(this,ei,"m",el).call(this)}async finalMessage(){return await this.done(),nD(this,ei,"m",es).call(this)}async finalFunctionCall(){return await this.done(),nD(this,ei,"m",ec).call(this)}async finalFunctionCallResult(){return await this.done(),nD(this,ei,"m",eu).call(this)}async totalUsage(){return await this.done(),nD(this,ei,"m",ed).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let t=nD(this,ei,"m",es).call(this);t&&this._emit("finalMessage",t);let n=nD(this,ei,"m",el).call(this);n&&this._emit("finalContent",n);let r=nD(this,ei,"m",ec).call(this);r&&this._emit("finalFunctionCall",r);let o=nD(this,ei,"m",eu).call(this);null!=o&&this._emit("finalFunctionCallResult",o),this._chatCompletions.some(e=>e.usage)&&this._emit("totalUsage",nD(this,ei,"m",ed).call(this))}async _createChatCompletion(e,t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nD(this,ei,"m",ef).call(this,t);let o=await e.chat.completions.create({...t,stream:!1},{...n,signal:this.controller.signal});return this._connected(),this._addChatCompletion(nI(o,t))}async _runChatCompletion(e,t,n){for(let e of t.messages)this._addMessage(e,!1);return await this._createChatCompletion(e,t,n)}async _runFunctions(e,t,n){let r="function",{function_call:o="auto",stream:a,...i}=t,l="string"!=typeof o&&o?.name,{maxChatCompletions:s=10}=n||{},c={};for(let e of t.functions)c[e.name||e.function.name]=e;let u=t.functions.map(e=>({name:e.name||e.function.name,parameters:e.parameters,description:e.description}));for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<s;++t){let t;let a=await this._createChatCompletion(e,{...i,function_call:o,functions:u,messages:[...this.messages]},n),s=a.choices[0]?.message;if(!s)throw new N("missing message in ChatCompletion response");if(!s.function_call)return;let{name:d,arguments:f}=s.function_call,p=c[d];if(p){if(l&&l!==d){let e=`Invalid function_call: ${JSON.stringify(d)}. ${JSON.stringify(l)} requested. Please try again`;this._addMessage({role:r,name:d,content:e});continue}}else{let e=`Invalid function_call: ${JSON.stringify(d)}. Available options are: ${u.map(e=>JSON.stringify(e.name)).join(", ")}. Please try again`;this._addMessage({role:r,name:d,content:e});continue}try{t=nO(p)?await p.parse(f):f}catch(e){this._addMessage({role:r,name:d,content:e instanceof Error?e.message:String(e)});continue}let h=await p.function(t,this),m=nD(this,ei,"m",ep).call(this,h);if(this._addMessage({role:r,name:d,content:m}),l)return}}async _runTools(e,t,n){let r="tool",{tool_choice:o="auto",stream:a,...i}=t,l="string"!=typeof o&&o?.function?.name,{maxChatCompletions:s=10}=n||{},c=t.tools.map(e=>{if(nM(e)){if(!e.$callback)throw new N("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:e.$callback,name:e.function.name,description:e.function.description||"",parameters:e.function.parameters,parse:e.$parseRaw,strict:!0}}}return e}),u={};for(let e of c)"function"===e.type&&(u[e.function.name||e.function.function.name]=e.function);let d="tools"in t?c.map(e=>"function"===e.type?{type:"function",function:{name:e.function.name||e.function.function.name,parameters:e.function.parameters,description:e.function.description,strict:e.function.strict}}:e):void 0;for(let e of t.messages)this._addMessage(e,!1);for(let t=0;t<s;++t){let t=await this._createChatCompletion(e,{...i,tool_choice:o,tools:d,messages:[...this.messages]},n),a=t.choices[0]?.message;if(!a)throw new N("missing message in ChatCompletion response");if(!a.tool_calls?.length)break;for(let e of a.tool_calls){let t;if("function"!==e.type)continue;let n=e.id,{name:o,arguments:a}=e.function,i=u[o];if(i){if(l&&l!==o){let e=`Invalid tool_call: ${JSON.stringify(o)}. ${JSON.stringify(l)} requested. Please try again`;this._addMessage({role:r,tool_call_id:n,content:e});continue}}else{let e=`Invalid tool_call: ${JSON.stringify(o)}. Available options are: ${Object.keys(u).map(e=>JSON.stringify(e)).join(", ")}. Please try again`;this._addMessage({role:r,tool_call_id:n,content:e});continue}try{t=nO(i)?await i.parse(a):a}catch(t){let e=t instanceof Error?t.message:String(t);this._addMessage({role:r,tool_call_id:n,content:e});continue}let s=await i.function(t,this),c=nD(this,ei,"m",ep).call(this,s);if(this._addMessage({role:r,tool_call_id:n,content:c}),l)return}}}}ei=new WeakSet,el=function(){return nD(this,ei,"m",es).call(this).content??null},es=function(){let e=this.messages.length;for(;e-- >0;){let t=this.messages[e];if(nC(t)){let{function_call:e,...n}=t,r={...n,content:t.content??null,refusal:t.refusal??null};return e&&(r.function_call=e),r}}throw new N("stream ended without producing a ChatCompletionMessage with role=assistant")},ec=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(nC(t)&&t?.function_call)return t.function_call;if(nC(t)&&t?.tool_calls?.length)return t.tool_calls.at(-1)?.function}},eu=function(){for(let e=this.messages.length-1;e>=0;e--){let t=this.messages[e];if(nj(t)&&null!=t.content||n_(t)&&null!=t.content&&"string"==typeof t.content&&this.messages.some(e=>"assistant"===e.role&&e.tool_calls?.some(e=>"function"===e.type&&e.id===t.tool_call_id)))return t.content}},ed=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:t}of this._chatCompletions)t&&(e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens);return e},ef=function(e){if(null!=e.n&&e.n>1)throw new N("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},ep=function(e){return"string"==typeof e?e:void 0===e?"undefined":JSON.stringify(e)};class nZ extends nL{static runFunctions(e,t,n){let r=new nZ,o={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runFunctions"}};return r._run(()=>r._runFunctions(e,t,o)),r}static runTools(e,t,n){let r=new nZ,o={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(e,t,o)),r}_addMessage(e,t=!0){super._addMessage(e,t),nC(e)&&e.content&&this._emit("content",e.content)}}let nz={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,ALL:511};class nB extends Error{}class nF extends Error{}let nH=(e,t)=>{let n=e.length,r=0,o=e=>{throw new nB(`${e} at position ${r}`)},a=e=>{throw new nF(`${e} at position ${r}`)},i=()=>(d(),r>=n&&o("Unexpected end of input"),'"'===e[r])?l():"{"===e[r]?s():"["===e[r]?c():"null"===e.substring(r,r+4)||nz.NULL&t&&n-r<4&&"null".startsWith(e.substring(r))?(r+=4,null):"true"===e.substring(r,r+4)||nz.BOOL&t&&n-r<4&&"true".startsWith(e.substring(r))?(r+=4,!0):"false"===e.substring(r,r+5)||nz.BOOL&t&&n-r<5&&"false".startsWith(e.substring(r))?(r+=5,!1):"Infinity"===e.substring(r,r+8)||nz.INFINITY&t&&n-r<8&&"Infinity".startsWith(e.substring(r))?(r+=8,1/0):"-Infinity"===e.substring(r,r+9)||nz.MINUS_INFINITY&t&&1<n-r&&n-r<9&&"-Infinity".startsWith(e.substring(r))?(r+=9,-1/0):"NaN"===e.substring(r,r+3)||nz.NAN&t&&n-r<3&&"NaN".startsWith(e.substring(r))?(r+=3,NaN):u(),l=()=>{let i=r,l=!1;for(r++;r<n&&('"'!==e[r]||l&&"\\"===e[r-1]);)l="\\"===e[r]&&!l,r++;if('"'==e.charAt(r))try{return JSON.parse(e.substring(i,++r-Number(l)))}catch(e){a(String(e))}else if(nz.STR&t)try{return JSON.parse(e.substring(i,r-Number(l))+'"')}catch(t){return JSON.parse(e.substring(i,e.lastIndexOf("\\"))+'"')}o("Unterminated string literal")},s=()=>{r++,d();let a={};try{for(;"}"!==e[r];){if(d(),r>=n&&nz.OBJ&t)return a;let o=l();d(),r++;try{let e=i();Object.defineProperty(a,o,{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){if(nz.OBJ&t)return a;throw e}d(),","===e[r]&&r++}}catch(e){if(nz.OBJ&t)return a;o("Expected '}' at end of object")}return r++,a},c=()=>{r++;let n=[];try{for(;"]"!==e[r];)n.push(i()),d(),","===e[r]&&r++}catch(e){if(nz.ARR&t)return n;o("Expected ']' at end of array")}return r++,n},u=()=>{if(0===r){"-"===e&&nz.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e)}catch(n){if(nz.NUM&t)try{if("."===e[e.length-1])return JSON.parse(e.substring(0,e.lastIndexOf(".")));return JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch(e){}a(String(n))}}let i=r;for("-"===e[r]&&r++;e[r]&&!",]}".includes(e[r]);)r++;r!=n||nz.NUM&t||o("Unterminated number literal");try{return JSON.parse(e.substring(i,r))}catch(n){"-"===e.substring(i,r)&&nz.NUM&t&&o("Not sure what '-' is");try{return JSON.parse(e.substring(i,e.lastIndexOf("e")))}catch(e){a(String(e))}}},d=()=>{for(;r<n&&" \n\r ".includes(e[r]);)r++};return i()},nq=e=>(function(e,t=nz.ALL){if("string"!=typeof e)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return nH(e.trim(),t)})(e,nz.ALL^nz.NUM);var nW=function(e,t,n,r,o){if("m"===r)throw TypeError("Private method is not writable");if("a"===r&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},nU=function(e,t,n,r){if("a"===n&&!r)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class nK extends nL{constructor(e){super(),eh.add(this),em.set(this,void 0),eg.set(this,void 0),ev.set(this,void 0),nW(this,em,e,"f"),nW(this,eg,[],"f")}get currentChatCompletionSnapshot(){return nU(this,ev,"f")}static fromReadableStream(e){let t=new nK(null);return t._run(()=>t._fromReadableStream(e)),t}static createChatCompletion(e,t,n){let r=new nK(t);return r._run(()=>r._runChatCompletion(e,{...t,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createChatCompletion(e,t,n){super._createChatCompletion;let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nU(this,eh,"m",ey).call(this);let o=await e.chat.completions.create({...t,stream:!0},{...n,signal:this.controller.signal});for await(let e of(this._connected(),o))nU(this,eh,"m",ex).call(this,e);if(o.controller.signal?.aborted)throw new A;return this._addChatCompletion(nU(this,eh,"m",eS).call(this))}async _fromReadableStream(e,t){let n;let r=t?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),nU(this,eh,"m",ey).call(this),this._connected();let o=e8.fromReadableStream(e,this.controller);for await(let e of o)n&&n!==e.id&&this._addChatCompletion(nU(this,eh,"m",eS).call(this)),nU(this,eh,"m",ex).call(this,e),n=e.id;if(o.controller.signal?.aborted)throw new A;return this._addChatCompletion(nU(this,eh,"m",eS).call(this))}[(em=new WeakMap,eg=new WeakMap,ev=new WeakMap,eh=new WeakSet,ey=function(){this.ended||nW(this,ev,void 0,"f")},eb=function(e){let t=nU(this,eg,"f")[e.index];return t||(t={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},nU(this,eg,"f")[e.index]=t),t},ex=function(e){if(this.ended)return;let t=nU(this,eh,"m",eO).call(this,e);for(let n of(this._emit("chunk",e,t),e.choices)){let e=t.choices[n.index];null!=n.delta.content&&e.message?.role==="assistant"&&e.message?.content&&(this._emit("content",n.delta.content,e.message.content),this._emit("content.delta",{delta:n.delta.content,snapshot:e.message.content,parsed:e.message.parsed})),null!=n.delta.refusal&&e.message?.role==="assistant"&&e.message?.refusal&&this._emit("refusal.delta",{delta:n.delta.refusal,snapshot:e.message.refusal}),n.logprobs?.content!=null&&e.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:n.logprobs?.content,snapshot:e.logprobs?.content??[]}),n.logprobs?.refusal!=null&&e.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:n.logprobs?.refusal,snapshot:e.logprobs?.refusal??[]});let r=nU(this,eh,"m",eb).call(this,e);for(let t of(e.finish_reason&&(nU(this,eh,"m",ek).call(this,e),null!=r.current_tool_call_index&&nU(this,eh,"m",ew).call(this,e,r.current_tool_call_index)),n.delta.tool_calls??[]))r.current_tool_call_index!==t.index&&(nU(this,eh,"m",ek).call(this,e),null!=r.current_tool_call_index&&nU(this,eh,"m",ew).call(this,e,r.current_tool_call_index)),r.current_tool_call_index=t.index;for(let t of n.delta.tool_calls??[]){let n=e.message.tool_calls?.[t.index];n?.type&&(n?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:n.function?.name,index:t.index,arguments:n.function.arguments,parsed_arguments:n.function.parsed_arguments,arguments_delta:t.function?.arguments??""}):n?.type)}}},ew=function(e,t){if(nU(this,eh,"m",eb).call(this,e).done_tool_calls.has(t))return;let n=e.message.tool_calls?.[t];if(!n)throw Error("no tool call snapshot");if(!n.type)throw Error("tool call snapshot missing `type`");if("function"===n.type){let e=nU(this,em,"f")?.tools?.find(e=>"function"===e.type&&e.function.name===n.function.name);this._emit("tool_calls.function.arguments.done",{name:n.function.name,index:t,arguments:n.function.arguments,parsed_arguments:nM(e)?e.$parseRaw(n.function.arguments):e?.function.strict?JSON.parse(n.function.arguments):null})}else n.type},ek=function(e){let t=nU(this,eh,"m",eb).call(this,e);if(e.message.content&&!t.content_done){t.content_done=!0;let n=nU(this,eh,"m",eE).call(this);this._emit("content.done",{content:e.message.content,parsed:n?n.$parseRaw(e.message.content):null})}e.message.refusal&&!t.refusal_done&&(t.refusal_done=!0,this._emit("refusal.done",{refusal:e.message.refusal})),e.logprobs?.content&&!t.logprobs_content_done&&(t.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:e.logprobs.content})),e.logprobs?.refusal&&!t.logprobs_refusal_done&&(t.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:e.logprobs.refusal}))},eS=function(){if(this.ended)throw new N("stream has ended, this shouldn't happen");let e=nU(this,ev,"f");if(!e)throw new N("request ended without sending any chunks");return nW(this,ev,void 0,"f"),nW(this,eg,[],"f"),function(e,t){var n;let{id:r,choices:o,created:a,model:i,system_fingerprint:l,...s}=e;return n={...s,id:r,choices:o.map(({message:t,finish_reason:n,index:r,logprobs:o,...a})=>{if(!n)throw new N(`missing finish_reason for choice ${r}`);let{content:i=null,function_call:l,tool_calls:s,...c}=t,u=t.role;if(!u)throw new N(`missing role for choice ${r}`);if(l){let{arguments:e,name:s}=l;if(null==e)throw new N(`missing function_call.arguments for choice ${r}`);if(!s)throw new N(`missing function_call.name for choice ${r}`);return{...a,message:{content:i,function_call:{arguments:e,name:s},role:u,refusal:t.refusal??null},finish_reason:n,index:r,logprobs:o}}return s?{...a,index:r,finish_reason:n,logprobs:o,message:{...c,role:u,content:i,refusal:t.refusal??null,tool_calls:s.map((t,n)=>{let{function:o,type:a,id:i,...l}=t,{arguments:s,name:c,...u}=o||{};if(null==i)throw new N(`missing choices[${r}].tool_calls[${n}].id${n$(e)}`);if(null==a)throw new N(`missing choices[${r}].tool_calls[${n}].type${n$(e)}`);if(null==c)throw new N(`missing choices[${r}].tool_calls[${n}].function.name${n$(e)}`);if(null==s)throw new N(`missing choices[${r}].tool_calls[${n}].function.argumentsdiff --git a/litellm/proxy/_experimental/out/_next/static/chunks/338-58247f2bc5fc3b51.js b/ui/litellm-dashboard/out/_next/static/chunks/338-5db4fbaf3c5da53d.jssimilarity index 62%rename from litellm/proxy/_experimental/out/_next/static/chunks/338-58247f2bc5fc3b51.jsrename to ui/litellm-dashboard/out/_next/static/chunks/338-5db4fbaf3c5da53d.jsindex 2ff3fe44f14..81d117294fd 100644--- a/litellm/proxy/_experimental/out/_next/static/chunks/338-58247f2bc5fc3b51.js+++ b/ui/litellm-dashboard/out/_next/static/chunks/338-5db4fbaf3c5da53d.js@@ -1 +1 @@-"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[338],{19250:function(e,t,o){o.r(t),o.d(t,{DEFAULT_ORGANIZATION:function(){return d},PredictedSpendLogsCall:function(){return e9},addAllowedIP:function(){return es},adminGlobalActivity:function(){return eb},adminGlobalActivityExceptions:function(){return eP},adminGlobalActivityExceptionsPerDeployment:function(){return ex},adminGlobalActivityPerModel:function(){return eF},adminGlobalCacheActivity:function(){return eN},adminSpendLogsCall:function(){return eE},adminTopEndUsersCall:function(){return eS},adminTopKeysCall:function(){return ej},adminTopModelsCall:function(){return eO},adminspendByProvider:function(){return ev},alertingSettingsCall:function(){return N},allEndUsersCall:function(){return ek},allTagNamesCall:function(){return em},availableTeamListCall:function(){return M},budgetCreateCall:function(){return j},budgetDeleteCall:function(){return E},budgetUpdateCall:function(){return S},cachingHealthCheckCall:function(){return tw},callMCPTool:function(){return tF},claimOnboardingToken:function(){return X},createGuardrailCall:function(){return tk},createMCPServer:function(){return tS},createPassThroughEndpoint:function(){return ts},credentialCreateCall:function(){return eV},credentialDeleteCall:function(){return eq},credentialGetCall:function(){return eH},credentialListCall:function(){return eD},credentialUpdateCall:function(){return eZ},defaultProxyBaseUrl:function(){return r},deleteAllowedIP:function(){return el},deleteCallback:function(){return t5},deleteConfigFieldSetting:function(){return ti},deleteGuardrailCall:function(){return tK},deleteMCPServer:function(){return tb},deletePassThroughEndpointsCall:function(){return td},fetchMCPAccessGroups:function(){return tj},fetchMCPServers:function(){return tE},getAllowedIPs:function(){return ec},getBudgetList:function(){return te},getBudgetSettings:function(){return tt},getCallbacksCall:function(){return to},getConfigFieldSetting:function(){return tn},getDefaultTeamSettings:function(){return tJ},getEmailEventSettings:function(){return tH},getGeneralSettingsCall:function(){return ta},getGuardrailInfo:function(){return tQ},getGuardrailProviderSpecificParams:function(){return tW},getGuardrailUISettings:function(){return tY},getGuardrailsList:function(){return tm},getInternalUserSettings:function(){return t_},getOnboardingCredentials:function(){return Q},getOpenAPISchema:function(){return m},getPassThroughEndpointInfo:function(){return t4},getPassThroughEndpointsCall:function(){return tr},getPossibleUserRoles:function(){return ez},getProxyBaseUrl:function(){return l},getProxyUISettings:function(){return ty},getPublicModelHubInfo:function(){return y},getRemainingUsers:function(){return t2},getSSOSettings:function(){return t$},getTeamPermissionsCall:function(){return tA},getTotalSpendCall:function(){return W},getUiConfig:function(){return f},healthCheckCall:function(){return tp},healthCheckHistoryCall:function(){return tg},individualModelHealthCheckCall:function(){return tu},invitationClaimCall:function(){return b},invitationCreateCall:function(){return v},keyCreateCall:function(){return P},keyCreateServiceAccountCall:function(){return F},keyDeleteCall:function(){return O},keyInfoCall:function(){return eB},keyInfoV1Call:function(){return eJ},keyListCall:function(){return eU},keySpendLogsCall:function(){return eg},keyUpdateCall:function(){return eK},latestHealthChecksCall:function(){return tf},listMCPTools:function(){return tN},makeModelGroupPublic:function(){return g},mcpToolsCall:function(){return t6},modelAvailableCall:function(){return ew},modelCostMap:function(){return k},modelCreateCall:function(){return C},modelDeleteCall:function(){return T},modelExceptionsCall:function(){return ep},modelHubCall:function(){return en},modelHubPublicModelsCall:function(){return er},modelInfoCall:function(){return eo},modelInfoV1Call:function(){return ea},modelMetricsCall:function(){return ei},modelMetricsSlowResponsesCall:function(){return eh},modelPatchUpdateCall:function(){return eW},modelSettingsCall:function(){return _},modelUpdateCall:function(){return eQ},organizationCreateCall:function(){return V},organizationDeleteCall:function(){return H},organizationInfoCall:function(){return L},organizationListCall:function(){return z},organizationMemberAddCall:function(){return e2},organizationMemberDeleteCall:function(){return e3},organizationMemberUpdateCall:function(){return e4},organizationUpdateCall:function(){return D},proxyBaseUrl:function(){return c},regenerateKeyCall:function(){return $},resetEmailEventSettings:function(){return tZ},serverRootPath:function(){return n},serviceHealthCheck:function(){return e8},sessionSpendLogsCall:function(){return tR},setCallbacksCall:function(){return th},setGlobalLitellmHeaderName:function(){return w},slackBudgetAlertsHealthCheck:function(){return e7},spendUsersCall:function(){return eA},streamingModelMetricsCall:function(){return ed},tagCreateCall:function(){return tP},tagDailyActivityCall:function(){return K},tagDeleteCall:function(){return tG},tagInfoCall:function(){return tO},tagListCall:function(){return tB},tagUpdateCall:function(){return tx},tagsSpendLogsCall:function(){return ey},teamBulkMemberAddCall:function(){return e$},teamCreateCall:function(){return eL},teamDailyActivityCall:function(){return Y},teamDeleteCall:function(){return G},teamInfoCall:function(){return A},teamListCall:function(){return R},teamMemberAddCall:function(){return eX},teamMemberDeleteCall:function(){return e1},teamMemberUpdateCall:function(){return e0},teamPermissionsUpdateCall:function(){return tI},teamSpendLogsCall:function(){return ef},teamUpdateCall:function(){return eY},testConnectionRequest:function(){return eG},testMCPConnectionRequest:function(){return t9},testMCPToolsListRequest:function(){return t7},transformRequestCall:function(){return q},uiAuditLogsCall:function(){return t1},uiSpendLogDetailsCall:function(){return tC},uiSpendLogsCall:function(){return eT},updateConfigFieldSetting:function(){return tl},updateDefaultTeamSettings:function(){return tU},updateEmailEventSettings:function(){return tq},updateGuardrailCall:function(){return tX},updateInternalUserSettings:function(){return tT},updateMCPServer:function(){return tv},updatePassThroughEndpoint:function(){return t3},updatePassThroughFieldSetting:function(){return tc},updateSSOSettings:function(){return t0},updateUsefulLinksCall:function(){return eu},userBulkUpdateUserCall:function(){return e6},userCreateCall:function(){return x},userDailyActivityCall:function(){return Z},userDeleteCall:function(){return B},userFilterUICall:function(){return eC},userGetAllUsersCall:function(){return eM},userGetRequesedtModelsCall:function(){return eR},userInfoCall:function(){return U},userListCall:function(){return J},userRequestModelCall:function(){return eI},userSpendLogsCall:function(){return e_},userUpdateUserCall:function(){return e5},v2TeamListCall:function(){return I},vectorStoreCreateCall:function(){return tM},vectorStoreDeleteCall:function(){return tL},vectorStoreInfoCall:function(){return tV},vectorStoreListCall:function(){return tz},vectorStoreSearchCall:function(){return t8},vectorStoreUpdateCall:function(){return tD}});var a=o(41021);let r=null,n="/",c=null;console.log=function(){};let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=window.location.origin,a=t||o;console.log("proxyBaseUrl:",c),console.log("serverRootPath:",e),e.length>0&&!a.endsWith(e)&&"/"!=e&&(a+=e,c=a),console.log("Updated proxyBaseUrl:",c)},l=()=>c||window.location.origin,i={GET:"GET",DELETE:"DELETE"},d="default_organization",h=0,p=async e=>{let t=Date.now();t-h>6e4?(e.includes("Authentication Error - Expired Key")&&(a.ZP.info("UI Session Expired. Logging out."),h=t,document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",window.location.href=window.location.pathname),h=t):console.log("Error suppressed to prevent spam:",e)},u="Authorization";function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authorization";console.log("setGlobalLitellmHeaderName: ".concat(e)),u=e}let g=async(e,t)=>{let o=c?"".concat(c,"/model_group/make_public"):"/model_group/make_public";return(await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},f=async()=>{console.log("Getting UI config");let e=await fetch(r?"".concat(r,"/litellm/.well-known/litellm-ui-config"):"/litellm/.well-known/litellm-ui-config"),t=await e.json();return console.log("jsonData in getUiConfig:",t),s(t.server_root_path,t.proxy_base_url),t},y=async()=>{let e=await fetch(r?"".concat(r,"/public/model_hub/info"):"/public/model_hub/info");return await e.json()},m=async()=>{let e=c?"".concat(c,"/openapi.json"):"/openapi.json",t=await fetch(e);return await t.json()},k=async e=>{try{let t=c?"".concat(c,"/get/litellm_model_cost_map"):"/get/litellm_model_cost_map",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("received litellm model cost data: ".concat(a)),a}catch(e){throw console.error("Failed to get model cost map:",e),e}},C=async(e,t)=>{try{let o=c?"".concat(c,"/model/new"):"/model/new",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text()||"Network response was not ok";throw a.ZP.error(e),Error(e)}let n=await r.json();return console.log("API Response:",n),a.ZP.destroy(),a.ZP.success("Model ".concat(t.model_name," created successfully"),2),n}catch(e){throw console.error("Failed to create key:",e),e}},_=async e=>{try{let t=c?"".concat(c,"/model/settings"):"/model/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){console.error("Failed to get model settings:",e)}},T=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=c?"".concat(c,"/model/delete"):"/model/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},E=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=c?"".concat(c,"/budget/delete"):"/budget/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},j=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/budget/new"):"/budget/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},S=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/budget/update"):"/budget/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},v=async(e,t)=>{try{let o=c?"".concat(c,"/invitation/new"):"/invitation/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},b=async(e,t)=>{try{console.log("Form Values in invitationCreateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/invitation/claim"):"/invitation/claim",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},N=async e=>{try{let t=c?"".concat(c,"/alerting/settings"):"/alerting/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},F=async(e,t)=>{try{if(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",t);let o=c?"".concat(c,"/key/service-account/generate"):"/key/service-account/generate",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},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 Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=c?"".concat(c,"/key/generate"):"/key/generate",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},x=async(e,t,o)=>{try{if(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),o.auto_create_key=!1,o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=c?"".concat(c,"/user/new"):"/user/new",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},O=async(e,t)=>{try{let o=c?"".concat(c,"/key/delete"):"/key/delete";console.log("in keyDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},B=async(e,t)=>{try{let o=c?"".concat(c,"/user/delete"):"/user/delete";console.log("in userDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_ids:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete user(s):",e),e}},G=async(e,t)=>{try{let o=c?"".concat(c,"/team/delete"):"/team/delete";console.log("in teamDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},J=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let h=c?"".concat(c,"/user/list"):"/user/list";console.log("in userListCall");let w=new URLSearchParams;if(t&&t.length>0){let e=t.join(",");w.append("user_ids",e)}o&&w.append("page",o.toString()),a&&w.append("page_size",a.toString()),r&&w.append("user_email",r),n&&w.append("role",n),s&&w.append("team",s),l&&w.append("sso_user_ids",l),i&&w.append("sort_by",i),d&&w.append("sort_order",d);let g=w.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw p(e),Error("Network response was not ok")}let y=await f.json();return console.log("/user/list API Response:",y),y}catch(e){throw console.error("Failed to create key:",e),e}},U=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];console.log("userInfoCall: ".concat(t,", ").concat(o,", ").concat(a,", ").concat(r,", ").concat(n,", ").concat(s));try{let l;if(a){l=c?"".concat(c,"/user/list"):"/user/list";let e=new URLSearchParams;null!=r&&e.append("page",r.toString()),null!=n&&e.append("page_size",n.toString()),l+="?".concat(e.toString())}else l=c?"".concat(c,"/user/info"):"/user/info",("Admin"!==o&&"Admin Viewer"!==o||s)&&t&&(l+="?user_id=".concat(t));console.log("Requesting user data from:",l);let i=await fetch(l,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("API Response:",d),d}catch(e){throw console.error("Failed to fetch user data:",e),e}},A=async(e,t)=>{try{let o=c?"".concat(c,"/team/info"):"/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},I=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6],arguments.length>7&&void 0!==arguments[7]&&arguments[7],arguments.length>8&&void 0!==arguments[8]&&arguments[8];try{let n=c?"".concat(c,"/v2/team/list"):"/v2/team/list";console.log("in teamInfoCall");let s=new URLSearchParams;o&&s.append("user_id",o.toString()),t&&s.append("organization_id",t.toString()),a&&s.append("team_id",a.toString()),r&&s.append("team_alias",r.toString());let l=s.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("/v2/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},R=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/team/list"):"/team/list";console.log("in teamInfoCall");let s=new URLSearchParams;o&&s.append("user_id",o.toString()),t&&s.append("organization_id",t.toString()),a&&s.append("team_id",a.toString()),r&&s.append("team_alias",r.toString());let l=s.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},M=async e=>{try{let t=c?"".concat(c,"/team/available"):"/team/available";console.log("in availableTeamListCall");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("/team/available_teams API Response:",a),a}catch(e){throw e}},z=async e=>{try{let t=c?"".concat(c,"/organization/list"):"/organization/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},L=async(e,t)=>{try{let o=c?"".concat(c,"/organization/info"):"/organization/info";t&&(o="".concat(o,"?organization_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/organization/new"):"/organization/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},D=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let o=c?"".concat(c,"/organization/update"):"/organization/update",a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},H=async(e,t)=>{try{let o=c?"".concat(c,"/organization/delete"):"/organization/delete",a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Error deleting organization: ".concat(e))}return await a.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},q=async(e,t)=>{try{let o=c?"".concat(c,"/utils/transform_request"):"/utils/transform_request",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},Z=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;try{let r=c?"".concat(c,"/user/daily/activity"):"/user/daily/activity",n=new URLSearchParams,s=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",s(t)),n.append("end_date",s(o)),n.append("page_size","1000"),n.append("page",a.toString());let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}return await i.json()}catch(e){throw console.error("Failed to create key:",e),e}},K=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/tag/daily/activity"):"/tag/daily/activity",s=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};s.append("start_date",l(t)),s.append("end_date",l(o)),s.append("page_size","1000"),s.append("page",a.toString()),r&&s.append("tags",r.join(","));let i=s.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw p(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},Y=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/team/daily/activity"):"/team/daily/activity",s=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};s.append("start_date",l(t)),s.append("end_date",l(o)),s.append("page_size","1000"),s.append("page",a.toString()),r&&s.append("team_ids",r.join(",")),s.append("exclude_team_ids","litellm-dashboard");let i=s.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw p(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},W=async e=>{try{let t=c?"".concat(c,"/global/spend"):"/global/spend",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},Q=async e=>{try{let t=c?"".concat(c,"/onboarding/get_token"):"/onboarding/get_token";t+="?invite_link=".concat(e);let o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},X=async(e,t,o,a)=>{let r=c?"".concat(c,"/onboarding/claim_token"):"/onboarding/claim_token";try{let n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({invitation_link:t,user_id:o,password:a})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to delete key:",e),e}},$=async(e,t,o)=>{try{let a=c?"".concat(c,"/key/").concat(t,"/regenerate"):"/key/".concat(t,"/regenerate"),r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Regenerate key Response:",n),n}catch(e){throw console.error("Failed to regenerate key:",e),e}},ee=!1,et=null,eo=async(e,t,o)=>{try{console.log("modelInfoCall:",e,t,o);let r=c?"".concat(c,"/v2/model/info"):"/v2/model/info",n=new URLSearchParams;n.append("include_team_models","true"),n.toString()&&(r+="?".concat(n.toString()));let s=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw e+="error shown=".concat(ee),ee||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),a.ZP.info(e,10),ee=!0,et&&clearTimeout(et),et=setTimeout(()=>{ee=!1},1e4)),Error("Network response was not ok")}let l=await s.json();return console.log("modelInfoCall:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},ea=async(e,t)=>{try{let o=c?"".concat(c,"/v1/model/info"):"/v1/model/info";o+="?litellm_model_id=".concat(t);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let r=await a.json();return console.log("modelInfoV1Call:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},er=async()=>{let e=c?"".concat(c,"/public/model_hub"):"/public/model_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},en=async e=>{try{let t=c?"".concat(c,"/model_group/info"):"/model_group/info",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("modelHubCall:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},ec=async e=>{try{let t=c?"".concat(c,"/get/allowed_ips"):"/get/allowed_ips",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw Error("Network response was not ok: ".concat(e))}let a=await o.json();return console.log("getAllowedIPs:",a),a.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},es=async(e,t)=>{try{let o=c?"".concat(c,"/add/allowed_ip"):"/add/allowed_ip",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},el=async(e,t)=>{try{let o=c?"".concat(c,"/delete/allowed_ip"):"/delete/allowed_ip",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},ei=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics"):"/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ed=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/model/streaming_metrics"):"/model/streaming_metrics";t&&(r="".concat(r,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let n=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},eh=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics/slow_responses"):"/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ep=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics/exceptions"):"/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eu=async(e,t)=>{try{let o=c?"".concat(c,"/model_hub/update_useful_links"):"/model_hub/update_useful_links",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({useful_links:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},ew=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6]);console.log("in /models calls, globalLitellmHeaderName",u);try{let t=c?"".concat(c,"/models"):"/models",o=new URLSearchParams;o.append("include_model_access_groups","True"),!0===a&&o.append("return_wildcard_routes","True"),!0===n&&o.append("only_model_access_groups","True"),r&&o.append("team_id",r.toString()),o.toString()&&(t+="?".concat(o.toString()));let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to create key:",e),e}},eg=async(e,t)=>{try{let o=c?"".concat(c,"/global/spend/logs"):"/global/spend/logs";console.log("in keySpendLogsCall:",o);let a=await fetch("".concat(o,"?api_key=").concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},ef=async e=>{try{let t=c?"".concat(c,"/global/spend/teams"):"/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ey=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/tags"):"/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),a&&(r+="".concat(r,"&tags=").concat(a.join(","))),console.log("in tagsSpendLogsCall:",r);let n=await fetch("".concat(r),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});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 create key:",e),e}},em=async e=>{try{let t=c?"".concat(c,"/global/spend/all_tag_names"):"/global/spend/all_tag_names";console.log("in global/spend/all_tag_names call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ek=async e=>{try{let t=c?"".concat(c,"/global/all_end_users"):"/global/all_end_users";console.log("in global/all_end_users call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eC=async(e,t)=>{try{let o=c?"".concat(c,"/user/filter/ui"):"/user/filter/ui";t.get("user_email")&&(o+="?user_email=".concat(t.get("user_email"))),t.get("user_id")&&(o+="?user_id=".concat(t.get("user_id")));let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},e_=async(e,t,o,a,r,n)=>{try{console.log("user role in spend logs call: ".concat(o));let t=c?"".concat(c,"/spend/logs"):"/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(r,"&end_date=").concat(n):"".concat(t,"?start_date=").concat(r,"&end_date=").concat(n);let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},eT=async(e,t,o,a,r,n,s,l,i,d,h,w)=>{try{let g=c?"".concat(c,"/spend/logs/ui"):"/spend/logs/ui",f=new URLSearchParams;t&&f.append("api_key",t),o&&f.append("team_id",o),a&&f.append("request_id",a),r&&f.append("start_date",r),n&&f.append("end_date",n),s&&f.append("page",s.toString()),l&&f.append("page_size",l.toString()),i&&f.append("user_id",i),d&&f.append("end_user",d),h&&f.append("status_filter",h),w&&f.append("model",w);let y=f.toString();y&&(g+="?".concat(y));let m=await fetch(g,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!m.ok){let e=await m.text();throw p(e),Error("Network response was not ok")}let k=await m.json();return console.log("Spend Logs Response:",k),k}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eE=async e=>{try{let t=c?"".concat(c,"/global/spend/logs"):"/global/spend/logs",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ej=async e=>{try{let t=c?"".concat(c,"/global/spend/keys?limit=5"):"/global/spend/keys?limit=5",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eS=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/end_users"):"/global/spend/end_users",n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let s={method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n},l=await fetch(r,s);if(!l.ok){let e=await l.text();throw p(e),Error("Network response was not ok")}let i=await l.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/provider"):"/global/spend/provider";o&&a&&(r+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(r+="&api_key=".concat(t));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eb=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity"):"/global/activity";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eN=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity/cache_hits"):"/global/activity/cache_hits";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eF=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity/model"):"/global/activity/model";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eP=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/activity/exceptions"):"/global/activity/exceptions";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok)throw await s.text(),Error("Network response was not ok");let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},ex=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/activity/exceptions/deployment"):"/global/activity/exceptions/deployment";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok)throw await s.text(),Error("Network response was not ok");let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eO=async e=>{try{let t=c?"".concat(c,"/global/spend/models?limit=5"):"/global/spend/models?limit=5",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eB=async(e,t)=>{try{let o=c?"".concat(c,"/v2/key/info"):"/v2/key/info",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!a.ok){let e=await a.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},eG=async(e,t,o)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let r=c?"".concat(c,"/health/test_connection"):"/health/test_connection",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify({litellm_params:t,mode:o})}),s=n.headers.get("content-type");if(!s||!s.includes("application/json")){let e=await n.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(n.status,": ").concat(n.statusText,"). Check network tab for details."))}let l=await n.json();if(!n.ok||"error"===l.status){if("error"===l.status);else{var a;return{status:"error",message:(null===(a=l.error)||void 0===a?void 0:a.message)||"Connection test failed: ".concat(n.status," ").concat(n.statusText)}}}return l}catch(e){throw console.error("Model connection test error:",e),e}},eJ=async(e,t)=>{try{console.log("entering keyInfoV1Call");let o=c?"".concat(c,"/key/info"):"/key/info";o="".concat(o,"?key=").concat(t);let r=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(console.log("response",r),!r.ok){let e=await r.text();p(e),a.ZP.error("Failed to fetch key info - "+e)}let n=await r.json();return console.log("data",n),n}catch(e){throw console.error("Failed to fetch key info:",e),e}},eU=async function(e,t,o,a,r,n,s,l){let i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let h=c?"".concat(c,"/key/list"):"/key/list";console.log("in keyListCall");let w=new URLSearchParams;o&&w.append("team_id",o.toString()),t&&w.append("organization_id",t.toString()),a&&w.append("key_alias",a),n&&w.append("key_hash",n),r&&w.append("user_id",r.toString()),s&&w.append("page",s.toString()),l&&w.append("size",l.toString()),i&&w.append("sort_by",i),d&&w.append("sort_order",d),w.append("return_full_object","true"),w.append("include_team_keys","true");let g=w.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw p(e),Error("Network response was not ok")}let y=await f.json();return console.log("/team/list API Response:",y),y}catch(e){throw console.error("Failed to create key:",e),e}},eA=async(e,t)=>{try{let o=c?"".concat(c,"/spend/users"):"/spend/users";console.log("in spendUsersCall:",o);let a=await fetch("".concat(o,"?user_id=").concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get spend for user",e),e}},eI=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/user/request_model"):"/user/request_model",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({models:[t],user_id:o,justification:a})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return console.log(s),s}catch(e){throw console.error("Failed to create key:",e),e}},eR=async e=>{try{let t=c?"".concat(c,"/user/get_requests"):"/user/get_requests";console.log("in userGetRequesedtModelsCall:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to get requested models:",e),e}},eM=async(e,t)=>{try{let o=c?"".concat(c,"/user/get_users?role=").concat(t):"/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get requested models:",e),e}},ez=async e=>{try{let t=c?"".concat(c,"/user/available_roles"):"/user/available_roles",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("response from user/available_role",a),a}catch(e){throw e}},eL=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/team/new"):"/team/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eV=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/credentials"):"/credentials",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eD=async e=>{try{let t=c?"".concat(c,"/credentials"):"/credentials";console.log("in credentialListCall");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("/credentials API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},eH=async(e,t,o)=>{try{let a=c?"".concat(c,"/credentials"):"/credentials";t?a+="/by_name/".concat(t):o&&(a+="/by_model/".concat(o)),console.log("in credentialListCall");let r=await fetch(a,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("/credentials API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eq=async(e,t)=>{try{let o=c?"".concat(c,"/credentials/").concat(t):"/credentials/".concat(t);console.log("in credentialDeleteCall:",t);let a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},eZ=async(e,t,o)=>{try{if(console.log("Form Values in credentialUpdateCall:",o),o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let a=c?"".concat(c,"/credentials/").concat(t):"/credentials/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eK=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let o=c?"".concat(c,"/key/update"):"/key/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update key Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eY=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=c?"".concat(c,"/team/update"):"/team/update",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),a.ZP.error("Failed to update team settings: "+e),Error(e)}let n=await r.json();return console.log("Update Team Response:",n),n}catch(e){throw console.error("Failed to update team:",e),e}},eW=async(e,t,o)=>{try{console.log("Form Values in modelUpateCall:",t);let a=c?"".concat(c,"/model/").concat(o,"/update"):"/model/".concat(o,"/update"),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("Update model Response:",n),n}catch(e){throw console.error("Failed to update model:",e),e}},eQ=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=c?"".concat(c,"/model/update"):"/model/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update model Response:",r),r}catch(e){throw console.error("Failed to update model:",e),e}},eX=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let r=c?"".concat(c,"/team/member_add"):"/team/member_add",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},e$=async(e,t,o,a)=>{try{console.log("Bulk add team members:",{teamId:t,members:o,maxBudgetInTeam:a});let n=c?"".concat(c,"/team/bulk_member_add"):"/team/bulk_member_add",s={team_id:t,members:o};null!=a&&(s.max_budget_in_team=a);let l=await fetch(n,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(s)});if(!l.ok){var r;let e=await l.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(r=t.detail)||void 0===r?void 0:r.error)||"Failed to bulk add team members",a=Error(o);throw a.raw=t,a}let i=await l.json();return console.log("Bulk team member add API Response:",i),i}catch(e){throw console.error("Failed to bulk add team members:",e),e}},e0=async(e,t,o)=>{try{console.log("Form Values in teamMemberUpdateCall:",o);let r=c?"".concat(c,"/team/member_update"):"/team/member_update",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,role:o.role,user_id:o.user_id})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to update team member:",e),e}},e1=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=c?"".concat(c,"/team/member_delete"):"/team/member_delete",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,...void 0!==o.user_email&&{user_email:o.user_email},...void 0!==o.user_id&&{user_id:o.user_id}})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},e2=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=c?"".concat(c,"/organization/member_add"):"/organization/member_add",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create organization member:",e),e}},e3=async(e,t,o)=>{try{console.log("Form Values in organizationMemberDeleteCall:",o);let a=c?"".concat(c,"/organization/member_delete"):"/organization/member_delete",r=await fetch(a,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,user_id:o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},e4=async(e,t,o)=>{try{console.log("Form Values in organizationMemberUpdateCall:",o);let a=c?"".concat(c,"/organization/member_update"):"/organization/member_update",r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},e5=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=c?"".concat(c,"/user/update"):"/user/update",r={...t};null!==o&&(r.user_role=o),r=JSON.stringify(r);let n=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!n.ok){let e=await n.text();throw p(e),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}},e6=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=c?"".concat(c,"/user/bulk_update"):"/user/bulk_update",r=[];for(let e of o)r.push({user_id:e,...t});let n=JSON.stringify({users:r}),s=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n});if(!s.ok){let e=await s.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let l=await s.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},e9=async(e,t)=>{try{let o=c?"".concat(c,"/global/predict/spend/logs"):"/global/predict/spend/logs",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},e7=async e=>{try{let t=c?"".concat(c,"/health/services?service=slack_budget_alerts"):"/health/services?service=slack_budget_alerts";console.log("Checking Slack Budget Alerts service health");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}let r=await o.json();return a.ZP.success("Test Slack Alert worked - check your Slack!"),console.log("Service Health Response:",r),r}catch(e){throw console.error("Failed to perform health check:",e),e}},e8=async(e,t)=>{try{let o=c?"".concat(c,"/health/services?service=").concat(t):"/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let r=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error(e)}let n=await r.json();return a.ZP.success("Test request to ".concat(t," made - check logs/alerts on ").concat(t," to verify")),n}catch(e){throw console.error("Failed to perform health check:",e),e}},te=async e=>{try{let t=c?"".concat(c,"/budget/list"):"/budget/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tt=async e=>{try{let t=c?"".concat(c,"/budget/settings"):"/budget/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},to=async(e,t,o)=>{try{let t=c?"".concat(c,"/get/config/callbacks"):"/get/config/callbacks",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},ta=async e=>{try{let t=c?"".concat(c,"/config/list?config_type=general_settings"):"/config/list?config_type=general_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tr=async e=>{try{let t=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tn=async(e,t)=>{try{let o=c?"".concat(c,"/config/field/info?field_name=").concat(t):"/config/field/info?field_name=".concat(t),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tc=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Successfully updated value!"),s}catch(e){throw console.error("Failed to set callbacks:",e),e}},ts=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tl=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/field/update"):"/config/field/update",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Successfully updated value!"),s}catch(e){throw console.error("Failed to set callbacks:",e),e}},ti=async(e,t)=>{try{let o=c?"".concat(c,"/config/field/delete"):"/config/field/delete",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return a.ZP.success("Field reset on proxy"),n}catch(e){throw console.error("Failed to get callbacks:",e),e}},td=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint?endpoint_id=").concat(t):"/config/pass_through_endpoint".concat(t),a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},th=async(e,t)=>{try{let o=c?"".concat(c,"/config/update"):"/config/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tp=async e=>{try{let t=c?"".concat(c,"/health"):"/health",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to call /health:",e),e}},tu=async(e,t)=>{try{let o=c?"".concat(c,"/health?model=").concat(encodeURIComponent(t)):"/health?model=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw Error(e||"Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to call /health for model ".concat(t,":"),e),e}},tw=async e=>{try{let t=c?"".concat(c,"/cache/ping"):"/cache/ping",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tg=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;try{let n=c?"".concat(c,"/health/history"):"/health/history",s=new URLSearchParams;t&&s.append("model",t),o&&s.append("status_filter",o),s.append("limit",a.toString()),s.append("offset",r.toString()),s.toString()&&(n+="?".concat(s.toString()));let l=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw p(e),Error(e)}return await l.json()}catch(e){throw console.error("Failed to call /health/history:",e),e}},tf=async e=>{try{let t=c?"".concat(c,"/health/latest"):"/health/latest",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},ty=async e=>{try{console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",c);let t=c?"".concat(c,"/sso/get/ui_settings"):"/sso/get/ui_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tm=async e=>{try{let t=c?"".concat(c,"/v2/guardrails/list"):"/v2/guardrails/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}},tk=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails"):"/guardrails",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!a.ok){let e=await a.text();throw p(e),Error(e)}let r=await a.json();return console.log("Create guardrail response:",r),r}catch(e){throw console.error("Failed to create guardrail:",e),e}},tC=async(e,t,o)=>{try{let a=c?"".concat(c,"/spend/logs/ui/").concat(t,"?start_date=").concat(encodeURIComponent(o)):"/spend/logs/ui/".concat(t,"?start_date=").concat(encodeURIComponent(o));console.log("Fetching log details from:",a);let r=await fetch(a,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Fetched log details:",n),n}catch(e){throw console.error("Failed to fetch log details:",e),e}},t_=async e=>{try{let t=c?"".concat(c,"/get/internal_user_settings"):"/get/internal_user_settings";console.log("Fetching SSO settings from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO settings:",a),a}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},tT=async(e,t)=>{try{let o=c?"".concat(c,"/update/internal_user_settings"):"/update/internal_user_settings";console.log("Updating internal user settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw p(e),Error(e)}let n=await r.json();return console.log("Updated internal user settings:",n),a.ZP.success("Internal user settings updated successfully"),n}catch(e){throw console.error("Failed to update internal user settings:",e),e}},tE=async e=>{try{let t=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server";console.log("Fetching MCP servers from:",t);let o=await fetch(t,{method:i.GET,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP servers:",a),a}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},tj=async e=>{try{let t=c?"".concat(c,"/v1/mcp/access_groups"):"/v1/mcp/access_groups";console.log("Fetching MCP access groups from:",t);let o=await fetch(t,{method:i.GET,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP access groups:",a),a.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},tS=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let o=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tv=async(e,t)=>{try{let o=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"PUT",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to update MCP server:",e),e}},tb=async(e,t)=>{try{let o=(c?"".concat(c):"")+"/v1/mcp/server/".concat(t);console.log("in deleteMCPServer:",t);let a=await fetch(o,{method:i.DELETE,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}}catch(e){throw console.error("Failed to delete key:",e),e}},tN=async(e,t)=>{try{let o=c?"".concat(c,"/mcp-rest/tools/list?server_id=").concat(t):"/mcp-rest/tools/list?server_id=".concat(t);console.log("Fetching MCP tools from:",o);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}}),r=await a.json();if(console.log("Fetched MCP tools response:",r),!a.ok){if(r.error&&r.message)throw Error(r.message);throw Error("Failed to fetch MCP tools")}return r}catch(e){return console.error("Failed to fetch MCP tools:",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools"}}},tF=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/mcp-rest/tools/call"):"/mcp-rest/tools/call";console.log("Calling MCP tool:",t,"with arguments:",o);let n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"x-mcp-auth":a,"Content-Type":"application/json"},body:JSON.stringify({name:t,arguments:o})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return console.log("MCP tool call response:",s),s}catch(e){throw console.error("Failed to call MCP tool:",e),e}},tP=async(e,t)=>{try{let o=c?"".concat(c,"/tag/new"):"/tag/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error creating tag:",e),e}},tx=async(e,t)=>{try{let o=c?"".concat(c,"/tag/update"):"/tag/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error updating tag:",e),e}},tO=async(e,t)=>{try{let o=c?"".concat(c,"/tag/info"):"/tag/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({names:t})});if(!a.ok){let e=await a.text();return await p(e),{}}return await a.json()}catch(e){throw console.error("Error getting tag info:",e),e}},tB=async e=>{try{let t=c?"".concat(c,"/tag/list"):"/tag/list",o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.text();return await p(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},tG=async(e,t)=>{try{let o=c?"".concat(c,"/tag/delete"):"/tag/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({name:t})});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error deleting tag:",e),e}},tJ=async e=>{try{let t=c?"".concat(c,"/get/default_team_settings"):"/get/default_team_settings";console.log("Fetching default team settings from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched default team settings:",a),a}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},tU=async(e,t)=>{try{let o=c?"".concat(c,"/update/default_team_settings"):"/update/default_team_settings";console.log("Updating default team settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Updated default team settings:",n),a.ZP.success("Default team settings updated successfully"),n}catch(e){throw console.error("Failed to update default team settings:",e),e}},tA=async(e,t)=>{try{let o=c?"".concat(c,"/team/permissions_list?team_id=").concat(t):"/team/permissions_list?team_id=".concat(t),a=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("Team permissions response:",r),r}catch(e){throw console.error("Failed to get team permissions:",e),e}},tI=async(e,t,o)=>{try{let a=c?"".concat(c,"/team/permissions_update"):"/team/permissions_update",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({team_id:t,team_member_permissions:o})});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},tR=async(e,t)=>{try{let o=c?"".concat(c,"/spend/logs/session/ui?session_id=").concat(encodeURIComponent(t)):"/spend/logs/session/ui?session_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},tM=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/new"):"/vector_store/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create vector store")}return await a.json()}catch(e){throw console.error("Error creating vector store:",e),e}},tz=async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let t=c?"".concat(c,"/vector_store/list"):"/vector_store/list",o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.json();throw Error(e.detail||"Failed to list vector stores")}return await o.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},tL=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/delete"):"/vector_store/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to delete vector store")}return await a.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},tV=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/info"):"/vector_store/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to get vector store info")}return await a.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},tD=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/update"):"/vector_store/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update vector store")}return await a.json()}catch(e){throw console.error("Error updating vector store:",e),e}},tH=async e=>{try{let t=c?"".concat(c,"/email/event_settings"):"/email/event_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get email event settings")}let a=await o.json();return console.log("Email event settings response:",a),a}catch(e){throw console.error("Failed to get email event settings:",e),e}},tq=async(e,t)=>{try{let o=c?"".concat(c,"/email/event_settings"):"/email/event_settings",a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Failed to update email event settings")}let r=await a.json();return console.log("Update email event settings response:",r),r}catch(e){throw console.error("Failed to update email event settings:",e),e}},tZ=async e=>{try{let t=c?"".concat(c,"/email/event_settings/reset"):"/email/event_settings/reset",o=await fetch(t,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to reset email event settings")}let a=await o.json();return console.log("Reset email event settings response:",a),a}catch(e){throw console.error("Failed to reset email event settings:",e),e}},tK=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails/").concat(t):"/guardrails/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error(e)}let r=await a.json();return console.log("Delete guardrail response:",r),r}catch(e){throw console.error("Failed to delete guardrail:",e),e}},tY=async e=>{try{let t=c?"".concat(c,"/guardrails/ui/add_guardrail_settings"):"/guardrails/ui/add_guardrail_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get guardrail UI settings")}let a=await o.json();return console.log("Guardrail UI settings response:",a),a}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},tW=async e=>{try{let t=c?"".concat(c,"/guardrails/ui/provider_specific_params"):"/guardrails/ui/provider_specific_params",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get guardrail provider specific parameters")}let a=await o.json();return console.log("Guardrail provider specific params response:",a),a}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},tQ=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails/").concat(t,"/info"):"/guardrails/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Failed to get guardrail info")}let r=await a.json();return console.log("Guardrail info response:",r),r}catch(e){throw console.error("Failed to get guardrail info:",e),e}},tX=async(e,t,o)=>{try{let a=c?"".concat(c,"/guardrails/").concat(t):"/guardrails/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw p(e),Error("Failed to update guardrail")}let n=await r.json();return console.log("Update guardrail response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},t$=async e=>{try{let t=c?"".concat(c,"/get/sso_settings"):"/get/sso_settings";console.log("Fetching SSO configuration from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO configuration:",a),a}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},t0=async(e,t)=>{try{let o=c?"".concat(c,"/update/sso_settings"):"/update/sso_settings";console.log("Updating SSO configuration:",t);let a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("Updated SSO configuration:",r),r}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},t1=async(e,t,o,a,r)=>{try{let t=c?"".concat(c,"/audit"):"/audit",o=new URLSearchParams;a&&o.append("page",a.toString()),r&&o.append("page_size",r.toString());let n=o.toString();n&&(t+="?".concat(n));let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},t2=async e=>{try{let t=c?"".concat(c,"/user/available_users"):"/user/available_users",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e)}});if(!o.ok){if(404===o.status)return null;let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},t3=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/pass_through_endpoint/").concat(encodeURIComponent(t)):"/config/pass_through_endpoint/".concat(encodeURIComponent(t)),n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Pass through endpoint updated successfully"),s}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},t4=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint?endpoint_id=").concat(encodeURIComponent(t)):"/config/pass_through_endpoint?endpoint_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=(await a.json()).endpoints;if(!r||0===r.length)throw Error("Pass through endpoint not found");return r[0]}catch(e){throw console.error("Failed to get pass through endpoint info:",e),e}},t5=async(e,t)=>{try{let o=c?"".concat(c,"/config/callback/delete"):"/config/callback/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({callback_name:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to delete specific callback:",e),e}},t6=async e=>{let t=l(),o=await fetch("".concat(t,"/v1/mcp/tools"),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw Error("HTTP error! status: ".concat(o.status));return await o.json()},t9=async(e,t)=>{try{console.log("Testing MCP connection with config:",JSON.stringify(t));let a=c?"".concat(c,"/mcp-rest/test/connection"):"/mcp-rest/test/connection",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify(t)}),n=r.headers.get("content-type");if(!n||!n.includes("application/json")){let e=await r.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(r.status,": ").concat(r.statusText,"). Check network tab for details."))}let s=await r.json();if(!r.ok||"error"===s.status){if("error"===s.status);else{var o;return{status:"error",message:(null===(o=s.error)||void 0===o?void 0:o.message)||"MCP connection test failed: ".concat(r.status," ").concat(r.statusText)}}}return s}catch(e){throw console.error("MCP connection test error:",e),e}},t7=async(e,t)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let o=c?"".concat(c,"/mcp-rest/test/tools/list"):"/mcp-rest/test/tools/list",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify(t)}),r=a.headers.get("content-type");if(!r||!r.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(a.status,": ").concat(a.statusText,"). Check network tab for details."))}let n=await a.json();if((!a.ok||n.error)&&!n.error)return{tools:[],error:"request_failed",message:n.message||"MCP tools list failed: ".concat(a.status," ").concat(a.statusText)};return n}catch(e){throw console.error("MCP tools list test error:",e),e}},t8=async(e,t,o)=>{try{let a="".concat(l(),"/v1/vector_stores/").concat(t,"/search"),r=await fetch(a,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o})});if(!r.ok){let e=await r.text();return await p(e),null}return await r.json()}catch(e){throw console.error("Error testing vector store search:",e),e}}},3914:function(e,t,o){function a(){let e=window.location.hostname,t=["Lax","Strict","None"];["/","/ui"].forEach(o=>{document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,";"),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,";"),t.forEach(t=>{let a="None"===t?" Secure;":"";document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; SameSite=").concat(t,";").concat(a),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,"; SameSite=").concat(t,";").concat(a)})}),console.log("After clearing cookies:",document.cookie)}function r(e){let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}o.d(t,{b:function(){return a},e:function(){return r}})}}]);\ No newline at end of file+"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[338],{19250:function(e,t,o){o.r(t),o.d(t,{DEFAULT_ORGANIZATION:function(){return d},PredictedSpendLogsCall:function(){return e9},addAllowedIP:function(){return es},adminGlobalActivity:function(){return eb},adminGlobalActivityExceptions:function(){return eP},adminGlobalActivityExceptionsPerDeployment:function(){return ex},adminGlobalActivityPerModel:function(){return eF},adminGlobalCacheActivity:function(){return eN},adminSpendLogsCall:function(){return eE},adminTopEndUsersCall:function(){return eS},adminTopKeysCall:function(){return ej},adminTopModelsCall:function(){return eO},adminspendByProvider:function(){return ev},alertingSettingsCall:function(){return N},allEndUsersCall:function(){return ek},allTagNamesCall:function(){return em},availableTeamListCall:function(){return M},budgetCreateCall:function(){return j},budgetDeleteCall:function(){return E},budgetUpdateCall:function(){return S},cachingHealthCheckCall:function(){return tw},callMCPTool:function(){return tF},claimOnboardingToken:function(){return X},createGuardrailCall:function(){return tk},createMCPServer:function(){return tS},createPassThroughEndpoint:function(){return ts},credentialCreateCall:function(){return eV},credentialDeleteCall:function(){return eq},credentialGetCall:function(){return eH},credentialListCall:function(){return eD},credentialUpdateCall:function(){return eZ},defaultProxyBaseUrl:function(){return r},deleteAllowedIP:function(){return el},deleteCallback:function(){return t5},deleteConfigFieldSetting:function(){return ti},deleteGuardrailCall:function(){return tK},deleteMCPServer:function(){return tb},deletePassThroughEndpointsCall:function(){return td},fetchMCPAccessGroups:function(){return tj},fetchMCPServers:function(){return tE},getAllowedIPs:function(){return ec},getBudgetList:function(){return te},getBudgetSettings:function(){return tt},getCallbacksCall:function(){return to},getConfigFieldSetting:function(){return tn},getDefaultTeamSettings:function(){return tJ},getEmailEventSettings:function(){return tH},getGeneralSettingsCall:function(){return ta},getGuardrailInfo:function(){return tQ},getGuardrailProviderSpecificParams:function(){return tW},getGuardrailUISettings:function(){return tY},getGuardrailsList:function(){return tm},getInternalUserSettings:function(){return t_},getOnboardingCredentials:function(){return Q},getOpenAPISchema:function(){return m},getPassThroughEndpointInfo:function(){return t4},getPassThroughEndpointsCall:function(){return tr},getPossibleUserRoles:function(){return ez},getProxyBaseUrl:function(){return l},getProxyUISettings:function(){return ty},getPublicModelHubInfo:function(){return y},getRemainingUsers:function(){return t3},getSSOSettings:function(){return t$},getTeamPermissionsCall:function(){return tA},getTotalSpendCall:function(){return W},getUiConfig:function(){return f},healthCheckCall:function(){return tp},healthCheckHistoryCall:function(){return tg},individualModelHealthCheckCall:function(){return tu},invitationClaimCall:function(){return b},invitationCreateCall:function(){return v},keyCreateCall:function(){return P},keyCreateServiceAccountCall:function(){return F},keyDeleteCall:function(){return O},keyInfoCall:function(){return eB},keyInfoV1Call:function(){return eJ},keyListCall:function(){return eU},keySpendLogsCall:function(){return eg},keyUpdateCall:function(){return eK},latestHealthChecksCall:function(){return tf},listMCPTools:function(){return tN},makeModelGroupPublic:function(){return g},mcpToolsCall:function(){return t6},modelAvailableCall:function(){return ew},modelCostMap:function(){return k},modelCreateCall:function(){return C},modelDeleteCall:function(){return T},modelExceptionsCall:function(){return ep},modelHubCall:function(){return en},modelHubPublicModelsCall:function(){return er},modelInfoCall:function(){return eo},modelInfoV1Call:function(){return ea},modelMetricsCall:function(){return ei},modelMetricsSlowResponsesCall:function(){return eh},modelPatchUpdateCall:function(){return eW},modelSettingsCall:function(){return _},modelUpdateCall:function(){return eQ},organizationCreateCall:function(){return V},organizationDeleteCall:function(){return H},organizationInfoCall:function(){return L},organizationListCall:function(){return z},organizationMemberAddCall:function(){return e3},organizationMemberDeleteCall:function(){return e2},organizationMemberUpdateCall:function(){return e4},organizationUpdateCall:function(){return D},proxyBaseUrl:function(){return c},regenerateKeyCall:function(){return $},resetEmailEventSettings:function(){return tZ},serverRootPath:function(){return n},serviceHealthCheck:function(){return e8},sessionSpendLogsCall:function(){return tR},setCallbacksCall:function(){return th},setGlobalLitellmHeaderName:function(){return w},slackBudgetAlertsHealthCheck:function(){return e7},spendUsersCall:function(){return eA},streamingModelMetricsCall:function(){return ed},tagCreateCall:function(){return tP},tagDailyActivityCall:function(){return K},tagDeleteCall:function(){return tG},tagInfoCall:function(){return tO},tagListCall:function(){return tB},tagUpdateCall:function(){return tx},tagsSpendLogsCall:function(){return ey},teamBulkMemberAddCall:function(){return e$},teamCreateCall:function(){return eL},teamDailyActivityCall:function(){return Y},teamDeleteCall:function(){return G},teamInfoCall:function(){return A},teamListCall:function(){return R},teamMemberAddCall:function(){return eX},teamMemberDeleteCall:function(){return e1},teamMemberUpdateCall:function(){return e0},teamPermissionsUpdateCall:function(){return tI},teamSpendLogsCall:function(){return ef},teamUpdateCall:function(){return eY},testConnectionRequest:function(){return eG},testMCPConnectionRequest:function(){return t9},testMCPToolsListRequest:function(){return t7},transformRequestCall:function(){return q},uiAuditLogsCall:function(){return t1},uiSpendLogDetailsCall:function(){return tC},uiSpendLogsCall:function(){return eT},updateConfigFieldSetting:function(){return tl},updateDefaultTeamSettings:function(){return tU},updateEmailEventSettings:function(){return tq},updateGuardrailCall:function(){return tX},updateInternalUserSettings:function(){return tT},updateMCPServer:function(){return tv},updatePassThroughEndpoint:function(){return t2},updatePassThroughFieldSetting:function(){return tc},updateSSOSettings:function(){return t0},updateUsefulLinksCall:function(){return eu},userBulkUpdateUserCall:function(){return e6},userCreateCall:function(){return x},userDailyActivityCall:function(){return Z},userDeleteCall:function(){return B},userFilterUICall:function(){return eC},userGetAllUsersCall:function(){return eM},userGetRequesedtModelsCall:function(){return eR},userInfoCall:function(){return U},userListCall:function(){return J},userRequestModelCall:function(){return eI},userSpendLogsCall:function(){return e_},userUpdateUserCall:function(){return e5},v2TeamListCall:function(){return I},vectorStoreCreateCall:function(){return tM},vectorStoreDeleteCall:function(){return tL},vectorStoreInfoCall:function(){return tV},vectorStoreListCall:function(){return tz},vectorStoreSearchCall:function(){return t8},vectorStoreUpdateCall:function(){return tD}});var a=o(41021);let r=null,n="/",c=null;console.log=function(){};let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=window.location.origin,a=t||o;console.log("proxyBaseUrl:",c),console.log("serverRootPath:",e),e.length>0&&!a.endsWith(e)&&"/"!=e&&(a+=e,c=a),console.log("Updated proxyBaseUrl:",c)},l=()=>c||window.location.origin,i={GET:"GET",DELETE:"DELETE"},d="default_organization",h=0,p=async e=>{let t=Date.now();t-h>6e4?(e.includes("Authentication Error - Expired Key")&&(a.ZP.info("UI Session Expired. Logging out."),h=t,document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",window.location.href=window.location.pathname),h=t):console.log("Error suppressed to prevent spam:",e)},u="Authorization";function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authorization";console.log("setGlobalLitellmHeaderName: ".concat(e)),u=e}let g=async(e,t)=>{let o=c?"".concat(c,"/model_group/make_public"):"/model_group/make_public";return(await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},f=async()=>{console.log("Getting UI config");let e=await fetch(r?"".concat(r,"/litellm/.well-known/litellm-ui-config"):"/litellm/.well-known/litellm-ui-config"),t=await e.json();return console.log("jsonData in getUiConfig:",t),s(t.server_root_path,t.proxy_base_url),t},y=async()=>{let e=await fetch(r?"".concat(r,"/public/model_hub/info"):"/public/model_hub/info");return await e.json()},m=async()=>{let e=c?"".concat(c,"/openapi.json"):"/openapi.json",t=await fetch(e);return await t.json()},k=async e=>{try{let t=c?"".concat(c,"/get/litellm_model_cost_map"):"/get/litellm_model_cost_map",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("received litellm model cost data: ".concat(a)),a}catch(e){throw console.error("Failed to get model cost map:",e),e}},C=async(e,t)=>{try{let o=c?"".concat(c,"/model/new"):"/model/new",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text()||"Network response was not ok";throw a.ZP.error(e),Error(e)}let n=await r.json();return console.log("API Response:",n),a.ZP.destroy(),a.ZP.success("Model ".concat(t.model_name," created successfully"),2),n}catch(e){throw console.error("Failed to create key:",e),e}},_=async e=>{try{let t=c?"".concat(c,"/model/settings"):"/model/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){console.error("Failed to get model settings:",e)}},T=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=c?"".concat(c,"/model/delete"):"/model/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},E=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=c?"".concat(c,"/budget/delete"):"/budget/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},j=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/budget/new"):"/budget/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},S=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/budget/update"):"/budget/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},v=async(e,t)=>{try{let o=c?"".concat(c,"/invitation/new"):"/invitation/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},b=async(e,t)=>{try{console.log("Form Values in invitationCreateCall:",t),console.log("Form Values after check:",t);let o=c?"".concat(c,"/invitation/claim"):"/invitation/claim",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},N=async e=>{try{let t=c?"".concat(c,"/alerting/settings"):"/alerting/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},F=async(e,t)=>{try{if(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",t);let o=c?"".concat(c,"/key/service-account/generate"):"/key/service-account/generate",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},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 Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=c?"".concat(c,"/key/generate"):"/key/generate",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},x=async(e,t,o)=>{try{if(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),o.auto_create_key=!1,o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=c?"".concat(c,"/user/new"):"/user/new",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},O=async(e,t)=>{try{let o=c?"".concat(c,"/key/delete"):"/key/delete";console.log("in keyDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},B=async(e,t)=>{try{let o=c?"".concat(c,"/user/delete"):"/user/delete";console.log("in userDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_ids:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete user(s):",e),e}},G=async(e,t)=>{try{let o=c?"".concat(c,"/team/delete"):"/team/delete";console.log("in teamDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},J=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let h=c?"".concat(c,"/user/list"):"/user/list";console.log("in userListCall");let w=new URLSearchParams;if(t&&t.length>0){let e=t.join(",");w.append("user_ids",e)}o&&w.append("page",o.toString()),a&&w.append("page_size",a.toString()),r&&w.append("user_email",r),n&&w.append("role",n),s&&w.append("team",s),l&&w.append("sso_user_ids",l),i&&w.append("sort_by",i),d&&w.append("sort_order",d);let g=w.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw p(e),Error("Network response was not ok")}let y=await f.json();return console.log("/user/list API Response:",y),y}catch(e){throw console.error("Failed to create key:",e),e}},U=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];console.log("userInfoCall: ".concat(t,", ").concat(o,", ").concat(a,", ").concat(r,", ").concat(n,", ").concat(s));try{let l;if(a){l=c?"".concat(c,"/user/list"):"/user/list";let e=new URLSearchParams;null!=r&&e.append("page",r.toString()),null!=n&&e.append("page_size",n.toString()),l+="?".concat(e.toString())}else l=c?"".concat(c,"/user/info"):"/user/info",("Admin"!==o&&"Admin Viewer"!==o||s)&&t&&(l+="?user_id=".concat(t));console.log("Requesting user data from:",l);let i=await fetch(l,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("API Response:",d),d}catch(e){throw console.error("Failed to fetch user data:",e),e}},A=async(e,t)=>{try{let o=c?"".concat(c,"/team/info"):"/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},I=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6],arguments.length>7&&void 0!==arguments[7]&&arguments[7],arguments.length>8&&void 0!==arguments[8]&&arguments[8];try{let n=c?"".concat(c,"/v2/team/list"):"/v2/team/list";console.log("in teamInfoCall");let s=new URLSearchParams;o&&s.append("user_id",o.toString()),t&&s.append("organization_id",t.toString()),a&&s.append("team_id",a.toString()),r&&s.append("team_alias",r.toString());let l=s.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("/v2/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},R=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/team/list"):"/team/list";console.log("in teamInfoCall");let s=new URLSearchParams;o&&s.append("user_id",o.toString()),t&&s.append("organization_id",t.toString()),a&&s.append("team_id",a.toString()),r&&s.append("team_alias",r.toString());let l=s.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}let d=await i.json();return console.log("/team/list API Response:",d),d}catch(e){throw console.error("Failed to create key:",e),e}},M=async e=>{try{let t=c?"".concat(c,"/team/available"):"/team/available";console.log("in availableTeamListCall");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("/team/available_teams API Response:",a),a}catch(e){throw e}},z=async e=>{try{let t=c?"".concat(c,"/organization/list"):"/organization/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},L=async(e,t)=>{try{let o=c?"".concat(c,"/organization/info"):"/organization/info";t&&(o="".concat(o,"?organization_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/organization/new"):"/organization/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},D=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let o=c?"".concat(c,"/organization/update"):"/organization/update",a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},H=async(e,t)=>{try{let o=c?"".concat(c,"/organization/delete"):"/organization/delete",a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!a.ok){let e=await a.text();throw p(e),Error("Error deleting organization: ".concat(e))}return await a.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},q=async(e,t)=>{try{let o=c?"".concat(c,"/utils/transform_request"):"/utils/transform_request",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},Z=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;try{let r=c?"".concat(c,"/user/daily/activity"):"/user/daily/activity",n=new URLSearchParams,s=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",s(t)),n.append("end_date",s(o)),n.append("page_size","1000"),n.append("page",a.toString());let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.text();throw p(e),Error("Network response was not ok")}return await i.json()}catch(e){throw console.error("Failed to create key:",e),e}},K=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/tag/daily/activity"):"/tag/daily/activity",s=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};s.append("start_date",l(t)),s.append("end_date",l(o)),s.append("page_size","1000"),s.append("page",a.toString()),r&&s.append("tags",r.join(","));let i=s.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw p(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},Y=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=c?"".concat(c,"/team/daily/activity"):"/team/daily/activity",s=new URLSearchParams,l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};s.append("start_date",l(t)),s.append("end_date",l(o)),s.append("page_size","1000"),s.append("page",a.toString()),r&&s.append("team_ids",r.join(",")),s.append("exclude_team_ids","litellm-dashboard");let i=s.toString();i&&(n+="?".concat(i));let d=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.text();throw p(e),Error("Network response was not ok")}return await d.json()}catch(e){throw console.error("Failed to create key:",e),e}},W=async e=>{try{let t=c?"".concat(c,"/global/spend"):"/global/spend",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},Q=async e=>{try{let t=c?"".concat(c,"/onboarding/get_token"):"/onboarding/get_token";t+="?invite_link=".concat(e);let o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},X=async(e,t,o,a)=>{let r=c?"".concat(c,"/onboarding/claim_token"):"/onboarding/claim_token";try{let n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({invitation_link:t,user_id:o,password:a})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to delete key:",e),e}},$=async(e,t,o)=>{try{let a=c?"".concat(c,"/key/").concat(t,"/regenerate"):"/key/".concat(t,"/regenerate"),r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Regenerate key Response:",n),n}catch(e){throw console.error("Failed to regenerate key:",e),e}},ee=!1,et=null,eo=async(e,t,o)=>{try{console.log("modelInfoCall:",e,t,o);let r=c?"".concat(c,"/v2/model/info"):"/v2/model/info",n=new URLSearchParams;n.append("include_team_models","true"),n.toString()&&(r+="?".concat(n.toString()));let s=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw e+="error shown=".concat(ee),ee||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),a.ZP.info(e,10),ee=!0,et&&clearTimeout(et),et=setTimeout(()=>{ee=!1},1e4)),Error("Network response was not ok")}let l=await s.json();return console.log("modelInfoCall:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},ea=async(e,t)=>{try{let o=c?"".concat(c,"/v1/model/info"):"/v1/model/info";o+="?litellm_model_id=".concat(t);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");let r=await a.json();return console.log("modelInfoV1Call:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},er=async()=>{let e=c?"".concat(c,"/public/model_hub"):"/public/model_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},en=async e=>{try{let t=c?"".concat(c,"/model_group/info"):"/model_group/info",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("modelHubCall:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},ec=async e=>{try{let t=c?"".concat(c,"/get/allowed_ips"):"/get/allowed_ips",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw Error("Network response was not ok: ".concat(e))}let a=await o.json();return console.log("getAllowedIPs:",a),a.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},es=async(e,t)=>{try{let o=c?"".concat(c,"/add/allowed_ip"):"/add/allowed_ip",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},el=async(e,t)=>{try{let o=c?"".concat(c,"/delete/allowed_ip"):"/delete/allowed_ip",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.text();throw Error("Network response was not ok: ".concat(e))}let r=await a.json();return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},ei=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics"):"/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ed=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/model/streaming_metrics"):"/model/streaming_metrics";t&&(r="".concat(r,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let n=await fetch(r,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},eh=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics/slow_responses"):"/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ep=async(e,t,o,a,r,n,s,l)=>{try{let t=c?"".concat(c,"/model/metrics/exceptions"):"/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(s,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eu=async(e,t)=>{try{let o=c?"".concat(c,"/model_hub/update_useful_links"):"/model_hub/update_useful_links",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({useful_links:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},ew=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6]);console.log("in /models calls, globalLitellmHeaderName",u);try{let t=c?"".concat(c,"/models"):"/models",o=new URLSearchParams;o.append("include_model_access_groups","True"),!0===a&&o.append("return_wildcard_routes","True"),!0===n&&o.append("only_model_access_groups","True"),r&&o.append("team_id",r.toString()),o.toString()&&(t+="?".concat(o.toString()));let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to create key:",e),e}},eg=async(e,t)=>{try{let o=c?"".concat(c,"/global/spend/logs"):"/global/spend/logs";console.log("in keySpendLogsCall:",o);let a=await fetch("".concat(o,"?api_key=").concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},ef=async e=>{try{let t=c?"".concat(c,"/global/spend/teams"):"/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ey=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/tags"):"/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),a&&(r+="".concat(r,"&tags=").concat(a.join(","))),console.log("in tagsSpendLogsCall:",r);let n=await fetch("".concat(r),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});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 create key:",e),e}},em=async e=>{try{let t=c?"".concat(c,"/global/spend/all_tag_names"):"/global/spend/all_tag_names";console.log("in global/spend/all_tag_names call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ek=async e=>{try{let t=c?"".concat(c,"/global/all_end_users"):"/global/all_end_users";console.log("in global/all_end_users call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eC=async(e,t)=>{try{let o=c?"".concat(c,"/user/filter/ui"):"/user/filter/ui";t.get("user_email")&&(o+="?user_email=".concat(t.get("user_email"))),t.get("user_id")&&(o+="?user_id=".concat(t.get("user_id")));let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},e_=async(e,t,o,a,r,n)=>{try{console.log("user role in spend logs call: ".concat(o));let t=c?"".concat(c,"/spend/logs"):"/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(r,"&end_date=").concat(n):"".concat(t,"?start_date=").concat(r,"&end_date=").concat(n);let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},eT=async(e,t,o,a,r,n,s,l,i,d,h,w)=>{try{let g=c?"".concat(c,"/spend/logs/ui"):"/spend/logs/ui",f=new URLSearchParams;t&&f.append("api_key",t),o&&f.append("team_id",o),a&&f.append("request_id",a),r&&f.append("start_date",r),n&&f.append("end_date",n),s&&f.append("page",s.toString()),l&&f.append("page_size",l.toString()),i&&f.append("user_id",i),d&&f.append("end_user",d),h&&f.append("status_filter",h),w&&f.append("model",w);let y=f.toString();y&&(g+="?".concat(y));let m=await fetch(g,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!m.ok){let e=await m.text();throw p(e),Error("Network response was not ok")}let k=await m.json();return console.log("Spend Logs Response:",k),k}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eE=async e=>{try{let t=c?"".concat(c,"/global/spend/logs"):"/global/spend/logs",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},ej=async e=>{try{let t=c?"".concat(c,"/global/spend/keys?limit=5"):"/global/spend/keys?limit=5",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eS=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/end_users"):"/global/spend/end_users",n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let s={method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n},l=await fetch(r,s);if(!l.ok){let e=await l.text();throw p(e),Error("Network response was not ok")}let i=await l.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/spend/provider"):"/global/spend/provider";o&&a&&(r+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(r+="&api_key=".concat(t));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eb=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity"):"/global/activity";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eN=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity/cache_hits"):"/global/activity/cache_hits";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eF=async(e,t,o)=>{try{let a=c?"".concat(c,"/global/activity/model"):"/global/activity/model";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[u]:"Bearer ".concat(e)}},n=await fetch(a,r);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}},eP=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/activity/exceptions"):"/global/activity/exceptions";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok)throw await s.text(),Error("Network response was not ok");let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},ex=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/global/activity/exceptions/deployment"):"/global/activity/exceptions/deployment";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[u]:"Bearer ".concat(e)}},s=await fetch(r,n);if(!s.ok)throw await s.text(),Error("Network response was not ok");let l=await s.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eO=async e=>{try{let t=c?"".concat(c,"/global/spend/models?limit=5"):"/global/spend/models?limit=5",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eB=async(e,t)=>{try{let o=c?"".concat(c,"/v2/key/info"):"/v2/key/info",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!a.ok){let e=await a.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},eG=async(e,t,o)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let r=c?"".concat(c,"/health/test_connection"):"/health/test_connection",n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify({litellm_params:t,mode:o})}),s=n.headers.get("content-type");if(!s||!s.includes("application/json")){let e=await n.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(n.status,": ").concat(n.statusText,"). Check network tab for details."))}let l=await n.json();if(!n.ok||"error"===l.status){if("error"===l.status);else{var a;return{status:"error",message:(null===(a=l.error)||void 0===a?void 0:a.message)||"Connection test failed: ".concat(n.status," ").concat(n.statusText)}}}return l}catch(e){throw console.error("Model connection test error:",e),e}},eJ=async(e,t)=>{try{console.log("entering keyInfoV1Call");let o=c?"".concat(c,"/key/info"):"/key/info";o="".concat(o,"?key=").concat(t);let r=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(console.log("response",r),!r.ok){let e=await r.text();p(e),a.ZP.error("Failed to fetch key info - "+e)}let n=await r.json();return console.log("data",n),n}catch(e){throw console.error("Failed to fetch key info:",e),e}},eU=async function(e,t,o,a,r,n,s,l){let i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let h=c?"".concat(c,"/key/list"):"/key/list";console.log("in keyListCall");let w=new URLSearchParams;o&&w.append("team_id",o.toString()),t&&w.append("organization_id",t.toString()),a&&w.append("key_alias",a),n&&w.append("key_hash",n),r&&w.append("user_id",r.toString()),s&&w.append("page",s.toString()),l&&w.append("size",l.toString()),i&&w.append("sort_by",i),d&&w.append("sort_order",d),w.append("return_full_object","true"),w.append("include_team_keys","true");let g=w.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.text();throw p(e),Error("Network response was not ok")}let y=await f.json();return console.log("/team/list API Response:",y),y}catch(e){throw console.error("Failed to create key:",e),e}},eA=async(e,t)=>{try{let o=c?"".concat(c,"/spend/users"):"/spend/users";console.log("in spendUsersCall:",o);let a=await fetch("".concat(o,"?user_id=").concat(t),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get spend for user",e),e}},eI=async(e,t,o,a)=>{try{let r=c?"".concat(c,"/user/request_model"):"/user/request_model",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({models:[t],user_id:o,justification:a})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return console.log(s),s}catch(e){throw console.error("Failed to create key:",e),e}},eR=async e=>{try{let t=c?"".concat(c,"/user/get_requests"):"/user/get_requests";console.log("in userGetRequesedtModelsCall:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to get requested models:",e),e}},eM=async(e,t)=>{try{let o=c?"".concat(c,"/user/get_users?role=").concat(t):"/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get requested models:",e),e}},ez=async e=>{try{let t=c?"".concat(c,"/user/available_roles"):"/user/available_roles",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");let a=await o.json();return console.log("response from user/available_role",a),a}catch(e){throw e}},eL=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/team/new"):"/team/new",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eV=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=c?"".concat(c,"/credentials"):"/credentials",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eD=async e=>{try{let t=c?"".concat(c,"/credentials"):"/credentials";console.log("in credentialListCall");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("/credentials API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},eH=async(e,t,o)=>{try{let a=c?"".concat(c,"/credentials"):"/credentials";t?a+="/by_name/".concat(t):o&&(a+="/by_model/".concat(o)),console.log("in credentialListCall");let r=await fetch(a,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("/credentials API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eq=async(e,t)=>{try{let o=c?"".concat(c,"/credentials/").concat(t):"/credentials/".concat(t);console.log("in credentialDeleteCall:",t);let a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},eZ=async(e,t,o)=>{try{if(console.log("Form Values in credentialUpdateCall:",o),o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let a=c?"".concat(c,"/credentials/").concat(t):"/credentials/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},eK=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let o=c?"".concat(c,"/key/update"):"/key/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update key Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eY=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=c?"".concat(c,"/team/update"):"/team/update",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),a.ZP.error("Failed to update team settings: "+e),Error(e)}let n=await r.json();return console.log("Update Team Response:",n),n}catch(e){throw console.error("Failed to update team:",e),e}},eW=async(e,t,o)=>{try{console.log("Form Values in modelUpateCall:",t);let a=c?"".concat(c,"/model/").concat(o,"/update"):"/model/".concat(o,"/update"),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("Update model Response:",n),n}catch(e){throw console.error("Failed to update model:",e),e}},eQ=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=c?"".concat(c,"/model/update"):"/model/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update model Response:",r),r}catch(e){throw console.error("Failed to update model:",e),e}},eX=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let r=c?"".concat(c,"/team/member_add"):"/team/member_add",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},e$=async(e,t,o,a,r)=>{try{console.log("Bulk add team members:",{teamId:t,members:o,maxBudgetInTeam:a});let s=c?"".concat(c,"/team/bulk_member_add"):"/team/bulk_member_add",l={team_id:t};r?l.all_users=!0:l.members=o,null!=a&&(l.max_budget_in_team=a);let i=await fetch(s,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){var n;let e=await i.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(n=t.detail)||void 0===n?void 0:n.error)||"Failed to bulk add team members",a=Error(o);throw a.raw=t,a}let d=await i.json();return console.log("Bulk team member add API Response:",d),d}catch(e){throw console.error("Failed to bulk add team members:",e),e}},e0=async(e,t,o)=>{try{console.log("Form Values in teamMemberUpdateCall:",o);let r=c?"".concat(c,"/team/member_update"):"/team/member_update",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,role:o.role,user_id:o.user_id})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let s=await n.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to update team member:",e),e}},e1=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=c?"".concat(c,"/team/member_delete"):"/team/member_delete",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,...void 0!==o.user_email&&{user_email:o.user_email},...void 0!==o.user_id&&{user_id:o.user_id}})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},e3=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=c?"".concat(c,"/organization/member_add"):"/organization/member_add",r=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create organization member:",e),e}},e2=async(e,t,o)=>{try{console.log("Form Values in organizationMemberDeleteCall:",o);let a=c?"".concat(c,"/organization/member_delete"):"/organization/member_delete",r=await fetch(a,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,user_id:o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},e4=async(e,t,o)=>{try{console.log("Form Values in organizationMemberUpdateCall:",o);let a=c?"".concat(c,"/organization/member_update"):"/organization/member_update",r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,...o})});if(!r.ok){let e=await r.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},e5=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=c?"".concat(c,"/user/update"):"/user/update",r={...t};null!==o&&(r.user_role=o),r=JSON.stringify(r);let n=await fetch(a,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!n.ok){let e=await n.text();throw p(e),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}},e6=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let r;console.log("Form Values in userUpdateUserCall:",t);let n=c?"".concat(c,"/user/bulk_update"):"/user/bulk_update";if(a)r=JSON.stringify({all_users:!0,user_updates:t});else if(o&&o.length>0){let e=[];for(let a of o)e.push({user_id:a,...t});r=JSON.stringify({users:e})}else throw Error("Must provide either userIds or set allUsers=true");let s=await fetch(n,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!s.ok){let e=await s.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let l=await s.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},e9=async(e,t)=>{try{let o=c?"".concat(c,"/global/predict/spend/logs"):"/global/predict/spend/logs",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},e7=async e=>{try{let t=c?"".concat(c,"/health/services?service=slack_budget_alerts"):"/health/services?service=slack_budget_alerts";console.log("Checking Slack Budget Alerts service health");let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}let r=await o.json();return a.ZP.success("Test Slack Alert worked - check your Slack!"),console.log("Service Health Response:",r),r}catch(e){throw console.error("Failed to perform health check:",e),e}},e8=async(e,t)=>{try{let o=c?"".concat(c,"/health/services?service=").concat(t):"/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let r=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error(e)}let n=await r.json();return a.ZP.success("Test request to ".concat(t," made - check logs/alerts on ").concat(t," to verify")),n}catch(e){throw console.error("Failed to perform health check:",e),e}},te=async e=>{try{let t=c?"".concat(c,"/budget/list"):"/budget/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tt=async e=>{try{let t=c?"".concat(c,"/budget/settings"):"/budget/settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},to=async(e,t,o)=>{try{let t=c?"".concat(c,"/get/config/callbacks"):"/get/config/callbacks",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},ta=async e=>{try{let t=c?"".concat(c,"/config/list?config_type=general_settings"):"/config/list?config_type=general_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tr=async e=>{try{let t=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tn=async(e,t)=>{try{let o=c?"".concat(c,"/config/field/info?field_name=").concat(t):"/config/field/info?field_name=".concat(t),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok)throw await a.text(),Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tc=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Successfully updated value!"),s}catch(e){throw console.error("Failed to set callbacks:",e),e}},ts=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tl=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/field/update"):"/config/field/update",n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Successfully updated value!"),s}catch(e){throw console.error("Failed to set callbacks:",e),e}},ti=async(e,t)=>{try{let o=c?"".concat(c,"/config/field/delete"):"/config/field/delete",r=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return a.ZP.success("Field reset on proxy"),n}catch(e){throw console.error("Failed to get callbacks:",e),e}},td=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint?endpoint_id=").concat(t):"/config/pass_through_endpoint".concat(t),a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},th=async(e,t)=>{try{let o=c?"".concat(c,"/config/update"):"/config/update",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tp=async e=>{try{let t=c?"".concat(c,"/health"):"/health",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to call /health:",e),e}},tu=async(e,t)=>{try{let o=c?"".concat(c,"/health?model=").concat(encodeURIComponent(t)):"/health?model=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw Error(e||"Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to call /health for model ".concat(t,":"),e),e}},tw=async e=>{try{let t=c?"".concat(c,"/cache/ping"):"/cache/ping",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tg=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;try{let n=c?"".concat(c,"/health/history"):"/health/history",s=new URLSearchParams;t&&s.append("model",t),o&&s.append("status_filter",o),s.append("limit",a.toString()),s.append("offset",r.toString()),s.toString()&&(n+="?".concat(s.toString()));let l=await fetch(n,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw p(e),Error(e)}return await l.json()}catch(e){throw console.error("Failed to call /health/history:",e),e}},tf=async e=>{try{let t=c?"".concat(c,"/health/latest"):"/health/latest",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},ty=async e=>{try{console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",c);let t=c?"".concat(c,"/sso/get/ui_settings"):"/sso/get/ui_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw await o.text(),Error("Network response was not ok");return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tm=async e=>{try{let t=c?"".concat(c,"/v2/guardrails/list"):"/v2/guardrails/list",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}},tk=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails"):"/guardrails",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!a.ok){let e=await a.text();throw p(e),Error(e)}let r=await a.json();return console.log("Create guardrail response:",r),r}catch(e){throw console.error("Failed to create guardrail:",e),e}},tC=async(e,t,o)=>{try{let a=c?"".concat(c,"/spend/logs/ui/").concat(t,"?start_date=").concat(encodeURIComponent(o)):"/spend/logs/ui/".concat(t,"?start_date=").concat(encodeURIComponent(o));console.log("Fetching log details from:",a);let r=await fetch(a,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Fetched log details:",n),n}catch(e){throw console.error("Failed to fetch log details:",e),e}},t_=async e=>{try{let t=c?"".concat(c,"/get/internal_user_settings"):"/get/internal_user_settings";console.log("Fetching SSO settings from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO settings:",a),a}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},tT=async(e,t)=>{try{let o=c?"".concat(c,"/update/internal_user_settings"):"/update/internal_user_settings";console.log("Updating internal user settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw p(e),Error(e)}let n=await r.json();return console.log("Updated internal user settings:",n),a.ZP.success("Internal user settings updated successfully"),n}catch(e){throw console.error("Failed to update internal user settings:",e),e}},tE=async e=>{try{let t=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server";console.log("Fetching MCP servers from:",t);let o=await fetch(t,{method:i.GET,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP servers:",a),a}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},tj=async e=>{try{let t=c?"".concat(c,"/v1/mcp/access_groups"):"/v1/mcp/access_groups";console.log("Fetching MCP access groups from:",t);let o=await fetch(t,{method:i.GET,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched MCP access groups:",a),a.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},tS=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let o=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw p(e),console.error("Error response from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tv=async(e,t)=>{try{let o=c?"".concat(c,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"PUT",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to update MCP server:",e),e}},tb=async(e,t)=>{try{let o=(c?"".concat(c):"")+"/v1/mcp/server/".concat(t);console.log("in deleteMCPServer:",t);let a=await fetch(o,{method:i.DELETE,headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}}catch(e){throw console.error("Failed to delete key:",e),e}},tN=async(e,t)=>{try{let o=c?"".concat(c,"/mcp-rest/tools/list?server_id=").concat(t):"/mcp-rest/tools/list?server_id=".concat(t);console.log("Fetching MCP tools from:",o);let a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}}),r=await a.json();if(console.log("Fetched MCP tools response:",r),!a.ok){if(r.error&&r.message)throw Error(r.message);throw Error("Failed to fetch MCP tools")}return r}catch(e){return console.error("Failed to fetch MCP tools:",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools"}}},tF=async(e,t,o,a,r)=>{try{let n=c?"".concat(c,"/mcp-rest/tools/call"):"/mcp-rest/tools/call";console.log("Calling MCP tool:",t,"with arguments:",o);let s={[u]:"Bearer ".concat(e),"Content-Type":"application/json"};r?s["x-mcp-".concat(r,"-authorization")]=a:s["x-mcp-auth"]=a;let l=await fetch(n,{method:"POST",headers:s,body:JSON.stringify({name:t,arguments:o})});if(!l.ok){let e=await l.text();throw p(e),Error("Network response was not ok")}let i=await l.json();return console.log("MCP tool call response:",i),i}catch(e){throw console.error("Failed to call MCP tool:",e),e}},tP=async(e,t)=>{try{let o=c?"".concat(c,"/tag/new"):"/tag/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error creating tag:",e),e}},tx=async(e,t)=>{try{let o=c?"".concat(c,"/tag/update"):"/tag/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error updating tag:",e),e}},tO=async(e,t)=>{try{let o=c?"".concat(c,"/tag/info"):"/tag/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({names:t})});if(!a.ok){let e=await a.text();return await p(e),{}}return await a.json()}catch(e){throw console.error("Error getting tag info:",e),e}},tB=async e=>{try{let t=c?"".concat(c,"/tag/list"):"/tag/list",o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.text();return await p(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},tG=async(e,t)=>{try{let o=c?"".concat(c,"/tag/delete"):"/tag/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({name:t})});if(!a.ok){let e=await a.text();await p(e);return}return await a.json()}catch(e){throw console.error("Error deleting tag:",e),e}},tJ=async e=>{try{let t=c?"".concat(c,"/get/default_team_settings"):"/get/default_team_settings";console.log("Fetching default team settings from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched default team settings:",a),a}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},tU=async(e,t)=>{try{let o=c?"".concat(c,"/update/default_team_settings"):"/update/default_team_settings";console.log("Updating default team settings:",t);let r=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Updated default team settings:",n),a.ZP.success("Default team settings updated successfully"),n}catch(e){throw console.error("Failed to update default team settings:",e),e}},tA=async(e,t)=>{try{let o=c?"".concat(c,"/team/permissions_list?team_id=").concat(t):"/team/permissions_list?team_id=".concat(t),a=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("Team permissions response:",r),r}catch(e){throw console.error("Failed to get team permissions:",e),e}},tI=async(e,t,o)=>{try{let a=c?"".concat(c,"/team/permissions_update"):"/team/permissions_update",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({team_id:t,team_member_permissions:o})});if(!r.ok){let e=await r.text();throw p(e),Error("Network response was not ok")}let n=await r.json();return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},tR=async(e,t)=>{try{let o=c?"".concat(c,"/spend/logs/session/ui?session_id=").concat(encodeURIComponent(t)):"/spend/logs/session/ui?session_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},tM=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/new"):"/vector_store/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create vector store")}return await a.json()}catch(e){throw console.error("Error creating vector store:",e),e}},tz=async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let t=c?"".concat(c,"/vector_store/list"):"/vector_store/list",o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.json();throw Error(e.detail||"Failed to list vector stores")}return await o.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},tL=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/delete"):"/vector_store/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to delete vector store")}return await a.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},tV=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/info"):"/vector_store/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to get vector store info")}return await a.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},tD=async(e,t)=>{try{let o=c?"".concat(c,"/vector_store/update"):"/vector_store/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update vector store")}return await a.json()}catch(e){throw console.error("Error updating vector store:",e),e}},tH=async e=>{try{let t=c?"".concat(c,"/email/event_settings"):"/email/event_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get email event settings")}let a=await o.json();return console.log("Email event settings response:",a),a}catch(e){throw console.error("Failed to get email event settings:",e),e}},tq=async(e,t)=>{try{let o=c?"".concat(c,"/email/event_settings"):"/email/event_settings",a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Failed to update email event settings")}let r=await a.json();return console.log("Update email event settings response:",r),r}catch(e){throw console.error("Failed to update email event settings:",e),e}},tZ=async e=>{try{let t=c?"".concat(c,"/email/event_settings/reset"):"/email/event_settings/reset",o=await fetch(t,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to reset email event settings")}let a=await o.json();return console.log("Reset email event settings response:",a),a}catch(e){throw console.error("Failed to reset email event settings:",e),e}},tK=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails/").concat(t):"/guardrails/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error(e)}let r=await a.json();return console.log("Delete guardrail response:",r),r}catch(e){throw console.error("Failed to delete guardrail:",e),e}},tY=async e=>{try{let t=c?"".concat(c,"/guardrails/ui/add_guardrail_settings"):"/guardrails/ui/add_guardrail_settings",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get guardrail UI settings")}let a=await o.json();return console.log("Guardrail UI settings response:",a),a}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},tW=async e=>{try{let t=c?"".concat(c,"/guardrails/ui/provider_specific_params"):"/guardrails/ui/provider_specific_params",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Failed to get guardrail provider specific parameters")}let a=await o.json();return console.log("Guardrail provider specific params response:",a),a}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},tQ=async(e,t)=>{try{let o=c?"".concat(c,"/guardrails/").concat(t,"/info"):"/guardrails/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Failed to get guardrail info")}let r=await a.json();return console.log("Guardrail info response:",r),r}catch(e){throw console.error("Failed to get guardrail info:",e),e}},tX=async(e,t,o)=>{try{let a=c?"".concat(c,"/guardrails/").concat(t):"/guardrails/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw p(e),Error("Failed to update guardrail")}let n=await r.json();return console.log("Update guardrail response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},t$=async e=>{try{let t=c?"".concat(c,"/get/sso_settings"):"/get/sso_settings";console.log("Fetching SSO configuration from:",t);let o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw p(e),Error("Network response was not ok")}let a=await o.json();return console.log("Fetched SSO configuration:",a),a}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},t0=async(e,t)=>{try{let o=c?"".concat(c,"/update/sso_settings"):"/update/sso_settings";console.log("Updating SSO configuration:",t);let a=await fetch(o,{method:"PATCH",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=await a.json();return console.log("Updated SSO configuration:",r),r}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},t1=async(e,t,o,a,r)=>{try{let t=c?"".concat(c,"/audit"):"/audit",o=new URLSearchParams;a&&o.append("page",a.toString()),r&&o.append("page_size",r.toString());let n=o.toString();n&&(t+="?".concat(n));let s=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!s.ok){let e=await s.text();throw p(e),Error("Network response was not ok")}return await s.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},t3=async e=>{try{let t=c?"".concat(c,"/user/available_users"):"/user/available_users",o=await fetch(t,{method:"GET",headers:{[u]:"Bearer ".concat(e)}});if(!o.ok){if(404===o.status)return null;let e=await o.text();throw p(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},t2=async(e,t,o)=>{try{let r=c?"".concat(c,"/config/pass_through_endpoint/").concat(encodeURIComponent(t)):"/config/pass_through_endpoint/".concat(encodeURIComponent(t)),n=await fetch(r,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!n.ok){let e=await n.text();throw p(e),Error("Network response was not ok")}let s=await n.json();return a.ZP.success("Pass through endpoint updated successfully"),s}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},t4=async(e,t)=>{try{let o=c?"".concat(c,"/config/pass_through_endpoint?endpoint_id=").concat(encodeURIComponent(t)):"/config/pass_through_endpoint?endpoint_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}let r=(await a.json()).endpoints;if(!r||0===r.length)throw Error("Pass through endpoint not found");return r[0]}catch(e){throw console.error("Failed to get pass through endpoint info:",e),e}},t5=async(e,t)=>{try{let o=c?"".concat(c,"/config/callback/delete"):"/config/callback/delete",a=await fetch(o,{method:"POST",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({callback_name:t})});if(!a.ok){let e=await a.text();throw p(e),Error("Network response was not ok")}return await a.json()}catch(e){throw console.error("Failed to delete specific callback:",e),e}},t6=async e=>{let t=l(),o=await fetch("".concat(t,"/v1/mcp/tools"),{method:"GET",headers:{[u]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw Error("HTTP error! status: ".concat(o.status));return await o.json()},t9=async(e,t)=>{try{console.log("Testing MCP connection with config:",JSON.stringify(t));let a=c?"".concat(c,"/mcp-rest/test/connection"):"/mcp-rest/test/connection",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify(t)}),n=r.headers.get("content-type");if(!n||!n.includes("application/json")){let e=await r.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(r.status,": ").concat(r.statusText,"). Check network tab for details."))}let s=await r.json();if(!r.ok||"error"===s.status){if("error"===s.status);else{var o;return{status:"error",message:(null===(o=s.error)||void 0===o?void 0:o.message)||"MCP connection test failed: ".concat(r.status," ").concat(r.statusText)}}}return s}catch(e){throw console.error("MCP connection test error:",e),e}},t7=async(e,t)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let o=c?"".concat(c,"/mcp-rest/test/tools/list"):"/mcp-rest/test/tools/list",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",[u]:"Bearer ".concat(e)},body:JSON.stringify(t)}),r=a.headers.get("content-type");if(!r||!r.includes("application/json")){let e=await a.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(a.status,": ").concat(a.statusText,"). Check network tab for details."))}let n=await a.json();if((!a.ok||n.error)&&!n.error)return{tools:[],error:"request_failed",message:n.message||"MCP tools list failed: ".concat(a.status," ").concat(a.statusText)};return n}catch(e){throw console.error("MCP tools list test error:",e),e}},t8=async(e,t,o)=>{try{let a="".concat(l(),"/v1/vector_stores/").concat(t,"/search"),r=await fetch(a,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o})});if(!r.ok){let e=await r.text();return await p(e),null}return await r.json()}catch(e){throw console.error("Error testing vector store search:",e),e}}},3914:function(e,t,o){function a(){let e=window.location.hostname,t=["Lax","Strict","None"];["/","/ui"].forEach(o=>{document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,";"),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,";"),t.forEach(t=>{let a="None"===t?" Secure;":"";document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; SameSite=").concat(t,";").concat(a),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(o,"; domain=").concat(e,"; SameSite=").concat(t,";").concat(a)})}),console.log("After clearing cookies:",document.cookie)}function r(e){let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}o.d(t,{b:function(){return a},e:function(){return r}})}}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/layout-25a743106e1c9456.js b/ui/litellm-dashboard/out/_next/static/chunks/app/layout-25a743106e1c9456.jsdeleted file mode 100644index 4ac435a9659..00000000000--- a/ui/litellm-dashboard/out/_next/static/chunks/app/layout-25a743106e1c9456.js+++ /dev/null@@ -1 +0,0 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{6580:function(n,e,t){Promise.resolve().then(t.t.bind(t,39974,23)),Promise.resolve().then(t.t.bind(t,2778,23))},2778:function(){},39974:function(n){n.exports={style:{fontFamily:"'__Inter_b0dd8a', '__Inter_Fallback_b0dd8a'",fontStyle:"normal"},className:"__className_b0dd8a"}}},function(n){n.O(0,[919,986,971,117,744],function(){return n(n.s=6580)}),_N_E=n.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/layout-f4acf18888f0aa20.js b/ui/litellm-dashboard/out/_next/static/chunks/app/layout-f4acf18888f0aa20.jsnew file mode 100644index 00000000000..62c2e56ed71--- /dev/null+++ b/ui/litellm-dashboard/out/_next/static/chunks/app/layout-f4acf18888f0aa20.js@@ -0,0 +1 @@+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{96443:function(n,e,t){Promise.resolve().then(t.t.bind(t,39974,23)),Promise.resolve().then(t.t.bind(t,2778,23))},2778:function(){},39974:function(n){n.exports={style:{fontFamily:"'__Inter_b0dd8a', '__Inter_Fallback_b0dd8a'",fontStyle:"normal"},className:"__className_b0dd8a"}}},function(n){n.O(0,[919,986,971,117,744],function(){return n(n.s=96443)}),_N_E=n.O()}]);\ No newline at end of filediff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-43595a95e1b23546.js b/ui/litellm-dashboard/out/_next/static/chunks/app/model_hub/page-1808d9da6d48b76d.jssimilarity index 63%rename from litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-43595a95e1b23546.jsrename to ui/litellm-dashboard/out/_next/static/chunks/app/model_hub/page-1808d9da6d48b76d.jsindex 27e12ec640c..262c47134bb 100644--- a/litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-43595a95e1b23546.js+++ b/ui/litellm-dashboard/out/_next/static/chunks/app/model_hub/page-1808d9da6d48b76d.js@@ -1 +1 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[418],{11790:function(e,n,t){Promise.resolve().then(t.bind(t,52829))},52829:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return f}});var u=t(57437),s=t(2265),c=t(99376),r=t(72162);function f(){let e=(0,c.useSearchParams)().get("key"),[n,t]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&t(e)},[e]),(0,u.jsx)(r.Z,{accessToken:n})}}},function(e){e.O(0,[445,152,338,162,971,117,744],function(){return e(e.s=11790)}),_N_E=e.O()}]);\ No newline at end of file+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[418],{21024:function(e,n,t){Promise.resolve().then(t.bind(t,52829))},52829:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return f}});var u=t(57437),s=t(2265),c=t(99376),r=t(72162);function f(){let e=(0,c.useSearchParams)().get("key"),[n,t]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&t(e)},[e]),(0,u.jsx)(r.Z,{accessToken:n})}}},function(e){e.O(0,[445,152,338,162,971,117,744],function(){return e(e.s=21024)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/model_hub_table/page-f3fc1d21cad686db.js b/ui/litellm-dashboard/out/_next/static/chunks/app/model_hub_table/page-6750ac8910a46248.jssimilarity index 68%rename from ui/litellm-dashboard/out/_next/static/chunks/app/model_hub_table/page-f3fc1d21cad686db.jsrename to ui/litellm-dashboard/out/_next/static/chunks/app/model_hub_table/page-6750ac8910a46248.jsindex 0e1a358a7e2..48a91877647 100644--- a/ui/litellm-dashboard/out/_next/static/chunks/app/model_hub_table/page-f3fc1d21cad686db.js+++ b/ui/litellm-dashboard/out/_next/static/chunks/app/model_hub_table/page-6750ac8910a46248.js@@ -1 +1 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{58538:function(e,n,u){Promise.resolve().then(u.bind(u,22775))},22775:function(e,n,u){"use strict";u.r(n),u.d(n,{default:function(){return f}});var t=u(57437),s=u(2265),r=u(99376),c=u(36172);function f(){let e=(0,r.useSearchParams)().get("key"),[n,u]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&u(e)},[e]),(0,t.jsx)(c.Z,{accessToken:n,publicPage:!0,premiumUser:!1,userRole:null})}}},function(e){e.O(0,[445,152,634,475,338,162,172,971,117,744],function(){return e(e.s=58538)}),_N_E=e.O()}]);\ No newline at end of file+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{64563:function(e,n,u){Promise.resolve().then(u.bind(u,22775))},22775:function(e,n,u){"use strict";u.r(n),u.d(n,{default:function(){return f}});var t=u(57437),s=u(2265),r=u(99376),c=u(36172);function f(){let e=(0,r.useSearchParams)().get("key"),[n,u]=(0,s.useState)(null);return(0,s.useEffect)(()=>{e&&u(e)},[e]),(0,t.jsx)(c.Z,{accessToken:n,publicPage:!0,premiumUser:!1,userRole:null})}}},function(e){e.O(0,[445,152,634,475,338,162,172,971,117,744],function(){return e(e.s=64563)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/onboarding/page-73a77fc5d4952c09.js b/ui/litellm-dashboard/out/_next/static/chunks/app/onboarding/page-73a77fc5d4952c09.jsdeleted file mode 100644index a6cb163c79c..00000000000--- a/ui/litellm-dashboard/out/_next/static/chunks/app/onboarding/page-73a77fc5d4952c09.js+++ /dev/null@@ -1 +0,0 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[461],{32922:function(e,r,t){Promise.resolve().then(t.bind(t,12011))},69262:function(e,r,t){"use strict";t.d(r,{Z:function(){return m}});var n=t(5853),o=t(2265);let s=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},l=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},a=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var c=t(96398),d=t(97324),i=t(1153);let m=o.forwardRef((e,r)=>{let{value:t,defaultValue:m,type:u,placeholder:p="Type...",icon:g,error:f=!1,errorMessage:b,disabled:h=!1,stepper:k,makeInputClassName:x,className:w,onChange:C,onValueChange:v,autoFocus:N}=e,y=(0,n._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[E,S]=(0,o.useState)(N||!1),[j,_]=(0,o.useState)(!1),Z=(0,o.useCallback)(()=>_(!j),[j,_]),I=(0,o.useRef)(null),q=(0,c.Uh)(t||m);return o.useEffect(()=>{let e=()=>S(!0),r=()=>S(!1),t=I.current;return t&&(t.addEventListener("focus",e),t.addEventListener("blur",r),N&&t.focus()),()=>{t&&(t.removeEventListener("focus",e),t.removeEventListener("blur",r))}},[N]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,d.q)(x("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,c.um)(q,h,f),E&&(0,d.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),w)},g?o.createElement(g,{className:(0,d.q)(x("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,i.lq)([I,r]),defaultValue:m,value:t,type:j?"text":u,className:(0,d.q)(x("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",g?"pl-2":"pl-3",f?"pr-3":"pr-4",h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:h,"data-testid":"base-input",onChange:e=>{null==C||C(e),null==v||v(e.target.value)}},y)),"password"!==u||h?null:o.createElement("button",{className:(0,d.q)(x("toggleButton"),"mr-2"),type:"button",onClick:()=>Z(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(a,{className:(0,d.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(l,{className:(0,d.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),f?o.createElement(s,{className:(0,d.q)(x("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=k?k:null),f&&b?o.createElement("p",{className:(0,d.q)(x("errorMessage"),"text-sm text-red-500 mt-1")},b):null)});m.displayName="BaseInput"},49566:function(e,r,t){"use strict";t.d(r,{Z:function(){return c}});var n=t(5853),o=t(2265);t(97324);var s=t(1153),l=t(69262);let a=(0,s.fn)("TextInput"),c=o.forwardRef((e,r)=>{let{type:t="text"}=e,s=(0,n._T)(e,["type"]);return o.createElement(l.Z,Object.assign({ref:r,type:t,makeInputClassName:a},s))});c.displayName="TextInput"},96398:function(e,r,t){"use strict";t.d(r,{Uh:function(){return d},n0:function(){return a},qg:function(){return s},sl:function(){return l},um:function(){return c}});var n=t(97324),o=t(2265);let s=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(s).join(""):"object"==typeof e&&e?s(e.props.children):void 0;function l(e){let r=new Map;return o.Children.map(e,e=>{var t;r.set(e.props.value,null!==(t=s(e))&&void 0!==t?t:e.props.value)}),r}function a(e,r){return o.Children.map(r,r=>{var t;if((null!==(t=s(r))&&void 0!==t?t:r.props.value).toLowerCase().includes(e.toLowerCase()))return r})}let c=function(e,r){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,n.q)(r?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!r&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",r&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",t&&"text-red-500",t?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function d(e){return null!=e&&""!==e}},49804:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(97324),s=t(1153),l=t(2265),a=t(9496);let c=(0,s.fn)("Col"),d=l.forwardRef((e,r)=>{let{numColSpan:t=1,numColSpanSm:s,numColSpanMd:d,numColSpanLg:i,children:m,className:u}=e,p=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),g=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"";return l.createElement("div",Object.assign({ref:r,className:(0,o.q)(c("root"),(()=>{let e=g(t,a.PT),r=g(s,a.SP),n=g(d,a.VS),l=g(i,a._w);return(0,o.q)(e,r,n,l)})(),u)},p),m)});d.displayName="Col"},67101:function(e,r,t){"use strict";t.d(r,{Z:function(){return i}});var n=t(5853),o=t(97324),s=t(1153),l=t(2265),a=t(9496);let c=(0,s.fn)("Grid"),d=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"",i=l.forwardRef((e,r)=>{let{numItems:t=1,numItemsSm:s,numItemsMd:i,numItemsLg:m,children:u,className:p}=e,g=(0,n._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=d(t,a._m),b=d(s,a.LH),h=d(i,a.l5),k=d(m,a.N4),x=(0,o.q)(f,b,h,k);return l.createElement("div",Object.assign({ref:r,className:(0,o.q)(c("root"),"grid",x,p)},g),u)});i.displayName="Grid"},9496:function(e,r,t){"use strict";t.d(r,{LH:function(){return o},N4:function(){return l},PT:function(){return a},SP:function(){return c},VS:function(){return d},_m:function(){return n},_w:function(){return i},l5:function(){return s}});let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},o={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},s={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},l={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},a={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},c={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},d={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},i={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},94789:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),s=t(26898),l=t(97324),a=t(1153);let c=(0,a.fn)("Callout"),d=o.forwardRef((e,r)=>{let{title:t,icon:d,color:i,className:m,children:u}=e,p=(0,n._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:r,className:(0,l.q)(c("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",i?(0,l.q)((0,a.bM)(i,s.K.background).bgColor,(0,a.bM)(i,s.K.darkBorder).borderColor,(0,a.bM)(i,s.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,l.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),m)},p),o.createElement("div",{className:(0,l.q)(c("header"),"flex items-start")},d?o.createElement(d,{className:(0,l.q)(c("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,l.q)(c("title"),"font-semibold")},t)),o.createElement("p",{className:(0,l.q)(c("body"),"overflow-y-auto",u?"mt-2":"")},u))});d.displayName="Callout"},12011:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return w}});var n=t(57437),o=t(2265),s=t(99376),l=t(20831),a=t(94789),c=t(12514),d=t(49804),i=t(67101),m=t(84264),u=t(49566),p=t(96761),g=t(84566),f=t(19250),b=t(14474),h=t(13634),k=t(73002),x=t(3914);function w(){let[e]=h.Z.useForm(),r=(0,s.useSearchParams)();(0,x.e)("token");let t=r.get("invitation_id"),w=r.get("action"),[C,v]=(0,o.useState)(null),[N,y]=(0,o.useState)(""),[E,S]=(0,o.useState)(""),[j,_]=(0,o.useState)(null),[Z,I]=(0,o.useState)(""),[q,L]=(0,o.useState)(""),[M,T]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(0,f.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),T(!1)})},[]),(0,o.useEffect)(()=>{t&&!M&&(0,f.getOnboardingCredentials)(t).then(e=>{let r=e.login_url;console.log("login_url:",r),I(r);let t=e.token,n=(0,b.o)(t);L(t),console.log("decoded:",n),v(n.key),console.log("decoded user email:",n.user_email),S(n.user_email),_(n.user_id)})},[t,M]),(0,n.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,n.jsxs)(c.Z,{children:[(0,n.jsx)(p.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,n.jsx)(p.Z,{className:"text-xl",children:"reset_password"===w?"Reset Password":"Sign up"}),(0,n.jsx)(m.Z,{children:"reset_password"===w?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==w&&(0,n.jsx)(a.Z,{className:"mt-4",title:"SSO",icon:g.GH$,color:"sky",children:(0,n.jsxs)(i.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,n.jsx)(d.Z,{children:"SSO is under the Enterprise Tier."}),(0,n.jsx)(d.Z,{children:(0,n.jsx)(l.Z,{variant:"primary",className:"mb-2",children:(0,n.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,n.jsxs)(h.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",C,"token:",q,"formValues:",e),C&&q&&(e.user_email=E,j&&t&&(0,f.claimOnboardingToken)(C,t,j,e.password).then(e=>{let r="/ui/";r+="?login=success",document.cookie="token="+q,console.log("redirecting to:",r);let t=(0,f.getProxyBaseUrl)();console.log("proxyBaseUrl:",t),t?window.location.href=t+r:window.location.href=r}))},children:[(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.Z.Item,{label:"Email Address",name:"user_email",children:(0,n.jsx)(u.Z,{type:"email",disabled:!0,value:E,defaultValue:E,className:"max-w-md"})}),(0,n.jsx)(h.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===w?"Enter your new password":"Create a password for your account",children:(0,n.jsx)(u.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,n.jsx)("div",{className:"mt-10",children:(0,n.jsx)(k.ZP,{htmlType:"submit",children:"reset_password"===w?"Reset Password":"Sign Up"})})]})]})})}},14474:function(e,r,t){"use strict";t.d(r,{o:function(){return o}});class n extends Error{}function o(e,r){let t;if("string"!=typeof e)throw new n("Invalid token specified: must be a string");r||(r={});let o=!0===r.header?0:1,s=e.split(".")[o];if("string"!=typeof s)throw new n(`Invalid token specified: missing part #${o+1}`);try{t=function(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw Error("base64 string is not of the correct length")}try{var t;return t=r,decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(r)}}(s)}catch(e){throw new n(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new n(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}n.prototype.name="InvalidTokenError"}},function(e){e.O(0,[665,445,634,338,971,117,744],function(){return e(e.s=32922)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/onboarding/page-acdf578c06ba6714.js b/ui/litellm-dashboard/out/_next/static/chunks/app/onboarding/page-acdf578c06ba6714.jsnew file mode 100644index 00000000000..f7e8c6a96ad--- /dev/null+++ b/ui/litellm-dashboard/out/_next/static/chunks/app/onboarding/page-acdf578c06ba6714.js@@ -0,0 +1 @@+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[461],{8672:function(e,r,t){Promise.resolve().then(t.bind(t,12011))},69262:function(e,r,t){"use strict";t.d(r,{Z:function(){return m}});var n=t(5853),o=t(2265);let s=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},l=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},a=e=>{var r=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var c=t(96398),d=t(97324),i=t(1153);let m=o.forwardRef((e,r)=>{let{value:t,defaultValue:m,type:u,placeholder:p="Type...",icon:g,error:f=!1,errorMessage:b,disabled:h=!1,stepper:k,makeInputClassName:x,className:w,onChange:C,onValueChange:v,autoFocus:N}=e,y=(0,n._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus"]),[E,S]=(0,o.useState)(N||!1),[j,_]=(0,o.useState)(!1),Z=(0,o.useCallback)(()=>_(!j),[j,_]),I=(0,o.useRef)(null),q=(0,c.Uh)(t||m);return o.useEffect(()=>{let e=()=>S(!0),r=()=>S(!1),t=I.current;return t&&(t.addEventListener("focus",e),t.addEventListener("blur",r),N&&t.focus()),()=>{t&&(t.removeEventListener("focus",e),t.removeEventListener("blur",r))}},[N]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,d.q)(x("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,c.um)(q,h,f),E&&(0,d.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),w)},g?o.createElement(g,{className:(0,d.q)(x("icon"),"shrink-0 h-5 w-5 ml-2.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,i.lq)([I,r]),defaultValue:m,value:t,type:j?"text":u,className:(0,d.q)(x("input"),"w-full focus:outline-none focus:ring-0 border-none bg-transparent text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",g?"pl-2":"pl-3",f?"pr-3":"pr-4",h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:h,"data-testid":"base-input",onChange:e=>{null==C||C(e),null==v||v(e.target.value)}},y)),"password"!==u||h?null:o.createElement("button",{className:(0,d.q)(x("toggleButton"),"mr-2"),type:"button",onClick:()=>Z(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(a,{className:(0,d.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(l,{className:(0,d.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),f?o.createElement(s,{className:(0,d.q)(x("errorIcon"),"text-red-500 shrink-0 w-5 h-5 mr-2.5")}):null,null!=k?k:null),f&&b?o.createElement("p",{className:(0,d.q)(x("errorMessage"),"text-sm text-red-500 mt-1")},b):null)});m.displayName="BaseInput"},49566:function(e,r,t){"use strict";t.d(r,{Z:function(){return c}});var n=t(5853),o=t(2265);t(97324);var s=t(1153),l=t(69262);let a=(0,s.fn)("TextInput"),c=o.forwardRef((e,r)=>{let{type:t="text"}=e,s=(0,n._T)(e,["type"]);return o.createElement(l.Z,Object.assign({ref:r,type:t,makeInputClassName:a},s))});c.displayName="TextInput"},96398:function(e,r,t){"use strict";t.d(r,{Uh:function(){return d},n0:function(){return a},qg:function(){return s},sl:function(){return l},um:function(){return c}});var n=t(97324),o=t(2265);let s=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(s).join(""):"object"==typeof e&&e?s(e.props.children):void 0;function l(e){let r=new Map;return o.Children.map(e,e=>{var t;r.set(e.props.value,null!==(t=s(e))&&void 0!==t?t:e.props.value)}),r}function a(e,r){return o.Children.map(r,r=>{var t;if((null!==(t=s(r))&&void 0!==t?t:r.props.value).toLowerCase().includes(e.toLowerCase()))return r})}let c=function(e,r){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,n.q)(r?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!r&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",r&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",t&&"text-red-500",t?"border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function d(e){return null!=e&&""!==e}},49804:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(97324),s=t(1153),l=t(2265),a=t(9496);let c=(0,s.fn)("Col"),d=l.forwardRef((e,r)=>{let{numColSpan:t=1,numColSpanSm:s,numColSpanMd:d,numColSpanLg:i,children:m,className:u}=e,p=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),g=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"";return l.createElement("div",Object.assign({ref:r,className:(0,o.q)(c("root"),(()=>{let e=g(t,a.PT),r=g(s,a.SP),n=g(d,a.VS),l=g(i,a._w);return(0,o.q)(e,r,n,l)})(),u)},p),m)});d.displayName="Col"},67101:function(e,r,t){"use strict";t.d(r,{Z:function(){return i}});var n=t(5853),o=t(97324),s=t(1153),l=t(2265),a=t(9496);let c=(0,s.fn)("Grid"),d=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"",i=l.forwardRef((e,r)=>{let{numItems:t=1,numItemsSm:s,numItemsMd:i,numItemsLg:m,children:u,className:p}=e,g=(0,n._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=d(t,a._m),b=d(s,a.LH),h=d(i,a.l5),k=d(m,a.N4),x=(0,o.q)(f,b,h,k);return l.createElement("div",Object.assign({ref:r,className:(0,o.q)(c("root"),"grid",x,p)},g),u)});i.displayName="Grid"},9496:function(e,r,t){"use strict";t.d(r,{LH:function(){return o},N4:function(){return l},PT:function(){return a},SP:function(){return c},VS:function(){return d},_m:function(){return n},_w:function(){return i},l5:function(){return s}});let n={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},o={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},s={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},l={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},a={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},c={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},d={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},i={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},94789:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),s=t(26898),l=t(97324),a=t(1153);let c=(0,a.fn)("Callout"),d=o.forwardRef((e,r)=>{let{title:t,icon:d,color:i,className:m,children:u}=e,p=(0,n._T)(e,["title","icon","color","className","children"]);return o.createElement("div",Object.assign({ref:r,className:(0,l.q)(c("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",i?(0,l.q)((0,a.bM)(i,s.K.background).bgColor,(0,a.bM)(i,s.K.darkBorder).borderColor,(0,a.bM)(i,s.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,l.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),m)},p),o.createElement("div",{className:(0,l.q)(c("header"),"flex items-start")},d?o.createElement(d,{className:(0,l.q)(c("icon"),"flex-none h-5 w-5 mr-1.5")}):null,o.createElement("h4",{className:(0,l.q)(c("title"),"font-semibold")},t)),o.createElement("p",{className:(0,l.q)(c("body"),"overflow-y-auto",u?"mt-2":"")},u))});d.displayName="Callout"},12011:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return w}});var n=t(57437),o=t(2265),s=t(99376),l=t(20831),a=t(94789),c=t(12514),d=t(49804),i=t(67101),m=t(84264),u=t(49566),p=t(96761),g=t(84566),f=t(19250),b=t(14474),h=t(13634),k=t(73002),x=t(3914);function w(){let[e]=h.Z.useForm(),r=(0,s.useSearchParams)();(0,x.e)("token");let t=r.get("invitation_id"),w=r.get("action"),[C,v]=(0,o.useState)(null),[N,y]=(0,o.useState)(""),[E,S]=(0,o.useState)(""),[j,_]=(0,o.useState)(null),[Z,I]=(0,o.useState)(""),[q,L]=(0,o.useState)(""),[M,T]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{(0,f.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),T(!1)})},[]),(0,o.useEffect)(()=>{t&&!M&&(0,f.getOnboardingCredentials)(t).then(e=>{let r=e.login_url;console.log("login_url:",r),I(r);let t=e.token,n=(0,b.o)(t);L(t),console.log("decoded:",n),v(n.key),console.log("decoded user email:",n.user_email),S(n.user_email),_(n.user_id)})},[t,M]),(0,n.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,n.jsxs)(c.Z,{children:[(0,n.jsx)(p.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,n.jsx)(p.Z,{className:"text-xl",children:"reset_password"===w?"Reset Password":"Sign up"}),(0,n.jsx)(m.Z,{children:"reset_password"===w?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==w&&(0,n.jsx)(a.Z,{className:"mt-4",title:"SSO",icon:g.GH$,color:"sky",children:(0,n.jsxs)(i.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,n.jsx)(d.Z,{children:"SSO is under the Enterprise Tier."}),(0,n.jsx)(d.Z,{children:(0,n.jsx)(l.Z,{variant:"primary",className:"mb-2",children:(0,n.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,n.jsxs)(h.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",C,"token:",q,"formValues:",e),C&&q&&(e.user_email=E,j&&t&&(0,f.claimOnboardingToken)(C,t,j,e.password).then(e=>{let r="/ui/";r+="?login=success",document.cookie="token="+q,console.log("redirecting to:",r);let t=(0,f.getProxyBaseUrl)();console.log("proxyBaseUrl:",t),t?window.location.href=t+r:window.location.href=r}))},children:[(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.Z.Item,{label:"Email Address",name:"user_email",children:(0,n.jsx)(u.Z,{type:"email",disabled:!0,value:E,defaultValue:E,className:"max-w-md"})}),(0,n.jsx)(h.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===w?"Enter your new password":"Create a password for your account",children:(0,n.jsx)(u.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,n.jsx)("div",{className:"mt-10",children:(0,n.jsx)(k.ZP,{htmlType:"submit",children:"reset_password"===w?"Reset Password":"Sign Up"})})]})]})})}},14474:function(e,r,t){"use strict";t.d(r,{o:function(){return o}});class n extends Error{}function o(e,r){let t;if("string"!=typeof e)throw new n("Invalid token specified: must be a string");r||(r={});let o=!0===r.header?0:1,s=e.split(".")[o];if("string"!=typeof s)throw new n(`Invalid token specified: missing part #${o+1}`);try{t=function(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw Error("base64 string is not of the correct length")}try{var t;return t=r,decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(r)}}(s)}catch(e){throw new n(`Invalid token specified: invalid base64 for part #${o+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new n(`Invalid token specified: invalid json for part #${o+1} (${e.message})`)}}n.prototype.name="InvalidTokenError"}},function(e){e.O(0,[665,445,634,338,971,117,744],function(){return e(e.s=8672)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/page-ae1e298d739b09ba.js b/ui/litellm-dashboard/out/_next/static/chunks/app/page-ae1e298d739b09ba.jsnew file mode 100644index 00000000000..a502942992d--- /dev/null+++ b/ui/litellm-dashboard/out/_next/static/chunks/app/page-ae1e298d739b09ba.js@@ -0,0 +1 @@+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{36362:function(e,s,t){Promise.resolve().then(t.bind(t,58193))},12011:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return _}});var l=t(57437),a=t(2265),r=t(99376),i=t(20831),n=t(94789),o=t(12514),c=t(49804),d=t(67101),m=t(84264),u=t(49566),x=t(96761),h=t(84566),p=t(19250),g=t(14474),j=t(13634),f=t(73002),v=t(3914);function _(){let[e]=j.Z.useForm(),s=(0,r.useSearchParams)();(0,v.e)("token");let t=s.get("invitation_id"),_=s.get("action"),[y,b]=(0,a.useState)(null),[N,Z]=(0,a.useState)(""),[w,k]=(0,a.useState)(""),[S,C]=(0,a.useState)(null),[I,P]=(0,a.useState)(""),[A,E]=(0,a.useState)(""),[T,L]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(0,p.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),L(!1)})},[]),(0,a.useEffect)(()=>{t&&!T&&(0,p.getOnboardingCredentials)(t).then(e=>{let s=e.login_url;console.log("login_url:",s),P(s);let t=e.token,l=(0,g.o)(t);E(t),console.log("decoded:",l),b(l.key),console.log("decoded user email:",l.user_email),k(l.user_email),C(l.user_id)})},[t,T]),(0,l.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(x.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,l.jsx)(x.Z,{className:"text-xl",children:"reset_password"===_?"Reset Password":"Sign up"}),(0,l.jsx)(m.Z,{children:"reset_password"===_?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==_&&(0,l.jsx)(n.Z,{className:"mt-4",title:"SSO",icon:h.GH$,color:"sky",children:(0,l.jsxs)(d.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,l.jsx)(c.Z,{children:"SSO is under the Enterprise Tier."}),(0,l.jsx)(c.Z,{children:(0,l.jsx)(i.Z,{variant:"primary",className:"mb-2",children:(0,l.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,l.jsxs)(j.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",y,"token:",A,"formValues:",e),y&&A&&(e.user_email=w,S&&t&&(0,p.claimOnboardingToken)(y,t,S,e.password).then(e=>{let s="/ui/";s+="?login=success",document.cookie="token="+A,console.log("redirecting to:",s);let t=(0,p.getProxyBaseUrl)();console.log("proxyBaseUrl:",t),t?window.location.href=t+s:window.location.href=s}))},children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(j.Z.Item,{label:"Email Address",name:"user_email",children:(0,l.jsx)(u.Z,{type:"email",disabled:!0,value:w,defaultValue:w,className:"max-w-md"})}),(0,l.jsx)(j.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===_?"Enter your new password":"Create a password for your account",children:(0,l.jsx)(u.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,l.jsx)("div",{className:"mt-10",children:(0,l.jsx)(f.ZP,{htmlType:"submit",children:"reset_password"===_?"Reset Password":"Sign Up"})})]})]})})}},58193:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return nI}});var l,a,r,i,n,o,c=t(57437),d=t(2265),m=t(99376),u=t(14474),x=t(21623),h=t(29827),p=t(65373),g=t(19250);let j=async(e,s,t,l,a)=>{let r;r="Admin"!=t&&"Admin Viewer"!=t?await (0,g.teamListCall)(e,(null==l?void 0:l.organization_id)||null,s):await (0,g.teamListCall)(e,(null==l?void 0:l.organization_id)||null),console.log("givenTeams: ".concat(r)),a(r)};var f=t(49804),v=t(67101),_=t(20831),y=t(49566),b=t(87452),N=t(88829),Z=t(72208),w=t(84264),k=t(96761),S=t(29233),C=t(52787),I=t(13634),P=t(41021),A=t(91679),E=t(29967),T=t(73002),L=t(64482),O=t(30150),M=e=>{let{step:s=.01,style:t={width:"100%"},placeholder:l="Enter a numerical value",min:a,max:r,onChange:i,...n}=e;return(0,c.jsx)(O.Z,{onWheel:e=>e.currentTarget.blur(),step:s,style:t,placeholder:l,min:a,max:r,onChange:i,...n})};let D=async(e,s,t)=>{try{if(null===e||null===s)return;if(null!==t){let l=(await (0,g.modelAvailableCall)(t,e,s,!0,null,!0)).data.map(e=>e.id),a=[],r=[];return l.forEach(e=>{e.endsWith("/*")?a.push(e):r.push(e)}),[...a,...r]}}catch(e){console.error("Error fetching user models:",e)}},F=e=>{if(e.endsWith("/*")){let s=e.replace("/*","");return"All ".concat(s," models")}return e},R=(e,s)=>{let t=[],l=[];return console.log("teamModels",e),console.log("allModels",s),e.forEach(e=>{if(e.endsWith("/*")){let a=e.replace("/*",""),r=s.filter(e=>e.startsWith(a+"/"));l.push(...r),t.push(e)}else l.push(e)}),[...t,...l].filter((e,s,t)=>t.indexOf(e)===s)};var q=t(20577),U=t(15424),z=t(89970);let V=(e,s)=>["metadata","config","enforced_params","aliases"].includes(e)||"json"===s.format,K=e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}},B=(e,s,t)=>{let l={max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"}[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[t]||"Text input";return V(e,s)?"".concat(l,"\nMust be valid JSON format"):s.enum?"Select from available options\nAllowed values: ".concat(s.enum.join(", ")):l};var G=e=>{let{schemaComponent:s,excludedFields:t=[],form:l,overrideLabels:a={},overrideTooltips:r={},customValidation:i={},defaultValues:n={}}=e,[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getOpenAPISchema)()).components.schemas[s];if(!e)throw Error('Schema component "'.concat(s,'" not found'));m(e);let a={};Object.keys(e.properties).filter(e=>!t.includes(e)&&void 0!==n[e]).forEach(e=>{a[e]=n[e]}),l.setFieldsValue(a)}catch(e){console.error("Schema fetch error:",e),x(e instanceof Error?e.message:"Failed to fetch schema")}})()},[s,l,t]);let h=e=>{if(e.type)return e.type;if(e.anyOf){let s=e.anyOf.map(e=>e.type);if(s.includes("number")||s.includes("integer"))return"number";s.includes("string")}return"string"},p=(e,s)=>{var t;let l;let d=h(s),m=null==o?void 0:null===(t=o.required)||void 0===t?void 0:t.includes(e),u=a[e]||s.title||e,x=r[e]||s.description,p=[];m&&p.push({required:!0,message:"".concat(u," is required")}),i[e]&&p.push({validator:i[e]}),V(e,s)&&p.push({validator:async(e,s)=>{if(s&&!K(s))throw Error("Please enter valid JSON")}});let g=x?(0,c.jsxs)("span",{children:[u," ",(0,c.jsx)(z.Z,{title:x,children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}):u;return l=V(e,s)?(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):s.enum?(0,c.jsx)(C.default,{children:s.enum.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"number"===d||"integer"===d?(0,c.jsx)(q.Z,{style:{width:"100%"},precision:"integer"===d?0:void 0}):"duration"===e?(0,c.jsx)(y.Z,{placeholder:"eg: 30s, 30h, 30d"}):(0,c.jsx)(y.Z,{placeholder:x||""}),(0,c.jsx)(I.Z.Item,{label:g,name:e,className:"mt-8",rules:p,initialValue:n[e],help:(0,c.jsx)("div",{className:"text-xs text-gray-500",children:B(e,s,d)}),children:l},e)};return u?(0,c.jsxs)("div",{className:"text-red-500",children:["Error: ",u]}):(null==o?void 0:o.properties)?(0,c.jsx)("div",{children:Object.entries(o.properties).filter(e=>{let[s]=e;return!t.includes(s)}).map(e=>{let[s,t]=e;return p(s,t)})}):null},H=e=>{let{onChange:s,value:t,className:l,accessToken:a,placeholder:r="Select vector stores",disabled:i=!1}=e,[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a){u(!0);try{let e=await (0,g.vectorStoreListCall)(a);e.data&&o(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{u(!1)}}})()},[a]),(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:r,onChange:s,value:t,loading:m,className:l,options:n.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:i})})},J=e=>{let{teams:s,value:t,onChange:l,disabled:a}=e;return console.log("disabled",a),(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Search or select a team",value:t,onChange:l,disabled:a,filterOption:(e,t)=>{if(!t)return!1;let l=null==s?void 0:s.find(e=>e.team_id===t.key);if(!l)return!1;let a=e.toLowerCase().trim(),r=(l.team_alias||"").toLowerCase(),i=(l.team_id||"").toLowerCase();return r.includes(a)||i.includes(a)},optionFilterProp:"children",children:null==s?void 0:s.map(e=>(0,c.jsxs)(C.default.Option,{value:e.team_id,children:[(0,c.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,c.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})},Y=t(23496),W=t(12514),$=t(91777),Q=t(82182),X=t(22452),ee=t(74998);(l=i||(i={})).Braintrust="Braintrust",l.CustomCallbackAPI="Custom Callback API",l.Datadog="Datadog",l.Langfuse="Langfuse",l.LangSmith="LangSmith",l.Lago="Lago",l.OpenMeter="OpenMeter",l.OTel="Open Telemetry",l.S3="S3",l.Arize="Arize";let es={Braintrust:"braintrust",CustomCallbackAPI:"custom_callback_api",Datadog:"datadog",Langfuse:"langfuse",LangSmith:"langsmith",Lago:"lago",OpenMeter:"openmeter",OTel:"otel",S3:"s3",Arize:"arize"},et=Object.fromEntries(Object.entries(es).map(e=>{let[s,t]=e;return[t,s]})),el=e=>e.map(e=>et[e]||e),ea=e=>e.map(e=>es[e]||e),er="/assets/logos/",ei={Langfuse:{logo:"".concat(er,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"}},Arize:{logo:"".concat(er,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"text"}},LangSmith:{logo:"".concat(er,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text"}},Braintrust:{logo:"".concat(er,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{}},"Custom Callback API":{logo:"".concat(er,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{}},Datadog:{logo:"".concat(er,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{}},Lago:{logo:"".concat(er,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{}},OpenMeter:{logo:"".concat(er,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{}},"Open Telemetry":{logo:"".concat(er,"otel.png"),supports_key_team_logging:!1,dynamic_params:{}},S3:{logo:"".concat(er,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{}}},{Option:en}=C.default;var eo=e=>{let{value:s=[],onChange:t,disabledCallbacks:l=[],onDisabledCallbacksChange:a}=e,r=Object.entries(ei).filter(e=>{let[s,t]=e;return t.supports_key_team_logging}).map(e=>{let[s,t]=e;return s}),i=Object.keys(ei),n=e=>{null==t||t(e)},o=e=>{n(s.filter((s,t)=>t!==e))},d=(e,t,l)=>{let a=[...s];if("callback_name"===t){let s=es[l]||l;a[e]={...a[e],[t]:s,callback_vars:{}}}else a[e]={...a[e],[t]:l};n(a)},m=(e,t,l)=>{let a=[...s];a[e]={...a[e],callback_vars:{...a[e].callback_vars,[t]:l}},n(a)},u=(e,s)=>{var t,l;if(!e.callback_name)return null;let a=null===(t=Object.entries(es).find(s=>{let[t,l]=s;return l===e.callback_name}))||void 0===t?void 0:t[0];if(!a)return null;let r=(null===(l=ei[a])||void 0===l?void 0:l.dynamic_params)||{};return 0===Object.keys(r).length?null:(0,c.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,c.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,c.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,c.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(r).map(t=>{let[l,a]=t;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,c.jsx)("span",{children:l.replace(/_/g," ")}),(0,c.jsx)(z.Z,{title:"Environment variable reference recommended: os.environ/".concat(l.toUpperCase()),children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===a&&(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"})]}),(0,c.jsx)(y.Z,{type:"password"===a?"password":"text",placeholder:"os.environ/".concat(l.toUpperCase()),value:e.callback_vars[l]||"",onChange:e=>m(s,l,e.target.value)})]},l)})})]})};return(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)($.Z,{className:"w-5 h-5 text-red-500"}),(0,c.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,c.jsx)(z.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help"})})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:l,onChange:e=>{let s=ea(e);null==a||a(s)},style:{width:"100%"},optionLabelProp:"label",children:i.map(e=>{var s;let t=null===(s=ei[e])||void 0===s?void 0:s.logo;return(0,c.jsx)(en,{value:e,label:e,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:e,className:"w-4 h-4 object-contain"}),(0,c.jsx)("span",{children:e})]})},e)})}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,c.jsx)(Y.Z,{}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(Q.Z,{className:"w-5 h-5 text-blue-500"}),(0,c.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,c.jsx)(z.Z,{title:"Configure callback logging integrations for this team.",children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help"})})]}),(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{n([...s,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:X.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,c.jsx)("div",{className:"space-y-4",children:s.map((e,s)=>{var t,l;let a=e.callback_name?null===(t=Object.entries(es).find(s=>{let[t,l]=s;return l===e.callback_name}))||void 0===t?void 0:t[0]:void 0,i=a?null===(l=ei[a])||void 0===l?void 0:l.logo:null;return(0,c.jsxs)(W.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,c.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[i&&(0,c.jsx)("img",{src:i,alt:a,className:"w-5 h-5 object-contain"}),(0,c.jsxs)("span",{className:"text-sm font-medium",children:[a||"New Integration"," Configuration"]})]}),(0,c.jsx)(_.Z,{variant:"light",onClick:()=>o(s),icon:ee.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,c.jsx)(C.default,{value:a,placeholder:"Select integration",onChange:e=>d(s,"callback_name",e),className:"w-full",optionLabelProp:"label",children:r.map(e=>{var s;let t=null===(s=ei[e])||void 0===s?void 0:s.logo;return(0,c.jsx)(en,{value:e,label:e,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:e,className:"w-4 h-4 object-contain"}),(0,c.jsx)("span",{children:e})]})},e)})})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,c.jsxs)(C.default,{value:e.callback_type,onChange:e=>d(s,"callback_type",e),className:"w-full",children:[(0,c.jsx)(en,{value:"success",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{children:"Success Only"})]})}),(0,c.jsx)(en,{value:"failure",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,c.jsx)("span",{children:"Failure Only"})]})}),(0,c.jsx)(en,{value:"success_and_failure",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),u(e,s)]})]},s)})}),0===s.length&&(0,c.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,c.jsx)(Q.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,c.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,c.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})},ec=function(e){let{value:s,onChange:t,premiumUser:l=!1,disabledCallbacks:a=[],onDisabledCallbacksChange:r}=e;return l?(0,c.jsx)(eo,{value:s,onChange:t,disabledCallbacks:a,onDisabledCallbacksChange:r}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,c.jsxs)(w.Z,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})},ed=t(57365),em=t(93192);function eu(e){let{isInvitationLinkModalVisible:s,setIsInvitationLinkModalVisible:t,baseUrl:l,invitationLinkData:a,modalType:r="invitation"}=e,{Title:i,Paragraph:n}=em.default,o=()=>{if(!l)return"";let e=new URL(l).pathname,s=e&&"/"!==e?"".concat(e,"/ui"):"ui";if(null==a?void 0:a.has_user_setup_sso)return new URL(s,l).toString();let t="".concat(s,"?invitation_id=").concat(null==a?void 0:a.id);return"resetPassword"===r&&(t+="&action=reset_password"),new URL(t,l).toString()};return(0,c.jsxs)(A.Z,{title:"invitation"===r?"Invitation Link":"Reset Password Link",visible:s,width:800,footer:null,onOk:()=>{t(!1)},onCancel:()=>{t(!1)},children:[(0,c.jsx)(n,{children:"invitation"===r?"Copy and send the generated link to onboard this user to the proxy.":"Copy and send the generated link to the user to reset their password."}),(0,c.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,c.jsx)(w.Z,{className:"text-base",children:"User ID"}),(0,c.jsx)(w.Z,{children:null==a?void 0:a.user_id})]}),(0,c.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,c.jsx)(w.Z,{children:"invitation"===r?"Invitation Link":"Reset Password Link"}),(0,c.jsx)(w.Z,{children:(0,c.jsx)(w.Z,{children:o()})})]}),(0,c.jsx)("div",{className:"flex justify-end mt-5",children:(0,c.jsx)(S.CopyToClipboard,{text:o(),onCopy:()=>P.ZP.success("Copied!"),children:(0,c.jsx)(_.Z,{variant:"primary",children:"invitation"===r?"Copy invitation link":"Copy password reset link"})})})]})}var ex=t(85010),eh=t(72188),ep=t(73879),eg=t(34310),ej=t(38434),ef=t(26349),ev=t(35291),e_=t(3632),ey=t(15452),eb=t.n(ey),eN=t(71157),eZ=t(44643),ew=t(88532),ek=e=>{let{accessToken:s,teams:t,possibleUIRoles:l,onUsersCreated:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(null),[k,C]=(0,d.useState)("http://localhost:4000");(0,d.useEffect)(()=>{(async()=>{try{let e=await (0,g.getProxyUISettings)(s);Z(e)}catch(e){console.error("Error fetching UI settings:",e)}})(),C(new URL("/",window.location.href).toString())},[s]);let I=async()=>{u(!0);let e=n.map(e=>({...e,status:"pending"}));o(e);let t=!1;for(let a=0;a<e.length;a++){var l,r,i;let n=e[a];try{let e={user_email:n.user_email,user_role:n.user_role};if(n.teams&&"string"==typeof n.teams&&""!==n.teams.trim()&&(e.teams=n.teams.split(",").map(e=>e.trim()).filter(Boolean),0===e.teams.length&&delete e.teams),n.models&&"string"==typeof n.models&&""!==n.models.trim()&&(e.models=n.models.split(",").map(e=>e.trim()).filter(Boolean),0===e.models.length&&delete e.models),n.max_budget&&""!==n.max_budget.toString().trim()){let s=parseFloat(n.max_budget.toString());!isNaN(s)&&s>0&&(e.max_budget=s)}n.budget_duration&&""!==n.budget_duration.trim()&&(e.budget_duration=n.budget_duration.trim()),n.metadata&&"string"==typeof n.metadata&&""!==n.metadata.trim()&&(e.metadata=n.metadata.trim()),console.log("Sending user data:",e);let r=await (0,g.userCreateCall)(s,null,e);if(console.log("Full response:",r),r&&(r.key||r.user_id)){t=!0,console.log("Success case triggered");let e=(null===(l=r.data)||void 0===l?void 0:l.user_id)||r.user_id;try{if(null==N?void 0:N.SSO_ENABLED){let e=new URL("/ui",k).toString();o(s=>s.map((s,t)=>t===a?{...s,status:"success",key:r.key||r.user_id,invitation_link:e}:s))}else{let t=await (0,g.invitationCreateCall)(s,e),l=new URL("/ui?invitation_id=".concat(t.id),k).toString();o(e=>e.map((e,s)=>s===a?{...e,status:"success",key:r.key||r.user_id,invitation_link:l}:e))}}catch(e){console.error("Error creating invitation:",e),o(e=>e.map((e,s)=>s===a?{...e,status:"success",key:r.key||r.user_id,error:"User created but failed to generate invitation link"}:e))}}else{console.log("Error case triggered");let e=(null==r?void 0:r.error)||"Failed to create user";console.log("Error message:",e),o(s=>s.map((s,t)=>t===a?{...s,status:"failed",error:e}:s))}}catch(s){console.error("Caught error:",s);let e=(null==s?void 0:null===(i=s.response)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.error)||(null==s?void 0:s.message)||String(s);o(s=>s.map((s,t)=>t===a?{...s,status:"failed",error:e}:s))}}u(!1),t&&a&&a()};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_.Z,{className:"mb-0",onClick:()=>i(!0),children:"+ Bulk Invite Users"}),(0,c.jsx)(A.Z,{title:"Bulk Invite Users",visible:r,width:800,onCancel:()=>i(!1),bodyStyle:{maxHeight:"70vh",overflow:"auto"},footer:null,children:(0,c.jsx)("div",{className:"flex flex-col",children:0===n.length?(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"1"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Download and fill the template"})]}),(0,c.jsxs)("div",{className:"ml-11 mb-6",children:[(0,c.jsx)("p",{className:"mb-4",children:"Add multiple users at once by following these steps:"}),(0,c.jsxs)("ol",{className:"list-decimal list-inside space-y-2 ml-2 mb-4",children:[(0,c.jsx)("li",{children:"Download our CSV template"}),(0,c.jsx)("li",{children:"Add your users' information to the spreadsheet"}),(0,c.jsx)("li",{children:"Save the file and upload it here"}),(0,c.jsx)("li",{children:"After creation, download the results file containing the API keys for each user"})]}),(0,c.jsxs)("div",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 mb-4",children:[(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Template Column Names"}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"user_email"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"User's email address (required)"})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"user_role"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'User\'s role (one of: "proxy_admin", "proxy_admin_view_only", "internal_user", "internal_user_view_only")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"teams"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated team IDs (e.g., "team-1,team-2")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"max_budget"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Maximum budget as a number (e.g., "100")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"budget_duration"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Budget reset period (e.g., "30d", "1mo")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"models"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated allowed models (e.g., "gpt-3.5-turbo,gpt-4")'})]})]})]})]}),(0,c.jsxs)(_.Z,{onClick:()=>{let e=new Blob([eb().unparse([["user_email","user_role","teams","max_budget","budget_duration","models"],["[email protected]","internal_user","team-id-1,team-id-2","100","30d","gpt-3.5-turbo,gpt-4"]])],{type:"text/csv"}),s=window.URL.createObjectURL(e),t=document.createElement("a");t.href=s,t.download="bulk_users_template.csv",document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(s)},size:"lg",className:"w-full md:w-auto",children:[(0,c.jsx)(ep.Z,{className:"mr-2"})," Download CSV Template"]})]}),(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"2"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Upload your completed CSV"})]}),(0,c.jsxs)("div",{className:"ml-11",children:[y?(0,c.jsxs)("div",{className:"mb-4 p-4 rounded-md border ".concat(f?"bg-red-50 border-red-200":"bg-blue-50 border-blue-200"),children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[f?(0,c.jsx)(eg.Z,{className:"text-red-500 text-xl mr-3"}):(0,c.jsx)(ej.Z,{className:"text-blue-500 text-xl mr-3"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(em.default.Text,{strong:!0,className:f?"text-red-800":"text-blue-800",children:y.name}),(0,c.jsxs)(em.default.Text,{className:"block text-xs ".concat(f?"text-red-600":"text-blue-600"),children:[(y.size/1024).toFixed(1)," KB • ",new Date().toLocaleDateString()]})]})]}),(0,c.jsxs)(_.Z,{size:"xs",variant:"secondary",onClick:()=>{b(null),o([]),h(null),j(null),v(null)},className:"flex items-center",children:[(0,c.jsx)(ef.Z,{className:"mr-1"})," Remove"]})]}),f?(0,c.jsxs)("div",{className:"mt-3 text-red-600 text-sm flex items-start",children:[(0,c.jsx)(ev.Z,{className:"mr-2 mt-0.5"}),(0,c.jsx)("span",{children:f})]}):!p&&(0,c.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1.5",children:(0,c.jsx)("div",{className:"bg-blue-500 h-1.5 rounded-full w-full animate-pulse"})}),(0,c.jsx)("span",{className:"ml-2 text-xs text-blue-600",children:"Processing..."})]})]}):(0,c.jsx)(ex.default,{beforeUpload:e=>((h(null),j(null),v(null),b(e),"text/csv"===e.type||e.name.endsWith(".csv"))?e.size>5242880?v("File is too large (".concat((e.size/1048576).toFixed(1)," MB). Please upload a CSV file smaller than 5MB.")):eb().parse(e,{complete:e=>{if(!e.data||0===e.data.length){j("The CSV file appears to be empty. Please upload a file with data."),o([]);return}if(1===e.data.length){j("The CSV file only contains headers but no user data. Please add user data to your CSV."),o([]);return}let s=e.data[0];if(0===s.length||1===s.length&&""===s[0]){j("The CSV file doesn't contain any column headers. Please make sure your CSV has headers."),o([]);return}let l=["user_email","user_role"].filter(e=>!s.includes(e));if(l.length>0){j("Your CSV is missing these required columns: ".concat(l.join(", "),". Please add these columns to your CSV file.")),o([]);return}try{let l=e.data.slice(1).map((e,l)=>{var a,r,i,n,o,c;if(0===e.length||1===e.length&&""===e[0])return null;if(e.length<s.length)return{rowNumber:l+2,isValid:!1,error:"Row ".concat(l+2," has fewer columns than the header row. Please ensure all data is properly formatted."),user_email:"",user_role:""};let d={user_email:(null===(a=e[s.indexOf("user_email")])||void 0===a?void 0:a.trim())||"",user_role:(null===(r=e[s.indexOf("user_role")])||void 0===r?void 0:r.trim())||"",teams:null===(i=e[s.indexOf("teams")])||void 0===i?void 0:i.trim(),max_budget:null===(n=e[s.indexOf("max_budget")])||void 0===n?void 0:n.trim(),budget_duration:null===(o=e[s.indexOf("budget_duration")])||void 0===o?void 0:o.trim(),models:null===(c=e[s.indexOf("models")])||void 0===c?void 0:c.trim(),rowNumber:l+2,isValid:!0,error:""},m=[];if(d.user_email?d.user_email.includes("@")&&d.user_email.includes(".")||m.push("Invalid email format (must contain @ and domain)"):m.push("Email is required"),d.user_role){let e=["proxy_admin","proxy_admin_view_only","internal_user","internal_user_view_only"];e.includes(d.user_role)||m.push('Invalid role "'.concat(d.user_role,'". Must be one of: ').concat(e.join(", ")))}else m.push("Role is required");if(d.max_budget&&""!==d.max_budget.toString().trim()&&(isNaN(parseFloat(d.max_budget.toString()))?m.push('Max budget "'.concat(d.max_budget,'" must be a number')):0>=parseFloat(d.max_budget.toString())&&m.push("Max budget must be greater than 0")),d.budget_duration&&!d.budget_duration.match(/^\d+[dhmwy]$|^\d+mo$/)&&m.push('Invalid budget duration format "'.concat(d.budget_duration,'". Use format like "30d", "1mo", "2w", "6h"')),d.teams&&"string"==typeof d.teams&&t&&t.length>0){let e=t.map(e=>e.team_id),s=d.teams.split(",").map(e=>e.trim()).filter(s=>!e.includes(s));s.length>0&&m.push("Unknown team(s): ".concat(s.join(", ")))}return m.length>0&&(d.isValid=!1,d.error=m.join(", ")),d}).filter(Boolean),a=l.filter(e=>e.isValid);o(l),0===l.length?j("No valid data rows found in the CSV file. Please check your file format."):0===a.length?h("No valid users found in the CSV. Please check the errors below and fix your CSV file."):a.length<l.length?h("Found ".concat(l.length-a.length," row(s) with errors out of ").concat(l.length," total rows. Please correct them before proceeding.")):P.ZP.success("Successfully parsed ".concat(a.length," users"))}catch(s){let e=s instanceof Error?s.message:"Unknown error";h("Error parsing CSV: ".concat(e)),o([])}},error:e=>{h("Failed to parse CSV file: ".concat(e.message)),o([])},header:!1}):(v("Invalid file type: ".concat(e.name,". Please upload a CSV file (.csv extension).")),P.ZP.error("Invalid file type. Please upload a CSV file.")),!1),accept:".csv",maxCount:1,showUploadList:!1,children:(0,c.jsxs)("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-500 transition-colors cursor-pointer",children:[(0,c.jsx)(e_.Z,{className:"text-3xl text-gray-400 mb-2"}),(0,c.jsx)("p",{className:"mb-1",children:"Drag and drop your CSV file here"}),(0,c.jsx)("p",{className:"text-sm text-gray-500 mb-3",children:"or"}),(0,c.jsx)(_.Z,{size:"sm",children:"Browse files"}),(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-4",children:"Only CSV files (.csv) are supported"})]})}),p&&(0,c.jsx)("div",{className:"mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(ew.Z,{className:"h-5 w-5 text-yellow-500 mr-2 mt-0.5"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(em.default.Text,{strong:!0,className:"text-yellow-800",children:"CSV Structure Error"}),(0,c.jsx)(em.default.Paragraph,{className:"text-yellow-700 mt-1 mb-0",children:p}),(0,c.jsx)(em.default.Paragraph,{className:"text-yellow-700 mt-2 mb-0",children:"Please download our template and ensure your CSV follows the required format."})]})]})})]})]}):(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"3"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:n.some(e=>"success"===e.status||"failed"===e.status)?"User Creation Results":"Review and create users"})]}),x&&(0,c.jsx)("div",{className:"ml-11 mb-4 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(ev.Z,{className:"text-red-500 mr-2 mt-1"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-red-600 font-medium",children:x}),n.some(e=>!e.isValid)&&(0,c.jsxs)("ul",{className:"mt-2 list-disc list-inside text-red-600 text-sm",children:[(0,c.jsx)("li",{children:"Check the table below for specific errors in each row"}),(0,c.jsx)("li",{children:"Common issues include invalid email formats, missing required fields, or incorrect role values"}),(0,c.jsx)("li",{children:"Fix these issues in your CSV file and upload again"})]})]})]})}),(0,c.jsxs)("div",{className:"ml-11",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,c.jsx)("div",{className:"flex items-center",children:n.some(e=>"success"===e.status||"failed"===e.status)?(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{className:"text-lg font-medium mr-3",children:"Creation Summary"}),(0,c.jsxs)(w.Z,{className:"text-sm bg-green-100 text-green-800 px-2 py-1 rounded mr-2",children:[n.filter(e=>"success"===e.status).length," Successful"]}),n.some(e=>"failed"===e.status)&&(0,c.jsxs)(w.Z,{className:"text-sm bg-red-100 text-red-800 px-2 py-1 rounded",children:[n.filter(e=>"failed"===e.status).length," Failed"]})]}):(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{className:"text-lg font-medium mr-3",children:"User Preview"}),(0,c.jsxs)(w.Z,{className:"text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded",children:[n.filter(e=>e.isValid).length," of ",n.length," users valid"]})]})}),!n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",children:"Back"}),(0,c.jsx)(_.Z,{onClick:I,disabled:0===n.filter(e=>e.isValid).length||m,children:m?"Creating...":"Create ".concat(n.filter(e=>e.isValid).length," Users")})]})]}),n.some(e=>"success"===e.status)&&(0,c.jsx)("div",{className:"mb-4 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"mr-3 mt-1",children:(0,c.jsx)(eZ.Z,{className:"h-5 w-5 text-blue-500"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-blue-800",children:"User creation complete"}),(0,c.jsxs)(w.Z,{className:"block text-sm text-blue-700 mt-1",children:[(0,c.jsx)("span",{className:"font-medium",children:"Next step:"})," Download the credentials file containing API keys and invitation links. Users will need these API keys to make LLM requests through LiteLLM."]})]})]})}),(0,c.jsx)(eh.Z,{dataSource:n,columns:[{title:"Row",dataIndex:"rowNumber",key:"rowNumber",width:80},{title:"Email",dataIndex:"user_email",key:"user_email"},{title:"Role",dataIndex:"user_role",key:"user_role"},{title:"Teams",dataIndex:"teams",key:"teams"},{title:"Budget",dataIndex:"max_budget",key:"max_budget"},{title:"Status",key:"status",render:(e,s)=>s.isValid?s.status&&"pending"!==s.status?"success"===s.status?(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(eZ.Z,{className:"h-5 w-5 text-green-500 mr-2"}),(0,c.jsx)("span",{className:"text-green-500",children:"Success"})]}),s.invitation_link&&(0,c.jsx)("div",{className:"mt-1",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{className:"text-xs text-gray-500 truncate max-w-[150px]",children:s.invitation_link}),(0,c.jsx)(S.CopyToClipboard,{text:s.invitation_link,onCopy:()=>P.ZP.success("Invitation link copied!"),children:(0,c.jsx)("button",{className:"ml-1 text-blue-500 text-xs hover:text-blue-700",children:"Copy"})})]})})]}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(eN.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsx)("span",{className:"text-red-500",children:"Failed"})]}),s.error&&(0,c.jsx)("span",{className:"text-sm text-red-500 ml-7",children:JSON.stringify(s.error)})]}):(0,c.jsx)("span",{className:"text-gray-500",children:"Pending"}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(eN.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsx)("span",{className:"text-red-500",children:"Invalid"})]}),s.error&&(0,c.jsx)("span",{className:"text-sm text-red-500 ml-7",children:s.error})]})}],size:"small",pagination:{pageSize:5},scroll:{y:300},rowClassName:e=>e.isValid?"":"bg-red-50"}),!n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",className:"mr-3",children:"Back"}),(0,c.jsx)(_.Z,{onClick:I,disabled:0===n.filter(e=>e.isValid).length||m,children:m?"Creating...":"Create ".concat(n.filter(e=>e.isValid).length," Users")})]}),n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",className:"mr-3",children:"Start New Bulk Import"}),(0,c.jsxs)(_.Z,{onClick:()=>{let e=n.map(e=>({user_email:e.user_email,user_role:e.user_role,status:e.status,key:e.key||"",invitation_link:e.invitation_link||"",error:e.error||""})),s=new Blob([eb().unparse(e)],{type:"text/csv"}),t=window.URL.createObjectURL(s),l=document.createElement("a");l.href=t,l.download="bulk_users_results.csv",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(t)},variant:"primary",className:"flex items-center",children:[(0,c.jsx)(ep.Z,{className:"mr-2"})," Download User Credentials"]})]})]})]})})})]})};let{Option:eS}=C.default,eC=()=>"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let s=16*Math.random()|0;return("x"==e?s:3&s|8).toString(16)});var eI=e=>{let{userID:s,accessToken:t,teams:l,possibleUIRoles:a,onUserCreated:r,isEmbedded:i=!1}=e,n=(0,h.NL)(),[o,m]=(0,d.useState)(null),[u]=I.Z.useForm(),[x,p]=(0,d.useState)(!1),[j,f]=(0,d.useState)(!1),[v,S]=(0,d.useState)([]),[E,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(null),[R,q]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=async()=>{try{let e=await (0,g.modelAvailableCall)(t,s,"any"),l=[];for(let s=0;s<e.data.length;s++){let t=e.data[s];l.push(t.id)}console.log("Model data response:",e.data),console.log("Available models:",l),S(l);let a=await (0,g.getProxyUISettings)(t);console.log("uiSettingsResponse:",a),m(a)}catch(e){console.error("Error fetching model data:",e)}};q((0,g.getProxyBaseUrl)()),e()},[]);let V=async e=>{var l,a,c;try{P.ZP.info("Making API Call"),i||p(!0),e.models&&0!==e.models.length||"proxy_admin"===e.user_role||(console.log("formValues.user_role",e.user_role),e.models=["no-default-models"]),console.log("formValues in create user:",e);let a=await (0,g.userCreateCall)(t,null,e);await n.invalidateQueries({queryKey:["userList"]}),console.log("user create Response:",a),f(!0);let c=(null===(l=a.data)||void 0===l?void 0:l.user_id)||a.user_id;if(r&&i){r(c),u.resetFields();return}if(null==o?void 0:o.SSO_ENABLED){let e={id:eC(),user_id:c,is_accepted:!1,accepted_at:null,expires_at:new Date(Date.now()+6048e5),created_at:new Date,created_by:s,updated_at:new Date,updated_by:s,has_user_setup_sso:!0};D(e),O(!0)}else(0,g.invitationCreateCall)(t,c).then(e=>{e.has_user_setup_sso=!1,D(e),O(!0)});P.ZP.success("API user Created"),u.resetFields(),localStorage.removeItem("userData"+s)}catch(s){let e=(null===(c=s.response)||void 0===c?void 0:null===(a=c.data)||void 0===a?void 0:a.detail)||(null==s?void 0:s.message)||"Error creating the user";P.ZP.error(e),console.error("Error creating the user:",s)}};return i?(0,c.jsxs)(I.Z,{form:u,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"User Email",name:"user_email",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"User Role",name:"user_role",children:(0,c.jsx)(C.default,{children:a&&Object.entries(a).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ed.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",children:(0,c.jsx)(C.default,{placeholder:"Select Team ID",style:{width:"100%"},children:l?l.map(e=>(0,c.jsx)(eS,{value:e.team_id,children:e.team_alias},e.team_id)):(0,c.jsx)(eS,{value:null,children:"Default Team"},"default")})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create User"})})]}):(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{className:"mb-0",onClick:()=>p(!0),children:"+ Invite User"}),(0,c.jsx)(ek,{accessToken:t,teams:l,possibleUIRoles:a}),(0,c.jsxs)(A.Z,{title:"Invite User",visible:x,width:800,footer:null,onOk:()=>{p(!1),u.resetFields()},onCancel:()=>{p(!1),f(!1),u.resetFields()},children:[(0,c.jsx)(w.Z,{className:"mb-1",children:"Create a User who can own keys"}),(0,c.jsxs)(I.Z,{form:u,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"User Email",name:"user_email",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Global Proxy Role"," ",(0,c.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,c.jsx)(U.Z,{})})]}),name:"user_role",children:(0,c.jsx)(C.default,{children:a&&Object.entries(a).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ed.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",className:"gap-2",name:"team_id",help:"If selected, user will be added as a 'user' role to the team.",children:(0,c.jsx)(C.default,{placeholder:"Select Team ID",style:{width:"100%"},children:l?l.map(e=>(0,c.jsx)(eS,{value:e.team_id,children:e.team_alias},e.team_id)):(0,c.jsx)(eS,{value:null,children:"Default Team"},"default")})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsxs)(b.Z,{children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)(k.Z,{children:"Personal Key Creation"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)(I.Z.Item,{className:"gap-2",label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"Models user has access to, outside of team scope.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",help:"Models user has access to, outside of team scope.",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),v.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})})})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create User"})})]})]}),j&&(0,c.jsx)(eu,{isInvitationLinkModalVisible:E,setIsInvitationLinkModalVisible:O,baseUrl:R||"",invitationLinkData:M})]})},eP=t(7310),eA=t.n(eP),eE=t(20347);let{Option:eT}=C.default,eL=e=>e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";var eO=e=>{let{value:s,onChange:t,className:l="",style:a={}}=e;return(0,c.jsxs)(C.default,{style:{width:"100%",...a},value:s||void 0,onChange:t,className:l,placeholder:"n/a",children:[(0,c.jsx)(eT,{value:"24h",children:"daily"}),(0,c.jsx)(eT,{value:"7d",children:"weekly"}),(0,c.jsx)(eT,{value:"30d",children:"monthly"})]})};function eM(e,s){let t=structuredClone(e);for(let[e,l]of Object.entries(s))e in t&&(t[e]=l);return t}let eD=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null==e?"-":e.toLocaleString("en-US",{minimumFractionDigits:s,maximumFractionDigits:s})},eF=async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;try{return await navigator.clipboard.writeText(e),P.ZP.success(s),!0}catch(e){return P.ZP.error("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}};var eR=e=>{let{onChange:s,value:t,className:l,accessToken:a,placeholder:r="Select MCP servers",disabled:i=!1}=e,[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(a){h(!0);try{let[e,s]=await Promise.all([(0,g.fetchMCPServers)(a),(0,g.fetchMCPAccessGroups)(a)]),t=Array.isArray(e)?e:e.data||[],l=Array.isArray(s)?s:s.data||[];o(t),u(l)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[a]);let p=[...m.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...n.map(e=>({label:"".concat(e.server_name||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.server_name||e.server_id," ").concat(e.server_id," MCP Server")}))],j=[...(null==t?void 0:t.servers)||[],...(null==t?void 0:t.accessGroups)||[]];return(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:r,onChange:e=>{s({servers:e.filter(e=>!m.includes(e)),accessGroups:e.filter(e=>m.includes(e))})},value:j,loading:x,className:l,showSearch:!0,style:{width:"100%"},disabled:i,filterOption:(e,s)=>{var t;return((null===(t=p.find(e=>e.value===(null==s?void 0:s.value)))||void 0===t?void 0:t.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:p.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,label:e.label,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,c.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,c.jsx)("span",{style:{flex:1},children:e.label}),(0,c.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})};let{Option:eq}=C.default,eU=e=>{let s=[];if(console.log("data:",JSON.stringify(e)),e)for(let t of e)t.metadata&&t.metadata.tags&&s.push(...t.metadata.tags);let t=Array.from(new Set(s)).map(e=>({value:e,label:e}));return console.log("uniqueTags:",t),t},ez=async(e,s,t,l)=>{try{if(null===e||null===s)return[];if(null!==t){let a=(await (0,g.modelAvailableCall)(t,e,s,!0,l,!0)).data.map(e=>e.id);return console.log("available_model_names:",a),a}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},eV=async(e,s,t,l)=>{try{if(null===e||null===s)return;if(null!==t){let a=(await (0,g.modelAvailableCall)(t,e,s)).data.map(e=>e.id);console.log("available_model_names:",a),l(a)}}catch(e){console.error("Error fetching user models:",e)}};var eK=e=>{let{userID:s,team:t,teams:l,userRole:a,accessToken:r,data:i,addKey:n,premiumUser:o=!1}=e,[m]=I.Z.useForm(),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(null),[j,O]=(0,d.useState)(null),[D,R]=(0,d.useState)([]),[q,V]=(0,d.useState)([]),[K,B]=(0,d.useState)("you"),[Y,W]=(0,d.useState)(eU(i)),[$,Q]=(0,d.useState)([]),[X,ee]=(0,d.useState)([]),[es,et]=(0,d.useState)(t),[el,er]=(0,d.useState)(!1),[ei,en]=(0,d.useState)(null),[eo,ed]=(0,d.useState)({}),[em,eu]=(0,d.useState)([]),[ex,eh]=(0,d.useState)(!1),[ep,eg]=(0,d.useState)([]),[ej,ef]=(0,d.useState)(!1),[ev,e_]=(0,d.useState)([]),[ey,eb]=(0,d.useState)("default"),eN=()=>{x(!1),m.resetFields(),ee([]),e_([]),eb("default")},eZ=()=>{x(!1),p(null),et(null),m.resetFields(),ee([]),e_([]),eb("default")};(0,d.useEffect)(()=>{s&&a&&r&&eV(s,a,r,R)},[r,s,a]);let ew=async()=>{try{if(null==r)return;let e=await (0,g.fetchMCPAccessGroups)(r);eg(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,d.useEffect)(()=>{ew()},[r]),(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getGuardrailsList)(r)).guardrails.map(e=>e.guardrail_name);Q(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[r]),(0,d.useEffect)(()=>{(async()=>{try{if(r){let e=sessionStorage.getItem("possibleUserRoles");if(e)ed(JSON.parse(e));else{let e=await (0,g.getPossibleUserRoles)(r);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),ed(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[r]);let ek=q.includes("no-default-models")&&!es,eS=async e=>{try{var t,l,a,o,c;let d;let u=null!==(a=null==e?void 0:e.key_alias)&&void 0!==a?a:"",h=null!==(o=null==e?void 0:e.team_id)&&void 0!==o?o:null;if((null!==(c=null==i?void 0:i.filter(e=>e.team_id===h).map(e=>e.key_alias))&&void 0!==c?c:[]).includes(u))throw Error("Key alias ".concat(u," already exists for team with ID ").concat(h,", please provide another key alias"));P.ZP.info("Making API Call"),x(!0),"you"===K&&(e.user_id=s);let j={};try{j=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===K&&(j.service_account_id=e.key_alias),X.length>0&&(j={...j,logging:X.filter(e=>e.callback_name)}),ev.length>0){let e=ea(ev);j={...j,litellm_disabled_callbacks:e}}if(e.metadata=JSON.stringify(j),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0)){e.object_permission||(e.object_permission={});let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),d="service_account"===K?await (0,g.keyCreateServiceAccountCall)(r,e):await (0,g.keyCreateCall)(r,s,e),console.log("key create Response:",d),n(d),p(d.key),O(d.soft_budget),P.ZP.success("API Key Created"),m.resetFields(),localStorage.removeItem("userData"+s)}catch(e){console.log("error in create key:",e),P.ZP.error("Error creating the key: ".concat(e))}};(0,d.useEffect)(()=>{if(s&&a&&r){var e;ez(s,a,r,null!==(e=null==es?void 0:es.team_id)&&void 0!==e?e:null).then(e=>{var s;V(Array.from(new Set([...null!==(s=null==es?void 0:es.models)&&void 0!==s?s:[],...e])))})}m.setFieldValue("models",[])},[es,r,s,a]);let eC=async e=>{if(!e){eu([]);return}eh(!0);try{let s=new URLSearchParams;if(s.append("user_email",e),null==r)return;let t=(await (0,g.userFilterUICall)(r,s)).map(e=>({label:"".concat(e.user_email," (").concat(e.user_id,")"),value:e.user_id,user:e}));eu(t)}catch(e){console.error("Error fetching users:",e),P.ZP.error("Failed to search for users")}finally{eh(!1)}},eP=(0,d.useCallback)(eA()(e=>eC(e),300),[r]),eT=(e,s)=>{let t=s.user;m.setFieldsValue({user_id:t.user_id})};return(0,c.jsxs)("div",{children:[a&&eE.LQ.includes(a)&&(0,c.jsx)(_.Z,{className:"mx-auto",onClick:()=>x(!0),children:"+ Create New Key"}),(0,c.jsx)(A.Z,{visible:u,width:1e3,footer:null,onOk:eN,onCancel:eZ,children:(0,c.jsxs)(I.Z,{form:m,onFinish:eS,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(k.Z,{className:"mb-4",children:"Key Ownership"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Owned By"," ",(0,c.jsx)(z.Z,{title:"Select who will own this API key",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,c.jsxs)(E.ZP.Group,{onChange:e=>B(e.target.value),value:K,children:[(0,c.jsx)(E.ZP,{value:"you",children:"You"}),(0,c.jsx)(E.ZP,{value:"service_account",children:"Service Account"}),"Admin"===a&&(0,c.jsx)(E.ZP,{value:"another_user",children:"Another User"})]})}),"another_user"===K&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["User ID"," ",(0,c.jsx)(z.Z,{title:"The user who will own this key and be responsible for its usage",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===K,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{eP(e)},onSelect:(e,s)=>eT(e,s),options:em,loading:ex,allowClear:!0,style:{width:"100%"},notFoundContent:ex?"Searching...":"No users found"}),(0,c.jsx)(T.ZP,{onClick:()=>er(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Team"," ",(0,c.jsx)(z.Z,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:t?t.team_id:null,className:"mt-4",children:(0,c.jsx)(J,{teams:l,onChange:e=>{et((null==l?void 0:l.find(s=>s.team_id===e))||null)}})})]}),ek&&(0,c.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your API key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!ek&&(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(k.Z,{className:"mb-4",children:"Key Details"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["you"===K||"another_user"===K?"Key Name":"Service Account ID"," ",(0,c.jsx)(z.Z,{title:"you"===K||"another_user"===K?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:"Please input a ".concat("you"===K?"key name":"service account ID")}],help:"required",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",rules:"management"===ey||"read_only"===ey?[]:[{required:!0,message:"Please select a model"}],help:"management"===ey||"read_only"===ey?"Models field is disabled for this key type":"required",className:"mt-4",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===ey||"read_only"===ey,onChange:e=>{e.includes("all-team-models")&&m.setFieldsValue({models:["all-team-models"]})},children:[(0,c.jsx)(eq,{value:"all-team-models",children:"All Team Models"},"all-team-models"),q.map(e=>(0,c.jsx)(eq,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Key Type"," ",(0,c.jsx)(z.Z,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"default",className:"mt-4",children:(0,c.jsxs)(C.default,{defaultValue:"default",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{eb(e),("management"===e||"read_only"===e)&&m.setFieldsValue({models:[]})},children:[(0,c.jsx)(eq,{value:"default",label:"Default",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call LLM API + Management routes"})]})}),(0,c.jsx)(eq,{value:"llm_api",label:"LLM API",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"LLM API"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only LLM API routes (chat/completions, embeddings, etc.)"})]})}),(0,c.jsx)(eq,{value:"management",label:"Management",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})}),(0,c.jsx)(eq,{value:"read_only",label:"Read Only",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Read Only"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can only call only info routes (e.g. /key/info, /user/info, /team/info)"})]})})]})})]}),!ek&&(0,c.jsx)("div",{className:"mb-8",children:(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",onClick:()=>{ej||(ew(),ef(!0))},children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)(k.Z,{className:"m-0",children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Max Budget (USD)"," ",(0,c.jsx)(z.Z,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==t?void 0:t.max_budget)!==null&&(null==t?void 0:t.max_budget)!==void 0?null==t?void 0:t.max_budget:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.max_budget&&s>t.max_budget)throw Error("Budget cannot exceed team max budget: $".concat(eD(t.max_budget,4)))}}],children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Reset Budget"," ",(0,c.jsx)(z.Z,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:"Team Reset Budget: ".concat((null==t?void 0:t.budget_duration)!==null&&(null==t?void 0:t.budget_duration)!==void 0?null==t?void 0:t.budget_duration:"None"),children:(0,c.jsx)(eO,{onChange:e=>m.setFieldValue("budget_duration",e)})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,c.jsx)(z.Z,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==t?void 0:t.tpm_limit)!==null&&(null==t?void 0:t.tpm_limit)!==void 0?null==t?void 0:t.tpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.tpm_limit&&s>t.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(t.tpm_limit))}}],children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,c.jsx)(z.Z,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==t?void 0:t.rpm_limit)!==null&&(null==t?void 0:t.rpm_limit)!==void 0?null==t?void 0:t.rpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.rpm_limit&&s>t.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(t.rpm_limit))}}],children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Expire Key"," ",(0,c.jsx)(z.Z,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days)",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"duration",className:"mt-4",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:$.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,c.jsx)(H,{onChange:e=>m.setFieldValue("allowed_vector_store_ids",e),value:m.getFieldValue("allowed_vector_store_ids"),accessToken:r,placeholder:"Select vector stores (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers or access groups this key can access. ",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this key can access. ",children:(0,c.jsx)(eR,{onChange:e=>m.setFieldValue("allowed_mcp_servers_and_groups",e),value:m.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:r,placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Tags"," ",(0,c.jsx)(z.Z,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Enter tags",tokenSeparators:[","],options:Y})}),(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Logging Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(ec,{value:X,onChange:ee,premiumUser:o,disabledCallbacks:ev,onDisabledCallbacksChange:e_})})})]}),(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("b",{children:"Advanced Settings"}),(0,c.jsx)(z.Z,{title:(0,c.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,c.jsx)("a",{href:g.proxyBaseUrl?"".concat(g.proxyBaseUrl,"/#/key%20management/generate_key_fn_key_generate_post"):"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,c.jsx)(U.Z,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)(G,{schemaComponent:"GenerateKeyRequest",form:m,excludedFields:["key_alias","team_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit"]})})]})]})]})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",disabled:ek,style:{opacity:ek?.5:1},children:"Create Key"})})]})}),el&&(0,c.jsx)(A.Z,{title:"Create New User",visible:el,onCancel:()=>er(!1),footer:null,width:800,children:(0,c.jsx)(eI,{userID:s,accessToken:r,teams:l,possibleUIRoles:eo,onUserCreated:e=>{en(e),m.setFieldsValue({user_id:e}),er(!1)},isEmbedded:!0})}),h&&(0,c.jsx)(A.Z,{visible:u,onOk:eN,onCancel:eZ,footer:null,children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Save your Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,c.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,c.jsx)(f.Z,{numColSpan:1,children:null!=h?(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"API Key:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:h})}),(0,c.jsx)(S.CopyToClipboard,{text:h,onCopy:()=>{P.ZP.success("API Key copied to clipboard")},children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,c.jsx)(w.Z,{children:"Key being created, this might take 30s"})})]})})]})},eB=t(7366),eG=e=>{let{selectedTeam:s,currentOrg:t,selectedKeyAlias:l,accessToken:a,createClicked:r}=e,[i,n]=(0,d.useState)({keys:[],total_count:0,current_page:1,total_pages:0}),[o,c]=(0,d.useState)(!0),[m,u]=(0,d.useState)(null),x=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(console.log("calling fetchKeys"),!a){console.log("accessToken",a);return}c(!0);let s="number"==typeof e.page?e.page:1,t="number"==typeof e.pageSize?e.pageSize:100,l=await (0,g.keyListCall)(a,null,null,null,null,null,s,t);console.log("data",l),n(l),u(null)}catch(e){u(e instanceof Error?e:Error("An error occurred"))}finally{c(!1)}};return(0,d.useEffect)(()=>{x(),console.log("selectedTeam",s,"currentOrg",t,"accessToken",a,"selectedKeyAlias",l)},[s,t,a,l,r]),{keys:i.keys,isLoading:o,error:m,pagination:{currentPage:i.current_page,totalPages:i.total_pages,totalCount:i.total_count},refresh:x,setKeys:e=>{n(s=>{let t="function"==typeof e?e(s.keys):e;return{...s,keys:t}})}}},eH=t(27281),eJ=t(41649),eY=t(12485),eW=t(18135),e$=t(35242),eQ=t(29706),eX=t(77991),e0=t(10900),e1=t(23628),e2=e=>{let{value:s,onChange:t,disabledCallbacks:l=[],onDisabledCallbacksChange:a}=e;return(0,c.jsx)(eo,{value:s,onChange:t,disabledCallbacks:l,onDisabledCallbacksChange:a})};let e4=["logging"],e5=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!e4.includes(s)})):{},e6=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],e3=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(e5(e),null,s)};function e8(e){var s,t,l,a,r,i,n;let{keyData:o,onCancel:m,onSubmit:u,teams:x,accessToken:h,userID:p,userRole:j,premiumUser:f=!1}=e,[v]=I.Z.useForm(),[b,N]=(0,d.useState)([]),Z=null==x?void 0:x.find(e=>e.team_id===o.team_id),[w,k]=(0,d.useState)([]),[S,P]=(0,d.useState)([]),[A,E]=(0,d.useState)(!1),[O,D]=(0,d.useState)(Array.isArray(null===(s=o.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?el(o.metadata.litellm_disabled_callbacks):[]);(0,d.useEffect)(()=>{(async()=>{if(p&&j&&h)try{if(null===o.team_id){let e=(await (0,g.modelAvailableCall)(h,p,j)).data.map(e=>e.id);k(e)}else if(null==Z?void 0:Z.team_id){let e=await ez(p,j,h,Z.team_id);k(Array.from(new Set([...Z.models,...e])))}}catch(e){console.error("Error fetching models:",e)}})()},[p,j,h,Z,o.team_id]),(0,d.useEffect)(()=>{v.setFieldValue("disabled_callbacks",O)},[v,O]);let F={...o,budget_duration:(n=o.budget_duration)&&({"24h":"daily","7d":"weekly","30d":"monthly"})[n]||null,metadata:e3(o.metadata),guardrails:(null===(t=o.metadata)||void 0===t?void 0:t.guardrails)||[],vector_stores:(null===(l=o.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=o.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(r=o.object_permission)||void 0===r?void 0:r.mcp_access_groups)||[]},logging_settings:e6(o.metadata),disabled_callbacks:Array.isArray(null===(i=o.metadata)||void 0===i?void 0:i.litellm_disabled_callbacks)?el(o.metadata.litellm_disabled_callbacks):[]};return(0,c.jsxs)(I.Z,{form:v,onFinish:u,initialValues:F,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[w.length>0&&(0,c.jsx)(C.default.Option,{value:"all-team-models",children:"All Team Models"}),w.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"daily",children:"Daily"}),(0,c.jsx)(C.default.Option,{value:"weekly",children:"Weekly"}),(0,c.jsx)(C.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,c.jsx)(I.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,c.jsx)(I.Z.Item,{label:"Guardrails",name:"guardrails",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails"})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>v.setFieldValue("vector_stores",e),value:v.getFieldValue("vector_stores"),accessToken:h||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(eR,{onChange:e=>v.setFieldValue("mcp_servers_and_groups",e),value:v.getFieldValue("mcp_servers_and_groups"),accessToken:h||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",children:(0,c.jsx)(C.default,{placeholder:"Select team",style:{width:"100%"},children:null==x?void 0:x.map(e=>(0,c.jsx)(C.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,c.jsx)(I.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,c.jsx)(e2,{value:v.getFieldValue("logging_settings"),onChange:e=>v.setFieldValue("logging_settings",e),disabledCallbacks:O,onDisabledCallbacksChange:e=>{D(el(e)),v.setFieldValue("disabled_callbacks",e)}})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:10})}),(0,c.jsx)(I.Z.Item,{name:"token",hidden:!0,children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,c.jsx)(L.default,{})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{onClick:m,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]})}function e7(e){let{selectedToken:s,visible:t,onClose:l,accessToken:a,premiumUser:r,setAccessToken:i,onKeyUpdate:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(null),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),[b,N]=(0,d.useState)(!1),[Z,C]=(0,d.useState)(!1),[E,T]=(0,d.useState)(null);(0,d.useEffect)(()=>{t&&s&&a&&(o.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),T(a),C(s.key_name===a))},[t,s,o,a]),(0,d.useEffect)(()=>{t||(u(null),N(!1),C(!1),T(null),o.resetFields())},[t,o]);let L=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,eB.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,eB.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,eB.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,d.useEffect)(()=>{(null==x?void 0:x.duration)?j(L(x.duration)):j(null)},[null==x?void 0:x.duration]);let O=async()=>{if(s&&E){N(!0);try{let e=await o.validateFields(),t=await (0,g.regenerateKeyCall)(E,s.token||s.token_id,e);u(t.key),P.ZP.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let l={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?L(e.duration):s.expires,...t};console.log("Updated key data with new token:",l),Z&&(T(t.key),i&&i(t.key)),n&&n(l),N(!1)}catch(e){console.error("Error regenerating key:",e),P.ZP.error("Failed to regenerate API Key"),N(!1)}}},M=()=>{u(null),N(!1),C(!1),T(null),o.resetFields(),l()};return(0,c.jsx)(A.Z,{title:"Regenerate API Key",open:t,onCancel:M,footer:m?[(0,c.jsx)(_.Z,{onClick:M,children:"Close"},"close")]:[(0,c.jsx)(_.Z,{onClick:M,className:"mr-2",children:"Cancel"},"cancel"),(0,c.jsx)(_.Z,{onClick:O,disabled:b,children:b?"Regenerating...":"Regenerate"},"regenerate")],children:m?(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Regenerated Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons, ",(0,c.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,c.jsxs)(f.Z,{numColSpan:1,children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"Key Alias:"}),(0,c.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,c.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,c.jsx)(w.Z,{className:"mt-3",children:"New API Key:"}),(0,c.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,c.jsx)("pre",{className:"break-words whitespace-normal",children:m})}),(0,c.jsx)(S.CopyToClipboard,{text:m,onCopy:()=>P.ZP.success("API Key copied to clipboard"),children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,c.jsxs)(I.Z,{form:o,layout:"vertical",onValuesChange:e=>{"duration"in e&&h(s=>({...s,duration:e.duration}))},children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,c.jsx)(y.Z,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),p&&(0,c.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",p]})]})})}var e9=t(79814),se=function(e){let{vectorStores:s,accessToken:t}=e,[l,a]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,g.vectorStoreListCall)(t);e.data&&a(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,s.length]);let r=e=>{let s=l.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(e9.Z,{className:"h-4 w-4 text-blue-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,c.jsx)(eJ.Z,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:r(e)},s))}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(e9.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},ss=t(25327),st=function(e){let{mcpServers:s,mcpAccessGroups:l=[],accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(a&&s.length>0)try{let e=await (0,g.fetchMCPServers)(a);e&&Array.isArray(e)?i(e):e.data&&Array.isArray(e.data)&&i(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[a,s.length]),(0,d.useEffect)(()=>{(async()=>{if(a&&l.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(a));o(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[a,l.length]);let m=e=>{let s=r.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}return e},u=e=>e,x=[...s.map(e=>({type:"server",value:e})),...l.map(e=>({type:"accessGroup",value:e}))],h=x.length;return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(ss.Z,{className:"h-4 w-4 text-gray-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,c.jsx)(eJ.Z,{color:"gray",size:"xs",children:h})]}),h>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:x.map((e,s)=>"server"===e.type?(0,c.jsx)(z.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium cursor-help",children:m(e.value)})},s):(0,c.jsxs)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium",children:[(0,c.jsx)("span",{className:"inline-block w-2 h-2 bg-green-500 rounded-full mr-2"}),u(e.value)," ",(0,c.jsx)("span",{className:"ml-1 text-xs text-green-500",children:"(Access Group)"})]},s))}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(ss.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},sl=function(e){let{objectPermission:s,variant:t="card",className:l="",accessToken:a}=e,r=(null==s?void 0:s.vector_stores)||[],i=(null==s?void 0:s.mcp_servers)||[],n=(null==s?void 0:s.mcp_access_groups)||[],o=(0,c.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,c.jsx)(se,{vectorStores:r,accessToken:a}),(0,c.jsx)(st,{mcpServers:i,mcpAccessGroups:n,accessToken:a})]});return"card"===t?(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,c.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),o]}):(0,c.jsxs)("div",{className:"".concat(l),children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),o]})},sa=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:l="card",className:a=""}=e,r=e=>{var s;return(null===(s=Object.entries(es).find(s=>{let[t,l]=s;return l===e}))||void 0===s?void 0:s[0])||e},i=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},n=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},o=(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(Q.Z,{className:"h-4 w-4 text-blue-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,c.jsx)(eJ.Z,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,c.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let l=r(e.callback_name),a=null===(t=ei[l])||void 0===t?void 0:t.logo;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[a?(0,c.jsx)("img",{src:a,alt:l,className:"w-5 h-5 object-contain"}):(0,c.jsx)(Q.Z,{className:"h-5 w-5 text-gray-400"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-blue-800",children:l}),(0,c.jsxs)(w.Z,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,c.jsx)(eJ.Z,{color:i(e.callback_type),size:"sm",children:n(e.callback_type)})]},s)})}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(Q.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)($.Z,{className:"h-4 w-4 text-red-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,c.jsx)(eJ.Z,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,c.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let l=et[e]||e,a=null===(t=ei[l])||void 0===t?void 0:t.logo;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[a?(0,c.jsx)("img",{src:a,alt:l,className:"w-5 h-5 object-contain"}):(0,c.jsx)($.Z,{className:"h-5 w-5 text-gray-400"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-red-800",children:l}),(0,c.jsx)(w.Z,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,c.jsx)(eJ.Z,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)($.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===l?(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(a),children:[(0,c.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),o]}):(0,c.jsxs)("div",{className:"".concat(a),children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),o]})},sr=t(30401),si=t(78867);function sn(e){var s,t,l,a;let{keyId:r,onClose:i,keyData:n,accessToken:o,userID:m,userRole:u,teams:x,onKeyDataUpdate:h,onDelete:p,premiumUser:j,setAccessToken:f}=e,[y,b]=(0,d.useState)(!1),[N]=I.Z.useForm(),[Z,S]=(0,d.useState)(!1),[C,A]=(0,d.useState)(!1),[E,L]=(0,d.useState)({}),[O,M]=(0,d.useState)(n),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)(!1);if((0,d.useEffect)(()=>{n&&M(n)},[n]),(0,d.useEffect)(()=>{if(R){let e=setTimeout(()=>{q(!1)},5e3);return()=>clearTimeout(e)}},[R]),!O)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:i,className:"mb-4",children:"Back to Keys"}),(0,c.jsx)(w.Z,{children:"Key not found"})]});let U=async e=>{try{var s,t,l,a;if(!o)return;let r=e.token;if(e.key=r,void 0!==e.vector_stores&&(e.object_permission={...O.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...O.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},delete e.mcp_servers_and_groups}if(e.metadata&&"string"==typeof e.metadata)try{let l=JSON.parse(e.metadata);e.metadata={...l,...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:ea(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),P.ZP.error("Invalid metadata JSON");return}else e.metadata={...e.metadata||{},...(null===(l=e.guardrails)||void 0===l?void 0:l.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(a=e.disabled_callbacks)||void 0===a?void 0:a.length)>0?{litellm_disabled_callbacks:ea(e.disabled_callbacks)}:{}};delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let i=await (0,g.keyUpdateCall)(o,e);M(e=>e?{...e,...i}:void 0),h&&h(i),P.ZP.success("Key updated successfully"),b(!1)}catch(e){P.ZP.error("Failed to update key"),console.error("Error updating key:",e)}},V=async()=>{try{if(!o)return;await (0,g.keyDeleteCall)(o,O.token||O.token_id),P.ZP.success("Key deleted successfully"),p&&p(),i()}catch(e){console.error("Error deleting the key:",e),P.ZP.error("Failed to delete key")}},K=async(e,s)=>{await eF(e)&&(L(e=>({...e,[s]:!0})),setTimeout(()=>{L(e=>({...e,[s]:!1}))},2e3))},B=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),l=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(l)};return(0,c.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:i,className:"mb-4",children:"Back to Keys"}),(0,c.jsx)(k.Z,{children:O.key_alias||"API Key"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono text-sm",children:O.token_id||O.token})]}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:E["key-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>K(O.token_id||O.token,"key-id"),className:"ml-2 transition-all duration-200".concat(E["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,c.jsx)(w.Z,{className:"text-sm text-gray-500",children:O.updated_at&&O.updated_at!==O.created_at?"Updated: ".concat(B(O.updated_at)):"Created: ".concat(B(O.created_at))}),R&&(0,c.jsx)(eJ.Z,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),D&&(0,c.jsx)(eJ.Z,{color:"blue",size:"xs",children:"Regenerated"})]})]}),u&&eE.LQ.includes(u)&&(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(z.Z,{title:j?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,c.jsx)("span",{className:"inline-block",children:(0,c.jsx)(_.Z,{icon:e1.Z,variant:"secondary",onClick:()=>A(!0),className:"flex items-center",disabled:!j,children:"Regenerate Key"})})}),(0,c.jsx)(_.Z,{icon:ee.Z,variant:"secondary",onClick:()=>S(!0),className:"flex items-center",children:"Delete Key"})]})]}),(0,c.jsx)(e7,{selectedToken:O,visible:C,onClose:()=>A(!1),accessToken:o,premiumUser:j,setAccessToken:f,onKeyUpdate:e=>{M(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),F(new Date),q(!0),h&&h({...e,created_at:new Date().toLocaleString()})}}),Z&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:V,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>S(!1),children:"Cancel"})]})]})]})}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"}),(0,c.jsx)(eY.Z,{children:"Settings"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Spend"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eD(O.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null!==O.max_budget?"$".concat(eD(O.max_budget)):"Unlimited"]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",null!==O.tpm_limit?O.tpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",null!==O.rpm_limit?O.rpm_limit:"Unlimited"]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:O.models&&O.models.length>0?O.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s)):(0,c.jsx)(w.Z,{children:"No models specified"})})]}),(0,c.jsx)(W.Z,{children:(0,c.jsx)(sl,{objectPermission:O.object_permission,variant:"inline",accessToken:o})}),(0,c.jsx)(sa,{loggingConfigs:e6(O.metadata),disabledCallbacks:Array.isArray(null===(s=O.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?el(O.metadata.litellm_disabled_callbacks):[],variant:"card"})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Key Settings"}),!y&&u&&eE.LQ.includes(u)&&(0,c.jsx)(_.Z,{variant:"light",onClick:()=>b(!0),children:"Edit Settings"})]}),y?(0,c.jsx)(e8,{keyData:O,onCancel:()=>b(!1),onSubmit:U,teams:x,accessToken:o,userID:m,userRole:u}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Key ID"}),(0,c.jsx)(w.Z,{className:"font-mono",children:O.token_id||O.token})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Key Alias"}),(0,c.jsx)(w.Z,{children:O.key_alias||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Secret Key"}),(0,c.jsx)(w.Z,{className:"font-mono",children:O.key_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)(w.Z,{children:O.team_id||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization"}),(0,c.jsx)(w.Z,{children:O.organization_id||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:B(O.created_at)})]}),D&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Regenerated"}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:B(D)}),(0,c.jsx)(eJ.Z,{color:"green",size:"xs",children:"Recent"})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Expires"}),(0,c.jsx)(w.Z,{children:O.expires?B(O.expires):"Never"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Spend"}),(0,c.jsxs)(w.Z,{children:["$",eD(O.spend,4)," USD"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Budget"}),(0,c.jsx)(w.Z,{children:null!==O.max_budget?"$".concat(eD(O.max_budget,2)):"Unlimited"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:O.models&&O.models.length>0?O.models.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,c.jsx)(w.Z,{children:"No models specified"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)(w.Z,{children:["TPM: ",null!==O.tpm_limit?O.tpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",null!==O.rpm_limit?O.rpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Max Parallel Requests:"," ",null!==O.max_parallel_requests?O.max_parallel_requests:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Model TPM Limits:"," ",(null===(t=O.metadata)||void 0===t?void 0:t.model_tpm_limit)?JSON.stringify(O.metadata.model_tpm_limit):"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Model RPM Limits:"," ",(null===(l=O.metadata)||void 0===l?void 0:l.model_rpm_limit)?JSON.stringify(O.metadata.model_rpm_limit):"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:e3(O.metadata)})]}),(0,c.jsx)(sl,{objectPermission:O.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o}),(0,c.jsx)(sa,{loggingConfigs:e6(O.metadata),disabledCallbacks:Array.isArray(null===(a=O.metadata)||void 0===a?void 0:a.litellm_disabled_callbacks)?el(O.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}var so=t(2356),sc=e=>{let{options:s,onApplyFilters:t,onResetFilters:l,initialValues:a={},buttonLabel:r="Filters"}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(a),[u,x]=(0,d.useState)({}),[h,p]=(0,d.useState)({}),[g,j]=(0,d.useState)({}),f=(0,d.useCallback)(eA()(async(e,s)=>{if(s.isSearchable&&s.searchFn){p(e=>({...e,[s.name]:!0}));try{let t=await s.searchFn(e);x(e=>({...e,[s.name]:t}))}catch(e){console.error("Error searching:",e),x(e=>({...e,[s.name]:[]}))}finally{p(e=>({...e,[s.name]:!1}))}}},300),[]),v=(e,s)=>{let l={...o,[e]:s};m(l),t(l)};return(0,c.jsxs)("div",{className:"w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(so.Z,{className:"h-4 w-4"}),onClick:()=>n(!i),className:"flex items-center gap-2",children:r}),(0,c.jsx)(T.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),m(e),l()},children:"Reset Filters"})]}),i&&(0,c.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Key Hash","Model"].map(e=>{let t=s.find(s=>s.label===e||s.name===e);return t?(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsx)("label",{className:"text-sm text-gray-600",children:t.label||t.name}),t.isSearchable?(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(t.label||t.name,"..."),value:o[t.name]||void 0,onChange:e=>v(t.name,e),onSearch:e=>{j(s=>({...s,[t.name]:e})),t.searchFn&&f(e,t)},filterOption:!1,loading:h[t.name],options:u[t.name]||[],allowClear:!0}):t.options?(0,c.jsx)(C.default,{className:"w-full",placeholder:"Select ".concat(t.label||t.name,"..."),value:o[t.name]||void 0,onChange:e=>v(t.name,e),allowClear:!0,children:t.options.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))}):(0,c.jsx)(L.default,{className:"w-full",placeholder:"Enter ".concat(t.label||t.name,"..."),value:o[t.name]||"",onChange:e=>v(t.name,e.target.value),allowClear:!0})]},t.name):null})})]})},sd=t(16593);let sm=async e=>{if(!e)return[];try{let s=[],t=1,l=!0;for(;l;){let a=await (0,g.keyListCall)(e,null,"",null,null,null,t,100),r=a.keys.map(e=>e.key_alias).filter(Boolean);s=[...s,...r],t<a.total_pages?t++:l=!1}return Array.from(new Set(s))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},su=async(e,s)=>{if(!e)return[];try{let t=[],l=1,a=!0;for(;a;){let r=await (0,g.teamListCall)(e,s||null,null);t=[...t,...r],l<r.total_pages?l++:a=!1}return t}catch(e){return console.error("Error fetching all teams:",e),[]}},sx=async e=>{if(!e)return[];try{let s=[],t=1,l=!0;for(;l;){let a=await (0,g.organizationListCall)(e);s=[...s,...a],t<a.total_pages?t++:l=!1}return s}catch(e){return console.error("Error fetching all organizations:",e),[]}},sh=()=>{let[e,s]=(0,d.useState)("http://localhost:4000");return(0,d.useEffect)(()=>{{let{protocol:e,host:t}=window.location;s("".concat(e,"//").concat(t))}},[]),e};var sp=t(71594),sg=t(24525),sj=t(47323),sf=t(21626),sv=t(97214),s_=t(28241),sy=t(58834),sb=t(69552),sN=t(71876),sZ=t(86462),sw=t(47686),sk=t(44633),sS=t(49084);function sC(e){let{keys:s,setKeys:t,isLoading:l=!1,pagination:a,onPageChange:r,pageSize:i=50,teams:n,selectedTeam:o,setSelectedTeam:m,selectedKeyAlias:u,setSelectedKeyAlias:x,accessToken:h,userID:p,userRole:j,organizations:f,setCurrentOrg:v,refresh:y,onSortChange:b,currentSort:N,premiumUser:Z,setAccessToken:k}=e,[S,C]=(0,d.useState)(null),[I,P]=(0,d.useState)([]),[A,E]=d.useState(()=>N?[{id:N.sortBy,desc:"desc"===N.sortOrder}]:[{id:"created_at",desc:!0}]),[T,L]=(0,d.useState)({}),{filters:O,filteredKeys:M,allKeyAliases:D,allTeams:R,allOrganizations:q,handleFilterChange:U,handleFilterReset:V}=function(e){let{keys:s,teams:t,organizations:l,accessToken:a}=e,r={"Team ID":"","Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"},[i,n]=(0,d.useState)(r),[o,c]=(0,d.useState)(t||[]),[m,u]=(0,d.useState)(l||[]),[x,h]=(0,d.useState)(s),p=(0,d.useRef)(0),j=(0,d.useCallback)(eA()(async e=>{if(!a)return;let s=Date.now();p.current=s;try{let t=await (0,g.keyListCall)(a,e["Organization ID"]||null,e["Team ID"]||null,e["Key Alias"]||null,e["User ID"]||null,e["Key Hash"]||null,1,25,e["Sort By"]||null,e["Sort Order"]||null);s===p.current&&t&&(h(t.keys),console.log("called from debouncedSearch filters:",JSON.stringify(e)),console.log("called from debouncedSearch data:",JSON.stringify(t)))}catch(e){console.error("Error searching users:",e)}},300),[a]);(0,d.useEffect)(()=>{if(!s){h([]);return}let e=[...s];i["Team ID"]&&(e=e.filter(e=>e.team_id===i["Team ID"])),i["Organization ID"]&&(e=e.filter(e=>e.organization_id===i["Organization ID"])),h(e)},[s,i]),(0,d.useEffect)(()=>{let e=async()=>{let e=await su(a);e.length>0&&c(e);let s=await sx(a);s.length>0&&u(s)};a&&e()},[a]);let f=(0,sd.a)({queryKey:["allKeys"],queryFn:async()=>{if(!a)throw Error("Access token required");return await sm(a)},enabled:!!a}).data||[];return(0,d.useEffect)(()=>{t&&t.length>0&&c(e=>e.length<t.length?t:e)},[t]),(0,d.useEffect)(()=>{l&&l.length>0&&u(e=>e.length<l.length?l:e)},[l]),{filters:i,filteredKeys:x,allKeyAliases:f,allTeams:o,allOrganizations:m,handleFilterChange:e=>{n({"Team ID":e["Team ID"]||"","Organization ID":e["Organization ID"]||"","Key Alias":e["Key Alias"]||"","User ID":e["User ID"]||"","Sort By":e["Sort By"]||"created_at","Sort Order":e["Sort Order"]||"desc"}),j({...i,...e})},handleFilterReset:()=>{n(r),j(r)}}}({keys:s,teams:n,organizations:f,accessToken:h});(0,d.useEffect)(()=>{if(h){let e=s.map(e=>e.user_id).filter(e=>null!==e);(async()=>{P((await (0,g.userListCall)(h,e,1,100)).users)})()}},[h,s]),(0,d.useEffect)(()=>{if(y){let e=()=>{y()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},[y]);let K=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return s.getCanExpand()?(0,c.jsx)("button",{onClick:s.getToggleExpandedHandler(),style:{cursor:"pointer"},children:s.getIsExpanded()?"▼":"▶"}):null}},{id:"token",accessorKey:"token",header:"Key ID",cell:e=>(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.getValue(),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>C(e.getValue()),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",cell:e=>{let s=e.getValue();return(0,c.jsx)(z.Z,{title:s,children:s?s.length>20?"".concat(s.slice(0,20),"..."):s:"-"})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",cell:e=>(0,c.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"team_alias",accessorKey:"team_id",header:"Team Alias",cell:e=>{let{row:s,getValue:t}=e,l=t(),a=null==n?void 0:n.find(e=>e.team_id===l);return(null==a?void 0:a.team_alias)||"Unknown"}},{id:"team_id",accessorKey:"team_id",header:"Team ID",cell:e=>(0,c.jsx)(z.Z,{title:e.getValue(),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user_id",header:"User Email",cell:e=>{let s=e.getValue(),t=I.find(e=>e.user_id===s);return(null==t?void 0:t.user_email)?(0,c.jsx)(z.Z,{title:null==t?void 0:t.user_email,children:(0,c.jsxs)("span",{children:[null==t?void 0:t.user_email.slice(0,20),"..."]})}):"-"}},{id:"user_id",accessorKey:"user_id",header:"User ID",cell:e=>{let s=e.getValue();return s&&s.length>15?(0,c.jsx)(z.Z,{title:s,children:(0,c.jsxs)("span",{children:[s.slice(0,7),"..."]})}):s||"-"}},{id:"created_at",accessorKey:"created_at",header:"Created At",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",cell:e=>{let s=e.getValue();return s&&s.length>15?(0,c.jsx)(z.Z,{title:s,children:(0,c.jsxs)("span",{children:[s.slice(0,7),"..."]})}):s}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"Never"}},{id:"expires",accessorKey:"expires",header:"Expires",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",cell:e=>eD(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",cell:e=>{let s=e.getValue();return null===s?"Unlimited":"$".concat(eD(s))}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",cell:e=>{let s=e.getValue();return(0,c.jsx)("div",{className:"flex flex-col py-2",children:Array.isArray(s)?(0,c.jsx)("div",{className:"flex flex-col",children:0===s.length?(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[s.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sj.Z,{icon:T[e.row.id]?sZ.Z:sw.Z,className:"cursor-pointer",size:"xs",onClick:()=>{L(s=>({...s,[e.row.id]:!s[e.row.id]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),s.length>3&&!T[e.row.id]&&(0,c.jsx)(eJ.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",s.length-3," ",s.length-3==1?"more model":"more models"]})}),T[e.row.id]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:s.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:["TPM: ",null!==t.tpm_limit?t.tpm_limit:"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",null!==t.rpm_limit?t.rpm_limit:"Unlimited"]})]})}}];console.log("keys: ".concat(JSON.stringify(s)));let B=(0,sp.b7)({data:M,columns:K.filter(e=>"expander"!==e.id),state:{sorting:A},onSortingChange:e=>{let s="function"==typeof e?e(A):e;if(console.log("newSorting: ".concat(JSON.stringify(s))),E(s),s&&s.length>0){let e=s[0],t=e.id,l=e.desc?"desc":"asc";console.log("sortBy: ".concat(t,", sortOrder: ").concat(l)),U({...O,"Sort By":t,"Sort Order":l}),null==b||b(t,l)}},getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0,manualSorting:!1});return d.useEffect(()=>{N&&E([{id:N.sortBy,desc:"desc"===N.sortOrder}])},[N]),(0,c.jsx)("div",{className:"w-full h-full overflow-hidden",children:S?(0,c.jsx)(sn,{keyId:S,onClose:()=>C(null),keyData:M.find(e=>e.token===S),onKeyDataUpdate:e=>{t(s=>s.map(s=>s.token===e.token?eM(s,e):s)),y&&y()},onDelete:()=>{t(e=>e.filter(e=>e.token!==S)),y&&y()},accessToken:h,userID:p,userRole:j,teams:R,premiumUser:Z,setAccessToken:k}):(0,c.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,c.jsx)("div",{className:"w-full mb-6",children:(0,c.jsx)(sc,{options:[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>R&&0!==R.length?R.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Organization ID",label:"Organization ID",isSearchable:!0,searchFn:async e=>q&&0!==q.length?q.filter(s=>{var t,l;return null!==(l=null===(t=s.organization_id)||void 0===t?void 0:t.toLowerCase().includes(e.toLowerCase()))&&void 0!==l&&l}).filter(e=>null!==e.organization_id&&void 0!==e.organization_id).map(e=>({label:"".concat(e.organization_id||"Unknown"," (").concat(e.organization_id,")"),value:e.organization_id})):[]},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>D.filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))},{name:"User ID",label:"User ID",isSearchable:!1},{name:"Key Hash",label:"Key Hash",isSearchable:!1}],onApplyFilters:U,initialValues:O,onResetFilters:V})}),(0,c.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[(0,c.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",l?"...":"".concat((a.currentPage-1)*i+1," - ").concat(Math.min(a.currentPage*i,a.totalCount))," of ",l?"...":a.totalCount," results"]}),(0,c.jsxs)("div",{className:"inline-flex items-center gap-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",l?"...":a.currentPage," of ",l?"...":a.totalPages]}),(0,c.jsx)("button",{onClick:()=>r(a.currentPage-1),disabled:l||1===a.currentPage,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>r(a.currentPage+1),disabled:l||a.currentPage===a.totalPages,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,c.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sf.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sy.Z,{children:B.getHeaderGroups().map(e=>(0,c.jsx)(sN.Z,{children:e.headers.map(e=>(0,c.jsx)(sb.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(sv.Z,{children:l?(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:K.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"\uD83D\uDE85 Loading keys..."})})})}):M.length>0?B.getRowModel().rows.map(e=>(0,c.jsx)(sN.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(s_.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("models"===e.column.id&&e.getValue().length>3?"px-0":""),children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:K.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No keys found"})})})})})]})})})})]})})}var sI=e=>{let{userID:s,userRole:t,accessToken:l,selectedTeam:a,setSelectedTeam:r,data:i,setData:n,teams:o,premiumUser:m,currentOrg:u,organizations:x,setCurrentOrg:h,selectedKeyAlias:p,setSelectedKeyAlias:j,createClicked:b,setAccessToken:N}=e,[Z,C]=(0,d.useState)(!1),[E,T]=(0,d.useState)(!1),[L,O]=(0,d.useState)(null),[M,F]=(0,d.useState)(null),[R,U]=(0,d.useState)(null),[z,V]=(0,d.useState)((null==a?void 0:a.team_id)||"");(0,d.useEffect)(()=>{V((null==a?void 0:a.team_id)||"")},[a]);let{keys:K,isLoading:B,error:G,pagination:H,refresh:J,setKeys:Y}=eG({selectedTeam:a||void 0,currentOrg:u,selectedKeyAlias:p,accessToken:l||"",createClicked:b}),[W,$]=(0,d.useState)(!1),[Q,X]=(0,d.useState)(!1),[ee,es]=(0,d.useState)(null),[et,el]=(0,d.useState)([]),ea=new Set,[er,ei]=(0,d.useState)(!1),[en,eo]=(0,d.useState)(!1),[ec,ed]=(0,d.useState)(null),[em,eu]=(0,d.useState)(null),[ex]=I.Z.useForm(),[eh,ep]=(0,d.useState)(null),[eg,ej]=(0,d.useState)(ea),[ef,ev]=(0,d.useState)([]);(0,d.useEffect)(()=>{console.log("in calculateNewExpiryTime for selectedToken",ee),(null==em?void 0:em.duration)?ep((e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,eB.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,eB.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,eB.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}catch(e){return null}})(em.duration)):ep(null),console.log("calculateNewExpiryTime:",eh)},[ee,null==em?void 0:em.duration]),(0,d.useEffect)(()=>{(async()=>{try{if(null===s||null===t||null===l)return;let e=await D(s,t,l);e&&el(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,s,t]),(0,d.useEffect)(()=>{if(o){let e=new Set;o.forEach((s,t)=>{let l=s.team_id;e.add(l)}),ej(e)}},[o]);let e_=async()=>{if(null!=L&&null!=i){try{if(!l)return;await (0,g.keyDeleteCall)(l,L);let e=i.filter(e=>e.token!==L);n(e)}catch(e){console.error("Error deleting the key:",e)}T(!1),O(null)}},ey=(e,s)=>{eu(t=>({...t,[e]:s}))},eb=async()=>{if(!m){P.ZP.error("Regenerate API Key is an Enterprise feature. Please upgrade to use this feature.");return}if(null!=ee)try{let e=await ex.validateFields();if(!l)return;let s=await (0,g.regenerateKeyCall)(l,ee.token||ee.token_id,e);if(ed(s.key),i){let t=i.map(t=>t.token===(null==ee?void 0:ee.token)?{...t,key_name:s.key_name,...e}:t);n(t)}eo(!1),ex.resetFields(),P.ZP.success("API Key regenerated successfully")}catch(e){console.error("Error regenerating key:",e),P.ZP.error("Failed to regenerate API Key")}};return(0,c.jsxs)("div",{children:[(0,c.jsx)(sC,{keys:K,setKeys:Y,isLoading:B,pagination:H,onPageChange:e=>{J({page:e})},pageSize:100,teams:o,selectedTeam:a,setSelectedTeam:r,accessToken:l,userID:s,userRole:t,organizations:x,setCurrentOrg:h,refresh:J,selectedKeyAlias:p,setSelectedKeyAlias:j,premiumUser:m,setAccessToken:N}),E&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key ?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:e_,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{T(!1),O(null)},children:"Cancel"})]})]})]})}),(0,c.jsx)(A.Z,{title:"Regenerate API Key",visible:en,onCancel:()=>{eo(!1),ex.resetFields()},footer:[(0,c.jsx)(_.Z,{onClick:()=>{eo(!1),ex.resetFields()},className:"mr-2",children:"Cancel"},"cancel"),(0,c.jsx)(_.Z,{onClick:eb,disabled:!m,children:m?"Regenerate":"Upgrade to Regenerate"},"regenerate")],children:m?(0,c.jsxs)(I.Z,{form:ex,layout:"vertical",onValuesChange:(e,s)=>{"duration"in e&&ey("duration",e.duration)},children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,c.jsx)(y.Z,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry:"," ",(null==ee?void 0:ee.expires)!=null?new Date(ee.expires).toLocaleString():"Never"]}),eh&&(0,c.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",eh]})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,c.jsx)(_.Z,{variant:"primary",className:"mb-2",children:(0,c.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",children:"Get Free Trial"})})]})}),ec&&(0,c.jsx)(A.Z,{visible:!!ec,onCancel:()=>ed(null),footer:[(0,c.jsx)(_.Z,{onClick:()=>ed(null),children:"Close"},"close")],children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Regenerated Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons, ",(0,c.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,c.jsxs)(f.Z,{numColSpan:1,children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"Key Alias:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:(null==ee?void 0:ee.key_alias)||"No alias set"})}),(0,c.jsx)(w.Z,{className:"mt-3",children:"New API Key:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:ec})}),(0,c.jsx)(S.CopyToClipboard,{text:ec,onCopy:()=>P.ZP.success("API Key copied to clipboard"),children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]})]})})]})},sP=t(12011),sA=t(3914),sE=e=>{let{userID:s,userRole:t,teams:l,keys:a,setUserRole:r,userEmail:i,setUserEmail:n,setTeams:o,setKeys:x,premiumUser:h,organizations:p,addKey:_,createClicked:y}=e,[b,N]=(0,d.useState)(null),[Z,w]=(0,d.useState)(null),k=(0,m.useSearchParams)(),S=function(e){console.log("COOKIES",document.cookie);let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));return s?s.split("=")[1]:null}("token"),C=k.get("invitation_id"),[I,P]=(0,d.useState)(null),[A,E]=(0,d.useState)(null),[T,L]=(0,d.useState)([]),[O,M]=(0,d.useState)(null),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)(null);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,d.useEffect)(()=>{if(S){let e=(0,u.o)(S);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),P(e.key),e.user_role){let s=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";case"internal_user":return"Internal User";case"internal_user_viewer":return"Internal Viewer";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",s),r(s)}else console.log("User role not defined");e.user_email?n(e.user_email):console.log("User Email is not set ".concat(e))}}if(s&&I&&t&&!a&&!b){let e=sessionStorage.getItem("userModels"+s);e?L(JSON.parse(e)):(console.log("currentOrg: ".concat(JSON.stringify(Z))),(async()=>{try{let e=await (0,g.getProxyUISettings)(I);M(e);let l=await (0,g.userInfoCall)(I,s,t,!1,null,null);N(l.user_info),console.log("userSpendData: ".concat(JSON.stringify(b))),(null==l?void 0:l.teams[0].keys)?x(l.keys.concat(l.teams.filter(e=>"Admin"===t||e.user_id===s).flatMap(e=>e.keys))):x(l.keys),sessionStorage.setItem("userData"+s,JSON.stringify(l.keys)),sessionStorage.setItem("userSpendData"+s,JSON.stringify(l.user_info));let a=(await (0,g.modelAvailableCall)(I,s,t)).data.map(e=>e.id);console.log("available_model_names:",a),L(a),console.log("userModels:",T),sessionStorage.setItem("userModels"+s,JSON.stringify(a))}catch(e){console.error("There was an error fetching the data",e),e.message.includes("Invalid proxy server token passed")&&U()}})(),j(I,s,t,Z,o))}},[s,S,I,a,t]),(0,d.useEffect)(()=>{I&&(async()=>{try{let e=await (0,g.keyInfoCall)(I,[I]);console.log("keyInfo: ",e)}catch(e){e.message.includes("Invalid proxy server token passed")&&U()}})()},[I]),(0,d.useEffect)(()=>{console.log("currentOrg: ".concat(JSON.stringify(Z),", accessToken: ").concat(I,", userID: ").concat(s,", userRole: ").concat(t)),I&&(console.log("fetching teams"),j(I,s,t,Z,o))},[Z]),(0,d.useEffect)(()=>{if(null!==a&&null!=D&&null!==D.team_id){let e=0;for(let s of(console.log("keys: ".concat(JSON.stringify(a))),a))D.hasOwnProperty("team_id")&&null!==s.team_id&&s.team_id===D.team_id&&(e+=s.spend);console.log("sum: ".concat(e)),E(e)}else if(null!==a){let e=0;for(let s of a)e+=s.spend;E(e)}},[D]),null!=C)return(0,c.jsx)(sP.default,{});function U(){(0,sA.b)();let e=(0,g.getProxyBaseUrl)();console.log("proxyBaseUrl:",e);let s=e?"".concat(e,"/sso/key/generate"):"/sso/key/generate";return console.log("Full URL:",s),window.location.href=s,null}if(null==S)return console.log("All cookies before redirect:",document.cookie),U(),null;try{let e=(0,u.o)(S);console.log("Decoded token:",e);let s=e.exp,t=Math.floor(Date.now()/1e3);if(s&&t>=s)return console.log("Token expired, redirecting to login"),U(),null}catch(e){return console.error("Error decoding token:",e),(0,sA.b)(),U(),null}if(null==I)return null;if(null==s)return(0,c.jsx)("h1",{children:"User ID is not set"});if(null==t&&r("App Owner"),t&&"Admin Viewer"==t){let{Title:e,Paragraph:s}=em.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",D),console.log("All cookies after redirect:",document.cookie),(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,c.jsx)(eK,{userID:s,team:D,teams:l,userRole:t,accessToken:I,data:a,addKey:_,premiumUser:h},D?D.team_id:null),(0,c.jsx)(sI,{userID:s,userRole:t,accessToken:I,selectedTeam:D||null,setSelectedTeam:F,selectedKeyAlias:R,setSelectedKeyAlias:q,data:a,setData:x,premiumUser:h,teams:l,currentOrg:Z,setCurrentOrg:w,organizations:p,createClicked:y,setAccessToken:P})]})})})},sT=t(97765),sL=t(42673);let sO=async(e,s,t)=>{try{console.log("handling submit for formValues:",e);let s=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,l=sL.fK[t]+"/*";e.model_name=l,s.push({public_name:l,litellm_model:l}),e.model=l}let t=[];for(let l of s){let s={},a={},r=l.public_name;for(let[t,r]of(s.model=l.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),s.model=l.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==r&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)s.model=r;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",r);let e=sL.fK[r];s.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)a[t]=r;else if("team_id"===t)a.team_id=r;else if("model_access_group"===t)a.access_groups=r;else if("mode"==t)console.log("placing mode in modelInfo"),a.mode=r,delete s.mode;else if("custom_model_name"===t)s.model=r;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw P.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,l]of Object.entries(e))s[t]=l}}else if("model_info_params"==t){console.log("model_info_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw P.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[s,t]of Object.entries(e))a[s]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){r&&(s[t]=Number(r));continue}else s[t]=r}t.push({litellmParamsObj:s,modelInfoObj:a,modelName:r})}return t}catch(e){P.ZP.error("Failed to create model: "+e,10)}},sM=async(e,s,t,l)=>{try{let a=await sO(e,s,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:l,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:l},i=await (0,g.modelCreateCall)(s,r);console.log("response for model create call: ".concat(i.data))}l&&l(),t.resetFields()}catch(e){P.ZP.error("Failed to add model: "+e,10)}};var sD=t(53410),sF=t(47451),sR=t(69410);let{Link:sq}=em.default,sU={[sL.Cl.OpenAI]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sL.Cl.OpenAI_Text]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sL.Cl.Vertex_AI]:[{key:"vertex_project",label:"Vertex Project",placeholder:"adroit-cadet-1234..",required:!0},{key:"vertex_location",label:"Vertex Location",placeholder:"us-east-1",required:!0},{key:"vertex_credentials",label:"Vertex Credentials",required:!0,type:"upload"}],[sL.Cl.AssemblyAI]:[{key:"api_base",label:"API Base",type:"select",required:!0,options:["https://api.assemblyai.com","https://api.eu.assemblyai.com"]},{key:"api_key",label:"AssemblyAI API Key",type:"password",required:!0}],[sL.Cl.Azure]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_version",label:"API Version",placeholder:"2023-07-01-preview",tooltip:"By default litellm will use the latest version. If you want to use a different version, you can specify it here"},{key:"base_model",label:"Base Model",placeholder:"azure/gpt-3.5-turbo"},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[sL.Cl.Azure_AI_Studio]:[{key:"api_base",label:"API Base",placeholder:"https://<test>.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",tooltip:"Enter your full Target URI from Azure Foundry here. Example: https://litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",required:!0},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[sL.Cl.OpenAI_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sL.Cl.OpenAI_Text_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sL.Cl.Bedrock]:[{key:"aws_access_key_id",label:"AWS Access Key ID",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_secret_access_key",label:"AWS Secret Access Key",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_region_name",label:"AWS Region Name",placeholder:"us-east-1",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."}],[sL.Cl.Ollama]:[{key:"api_base",label:"API Base",placeholder:"http://localhost:11434",defaultValue:"http://localhost:11434",required:!1,tooltip:"The base URL for your Ollama server. Defaults to http://localhost:11434 if not specified."}],[sL.Cl.Anthropic]:[{key:"api_key",label:"API Key",placeholder:"sk-",type:"password",required:!0}],[sL.Cl.Deepgram]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.ElevenLabs]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Google_AI_Studio]:[{key:"api_key",label:"API Key",placeholder:"aig-",type:"password",required:!0}],[sL.Cl.Groq]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.MistralAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Deepseek]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Cohere]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Databricks]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.xAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Cerebras]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Sambanova]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Perplexity]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.TogetherAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Openrouter]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.FireworksAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sL.Cl.Triton]:[{key:"api_key",label:"API Key",type:"password",required:!1},{key:"api_base",label:"API Base",placeholder:"http://localhost:8000/generate",required:!1}]};var sz=e=>{let{selectedProvider:s,uploadProps:t}=e,l=sL.Cl[s],a=I.Z.useFormInstance(),r=d.useMemo(()=>sU[l]||[],[l]),i={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let s=new FileReader;s.onload=e=>{if(e.target){let s=e.target.result;console.log("Setting field value from JSON, length: ".concat(s.length)),a.setFieldsValue({vertex_credentials:s}),console.log("Form values after setting:",a.getFieldsValue())}},s.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",a.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,c.jsx)(c.Fragment,{children:r.map(e=>{var s;return(0,c.jsxs)(d.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,c.jsx)(C.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(s=e.options)||void 0===s?void 0:s.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,c.jsx)(ex.default,{...i,onChange:s=>{(null==t?void 0:t.onChange)&&t.onChange(s),setTimeout(()=>{let s=a.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(s))},500)},children:(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(e_.Z,{}),children:"Click to Upload"})}):(0,c.jsx)(y.Z,{placeholder:e.placeholder,type:"password"===e.type?"password":"text"})}),"vertex_credentials"===e.key&&(0,c.jsx)(sF.Z,{children:(0,c.jsx)(sR.Z,{children:(0,c.jsx)(w.Z,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,c.jsxs)(sF.Z,{children:[(0,c.jsx)(sR.Z,{span:10}),(0,c.jsx)(sR.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,c.jsx)(sq,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})})};let{Title:sV,Link:sK}=em.default;var sB=e=>{let{isVisible:s,onCancel:t,onAddCredential:l,onUpdateCredential:a,uploadProps:r,addOrEdit:i,existingCredential:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(sL.Cl.OpenAI),[x,h]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{n&&(o.setFieldsValue({credential_name:n.credential_name,custom_llm_provider:n.credential_info.custom_llm_provider,api_base:n.credential_values.api_base,api_version:n.credential_values.api_version,base_model:n.credential_values.base_model,api_key:n.credential_values.api_key}),u(n.credential_info.custom_llm_provider))},[n]),(0,c.jsx)(A.Z,{title:"add"===i?"Add New Credential":"Edit Credential",visible:s,onCancel:()=>{t(),o.resetFields()},footer:null,width:600,children:(0,c.jsxs)(I.Z,{form:o,onFinish:e=>{let s=Object.entries(e).reduce((e,s)=>{let[t,l]=s;return""!==l&&null!=l&&(e[t]=l),e},{});"add"===i?l(s):a(s),o.resetFields()},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==n?void 0:n.credential_name,children:(0,c.jsx)(y.Z,{placeholder:"Enter a friendly name for these credentials",disabled:null!=n&&!!n.credential_name})}),(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,c.jsx)(C.default,{showSearch:!0,onChange:e=>{u(e),o.setFieldValue("custom_llm_provider",e)},children:Object.entries(sL.Cl).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sL.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(sz,{selectedProvider:m,uploadProps:r}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(sK,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:()=>{t(),o.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"add"===i?"Add Credential":"Update Credential"})]})]})]})})},sG=e=>{let{accessToken:s,uploadProps:t,credentialList:l,fetchCredentials:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(null),[x]=I.Z.useForm(),h=["credential_name","custom_llm_provider"],p=async e=>{if(!s)return;let t=Object.entries(e).filter(e=>{let[s]=e;return!h.includes(s)}).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:l}},{}),l={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,g.credentialUpdateCall)(s,e.credential_name,l),P.ZP.success("Credential updated successfully"),o(!1),a(s)},j=async e=>{if(!s)return;let t=Object.entries(e).filter(e=>{let[s]=e;return!h.includes(s)}).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:l}},{}),l={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,g.credentialCreateCall)(s,l),P.ZP.success("Credential added successfully"),i(!1),a(s)};(0,d.useEffect)(()=>{s&&a(s)},[s]);let f=e=>{let s={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=s[e.toLowerCase()]||s.default;return(0,c.jsx)(eJ.Z,{color:t,size:"xs",children:e})},v=async e=>{s&&(await (0,g.credentialDeleteCall)(s,e),P.ZP.success("Credential deleted successfully"),a(s))};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(w.Z,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,c.jsx)(W.Z,{children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Credential Name"}),(0,c.jsx)(sb.Z,{children:"Provider"}),(0,c.jsx)(sb.Z,{children:"Description"})]})}),(0,c.jsx)(sv.Z,{children:l&&0!==l.length?l.map((e,s)=>{var t,l;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.credential_name}),(0,c.jsx)(s_.Z,{children:f((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,c.jsx)(s_.Z,{children:(null===(l=e.credential_info)||void 0===l?void 0:l.description)||"-"}),(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(_.Z,{icon:sD.Z,variant:"light",size:"sm",onClick:()=>{u(e),o(!0)}}),(0,c.jsx)(_.Z,{icon:ee.Z,variant:"light",size:"sm",onClick:()=>v(e.credential_name)})]})]},s)}):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),(0,c.jsx)(_.Z,{onClick:()=>i(!0),className:"mt-4",children:"Add Credential"}),r&&(0,c.jsx)(sB,{onAddCredential:j,isVisible:r,onCancel:()=>i(!1),uploadProps:t,addOrEdit:"add",onUpdateCredential:p,existingCredential:null}),n&&(0,c.jsx)(sB,{onAddCredential:j,isVisible:n,existingCredential:m,onUpdateCredential:p,uploadProps:t,onCancel:()=>o(!1),addOrEdit:"edit"})]})};let sH=e=>{var s;return(null==e?void 0:null===(s=e.model_info)||void 0===s?void 0:s.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var sJ=t(53003),sY=e=>{let{value:s,onValueChange:t,label:l="Select Time Range",className:a="",showTimeRange:r=!0}=e;return(0,c.jsxs)("div",{className:a,children:[l&&(0,c.jsx)(w.Z,{className:"mb-2",children:l}),(0,c.jsx)(sJ.Z,{enableSelect:!0,value:s,onValueChange:e=>{if(e.from){let s;let l={...e},a=new Date(e.from);s=new Date(e.to?e.to:e.from),a.toDateString(),s.toDateString(),a.setHours(0,0,0,0),s.setHours(23,59,59,999),l.from=a,l.to=s,t(l)}else t(e)}}),r&&s.from&&s.to&&(0,c.jsx)(w.Z,{className:"mt-1 text-xs text-gray-500",children:((e,s)=>{if(!e||!s)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==s.toDateString())return"".concat(t(e)," - ").concat(t(s));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),l=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(l," - ").concat(a)}})(s.from,s.to)})]})},sW=t(75105),s$=t(40278),sQ=t(14301),sX=t(59664),s0=e=>{let{modelMetrics:s,modelMetricsCategories:t,customTooltip:l,premiumUser:a}=e;return(0,c.jsx)(sX.Z,{title:"Time to First token (s)",className:"h-72",data:s,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:l})},s1=e=>{let{teamData:s,canEditTeam:t,handleMemberDelete:l,setSelectedEditMember:a,setIsEditMemberModalVisible:r,setIsAddMemberModalVisible:i}=e,n=e=>{if(null==e)return"0";if("number"==typeof e){let s=Number(e);return s===Math.floor(s)?s.toString():eD(s,8).replace(/\.?0+$/,"")}return"0"},o=e=>{if(!e)return 0;let t=s.team_memberships.find(s=>s.user_id===e);return(null==t?void 0:t.spend)||0},d=e=>{var t;if(!e)return null;let l=s.team_memberships.find(s=>s.user_id===e);console.log("membership=".concat(l));let a=null==l?void 0:null===(t=l.litellm_budget_table)||void 0===t?void 0:t.max_budget;return null==a?null:n(a)};return(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(W.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"User ID"}),(0,c.jsx)(sb.Z,{children:"User Email"}),(0,c.jsx)(sb.Z,{children:"Role"}),(0,c.jsxs)(sb.Z,{children:["Team Member Spend (USD)"," ",(0,c.jsx)(z.Z,{title:"This is the amount spent by a user in the team.",children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(sb.Z,{children:"Team Member Budget (USD)"}),(0,c.jsx)(sb.Z,{})]})}),(0,c.jsx)(sv.Z,{children:s.team_info.members_with_roles.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_id})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.role})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{className:"font-mono",children:["$",eD(o(e.user_id),4)]})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:d(e.user_id)?"$".concat(eD(Number(d(e.user_id)),4)):"No Limit"})}),(0,c.jsx)(s_.Z,{children:t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{a(e),r(!0)}}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>l(e)})]})})]},s))})]})}),(0,c.jsx)(_.Z,{onClick:()=>i(!0),children:"Add Member"})]})},s2=t(61994),s4=t(85180),s5=t(89245),s6=t(78355);let s3={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team"},s8=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",s7=e=>{let s=s8(e),t=s3[e];if(!t){for(let[s,l]of Object.entries(s3))if(e.includes(s)){t=l;break}}return t||(t="Access ".concat(e)),{method:s,endpoint:e,description:t,route:e}};var s9=e=>{let{teamId:s,accessToken:t,canEditTeam:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)([]),[o,m]=(0,d.useState)(!0),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),j=async()=>{try{if(m(!0),!t)return;let e=await (0,g.getTeamPermissionsCall)(t,s),l=e.all_available_permissions||[];r(l);let a=e.team_member_permissions||[];n(a),p(!1)}catch(e){P.ZP.error("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{m(!1)}};(0,d.useEffect)(()=>{j()},[s,t]);let f=(e,s)=>{n(s?[...i,e]:i.filter(s=>s!==e)),p(!0)},v=async()=>{try{if(!t)return;x(!0),await (0,g.teamPermissionsUpdateCall)(t,s,i),P.ZP.success("Permissions updated successfully"),p(!1)}catch(e){P.ZP.error("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(o)return(0,c.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let y=a.length>0;return(0,c.jsxs)(W.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,c.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,c.jsx)(k.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),l&&h&&(0,c.jsxs)("div",{className:"flex gap-3",children:[(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(s5.Z,{}),onClick:()=>{j()},children:"Reset"}),(0,c.jsxs)(_.Z,{onClick:v,loading:u,className:"flex items-center gap-2",children:[(0,c.jsx)(s6.Z,{})," Save Changes"]})]})]}),(0,c.jsx)(w.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),y?(0,c.jsxs)(sf.Z,{className:"mt-4",children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Method"}),(0,c.jsx)(sb.Z,{children:"Endpoint"}),(0,c.jsx)(sb.Z,{children:"Description"}),(0,c.jsx)(sb.Z,{className:"text-right",children:"Access"})]})}),(0,c.jsx)(sv.Z,{children:a.map(e=>{let s=s7(e);return(0,c.jsxs)(sN.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===s.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:s.method})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)("span",{className:"font-mono text-sm text-gray-800",children:s.endpoint})}),(0,c.jsx)(s_.Z,{className:"text-gray-700",children:s.description}),(0,c.jsx)(s_.Z,{className:"text-right",children:(0,c.jsx)(s2.Z,{checked:i.includes(e),onChange:s=>f(e,s.target.checked),disabled:!l})})]},e)})})]}):(0,c.jsx)("div",{className:"py-12",children:(0,c.jsx)(s4.Z,{description:"No permissions available"})})]})},te=e=>{var s,t,l;let{visible:a,onCancel:r,onSubmit:i,initialData:n,mode:o,config:m}=e,[u]=I.Z.useForm();console.log("Initial Data:",n),(0,d.useEffect)(()=>{if(a){if("edit"===o&&n)u.setFieldsValue({...n,role:n.role||m.defaultRole});else{var e;u.resetFields(),u.setFieldsValue({role:m.defaultRole||(null===(e=m.roleOptions[0])||void 0===e?void 0:e.value)})}}},[a,n,o,u,m.defaultRole,m.roleOptions]);let x=async e=>{try{let s=Object.entries(e).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:"string"==typeof l?l.trim():l}},{});i(s),u.resetFields()}catch(e){console.error("Form submission error:",e)}},h=e=>{switch(e.type){case"input":return(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",onChange:e=>{e.target.value=e.target.value.trim()}});case"select":var s;return(0,c.jsx)(C.default,{children:null===(s=e.options)||void 0===s?void 0:s.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))});default:return null}};return(0,c.jsx)(A.Z,{title:m.title||("add"===o?"Add Member":"Edit Member"),open:a,width:800,footer:null,onCancel:r,children:(0,c.jsxs)(I.Z,{form:u,onFinish:x,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[m.showEmail&&(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",placeholder:"[email protected]",onChange:e=>{e.target.value=e.target.value.trim()}})}),m.showEmail&&m.showUserId&&(0,c.jsx)("div",{className:"text-center mb-4",children:(0,c.jsx)(w.Z,{children:"OR"})}),m.showUserId&&(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",placeholder:"user_123",onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{children:"Role"}),"edit"===o&&n&&(0,c.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(t=n.role,(null===(l=m.roleOptions.find(e=>e.value===t))||void 0===l?void 0:l.label)||t),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,c.jsx)(C.default,{children:"edit"===o&&n?[...m.roleOptions.filter(e=>e.value===n.role),...m.roleOptions.filter(e=>e.value!==n.role)].map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value)):m.roleOptions.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))})}),null===(s=m.additionalFields)||void 0===s?void 0:s.map(e=>(0,c.jsx)(I.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:h(e)},e.name)),(0,c.jsxs)("div",{className:"text-right mt-6",children:[(0,c.jsx)(T.ZP,{onClick:r,className:"mr-2",children:"Cancel"}),(0,c.jsx)(T.ZP,{type:"default",htmlType:"submit",children:"add"===o?"Add Member":"Save Changes"})]})]})})},ts=e=>{let{isVisible:s,onCancel:t,onSubmit:l,accessToken:a,title:r="Add Team Member",roles:i=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:n="user"}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)("user_email"),f=async(e,s)=>{if(!e){u([]);return}h(!0);try{let t=new URLSearchParams;if(t.append(s,e),null==a)return;let l=(await (0,g.userFilterUICall)(a,t)).map(e=>({label:"user_email"===s?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===s?e.user_email:e.user_id,user:e}));u(l)}catch(e){console.error("Error fetching users:",e)}finally{h(!1)}},v=(0,d.useCallback)(eA()((e,s)=>f(e,s),300),[]),_=(e,s)=>{j(s),v(e,s)},y=(e,s)=>{let t=s.user;o.setFieldsValue({user_email:t.user_email,user_id:t.user_id,role:o.getFieldValue("role")})};return(0,c.jsx)(A.Z,{title:r,open:s,onCancel:()=>{o.resetFields(),u([]),t()},footer:null,width:800,children:(0,c.jsxs)(I.Z,{form:o,onFinish:l,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:n},children:[(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>_(e,"user_email"),onSelect:(e,s)=>y(e,s),options:"user_email"===p?m:[],loading:x,allowClear:!0})}),(0,c.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>_(e,"user_id"),onSelect:(e,s)=>y(e,s),options:"user_id"===p?m:[],loading:x,allowClear:!0})}),(0,c.jsx)(I.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,c.jsx)(C.default,{defaultValue:n,children:i.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:(0,c.jsxs)(z.Z,{title:e.description,children:[(0,c.jsx)("span",{className:"font-medium",children:e.label}),(0,c.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,c.jsx)("div",{className:"text-right mt-4",children:(0,c.jsx)(T.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})},tt=e=>{var s,t,l,a,r,i,n,o,m,u,x;let{teamId:h,onClose:p,accessToken:j,is_team_admin:f,is_proxy_admin:b,userModels:N,editTeam:Z,premiumUser:S=!1,onUpdate:A}=e,[E,O]=(0,d.useState)(null),[D,R]=(0,d.useState)(!0),[q,V]=(0,d.useState)(!1),[K]=I.Z.useForm(),[B,G]=(0,d.useState)(!1),[J,Y]=(0,d.useState)(null),[$,Q]=(0,d.useState)(!1),[X,ee]=(0,d.useState)([]),[es,et]=(0,d.useState)(!1),[el,ea]=(0,d.useState)({}),[er,ei]=(0,d.useState)([]);console.log("userModels in team info",N);let en=f||b,eo=async()=>{try{if(R(!0),!j)return;let e=await (0,g.teamInfoCall)(j,h);O(e)}catch(e){P.ZP.error("Failed to load team information"),console.error("Error fetching team info:",e)}finally{R(!1)}};(0,d.useEffect)(()=>{eo()},[h,j]),(0,d.useEffect)(()=>{(async()=>{try{if(!j)return;let e=(await (0,g.getGuardrailsList)(j)).guardrails.map(e=>e.guardrail_name);ei(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[j]);let ec=async e=>{try{if(null==j)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.teamMemberAddCall)(j,h,s),P.ZP.success("Team member added successfully"),V(!1),K.resetFields();let t=await (0,g.teamInfoCall)(j,h);O(t),A(t)}catch(a){var s,t,l;let e="Failed to add team member";(null==a?void 0:null===(l=a.raw)||void 0===l?void 0:null===(t=l.detail)||void 0===t?void 0:null===(s=t.error)||void 0===s?void 0:s.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==a?void 0:a.message)&&(e=a.message),P.ZP.error(e),console.error("Error adding team member:",a)}},ed=async e=>{try{if(null==j)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};P.ZP.destroy(),await (0,g.teamMemberUpdateCall)(j,h,s),P.ZP.success("Team member updated successfully"),G(!1);let t=await (0,g.teamInfoCall)(j,h);O(t),A(t)}catch(l){var s,t;let e="Failed to update team member";(null==l?void 0:null===(t=l.raw)||void 0===t?void 0:null===(s=t.detail)||void 0===s?void 0:s.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==l?void 0:l.message)&&(e=l.message),G(!1),P.ZP.destroy(),P.ZP.error(e),console.error("Error updating team member:",l)}},em=async e=>{try{if(null==j)return;await (0,g.teamMemberDeleteCall)(j,h,e),P.ZP.success("Team member removed successfully");let s=await (0,g.teamInfoCall)(j,h);O(s),A(s)}catch(e){P.ZP.error("Failed to remove team member"),console.error("Error removing team member:",e)}},eu=async e=>{try{if(!j)return;let s={};try{s=e.metadata?JSON.parse(e.metadata):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={team_id:h,team_alias:e.team_alias,models:e.models,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...s,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};void 0!==e.team_member_budget&&(t.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(t.team_member_key_duration=e.team_member_key_duration);let{servers:l,accessGroups:a}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};(l&&l.length>0||a&&a.length>0)&&(t.object_permission={},l&&l.length>0&&(t.object_permission.mcp_servers=l),a&&a.length>0&&(t.object_permission.mcp_access_groups=a)),delete e.mcp_servers_and_groups,await (0,g.teamUpdateCall)(j,t),P.ZP.success("Team settings updated successfully"),Q(!1),eo()}catch(e){console.error("Error updating team:",e)}};if(D)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==E?void 0:E.team_info))return(0,c.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:ex}=E,eh=async(e,s)=>{await eF(e)&&(ea(e=>({...e,[s]:!0})),setTimeout(()=>{ea(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:p,className:"mb-4",children:"Back to Teams"}),(0,c.jsx)(k.Z,{children:ex.team_alias}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:ex.team_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:el["team-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>eh(ex.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(el["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:Z?3:0,children:[(0,c.jsx)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"},"overview"),...en?[(0,c.jsx)(eY.Z,{children:"Members"},"members"),(0,c.jsx)(eY.Z,{children:"Member Permissions"},"member-permissions"),(0,c.jsx)(eY.Z,{children:"Settings"},"settings")]:[]]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Budget Status"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eD(ex.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null===ex.max_budget?"Unlimited":"$".concat(eD(ex.max_budget,4))]}),ex.budget_duration&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Reset: ",ex.budget_duration]}),(0,c.jsx)("br",{}),ex.team_member_budget_table&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Team Member Budget: $",eD(ex.team_member_budget_table.max_budget,4)]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",ex.tpm_limit||"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",ex.rpm_limit||"Unlimited"]}),ex.max_parallel_requests&&(0,c.jsxs)(w.Z,{children:["Max Parallel Requests: ",ex.max_parallel_requests]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===ex.models.length?(0,c.jsx)(eJ.Z,{color:"red",children:"All proxy models"}):ex.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["User Keys: ",E.keys.filter(e=>e.user_id).length]}),(0,c.jsxs)(w.Z,{children:["Service Account Keys: ",E.keys.filter(e=>!e.user_id).length]}),(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Total: ",E.keys.length]})]})]}),(0,c.jsx)(sl,{objectPermission:ex.object_permission,variant:"card",accessToken:j}),(0,c.jsx)(sa,{loggingConfigs:(null===(s=ex.metadata)||void 0===s?void 0:s.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(s1,{teamData:E,canEditTeam:en,handleMemberDelete:em,setSelectedEditMember:Y,setIsEditMemberModalVisible:G,setIsAddMemberModalVisible:V})}),en&&(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(s9,{teamId:h,accessToken:j,canEditTeam:en})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Team Settings"}),en&&!$&&(0,c.jsx)(_.Z,{onClick:()=>Q(!0),children:"Edit Settings"})]}),$?(0,c.jsxs)(I.Z,{form:K,onFinish:eu,initialValues:{...ex,team_alias:ex.team_alias,models:ex.models,tpm_limit:ex.tpm_limit,rpm_limit:ex.rpm_limit,max_budget:ex.max_budget,budget_duration:ex.budget_duration,guardrails:(null===(t=ex.metadata)||void 0===t?void 0:t.guardrails)||[],metadata:ex.metadata?JSON.stringify((e=>{let{logging:s,...t}=e;return t})(ex.metadata),null,2):"",logging_settings:(null===(l=ex.metadata)||void 0===l?void 0:l.logging)||[],organization_id:ex.organization_id,vector_stores:(null===(a=ex.object_permission)||void 0===a?void 0:a.vector_stores)||[],mcp_servers:(null===(r=ex.object_permission)||void 0===r?void 0:r.mcp_servers)||[],mcp_access_groups:(null===(i=ex.object_permission)||void 0===i?void 0:i.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(n=ex.object_permission)||void 0===n?void 0:n.mcp_servers)||[],accessGroups:(null===(o=ex.object_permission)||void 0===o?void 0:o.mcp_access_groups)||[]}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,c.jsx)(L.default,{type:""})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Array.from(new Set(N)).map((e,s)=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},s))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Setup your first guardrail",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",placeholder:"Select or enter guardrails",options:er.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>K.setFieldValue("vector_stores",e),value:K.getFieldValue("vector_stores"),accessToken:j||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(eR,{onChange:e=>K.setFieldValue("mcp_servers_and_groups",e),value:K.getFieldValue("mcp_servers_and_groups"),accessToken:j||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,c.jsx)(L.default,{type:""})}),(0,c.jsx)(I.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,c.jsx)(e2,{value:K.getFieldValue("logging_settings"),onChange:e=>K.setFieldValue("logging_settings",e)})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:10})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{htmlType:"button",onClick:()=>Q(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team Name"}),(0,c.jsx)("div",{children:ex.team_alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)("div",{className:"font-mono",children:ex.team_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:new Date(ex.created_at).toLocaleString()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:ex.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)("div",{children:["TPM: ",ex.tpm_limit||"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",ex.rpm_limit||"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team Budget"}),(0,c.jsxs)("div",{children:["Max Budget:"," ",null!==ex.max_budget?"$".concat(eD(ex.max_budget,4)):"No Limit"]}),(0,c.jsxs)("div",{children:["Budget Reset: ",ex.budget_duration||"Never"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Team Member Settings"," ",(0,c.jsx)(z.Z,{title:"These are limits on individual team members",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),(0,c.jsxs)("div",{children:["Max Budget:"," ",(null===(m=ex.team_member_budget_table)||void 0===m?void 0:m.max_budget)||"No Limit"]}),(0,c.jsxs)("div",{children:["Key Duration:"," ",(null===(u=ex.metadata)||void 0===u?void 0:u.team_member_key_duration)||"No Limit"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization ID"}),(0,c.jsx)("div",{children:ex.organization_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Status"}),(0,c.jsx)(eJ.Z,{color:ex.blocked?"red":"green",children:ex.blocked?"Blocked":"Active"})]}),(0,c.jsx)(sl,{objectPermission:ex.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:j}),(0,c.jsx)(sa,{loggingConfigs:(null===(x=ex.metadata)||void 0===x?void 0:x.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,c.jsx)(te,{visible:B,onCancel:()=>G(!1),onSubmit:ed,initialData:J,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}]}}),(0,c.jsx)(ts,{isVisible:q,onCancel:()=>V(!1),onSubmit:ec,accessToken:j})]})},tl=t(45589);let{Title:ta,Link:tr}=em.default;var ti=e=>{let{isVisible:s,onCancel:t,onAddCredential:l,existingCredential:a,setIsCredentialModalOpen:r}=e,[i]=I.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(a))),(0,c.jsx)(A.Z,{title:"Reuse Credentials",visible:s,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,c.jsxs)(I.Z,{form:i,onFinish:e=>{l(e),i.resetFields(),r(!1)},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==a?void 0:a.credential_name,children:(0,c.jsx)(y.Z,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==a?void 0:a.credential_values)||{}).map(e=>{let[s,t]=e;return(0,c.jsx)(I.Z.Item,{label:s,name:s,initialValue:t,children:(0,c.jsx)(y.Z,{placeholder:"Enter ".concat(s),disabled:!0})},s)}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(tr,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})},tn=t(63709),to=t(45246),tc=t(96473);let{Text:td}=em.default;var tm=e=>{let{form:s,showCacheControl:t,onCacheControlChange:l}=e,a=e=>{let t=s.getFieldValue("litellm_extra_params");try{let l=t?JSON.parse(t):{};e.length>0?l.cache_control_injection_points=e:delete l.cache_control_injection_points,Object.keys(l).length>0?s.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):s.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,c.jsx)(tn.Z,{onChange:l,className:"bg-gray-600"})}),t&&(0,c.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,c.jsx)(td,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,c.jsx)(I.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:l,remove:r}=t;return(0,c.jsxs)(c.Fragment,{children:[e.map((t,l)=>(0,c.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,c.jsx)(I.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,c.jsx)(C.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,c.jsx)(I.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,c.jsx)(C.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{a(s.getFieldValue("cache_control_points"))}})}),(0,c.jsx)(I.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,c.jsx)(M,{type:"number",placeholder:"Optional",step:1,min:0,onChange:()=>{a(s.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,c.jsx)(to.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{r(t.name),setTimeout(()=>{a(s.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,c.jsx)(I.Z.Item,{children:(0,c.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>l(),children:[(0,c.jsx)(tc.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})};let tu=async e=>{try{let s=await (0,g.modelHubCall)(e);if(console.log("model_info:",s),(null==s?void 0:s.data.length)>0){let e=s.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,s)=>e.model_group.localeCompare(s.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};var tx=t(44851),th=t(67960),tp=t(70464);let{TextArea:tg}=L.default,{Panel:tj}=tx.default;var tf=e=>{let{modelInfo:s,value:t,onChange:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]);(0,d.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,s)=>({id:e.id||"route-".concat(s,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));r(e),m(e.map(e=>e.id))}else r([]),m([])},[t]);let u=e=>{let s=a.filter(s=>s.id!==e);r(s),h(s),m(s=>s.filter(s=>s!==e))},x=(e,s,t)=>{let l=a.map(l=>l.id===e?{...l,[s]:t}:l);r(l),h(l)},h=e=>{let s={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==l||l(s)},p=s.map(e=>({value:e.model_group,label:e.model_group}));return(0,c.jsxs)("div",{className:"w-full max-w-none",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,c.jsx)(z.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(T.ZP,{type:"primary",icon:(0,c.jsx)(tc.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),s=[...a,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];r(s),h(s),m(s=>[...s,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===a.length?(0,c.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,c.jsx)(w.Z,{children:"No routes configured. Click “Add Route” to get started."})}):(0,c.jsx)("div",{className:"space-y-3 mb-6 w-full",children:a.map((e,s)=>(0,c.jsx)(th.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,c.jsx)(tx.default,{ghost:!0,expandIcon:e=>{let{isActive:s}=e;return(0,c.jsx)(tp.Z,{rotate:s?180:0})},activeKey:o,onChange:e=>m(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,c.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,c.jsxs)(w.Z,{className:"font-medium text-base",children:["Route ",s+1,": ",e.model||"Unnamed"]}),(0,c.jsx)(T.ZP,{type:"text",danger:!0,icon:(0,c.jsx)(ef.Z,{}),onClick:s=>{s.stopPropagation(),u(e.id)},className:"mr-2"})]}),children:(0,c.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,c.jsx)(C.default,{value:e.model,onChange:s=>x(e.id,"model",s),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,c.jsx)(tg,{value:e.description,onChange:s=>x(e.id,"description",s.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium",children:"Score Threshold"}),(0,c.jsx)(z.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(q.Z,{value:e.score_threshold,onChange:s=>x(e.id,"score_threshold",s||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,c.jsxs)("div",{className:"w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium",children:"Example Utterances"}),(0,c.jsx)(z.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,c.jsx)(C.default,{mode:"tags",value:e.utterances,onChange:s=>x(e.id,"utterances",s),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,c.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,c.jsx)(T.ZP,{type:"link",onClick:()=>n(!i),className:"text-blue-600 p-0",children:i?"Hide":"Show"})]}),i&&(0,c.jsx)(th.Z,{className:"bg-gray-50 w-full",children:(0,c.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:a.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})},tv=e=>{let{isVisible:s,onCancel:t,onSuccess:l,modelData:a,accessToken:r,userRole:i}=e,[n]=I.Z.useForm(),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)(!1),[v,_]=(0,d.useState)(!1),[b,N]=(0,d.useState)(null);(0,d.useEffect)(()=>{s&&a&&Z()},[s,a]),(0,d.useEffect)(()=>{let e=async()=>{if(r)try{let e=await (0,g.modelAvailableCall)(r,"","",!1,null,!0,!0);x(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(r)try{let e=await tu(r);p(e)}catch(e){console.error("Error fetching model info:",e)}};s&&(e(),t())},[s,r]);let Z=()=>{try{var e,s,t,l,r,i;let o=null;(null===(e=a.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(o="string"==typeof a.litellm_params.auto_router_config?JSON.parse(a.litellm_params.auto_router_config):a.litellm_params.auto_router_config),N(o),n.setFieldsValue({auto_router_name:a.model_name,auto_router_default_model:(null===(s=a.litellm_params)||void 0===s?void 0:s.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=a.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(l=a.model_info)||void 0===l?void 0:l.access_groups)||[]});let c=new Set(h.map(e=>e.model_group));f(!c.has(null===(r=a.litellm_params)||void 0===r?void 0:r.auto_router_default_model)),_(!c.has(null===(i=a.litellm_params)||void 0===i?void 0:i.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),P.ZP.error("Error loading auto router configuration")}},k=async()=>{try{m(!0);let e=await n.validateFields(),s={...a.litellm_params,auto_router_config:JSON.stringify(b),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},i={...a.model_info,access_groups:e.model_access_group||[]},o={model_name:e.auto_router_name,litellm_params:s,model_info:i};await (0,g.modelPatchUpdateCall)(r,o,a.model_info.id);let c={...a,model_name:e.auto_router_name,litellm_params:s,model_info:i};P.ZP.success("Auto router configuration updated successfully"),l(c),t()}catch(e){console.error("Error updating auto router:",e),P.ZP.error("Failed to update auto router configuration")}finally{m(!1)}},S=h.map(e=>({value:e.model_group,label:e.model_group}));return(0,c.jsx)(A.Z,{title:"Edit Auto Router Configuration",open:s,onCancel:t,footer:[(0,c.jsx)(T.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,c.jsx)(T.ZP,{loading:o,onClick:k,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsx)(w.Z,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,c.jsxs)(I.Z,{form:n,layout:"vertical",className:"space-y-4",children:[(0,c.jsx)(I.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(tf,{modelInfo:h,value:b,onChange:e=>{N(e)}})}),(0,c.jsx)(I.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,c.jsx)(C.default,{placeholder:"Select a default model",onChange:e=>{f("custom"===e)},options:[...S,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,c.jsx)(I.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,c.jsx)(C.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{_("custom"===e)},options:[...S,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===i&&(0,c.jsx)(I.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:u.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};function t_(e){var s,t,l,a,r,i,n,o,m,u,x,h,p,j,f,b,N,Z,S,E,O,D,F,R,q,V,K,B;let{modelId:G,onClose:H,modelData:J,accessToken:Y,userID:$,userRole:Q,editModel:X,setEditModalVisible:es,setSelectedModel:et,onModelUpdate:el,modelAccessGroups:ea}=e,[er]=I.Z.useForm(),[ei,en]=(0,d.useState)(null),[eo,ec]=(0,d.useState)(!1),[ed,em]=(0,d.useState)(!1),[eu,ex]=(0,d.useState)(!1),[eh,ep]=(0,d.useState)(!1),[eg,ej]=(0,d.useState)(!1),[ef,ev]=(0,d.useState)(null),[e_,ey]=(0,d.useState)(!1),[eb,eN]=(0,d.useState)({}),[eZ,ew]=(0,d.useState)(!1),[ek,eS]=(0,d.useState)([]),eC="Admin"===Q||(null==J?void 0:null===(s=J.model_info)||void 0===s?void 0:s.created_by)===$,eI=(null==J?void 0:null===(t=J.litellm_params)||void 0===t?void 0:t.auto_router_config)!=null,eP=(null==J?void 0:null===(l=J.litellm_params)||void 0===l?void 0:l.litellm_credential_name)!=null&&(null==J?void 0:null===(a=J.litellm_params)||void 0===a?void 0:a.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eP),console.log("modelData.litellm_params.litellm_credential_name, ",null==J?void 0:null===(r=J.litellm_params)||void 0===r?void 0:r.litellm_credential_name),(0,d.useEffect)(()=>{let e=async()=>{var e;if(!Y)return;let s=await (0,g.modelInfoV1Call)(Y,G);console.log("modelInfoResponse, ",s);let t=s.data[0];en(t),(null==t?void 0:null===(e=t.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&ey(!0)},s=async()=>{if(Y)try{let e=(await (0,g.getGuardrailsList)(Y)).guardrails.map(e=>e.guardrail_name);eS(e)}catch(e){console.error("Failed to fetch guardrails:",e)}};(async()=>{if(console.log("accessToken, ",Y),!Y||eP)return;let e=await (0,g.credentialGetCall)(Y,null,G);console.log("existingCredentialResponse, ",e),ev({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e(),s()},[Y,G]);let eA=async e=>{var s;if(console.log("values, ",e),!Y)return;let t={credential_name:e.credential_name,model_id:G,credential_info:{custom_llm_provider:null===(s=ei.litellm_params)||void 0===s?void 0:s.custom_llm_provider}};P.ZP.info("Storing credential.."),console.log("credentialResponse, ",await (0,g.credentialCreateCall)(Y,t)),P.ZP.success("Credential stored successfully")},eE=async e=>{try{var s;let t;if(!Y)return;ep(!0),console.log("values.model_name, ",e.model_name);let l={...ei.litellm_params,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6};e.guardrails&&(l.guardrails=e.guardrails),e.cache_control&&(null===(s=e.cache_control_injection_points)||void 0===s?void 0:s.length)>0?l.cache_control_injection_points=e.cache_control_injection_points:delete l.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):J.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){P.ZP.error("Invalid JSON in Model Info");return}let a={model_name:e.model_name,litellm_params:l,model_info:t};await (0,g.modelPatchUpdateCall)(Y,a,G);let r={...ei,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:l,model_info:t};en(r),el&&el(r),P.ZP.success("Model settings updated successfully"),ex(!1),ej(!1)}catch(e){console.error("Error updating model:",e),P.ZP.error("Failed to update model settings")}finally{ep(!1)}};if(!J)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Models"}),(0,c.jsx)(w.Z,{children:"Model not found"})]});let eT=async()=>{try{if(!Y)return;await (0,g.modelDeleteCall)(Y,G),P.ZP.success("Model deleted successfully"),el&&el({deleted:!0,model_info:{id:G}}),H()}catch(e){console.error("Error deleting the model:",e),P.ZP.error("Failed to delete model")}},eL=async(e,s)=>{await eF(e)&&(eN(e=>({...e,[s]:!0})),setTimeout(()=>{eN(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:H,className:"mb-4",children:"Back to Models"}),(0,c.jsxs)(k.Z,{children:["Public Model Name: ",sH(J)]}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:J.model_info.id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:eb["model-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>eL(J.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eb["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{className:"flex gap-2",children:["Admin"===Q&&(0,c.jsx)(_.Z,{icon:tl.Z,variant:"secondary",onClick:()=>em(!0),className:"flex items-center",children:"Re-use Credentials"}),eC&&(0,c.jsx)(_.Z,{icon:ee.Z,variant:"secondary",onClick:()=>ec(!0),className:"flex items-center",children:"Delete Model"})]})]}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-6",children:[(0,c.jsx)(eY.Z,{children:"Overview"}),(0,c.jsx)(eY.Z,{children:"Raw JSON"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Provider"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[J.provider&&(0,c.jsx)("img",{src:(0,sL.dr)(J.provider).logo,alt:"".concat(J.provider," logo"),className:"w-4 h-4",onError:e=>{let s=e.target,t=s.parentElement;if(t){var l;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(l=J.provider)||void 0===l?void 0:l.charAt(0))||"-",t.replaceChild(e,s)}}}),(0,c.jsx)(k.Z,{children:J.provider||"Not Set"})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"LiteLLM Model"}),(0,c.jsx)("pre",{children:(0,c.jsx)(k.Z,{children:J.litellm_model_name||"Not Set"})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Pricing"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["Input: $",J.input_cost,"/1M tokens"]}),(0,c.jsxs)(w.Z,{children:["Output: $",J.output_cost,"/1M tokens"]})]})]})]}),(0,c.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,c.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",J.model_info.created_at?new Date(J.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,c.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",J.model_info.created_by||"Not Set"]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Model Settings"}),(0,c.jsxs)("div",{className:"flex gap-2",children:[eI&&eC&&!eg&&(0,c.jsx)(_.Z,{variant:"primary",onClick:()=>ew(!0),className:"flex items-center",children:"Edit Auto Router"}),eC&&!eg&&(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>ej(!0),className:"flex items-center",children:"Edit Model"})]})]}),ei?(0,c.jsx)(I.Z,{form:er,onFinish:eE,initialValues:{model_name:ei.model_name,litellm_model_name:ei.litellm_model_name,api_base:ei.litellm_params.api_base,custom_llm_provider:ei.litellm_params.custom_llm_provider,organization:ei.litellm_params.organization,tpm:ei.litellm_params.tpm,rpm:ei.litellm_params.rpm,max_retries:ei.litellm_params.max_retries,timeout:ei.litellm_params.timeout,stream_timeout:ei.litellm_params.stream_timeout,input_cost:ei.litellm_params.input_cost_per_token?1e6*ei.litellm_params.input_cost_per_token:(null===(i=ei.model_info)||void 0===i?void 0:i.input_cost_per_token)*1e6||null,output_cost:(null===(n=ei.litellm_params)||void 0===n?void 0:n.output_cost_per_token)?1e6*ei.litellm_params.output_cost_per_token:(null===(o=ei.model_info)||void 0===o?void 0:o.output_cost_per_token)*1e6||null,cache_control:null!==(m=ei.litellm_params)&&void 0!==m&&!!m.cache_control_injection_points,cache_control_injection_points:(null===(u=ei.litellm_params)||void 0===u?void 0:u.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(x=ei.model_info)||void 0===x?void 0:x.access_groups)?ei.model_info.access_groups:[],guardrails:Array.isArray(null===(h=ei.litellm_params)||void 0===h?void 0:h.guardrails)?ei.litellm_params.guardrails:[]},layout:"vertical",onValuesChange:()=>ex(!0),children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Name"}),eg?(0,c.jsx)(I.Z.Item,{name:"model_name",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter model name"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:ei.model_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eg?(0,c.jsx)(I.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter LiteLLM model name"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:ei.litellm_model_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eg?(0,c.jsx)(I.Z.Item,{name:"input_cost",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter input cost"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==ei?void 0:null===(p=ei.litellm_params)||void 0===p?void 0:p.input_cost_per_token)?((null===(j=ei.litellm_params)||void 0===j?void 0:j.input_cost_per_token)*1e6).toFixed(4):(null==ei?void 0:null===(f=ei.model_info)||void 0===f?void 0:f.input_cost_per_token)?(1e6*ei.model_info.input_cost_per_token).toFixed(4):null})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eg?(0,c.jsx)(I.Z.Item,{name:"output_cost",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter output cost"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==ei?void 0:null===(b=ei.litellm_params)||void 0===b?void 0:b.output_cost_per_token)?(1e6*ei.litellm_params.output_cost_per_token).toFixed(4):(null==ei?void 0:null===(N=ei.model_info)||void 0===N?void 0:N.output_cost_per_token)?(1e6*ei.model_info.output_cost_per_token).toFixed(4):null})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"API Base"}),eg?(0,c.jsx)(I.Z.Item,{name:"api_base",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter API base"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(Z=ei.litellm_params)||void 0===Z?void 0:Z.api_base)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Custom LLM Provider"}),eg?(0,c.jsx)(I.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter custom LLM provider"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(S=ei.litellm_params)||void 0===S?void 0:S.custom_llm_provider)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization"}),eg?(0,c.jsx)(I.Z.Item,{name:"organization",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter organization"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(E=ei.litellm_params)||void 0===E?void 0:E.organization)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eg?(0,c.jsx)(I.Z.Item,{name:"tpm",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter TPM"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(O=ei.litellm_params)||void 0===O?void 0:O.tpm)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eg?(0,c.jsx)(I.Z.Item,{name:"rpm",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter RPM"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=ei.litellm_params)||void 0===D?void 0:D.rpm)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Max Retries"}),eg?(0,c.jsx)(I.Z.Item,{name:"max_retries",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter max retries"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(F=ei.litellm_params)||void 0===F?void 0:F.max_retries)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Timeout (seconds)"}),eg?(0,c.jsx)(I.Z.Item,{name:"timeout",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter timeout"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=ei.litellm_params)||void 0===R?void 0:R.timeout)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eg?(0,c.jsx)(I.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter stream timeout"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=ei.litellm_params)||void 0===q?void 0:q.stream_timeout)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Access Groups"}),eg?(0,c.jsx)(I.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==ea?void 0:ea.map(e=>({value:e,label:e}))})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(V=ei.model_info)||void 0===V?void 0:V.access_groups)?Array.isArray(ei.model_info.access_groups)?ei.model_info.access_groups.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:ei.model_info.access_groups.map((e,s)=>(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},s))}):"No groups assigned":ei.model_info.access_groups:"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Apply safety guardrails to this model to filter content or enforce policies",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),eg?(0,c.jsx)(I.Z.Item,{name:"guardrails",className:"mb-0",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing guardrails or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:ek.map(e=>({value:e,label:e}))})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(K=ei.litellm_params)||void 0===K?void 0:K.guardrails)?Array.isArray(ei.litellm_params.guardrails)?ei.litellm_params.guardrails.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:ei.litellm_params.guardrails.map((e,s)=>(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:e},s))}):"No guardrails assigned":ei.litellm_params.guardrails:"Not Set"})]}),eg?(0,c.jsx)(tm,{form:er,showCacheControl:e_,onCacheControlChange:e=>ey(e)}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cache Control"}),(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(B=ei.litellm_params)||void 0===B?void 0:B.cache_control_injection_points)?(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"Enabled"}),(0,c.jsx)("div",{className:"mt-2",children:ei.litellm_params.cache_control_injection_points.map((e,s)=>(0,c.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,c.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,c.jsxs)("span",{children:[" Index: ",e.index]})]},s))})]}):"Disabled"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Info"}),eg?(0,c.jsx)(I.Z.Item,{name:"model_info",className:"mb-0",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify(J.model_info,null,2)})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(ei.model_info,null,2)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:J.model_info.team_id||"Not Set"})]})]}),eg&&(0,c.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{er.resetFields(),ex(!1),ej(!1)},children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",onClick:()=>er.submit(),loading:eh,children:"Save Changes"})]})]})}):(0,c.jsx)(w.Z,{children:"Loading..."})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(W.Z,{children:(0,c.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify(J,null,2)})})})]})]}),eo&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Model"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this model?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(T.ZP,{onClick:eT,className:"ml-2",danger:!0,children:"Delete"}),(0,c.jsx)(T.ZP,{onClick:()=>ec(!1),children:"Cancel"})]})]})]})}),ed&&!eP?(0,c.jsx)(ti,{isVisible:ed,onCancel:()=>em(!1),onAddCredential:eA,existingCredential:ef,setIsCredentialModalOpen:em}):(0,c.jsx)(A.Z,{open:ed,onCancel:()=>em(!1),title:"Using Existing Credential",children:(0,c.jsx)(w.Z,{children:J.litellm_params.litellm_credential_name})}),(0,c.jsx)(tv,{isVisible:eZ,onCancel:()=>ew(!1),onSuccess:e=>{en(e),el&&el(e)},modelData:ei||J,accessToken:Y||"",userRole:Q||""})]})}var ty=e=>{let{selectedProvider:s,providerModels:t,getPlaceholder:l}=e,a=I.Z.useFormInstance(),r=e=>{let s=e.target.value,t=(a.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?{public_name:s,litellm_model:s}:e);a.setFieldsValue({model_mappings:t})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(I.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"Actual model name used for making litellm.completion() / litellm.embedding() call.",className:"mb-0",children:[(0,c.jsx)(I.Z.Item,{name:"model",rules:[{required:!0,message:"Please select at least one model."}],noStyle:!0,children:s===sL.Cl.Azure||s===sL.Cl.OpenAI_Compatible||s===sL.Cl.Ollama?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(y.Z,{placeholder:l(s)})}):t.length>0?(0,c.jsx)(C.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let s=Array.isArray(e)?e:[e];if(s.includes("all-wildcard"))a.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(a.getFieldValue("model"))!==JSON.stringify(s)){let e=s.map(e=>({public_name:e,litellm_model:e}));a.setFieldsValue({model:s,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(s," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,c.jsx)(y.Z,{placeholder:l(s)})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.model!==s.model,children:e=>{let{getFieldValue:s}=e,t=s("model")||[];return(Array.isArray(t)?t:[t]).includes("custom")&&(0,c.jsx)(I.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,c.jsx)(y.Z,{placeholder:"Enter custom model name",onChange:r})})}})]}),(0,c.jsxs)(sF.Z,{children:[(0,c.jsx)(sR.Z,{span:10}),(0,c.jsx)(sR.Z,{span:10,children:(0,c.jsx)(w.Z,{className:"mb-3 mt-1",children:"Actual model name used for making litellm.completion() call. We loadbalance models with the same public name"})})]})]})},tb=()=>{let e=I.Z.useFormInstance(),[s,t]=(0,d.useState)(0),l=I.Z.useWatch("model",e)||[],a=Array.isArray(l)?l:[l],r=I.Z.useWatch("custom_model_name",e),i=!a.includes("all-wildcard");if((0,d.useEffect)(()=>{if(r&&a.includes("custom")){let s=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?{public_name:r,litellm_model:r}:e);e.setFieldValue("model_mappings",s),t(e=>e+1)}},[r,a,e]),(0,d.useEffect)(()=>{if(a.length>0&&!a.includes("all-wildcard")){let s=e.getFieldValue("model_mappings")||[];if(s.length!==a.length||!a.every(e=>s.some(s=>"custom"===e?"custom"===s.litellm_model||s.litellm_model===r:s.litellm_model===e))){let s=a.map(e=>"custom"===e&&r?{public_name:r,litellm_model:r}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",s),t(e=>e+1)}}},[a,r,e]),!i)return null;let n=[{title:"Public Name",dataIndex:"public_name",key:"public_name",render:(s,t,l)=>(0,c.jsx)(y.Z,{value:s,onChange:s=>{let t=[...e.getFieldValue("model_mappings")];t[l].public_name=s.target.value,e.setFieldValue("model_mappings",t)}})},{title:"LiteLLM Model",dataIndex:"litellm_model",key:"litellm_model"}];return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(I.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",rules:[{required:!0,validator:async(e,s)=>{if(!s||0===s.length)throw Error("At least one model mapping is required");if(s.filter(e=>!e.public_name||""===e.public_name.trim()).length>0)throw Error("All model mappings must have valid public names")}}],children:(0,c.jsx)(eh.Z,{dataSource:e.getFieldValue("model_mappings"),columns:n,pagination:!1,size:"small"},s)})})},tN=t(90464);let{Link:tZ}=em.default;var tw=e=>{let{showAdvancedSettings:s,setShowAdvancedSettings:t,teams:l,guardrailsList:a}=e,[r]=I.Z.useForm(),[i,n]=d.useState(!1),[o,m]=d.useState("per_token"),[u,x]=d.useState(!1),h=(e,s)=>s&&(isNaN(Number(s))||0>Number(s))?Promise.reject("Please enter a valid positive number"):Promise.resolve(),p=(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}};return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(b.Z,{className:"mt-2 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Advanced Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,c.jsx)(I.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,c.jsx)(tn.Z,{onChange:e=>{n(e),e||r.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails. Go to 'Guardrails' tab to create new guardrails.",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:a.map(e=>({value:e,label:e}))})}),i&&(0,c.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,c.jsx)(I.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,c.jsx)(C.default,{defaultValue:"per_token",onChange:e=>m(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===o?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:h}],className:"mb-4",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:h}],className:"mb-4",children:(0,c.jsx)(y.Z,{})})]}):(0,c.jsx)(I.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:h}],className:"mb-4",children:(0,c.jsx)(y.Z,{})})]}),(0,c.jsx)(I.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,c.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,c.jsx)(tZ,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,c.jsx)(tn.Z,{onChange:e=>{let s=r.getFieldValue("litellm_extra_params");try{let t=s?JSON.parse(s):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?r.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):r.setFieldValue("litellm_extra_params","")}catch(s){e?r.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):r.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,c.jsx)(tm,{form:r,showCacheControl:u,onCacheControlChange:e=>{if(x(e),!e){let e=r.getFieldValue("litellm_extra_params");try{let s=e?JSON.parse(e):{};delete s.cache_control_injection_points,Object.keys(s).length>0?r.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):r.setFieldValue("litellm_extra_params","")}catch(e){r.setFieldValue("litellm_extra_params","")}}}}),(0,c.jsx)(I.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:p}],children:(0,c.jsx)(tN.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,c.jsxs)(sF.Z,{className:"mb-4",children:[(0,c.jsx)(sR.Z,{span:10}),(0,c.jsx)(sR.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,c.jsx)(tZ,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,c.jsx)(I.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:p}],children:(0,c.jsx)(tN.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},tk=t(29),tS=t.n(tk),tC=t(23639);let{Text:tI}=em.default;var tP=e=>{let{formValues:s,accessToken:t,testMode:l,modelName:a="this model",onClose:r,onTestComplete:i}=e,[n,o]=d.useState(null),[m,u]=d.useState(null),[x,h]=d.useState(null),[p,j]=d.useState(!0),[f,v]=d.useState(!1),[_,y]=d.useState(!1),b=async()=>{j(!0),y(!1),o(null),u(null),h(null),v(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",s);let a=await sO(s,t,null);if(!a){console.log("No result from prepareModelAddRequest"),o("Failed to prepare model data. Please check your form inputs."),v(!1),j(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:i,modelName:n}=a[0],c=await (0,g.testConnectionRequest)(t,r,null==i?void 0:i.mode);if("success"===c.status)P.ZP.success("Connection test successful!"),o(null),v(!0);else{var e,l;let s=(null===(e=c.result)||void 0===e?void 0:e.error)||c.message||"Unknown error";o(s),u(r),h(null===(l=c.result)||void 0===l?void 0:l.raw_request_typed_dict),v(!1)}}catch(e){console.error("Test connection error:",e),o(e instanceof Error?e.message:String(e)),v(!1)}finally{j(!1),i&&i()}};d.useEffect(()=>{let e=setTimeout(()=>{b()},200);return()=>clearTimeout(e)},[]);let N=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",Z="string"==typeof n?N(n):(null==n?void 0:n.message)?N(n.message):"Unknown error",w=x?((e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")})(x.raw_request_api_base,x.raw_request_body,x.raw_request_headers||{}):"";return(0,c.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[p?(0,c.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-776cdcbc0448e4ea",children:[(0,c.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-776cdcbc0448e4ea loading-spinner",children:(0,c.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-776cdcbc0448e4ea"})}),(0,c.jsxs)(tI,{style:{fontSize:"16px"},children:["Testing connection to ",a,"..."]}),(0,c.jsx)(tS(),{id:"776cdcbc0448e4ea",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):f?(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,c.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,c.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,c.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,c.jsxs)(tI,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",a," successful!"]})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,c.jsx)(ev.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,c.jsxs)(tI,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",a," failed"]})]}),(0,c.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,c.jsx)(tI,{strong:!0,style:{display:"block",marginBottom:"8px"},children:"Error: "}),(0,c.jsx)(tI,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:Z}),n&&(0,c.jsx)("div",{style:{marginTop:"12px"},children:(0,c.jsx)(T.ZP,{type:"link",onClick:()=>y(!_),style:{paddingLeft:0,height:"auto"},children:_?"Hide Details":"Show Details"})})]}),_&&(0,c.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,c.jsx)(tI,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,c.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof n?n:JSON.stringify(n,null,2)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(tI,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,c.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:w||"No request data available"}),(0,c.jsx)(T.ZP,{style:{marginTop:"8px"},icon:(0,c.jsx)(tC.Z,{}),onClick:()=>{navigator.clipboard.writeText(w||""),P.ZP.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,c.jsx)(Y.Z,{style:{margin:"24px 0 16px"}}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,c.jsx)(T.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,c.jsx)(U.Z,{}),children:"View Documentation"})})]})};let tA=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"}];var tE=t(92858);let tT=async(e,s,t,l)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",s?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",l?"Present":"Missing");let a={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:s?"Present":"Missing",config:a});let r=await (0,g.modelCreateCall)(s,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),P.ZP.error("Failed to add auto router: "+e,10)}},{Title:tL,Link:tO}=em.default;var tM=e=>{let{form:s,handleOk:t,accessToken:l,userRole:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)([]),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)(!1),[_,b]=(0,d.useState)(!1),[N,Z]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{h((await (0,g.modelAvailableCall)(l,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[l]),(0,d.useEffect)(()=>{(async()=>{try{let e=await tu(l);console.log("Fetched models for auto router:",e),j(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[l]);let k=eE.ZL.includes(a),S=async()=>{o(!0),u("test-".concat(Date.now())),i(!0)},E=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",N);let e=s.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){P.ZP.error("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){P.ZP.error("Please select a Default Model");return}if(s.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!N||!N.routes||0===N.routes.length){P.ZP.error("Please configure at least one route for the auto router");return}if(N.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){P.ZP.error("Please ensure all routes have a target model, description, and at least one utterance");return}s.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let a={...e,auto_router_config:N};console.log("Final submit values:",a),tT(a,l,s,t)}).catch(e=>{console.error("Validation failed:",e);let s=e.errorFields||[];if(s.length>0){let e=s.map(e=>{let s=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[s]||s});P.ZP.error("Please fill in the following required fields: ".concat(e.join(", ")))}else P.ZP.error("Please fill in all required fields")})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tL,{level:2,children:"Add Auto Router"}),(0,c.jsx)(w.Z,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,c.jsx)(th.Z,{children:(0,c.jsxs)(I.Z,{form:s,onFinish:E,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(y.Z,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,c.jsx)("div",{className:"w-full mb-4",children:(0,c.jsx)(tf,{modelInfo:p,value:N,onChange:e=>{Z(e),s.setFieldValue("auto_router_config",e)}})}),(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(C.default,{placeholder:"Select a default model",onChange:e=>{v("custom"===e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,c.jsx)(I.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(C.default,{value:s.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{b("custom"===e),s.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),k&&(0,c.jsx)(I.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(em.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{className:"space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:S,loading:n,children:"Test Connect"}),(0,c.jsx)(T.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",N),console.log("Current form values:",s.getFieldsValue()),E()},children:"Add Auto Router"})]})]})]})}),(0,c.jsx)(A.Z,{title:"Connection Test Results",open:r,onCancel:()=>{i(!1),o(!1)},footer:[(0,c.jsx)(T.ZP,{onClick:()=>{i(!1),o(!1)},children:"Close"},"close")],width:700,children:r&&(0,c.jsx)(tP,{formValues:s.getFieldsValue(),accessToken:l,testMode:"chat",modelName:s.getFieldValue("auto_router_name"),onClose:()=>{i(!1),o(!1)},onTestComplete:()=>o(!1)},m)})]})};let{Title:tD,Link:tF}=em.default;var tR=e=>{let{form:s,handleOk:t,selectedProvider:l,setSelectedProvider:a,providerModels:r,setProviderModelsFn:i,getPlaceholder:n,uploadProps:o,showAdvancedSettings:m,setShowAdvancedSettings:u,teams:x,credentials:h,accessToken:p,userRole:j,premiumUser:f}=e,[v]=I.Z.useForm(),[_,y]=(0,d.useState)("chat"),[b,N]=(0,d.useState)(!1),[Z,k]=(0,d.useState)(!1),[S,P]=(0,d.useState)([]),[E,L]=(0,d.useState)("");(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getGuardrailsList)(p)).guardrails.map(e=>e.guardrail_name);P(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[p]);let O=async()=>{k(!0),L("test-".concat(Date.now())),N(!0)},[M,D]=(0,d.useState)(!1),[F,R]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{R((await (0,g.modelAvailableCall)(p,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[p]);let q=eE.ZL.includes(j);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(eW.Z,{className:"w-full",children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Add Model"}),(0,c.jsx)(eY.Z,{children:"Add Auto Router"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(tD,{level:2,children:"Add Model"}),(0,c.jsx)(th.Z,{children:(0,c.jsx)(I.Z,{form:s,onFinish:e=>{console.log("\uD83D\uDD25 Form onFinish triggered with values:",e),t()},onFinishFailed:e=>{console.log("\uD83D\uDCA5 Form onFinishFailed triggered:",e)},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(C.default,{showSearch:!0,value:l,onChange:e=>{a(e),i(e),s.setFieldsValue({model:[],model_name:void 0})},children:Object.entries(sL.Cl).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sL.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(ty,{selectedProvider:l,providerModels:r,getPlaceholder:n}),(0,c.jsx)(tb,{}),(0,c.jsx)(I.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,c.jsx)(C.default,{style:{width:"100%"},value:_,onChange:e=>y(e),options:tA})}),(0,c.jsxs)(sF.Z,{children:[(0,c.jsx)(sR.Z,{span:10}),(0,c.jsx)(sR.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"mb-5 mt-1",children:[(0,c.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model ",(0,c.jsx)(tF,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsx)(em.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,c.jsx)(I.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...h.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.litellm_credential_name!==s.litellm_credential_name||e.provider!==s.provider,children:e=>{let{getFieldValue:s}=e,t=s("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?(0,c.jsx)("div",{className:"text-gray-500 text-sm text-center",children:"Using existing credentials - no additional provider fields needed"}):(0,c.jsx)(sz,{selectedProvider:l,uploadProps:o})}}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,c.jsx)(z.Z,{title:f?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,c.jsx)(tE.Z,{checked:M,onChange:e=>{D(e),e||s.setFieldValue("team_id",void 0)},disabled:!f})})}),M&&(0,c.jsx)(I.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:M&&!q,message:"Please select a team."}],children:(0,c.jsx)(J,{teams:x,disabled:!f})}),q&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(I.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:F.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,c.jsx)(tw,{showAdvancedSettings:m,setShowAdvancedSettings:u,teams:x,guardrailsList:S}),(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(em.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{className:"space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:O,loading:Z,children:"Test Connect"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(tM,{form:v,handleOk:()=>{v.validateFields().then(e=>{tT(e,p,v,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:p,userRole:j})})]})]}),(0,c.jsx)(A.Z,{title:"Connection Test Results",open:b,onCancel:()=>{N(!1),k(!1)},footer:[(0,c.jsx)(T.ZP,{onClick:()=>{N(!1),k(!1)},children:"Close"},"close")],width:700,children:b&&(0,c.jsx)(tP,{formValues:s.getFieldsValue(),accessToken:p,testMode:_,modelName:s.getFieldValue("model_name")||s.getFieldValue("model"),onClose:()=>{N(!1),k(!1)},onTestComplete:()=>k(!1)},E)})]})},tq=t(8048);let tU=(e,s,t,l,a,r,i,n,o,d,m)=>[{header:"Model ID",accessorKey:"model_info.id",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.model_info.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>l(t.model_info.id),children:t.model_info.id})})}},{header:"Public Model Name",accessorKey:"model_name",cell:e=>{let{row:s}=e,t=r(s.original)||"-";return(0,c.jsx)(z.Z,{title:t,children:(0,c.jsx)("div",{className:"text-xs truncate whitespace-nowrap",children:t})})}},{header:"Provider",accessorKey:"provider",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t.provider&&(0,c.jsx)("img",{src:(0,sL.dr)(t.provider).logo,alt:"".concat(t.provider," logo"),className:"w-4 h-4",onError:e=>{let s=e.target,l=s.parentElement;if(l){var a;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(a=t.provider)||void 0===a?void 0:a.charAt(0))||"-",l.replaceChild(e,s)}}}),(0,c.jsx)("p",{className:"text-xs",children:t.provider||"-"})]})}},{header:"LiteLLM Model Name",accessorKey:"litellm_model_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.litellm_model_name,children:(0,c.jsx)("div",{className:"text-xs truncate whitespace-nowrap",children:t.litellm_model_name||"-"})})}},{header:"Created At",accessorKey:"model_info.created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.created_at?new Date(t.model_info.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:"Created By",accessorKey:"model_info.created_by",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.created_by||"-"})}},{header:()=>(0,c.jsx)(z.Z,{title:"Cost per 1M tokens",children:(0,c.jsx)("span",{children:"Input Cost"})}),accessorKey:"input_cost",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("pre",{className:"text-xs",children:t.input_cost||"-"})}},{header:()=>(0,c.jsx)(z.Z,{title:"Cost per 1M tokens",children:(0,c.jsx)("span",{children:"Output Cost"})}),accessorKey:"output_cost",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("pre",{className:"text-xs",children:t.output_cost||"-"})}},{header:"Team ID",accessorKey:"model_info.team_id",cell:e=>{let{row:s}=e,t=s.original;return t.model_info.team_id?(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:t.model_info.team_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>a(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:"Model Access Group",accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:s}=e,t=s.original,l=t.model_info.access_groups;if(!l||0===l.length)return"-";let a=t.model_info.id,r=d.has(a),i=l.length>1,n=()=>{let e=new Set(d);r?e.delete(a):e.add(a),m(e)};return(0,c.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:l[0]}),(r||!i&&2===l.length)&&l.slice(1).map((e,s)=>(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},s+1)),i&&(0,c.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:r?"−":"+".concat(l.length-1)})]})}},{header:"Credentials",accessorKey:"litellm_credential_name",cell:e=>{let{row:s}=e,t=s.original;return t.litellm_params&&t.litellm_params.litellm_credential_name?(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsxs)(z.Z,{title:t.litellm_params.litellm_credential_name,children:[t.litellm_params.litellm_credential_name.slice(0,7),"..."]})}):(0,c.jsx)("span",{className:"text-gray-400",children:"-"})}},{header:"Status",accessorKey:"model_info.db_model",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:"",cell:t=>{var a;let{row:r}=t,i=r.original,n="Admin"===e||(null===(a=i.model_info)||void 0===a?void 0:a.created_by)===s;return(0,c.jsxs)("div",{className:"flex items-center justify-end gap-2 pr-4",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{n&&(l(i.model_info.id),o(!0))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>{n&&(l(i.model_info.id),o(!1))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"})]})}}];var tz=t(15731),tV=t(91126);let tK=(e,s,t,l,a,r,i,n,o,d,m)=>[{header:()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(s2.Z,{checked:t,indeterminate:s.length>0&&!t,onChange:e=>a(e.target.checked),onClick:e=>e.stopPropagation()}),(0,c.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,a=t.original,r=a.model_name,i=s.includes(r);return(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(s2.Z,{checked:i,onChange:e=>l(r,e.target.checked),onClick:e=>e.stopPropagation()}),(0,c.jsx)(z.Z,{title:a.model_info.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(a.model_info.id),children:a.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,t=s.original,l=n(t)||t.model_name;return(0,c.jsx)("div",{className:"font-medium text-sm",children:(0,c.jsx)(z.Z,{title:l,children:(0,c.jsx)("div",{className:"truncate max-w-[200px]",children:l})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,s,t)=>{var l,a;let r=e.getValue("health_status")||"unknown",i=s.getValue("health_status")||"unknown",n={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(l=n[r])&&void 0!==l?l:4)-(null!==(a=n[i])&&void 0!==a?a:4)},cell:s=>{var t;let{row:l}=s,a=l.original,r={status:a.health_status,loading:a.health_loading,error:a.health_error};if(r.loading)return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:"Checking..."})]});let n=a.model_name,o="healthy"===r.status&&(null===(t=e[n])||void 0===t?void 0:t.successResponse);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[i(r.status),o&&d&&(0,c.jsx)(z.Z,{title:"View response details",placement:"top",children:(0,c.jsx)("button",{onClick:()=>{var s;return d(n,null===(s=e[n])||void 0===s?void 0:s.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,c.jsx)(tz.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:s=>{let{row:t}=s,l=t.original.model_name,a=e[l];if(!(null==a?void 0:a.error))return(0,c.jsx)(w.Z,{className:"text-gray-400 text-sm",children:"No errors"});let r=a.error,i=a.fullError||a.error;return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"max-w-[200px]",children:(0,c.jsx)(z.Z,{title:r,placement:"top",children:(0,c.jsx)(w.Z,{className:"text-red-600 text-sm truncate",children:r})})}),o&&i!==r&&(0,c.jsx)(z.Z,{title:"View full error details",placement:"top",children:(0,c.jsx)("button",{onClick:()=>o(l,r,i),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,c.jsx)(tz.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,s,t)=>{let l=e.getValue("last_check")||"Never checked",a=s.getValue("last_check")||"Never checked";if("Never checked"===l&&"Never checked"===a)return 0;if("Never checked"===l)return 1;if("Never checked"===a)return -1;if("Check in progress..."===l&&"Check in progress..."===a)return 0;if("Check in progress..."===l)return -1;if("Check in progress..."===a)return 1;let r=new Date(l),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,s,t)=>{let l=e.getValue("last_success")||"Never succeeded",a=s.getValue("last_success")||"Never succeeded";if("Never succeeded"===l&&"Never succeeded"===a)return 0;if("Never succeeded"===l)return 1;if("Never succeeded"===a)return -1;if("None"===l&&"None"===a)return 0;if("None"===l)return 1;if("None"===a)return -1;let r=new Date(l),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:s=>{let{row:t}=s,l=e[t.original.model_name],a=(null==l?void 0:l.lastSuccess)||"None";return(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:a})}},{header:"Actions",id:"actions",cell:e=>{let{row:s}=e,t=s.original,l=t.model_name,a=t.health_status&&"none"!==t.health_status,i=t.health_loading?"Checking...":a?"Re-run Health Check":"Run Health Check";return(0,c.jsx)(z.Z,{title:i,placement:"top",children:(0,c.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||r(l)},disabled:t.health_loading,children:t.health_loading?(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):a?(0,c.jsx)(e1.Z,{className:"h-4 w-4"}):(0,c.jsx)(tV.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],tB=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var tG=e=>{let{accessToken:s,modelData:t,all_models_on_proxy:l,getDisplayModelName:a,setSelectedModelId:r}=e,[i,n]=(0,d.useState)({}),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[j,f]=(0,d.useState)(null),[v,y]=(0,d.useState)(!1),[b,N]=(0,d.useState)(null),Z=(0,d.useRef)(null);(0,d.useEffect)(()=>{s&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(s=>{e[s.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let l=await (0,g.latestHealthChecksCall)(s);l&&l.latest_health_checks&&"object"==typeof l.latest_health_checks&&Object.entries(l.latest_health_checks).forEach(s=>{let[l,a]=s;if(!a)return;let r=null,i=t.data.find(e=>e.model_name===l);if(i)r=i.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===l);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let s=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:s?S(s):void 0,fullError:s,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}n(e)})()},[s,t]);let S=e=>{var s;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),l=t.match(/(\w+Error):\s*(\d{3})/i);if(l)return"".concat(l[1],": ").concat(l[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],s={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return s?"".concat(e,": ").concat(s):e}for(let{pattern:e,replacement:s}of tB)if(e.test(t))return s;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let i=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),n=null===(s=i.split(/[.!?]/)[0])||void 0===s?void 0:s.trim();return n&&n.length>0?n.length>100?n.substring(0,97)+"...":n:i.length>100?i.substring(0,97)+"...":i},C=async e=>{if(s){n(s=>({...s,[e]:{...s[e],loading:!0,status:"checking"}}));try{var l,a;let r=await (0,g.individualModelHealthCheckCall)(s,e),i=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let s=(null===(l=r.unhealthy_endpoints[0])||void 0===l?void 0:l.error)||"Health check failed",t=S(s);n(l=>{var a;return{...l,[e]:{status:"unhealthy",lastCheck:i,lastSuccess:(null===(a=l[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:s}}})}else n(s=>({...s,[e]:{status:"healthy",lastCheck:i,lastSuccess:i,loading:!1,successResponse:r}}));try{let l=await (0,g.latestHealthChecksCall)(s),r=t.data.find(s=>s.model_name===e);if(r){let s=r.model_info.id,t=null===(a=l.latest_health_checks)||void 0===a?void 0:a[s];if(t){let s=t.error_message||void 0;n(l=>{var a,r,i,n,o,c,d;return{...l,[e]:{status:t.status||(null===(a=l[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=l[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(i=l[e])||void 0===i?void 0:i.lastSuccess)||"None":(null===(n=l[e])||void 0===n?void 0:n.lastSuccess)||"None",loading:!1,error:s?S(s):null===(o=l[e])||void 0===o?void 0:o.error,fullError:s||(null===(c=l[e])||void 0===c?void 0:c.fullError),successResponse:"healthy"===t.status?t:null===(d=l[e])||void 0===d?void 0:d.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let s=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),l=S(t);n(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:s,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:l,fullError:t}}})}}},I=async()=>{let e=o.length>0?o:l,a=e.reduce((e,s)=>(e[s]={...i[s],loading:!0,status:"checking"},e),{});n(e=>({...e,...a}));let r={},c=e.map(async e=>{if(s)try{let l=await (0,g.individualModelHealthCheckCall)(s,e);r[e]=l;let a=new Date().toLocaleString();if(l.unhealthy_count>0&&l.unhealthy_endpoints&&l.unhealthy_endpoints.length>0){var t;let s=(null===(t=l.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",r=S(s);n(t=>{var l;return{...t,[e]:{status:"unhealthy",lastCheck:a,lastSuccess:(null===(l=t[e])||void 0===l?void 0:l.lastSuccess)||"None",loading:!1,error:r,fullError:s}}})}else n(s=>({...s,[e]:{status:"healthy",lastCheck:a,lastSuccess:a,loading:!1,successResponse:l}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let s=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),l=S(t);n(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:s,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:l,fullError:t}}})}});await Promise.allSettled(c);try{if(!s)return;let l=await (0,g.latestHealthChecksCall)(s);l.latest_health_checks&&Object.entries(l.latest_health_checks).forEach(s=>{let[l,a]=s,r=t.data.find(e=>e.model_info.id===l);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,s=a.error_message||void 0;n(t=>{let l=t[e];return{...t,[e]:{status:a.status||(null==l?void 0:l.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==l?void 0:l.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==l?void 0:l.lastSuccess)||"None",loading:!1,error:s?S(s):null==l?void 0:l.error,fullError:s||(null==l?void 0:l.fullError),successResponse:"healthy"===a.status?a:null==l?void 0:l.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},P=e=>{x(e),e?m(l):m([])},E=()=>{p(!1),f(null)},L=()=>{y(!1),N(null)};return(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"mb-6",children:(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Model Health Status"}),(0,c.jsx)(w.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[o.length>0&&(0,c.jsx)(_.Z,{size:"sm",variant:"light",onClick:()=>P(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,c.jsx)(_.Z,{size:"sm",variant:"secondary",onClick:I,disabled:Object.values(i).some(e=>e.loading),className:"px-3 py-1 text-sm",children:o.length>0&&o.length<l.length?"Run Selected Checks":"Run All Checks"})]})]})}),(0,c.jsx)("div",{children:(0,c.jsx)(tq.C,{columns:tK(i,o,u,(e,s)=>{s?m(s=>[...s,e]):(m(s=>s.filter(s=>s!==e)),x(!1))},P,C,e=>{switch(e){case"healthy":return(0,c.jsx)(eJ.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,c.jsx)(eJ.Z,{color:"red",children:"unhealthy"});case"checking":return(0,c.jsx)(eJ.Z,{color:"blue",children:"checking"});case"none":return(0,c.jsx)(eJ.Z,{color:"gray",children:"none"});default:return(0,c.jsx)(eJ.Z,{color:"gray",children:"unknown"})}},a,(e,s,t)=>{f({modelName:e,cleanedError:s,fullError:t}),p(!0)},(e,s)=>{N({modelName:e,response:s}),y(!0)},r),data:t.data.map(e=>{let s=i[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:s.status,last_check:s.lastCheck,last_success:s.lastSuccess||"None",health_loading:s.loading,health_error:s.error,health_full_error:s.fullError}}),isLoading:!1,table:Z})}),(0,c.jsx)(A.Z,{title:j?"Health Check Error - ".concat(j.modelName):"Error Details",open:h,onCancel:E,footer:[(0,c.jsx)(T.ZP,{onClick:E,children:"Close"},"close")],width:800,children:j&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Error:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-red-800",children:j.cleanedError})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Full Error Details:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:j.fullError})})]})]})}),(0,c.jsx)(A.Z,{title:b?"Health Check Response - ".concat(b.modelName):"Response Details",open:v,onCancel:L,footer:[(0,c.jsx)(T.ZP,{onClick:L,children:"Close"},"close")],width:800,children:b&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Status:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Response Details:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(b.response,null,2)})})]})]})})]})},tH=t(61778),tJ=t(12660),tY=t(93142),tW=e=>{let{value:s={},onChange:t}=e,[l,a]=(0,d.useState)(Object.entries(s)),r=e=>{let s=l.filter((s,t)=>t!==e);a(s),null==t||t(Object.fromEntries(s))},i=(e,s,r)=>{let i=[...l];i[e]=[s,r],a(i),null==t||t(Object.fromEntries(i))};return(0,c.jsxs)("div",{children:[l.map((e,s)=>{let[t,l]=e;return(0,c.jsxs)(tY.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,c.jsx)(y.Z,{placeholder:"Header Name",value:t,onChange:e=>i(s,e.target.value,l)}),(0,c.jsx)(y.Z,{placeholder:"Header Value",value:l,onChange:e=>i(s,t,e.target.value)}),(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,c.jsx)(to.Z,{onClick:()=>r(s),style:{cursor:"pointer"}})})]},s)}),(0,c.jsx)(T.ZP,{type:"dashed",onClick:()=>{a([...l,["",""]])},icon:(0,c.jsx)(tc.Z,{}),children:"Add Header"})]})},t$=t(77565),tQ=e=>{let{pathValue:s,targetValue:t,includeSubpath:l}=e,a=(0,g.getProxyBaseUrl)();return s&&t?(0,c.jsxs)(W.Z,{className:"p-5",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,c.jsx)(sT.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,c.jsxs)("div",{className:"space-y-5",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,c.jsx)("code",{className:"font-mono text-sm text-gray-900",children:s?"".concat(a).concat(s):""})]}),(0,c.jsx)("div",{className:"text-gray-400",children:(0,c.jsx)(t$.Z,{className:"text-lg"})}),(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,c.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),l&&(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,c.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[s&&"".concat(a).concat(s),(0,c.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,c.jsx)("div",{className:"text-gray-400",children:(0,c.jsx)(t$.Z,{className:"text-lg"})}),(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,c.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,c.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,c.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",s," will be appended to the target URL"]})]})}),!l&&(0,c.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(U.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,c.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like ",(0,c.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null};let{Option:tX}=C.default;var t0=e=>{let{accessToken:s,setPassThroughItems:t,passThroughItems:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)(""),[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(!0),b=()=>{a.resetFields(),h(""),j(""),v(!0),i(!1)},N=e=>{let s=e;e&&!e.startsWith("/")&&(s="/"+e),h(s),a.setFieldsValue({path:s})},Z=async e=>{console.log("addPassThrough called with:",e),o(!0);try{console.log("formValues: ".concat(JSON.stringify(e)));let r=(await (0,g.createPassThroughEndpoint)(s,e)).endpoints[0],n=[...l,r];t(n),P.ZP.success("Pass-through endpoint created successfully"),a.resetFields(),h(""),j(""),v(!0),i(!1)}catch(e){P.ZP.error("Error creating pass-through endpoint: "+e,20)}finally{o(!1)}};return(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>i(!0),children:"+ Add Pass-Through Endpoint"}),(0,c.jsx)(A.Z,{title:(0,c.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,c.jsx)(tJ.Z,{className:"text-xl text-blue-500"}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:r,width:1e3,onCancel:b,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,c.jsxs)("div",{className:"mt-6",children:[(0,c.jsx)(tH.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,c.jsxs)(I.Z,{form:a,onFinish:Z,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:x,target:p},children:[(0,c.jsxs)(W.Z,{className:"p-5",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,c.jsx)(sT.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,c.jsxs)("div",{className:"space-y-5",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)(y.Z,{placeholder:"bria",value:x,onChange:e=>N(e.target.value),className:"flex-1"})})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,c.jsx)(y.Z,{placeholder:"https://engine.prod.bria-api.com",value:p,onChange:e=>{j(e.target.value),a.setFieldsValue({target:e.target.value})}})}),(0,c.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,c.jsx)(I.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,c.jsx)(tE.Z,{checked:f,onChange:v})})]})]})]}),(0,c.jsx)(tQ,{pathValue:x,targetValue:p,includeSubpath:f}),(0,c.jsxs)(W.Z,{className:"p-6",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,c.jsx)(sT.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,c.jsx)(z.Z,{title:"Authentication and other headers to forward with requests",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,c.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,c.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,c.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,c.jsx)(tW,{})})]}),(0,c.jsxs)(W.Z,{className:"p-6",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,c.jsx)(sT.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,c.jsx)(z.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,c.jsx)(M,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,c.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:b,children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",loading:n,onClick:()=>{console.log("Submit button clicked"),a.submit()},children:n?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},t1=t(87769),t2=t(42208);let t4=e=>{let{value:s}=e,[t,l]=(0,d.useState)(!1),a=JSON.stringify(s,null,2);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?a:"••••••••"}),(0,c.jsx)("button",{onClick:()=>l(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,c.jsx)(t1.Z,{className:"w-4 h-4 text-gray-500"}):(0,c.jsx)(t2.Z,{className:"w-4 h-4 text-gray-500"})})]})};var t5=e=>{let{endpointData:s,onClose:t,accessToken:l,isAdmin:a,onEndpointUpdated:r}=e,[i,n]=(0,d.useState)(s),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)(!1),[h]=I.Z.useForm(),p=async e=>{try{if(!l||!(null==i?void 0:i.id))return;let s={};if(e.headers)try{s="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){P.ZP.error("Invalid JSON format for headers");return}let t={path:i.path,target:e.target,headers:s,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request};await (0,g.updatePassThroughEndpoint)(l,i.id,t),n({...i,...t}),x(!1),r&&r()}catch(e){console.error("Error updating endpoint:",e),P.ZP.error("Failed to update pass through endpoint")}},j=async()=>{try{if(!l||!(null==i?void 0:i.id))return;await (0,g.deletePassThroughEndpointsCall)(l,i.id),P.ZP.success("Pass through endpoint deleted successfully"),t(),r&&r()}catch(e){console.error("Error deleting endpoint:",e),P.ZP.error("Failed to delete pass through endpoint")}};return o?(0,c.jsx)("div",{className:"p-4",children:"Loading..."}):i?(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,c.jsxs)(k.Z,{children:["Pass Through Endpoint: ",i.path]}),(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:i.id})]})}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"},"overview"),a?(0,c.jsx)(eY.Z,{children:"Settings"},"settings"):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Path"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{className:"font-mono",children:i.path})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Target"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{children:i.target})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Configuration"}),(0,c.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,c.jsx)("div",{children:(0,c.jsx)(eJ.Z,{color:i.include_subpath?"green":"gray",children:i.include_subpath?"Include Subpath":"Exact Path"})}),void 0!==i.cost_per_request&&(0,c.jsx)("div",{children:(0,c.jsxs)(w.Z,{children:["Cost per request: $",i.cost_per_request]})})]})]})]}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(tQ,{pathValue:i.path,targetValue:i.target,includeSubpath:i.include_subpath||!1})}),i.headers&&Object.keys(i.headers).length>0&&(0,c.jsxs)(W.Z,{className:"mt-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Headers"}),(0,c.jsxs)(eJ.Z,{color:"blue",children:[Object.keys(i.headers).length," headers configured"]})]}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(t4,{value:i.headers})})]})]}),a&&(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Pass Through Endpoint Settings"}),(0,c.jsx)("div",{className:"space-x-2",children:!u&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_.Z,{onClick:()=>x(!0),children:"Edit Settings"}),(0,c.jsx)(_.Z,{onClick:j,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),u?(0,c.jsxs)(I.Z,{form:h,onFinish:p,initialValues:{target:i.target,headers:i.headers?JSON.stringify(i.headers,null,2):"",include_subpath:i.include_subpath||!1,cost_per_request:i.cost_per_request},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,c.jsx)(y.Z,{placeholder:"https://api.example.com"})}),(0,c.jsx)(I.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,c.jsx)(L.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,c.jsx)(I.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,c.jsx)(tn.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,c.jsx)(q.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,c.jsx)(T.ZP,{onClick:()=>x(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{children:"Save Changes"})]})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Path"}),(0,c.jsx)("div",{className:"font-mono",children:i.path})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Target URL"}),(0,c.jsx)("div",{children:i.target})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Include Subpath"}),(0,c.jsx)(eJ.Z,{color:i.include_subpath?"green":"gray",children:i.include_subpath?"Yes":"No"})]}),void 0!==i.cost_per_request&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cost per Request"}),(0,c.jsxs)("div",{children:["$",i.cost_per_request]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Headers"}),i.headers&&Object.keys(i.headers).length>0?(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(t4,{value:i.headers})}):(0,c.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,c.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},t6=t(19130);function t3(e){let{data:s=[],columns:t,getRowCanExpand:l,renderSubComponent:a,isLoading:r=!1,loadingMessage:i="\uD83D\uDE85 Loading logs...",noDataMessage:n="No logs found"}=e,o=(0,sp.b7)({data:s,columns:t,getRowCanExpand:l,getRowId:(e,s)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(s)},getCoreRowModel:(0,sg.sC)(),getExpandedRowModel:(0,sg.rV)()});return(0,c.jsx)("div",{className:"rounded-lg custom-border",children:(0,c.jsxs)(t6.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(t6.ss,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(t6.SC,{children:e.headers.map(e=>(0,c.jsx)(t6.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,c.jsx)(t6.RM,{children:r?(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:i})})})}):o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsxs)(d.Fragment,{children:[(0,c.jsx)(t6.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(t6.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:e.getVisibleCells().length,children:a({row:e})})})]},e.id)):(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:n})})})})})]})})}let t8=e=>{let{value:s}=e,[t,l]=(0,d.useState)(!1),a=JSON.stringify(s);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"font-mono text-xs",children:t?a:"••••••••"}),(0,c.jsx)("button",{onClick:()=>l(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,c.jsx)(t1.Z,{className:"w-4 h-4 text-gray-500"}):(0,c.jsx)(t2.Z,{className:"w-4 h-4 text-gray-500"})})]})};var t7=e=>{let{accessToken:s,userRole:t,userID:l,modelData:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{s&&t&&l&&(0,g.getPassThroughEndpointsCall)(s).then(e=>{i(e.endpoints)})},[s,t,l]);let p=async e=>{h(e),u(!0)},j=async()=>{if(null!=x&&s){try{await (0,g.deletePassThroughEndpointsCall)(s,x);let e=r.filter(e=>e.id!==x);i(e),P.ZP.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.ZP.error("Error deleting the endpoint: "+e)}u(!1),h(null)}},f=(e,s)=>{p(e)},v=[{header:"ID",accessorKey:"id",cell:e=>(0,c.jsx)(z.Z,{title:e.row.original.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&o(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,c.jsx)(w.Z,{children:e.getValue()})},{header:"Headers",accessorKey:"headers",cell:e=>(0,c.jsx)(t8,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>s.original.id&&o(s.original.id),title:"Edit"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>f(s.original.id,s.index),title:"Delete"})]})}}];if(!s)return null;if(n){console.log("selectedEndpointId",n),console.log("generalSettings",r);let e=r.find(e=>e.id===n);return e?(0,c.jsx)(t5,{endpointData:e,onClose:()=>o(null),accessToken:s,isAdmin:"Admin"===t||"admin"===t,onEndpointUpdated:()=>{s&&(0,g.getPassThroughEndpointsCall)(s).then(e=>{i(e.endpoints)})}}):(0,c.jsx)("div",{children:"Endpoint not found"})}return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Pass Through Endpoints"}),(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,c.jsx)(t0,{accessToken:s,setPassThroughItems:i,passThroughItems:r}),(0,c.jsx)(t3,{data:r,columns:v,renderSubComponent:()=>(0,c.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),m&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:j,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{u(!1),h(null)},children:"Cancel"})]})]})]})})]})};let t9={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var le=e=>{let{accessToken:s,token:t,userRole:l,userID:a,modelData:r={data:[]},keys:i,setModelData:n,premiumUser:o,teams:m}=e,[u]=I.Z.useForm(),[x]=I.Z.useForm(),[h,p]=(0,d.useState)(null),[j,y]=(0,d.useState)(""),[b,N]=(0,d.useState)([]),[Z,S]=(0,d.useState)([]),[C,A]=(0,d.useState)(sL.Cl.OpenAI),[E,T]=(0,d.useState)(null),[L,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(!1),[F,R]=(0,d.useState)(null),[z,V]=(0,d.useState)([]),[K,B]=(0,d.useState)([]),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)([]),[$,Q]=(0,d.useState)([]),[X,ee]=(0,d.useState)([]),[es,et]=(0,d.useState)([]),[el,ea]=(0,d.useState)([]),[er,ei]=(0,d.useState)([]),[en,eo]=(0,d.useState)([]),[ec,eu]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ex,eh]=(0,d.useState)(null),[ep,eg]=(0,d.useState)(null),[ej,ef]=(0,d.useState)(0),[ev,e_]=(0,d.useState)({}),[ey,eb]=(0,d.useState)([]),[eN,eZ]=(0,d.useState)(!1),[ew,ek]=(0,d.useState)(null),[eS,eC]=(0,d.useState)(null),[eI,eP]=(0,d.useState)([]),[eA,eT]=(0,d.useState)([]),[eL,eO]=(0,d.useState)(!1),[eM,eD]=(0,d.useState)(null),[eF,eR]=(0,d.useState)(!1),[eq,eU]=(0,d.useState)(null),[ez,eV]=(0,d.useState)(null),[eK,eB]=(0,d.useState)(null),[eG,eJ]=(0,d.useState)(null),[e0,e2]=(0,d.useState)("personal"),[e4,e5]=(0,d.useState)("current_team"),[e6,e3]=(0,d.useState)(!1),[e8,e7]=(0,d.useState)(!1),[e9,se]=(0,d.useState)(new Set),ss=(0,d.useRef)(null),st=(0,d.useRef)(null),[sl,sa]=(0,d.useState)(0),sr=async(e,t,r)=>{if(console.log("Updating model metrics for group:",e),!s||!a||!l||!t||!r)return;console.log("inside updateModelMetrics - startTime:",t,"endTime:",r),H(e);let i=null==ew?void 0:ew.token;void 0===i&&(i=null);let n=eS;void 0===n&&(n=null);try{let o=await (0,g.modelMetricsCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);console.log("Model metrics response:",o),Y(o.data),Q(o.all_api_bases);let c=await (0,g.streamingModelMetricsCall)(s,e,t.toISOString(),r.toISOString());ee(c.data),et(c.all_api_bases);let d=await (0,g.modelExceptionsCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);console.log("Model exceptions response:",d),ea(d.data),ei(d.exception_types);let m=await (0,g.modelMetricsSlowResponsesCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);if(console.log("slowResponses:",m),eo(m),e){let l=await (0,g.adminGlobalActivityExceptions)(s,null==t?void 0:t.toISOString().split("T")[0],null==r?void 0:r.toISOString().split("T")[0],e);e_(l);let a=await (0,g.adminGlobalActivityExceptionsPerDeployment)(s,null==t?void 0:t.toISOString().split("T")[0],null==r?void 0:r.toISOString().split("T")[0],e);eb(a)}}catch(e){console.error("Failed to fetch model metrics",e)}},si=async e=>{try{let s=await (0,g.credentialListCall)(e);console.log("credentials: ".concat(JSON.stringify(s))),eT(s.credentials)}catch(e){console.error("Error fetching credentials:",e)}};(0,d.useEffect)(()=>{sr(G,ec.from,ec.to)},[ew,eS,ez]),(0,d.useEffect)(()=>{let e=e=>{ss.current&&!ss.current.contains(e.target)&&e7(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let sn={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let s=new FileReader;s.onload=e=>{if(e.target){let s=e.target.result;console.log("Resetting vertex_credentials to JSON; jsonStr: ".concat(s)),u.setFieldsValue({vertex_credentials:s}),console.log("Form values right after setting:",u.getFieldsValue())}},s.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered with values:",e),console.log("Current form values:",u.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?P.ZP.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&P.ZP.error("".concat(e.file.name," file upload failed."))}},sc=()=>{y(new Date().toLocaleString())},sd=async()=>{if(!s){console.error("Access token is missing");return}try{let e={router_settings:{}};"global"===G?(console.log("Saving global retry policy:",ep),ep&&(e.router_settings.retry_policy=ep),P.ZP.success("Global retry settings saved successfully")):(console.log("Saving model group retry policy for",G,":",ex),ex&&(e.router_settings.model_group_retry_policy=ex),P.ZP.success("Retry settings saved successfully for ".concat(G))),await (0,g.setCallbacksCall)(s,e)}catch(e){console.error("Failed to save retry settings:",e),P.ZP.error("Failed to save retry settings")}};if((0,d.useEffect)(()=>{if(!s||!t||!l||!a)return;let e=async()=>{try{var e,t,r,i,o,c,d,m,u,x,h,p;let j=await (0,g.modelInfoCall)(s,a,l);console.log("Model data response:",j.data),n(j);let f=await (0,g.modelSettingsCall)(s);f&&S(f);let v=new Set;for(let e=0;e<j.data.length;e++){let s=j.data[e];v.add(s.model_name)}console.log("all_model_groups:",v);let _=Array.from(v);_=_.sort(),V(_);let y=new Set;for(let e=0;e<j.data.length;e++){let s=j.data[e].model_info;if(s){let e=s.access_groups;if(e)for(let s=0;s<e.length;s++)y.add(e[s])}}B(Array.from(y)),console.log("array_model_groups:",_);let b="all";_.length>0&&(b=_[_.length-1],console.log("_initial_model_group:",b)),console.log("selectedModelGroup:",G);let N=await (0,g.modelMetricsCall)(s,a,l,b,null===(e=ec.from)||void 0===e?void 0:e.toISOString(),null===(t=ec.to)||void 0===t?void 0:t.toISOString(),null==ew?void 0:ew.token,eS);console.log("Model metrics response:",N),Y(N.data),Q(N.all_api_bases);let Z=await (0,g.streamingModelMetricsCall)(s,b,null===(r=ec.from)||void 0===r?void 0:r.toISOString(),null===(i=ec.to)||void 0===i?void 0:i.toISOString());ee(Z.data),et(Z.all_api_bases);let w=await (0,g.modelExceptionsCall)(s,a,l,b,null===(o=ec.from)||void 0===o?void 0:o.toISOString(),null===(c=ec.to)||void 0===c?void 0:c.toISOString(),null==ew?void 0:ew.token,eS);console.log("Model exceptions response:",w),ea(w.data),ei(w.exception_types);let k=await (0,g.modelMetricsSlowResponsesCall)(s,a,l,b,null===(d=ec.from)||void 0===d?void 0:d.toISOString(),null===(m=ec.to)||void 0===m?void 0:m.toISOString(),null==ew?void 0:ew.token,eS),C=await (0,g.adminGlobalActivityExceptions)(s,null===(u=ec.from)||void 0===u?void 0:u.toISOString().split("T")[0],null===(x=ec.to)||void 0===x?void 0:x.toISOString().split("T")[0],b);e_(C);let I=await (0,g.adminGlobalActivityExceptionsPerDeployment)(s,null===(h=ec.from)||void 0===h?void 0:h.toISOString().split("T")[0],null===(p=ec.to)||void 0===p?void 0:p.toISOString().split("T")[0],b);eb(I),console.log("dailyExceptions:",C),console.log("dailyExceptionsPerDeplyment:",I),console.log("slowResponses:",k),eo(k);let P=await (0,g.allEndUsersCall)(s);eP(null==P?void 0:P.end_users);let A=(await (0,g.getCallbacksCall)(s,a,l)).router_settings;console.log("routerSettingsInfo:",A);let E=A.model_group_retry_policy,T=A.num_retries;console.log("model_group_retry_policy:",E),console.log("default_retries:",T),eh(E),eg(A.retry_policy),ef(T)}catch(e){console.error("There was an error fetching the model data",e)}};s&&t&&l&&a&&e();let r=async()=>{let e=await (0,g.modelCostMap)(s);console.log("received model cost map data: ".concat(Object.keys(e))),p(e)};null==h&&r(),sc()},[s,t,l,a,h,j,ez]),!r||!s||!t||!l||!a)return(0,c.jsx)("div",{children:"Loading..."});let sm=[],su=[];for(let e=0;e<r.data.length;e++){var sx,sh,sp;let s=r.data[e],t=null==s?void 0:null===(sx=s.litellm_params)||void 0===sx?void 0:sx.model,l=null==s?void 0:null===(sh=s.litellm_params)||void 0===sh?void 0:sh.custom_llm_provider,a=null==s?void 0:s.model_info,i="",n="Undefined",o="Undefined",c="Undefined",d="Undefined",m={},u=e=>(console.log("GET PROVIDER CALLED! - ".concat(h)),null!=h&&"object"==typeof h&&e in h)?h[e].litellm_provider:"openai";if(t){let e=t.split("/"),s=e[0];(i=l)||(i=1===e.length?u(t):s)}else i="-";a&&(n=null==a?void 0:a.input_cost_per_token,o=null==a?void 0:a.output_cost_per_token,c=null==a?void 0:a.max_tokens,d=null==a?void 0:a.max_input_tokens),(null==s?void 0:s.litellm_params)&&(m=Object.fromEntries(Object.entries(null==s?void 0:s.litellm_params).filter(e=>{let[s]=e;return"model"!==s&&"api_base"!==s}))),r.data[e].provider=i,r.data[e].input_cost=n,r.data[e].output_cost=o,r.data[e].litellm_model_name=t,su.push(i),r.data[e].input_cost&&(r.data[e].input_cost=(1e6*Number(r.data[e].input_cost)).toFixed(2)),r.data[e].output_cost&&(r.data[e].output_cost=(1e6*Number(r.data[e].output_cost)).toFixed(2)),r.data[e].max_tokens=c,r.data[e].max_input_tokens=d,r.data[e].api_base=null==s?void 0:null===(sp=s.litellm_params)||void 0===sp?void 0:sp.api_base,r.data[e].cleanedLitellmParams=m,sm.push(s.model_name),console.log(r.data[e])}if(l&&"Admin Viewer"==l){let{Title:e,Paragraph:s}=em.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to view all models"})]})}let sg=(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mb-1",children:"Select API Key Name"}),o?(0,c.jsxs)("div",{children:[(0,c.jsxs)(eH.Z,{defaultValue:"all-keys",children:[(0,c.jsx)(ed.Z,{value:"all-keys",onClick:()=>{ek(null)},children:"All Keys"},"all-keys"),null==i?void 0:i.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,c.jsx)(ed.Z,{value:String(s),onClick:()=>{ek(e)},children:e.key_alias},s):null)]}),(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Customer Name"}),(0,c.jsxs)(eH.Z,{defaultValue:"all-customers",children:[(0,c.jsx)(ed.Z,{value:"all-customers",onClick:()=>{eC(null)},children:"All Customers"},"all-customers"),null==eI?void 0:eI.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,onClick:()=>{eC(e)},children:e},s))]}),(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Team"}),(0,c.jsxs)(eH.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=eK?eK:"all",onValueChange:e=>eB("all"===e?null:e),children:[(0,c.jsx)(ed.Z,{value:"all",children:"All Teams"}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ed.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Team"}),(0,c.jsxs)(eH.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=eK?eK:"all",onValueChange:e=>eB("all"===e?null:e),children:[(0,c.jsx)(ed.Z,{value:"all",children:"All Teams"}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ed.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]}),sZ=e=>{var s,t;let{payload:l,active:a}=e;if(!a||!l)return null;let r=null===(t=l[0])||void 0===t?void 0:null===(s=t.payload)||void 0===s?void 0:s.date,i=l.sort((e,s)=>s.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:l.slice(5).reduce((e,s)=>e+s.value,0),color:"gray"})}return(0,c.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,c.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",r]}),i.map((e,s)=>{let t=parseFloat(e.value.toFixed(5)),l=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,c.jsxs)("div",{className:"flex justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,c.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,c.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:l})]},s)})]})};console.log("selectedProvider: ".concat(C)),console.log("providerModels.length: ".concat(b.length));let sw=Object.keys(sL.Cl).find(e=>sL.Cl[e]===C);return(sw&&Z&&Z.find(e=>e.name===sL.fK[sw]),eq)?(0,c.jsx)("div",{className:"w-full h-full",children:(0,c.jsx)(tt,{teamId:eq,onClose:()=>eU(null),accessToken:s,is_team_admin:"Admin"===l,is_proxy_admin:"Proxy Admin"===l,userModels:sm,editTeam:!1,onUpdate:sc})}):(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:eM?(0,c.jsx)(t_,{modelId:eM,editModel:!0,onClose:()=>{eD(null),eR(!1)},modelData:r.data.find(e=>e.model_info.id===eM),accessToken:s,userID:a,userRole:l,setEditModalVisible:D,setSelectedModel:R,onModelUpdate:e=>{n({...r,data:r.data.map(s=>s.model_info.id===e.model_info.id?e:s)}),sc()},modelAccessGroups:K}):(0,c.jsxs)(eW.Z,{index:sl,onIndexChange:sa,className:"gap-2 h-[75vh] w-full ",children:[(0,c.jsxs)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[eE.ZL.includes(l)?(0,c.jsx)(eY.Z,{children:"All Models"}):(0,c.jsx)(eY.Z,{children:"Your Models"}),(0,c.jsx)(eY.Z,{children:"Add Model"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"LLM Credentials"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"Pass-Through Endpoints"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"Health Status"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"Model Analytics"}),eE.ZL.includes(l)&&(0,c.jsx)(eY.Z,{children:"Model Retry Settings"})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[j&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",j]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center",onClick:sc})]})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(v.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Model Management"}),eE.ZL.includes(l)?(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Add and manage models for the proxy"}):(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Add models for teams you are an admin for."})]})}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,c.jsxs)(eH.Z,{className:"w-80",defaultValue:"personal",value:e0,onValueChange:e=>e2(e),children:[(0,c.jsx)(ed.Z,{value:"personal",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ed.Z,{value:e.team_id,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),"current_team"===e4&&(0,c.jsxs)("div",{className:"flex items-start gap-2 mt-2 bg-gray-50 rounded",children:[(0,c.jsx)(U.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===e0?(0,c.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,c.jsx)("a",{href:"/?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,c.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',e0,'" on the'," ",(0,c.jsx)("a",{href:"/?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,c.jsxs)(eH.Z,{className:"w-64",defaultValue:"current_team",value:e4,onValueChange:e=>e5(e),children:[(0,c.jsx)(ed.Z,{value:"current_team",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,c.jsx)(ed.Z,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),(0,c.jsx)("div",{className:"flex items-center justify-between",children:(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:"Filter by Public Model Name:"}),(0,c.jsxs)(eH.Z,{className:"w-64",defaultValue:null!=G?G:"all",onValueChange:e=>H("all"===e?"all":e),value:null!=G?G:"all",children:[(0,c.jsx)(ed.Z,{value:"all",children:"All Models"}),(0,c.jsx)(ed.Z,{value:"wildcard",children:"Wildcard Models (*)"}),z.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,children:e},s))]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:"Filter by Model Access Group:"}),(0,c.jsxs)(eH.Z,{className:"w-64",defaultValue:"all",value:null!=eG?eG:"all",onValueChange:e=>eJ("all"===e?null:e),children:[(0,c.jsx)(ed.Z,{value:"all",children:"All Model Access Groups"}),K.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,children:e},s))]})]})]})}),(0,c.jsx)("div",{className:"flex justify-between items-center",children:(0,c.jsxs)(w.Z,{className:"text-sm text-gray-700",children:["Showing"," ",r&&r.data.length>0?r.data.filter(e=>{var s,t,l,a;let r="all"===G||e.model_name===G||!G,i="all"===eG||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(eG))||!eG,n=!0;return"current_team"===e4&&(n="personal"===e0?(null===(t=e.model_info)||void 0===t?void 0:t.direct_access)===!0:(null===(a=e.model_info)||void 0===a?void 0:null===(l=a.access_via_team_ids)||void 0===l?void 0:l.includes(e0))===!0),r&&i&&n}).length:0," ","results"]})})]})}),(0,c.jsx)(tq.C,{columns:tU(l,a,o,eD,eU,sH,e=>{R(e),D(!0)},sc,eR,e9,se),data:r.data.filter(e=>{var s,t,l,a;let r="all"===G||e.model_name===G||!G||"wildcard"===G&&e.model_name.includes("*"),i="all"===eG||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(eG))||!eG,n=!0;return"current_team"===e4&&(n="personal"===e0?(null===(t=e.model_info)||void 0===t?void 0:t.direct_access)===!0:(null===(a=e.model_info)||void 0===a?void 0:null===(l=a.access_via_team_ids)||void 0===l?void 0:l.includes(e0))===!0),r&&i&&n}),isLoading:!1,table:st})]})]})})}),(0,c.jsx)(eQ.Z,{className:"h-full",children:(0,c.jsx)(tR,{form:u,handleOk:()=>{console.log("\uD83D\uDE80 handleOk called from model dashboard!"),console.log("Current form values:",u.getFieldsValue()),u.validateFields().then(e=>{console.log("✅ Validation passed, submitting:",e),sM(e,s,u,sc)}).catch(e=>{var s;console.error("❌ Validation failed:",e),console.error("Form errors:",e.errorFields);let t=(null===(s=e.errorFields)||void 0===s?void 0:s.map(e=>"".concat(e.name.join("."),": ").concat(e.errors.join(", "))).join(" | "))||"Unknown validation error";P.ZP.error("Please fill in the following required fields: ".concat(t))})},selectedProvider:C,setSelectedProvider:A,providerModels:b,setProviderModelsFn:e=>{let s=(0,sL.bK)(e,h);N(s),console.log("providerModels: ".concat(s))},getPlaceholder:sL.ph,uploadProps:sn,showAdvancedSettings:eL,setShowAdvancedSettings:eO,teams:m,credentials:eA,accessToken:s,userRole:l,premiumUser:o})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(sG,{accessToken:s,uploadProps:sn,credentialList:eA,fetchCredentials:si})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(t7,{accessToken:s,userRole:l,userID:a,modelData:r})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(tG,{accessToken:s,modelData:r,all_models_on_proxy:sm,getDisplayModelName:sH,setSelectedModelId:eD})}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:ec,className:"mr-2",onValueChange:e=>{eu(e),sr(G,e.from,e.to)}})}),(0,c.jsxs)(f.Z,{className:"ml-2",children:[(0,c.jsx)(w.Z,{children:"Select Model Group"}),(0,c.jsx)(eH.Z,{defaultValue:G||z[0],value:G||z[0],children:z.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,onClick:()=>sr(e,ec.from,ec.to),children:e},s))})]}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(sQ.Z,{trigger:"click",content:sg,overlayStyle:{width:"20vw"},children:(0,c.jsx)(_.Z,{icon:so.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>eZ(!0)})})})]}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(W.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eY.Z,{value:"1",children:"Avg. Latency per Token"}),(0,c.jsx)(eY.Z,{value:"2",children:"Time to first token"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)("p",{className:"text-gray-500 italic",children:[" ","(seconds/token)"]}),(0,c.jsx)(w.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),J&&$&&(0,c.jsx)(sW.Z,{title:"Model Latency",className:"h-72",data:J,showLegend:!1,index:"date",categories:$,connectNulls:!0,customTooltip:sZ})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(s0,{modelMetrics:X,modelMetricsCategories:es,customTooltip:sZ,premiumUser:o})})]})]})})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(W.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Deployment"}),(0,c.jsx)(sb.Z,{children:"Success Responses"}),(0,c.jsxs)(sb.Z,{children:["Slow Responses"," ",(0,c.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,c.jsx)(sv.Z,{children:en.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.api_base}),(0,c.jsx)(s_.Z,{children:e.total_count}),(0,c.jsx)(s_.Z,{children:e.slow_count})]},s))})]})})})]}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(k.Z,{children:["All Exceptions for ",G]}),(0,c.jsx)(s$.Z,{className:"h-60",data:el,index:"model",categories:er,stack:!0,yAxisWidth:30})]})}),(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(k.Z,{children:["All Up Rate Limit Errors (429) for ",G]}),(0,c.jsxs)(v.Z,{numItems:1,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors"," ",ev.sum_num_rate_limit_exceptions]}),(0,c.jsx)(s$.Z,{className:"h-40",data:ev.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,c.jsx)(f.Z,{})]})]}),o?(0,c.jsx)(c.Fragment,{children:ey.map((e,s)=>(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429)"," ",e.sum_num_rate_limit_exceptions]}),(0,c.jsx)(s$.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},s))}):(0,c.jsx)(c.Fragment,{children:ey&&ey.length>0&&ey.slice(0,1).map((e,s)=>(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,c.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,c.jsx)(_.Z,{variant:"primary",className:"mb-2",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:e.api_base}),(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors"," ",e.sum_num_rate_limit_exceptions]}),(0,c.jsx)(s$.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},s))})]})]}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)("div",{className:"flex items-center gap-4 mb-6",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{children:"Retry Policy Scope:"}),(0,c.jsxs)(eH.Z,{className:"ml-2 w-48",defaultValue:"global",value:"global"===G?"global":G||z[0],onValueChange:e=>H(e),children:[(0,c.jsx)(ed.Z,{value:"global",children:"Global Default"}),z.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,onClick:()=>H(e),children:e},s))]})]})}),"global"===G?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k.Z,{children:"Global Retry Policy"}),(0,c.jsx)(w.Z,{className:"mb-6",children:"Default retry settings applied to all model groups unless overridden"})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(k.Z,{children:["Retry Policy for ",G]}),(0,c.jsx)(w.Z,{className:"mb-6",children:"Model-specific retry settings. Falls back to global defaults if not set."})]}),t9&&(0,c.jsx)("table",{children:(0,c.jsx)("tbody",{children:Object.entries(t9).map((e,s)=>{var t,l,a,r;let i,[n,o]=e;if("global"===G)i=null!==(t=null==ep?void 0:ep[o])&&void 0!==t?t:ej;else{let e=null==ex?void 0:null===(l=ex[G])||void 0===l?void 0:l[o];i=null!=e?e:null!==(a=null==ep?void 0:ep[o])&&void 0!==a?a:ej}return(0,c.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,c.jsxs)("td",{children:[(0,c.jsx)(w.Z,{children:n}),"global"!==G&&(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500 ml-2",children:["(Global: ",null!==(r=null==ep?void 0:ep[o])&&void 0!==r?r:ej,")"]})]}),(0,c.jsx)("td",{children:(0,c.jsx)(q.Z,{className:"ml-5",value:i,min:0,step:1,onChange:e=>{"global"===G?eg(s=>null==e?s:{...null!=s?s:{},[o]:e}):eh(s=>{var t;let l=null!==(t=null==s?void 0:s[G])&&void 0!==t?t:{};return{...null!=s?s:{},[G]:{...l,[o]:e}}})}})})]},s)})})}),(0,c.jsx)(_.Z,{className:"mt-6 mr-8",onClick:sd,children:"Save"})]})]})]})})})})},ls=e=>{let{visible:s,possibleUIRoles:t,onCancel:l,user:a,onSubmit:r}=e,[i,n]=(0,d.useState)(a),[o]=I.Z.useForm();(0,d.useEffect)(()=>{o.resetFields()},[a]);let m=async()=>{o.resetFields(),l()},u=async e=>{r(e),o.resetFields(),l()};return a?(0,c.jsx)(A.Z,{visible:s,onCancel:m,footer:null,title:"Edit User "+a.user_id,width:1e3,children:(0,c.jsx)(I.Z,{form:o,onFinish:u,initialValues:a,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"User Role",name:"user_role",children:(0,c.jsx)(C.default,{children:t&&Object.entries(t).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ed.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,c.jsx)(q.Z,{min:0,step:.01})}),(0,c.jsx)(I.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,c.jsx)(M,{min:0,step:.01})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},lt=t(16853);function ll(e){let{userData:s,onCancel:t,onSubmit:l,teams:a,accessToken:r,userID:i,userRole:n,userModels:o,possibleUIRoles:m,isBulkEdit:u=!1}=e,[x]=I.Z.useForm();return d.useEffect(()=>{var e,t,l,a,r;x.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_role:null===(t=s.user_info)||void 0===t?void 0:t.user_role,models:(null===(l=s.user_info)||void 0===l?void 0:l.models)||[],max_budget:null===(a=s.user_info)||void 0===a?void 0:a.max_budget,metadata:(null===(r=s.user_info)||void 0===r?void 0:r.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,x]),(0,c.jsxs)(I.Z,{form:x,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}l(e)},layout:"vertical",children:[!u&&(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",children:(0,c.jsx)(y.Z,{disabled:!0})}),!u&&(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Global Proxy Role"," ",(0,c.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,c.jsx)(U.Z,{})})]}),name:"user_role",children:(0,c.jsx)(C.default,{children:m&&Object.entries(m).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ed.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Personal Models"," ",(0,c.jsx)(z.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!eE.ZL.includes(n||""),children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,c.jsx)(C.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),o.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(lt.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",type:"button",onClick:t,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})]})}let{Text:la,Title:lr}=em.default;var li=e=>{let{visible:s,onCancel:t,selectedUsers:l,possibleUIRoles:a,accessToken:r,onSuccess:i,teams:n,userRole:o,userModels:m,allowAllUsers:u=!1}=e,[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)(null),[_,y]=(0,d.useState)(!1),[b,N]=(0,d.useState)(!1),Z=()=>{j([]),v(null),y(!1),N(!1),t()},w=d.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:n||[]}),[n,s]),k=async e=>{if(console.log("formValues",e),!r){P.ZP.error("Access token not found");return}h(!0);try{let s=l.map(e=>e.user_id),a={};e.user_role&&""!==e.user_role&&(a.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(a.max_budget=e.max_budget),e.models&&e.models.length>0&&(a.models=e.models),e.metadata&&Object.keys(e.metadata).length>0&&(a.metadata=e.metadata);let n=Object.keys(a).length>0,o=_&&p.length>0;if(!n&&!o){P.ZP.error("Please modify at least one field or select teams to add users to");return}let c=[];if(n){if(b){let e=await (0,g.userBulkUpdateUserCall)(r,a,void 0,!0);c.push("Updated all users (".concat(e.total_requested," total)"))}else await (0,g.userBulkUpdateUserCall)(r,a,s),c.push("Updated ".concat(s.length," user(s)"))}if(o){let e=[];for(let s of p)try{let t=null;b?t=null:l.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let a=await (0,g.teamBulkMemberAddCall)(r,s,t||null,f||void 0,b);console.log("result",a),e.push({teamId:s,success:!0,successfulAdditions:a.successful_additions,failedAdditions:a.failed_additions})}catch(t){console.error("Failed to add users to team ".concat(s,":"),t),e.push({teamId:s,success:!1,error:t})}let s=e.filter(e=>e.success),t=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);c.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}t.length>0&&P.ZP.warning("Failed to add users to ".concat(t.length," team(s)"))}c.length>0&&P.ZP.success(c.join(". ")),j([]),v(null),y(!1),N(!1),i(),t()}catch(e){console.error("Bulk operation failed:",e),P.ZP.error("Failed to perform bulk operations")}finally{h(!1)}};return(0,c.jsxs)(A.Z,{visible:s,onCancel:Z,footer:null,title:b?"Bulk Edit All Users":"Bulk Edit ".concat(l.length," User(s)"),width:800,children:[u&&(0,c.jsxs)("div",{className:"mb-4",children:[(0,c.jsx)(s2.Z,{checked:b,onChange:e=>N(e.target.checked),children:(0,c.jsx)(la,{strong:!0,children:"Update ALL users in the system"})}),b&&(0,c.jsx)("div",{style:{marginTop:8},children:(0,c.jsx)(la,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!b&&(0,c.jsxs)("div",{className:"mb-4",children:[(0,c.jsxs)(lr,{level:5,children:["Selected Users (",l.length,"):"]}),(0,c.jsx)(eh.Z,{size:"small",bordered:!0,dataSource:l,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,c.jsx)(la,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,c.jsx)(la,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,c.jsx)(la,{style:{fontSize:"12px"},children:(null==a?void 0:null===(s=a[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,c.jsx)(la,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,c.jsx)(Y.Z,{}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsxs)(la,{children:[(0,c.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,c.jsx)(th.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,c.jsxs)(tY.Z,{direction:"vertical",style:{width:"100%"},children:[(0,c.jsx)(s2.Z,{checked:_,onChange:e=>y(e.target.checked),children:"Add selected users to teams"}),_&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(la,{strong:!0,children:"Select Teams:"}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select teams to add users to",value:p,onChange:j,style:{width:"100%",marginTop:8},options:(null==n?void 0:n.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(la,{strong:!0,children:"Team Budget (Optional):"}),(0,c.jsx)(q.Z,{placeholder:"Max budget per user in team",value:f,onChange:e=>v(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,c.jsx)(la,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,c.jsx)(la,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,c.jsx)(ll,{userData:w,onCancel:Z,onSubmit:k,teams:n,accessToken:r,userID:"bulk_edit",userRole:o,userModels:m,possibleUIRoles:a,isBulkEdit:!0}),x&&(0,c.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,c.jsxs)(la,{children:["Updating ",b?"all users":l.length," user(s)..."]})})]})};let ln=(e,s,t,l,a,r)=>{let i=[{header:"User ID",accessorKey:"user_id",cell:e=>{let{row:s}=e;return(0,c.jsx)(z.Z,{title:s.original.user_id,children:(0,c.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"User Email",accessorKey:"user_email",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",cell:s=>{var t;let{row:l}=s;return(0,c.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(t=e[l.original.user_role])||void 0===t?void 0:t.ui_label)||"-"})}},{header:"User Spend ($ USD)",accessorKey:"spend",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.spend?eD(s.original.spend,4):"-"})}},{header:"User Max Budget ($ USD)",accessorKey:"max_budget",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{children:"SSO ID"}),(0,c.jsx)(z.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,c.jsx)(tz.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"API Keys",accessorKey:"key_count",cell:e=>{let{row:s}=e;return(0,c.jsx)(v.Z,{numItems:2,children:s.original.key_count>0?(0,c.jsxs)(eJ.Z,{size:"xs",color:"indigo",children:[s.original.key_count," Keys"]}):(0,c.jsx)(eJ.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(z.Z,{title:"Edit user details",zIndex:9999,children:(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>a(s.original.user_id,!0)})}),(0,c.jsx)(z.Z,{title:"Delete user",zIndex:9999,children:(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>t(s.original.user_id)})}),(0,c.jsx)(z.Z,{title:"Reset Password",zIndex:9999,children:(0,c.jsx)(sj.Z,{icon:e1.Z,size:"sm",onClick:()=>l(s.original.user_id)})})]})}}];if(r){let{onSelectUser:e,onSelectAll:s,isUserSelected:t,isAllSelected:l,isIndeterminate:a}=r;return[{id:"select",header:()=>(0,c.jsx)(s2.Z,{indeterminate:a,checked:l,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:l}=s;return(0,c.jsx)(s2.Z,{checked:t(l.original),onChange:s=>e(l.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...i]}return i};function lo(e){var s,t,l,a,r,i,n,o,m,u,x,h,p,j,f,y,b,N,Z,S,C,I,A,E,L,O,M;let{userId:D,onClose:F,accessToken:R,userRole:q,onDelete:U,possibleUIRoles:z,initialTab:V=0,startInEditMode:K=!1}=e,[B,G]=(0,d.useState)(null),[H,J]=(0,d.useState)(!1),[Y,$]=(0,d.useState)(!0),[Q,X]=(0,d.useState)(K),[es,et]=(0,d.useState)([]),[el,ea]=(0,d.useState)(!1),[er,ei]=(0,d.useState)(null),[en,eo]=(0,d.useState)(null),[ec,ed]=(0,d.useState)(V),[em,ex]=(0,d.useState)({});d.useEffect(()=>{eo((0,g.getProxyBaseUrl)())},[]),d.useEffect(()=>{console.log("userId: ".concat(D,", userRole: ").concat(q,", accessToken: ").concat(R)),(async()=>{try{if(!R)return;let e=await (0,g.userInfoCall)(R,D,q||"",!1,null,null,!0);G(e);let s=(await (0,g.modelAvailableCall)(R,D,q||"")).data.map(e=>e.id);et(s)}catch(e){console.error("Error fetching user data:",e),P.ZP.error("Failed to fetch user data")}finally{$(!1)}})()},[R,D,q]);let eh=async()=>{if(!R){P.ZP.error("Access token not found");return}try{P.ZP.success("Generating password reset link...");let e=await (0,g.invitationCreateCall)(R,D);ei(e),ea(!0)}catch(e){P.ZP.error("Failed to generate password reset link")}},ep=async()=>{try{if(!R)return;await (0,g.userDeleteCall)(R,[D]),P.ZP.success("User deleted successfully"),U&&U(),F()}catch(e){console.error("Error deleting user:",e),P.ZP.error("Failed to delete user")}},eg=async e=>{try{if(!R||!B)return;await (0,g.userUpdateUserCall)(R,e,null),G({...B,user_info:{...B.user_info,user_email:e.user_email,models:e.models,max_budget:e.max_budget,metadata:e.metadata}}),P.ZP.success("User updated successfully"),X(!1)}catch(e){console.error("Error updating user:",e),P.ZP.error("Failed to update user")}};if(Y)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(w.Z,{children:"Loading user data..."})]});if(!B)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(w.Z,{children:"User not found"})]});let ej=async(e,s)=>{await eF(e)&&(ex(e=>({...e,[s]:!0})),setTimeout(()=>{ex(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(k.Z,{children:(null===(s=B.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:B.user_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:em["user-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>ej(B.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(em["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),q&&eE.LQ.includes(q)&&(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"secondary",onClick:eh,className:"flex items-center",children:"Reset Password"}),(0,c.jsx)(_.Z,{icon:ee.Z,variant:"secondary",onClick:()=>J(!0),className:"flex items-center",children:"Delete User"})]})]}),H&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:ep,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>J(!1),children:"Cancel"})]})]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:ec,onIndexChange:ed,children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"}),(0,c.jsx)(eY.Z,{children:"Details"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Spend"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eD((null===(t=B.user_info)||void 0===t?void 0:t.spend)||0,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",(null===(l=B.user_info)||void 0===l?void 0:l.max_budget)!==null?"$".concat(eD(B.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Teams"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(w.Z,{children:[(null===(a=B.teams)||void 0===a?void 0:a.length)||0," teams"]})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"API Keys"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(w.Z,{children:[(null===(r=B.keys)||void 0===r?void 0:r.length)||0," keys"]})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Personal Models"}),(0,c.jsx)("div",{className:"mt-2",children:(null===(n=B.user_info)||void 0===n?void 0:null===(i=n.models)||void 0===i?void 0:i.length)&&(null===(m=B.user_info)||void 0===m?void 0:null===(o=m.models)||void 0===o?void 0:o.length)>0?null===(x=B.user_info)||void 0===x?void 0:null===(u=x.models)||void 0===u?void 0:u.map((e,s)=>(0,c.jsx)(w.Z,{children:e},s)):(0,c.jsx)(w.Z,{children:"All proxy models"})})]})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"User Settings"}),!Q&&q&&eE.LQ.includes(q)&&(0,c.jsx)(_.Z,{variant:"light",onClick:()=>X(!0),children:"Edit Settings"})]}),Q&&B?(0,c.jsx)(ll,{userData:B,onCancel:()=>X(!1),onSubmit:eg,teams:B.teams,accessToken:R,userID:D,userRole:q,userModels:es,possibleUIRoles:z}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"User ID"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"font-mono",children:B.user_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:em["user-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>ej(B.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(em["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Email"}),(0,c.jsx)(w.Z,{children:(null===(h=B.user_info)||void 0===h?void 0:h.user_email)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Role"}),(0,c.jsx)(w.Z,{children:(null===(p=B.user_info)||void 0===p?void 0:p.user_role)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:(null===(j=B.user_info)||void 0===j?void 0:j.created_at)?new Date(B.user_info.created_at).toLocaleString():"Unknown"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(w.Z,{children:(null===(f=B.user_info)||void 0===f?void 0:f.updated_at)?new Date(B.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Teams"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(y=B.teams)||void 0===y?void 0:y.length)&&(null===(b=B.teams)||void 0===b?void 0:b.length)>0?null===(N=B.teams)||void 0===N?void 0:N.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e.team_alias||e.team_id},s)):(0,c.jsx)(w.Z,{children:"No teams"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(S=B.user_info)||void 0===S?void 0:null===(Z=S.models)||void 0===Z?void 0:Z.length)&&(null===(I=B.user_info)||void 0===I?void 0:null===(C=I.models)||void 0===C?void 0:C.length)>0?null===(E=B.user_info)||void 0===E?void 0:null===(A=E.models)||void 0===A?void 0:A.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,c.jsx)(w.Z,{children:"All proxy models"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"API Keys"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(L=B.keys)||void 0===L?void 0:L.length)&&(null===(O=B.keys)||void 0===O?void 0:O.length)>0?B.keys.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,c.jsx)(w.Z,{children:"No API keys"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(M=B.user_info)||void 0===M?void 0:M.metadata)||{},null,2)})]})]})]})})]})]}),(0,c.jsx)(eu,{isInvitationLinkModalVisible:el,setIsInvitationLinkModalVisible:ea,baseUrl:en||"",invitationLinkData:er,modalType:"resetPassword"})]})}function lc(e){let{data:s=[],columns:t,isLoading:l=!1,onSortChange:a,currentSort:r,accessToken:i,userRole:n,possibleUIRoles:o,handleEdit:m,handleDelete:u,handleResetPassword:x,selectedUsers:h=[],onSelectionChange:p,enableSelection:g=!1}=e,[j,f]=d.useState([{id:(null==r?void 0:r.sortBy)||"created_at",desc:(null==r?void 0:r.sortOrder)==="desc"}]),[v,_]=d.useState(null),[y,b]=d.useState(!1),N=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_(e),b(s)},Z=(e,s)=>{p&&(s?p([...h,e]):p(h.filter(s=>s.user_id!==e.user_id)))},w=e=>{p&&(e?p(s):p([]))},k=e=>h.some(s=>s.user_id===e.user_id),S=s.length>0&&h.length===s.length,C=h.length>0&&h.length<s.length,I=d.useMemo(()=>o?ln(o,m,u,x,N,g?{selectedUsers:h,onSelectUser:Z,onSelectAll:w,isUserSelected:k,isAllSelected:S,isIndeterminate:C}:void 0):t,[o,m,u,x,N,t,g,h,S,C]),P=(0,sp.b7)({data:s,columns:I,state:{sorting:j},onSortingChange:e=>{if(f(e),e.length>0){let s=e[0],t=s.id,l=s.desc?"desc":"asc";null==a||a(t,l)}},getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0});return(d.useEffect(()=>{r&&f([{id:r.sortBy,desc:"desc"===r.sortOrder}])},[r]),v)?(0,c.jsx)(lo,{userId:v,onClose:()=>{_(null),b(!1)},accessToken:i,userRole:n,possibleUIRoles:o,initialTab:y?1:0,startInEditMode:y}):(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(t6.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(t6.ss,{children:P.getHeaderGroups().map(e=>(0,c.jsx)(t6.SC,{children:e.headers.map(e=>(0,c.jsx)(t6.xs,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(t6.RM,{children:l?(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:I.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?P.getRowModel().rows.map(e=>(0,c.jsx)(t6.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(t6.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&N(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(t6.SC,{children:(0,c.jsx)(t6.pj,{colSpan:I.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No users found"})})})})})]})})})}var ld=t(67982),lm=t(87908),lu=e=>{var s;let{accessToken:t,possibleUIRoles:l,userID:a,userRole:r}=e,[i,n]=(0,d.useState)(!0),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)({}),[j,f]=(0,d.useState)(!1),[v,b]=(0,d.useState)([]),{Paragraph:N}=em.default,{Option:Z}=C.default;(0,d.useEffect)(()=>{(async()=>{if(!t){n(!1);return}try{let e=await (0,g.getInternalUserSettings)(t);if(m(e),p(e.values||{}),t)try{let e=await (0,g.modelAvailableCall)(t,a,r);if(e&&e.data){let s=e.data.map(e=>e.id);b(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),P.ZP.error("Failed to fetch SSO settings")}finally{n(!1)}})()},[t]);let S=async()=>{if(t){f(!0);try{let e=Object.entries(h).reduce((e,s)=>{let[t,l]=s;return e[t]=""===l?null:l,e},{}),s=await (0,g.updateInternalUserSettings)(t,e);m({...o,values:s.settings}),x(!1)}catch(e){console.error("Error updating SSO settings:",e),P.ZP.error("Failed to update settings: "+e)}finally{f(!1)}}},I=(e,s)=>{p(t=>({...t,[e]:s}))},A=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],E=e=>{let s=A(e),t=(e,t,l)=>{let a=[...s];a[e]={...a[e],[t]:l},I("teams",a)},l=e=>{I("teams",s.filter((s,t)=>t!==e))};return(0,c.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,c.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Team ",s+1]}),(0,c.jsx)(_.Z,{size:"sm",variant:"secondary",icon:ef.Z,onClick:()=>l(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,c.jsx)(y.Z,{value:e.team_id,onChange:e=>t(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,c.jsx)(q.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>t(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,c.jsxs)(C.default,{style:{width:"100%"},value:e.user_role,onChange:e=>t(s,"user_role",e),children:[(0,c.jsx)(Z,{value:"user",children:"User"}),(0,c.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,c.jsx)(_.Z,{variant:"secondary",icon:tc.Z,onClick:()=>{I("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},T=(e,s,t)=>{var a;let r=s.type;if("teams"===e)return(0,c.jsx)("div",{className:"mt-2",children:E(h[e]||[])});if("user_role"===e&&l)return(0,c.jsx)(C.default,{style:{width:"100%"},value:h[e]||"",onChange:s=>I(e,s),className:"mt-2",children:Object.entries(l).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(Z,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{children:t}),(0,c.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:l})]})},s)})});if("budget_duration"===e)return(0,c.jsx)(eO,{value:h[e]||null,onChange:s=>I(e,s),className:"mt-2"});if("boolean"===r)return(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(tn.Z,{checked:!!h[e],onChange:s=>I(e,s)})});if("array"===r&&(null===(a=s.items)||void 0===a?void 0:a.enum))return(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:h[e]||[],onChange:s=>I(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,c.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,c.jsxs)(C.default,{mode:"multiple",style:{width:"100%"},value:h[e]||[],onChange:s=>I(e,s),className:"mt-2",children:[(0,c.jsx)(Z,{value:"no-default-models",children:"No Default Models"}),v.map(e=>(0,c.jsx)(Z,{value:e,children:F(e)},e))]});if("string"===r&&s.enum)return(0,c.jsx)(C.default,{style:{width:"100%"},value:h[e]||"",onChange:s=>I(e,s),className:"mt-2",children:s.enum.map(e=>(0,c.jsx)(Z,{value:e,children:e},e))});else return(0,c.jsx)(y.Z,{value:void 0!==h[e]?String(h[e]):"",onChange:s=>I(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},L=(e,s)=>{if(null==s)return(0,c.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,c.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=A(s);return(0,c.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,c.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,c.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,c.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat(eD(e.max_budget_in_team,4)):"No limit"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,c.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&l&&l[s]){let{ui_label:e,description:t}=l[s];return(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium",children:e}),t&&(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:t})]})}return"budget_duration"===e?(0,c.jsx)("span",{children:eL(s)}):"boolean"==typeof s?(0,c.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:F(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,c.jsx)("span",{children:String(s)})};return i?(0,c.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,c.jsx)(lm.Z,{size:"large"})}):o?(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Default User Settings"}),!i&&o&&(u?(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{x(!1),p(o.values||{})},disabled:j,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:S,loading:j,children:"Save Changes"})]}):(0,c.jsx)(_.Z,{onClick:()=>x(!0),children:"Edit Settings"}))]}),(null==o?void 0:null===(s=o.field_schema)||void 0===s?void 0:s.description)&&(0,c.jsx)(N,{className:"mb-4",children:o.field_schema.description}),(0,c.jsx)(ld.Z,{}),(0,c.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=o;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,l]=s,a=e[t],r=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,c.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,c.jsx)(w.Z,{className:"font-medium text-lg",children:r}),(0,c.jsx)(N,{className:"text-sm text-gray-500 mt-1",children:l.description||"No description available"}),u?(0,c.jsx)("div",{className:"mt-2",children:T(t,l,a)}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:L(t,a)})]},t)}):(0,c.jsx)(w.Z,{children:"No schema information available"})})()})]}):(0,c.jsx)(W.Z,{children:(0,c.jsx)(w.Z,{children:"No settings available or you do not have permission to view them."})})},lx=t(19616);let lh={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var lp=e=>{var s;let{accessToken:t,token:l,userRole:a,userID:r,teams:i}=e,n=(0,h.NL)(),[o,m]=(0,d.useState)(1),[u,x]=(0,d.useState)(!1),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)(!1),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)("users"),[w,k]=(0,d.useState)(lh),[S,C,I]=(0,lx.G)(w,{wait:300}),[A,E]=(0,d.useState)(!1),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(null),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)([]),[U,z]=(0,d.useState)(!1),[V,K]=(0,d.useState)(!1),[B,G]=(0,d.useState)([]),H=e=>{b(e),v(!0)};(0,d.useEffect)(()=>()=>{I.cancel()},[I]),(0,d.useEffect)(()=>{F((0,g.getProxyBaseUrl)())},[]),(0,d.useEffect)(()=>{(async()=>{try{if(!r||!a||!t)return;let e=(await (0,g.modelAvailableCall)(t,r,a)).data.map(e=>e.id);console.log("available_model_names:",e),G(e)}catch(e){console.error("Error fetching user models:",e)}})()},[t,r,a]);let J=e=>{k(s=>{let t={...s,...e};return C(t),t})},Y=async e=>{if(!t){P.ZP.error("Access token not found");return}try{P.ZP.success("Generating password reset link...");let s=await (0,g.invitationCreateCall)(t,e);M(s),L(!0)}catch(e){P.ZP.error("Failed to generate password reset link")}},W=async()=>{if(y&&t)try{await (0,g.userDeleteCall)(t,[y]),n.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==y);return{...e,users:s}}),P.ZP.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),P.ZP.error("Failed to delete user")}v(!1),b(null)},$=async()=>{j(null),x(!1)},Q=async e=>{if(console.log("inside handleEditSubmit:",e),t&&l&&a&&r){try{let s=await (0,g.userUpdateUserCall)(t,e,null);n.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let t=e.users.map(e=>e.user_id===s.data.user_id?eM(e,s.data):e);return{...e,users:t}}),P.ZP.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}j(null),x(!1)}},X=async e=>{m(e)},ee=(0,sd.a)({queryKey:["userList",{debouncedFilter:S,currentPage:o}],queryFn:async()=>{if(!t)throw Error("Access token required");return await (0,g.userListCall)(t,S.user_id?[S.user_id]:null,o,25,S.email||null,S.user_role||null,S.team||null,S.sso_user_id||null,S.sort_by,S.sort_order)},enabled:!!(t&&l&&a&&r),placeholderData:e=>e}),es=ee.data,et=(0,sd.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!t)throw Error("Access token required");return await (0,g.getPossibleUserRoles)(t)},enabled:!!(t&&l&&a&&r)}).data;if(ee.isLoading||!t||!l||!a||!r)return(0,c.jsx)("div",{children:"Loading..."});let el=ln(et,e=>{j(e),x(!0)},H,Y,()=>{});return(0,c.jsxs)("div",{className:"w-full p-6",children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)(eI,{userID:r,accessToken:t,teams:i,possibleUIRoles:et}),(0,c.jsx)(_.Z,{onClick:()=>{K(!V),q([])},variant:V?"primary":"secondary",className:"flex items-center",children:V?"Cancel Selection":"Select Users"}),V&&(0,c.jsxs)(_.Z,{onClick:()=>{if(0===R.length){P.ZP.error("Please select users to edit");return}z(!0)},disabled:0===R.length,className:"flex items-center",children:["Bulk Edit (",R.length," selected)"]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:0,onIndexChange:e=>Z(0===e?"users":"settings"),children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Users"}),(0,c.jsx)(eY.Z,{children:"Default User Settings"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by email...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.email,onChange:e=>J({email:e.target.value})}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(A?"bg-gray-100":""),onClick:()=>E(!A),children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(w.user_id||w.user_role||w.team)&&(0,c.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{J(lh)},children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),A&&(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Filter by User ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.user_id,onChange:e=>J({user_id:e.target.value})}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eH.Z,{value:w.user_role,onValueChange:e=>J({user_role:e}),placeholder:"Select Role",children:Object.entries(et).map(e=>{let[s,t]=e;return(0,c.jsx)(ed.Z,{value:s,children:t.ui_label},s)})})}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eH.Z,{value:w.team,onValueChange:e=>J({team:e}),placeholder:"Select Team",children:null==i?void 0:i.map(e=>(0,c.jsx)(ed.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,c.jsx)("div",{className:"relative w-64",children:(0,c.jsx)("input",{type:"text",placeholder:"Filter by SSO ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.sso_user_id,onChange:e=>J({sso_user_id:e.target.value})})})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",es&&es.users&&es.users.length>0?(es.page-1)*es.page_size+1:0," ","-"," ",es&&es.users?Math.min(es.page*es.page_size,es.total):0," ","of ",es?es.total:0," results"]}),(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{onClick:()=>X(o-1),disabled:1===o,className:"px-3 py-1 text-sm border rounded-md ".concat(1===o?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,c.jsx)("button",{onClick:()=>X(o+1),disabled:!es||o>=es.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!es||o>=es.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,c.jsx)(lc,{data:(null===(s=ee.data)||void 0===s?void 0:s.users)||[],columns:el,isLoading:ee.isLoading,accessToken:t,userRole:a,onSortChange:(e,s)=>{J({sort_by:e,sort_order:s})},currentSort:{sortBy:w.sort_by,sortOrder:w.sort_order},possibleUIRoles:et,handleEdit:e=>{j(e),x(!0)},handleDelete:H,handleResetPassword:Y,enableSelection:V,selectedUsers:R,onSelectionChange:e=>{q(e)}})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lu,{accessToken:t,possibleUIRoles:et,userID:r,userRole:a})})]})]}),(0,c.jsx)(ls,{visible:u,possibleUIRoles:et,onCancel:$,user:p,onSubmit:Q}),f&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"}),(0,c.jsxs)("p",{className:"text-sm font-medium text-gray-900 mt-2",children:["User ID: ",y]})]})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:W,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{v(!1),b(null)},children:"Cancel"})]})]})]})}),(0,c.jsx)(eu,{isInvitationLinkModalVisible:T,setIsInvitationLinkModalVisible:L,baseUrl:D||"",invitationLinkData:O,modalType:"resetPassword"}),(0,c.jsx)(li,{visible:U,onCancel:()=>z(!1),selectedUsers:R,possibleUIRoles:et,accessToken:t,onSuccess:()=>{n.invalidateQueries({queryKey:["userList"]}),q([]),K(!1)},teams:i,userRole:a,userModels:B,allowAllUsers:!!a&&(0,eE.tY)(a)})]})},lg=e=>{var s;let{accessToken:t,userID:l,userRole:a}=e,[r,i]=(0,d.useState)(!0),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)({}),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)([]),{Paragraph:b}=em.default,{Option:N}=C.default;(0,d.useEffect)(()=>{(async()=>{if(!t){i(!1);return}try{let e=await (0,g.getDefaultTeamSettings)(t);if(o(e),h(e.values||{}),t)try{let e=await (0,g.modelAvailableCall)(t,l,a);if(e&&e.data){let s=e.data.map(e=>e.id);v(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),P.ZP.error("Failed to fetch team settings")}finally{i(!1)}})()},[t]);let Z=async()=>{if(t){j(!0);try{let e=await (0,g.updateDefaultTeamSettings)(t,x);o({...n,values:e.settings}),u(!1),P.ZP.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),P.ZP.error("Failed to update team settings")}finally{j(!1)}}},S=(e,s)=>{h(t=>({...t,[e]:s}))},I=(e,s,t)=>{var l;let a=s.type;return"budget_duration"===e?(0,c.jsx)(eO,{value:x[e]||null,onChange:s=>S(e,s),className:"mt-2"}):"boolean"===a?(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(tn.Z,{checked:!!x[e],onChange:s=>S(e,s)})}):"array"===a&&(null===(l=s.items)||void 0===l?void 0:l.enum)?(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:x[e]||[],onChange:s=>S(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,c.jsx)(N,{value:e,children:e},e))}):"models"===e?(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:x[e]||[],onChange:s=>S(e,s),className:"mt-2",children:f.map(e=>(0,c.jsx)(N,{value:e,children:F(e)},e))}):"string"===a&&s.enum?(0,c.jsx)(C.default,{style:{width:"100%"},value:x[e]||"",onChange:s=>S(e,s),className:"mt-2",children:s.enum.map(e=>(0,c.jsx)(N,{value:e,children:e},e))}):(0,c.jsx)(y.Z,{value:void 0!==x[e]?String(x[e]):"",onChange:s=>S(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},A=(e,s)=>null==s?(0,c.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,c.jsx)("span",{children:eL(s)}):"boolean"==typeof s?(0,c.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:F(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,c.jsx)("span",{children:String(s)});return r?(0,c.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,c.jsx)(lm.Z,{size:"large"})}):n?(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{className:"text-xl",children:"Default Team Settings"}),!r&&n&&(m?(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{u(!1),h(n.values||{})},disabled:p,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:Z,loading:p,children:"Save Changes"})]}):(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Settings"}))]}),(0,c.jsx)(w.Z,{children:"These settings will be applied by default when creating new teams."}),(null==n?void 0:null===(s=n.field_schema)||void 0===s?void 0:s.description)&&(0,c.jsx)(b,{className:"mb-4 mt-2",children:n.field_schema.description}),(0,c.jsx)(ld.Z,{}),(0,c.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=n;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,l]=s,a=e[t],r=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,c.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,c.jsx)(w.Z,{className:"font-medium text-lg",children:r}),(0,c.jsx)(b,{className:"text-sm text-gray-500 mt-1",children:l.description||"No description available"}),m?(0,c.jsx)("div",{className:"mt-2",children:I(t,l,a)}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:A(t,a)})]},t)}):(0,c.jsx)(w.Z,{children:"No schema information available"})})()})]}):(0,c.jsx)(W.Z,{children:(0,c.jsx)(w.Z,{children:"No team settings available or you do not have permission to view them."})})},lj=e=>{let{accessToken:s,userID:t}=e,[l,a]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(s&&t)try{let e=await (0,g.availableTeamListCall)(s);a(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,t]);let r=async e=>{if(s&&t)try{await (0,g.teamMemberAddCall)(s,e,{user_id:t,role:"user"}),P.ZP.success("Successfully joined team"),a(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),P.ZP.error("Failed to join team")}};return(0,c.jsx)(W.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Team Name"}),(0,c.jsx)(sb.Z,{children:"Description"}),(0,c.jsx)(sb.Z,{children:"Members"}),(0,c.jsx)(sb.Z,{children:"Models"}),(0,c.jsx)(sb.Z,{children:"Actions"})]})}),(0,c.jsxs)(sv.Z,{children:[l.map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:e.team_alias})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:e.description||"No description available"})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{children:[e.members_with_roles.length," members"]})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})})})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(_.Z,{size:"xs",variant:"secondary",onClick:()=>r(e.team_id),children:"Join Team"})})]},e.team_id)),0===l.length&&(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:5,className:"text-center",children:(0,c.jsx)(w.Z,{children:"No available teams to join"})})})]})]})})};let lf=(e,s)=>{let t=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),t=e.models):t=s,R(t,s)};var lv=e=>{let{teams:s,searchParams:t,accessToken:l,setTeams:a,userID:r,userRole:i,organizations:n,premiumUser:o=!1}=e,[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)(null),[p,k]=(0,d.useState)(null),[S,E]=(0,d.useState)(!1),[O,R]=(0,d.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"});(0,d.useEffect)(()=>{console.log("inside useeffect - ".concat(m)),l&&j(l,r,i,x,a),ez()},[m]);let[q]=I.Z.useForm(),[V]=I.Z.useForm(),{Title:K,Paragraph:B}=em.default,[G,J]=(0,d.useState)(""),[Y,$]=(0,d.useState)(!1),[Q,X]=(0,d.useState)(null),[es,et]=(0,d.useState)(null),[el,ea]=(0,d.useState)(!1),[er,ei]=(0,d.useState)(!1),[en,eo]=(0,d.useState)(!1),[eu,ex]=(0,d.useState)(!1),[eh,ep]=(0,d.useState)([]),[eg,ej]=(0,d.useState)(!1),[ef,ev]=(0,d.useState)(null),[e_,ey]=(0,d.useState)([]),[eb,eN]=(0,d.useState)({}),[eZ,ew]=(0,d.useState)([]),[ek,eS]=(0,d.useState)({}),[eC,eI]=(0,d.useState)([]),[eP,eA]=(0,d.useState)([]),[eT,eL]=(0,d.useState)(!1);(0,d.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(p));let e=lf(p,eh);console.log("models: ".concat(e)),ey(e),q.setFieldValue("models",[])},[p,eh]),(0,d.useEffect)(()=>{(async()=>{try{if(null==l)return;let e=(await (0,g.getGuardrailsList)(l)).guardrails.map(e=>e.guardrail_name);ew(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[l]);let eO=async()=>{try{if(null==l)return;let e=await (0,g.fetchMCPAccessGroups)(l);eA(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,d.useEffect)(()=>{eO()},[l]),(0,d.useEffect)(()=>{s&&eN(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let eF=async e=>{ev(e),ej(!0)},eq=async()=>{if(null!=ef&&null!=s&&null!=l){try{await (0,g.teamDeleteCall)(l,ef),j(l,r,i,x,a)}catch(e){console.error("Error deleting the team:",e)}ej(!1),ev(null)}};(0,d.useEffect)(()=>{(async()=>{try{if(null===r||null===i||null===l)return;let e=await D(r,i,l);e&&ep(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,r,i,s]);let eU=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=l){var t,r,i;let n=null==e?void 0:e.team_alias,o=null!==(i=null==s?void 0:s.map(e=>e.team_alias))&&void 0!==i?i:[],c=(null==e?void 0:e.organization_id)||(null==x?void 0:x.organization_id);if(""===c||"string"!=typeof c?e.organization_id=null:e.organization_id=c.trim(),o.includes(n))throw Error("Team alias ".concat(n," already exists, please pick another alias"));if(P.ZP.info("Creating Team"),eC.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:eC.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if((e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(r=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===r?void 0:r.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups)){let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups);let d=await (0,g.teamCreateCall)(l,e);null!==s?a([...s,d]):a([d]),console.log("response for team create call: ".concat(d)),P.ZP.success("Team created"),q.resetFields(),eI([]),ei(!1)}}catch(e){console.error("Error creating the team:",e),P.ZP.error("Error creating the team: "+e,20)}},ez=()=>{u(new Date().toLocaleString())},eV=(e,s)=>{let t={...O,[e]:s};R(t),l&&(0,g.v2TeamListCall)(l,t.organization_id||null,null,t.team_id||null,t.team_alias||null).then(e=>{e&&e.teams&&a(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})};return(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==i||"Org Admin"==i)&&(0,c.jsx)(_.Z,{className:"w-fit",onClick:()=>ei(!0),children:"+ Create New Team"}),es?(0,c.jsx)(tt,{teamId:es,onUpdate:e=>{a(s=>{if(null==s)return s;let t=s.map(s=>e.team_id===s.team_id?eM(s,e):s);return l&&j(l,r,i,x,a),t})},onClose:()=>{et(null),ea(!1)},accessToken:l,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;s<e.members_with_roles.length;s++){let t=e.members_with_roles[s];if(t.user_id==r&&"admin"==t.role)return!0}return!1})(null==s?void 0:s.find(e=>e.team_id===es)),is_proxy_admin:"Admin"==i,userModels:eh,editTeam:el}):(0,c.jsxs)(eW.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eY.Z,{children:"Your Teams"}),(0,c.jsx)(eY.Z,{children:"Available Teams"}),(0,eE.tY)(i||"")&&(0,c.jsx)(eY.Z,{children:"Default Team Settings"})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",m]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center",onClick:ez})]})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(w.Z,{children:["Click on “Team ID” to view team details"," ",(0,c.jsx)("b",{children:"and"})," manage team members."]}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:O.team_alias,onChange:e=>eV("team_alias",e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(S?"bg-gray-100":""),onClick:()=>E(!S),children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(O.team_id||O.team_alias||O.organization_id)&&(0,c.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{R({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),l&&(0,g.v2TeamListCall)(l,null,r||null,null,null).then(e=>{e&&e.teams&&a(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),S&&(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:O.team_id,onChange:e=>eV("team_id",e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eH.Z,{value:O.organization_id||"",onValueChange:e=>eV("organization_id",e),placeholder:"Select Organization",children:null==n?void 0:n.map(e=>(0,c.jsx)(ed.Z,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})}),(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Team Name"}),(0,c.jsx)(sb.Z,{children:"Team ID"}),(0,c.jsx)(sb.Z,{children:"Created"}),(0,c.jsx)(sb.Z,{children:"Spend (USD)"}),(0,c.jsx)(sb.Z,{children:"Budget (USD)"}),(0,c.jsx)(sb.Z,{children:"Models"}),(0,c.jsx)(sb.Z,{children:"Organization"}),(0,c.jsx)(sb.Z,{children:"Info"})]})}),(0,c.jsx)(sv.Z,{children:s&&s.length>0?s.filter(e=>!x||e.organization_id===x.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.team_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{et(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,c.jsx)(s_.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,c.jsx)(s_.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:eD(e.spend,4)}),(0,c.jsx)(s_.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,c.jsx)(s_.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,c.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,c.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sj.Z,{icon:ek[e.team_id]?sZ.Z:sw.Z,className:"cursor-pointer",size:"xs",onClick:()=>{eS(s=>({...s,[e.team_id]:!s[e.team_id]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),e.models.length>3&&!ek[e.team_id]&&(0,c.jsx)(eJ.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),ek[e.team_id]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}),(0,c.jsx)(s_.Z,{children:e.organization_id}),(0,c.jsxs)(s_.Z,{children:[(0,c.jsxs)(w.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].keys&&eb[e.team_id].keys.length," ","Keys"]}),(0,c.jsxs)(w.Z,{children:[eb&&e.team_id&&eb[e.team_id]&&eb[e.team_id].team_info&&eb[e.team_id].team_info.members_with_roles&&eb[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,c.jsx)(s_.Z,{children:"Admin"==i?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{et(e.team_id),ea(!0)}}),(0,c.jsx)(sj.Z,{onClick:()=>eF(e.team_id),icon:ee.Z,size:"sm"})]}):null})]},e.team_id)):null})]}),eg&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Team"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this team ?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:eq,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{ej(!1),ev(null)},children:"Cancel"})]})]})]})})]})})})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lj,{accessToken:l,userID:r})}),(0,eE.tY)(i||"")&&(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lg,{accessToken:l,userID:r||"",userRole:i||""})})]})]}),("Admin"==i||"Org Admin"==i)&&(0,c.jsx)(A.Z,{title:"Create Team",visible:er,width:1e3,footer:null,onOk:()=>{ei(!1),q.resetFields(),eI([])},onCancel:()=>{ei(!1),q.resetFields(),eI([])},children:(0,c.jsxs)(I.Z,{form:q,onFinish:eU,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Organization"," ",(0,c.jsx)(z.Z,{title:(0,c.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:x?x.organization_id:null,className:"mt-8",children:(0,c.jsx)(C.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{q.setFieldValue("organization_id",e),k((null==n?void 0:n.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var t;return!!s&&((null===(t=s.children)||void 0===t?void 0:t.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==n?void 0:n.map(e=>(0,c.jsxs)(C.default.Option,{value:e.organization_id,children:[(0,c.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,c.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"These are the models that your selected team has access to",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),e_.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",onClick:()=>{eT||(eO(),eL(!0))},children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Additional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,c.jsx)(y.Z,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Setup your first guardrail",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:eZ.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,c.jsx)(H,{onChange:e=>q.setFieldValue("allowed_vector_store_ids",e),value:q.getFieldValue("allowed_vector_store_ids"),accessToken:l||"",placeholder:"Select vector stores (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers or access groups this team can access by default. ",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-8",help:"Select MCP servers or access groups this team can access. ",children:(0,c.jsx)(eR,{onChange:e=>q.setFieldValue("allowed_mcp_servers_and_groups",e),value:q.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:l||"",placeholder:"Select MCP servers or access groups (optional)"})})]})]}),(0,c.jsxs)(b.Z,{className:"mt-8 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Logging Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(ec,{value:eC,onChange:eI,premiumUser:o})})})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create Team"})})]})})]})})})},l_=e=>{var s,t,l,a,r;let{organizationId:i,onClose:n,accessToken:o,is_org_admin:m,is_proxy_admin:u,userModels:x,editOrg:h}=e,[p,j]=(0,d.useState)(null),[f,b]=(0,d.useState)(!0),[N]=I.Z.useForm(),[Z,S]=(0,d.useState)(!1),[A,E]=(0,d.useState)(!1),[O,D]=(0,d.useState)(!1),[R,q]=(0,d.useState)(null),[U,z]=(0,d.useState)({}),V=m||u,K=async()=>{try{if(b(!0),!o)return;let e=await (0,g.organizationInfoCall)(o,i);j(e)}catch(e){P.ZP.error("Failed to load organization information"),console.error("Error fetching organization info:",e)}finally{b(!1)}};(0,d.useEffect)(()=>{K()},[i,o]);let B=async e=>{try{if(null==o)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.organizationMemberAddCall)(o,i,s),P.ZP.success("Organization member added successfully"),E(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to add organization member"),console.error("Error adding organization member:",e)}},G=async e=>{try{if(!o)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.organizationMemberUpdateCall)(o,i,s),P.ZP.success("Organization member updated successfully"),D(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to update organization member"),console.error("Error updating organization member:",e)}},J=async e=>{try{if(!o)return;await (0,g.organizationMemberDeleteCall)(o,i,e.user_id),P.ZP.success("Organization member deleted successfully"),D(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to delete organization member"),console.error("Error deleting organization member:",e)}},Y=async e=>{try{if(!o)return;let s={organization_id:i,organization_alias:e.organization_alias,models:e.models,litellm_budget_table:{tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration},metadata:e.metadata?JSON.parse(e.metadata):null};if((void 0!==e.vector_stores||void 0!==e.mcp_servers_and_groups)&&(s.object_permission={...null==p?void 0:p.object_permission,vector_stores:e.vector_stores||[]},void 0!==e.mcp_servers_and_groups)){let{servers:t,accessGroups:l}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};t&&t.length>0&&(s.object_permission.mcp_servers=t),l&&l.length>0&&(s.object_permission.mcp_access_groups=l)}await (0,g.organizationUpdateCall)(o,s),P.ZP.success("Organization settings updated successfully"),S(!1),K()}catch(e){P.ZP.error("Failed to update organization settings"),console.error("Error updating organization:",e)}};if(f)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!p)return(0,c.jsx)("div",{className:"p-4",children:"Organization not found"});let $=async(e,s)=>{await eF(e)&&(z(e=>({...e,[s]:!0})),setTimeout(()=>{z(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,onClick:n,variant:"light",className:"mb-4",children:"Back to Organizations"}),(0,c.jsx)(k.Z,{children:p.organization_alias}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:p.organization_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:U["org-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>$(p.organization_id,"org-id"),className:"left-2 z-10 transition-all duration-200 ".concat(U["org-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:h?2:0,children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"}),(0,c.jsx)(eY.Z,{children:"Members"}),(0,c.jsx)(eY.Z,{children:"Settings"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Organization Details"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["Created: ",new Date(p.created_at).toLocaleDateString()]}),(0,c.jsxs)(w.Z,{children:["Updated: ",new Date(p.updated_at).toLocaleDateString()]}),(0,c.jsxs)(w.Z,{children:["Created By: ",p.created_by]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Budget Status"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eD(p.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null===p.litellm_budget_table.max_budget?"Unlimited":"$".concat(eD(p.litellm_budget_table.max_budget,4))]}),p.litellm_budget_table.budget_duration&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Reset: ",p.litellm_budget_table.budget_duration]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",p.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",p.litellm_budget_table.rpm_limit||"Unlimited"]}),p.litellm_budget_table.max_parallel_requests&&(0,c.jsxs)(w.Z,{children:["Max Parallel Requests: ",p.litellm_budget_table.max_parallel_requests]})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===p.models.length?(0,c.jsx)(eJ.Z,{color:"red",children:"All proxy models"}):p.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Teams"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:null===(s=p.teams)||void 0===s?void 0:s.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e.team_id},s))})]}),(0,c.jsx)(sl,{objectPermission:p.object_permission,variant:"card",accessToken:o})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(W.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[75vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"User ID"}),(0,c.jsx)(sb.Z,{children:"Role"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{children:"Created At"}),(0,c.jsx)(sb.Z,{})]})}),(0,c.jsx)(sv.Z,{children:null===(t=p.members)||void 0===t?void 0:t.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_id})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_role})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{children:["$",eD(e.spend,4)]})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:new Date(e.created_at).toLocaleString()})}),(0,c.jsx)(s_.Z,{children:V&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{q({role:e.user_role,user_email:e.user_email,user_id:e.user_id}),D(!0)}}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>{J(e)}})]})})]},s))})]})}),V&&(0,c.jsx)(_.Z,{onClick:()=>{E(!0)},children:"Add Member"})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Organization Settings"}),V&&!Z&&(0,c.jsx)(_.Z,{onClick:()=>S(!0),children:"Edit Settings"})]}),Z?(0,c.jsxs)(I.Z,{form:N,onFinish:Y,initialValues:{organization_alias:p.organization_alias,models:p.models,tpm_limit:p.litellm_budget_table.tpm_limit,rpm_limit:p.litellm_budget_table.rpm_limit,max_budget:p.litellm_budget_table.max_budget,budget_duration:p.litellm_budget_table.budget_duration,metadata:p.metadata?JSON.stringify(p.metadata,null,2):"",vector_stores:(null===(l=p.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=p.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(r=p.object_permission)||void 0===r?void 0:r.mcp_access_groups)||[]}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),x.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>N.setFieldValue("vector_stores",e),value:N.getFieldValue("vector_stores"),accessToken:o||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers & Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(eR,{onChange:e=>N.setFieldValue("mcp_servers_and_groups",e),value:N.getFieldValue("mcp_servers_and_groups"),accessToken:o||"",placeholder:"Select MCP servers and access groups"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{onClick:()=>S(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization Name"}),(0,c.jsx)("div",{children:p.organization_alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization ID"}),(0,c.jsx)("div",{className:"font-mono",children:p.organization_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:new Date(p.created_at).toLocaleString()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:p.models.map((e,s)=>(0,c.jsx)(eJ.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)("div",{children:["TPM: ",p.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",p.litellm_budget_table.rpm_limit||"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Budget"}),(0,c.jsxs)("div",{children:["Max:"," ",null!==p.litellm_budget_table.max_budget?"$".concat(eD(p.litellm_budget_table.max_budget,4)):"No Limit"]}),(0,c.jsxs)("div",{children:["Reset: ",p.litellm_budget_table.budget_duration||"Never"]})]}),(0,c.jsx)(sl,{objectPermission:p.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o})]})]})})]})]}),(0,c.jsx)(ts,{isVisible:A,onCancel:()=>E(!1),onSubmit:B,accessToken:o,title:"Add Organization Member",roles:[{label:"org_admin",value:"org_admin",description:"Can add and remove members, and change their roles."},{label:"internal_user",value:"internal_user",description:"Can view/create keys for themselves within organization."},{label:"internal_user_viewer",value:"internal_user_viewer",description:"Can only view their keys within organization."}],defaultRole:"internal_user"}),(0,c.jsx)(te,{visible:O,onCancel:()=>D(!1),onSubmit:G,initialData:R,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Org Admin",value:"org_admin"},{label:"Internal User",value:"internal_user"},{label:"Internal User Viewer",value:"internal_user_viewer"}]}})]})};let ly=async(e,s)=>{s(await (0,g.organizationListCall)(e))};var lb=e=>{let{organizations:s,userRole:t,userModels:l,accessToken:a,lastRefreshed:r,handleRefreshClick:i,currentOrg:n,guardrailsList:o=[],setOrganizations:m,premiumUser:u}=e,[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(!1),[b,N]=(0,d.useState)(!1),[Z,k]=(0,d.useState)(null),[S,E]=(0,d.useState)(!1),[T]=I.Z.useForm(),[O,D]=(0,d.useState)({});(0,d.useEffect)(()=>{a&&ly(a,m)},[a]);let R=e=>{e&&(k(e),N(!0))},q=async()=>{if(Z&&a)try{await (0,g.organizationDeleteCall)(a,Z),P.ZP.success("Organization deleted successfully"),N(!1),k(null),ly(a,m)}catch(e){console.error("Error deleting organization:",e)}},V=async e=>{try{var s,t,l,r;if(!a)return;console.log("values in organizations new create call: ".concat(JSON.stringify(e))),(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(s=e.allowed_mcp_servers_and_groups.servers)||void 0===s?void 0:s.length)>0||(null===(t=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===t?void 0:t.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(l=e.allowed_mcp_servers_and_groups.servers)||void 0===l?void 0:l.length)>0&&(e.object_permission.mcp_servers=e.allowed_mcp_servers_and_groups.servers),(null===(r=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===r?void 0:r.length)>0&&(e.object_permission.mcp_access_groups=e.allowed_mcp_servers_and_groups.accessGroups),delete e.allowed_mcp_servers_and_groups)),await (0,g.organizationCreateCall)(a,e),E(!1),T.resetFields(),ly(a,m)}catch(e){console.error("Error creating organization:",e)}};return u?(0,c.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"===t||"Org Admin"===t)&&(0,c.jsx)(_.Z,{className:"w-fit",onClick:()=>E(!0),children:"+ Create New Organization"}),x?(0,c.jsx)(l_,{organizationId:x,onClose:()=>{h(null),j(!1)},accessToken:a,is_org_admin:!0,is_proxy_admin:"Admin"===t,userModels:l,editOrg:p}):(0,c.jsxs)(eW.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsx)("div",{className:"flex",children:(0,c.jsx)(eY.Z,{children:"Your Organizations"})}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",r]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center",onClick:i})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(w.Z,{children:"Click on “Organization ID” to view organization details."}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(W.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Organization ID"}),(0,c.jsx)(sb.Z,{children:"Organization Name"}),(0,c.jsx)(sb.Z,{children:"Created"}),(0,c.jsx)(sb.Z,{children:"Spend (USD)"}),(0,c.jsx)(sb.Z,{children:"Budget (USD)"}),(0,c.jsx)(sb.Z,{children:"Models"}),(0,c.jsx)(sb.Z,{children:"TPM / RPM Limits"}),(0,c.jsx)(sb.Z,{children:"Info"}),(0,c.jsx)(sb.Z,{children:"Actions"})]})}),(0,c.jsx)(sv.Z,{children:s&&s.length>0?s.sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>{var s,l,a,r,i,n,o,d,m;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.organization_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>h(e.organization_id),children:[null===(s=e.organization_id)||void 0===s?void 0:s.slice(0,7),"..."]})})})}),(0,c.jsx)(s_.Z,{children:e.organization_alias}),(0,c.jsx)(s_.Z,{children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,c.jsx)(s_.Z,{children:eD(e.spend,4)}),(0,c.jsx)(s_.Z,{children:(null===(l=e.litellm_budget_table)||void 0===l?void 0:l.max_budget)!==null&&(null===(a=e.litellm_budget_table)||void 0===a?void 0:a.max_budget)!==void 0?null===(r=e.litellm_budget_table)||void 0===r?void 0:r.max_budget:"No limit"}),(0,c.jsx)(s_.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,c.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,c.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sj.Z,{icon:O[e.organization_id||""]?sZ.Z:sw.Z,className:"cursor-pointer",size:"xs",onClick:()=>{D(s=>({...s,[e.organization_id||""]:!s[e.organization_id||""]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),e.models.length>3&&!O[e.organization_id||""]&&(0,c.jsx)(eJ.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),O[e.organization_id||""]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eJ.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eJ.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{children:["TPM:"," ",(null===(i=e.litellm_budget_table)||void 0===i?void 0:i.tpm_limit)?null===(n=e.litellm_budget_table)||void 0===n?void 0:n.tpm_limit:"Unlimited",(0,c.jsx)("br",{}),"RPM:"," ",(null===(o=e.litellm_budget_table)||void 0===o?void 0:o.rpm_limit)?null===(d=e.litellm_budget_table)||void 0===d?void 0:d.rpm_limit:"Unlimited"]})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(w.Z,{children:[(null===(m=e.members)||void 0===m?void 0:m.length)||0," Members"]})}),(0,c.jsx)(s_.Z,{children:"Admin"===t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{h(e.organization_id),j(!0)}}),(0,c.jsx)(sj.Z,{onClick:()=>R(e.organization_id),icon:ee.Z,size:"sm"})]})})]},e.organization_id)}):null})]})})})})]})})]})]})}),(0,c.jsx)(A.Z,{title:"Create Organization",visible:S,width:800,footer:null,onCancel:()=>{E(!1),T.resetFields()},children:(0,c.jsxs)(I.Z,{form:T,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),l&&l.length>0&&l.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this organization can access by default. Leave empty for access to all vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this organization can access. Leave empty for access to all vector stores",children:(0,c.jsx)(H,{onChange:e=>T.setFieldValue("allowed_vector_store_ids",e),value:T.getFieldValue("allowed_vector_store_ids"),accessToken:a||"",placeholder:"Select vector stores (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers and access groups this organization can access by default.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers and access groups this organization can access.",children:(0,c.jsx)(eR,{onChange:e=>T.setFieldValue("allowed_mcp_servers_and_groups",e),value:T.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:a||"",placeholder:"Select MCP servers and access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(_.Z,{type:"submit",children:"Create Organization"})})]})}),b?(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Organization"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this organization?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:q,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{N(!1),k(null)},children:"Cancel"})]})]})]})}):(0,c.jsx)(c.Fragment,{})]}):(0,c.jsx)("div",{children:(0,c.jsxs)(w.Z,{children:["This is a LiteLLM Enterprise feature, and requires a valid key to use. Get a trial key"," ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})},lN=t(94789);let lZ={google:"https://artificialanalysis.ai/img/logos/google_small.svg",microsoft:"https://upload.wikimedia.org/wikipedia/commons/a/a8/Microsoft_Azure_Logo.svg",okta:"https://www.okta.com/sites/default/files/Okta_Logo_BrightBlue_Medium.png",generic:""},lw={google:{envVarMap:{google_client_id:"GOOGLE_CLIENT_ID",google_client_secret:"GOOGLE_CLIENT_SECRET"},fields:[{label:"GOOGLE CLIENT ID",name:"google_client_id"},{label:"GOOGLE CLIENT SECRET",name:"google_client_secret"}]},microsoft:{envVarMap:{microsoft_client_id:"MICROSOFT_CLIENT_ID",microsoft_client_secret:"MICROSOFT_CLIENT_SECRET",microsoft_tenant:"MICROSOFT_TENANT"},fields:[{label:"MICROSOFT CLIENT ID",name:"microsoft_client_id"},{label:"MICROSOFT CLIENT SECRET",name:"microsoft_client_secret"},{label:"MICROSOFT TENANT",name:"microsoft_tenant"}]},okta:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"GENERIC CLIENT ID",name:"generic_client_id"},{label:"GENERIC CLIENT SECRET",name:"generic_client_secret"},{label:"AUTHORIZATION ENDPOINT",name:"generic_authorization_endpoint",placeholder:"https://your-okta-domain/authorize"},{label:"TOKEN ENDPOINT",name:"generic_token_endpoint",placeholder:"https://your-okta-domain/token"},{label:"USERINFO ENDPOINT",name:"generic_userinfo_endpoint",placeholder:"https://your-okta-domain/userinfo"}]},generic:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"GENERIC CLIENT ID",name:"generic_client_id"},{label:"GENERIC CLIENT SECRET",name:"generic_client_secret"},{label:"AUTHORIZATION ENDPOINT",name:"generic_authorization_endpoint"},{label:"TOKEN ENDPOINT",name:"generic_token_endpoint"},{label:"USERINFO ENDPOINT",name:"generic_userinfo_endpoint"}]}};var lk=e=>{let{isAddSSOModalVisible:s,isInstructionsModalVisible:t,handleAddSSOOk:l,handleAddSSOCancel:a,handleShowInstructions:r,handleInstructionsOk:i,handleInstructionsCancel:n,form:o,accessToken:m,ssoConfigured:u=!1}=e,[x,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(s&&m)try{let s=await (0,g.getSSOSettings)(m);if(console.log("Raw SSO data received:",s),s&&s.values){console.log("SSO values:",s.values),console.log("user_email from API:",s.values.user_email);let l=null;if(s.values.google_client_id)l="google";else if(s.values.microsoft_client_id)l="microsoft";else if(s.values.generic_client_id){var e,t;l=(null===(e=s.values.generic_authorization_endpoint)||void 0===e?void 0:e.includes("okta"))||(null===(t=s.values.generic_authorization_endpoint)||void 0===t?void 0:t.includes("auth0"))?"okta":"generic"}let a={sso_provider:l,proxy_base_url:s.values.proxy_base_url,user_email:s.values.user_email,...s.values};console.log("Setting form values:",a),o.resetFields(),setTimeout(()=>{o.setFieldsValue(a),console.log("Form values set, current form values:",o.getFieldsValue())},100)}}catch(e){console.error("Failed to load SSO settings:",e)}})()},[s,m,o]);let p=async e=>{if(!m){P.ZP.error("No access token available");return}try{await (0,g.updateSSOSettings)(m,e),r(e)}catch(e){console.error("Failed to save SSO settings:",e),P.ZP.error("Failed to save SSO settings")}},j=async()=>{if(!m){P.ZP.error("No access token available");return}try{await (0,g.updateSSOSettings)(m,{google_client_id:"",google_client_secret:"",microsoft_client_id:"",microsoft_client_secret:"",microsoft_tenant:"",generic_client_id:"",generic_client_secret:"",generic_authorization_endpoint:"",generic_token_endpoint:"",generic_userinfo_endpoint:"",proxy_base_url:"",user_email:"",sso_provider:""}),o.resetFields(),h(!1),l(),P.ZP.success("SSO settings cleared successfully")}catch(e){console.error("Failed to clear SSO settings:",e),P.ZP.error("Failed to clear SSO settings")}},f=e=>{let s=lw[e];return s?s.fields.map(e=>(0,c.jsx)(I.Z.Item,{label:e.label,name:e.name,rules:[{required:!0,message:"Please enter the ".concat(e.label.toLowerCase())}],children:e.name.includes("client")?(0,c.jsx)(L.default.Password,{}):(0,c.jsx)(y.Z,{placeholder:e.placeholder})},e.name)):null};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(A.Z,{title:u?"Edit SSO Settings":"Add SSO",visible:s,width:800,footer:null,onOk:l,onCancel:a,children:(0,c.jsxs)(I.Z,{form:o,onFinish:p,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"SSO Provider",name:"sso_provider",rules:[{required:!0,message:"Please select an SSO provider"}],children:(0,c.jsx)(C.default,{children:Object.entries(lZ).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0"},children:[t&&(0,c.jsx)("img",{src:t,alt:s,style:{height:24,width:24,marginRight:12,objectFit:"contain"}}),(0,c.jsxs)("span",{children:[s.charAt(0).toUpperCase()+s.slice(1)," SSO"]})]})},s)})})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.sso_provider!==s.sso_provider,children:e=>{let{getFieldValue:s}=e,t=s("sso_provider");return t?f(t):null}}),(0,c.jsx)(I.Z.Item,{label:"Proxy Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"PROXY BASE URL",name:"proxy_base_url",rules:[{required:!0,message:"Please enter the proxy base url"}],children:(0,c.jsx)(y.Z,{})})]}),(0,c.jsxs)("div",{style:{textAlign:"right",marginTop:"10px",display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px"},children:[u&&(0,c.jsx)(T.ZP,{onClick:()=>h(!0),style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#5558eb",e.currentTarget.style.borderColor="#5558eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1",e.currentTarget.style.borderColor="#6366f1"},children:"Clear"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})]})]})}),(0,c.jsxs)(A.Z,{title:"Confirm Clear SSO Settings",visible:x,onOk:j,onCancel:()=>h(!1),okText:"Yes, Clear",cancelText:"Cancel",okButtonProps:{danger:!0,style:{backgroundColor:"#dc2626",borderColor:"#dc2626"}},children:[(0,c.jsx)("p",{children:"Are you sure you want to clear all SSO settings? This action cannot be undone."}),(0,c.jsx)("p",{children:"Users will no longer be able to login using SSO after this change."})]}),(0,c.jsxs)(A.Z,{title:"SSO Setup Instructions",visible:t,width:800,footer:null,onOk:i,onCancel:n,children:[(0,c.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{onClick:i,children:"Done"})})]})]})},lS=t(62272),lC=t(92403),lI=t(29271),lP=t(34419);let lA=e=>{if(!e)return"An unknown error occurred";if("string"==typeof e)return e;if(e.message)try{let s=JSON.parse(e.message);if(s.error&&s.error.message)return s.error.message;return"string"==typeof s?s:JSON.stringify(s,null,2)}catch(s){return e.message}if(e.response&&e.response.data){if("string"==typeof e.response.data)return e.response.data;if(e.response.data.message)return e.response.data.message;if(e.response.data.error)return"string"==typeof e.response.data.error?e.response.data.error:e.response.data.error.message||JSON.stringify(e.response.data.error)}return String(e)};var lE=e=>{let{accessToken:s,userID:t,proxySettings:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)("<your_proxy_base_url>");(0,d.useEffect)(()=>{let e="<your_proxy_base_url>";u(l&&l.PROXY_BASE_URL&&void 0!==l.PROXY_BASE_URL?l.PROXY_BASE_URL:window.location.origin)},[l]);let x="".concat(m,"/scim/v2"),h=async e=>{if(!s||!t){P.ZP.error("You need to be logged in to create a SCIM token");return}try{i(!0);let l={key_alias:e.key_alias||"SCIM Access Token",team_id:null,models:[],allowed_routes:["/scim/*"]},a=await (0,g.keyCreateCall)(s,t,l);o(a),P.ZP.success("SCIM token created successfully")}catch(e){console.error("Error creating SCIM token:",e),P.ZP.error("Failed to create SCIM token: "+lA(e))}finally{i(!1)}};return(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)("div",{className:"flex items-center mb-4",children:(0,c.jsx)(k.Z,{children:"SCIM Configuration"})}),(0,c.jsx)(w.Z,{className:"text-gray-600",children:"System for Cross-domain Identity Management (SCIM) allows you to automatically provision and manage users and groups in LiteLLM."}),(0,c.jsx)(ld.Z,{}),(0,c.jsxs)("div",{className:"space-y-8",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"1"}),(0,c.jsxs)(k.Z,{className:"text-lg flex items-center",children:[(0,c.jsx)(lS.Z,{className:"h-5 w-5 mr-2"}),"SCIM Tenant URL"]})]}),(0,c.jsx)(w.Z,{className:"text-gray-600 mb-3",children:"Use this URL in your identity provider SCIM integration settings."}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(y.Z,{value:x,disabled:!0,className:"flex-grow"}),(0,c.jsx)(S.CopyToClipboard,{text:x,onCopy:()=>P.ZP.success("URL copied to clipboard"),children:(0,c.jsxs)(_.Z,{variant:"primary",className:"ml-2 flex items-center",children:[(0,c.jsx)(tC.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"2"}),(0,c.jsxs)(k.Z,{className:"text-lg flex items-center",children:[(0,c.jsx)(lC.Z,{className:"h-5 w-5 mr-2"}),"Authentication Token"]})]}),(0,c.jsx)(lN.Z,{title:"Using SCIM",color:"blue",className:"mb-4",children:"You need a SCIM token to authenticate with the SCIM API. Create one below and use it in your SCIM provider configuration."}),n?(0,c.jsxs)(W.Z,{className:"border border-yellow-300 bg-yellow-50",children:[(0,c.jsxs)("div",{className:"flex items-center mb-2 text-yellow-800",children:[(0,c.jsx)(lI.Z,{className:"h-5 w-5 mr-2"}),(0,c.jsx)(k.Z,{className:"text-lg text-yellow-800",children:"Your SCIM Token"})]}),(0,c.jsx)(w.Z,{className:"text-yellow-800 mb-4 font-medium",children:"Make sure to copy this token now. You will not be able to see it again."}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(y.Z,{value:n.key,className:"flex-grow mr-2 bg-white",type:"password",disabled:!0}),(0,c.jsx)(S.CopyToClipboard,{text:n.key,onCopy:()=>P.ZP.success("Token copied to clipboard"),children:(0,c.jsxs)(_.Z,{variant:"primary",className:"flex items-center",children:[(0,c.jsx)(tC.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,c.jsxs)(_.Z,{className:"mt-4 flex items-center",variant:"secondary",onClick:()=>o(null),children:[(0,c.jsx)(lP.Z,{className:"h-4 w-4 mr-1"}),"Create Another Token"]})]}):(0,c.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,c.jsxs)(I.Z,{form:a,onFinish:h,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Token Name",rules:[{required:!0,message:"Please enter a name for your token"}],children:(0,c.jsx)(y.Z,{placeholder:"SCIM Access Token"})}),(0,c.jsx)(I.Z.Item,{children:(0,c.jsxs)(_.Z,{variant:"primary",type:"submit",loading:r,className:"flex items-center",children:[(0,c.jsx)(lC.Z,{className:"h-4 w-4 mr-1"}),"Create SCIM Token"]})})]})})]})]})]})})},lT=e=>{let{accessToken:s,onSuccess:t}=e,[l]=I.Z.useForm(),[a,r]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(s)try{let e=await (0,g.getSSOSettings)(s);if(e&&e.values){let s=e.values.ui_access_mode,t={};s&&"object"==typeof s?t={ui_access_mode_type:s.type,restricted_sso_group:s.restricted_sso_group,sso_group_jwt_field:s.sso_group_jwt_field}:"string"==typeof s&&(t={ui_access_mode_type:s,restricted_sso_group:e.values.restricted_sso_group,sso_group_jwt_field:e.values.team_ids_jwt_field||e.values.sso_group_jwt_field}),l.setFieldsValue(t)}}catch(e){console.error("Failed to load UI access settings:",e)}})()},[s,l]);let i=async e=>{if(!s){P.ZP.error("No access token available");return}r(!0);try{let l={ui_access_mode:{type:e.ui_access_mode_type,restricted_sso_group:e.restricted_sso_group,sso_group_jwt_field:e.sso_group_jwt_field}};await (0,g.updateSSOSettings)(s,l),t()}catch(e){console.error("Failed to save UI access settings:",e),P.ZP.error("Failed to save UI access settings")}finally{r(!1)}};return(0,c.jsxs)("div",{style:{padding:"16px"},children:[(0,c.jsx)("div",{style:{marginBottom:"16px"},children:(0,c.jsx)(w.Z,{style:{fontSize:"14px",color:"#6b7280"},children:"Configure who can access the UI interface and how group information is extracted from JWT tokens."})}),(0,c.jsxs)(I.Z,{form:l,onFinish:i,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"UI Access Mode",name:"ui_access_mode_type",tooltip:"Controls who can access the UI interface",children:(0,c.jsxs)(C.default,{placeholder:"Select access mode",children:[(0,c.jsx)(C.default.Option,{value:"all_authenticated_users",children:"All Authenticated Users"}),(0,c.jsx)(C.default.Option,{value:"restricted_sso_group",children:"Restricted SSO Group"})]})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.ui_access_mode_type!==s.ui_access_mode_type,children:e=>{let{getFieldValue:s}=e;return"restricted_sso_group"===s("ui_access_mode_type")?(0,c.jsx)(I.Z.Item,{label:"Restricted SSO Group",name:"restricted_sso_group",rules:[{required:!0,message:"Please enter the restricted SSO group"}],children:(0,c.jsx)(y.Z,{placeholder:"ui-access-group"})}):null}}),(0,c.jsx)(I.Z.Item,{label:"SSO Group JWT Field",name:"sso_group_jwt_field",tooltip:"JWT field name that contains team/group information. Use dot notation to access nested fields.",children:(0,c.jsx)(y.Z,{placeholder:"groups"})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"16px"},children:(0,c.jsx)(T.ZP,{type:"primary",htmlType:"submit",loading:a,style:{backgroundColor:"#6366f1",borderColor:"#6366f1"},children:"Update UI Access Control"})})]})]})},lL=t(382),lO=e=>{let{searchParams:s,accessToken:t,userID:l,showSSOBanner:a,premiumUser:r,proxySettings:i,userRole:n}=e,[o]=I.Z.useForm(),[u]=I.Z.useForm(),{Title:x,Paragraph:h}=em.default,[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(!1),[w,k]=(0,d.useState)(!1),[S,C]=(0,d.useState)(!1),[E,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(!1),[F,R]=(0,d.useState)(!1),[q,U]=(0,d.useState)(!1),[z,V]=(0,d.useState)(!1),[K,B]=(0,d.useState)(!1),[G,H]=(0,d.useState)(!1),[J,Y]=(0,d.useState)([]),[$,Q]=(0,d.useState)(null),[X,ee]=(0,d.useState)(!1);(0,m.useRouter)();let[es,et]=(0,d.useState)(null);console.log=function(){};let el=sh(),ea="All IP Addresses Allowed",er=el;er+="/fallback/login";let ei=async()=>{if(t&&r)try{let e=await (0,g.getSSOSettings)(t);if(console.log("SSO data:",e),e&&e.values){let s=e.values.google_client_id&&e.values.google_client_secret,t=e.values.microsoft_client_id&&e.values.microsoft_client_secret,l=e.values.generic_client_id&&e.values.generic_client_secret;ee(s||t||l)}else ee(!1)}catch(e){console.error("Error checking SSO configuration:",e),ee(!1)}},en=async()=>{try{if(!0!==r){P.ZP.error("This feature is only available for premium users. Please upgrade your account.");return}if(t){let e=await (0,g.getAllowedIPs)(t);Y(e&&e.length>0?e:[ea])}else Y([ea])}catch(e){console.error("Error fetching allowed IPs:",e),P.ZP.error("Failed to fetch allowed IPs ".concat(e)),Y([ea])}finally{!0===r&&U(!0)}},eo=async e=>{try{if(t){await (0,g.addAllowedIP)(t,e.ip);let s=await (0,g.getAllowedIPs)(t);Y(s),P.ZP.success("IP address added successfully")}}catch(e){console.error("Error adding IP:",e),P.ZP.error("Failed to add IP address ".concat(e))}finally{V(!1)}},ec=async e=>{Q(e),B(!0)},ed=async()=>{if($&&t)try{await (0,g.deleteAllowedIP)(t,$);let e=await (0,g.getAllowedIPs)(t);Y(e.length>0?e:[ea]),P.ZP.success("IP address deleted successfully")}catch(e){console.error("Error deleting IP:",e),P.ZP.error("Failed to delete IP address ".concat(e))}finally{B(!1),Q(null)}};(0,d.useEffect)(()=>{(async()=>{if(null!=t){let e=[],s=await (0,g.userGetAllUsersCall)(t,"proxy_admin_viewer");console.log("proxy admin viewer response: ",s);let l=s.users;console.log("proxy viewers response: ".concat(l)),l.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy viewers: ".concat(l));let a=(await (0,g.userGetAllUsersCall)(t,"proxy_admin")).users;a.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy admins: ".concat(a)),console.log("combinedList: ".concat(e)),v(e),et(await (0,g.getPossibleUserRoles)(t))}})()},[t]),(0,d.useEffect)(()=>{ei()},[t,r]);let eu=()=>{H(!1)};return console.log("admins: ".concat(null==f?void 0:f.length)),(0,c.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,c.jsx)(x,{level:4,children:"Admin Access "}),(0,c.jsx)(h,{children:"Go to 'Internal Users' page to add other admins."}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsx)(eY.Z,{children:"Security Settings"}),(0,c.jsx)(eY.Z,{children:"SCIM"}),(0,c.jsx)(eY.Z,{children:"Useful Links"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(x,{level:4,children:" ✨ Security Settings"}),(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",marginTop:"1rem",marginLeft:"0.5rem"},children:[(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:()=>!0===r?D(!0):P.ZP.error("Only premium users can add SSO"),children:X?"Edit SSO Settings":"Add SSO"})}),(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:en,children:"Allowed IPs"})}),(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:()=>!0===r?H(!0):P.ZP.error("Only premium users can configure UI access control"),children:"UI Access Control"})})]})]}),(0,c.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,c.jsx)(lk,{isAddSSOModalVisible:M,isInstructionsModalVisible:F,handleAddSSOOk:()=>{D(!1),o.resetFields(),t&&r&&ei()},handleAddSSOCancel:()=>{D(!1),o.resetFields()},handleShowInstructions:e=>{D(!1),R(!0)},handleInstructionsOk:()=>{R(!1),t&&r&&ei()},handleInstructionsCancel:()=>{R(!1),t&&r&&ei()},form:o,accessToken:t,ssoConfigured:X}),(0,c.jsx)(A.Z,{title:"Manage Allowed IP Addresses",width:800,visible:q,onCancel:()=>U(!1),footer:[(0,c.jsx)(_.Z,{className:"mx-1",onClick:()=>V(!0),children:"Add IP Address"},"add"),(0,c.jsx)(_.Z,{onClick:()=>U(!1),children:"Close"},"close")],children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"IP Address"}),(0,c.jsx)(sb.Z,{className:"text-right",children:"Action"})]})}),(0,c.jsx)(sv.Z,{children:J.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e}),(0,c.jsx)(s_.Z,{className:"text-right",children:e!==ea&&(0,c.jsx)(_.Z,{onClick:()=>ec(e),color:"red",size:"xs",children:"Delete"})})]},s))})]})}),(0,c.jsx)(A.Z,{title:"Add Allowed IP Address",visible:z,onCancel:()=>V(!1),footer:null,children:(0,c.jsxs)(I.Z,{onFinish:eo,children:[(0,c.jsx)(I.Z.Item,{name:"ip",rules:[{required:!0,message:"Please enter an IP address"}],children:(0,c.jsx)(L.default,{placeholder:"Enter IP address"})}),(0,c.jsx)(I.Z.Item,{children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add IP Address"})})]})}),(0,c.jsx)(A.Z,{title:"Confirm Delete",visible:K,onCancel:()=>B(!1),onOk:ed,footer:[(0,c.jsx)(_.Z,{className:"mx-1",onClick:()=>ed(),children:"Yes"},"delete"),(0,c.jsx)(_.Z,{onClick:()=>B(!1),children:"Close"},"close")],children:(0,c.jsxs)("p",{children:["Are you sure you want to delete the IP address: ",$,"?"]})}),(0,c.jsx)(A.Z,{title:"UI Access Control Settings",visible:G,width:600,footer:null,onOk:eu,onCancel:()=>{H(!1)},children:(0,c.jsx)(lT,{accessToken:t,onSuccess:()=>{eu(),P.ZP.success("UI Access Control settings updated successfully")}})})]}),(0,c.jsxs)(lN.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access"," ",(0,c.jsxs)("a",{href:er,target:"_blank",children:[(0,c.jsx)("b",{children:er})," "]})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lE,{accessToken:t,userID:l,proxySettings:i})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lL.Z,{accessToken:t,userRole:n||null})})]})]})]})};let{Title:lM}=em.default;var lD=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)([]);(0,d.useEffect)(()=>{i()},[s]);let i=async()=>{if(s){l(!0);try{let e=await (0,g.getEmailEventSettings)(s);r(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),P.ZP.error("Failed to fetch email event settings")}finally{l(!1)}}},n=(e,s)=>{r(a.map(t=>t.event===e?{...t,enabled:s}:t))},o=async()=>{if(s)try{await (0,g.updateEmailEventSettings)(s,{settings:a}),P.ZP.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),P.ZP.error("Failed to update email event settings")}},m=async()=>{if(s)try{await (0,g.resetEmailEventSettings)(s),P.ZP.success("Email event settings reset to defaults"),i()}catch(e){console.error("Failed to reset email event settings:",e),P.ZP.error("Failed to reset email event settings")}},u=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let s=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(s)}};return(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(lM,{level:4,children:"Email Notifications"}),(0,c.jsx)(w.Z,{children:"Select which events should trigger email notifications."}),(0,c.jsx)(Y.Z,{}),t?(0,c.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,c.jsx)(lm.Z,{size:"large"})}):(0,c.jsx)("div",{className:"space-y-4",children:a.map(e=>(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(s2.Z,{checked:e.enabled,onChange:s=>n(e.event,s.target.checked)}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)(w.Z,{children:e.event}),(0,c.jsx)("div",{className:"text-sm text-gray-500 block",children:u(e.event)})]})]},e.event))}),(0,c.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,c.jsx)(_.Z,{onClick:o,disabled:t,children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:m,variant:"secondary",disabled:t,children:"Reset to Defaults"})]})]})};let{Title:lF}=em.default;var lR=e=>{let{accessToken:s,premiumUser:t,alerts:l}=e,a=()=>{if(!s)return;let e={};l.filter(e=>"email"===e.name).forEach(s=>{var t;Object.entries(null!==(t=s.variables)&&void 0!==t?t:{}).forEach(s=>{let[t,l]=s,a=document.querySelector('input[name="'.concat(t,'"]'));a&&a.value&&(e[t]=null==a?void 0:a.value)})}),console.log("updatedVariables",e);try{(0,g.setCallbacksCall)(s,{general_settings:{alerting:["email"]},environment_variables:e})}catch(e){P.ZP.error("Failed to update alerts: "+e,20)}P.ZP.success("Email settings updated successfully")};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 mb-6",children:(0,c.jsx)(lD,{accessToken:s})}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(lF,{level:4,children:"Email Server Settings"}),(0,c.jsxs)(w.Z,{children:[(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:" LiteLLM Docs: email alerts"})," ",(0,c.jsx)("br",{})]}),(0,c.jsx)("div",{className:"flex w-full",children:l.filter(e=>"email"===e.name).map((e,s)=>{var l;return(0,c.jsx)(s_.Z,{children:(0,c.jsx)("ul",{children:(0,c.jsx)(v.Z,{numItems:2,children:Object.entries(null!==(l=e.variables)&&void 0!==l?l:{}).map(e=>{let[s,l]=e;return(0,c.jsxs)("li",{className:"mx-2 my-2",children:[!0!=t&&("EMAIL_LOGO_URL"===s||"EMAIL_SUPPORT_CONTACT"===s)?(0,c.jsxs)("div",{children:[(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,c.jsxs)(w.Z,{className:"mt-2",children:[" ","✨ ",s]})}),(0,c.jsx)(y.Z,{name:s,defaultValue:l,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-2",children:s}),(0,c.jsx)(y.Z,{name:s,defaultValue:l,type:"password",style:{width:"400px"}})]}),(0,c.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===s&&(0,c.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `[email protected]`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `[email protected]`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===s&&(0,c.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===s&&(0,c.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is [email protected]"})]})]},s)})})})},s)})}),(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>a(),children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:()=>s&&(0,g.serviceHealthCheck)(s,"email"),className:"mx-2",children:"Test Email Alerts"})]})]})},lq=e=>{let{alertingSettings:s,handleInputChange:t,handleResetField:l,handleSubmit:a,premiumUser:r}=e,[i]=I.Z.useForm();return(0,c.jsxs)(I.Z,{form:i,onFinish:()=>{console.log("INSIDE ONFINISH");let e=i.getFieldsValue(),s=Object.entries(e).every(e=>{let[s,t]=e;return"boolean"!=typeof t&&(""===t||null==t)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(s)),s?console.log("Some form fields are empty."):a(e)},labelAlign:"left",children:[s.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsxs)(s_.Z,{align:"center",children:[(0,c.jsx)(w.Z,{children:e.field_name}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?r?(0,c.jsx)(I.Z.Item,{name:e.field_name,children:(0,c.jsx)(s_.Z,{children:"Integer"===e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>t(e.field_name,s)}):"Boolean"===e.field_type?(0,c.jsx)(tE.Z,{checked:e.field_value,onChange:s=>t(e.field_name,s)}):(0,c.jsx)(L.default,{value:e.field_value,onChange:s=>t(e.field_name,s)})})}):(0,c.jsx)(s_.Z,{children:(0,c.jsx)(_.Z,{className:"flex items-center justify-center",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,c.jsx)(I.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,c.jsx)(s_.Z,{children:"Integer"===e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>t(e.field_name,s),className:"p-0"}):"Boolean"===e.field_type?(0,c.jsx)(tE.Z,{checked:e.field_value,onChange:s=>{t(e.field_name,s),i.setFieldsValue({[e.field_name]:s})}}):(0,c.jsx)(L.default,{value:e.field_value,onChange:s=>t(e.field_name,s)})})}),(0,c.jsx)(s_.Z,{children:!0==e.stored_in_db?(0,c.jsx)(eJ.Z,{icon:eZ.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,c.jsx)(eJ.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,c.jsx)(eJ.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(sj.Z,{icon:ee.Z,color:"red",onClick:()=>l(e.field_name,s),children:"Reset"})})]},s)),(0,c.jsx)("div",{children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Update Settings"})})]})},lU=e=>{let{accessToken:s,premiumUser:t}=e,[l,a]=(0,d.useState)([]);return(0,d.useEffect)(()=>{s&&(0,g.alertingSettingsCall)(s).then(e=>{a(e)})},[s]),(0,c.jsx)(lq,{alertingSettings:l,handleInputChange:(e,s)=>{let t=l.map(t=>t.field_name===e?{...t,field_value:s}:t);console.log("updatedSettings: ".concat(JSON.stringify(t))),a(t)},handleResetField:(e,t)=>{if(s)try{let s=l.map(s=>s.field_name===e?{...s,stored_in_db:null,field_value:s.field_default_value}:s);a(s)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!s||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let t={};l.forEach(e=>{t[e.field_name]=e.field_value});let a={...e,...t};console.log("mergedFormValues: ".concat(JSON.stringify(a)));let{slack_alerting:r,...i}=a;console.log("slack_alerting: ".concat(r,", alertingArgs: ").concat(JSON.stringify(i)));try{(0,g.updateConfigFieldSetting)(s,"alerting_args",i),"boolean"==typeof r&&(!0==r?(0,g.updateConfigFieldSetting)(s,"alerting",["slack"]):(0,g.updateConfigFieldSetting)(s,"alerting",[])),P.ZP.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:t})},lz=t(38994);let{Title:lV,Paragraph:lK}=em.default;var lB=e=>{let{accessToken:s,userRole:t,userID:l,premiumUser:a}=e,[r,n]=(0,d.useState)([]),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(!1),[h]=I.Z.useForm(),[p,j]=(0,d.useState)(null),[f,b]=(0,d.useState)(""),[N,Z]=(0,d.useState)({}),[k,S]=(0,d.useState)([]),[E,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)([]),[D,F]=(0,d.useState)([]),[R,q]=(0,d.useState)(!1),[U,z]=(0,d.useState)(null),[V,K]=(0,d.useState)(!1),[B,G]=(0,d.useState)(null),H=e=>{k.includes(e)?S(k.filter(s=>s!==e)):S([...k,e])},J={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,d.useEffect)(()=>{s&&t&&l&&(0,g.getCallbacksCall)(s,l,t).then(e=>{n(e.callbacks),M(e.available_callbacks);let s=e.alerts;if(s&&s.length>0){let e=s[0],t=e.variables.SLACK_WEBHOOK_URL;S(e.active_alerts),b(t),Z(e.alerts_to_webhook)}m(s)})},[s,t,l]);let Y=e=>k&&k.includes(e),$=async e=>{if(!s)return;let t={};Object.entries(e).forEach(e=>{let[s,l]=e;"callback"!==s&&(t[s]=l)});try{await (0,g.setCallbacksCall)(s,{environment_variables:t}),P.ZP.success("Callback added successfully"),x(!1),h.resetFields(),j(null)}catch(e){P.ZP.error("Failed to add callback: "+e,20)}},Q=async e=>{if(!s)return;let t=null==e?void 0:e.callback,l={};Object.entries(e).forEach(e=>{let[s,t]=e;"callback"!==s&&(l[s]=t)});try{await (0,g.setCallbacksCall)(s,{environment_variables:l,litellm_settings:{success_callback:[t]}}),P.ZP.success("Callback ".concat(t," added successfully")),x(!1),h.resetFields(),j(null)}catch(e){P.ZP.error("Failed to add callback: "+e,20)}},X=e=>{j(e.litellm_callback_name),e&&e.litellm_callback_params?F(e.litellm_callback_params):F([])},et=e=>{G(e),K(!0)},el=async()=>{if(B&&s)try{if(await (0,g.deleteCallback)(s,B),P.ZP.success("Callback ".concat(B," deleted successfully")),l&&t){let e=await (0,g.getCallbacksCall)(s,l,t);n(e.callbacks)}K(!1),G(null)}catch(e){console.error("Failed to delete callback:",e),P.ZP.error("Failed to delete callback: ".concat(e))}};return s?(0,c.jsxs)("div",{className:"w-full mx-4",children:[(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eY.Z,{value:"1",children:"Logging Callbacks"}),(0,c.jsx)(eY.Z,{value:"2",children:"Alerting Types"}),(0,c.jsx)(eY.Z,{value:"3",children:"Alerting Settings"}),(0,c.jsx)(eY.Z,{value:"4",children:"Email Alerts"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(lV,{level:4,children:"Active Logging Callbacks"}),(0,c.jsx)(v.Z,{numItems:2,children:(0,c.jsx)(W.Z,{className:"max-h-[50vh]",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(sN.Z,{children:(0,c.jsx)(sb.Z,{children:"Callback Name"})})}),(0,c.jsx)(sv.Z,{children:r.map((e,t)=>(0,c.jsxs)(sN.Z,{className:"flex justify-between",children:[(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:e.name})}),(0,c.jsx)(s_.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"flex justify-between",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>{z(e),q(!0)}}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>et(e.name),className:"text-red-500 hover:text-red-700 cursor-pointer"}),(0,c.jsx)(_.Z,{onClick:()=>(0,g.serviceHealthCheck)(s,e.name),className:"ml-2",variant:"secondary",children:"Test Callback"})]})})]},t))})]})})}),(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>L(!0),children:"Add Callback"})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(w.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,c.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{}),(0,c.jsx)(sb.Z,{}),(0,c.jsx)(sb.Z,{children:"Slack Webhook URL"})]})}),(0,c.jsx)(sv.Z,{children:Object.entries(J).map((e,s)=>{let[t,l]=e;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:"region_outage_alerts"==t?a?(0,c.jsx)(tE.Z,{id:"switch",name:"switch",checked:Y(t),onChange:()=>H(t)}):(0,c.jsx)(_.Z,{className:"flex items-center justify-center",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,c.jsx)(tE.Z,{id:"switch",name:"switch",checked:Y(t),onChange:()=>H(t)})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(w.Z,{children:l})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(y.Z,{name:t,type:"password",defaultValue:N&&N[t]?N[t]:f})})]},s)})})]}),(0,c.jsx)(_.Z,{size:"xs",className:"mt-2",onClick:()=>{if(!s)return;let e={};Object.entries(J).forEach(s=>{let[t,l]=s,a=document.querySelector('input[name="'.concat(t,'"]')),r=(null==a?void 0:a.value)||"";e[t]=r});try{(0,g.setCallbacksCall)(s,{general_settings:{alert_to_webhook_url:e,alert_types:k}})}catch(e){P.ZP.error("Failed to update alerts: "+e,20)}P.ZP.success("Alerts updated successfully")},children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:()=>(0,g.serviceHealthCheck)(s,"slack"),className:"mx-2",children:"Test Alerts"})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lU,{accessToken:s,premiumUser:a})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(lR,{accessToken:s,premiumUser:a,alerts:o})})]})]})}),(0,c.jsxs)(A.Z,{title:"Add Logging Callback",visible:E,width:800,onCancel:()=>L(!1),footer:null,children:[(0,c.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,c.jsx)(I.Z,{form:h,onFinish:Q,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(lz.Z,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,c.jsx)(C.default,{onChange:e=>{let s=O[e];s&&X(s)},children:Object.entries(i).map(e=>{var s;let[t,l]=e;return(0,c.jsx)(ed.Z,{value:es[t],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(null===(s=ei[l])||void 0===s?void 0:s.logo)?(0,c.jsx)("div",{className:"w-5 h-5 flex items-center justify-center",children:(0,c.jsx)("img",{src:ei[l].logo,alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{e.currentTarget.style.display="none"}})}):(0,c.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:l.charAt(0).toUpperCase()}),(0,c.jsx)("span",{children:l})]})},l)})})}),D&&D.map(e=>(0,c.jsx)(lz.Z,{label:e,name:e,rules:[{required:!0,message:"Please enter the value for "+e}],children:(0,c.jsx)(y.Z,{type:"password"})},e)),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})]}),(0,c.jsx)(A.Z,{visible:R,width:800,title:"Edit ".concat(null==U?void 0:U.name," Settings"),onCancel:()=>q(!1),footer:null,children:(0,c.jsxs)(I.Z,{form:h,onFinish:$,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(c.Fragment,{children:U&&U.variables&&Object.entries(U.variables).map(e=>{let[s,t]=e;return(0,c.jsx)(lz.Z,{label:s,name:s,children:(0,c.jsx)(y.Z,{type:"password",defaultValue:t})},s)})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,c.jsx)(A.Z,{title:"Confirm Delete",visible:V,onOk:el,onCancel:()=>{K(!1),G(null)},okText:"Delete",cancelText:"Cancel",okButtonProps:{danger:!0},children:(0,c.jsxs)("p",{children:["Are you sure you want to delete the callback - ",B,"? This action cannot be undone."]})})]}):null},lG=t(92414),lH=t(46030);let{Option:lJ}=C.default;var lY=e=>{let{models:s,accessToken:t,routerSettings:l,setRouterSettings:a}=e,[r]=I.Z.useForm(),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)("");return(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{className:"mx-auto",onClick:()=>n(!0),children:"+ Add Fallbacks"}),(0,c.jsx)(A.Z,{title:"Add Fallbacks",visible:i,width:800,footer:null,onOk:()=>{n(!1),r.resetFields()},onCancel:()=>{n(!1),r.resetFields()},children:(0,c.jsxs)(I.Z,{form:r,onFinish:e=>{console.log(e);let{model_name:s,models:i}=e,o=[...l.fallbacks||[],{[s]:i}],c={...l,fallbacks:o};console.log(c);try{(0,g.setCallbacksCall)(t,{router_settings:c}),a(c)}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}P.ZP.success("router settings updated successfully"),n(!1),r.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Public Model Name",name:"model_name",rules:[{required:!0,message:"Set the model to fallback for"}],help:"required",children:(0,c.jsx)(eH.Z,{defaultValue:o,children:s&&s.map((e,s)=>(0,c.jsx)(ed.Z,{value:e,onClick:()=>m(e),children:e},s))})}),(0,c.jsx)(I.Z.Item,{label:"Fallback Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,c.jsx)(lG.Z,{value:s,children:s&&s.filter(e=>e!=o).map(e=>(0,c.jsx)(lH.Z,{value:e,children:e},e))})})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add Fallbacks"})})]})})]})},lW=t(26433);async function l$(e,s){console.log=function(){},console.log("isLocal:",!1);let t=window.location.origin,l=new lW.ZP.OpenAI({apiKey:s,baseURL:t,dangerouslyAllowBrowser:!0});try{let s=await l.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});P.ZP.success((0,c.jsxs)("span",{children:["Test model=",(0,c.jsx)("strong",{children:e}),", received model=",(0,c.jsx)("strong",{children:s.model}),". See"," ",(0,c.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}let lQ={ttl:3600,lowest_latency_buffer:0},lX=e=>{let{selectedStrategy:s,strategyArgs:t,paramExplanation:l}=e;return(0,c.jsxs)(b.Z,{children:[(0,c.jsx)(Z.Z,{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Routing Strategy Specific Args"}),(0,c.jsx)(N.Z,{children:"latency-based-routing"==s?(0,c.jsx)(W.Z,{children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Setting"}),(0,c.jsx)(sb.Z,{children:"Value"})]})}),(0,c.jsx)(sv.Z,{children:Object.entries(t).map(e=>{let[s,t]=e;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(w.Z,{children:s}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:l[s]})]}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(y.Z,{name:s,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t.toString()})})]},s)})})]})}):(0,c.jsx)(w.Z,{children:"No specific settings"})})]})};var l0=e=>{let{accessToken:s,userRole:t,userID:l,modelData:a}=e,[r,i]=(0,d.useState)({}),[n,o]=(0,d.useState)({}),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p]=I.Z.useForm(),[j,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),A={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,d.useEffect)(()=>{s&&t&&l&&((0,g.getCallbacksCall)(s,l,t).then(e=>{console.log("callbacks",e);let s=e.router_settings;"model_group_retry_policy"in s&&delete s.model_group_retry_policy,i(s)}),(0,g.getGeneralSettingsCall)(s).then(e=>{u(e)}))},[s,t,l]);let E=async e=>{if(!s)return;console.log("received key: ".concat(e)),console.log("routerSettings['fallbacks']: ".concat(r.fallbacks));let t=r.fallbacks.map(s=>(e in s&&delete s[e],s)).filter(e=>Object.keys(e).length>0),l={...r,fallbacks:t};try{await (0,g.setCallbacksCall)(s,{router_settings:l}),i(l),P.ZP.success("Router settings updated successfully")}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}},T=(e,s)=>{u(m.map(t=>t.field_name===e?{...t,field_value:s}:t))},L=(e,t)=>{if(!s)return;let l=m[t].field_value;if(null!=l&&void 0!=l)try{(0,g.updateConfigFieldSetting)(s,e,l);let t=m.map(s=>s.field_name===e?{...s,stored_in_db:!0}:s);u(t)}catch(e){}},O=(e,t)=>{if(s)try{(0,g.deleteConfigFieldSetting)(s,e);let t=m.map(s=>s.field_name===e?{...s,stored_in_db:null,field_value:null}:s);u(t)}catch(e){}},M=e=>{if(!s)return;console.log("router_settings",e);let t=Object.fromEntries(Object.entries(e).map(e=>{let[s,t]=e;if("routing_strategy_args"!==s&&"routing_strategy"!==s){var l;return[s,(null===(l=document.querySelector('input[name="'.concat(s,'"]')))||void 0===l?void 0:l.value)||t]}if("routing_strategy"==s)return[s,N];if("routing_strategy_args"==s&&"latency-based-routing"==N){let e={},s=document.querySelector('input[name="lowest_latency_buffer"]'),t=document.querySelector('input[name="ttl"]');return(null==s?void 0:s.value)&&(e.lowest_latency_buffer=Number(s.value)),(null==t?void 0:t.value)&&(e.ttl=Number(t.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",t);try{(0,g.setCallbacksCall)(s,{router_settings:t})}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}P.ZP.success("router settings updated successfully")};return s?(0,c.jsx)("div",{className:"w-full mx-4",children:(0,c.jsxs)(eW.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)(e$.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eY.Z,{value:"1",children:"Loadbalancing"}),(0,c.jsx)(eY.Z,{value:"2",children:"Fallbacks"}),(0,c.jsx)(eY.Z,{value:"3",children:"General"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,c.jsx)(k.Z,{children:"Router Settings"}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Setting"}),(0,c.jsx)(sb.Z,{children:"Value"})]})}),(0,c.jsx)(sv.Z,{children:Object.entries(r).filter(e=>{let[s,t]=e;return"fallbacks"!=s&&"context_window_fallbacks"!=s&&"routing_strategy_args"!=s}).map(e=>{let[s,t]=e;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(w.Z,{children:s}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:A[s]})]}),(0,c.jsx)(s_.Z,{children:"routing_strategy"==s?(0,c.jsxs)(eH.Z,{defaultValue:t,className:"w-full max-w-md",onValueChange:Z,children:[(0,c.jsx)(ed.Z,{value:"usage-based-routing",children:"usage-based-routing"}),(0,c.jsx)(ed.Z,{value:"latency-based-routing",children:"latency-based-routing"}),(0,c.jsx)(ed.Z,{value:"simple-shuffle",children:"simple-shuffle"})]}):(0,c.jsx)(y.Z,{name:s,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t.toString()})})]},s)})})]}),(0,c.jsx)(lX,{selectedStrategy:N,strategyArgs:r&&r.routing_strategy_args&&Object.keys(r.routing_strategy_args).length>0?r.routing_strategy_args:lQ,paramExplanation:A})]}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>M(r),children:"Save Changes"})})]})}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Model Name"}),(0,c.jsx)(sb.Z,{children:"Fallbacks"})]})}),(0,c.jsx)(sv.Z,{children:r.fallbacks&&r.fallbacks.map((e,t)=>Object.entries(e).map(e=>{let[l,a]=e;return(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:l}),(0,c.jsx)(s_.Z,{children:Array.isArray(a)?a.join(", "):a}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(_.Z,{onClick:()=>l$(l,s),children:"Test Fallback"})}),(0,c.jsx)(s_.Z,{children:(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>E(l)})})]},t.toString()+l)}))})]}),(0,c.jsx)(lY,{models:(null==a?void 0:a.data)?a.data.map(e=>e.model_name):[],accessToken:s,routerSettings:r,setRouterSettings:i})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(W.Z,{children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Setting"}),(0,c.jsx)(sb.Z,{children:"Value"}),(0,c.jsx)(sb.Z,{children:"Status"}),(0,c.jsx)(sb.Z,{children:"Action"})]})}),(0,c.jsx)(sv.Z,{children:m.filter(e=>"TypedDictionary"!==e.field_type).map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(w.Z,{children:e.field_name}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,c.jsx)(s_.Z,{children:"Integer"==e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>T(e.field_name,s)}):null}),(0,c.jsx)(s_.Z,{children:!0==e.stored_in_db?(0,c.jsx)(eJ.Z,{icon:eZ.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,c.jsx)(eJ.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,c.jsx)(eJ.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,c.jsxs)(s_.Z,{children:[(0,c.jsx)(_.Z,{onClick:()=>L(e.field_name,s),children:"Update"}),(0,c.jsx)(sj.Z,{icon:ee.Z,color:"red",onClick:()=>O(e.field_name,s),children:"Reset"})]})]},s))})]})})})]})]})}):null},l1=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:l,setBudgetList:a}=e,[r]=I.Z.useForm(),i=async e=>{if(null!=t&&void 0!=t)try{P.ZP.info("Making API Call");let s=await (0,g.budgetCreateCall)(t,e);console.log("key create Response:",s),a(e=>e?[...e,s]:[s]),P.ZP.success("Budget Created"),r.resetFields()}catch(e){console.error("Error creating the key:",e),P.ZP.error("Error creating the key: ".concat(e),20)}};return(0,c.jsx)(A.Z,{title:"Create Budget",visible:s,width:800,footer:null,onOk:()=>{l(!1),r.resetFields()},onCancel:()=>{l(!1),r.resetFields()},children:(0,c.jsxs)(I.Z,{form:r,onFinish:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},l2=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:l,setBudgetList:a,existingBudget:r,handleUpdateCall:i}=e;console.log("existingBudget",r);let[n]=I.Z.useForm();(0,d.useEffect)(()=>{n.setFieldsValue(r)},[r,n]);let o=async e=>{if(null!=t&&void 0!=t)try{P.ZP.info("Making API Call"),l(!0);let s=await (0,g.budgetUpdateCall)(t,e);a(e=>e?[...e,s]:[s]),P.ZP.success("Budget Updated"),n.resetFields(),i()}catch(e){console.error("Error creating the key:",e),P.ZP.error("Error creating the key: ".concat(e),20)}};return(0,c.jsx)(A.Z,{title:"Edit Budget",visible:s,width:800,footer:null,onOk:()=>{l(!1),n.resetFields()},onCancel:()=>{l(!1),n.resetFields()},children:(0,c.jsxs)(I.Z,{form:n,onFinish:o,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:r,children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})},l4=t(17906),l5=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)(!1),[a,r]=(0,d.useState)(!1),[i,n]=(0,d.useState)(null),[o,m]=(0,d.useState)([]);(0,d.useEffect)(()=>{s&&(0,g.getBudgetList)(s).then(e=>{m(e)})},[s]);let u=async(e,t)=>{console.log("budget_id",e),null!=s&&(n(o.find(s=>s.budget_id===e)||null),r(!0))},x=async(e,t)=>{if(null==s)return;P.ZP.info("Request made"),await (0,g.budgetDeleteCall)(s,e);let l=[...o];l.splice(t,1),m(l),P.ZP.success("Budget Deleted.")},h=async()=>{null!=s&&(0,g.getBudgetList)(s).then(e=>{m(e)})};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)(_.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>l(!0),children:"+ Create Budget"}),(0,c.jsx)(l1,{accessToken:s,isModalVisible:t,setIsModalVisible:l,setBudgetList:m}),i&&(0,c.jsx)(l2,{accessToken:s,isModalVisible:a,setIsModalVisible:r,setBudgetList:m,existingBudget:i,handleUpdateCall:h}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Create a budget to assign to customers."}),(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Budget ID"}),(0,c.jsx)(sb.Z,{children:"Max Budget"}),(0,c.jsx)(sb.Z,{children:"TPM"}),(0,c.jsx)(sb.Z,{children:"RPM"})]})}),(0,c.jsx)(sv.Z,{children:o.slice().sort((e,s)=>new Date(s.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.budget_id}),(0,c.jsx)(s_.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,c.jsx)(s_.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,c.jsx)(s_.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>u(e.budget_id,s)}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>x(e.budget_id,s)})]},s))})]})]}),(0,c.jsxs)("div",{className:"mt-5",children:[(0,c.jsx)(w.Z,{className:"text-base",children:"How to use budget id"}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsx)(eY.Z,{children:"Assign Budget to Customer"}),(0,c.jsx)(eY.Z,{children:"Test it (Curl)"}),(0,c.jsx)(eY.Z,{children:"Test it (OpenAI SDK)"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.Z,{language:"bash",children:"\ncurl -X POST --location '<your_proxy_base_url>/end_user/new' \n-H 'Authorization: Bearer <your-master-key>' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"<BUDGET_ID>\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.Z,{language:"bash",children:'\ncurl -X POST --location \'<your_proxy_base_url>/chat/completions\' \n-H \'Authorization: Bearer <your-master-key>\' \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,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="<your_proxy_base_url>",\n api_key="<your_proxy_key>"\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})},l6=t(77398),l3=t.n(l6);let l8=e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}},l7=e=>{let{utcTime:s}=e;return(0,c.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:l8(s)})},l9=(e,s)=>{var t,l;return(null===(l=e.metadata)||void 0===l?void 0:null===(t=l.mcp_tool_call_metadata)||void 0===t?void 0:t.mcp_server_logo_url)?e.metadata.mcp_tool_call_metadata.mcp_server_logo_url:s?(0,sL.dr)(s).logo:""},ae=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,c.jsx)(()=>{let[e,t]=d.useState(s.getIsExpanded()),l=d.useCallback(()=>{t(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,c.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,c.jsx)("svg",{className:"w-4 h-4 transform transition-transform duration-75 ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,c.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Time",accessorKey:"startTime",cell:e=>(0,c.jsx)(l7,{utcTime:e.getValue()})},{header:"Status",accessorKey:"metadata.status",cell:e=>{let s="failure"!==(e.getValue()||"Success").toLowerCase();return(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat(s?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let s=String(e.getValue()||""),t=e.row.original.onSessionClick;return(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>null==t?void 0:t(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:"Cost",accessorKey:"spend",cell:e=>(0,c.jsxs)("span",{children:["$",eD(e.getValue()||0,6)]})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let s=String(e.getValue()||"-"),t=e.row.original.onKeyHashClick;return(0,c.jsx)(z.Z,{title:s,children:(0,c.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>null==t?void 0:t(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Model",accessorKey:"model",cell:e=>{let s=e.row.original,t=s.custom_llm_provider,l=String(e.getValue()||"");return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:l9(s,t),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)(z.Z,{title:l,children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:l})})]})}},{header:"Tokens",accessorKey:"total_tokens",cell:e=>{let s=e.row.original;return(0,c.jsxs)("span",{className:"text-sm",children:[String(s.total_tokens||"0"),(0,c.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(s.prompt_tokens||"0"),"+",String(s.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let s=e.getValue();if(!s||0===Object.keys(s).length)return"-";let t=Object.entries(s),l=t[0],a=t.slice(1);return(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,c.jsx)(z.Z,{title:(0,c.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{children:[s,": ",String(t)]},s)})}),children:(0,c.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[l[0],": ",String(l[1]),a.length>0&&" +".concat(a.length)]})})})}}],as=e=>(0,c.jsx)(eJ.Z,{color:"gray",className:"flex items-center gap-1",children:(0,c.jsx)("span",{className:"whitespace-nowrap text-xs",children:e})}),at=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,c.jsx)(()=>{let[e,t]=d.useState(s.getIsExpanded()),l=d.useCallback(()=>{t(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,c.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,c.jsx)("svg",{className:"w-4 h-4 transform transition-transform ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,c.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Timestamp",accessorKey:"updated_at",cell:e=>(0,c.jsx)(l7,{utcTime:e.getValue()})},{header:"Table Name",accessorKey:"table_name",cell:e=>{let s=e.getValue(),t=s;switch(s){case"LiteLLM_VerificationToken":t="Keys";break;case"LiteLLM_TeamTable":t="Teams";break;case"LiteLLM_OrganizationTable":t="Organizations";break;case"LiteLLM_UserTable":t="Users";break;case"LiteLLM_ProxyModelTable":t="Models";break;default:t=s}return(0,c.jsx)("span",{children:t})}},{header:"Action",accessorKey:"action",cell:e=>(0,c.jsx)("span",{children:as(e.getValue())})},{header:"Changed By",accessorKey:"changed_by",cell:e=>{let s=e.row.original.changed_by,t=e.row.original.changed_by_api_key;return(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsx)("div",{className:"font-medium",children:s}),t&&(0,c.jsx)(z.Z,{title:t,children:(0,c.jsxs)("div",{className:"text-xs text-muted-foreground max-w-[15ch] truncate",children:[" ",t]})})]})}},{header:"Affected Item ID",accessorKey:"object_id",cell:e=>(0,c.jsx)(()=>{let s=e.getValue(),[t,l]=(0,d.useState)(!1);if(!s)return(0,c.jsx)(c.Fragment,{children:"-"});let a=async()=>{try{await navigator.clipboard.writeText(String(s)),l(!0),setTimeout(()=>l(!1),1500)}catch(e){console.error("Failed to copy object ID: ",e)}};return(0,c.jsx)(z.Z,{title:t?"Copied!":String(s),children:(0,c.jsx)("span",{className:"max-w-[20ch] truncate block cursor-pointer hover:text-blue-600",onClick:a,children:String(s)})})},{})}],al=async(e,s,t,l)=>{console.log("prefetchLogDetails called with",e.length,"logs");let a=e.map(e=>{if(e.request_id)return console.log("Prefetching details for request_id:",e.request_id),l.prefetchQuery({queryKey:["logDetails",e.request_id,s],queryFn:async()=>{console.log("Fetching details for",e.request_id);let l=await (0,g.uiSpendLogDetailsCall)(t,e.request_id,s);return console.log("Received details for",e.request_id,":",l?"success":"failed"),l},staleTime:6e5,gcTime:6e5})});try{let e=await Promise.all(a);return console.log("All prefetch promises completed:",e.length),e}catch(e){throw console.error("Error in prefetchLogDetails:",e),e}};function aa(e){let{row:s,hasMessages:t,hasResponse:l,hasError:a,errorInfo:r,getRawRequest:i,formattedResponse:n}=e,o=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let t=document.execCommand("copy");if(document.body.removeChild(s),!t)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},d=async()=>{await o(JSON.stringify(i(),null,2))?P.ZP.success("Request copied to clipboard"):P.ZP.error("Failed to copy request")},m=async()=>{await o(JSON.stringify(n(),null,2))?P.ZP.success("Response copied to clipboard"):P.ZP.error("Failed to copy response")};return(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request"}),(0,c.jsx)("button",{onClick:d,className:"p-1 hover:bg-gray-200 rounded",title:"Copy request",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-96",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(i(),null,2)})})]}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsxs)("h3",{className:"text-lg font-medium",children:["Response",a&&(0,c.jsxs)("span",{className:"ml-2 text-sm text-red-600",children:["• HTTP code ",(null==r?void 0:r.error_code)||400]})]}),(0,c.jsx)("button",{onClick:m,className:"p-1 hover:bg-gray-200 rounded",title:"Copy response",disabled:!l,children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-96 bg-gray-50",children:l?(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(n(),null,2)}):(0,c.jsx)("div",{className:"text-gray-500 text-sm italic text-center py-4",children:"Response data not available"})})]})]})}let ar=e=>{var s;let{errorInfo:t}=e,[l,a]=d.useState({}),[r,i]=d.useState(!1),n=e=>{a(s=>({...s,[e]:!s[e]}))},o=t.traceback&&(s=t.traceback)?Array.from(s.matchAll(/File "([^"]+)", line (\d+)/g)).map(e=>{let t=e[1],l=e[2],a=t.split("/").pop()||t,r=e.index||0,i=s.indexOf('File "',r+1),n=i>-1?s.substring(r,i).trim():s.substring(r).trim(),o=n.split("\n"),c="";return o.length>1&&(c=o[o.length-1].trim()),{filePath:t,fileName:a,lineNumber:l,code:c,inFunction:n.includes(" in ")?n.split(" in ")[1].split("\n")[0]:""}}):[];return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"p-4 border-b",children:(0,c.jsxs)("h3",{className:"text-lg font-medium flex items-center text-red-600",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Error Details"]})}),(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"bg-red-50 rounded-md p-4 mb-4",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"text-red-800 font-medium w-20",children:"Type:"}),(0,c.jsx)("span",{className:"text-red-700",children:t.error_class||"Unknown Error"})]}),(0,c.jsxs)("div",{className:"flex mt-2",children:[(0,c.jsx)("span",{className:"text-red-800 font-medium w-20 flex-shrink-0",children:"Message:"}),(0,c.jsx)("span",{className:"text-red-700 break-words whitespace-pre-wrap",children:t.error_message||"Unknown error occurred"})]})]}),t.traceback&&(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,c.jsx)("h4",{className:"font-medium",children:"Traceback"}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsx)("button",{onClick:()=>{let e=!r;if(i(e),o.length>0){let s={};o.forEach((t,l)=>{s[l]=e}),a(s)}},className:"text-gray-500 hover:text-gray-700 flex items-center text-sm",children:r?"Collapse All":"Expand All"}),(0,c.jsxs)("button",{onClick:()=>navigator.clipboard.writeText(t.traceback||""),className:"text-gray-500 hover:text-gray-700 flex items-center",title:"Copy traceback",children:[(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,c.jsx)("span",{className:"ml-1",children:"Copy"})]})]})]}),(0,c.jsx)("div",{className:"bg-white rounded-md border border-gray-200 overflow-hidden shadow-sm",children:o.map((e,s)=>(0,c.jsxs)("div",{className:"border-b border-gray-200 last:border-b-0",children:[(0,c.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between cursor-pointer hover:bg-gray-50",onClick:()=>n(s),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{className:"text-gray-400 mr-2 w-12 text-right",children:e.lineNumber}),(0,c.jsx)("span",{className:"text-gray-600 font-medium",children:e.fileName}),(0,c.jsx)("span",{className:"text-gray-500 mx-1",children:"in"}),(0,c.jsx)("span",{className:"text-indigo-600 font-medium",children:e.inFunction||e.fileName})]}),(0,c.jsx)("svg",{className:"w-5 h-5 text-gray-500 transition-transform ".concat(l[s]?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(l[s]||!1)&&e.code&&(0,c.jsx)("div",{className:"px-12 py-2 font-mono text-sm text-gray-800 bg-gray-50 overflow-x-auto border-t border-gray-100",children:e.code})]},s))})]})]})]})},ai=e=>{let{show:s}=e;return s?(0,c.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start",children:[(0,c.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Request/Response Data Not Available"}),(0,c.jsxs)("p",{className:"text-sm text-blue-700 mt-1",children:["To view request and response details, enable prompt storage in your LiteLLM configuration by adding the following to your ",(0,c.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded",children:"proxy_config.yaml"})," file:"]}),(0,c.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"general_settings:\n store_model_in_db: true\n store_prompts_in_spend_logs: true"}),(0,c.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change."})]})]}):null};var an=t(35829);let ao=e=>{let{sessionId:s,logs:t,onBack:l}=e,[a,r]=(0,d.useState)(null),[i,n]=(0,d.useState)({}),o=t.reduce((e,s)=>e+(s.spend||0),0),m=t.reduce((e,s)=>e+(s.total_tokens||0),0),u=t.length>0?new Date(t[0].startTime):new Date;(((t.length>0?new Date(t[t.length-1].endTime):new Date).getTime()-u.getTime())/1e3).toFixed(2),t.map(e=>({time:new Date(e.startTime).toISOString(),tokens:e.total_tokens||0,cost:e.spend||0}));let x=async(e,s)=>{await eF(e)&&(n(e=>({...e,[s]:!0})),setTimeout(()=>{n(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:l,className:"mb-4",children:"Back to All Logs"}),(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsx)("h1",{className:"text-2xl font-semibold text-gray-900",children:"Session Details"}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)("p",{className:"text-sm text-gray-500 font-mono",children:s}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:i["session-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>x(s,"session-id"),className:"left-2 z-10 transition-all duration-200 ".concat(i["session-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/ui_logs_sessions",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 flex items-center gap-1",children:["Get started with session management here",(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(an.Z,{children:t.length})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Cost"}),(0,c.jsxs)(an.Z,{children:["$",eD(o,6)]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(an.Z,{children:m})]})]}),(0,c.jsx)(k.Z,{children:"Session Logs"}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(t3,{columns:ae,data:t,renderSubComponent:ag,getRowCanExpand:()=>!0,loadingMessage:"Loading logs...",noDataMessage:"No logs found"})})]})};function ac(e){let{data:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)({});if(!s||0===s.length)return null;let i=e=>new Date(1e3*e).toLocaleString(),n=(e,s)=>"".concat(((s-e)*1e3).toFixed(2),"ms"),o=(e,s)=>{let t="".concat(e,"-").concat(s);r(e=>({...e,[t]:!e[t]}))};return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Vector Store Requests"})]}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:t?"Click to collapse":"Click to expand"})]}),t&&(0,c.jsx)("div",{className:"p-4",children:s.map((e,s)=>(0,c.jsxs)("div",{className:"mb-6 last:mb-0",children:[(0,c.jsx)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Query:"}),(0,c.jsx)("span",{className:"font-mono",children:e.query})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Vector Store ID:"}),(0,c.jsx)("span",{className:"font-mono",children:e.vector_store_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,c.jsx)("span",{className:"flex items-center",children:(()=>{let{logo:s,displayName:t}=(0,sL.dr)(e.custom_llm_provider);return(0,c.jsxs)(c.Fragment,{children:[s&&(0,c.jsx)("img",{src:s,alt:"".concat(t," logo"),className:"h-5 w-5 mr-2"}),t]})})()})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:i(e.start_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:i(e.end_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsx)("span",{children:n(e.start_time,e.end_time)})]})]})]})}),(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Search Results"}),(0,c.jsx)("div",{className:"space-y-2",children:e.vector_store_search_response.data.map((e,t)=>{let l=a["".concat(s,"-").concat(t)]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,c.jsxs)("div",{className:"flex items-center p-3 bg-gray-50 cursor-pointer",onClick:()=>o(s,t),children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(l?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsxs)("span",{className:"font-medium mr-2",children:["Result ",t+1]}),(0,c.jsxs)("span",{className:"text-gray-500 text-sm",children:["Score: ",(0,c.jsx)("span",{className:"font-mono",children:e.score.toFixed(4)})]})]})]}),l&&(0,c.jsx)("div",{className:"p-3 border-t bg-white",children:e.content.map((e,s)=>(0,c.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,c.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:e.type}),(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all bg-gray-50 p-2 rounded",children:e.text})]},s))})]},t)})})]},s))})]})}function ad(e){let{data:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)(!0),[i,n]=(0,d.useState)({});if(!s)return null;let o=s.masked_entity_count?Object.values(s.masked_entity_count).reduce((e,s)=>e+s,0):0,m=e=>new Date(1e3*e).toLocaleString(),u=e=>{n(s=>({...s,[e]:!s[e]}))},x=e=>e>=.8?"text-green-600":"text-yellow-600";return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Guardrail Information"}),(0,c.jsx)("span",{className:"ml-3 px-2 py-1 rounded-md text-xs font-medium inline-block ".concat("success"===s.guardrail_status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.guardrail_status}),o>0&&(0,c.jsxs)("span",{className:"ml-3 px-2 py-1 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[o," masked ",1===o?"entity":"entities"]})]}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:t?"Click to collapse":"Click to expand"})]}),t&&(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:[(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail Name:"}),(0,c.jsx)("span",{className:"font-mono",children:s.guardrail_name})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Mode:"}),(0,c.jsx)("span",{className:"font-mono",children:s.guardrail_mode})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat("success"===s.guardrail_status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.guardrail_status})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:m(s.start_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:m(s.end_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsxs)("span",{children:[s.duration.toFixed(4),"s"]})]})]})]}),s.masked_entity_count&&Object.keys(s.masked_entity_count).length>0&&(0,c.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Masked Entity Summary"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(s.masked_entity_count).map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{className:"px-3 py-1.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[s,": ",t]},s)})})]})]}),s.guardrail_response&&s.guardrail_response.length>0&&(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>r(!a),children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsxs)("h4",{className:"font-medium",children:["Detected Entities (",s.guardrail_response.length,")"]})]}),a&&(0,c.jsx)("div",{className:"space-y-2",children:s.guardrail_response.map((e,s)=>{let t=i[s]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>u(s),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("span",{className:"font-medium mr-2",children:e.entity_type}),(0,c.jsxs)("span",{className:"font-mono ".concat(x(e.score)),children:["Score: ",e.score.toFixed(2)]})]}),(0,c.jsxs)("span",{className:"text-xs text-gray-500",children:["Position: ",e.start,"-",e.end]})]}),t&&(0,c.jsx)("div",{className:"p-3 border-t bg-white",children:(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-2",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Entity Type:"}),(0,c.jsx)("span",{children:e.entity_type})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Position:"}),(0,c.jsxs)("span",{children:["Characters ",e.start,"-",e.end]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Confidence:"}),(0,c.jsx)("span",{className:x(e.score),children:e.score.toFixed(2)})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[e.recognition_metadata&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Recognizer:"}),(0,c.jsx)("span",{children:e.recognition_metadata.recognizer_name})]}),(0,c.jsxs)("div",{className:"flex overflow-hidden",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Identifier:"}),(0,c.jsx)("span",{className:"truncate text-xs font-mono",children:e.recognition_metadata.recognizer_identifier})]})]}),e.analysis_explanation&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Explanation:"}),(0,c.jsx)("span",{children:e.analysis_explanation})]})]})]})})]},s)})})]})]})]})}let am={TEAM_ID:"Team ID",KEY_HASH:"Key Hash",REQUEST_ID:"Request ID",MODEL:"Model",USER_ID:"User ID",END_USER:"End User",STATUS:"Status",KEY_ALIAS:"Key Alias"},au="".concat("../ui/assets/","audit-logs-preview.png");function ax(e){let{userID:s,userRole:t,token:l,accessToken:a,isActive:r,premiumUser:i,allTeams:n}=e,[o,m]=(0,d.useState)(l3()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),u=(0,d.useRef)(null),x=(0,d.useRef)(null),[h,p]=(0,d.useState)(1),[j]=(0,d.useState)(50),[f,v]=(0,d.useState)({}),[_,y]=(0,d.useState)(""),[b,N]=(0,d.useState)(""),[Z,k]=(0,d.useState)(""),[S,C]=(0,d.useState)("all"),[I,P]=(0,d.useState)("all"),[A,E]=(0,d.useState)(!1),[T,L]=(0,d.useState)(!1),O=(0,sd.a)({queryKey:["all_audit_logs",a,l,t,s,o],queryFn:async()=>{if(!a||!l||!t||!s)return[];let e=l3()(o).utc().format("YYYY-MM-DD HH:mm:ss"),r=l3()().utc().format("YYYY-MM-DD HH:mm:ss"),i=[],n=1,c=1;do{let s=await (0,g.uiAuditLogsCall)(a,e,r,n,50);i=i.concat(s.audit_logs),c=s.total_pages,n++}while(n<=c);return i},enabled:!!a&&!!l&&!!t&&!!s&&r,refetchInterval:5e3,refetchIntervalInBackground:!0}),M=(0,d.useCallback)(async e=>{if(a)try{let s=(await (0,g.keyListCall)(a,null,null,e,null,null,1,10)).keys.find(s=>s.key_alias===e);s?N(s.token):N("")}catch(e){console.error("Error fetching key hash for alias:",e),N("")}},[a]);(0,d.useEffect)(()=>{if(!a)return;let e=!1,s=!1;f["Team ID"]?_!==f["Team ID"]&&(y(f["Team ID"]),e=!0):""!==_&&(y(""),e=!0),f["Key Hash"]?b!==f["Key Hash"]&&(N(f["Key Hash"]),s=!0):f["Key Alias"]?M(f["Key Alias"]):""!==b&&(N(""),s=!0),(e||s)&&p(1)},[f,a,M,_,b]),(0,d.useEffect)(()=>{p(1)},[_,b,o,Z,S,I]),(0,d.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&E(!1),x.current&&!x.current.contains(e.target)&&L(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let D=(0,d.useMemo)(()=>O.data?O.data.filter(e=>{var s,t,l,a,r,i,n;let o=!0,c=!0,d=!0,m=!0,u=!0;if(_){let r="string"==typeof e.before_value?null===(s=JSON.parse(e.before_value))||void 0===s?void 0:s.team_id:null===(t=e.before_value)||void 0===t?void 0:t.team_id,i="string"==typeof e.updated_values?null===(l=JSON.parse(e.updated_values))||void 0===l?void 0:l.team_id:null===(a=e.updated_values)||void 0===a?void 0:a.team_id;o=r===_||i===_}if(b)try{let s="string"==typeof e.before_value?JSON.parse(e.before_value):e.before_value,t="string"==typeof e.updated_values?JSON.parse(e.updated_values):e.updated_values,l=null==s?void 0:s.token,a=null==t?void 0:t.token;c="string"==typeof l&&l.includes(b)||"string"==typeof a&&a.includes(b)}catch(e){c=!1}if(Z&&(d=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(Z.toLowerCase())),"all"!==S&&(m=(null===(i=e.action)||void 0===i?void 0:i.toLowerCase())===S.toLowerCase()),"all"!==I){let s="";switch(I){case"keys":s="litellm_verificationtoken";break;case"teams":s="litellm_teamtable";break;case"users":s="litellm_usertable";break;default:s=I}u=(null===(n=e.table_name)||void 0===n?void 0:n.toLowerCase())===s}return o&&c&&d&&m&&u}):[],[O.data,_,b,Z,S,I]),F=D.length,R=Math.ceil(F/j)||1,q=(0,d.useMemo)(()=>{let e=(h-1)*j,s=e+j;return D.slice(e,s)},[D,h,j]),U=!O.data||0===O.data.length,z=(0,d.useCallback)(e=>{let{row:s}=e;return(0,c.jsx)(e=>{let{rowData:s}=e,{before_value:t,updated_values:l,table_name:a,action:r}=s,i=(e,s)=>{if(!e||0===Object.keys(e).length)return(0,c.jsx)(w.Z,{children:"N/A"});if(s){let s=Object.keys(e),t=["token","spend","max_budget"];if(s.every(e=>t.includes(e))&&s.length>0)return(0,c.jsxs)("div",{children:[s.includes("token")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Token:"})," ",e.token||"N/A"]}),s.includes("spend")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Spend:"})," ",void 0!==e.spend?"$".concat(eD(e.spend,6)):"N/A"]}),s.includes("max_budget")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Max Budget:"})," ",void 0!==e.max_budget?"$".concat(eD(e.max_budget,6)):"N/A"]})]});if(e["No differing fields detected in 'before' state"]||e["No differing fields detected in 'updated' state"]||e["No fields changed"])return(0,c.jsx)(w.Z,{children:e[Object.keys(e)[0]]})}return(0,c.jsx)("pre",{className:"p-2 bg-gray-50 border rounded text-xs overflow-auto max-h-60",children:JSON.stringify(e,null,2)})},n=t,o=l;if(("updated"===r||"rotated"===r)&&t&&l&&("LiteLLM_TeamTable"===a||"LiteLLM_UserTable"===a||"LiteLLM_VerificationToken"===a)){let e={},s={};new Set([...Object.keys(t),...Object.keys(l)]).forEach(a=>{JSON.stringify(t[a])!==JSON.stringify(l[a])&&(t.hasOwnProperty(a)&&(e[a]=t[a]),l.hasOwnProperty(a)&&(s[a]=l[a]))}),Object.keys(t).forEach(a=>{l.hasOwnProperty(a)||e.hasOwnProperty(a)||(e[a]=t[a],s[a]=void 0)}),Object.keys(l).forEach(a=>{t.hasOwnProperty(a)||s.hasOwnProperty(a)||(s[a]=l[a],e[a]=void 0)}),n=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},o=Object.keys(s).length>0?s:{"No differing fields detected in 'updated' state":"N/A"},0===Object.keys(e).length&&0===Object.keys(s).length&&(n={"No fields changed":"N/A"},o={"No fields changed":"N/A"})}return(0,c.jsxs)("div",{className:"-mx-4 p-4 bg-slate-100 border-y border-slate-300 grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Before Value:"}),i(n,"LiteLLM_VerificationToken"===a)]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Updated Value:"}),i(o,"LiteLLM_VerificationToken"===a)]})]})},{rowData:s.original})},[]);if(!i)return(0,c.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,c.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,c.jsx)(w.Z,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,c.jsx)(w.Z,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,c.jsx)("img",{src:au,alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{console.error("Failed to load audit logs preview image"),e.target.style.display="none"}})]});let V=F>0?(h-1)*j+1:0,K=Math.min(h*j,F);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4"}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,c.jsx)("h1",{className:"text-xl font-semibold py-4",children:"Audit Logs"}),(0,c.jsx)(e=>{let{show:s}=e;return s?(0,c.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start mb-6",children:[(0,c.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Audit Logs Not Available"}),(0,c.jsx)("p",{className:"text-sm text-blue-700 mt-1",children:"To enable audit logging, add the following configuration to your LiteLLM proxy configuration file:"}),(0,c.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"litellm_settings:\n store_audit_logs: true"}),(0,c.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change and proxy restart."})]})]}):null},{show:U}),(0,c.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,c.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)("input",{type:"text",placeholder:"Search by Object ID...",value:Z,onChange:e=>k(e.target.value),className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,c.jsxs)("button",{onClick:()=>{O.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,c.jsx)("svg",{className:"w-4 h-4 ".concat(O.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,c.jsx)("span",{children:"Refresh"})]})]})}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsxs)("div",{className:"relative",ref:u,children:[(0,c.jsx)("label",{htmlFor:"actionFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Action:"}),(0,c.jsxs)("button",{id:"actionFilterDisplay",onClick:()=>E(!A),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,c.jsxs)("span",{children:["all"===S&&"All Actions","created"===S&&"Created","updated"===S&&"Updated","deleted"===S&&"Deleted","rotated"===S&&"Rotated"]}),(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),A&&(0,c.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,c.jsx)("div",{className:"space-y-1",children:[{label:"All Actions",value:"all"},{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}].map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(S===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{C(e.value),E(!1)},children:e.label},e.value))})})]}),(0,c.jsxs)("div",{className:"relative",ref:x,children:[(0,c.jsx)("label",{htmlFor:"tableFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Table:"}),(0,c.jsxs)("button",{id:"tableFilterDisplay",onClick:()=>L(!T),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,c.jsxs)("span",{children:["all"===I&&"All Tables","keys"===I&&"Keys","teams"===I&&"Teams","users"===I&&"Users"]}),(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),T&&(0,c.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,c.jsx)("div",{className:"space-y-1",children:[{label:"All Tables",value:"all"},{label:"Keys",value:"keys"},{label:"Teams",value:"teams"},{label:"Users",value:"users"}].map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(I===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{P(e.value),L(!1)},children:e.label},e.value))})})]}),(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",O.isLoading?"...":V," ","-"," ",O.isLoading?"...":K," ","of"," ",O.isLoading?"...":F," ","results"]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",O.isLoading?"...":h," of"," ",O.isLoading?"...":R]}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.max(1,e-1)),disabled:O.isLoading||1===h,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.min(R,e+1)),disabled:O.isLoading||h===R,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),(0,c.jsx)(t3,{columns:at,data:q,renderSubComponent:z,getRowCanExpand:()=>!0})]})]})}let ah=(e,s,t)=>{if(e)return"".concat(l3()(s).format("MMM D, h:mm A")," - ").concat(l3()(t).format("MMM D, h:mm A"));let l=l3()(),a=l3()(s),r=l.diff(a,"minutes");if(r>=0&&r<2)return"Last 1 Minute";if(r>=2&&r<16)return"Last 15 Minutes";if(r>=16&&r<61)return"Last Hour";let i=l.diff(a,"hours");return i>=1&&i<5?"Last 4 Hours":i>=5&&i<25?"Last 24 Hours":i>=25&&i<169?"Last 7 Days":"".concat(a.format("MMM D")," - ").concat(l.format("MMM D"))};function ap(e){var s,t,l;let{accessToken:a,token:r,userRole:i,userID:n,allTeams:o,premiumUser:m}=e,[u,x]=(0,d.useState)(""),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)(!1),[_,y]=(0,d.useState)(1),[b]=(0,d.useState)(50),N=(0,d.useRef)(null),Z=(0,d.useRef)(null),w=(0,d.useRef)(null),[k,S]=(0,d.useState)(l3()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[C,I]=(0,d.useState)(l3()().format("YYYY-MM-DDTHH:mm")),[P,A]=(0,d.useState)(!1),[E,T]=(0,d.useState)(!1),[L,O]=(0,d.useState)(""),[M,D]=(0,d.useState)(""),[F,R]=(0,d.useState)(""),[q,U]=(0,d.useState)(""),[z,V]=(0,d.useState)(""),[K,B]=(0,d.useState)(null),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)(""),[W,$]=(0,d.useState)(i&&eE.lo.includes(i)),[Q,X]=(0,d.useState)("request logs"),[ee,es]=(0,d.useState)(null),[et,el]=(0,d.useState)(null),ea=(0,h.NL)(),[er,ei]=(0,d.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,d.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(er))},[er]);let[en,eo]=(0,d.useState)({value:24,unit:"hours"});(0,d.useEffect)(()=>{(async()=>{G&&a&&B({...(await (0,g.keyInfoV1Call)(a,G)).info,token:G,api_key:G})})()},[G,a]),(0,d.useEffect)(()=>{function e(e){N.current&&!N.current.contains(e.target)&&v(!1),Z.current&&!Z.current.contains(e.target)&&j(!1),w.current&&!w.current.contains(e.target)&&T(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,d.useEffect)(()=>{i&&eE.lo.includes(i)&&$(!0)},[i]);let ec=(0,sd.a)({queryKey:["logs","table",_,b,k,C,F,q,W?n:null,J,z],queryFn:async()=>{if(!a||!r||!i||!n)return{data:[],total:0,page:1,page_size:b,total_pages:0};let e=l3()(k).utc().format("YYYY-MM-DD HH:mm:ss"),s=P?l3()(C).utc().format("YYYY-MM-DD HH:mm:ss"):l3()().utc().format("YYYY-MM-DD HH:mm:ss"),t=await (0,g.uiSpendLogsCall)(a,q||void 0,F||void 0,void 0,e,s,_,b,W?n:void 0,J,z);return await al(t.data,e,a,ea),t.data=t.data.map(s=>{let t=ea.getQueryData(["logDetails",s.request_id,e]);return(null==t?void 0:t.messages)&&(null==t?void 0:t.response)&&(s.messages=t.messages,s.response=t.response),s}),t},enabled:!!a&&!!r&&!!i&&!!n&&"request logs"===Q,refetchInterval:!!er&&1===_&&15e3,refetchIntervalInBackground:!0}),{filters:ed,filteredLogs:em,allTeams:eu,allKeyAliases:ex,handleFilterChange:eh,handleFilterReset:ep}=function(e){let{logs:s,accessToken:t,startTime:l,endTime:a,pageSize:r=25,isCustomDate:i,setCurrentPage:n,userID:o,userRole:c}=e,m=(0,d.useMemo)(()=>({[am.TEAM_ID]:"",[am.KEY_HASH]:"",[am.REQUEST_ID]:"",[am.MODEL]:"",[am.USER_ID]:"",[am.END_USER]:"",[am.STATUS]:"",[am.KEY_ALIAS]:""}),[]),[u,x]=(0,d.useState)(m),[h,p]=(0,d.useState)(s),j=(0,d.useRef)(0),f=(0,d.useCallback)(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t)return;let n=Date.now();j.current=n;let o=l3()(l).utc().format("YYYY-MM-DD HH:mm:ss"),c=i?l3()(a).utc().format("YYYY-MM-DD HH:mm:ss"):l3()().utc().format("YYYY-MM-DD HH:mm:ss");try{let l=await (0,g.uiSpendLogsCall)(t,e[am.KEY_HASH]||void 0,e[am.TEAM_ID]||void 0,e[am.REQUEST_ID]||void 0,o,c,s,r,e[am.USER_ID]||void 0,e[am.END_USER]||void 0,e[am.STATUS]||void 0,e[am.MODEL]||void 0);n===j.current&&l.data&&p(l)}catch(e){console.error("Error searching users:",e)}},[t,l,a,i,r]),v=(0,d.useMemo)(()=>eA()((e,s)=>f(e,s),300),[f]);(0,d.useEffect)(()=>()=>v.cancel(),[v]);let _=(0,sd.a)({queryKey:["allKeys"],queryFn:async()=>{if(!t)throw Error("Access token required");return await sm(t)},enabled:!!t}).data||[];(0,d.useEffect)(()=>{if(!s||!s.data){p({data:[],total:0,page:1,page_size:50,total_pages:0});return}let e=[...s.data];if(u[am.TEAM_ID]&&(e=e.filter(e=>e.team_id===u[am.TEAM_ID])),u[am.STATUS]&&(e=e.filter(e=>"success"===u[am.STATUS]?!e.status||"success"===e.status:e.status===u[am.STATUS])),u[am.MODEL]&&(e=e.filter(e=>e.model===u[am.MODEL])),u[am.KEY_HASH]&&(e=e.filter(e=>e.api_key===u[am.KEY_HASH])),u[am.END_USER]&&(e=e.filter(e=>e.end_user===u[am.END_USER])),u[am.KEY_ALIAS])try{let s=u[am.KEY_ALIAS];s&&(e=e.filter(e=>{var t;return(null===(t=e.metadata)||void 0===t?void 0:t.user_api_key_alias)===s}))}catch(e){console.error("Error fetching key info for alias:",e)}let t={data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages};JSON.stringify(t)!==JSON.stringify(h)&&p(t)},[s,u,h,t]);let{data:y}=(0,sd.a)({queryKey:["allTeamsForLogFilters",t],queryFn:async()=>t&&await su(t)||[],enabled:!!t});return{filters:u,filteredLogs:h,allKeyAliases:_,allTeams:y,handleFilterChange:e=>{x(s=>{let t={...s,...e};for(let e of Object.keys(m))e in t||(t[e]=m[e]);return JSON.stringify(t)!==JSON.stringify(s)&&(n(1),v(t,1)),t})},handleFilterReset:()=>{x(m),v(m,1)}}}({logs:ec.data||{data:[],total:0,page:1,page_size:b||10,total_pages:1},accessToken:a,startTime:k,endTime:C,pageSize:b,isCustomDate:P,setCurrentPage:y,userID:n,userRole:i}),eg=(0,d.useCallback)(async e=>{if(a)try{let s=(await (0,g.keyListCall)(a,null,null,e,null,null,_,b)).keys.find(s=>s.key_alias===e);s&&U(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[a,_,b]);(0,d.useEffect)(()=>{a&&(ed["Team ID"]?R(ed["Team ID"]):R(""),Y(ed.Status||""),V(ed.Model||""),ed["Key Hash"]?U(ed["Key Hash"]):ed["Key Alias"]?eg(ed["Key Alias"]):U(""))},[ed,a,eg]);let ej=(0,sd.a)({queryKey:["sessionLogs",et],queryFn:async()=>{if(!a||!et)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,g.sessionSpendLogsCall)(a,et);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!a&&!!et});if((0,d.useEffect)(()=>{var e;(null===(e=ec.data)||void 0===e?void 0:e.data)&&ee&&!ec.data.data.some(e=>e.request_id===ee)&&es(null)},[null===(s=ec.data)||void 0===s?void 0:s.data,ee]),!a||!r||!i||!n)return null;let ef=em.data.filter(e=>!u||e.request_id.includes(u)||e.model.includes(u)||e.user&&e.user.includes(u)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>H(e),onSessionClick:e=>{e&&el(e)}}))||[],ev=(null===(l=ej.data)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.map(e=>({...e,onKeyHashClick:e=>H(e),onSessionClick:e=>{}})))||[],e_=[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>o&&0!==o.length?o.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",isSearchable:!1},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>a?(await sm(a)).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e})):[]},{name:"End User",label:"End User",isSearchable:!0,searchFn:async e=>{if(!a)return[];let s=await (0,g.allEndUsersCall)(a);return((null==s?void 0:s.end_users)||[]).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Key Hash",label:"Key Hash",isSearchable:!1}];if(et&&ej.data)return(0,c.jsx)("div",{className:"w-full p-6",children:(0,c.jsx)(ao,{sessionId:et,logs:ej.data.data,onBack:()=>el(null)})});let ey=[{label:"Last 15 Minutes",value:15,unit:"minutes"},{label:"Last Hour",value:1,unit:"hours"},{label:"Last 4 Hours",value:4,unit:"hours"},{label:"Last 24 Hours",value:24,unit:"hours"},{label:"Last 7 Days",value:7,unit:"days"}],eb=ey.find(e=>e.value===en.value&&e.unit===en.unit),eN=P?ah(P,k,C):null==eb?void 0:eb.label;return(0,c.jsx)("div",{className:"w-full p-6",children:(0,c.jsxs)(eW.Z,{defaultIndex:0,onIndexChange:e=>X(0===e?"request logs":"audit logs"),children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsx)(eY.Z,{children:"Request Logs"}),(0,c.jsx)(eY.Z,{children:"Audit Logs"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,c.jsx)("h1",{className:"text-xl font-semibold",children:et?(0,c.jsxs)(c.Fragment,{children:["Session: ",(0,c.jsx)("span",{className:"font-mono",children:et}),(0,c.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>el(null),children:"← Back to All Logs"})]}):"Request Logs"})}),K&&G&&K.api_key===G?(0,c.jsx)(sn,{keyId:G,keyData:K,accessToken:a,userID:n,userRole:i,teams:o,onClose:()=>H(null),premiumUser:m}):et?(0,c.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,c.jsx)(t3,{columns:ae,data:ev,renderSubComponent:ag,getRowCanExpand:()=>!0})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sc,{options:e_,onApplyFilters:eh,onResetFilters:ep}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:u,onChange:e=>x(e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsxs)("div",{className:"relative",ref:w,children:[(0,c.jsxs)("button",{onClick:()=>T(!E),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),eN]}),E&&(0,c.jsx)("div",{className:"absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,c.jsxs)("div",{className:"space-y-1",children:[ey.map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eN===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{I(l3()().format("YYYY-MM-DDTHH:mm")),S(l3()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eo({value:e.value,unit:e.unit}),A(!1),T(!1)},children:e.label},e.label)),(0,c.jsx)("div",{className:"border-t my-2"}),(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(P?"bg-blue-50 text-blue-600":""),onClick:()=>A(!P),children:"Custom Range"})]})})]}),(0,c.jsx)(()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,c.jsx)(tE.Z,{color:"green",checked:er,defaultChecked:!0,onChange:ei})]}),{}),(0,c.jsxs)("button",{onClick:()=>{ec.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,c.jsx)("svg",{className:"w-4 h-4 ".concat(ec.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,c.jsx)("span",{children:"Refresh"})]})]}),P&&(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{children:(0,c.jsx)("input",{type:"datetime-local",value:k,onChange:e=>{S(e.target.value),y(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,c.jsx)("span",{className:"text-gray-500",children:"to"}),(0,c.jsx)("div",{children:(0,c.jsx)("input",{type:"datetime-local",value:C,onChange:e=>{I(e.target.value),y(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",ec.isLoading?"...":em?(_-1)*b+1:0," ","-"," ",ec.isLoading?"...":em?Math.min(_*b,em.total):0," ","of"," ",ec.isLoading?"...":em?em.total:0," ","results"]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",ec.isLoading?"...":_," of"," ",ec.isLoading?"...":em?em.total_pages:1]}),(0,c.jsx)("button",{onClick:()=>y(e=>Math.max(1,e-1)),disabled:ec.isLoading||1===_,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>y(e=>Math.min(em.total_pages||1,e+1)),disabled:ec.isLoading||_===(em.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),er&&1===_&&(0,c.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-greem-200 rounded-md flex items-center justify-between",children:[(0,c.jsx)("div",{className:"flex items-center gap-2",children:(0,c.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,c.jsx)("button",{onClick:()=>ei(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,c.jsx)(t3,{columns:ae,data:ef,renderSubComponent:ag,getRowCanExpand:()=>!0})]})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(ax,{userID:n,userRole:i,token:r,accessToken:a,isActive:"audit logs"===Q,premiumUser:m,allTeams:o})})]})]})})}function ag(e){var s,t,l,a,r;let{row:i}=e,n=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},o=i.original.metadata||{},d="failure"===o.status,m=d?o.error_information:null,u=i.original.messages&&(Array.isArray(i.original.messages)?i.original.messages.length>0:Object.keys(i.original.messages).length>0),x=i.original.response&&Object.keys(n(i.original.response)).length>0,h=o.vector_store_request_metadata&&Array.isArray(o.vector_store_request_metadata)&&o.vector_store_request_metadata.length>0,p=i.original.metadata&&i.original.metadata.guardrail_information,g=p&&(null===(r=i.original.metadata)||void 0===r?void 0:r.guardrail_information.masked_entity_count)?Object.values(i.original.metadata.guardrail_information.masked_entity_count).reduce((e,s)=>e+("number"==typeof s?s:0),0):0;return(0,c.jsxs)("div",{className:"p-6 bg-gray-50 space-y-6",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"p-4 border-b",children:(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request Details"})}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 p-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Request ID:"}),(0,c.jsx)("span",{className:"font-mono text-sm",children:i.original.request_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Model:"}),(0,c.jsx)("span",{children:i.original.model})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Model ID:"}),(0,c.jsx)("span",{children:i.original.model_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Call Type:"}),(0,c.jsx)("span",{children:i.original.call_type})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,c.jsx)("span",{children:i.original.custom_llm_provider||"-"})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"API Base:"}),(0,c.jsx)(z.Z,{title:i.original.api_base||"-",children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:i.original.api_base||"-"})})]}),(null==i?void 0:null===(s=i.original)||void 0===s?void 0:s.requester_ip_address)&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"IP Address:"}),(0,c.jsx)("span",{children:null==i?void 0:null===(t=i.original)||void 0===t?void 0:t.requester_ip_address})]}),p&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail:"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-mono",children:i.original.metadata.guardrail_information.guardrail_name}),g>0&&(0,c.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[g," masked"]})]})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Tokens:"}),(0,c.jsxs)("span",{children:[i.original.total_tokens," (",i.original.prompt_tokens,"+",i.original.completion_tokens,")"]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Cost:"}),(0,c.jsxs)("span",{children:["$",eD(i.original.spend||0,6)]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Cache Hit:"}),(0,c.jsx)("span",{children:i.original.cache_hit})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat("failure"!==((null===(l=i.original.metadata)||void 0===l?void 0:l.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(a=i.original.metadata)||void 0===a?void 0:a.status)||"Success").toLowerCase()?"Success":"Failure"})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:i.original.startTime})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:i.original.endTime})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsxs)("span",{children:[i.original.duration," s."]})]})]})]})]}),(0,c.jsx)(ai,{show:!u&&!x}),(0,c.jsx)(aa,{row:i,hasMessages:u,hasResponse:x,hasError:d,errorInfo:m,getRawRequest:()=>{var e;return(null===(e=i.original)||void 0===e?void 0:e.proxy_server_request)?n(i.original.proxy_server_request):n(i.original.messages)},formattedResponse:()=>d&&m?{error:{message:m.error_message||"An error occurred",type:m.error_class||"error",code:m.error_code||"unknown",param:null}}:n(i.original.response)}),p&&(0,c.jsx)(ad,{data:i.original.metadata.guardrail_information}),h&&(0,c.jsx)(ac,{data:o.vector_store_request_metadata}),d&&m&&(0,c.jsx)(ar,{errorInfo:m}),i.original.request_tags&&Object.keys(i.original.request_tags).length>0&&(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"flex justify-between items-center p-4 border-b",children:(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request Tags"})}),(0,c.jsx)("div",{className:"p-4",children:(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(i.original.request_tags).map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[s,": ",String(t)]},s)})})})]}),i.original.metadata&&Object.keys(i.original.metadata).length>0&&(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Metadata"}),(0,c.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(i.original.metadata,null,2))},className:"p-1 hover:bg-gray-200 rounded",title:"Copy metadata",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-64",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(i.original.metadata,null,2)})})]})]})}var aj=t(36172),af=t(14042),av=e=>{let{userID:s,userRole:t,accessToken:l,userSpend:a,userMaxBudget:r,selectedTeam:i}=e;console.log("userSpend: ".concat(a));let[n,o]=(0,d.useState)(null!==a?a:0),[m,u]=(0,d.useState)(i?Number(eD(i.max_budget,4)):null);(0,d.useEffect)(()=>{if(i){if("Default Team"===i.team_alias)u(r);else{let e=!1;if(i.team_memberships)for(let t of i.team_memberships)t.user_id===s&&"max_budget"in t.litellm_budget_table&&null!==t.litellm_budget_table.max_budget&&(u(t.litellm_budget_table.max_budget),e=!0);e||u(i.max_budget)}}},[i,r]);let[x,h]=(0,d.useState)([]);(0,d.useEffect)(()=>{let e=async()=>{if(!l||!s||!t)return};(async()=>{try{if(null===s||null===t)return;if(null!==l){let e=(await (0,g.modelAvailableCall)(l,s,t)).data.map(e=>e.id);console.log("available_model_names:",e),h(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[t,l,s]),(0,d.useEffect)(()=>{null!==a&&o(a)},[a]);let p=[];i&&i.models&&(p=i.models),p&&p.includes("all-proxy-models")?(console.log("user models:",x),p=x):p&&p.includes("all-team-models")?p=i.models:p&&0===p.length&&(p=x);let j=null!==m?"$".concat(eD(Number(m),4)," limit"):"No limit",f=void 0!==n?eD(n,4):null;return console.log("spend in view user spend: ".concat(n)),(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,c.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",f]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,c.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:j})]})]})})};let a_=e=>{let{key:s,info:t}=e;return{token:s,...t}};var ay=e=>{let{topKeys:s,accessToken:t,userID:l,userRole:a,teams:r,premiumUser:i}=e,[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(null),[x,h]=(0,d.useState)(void 0),[p,j]=(0,d.useState)("table"),f=async e=>{if(t)try{let s=await (0,g.keyInfoV1Call)(t,e.api_key),l=a_(s);h(l),u(e.api_key),o(!0)}catch(e){console.error("Error fetching key info:",e)}},v=()=>{o(!1),u(null),h(void 0)};d.useEffect(()=>{let e=e=>{"Escape"===e.key&&n&&v()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n]);let y=s.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{onClick:()=>j("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===p?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,c.jsx)("button",{onClick:()=>j("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===p?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===p?(0,c.jsx)("div",{className:"relative",children:(0,c.jsx)(s$.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:y,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat(eD(e,2)):"No Key Alias",onValueChange:e=>f(e),showTooltip:!0,customTooltip:e=>{var s,t;let l=null===(t=e.payload)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.payload;return(0,c.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,c.jsxs)("div",{className:"space-y-1.5",children:[(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,c.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==l?void 0:l.key_alias})]}),(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,c.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==l?void 0:l.api_key})]}),(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,c.jsxs)("span",{className:"text-white font-medium",children:["$",eD(null==l?void 0:l.spend,2)]})]})]})})}})}):(0,c.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,c.jsx)(t3,{columns:[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.getValue(),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>f(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>"$".concat(eD(e.getValue(),2))}],data:s,renderSubComponent:()=>(0,c.jsx)(c.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),n&&m&&x&&(console.log("Rendering modal with:",{isModalOpen:n,selectedKey:m,keyData:x}),(0,c.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&v()},children:(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,c.jsx)("button",{onClick:v,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,c.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,c.jsx)("div",{className:"p-6 h-full",children:(0,c.jsx)(sn,{keyId:m,onClose:v,keyData:x,accessToken:t,userID:l,userRole:a,teams:r,premiumUser:i})})]})}))]})};function ab(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function aN(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let aZ={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6"},aw=e=>{let{active:s,payload:t,label:l}=e;if(s&&t&&t.length){let e=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),s=(e,s)=>{let t=s.substring(s.indexOf(".")+1);if(e.metrics&&t in e.metrics)return e.metrics[t]};return(0,c.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,c.jsx)("p",{className:"text-tremor-content-strong",children:l}),t.map(t=>{var l;let a=null===(l=t.dataKey)||void 0===l?void 0:l.toString();if(!a||!t.payload)return null;let r=s(t.payload,a),i=a.includes("spend"),n=void 0!==r?i?"$".concat(r.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})):r.toLocaleString():"N/A",o=aZ[t.color]||t.color;return(0,c.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:o}}),(0,c.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:e(a)})]}),(0,c.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:n})]},a)})]})}return null},ak=e=>{let{categories:s,colors:t}=e,l=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return(0,c.jsx)("div",{className:"flex items-center justify-end space-x-4",children:s.map((e,s)=>{let a=aZ[t[s]]||t[s];return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:a}}),(0,c.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:l(e)})]},e)})})},aS=e=>{var s,t;let{modelName:l,metrics:a}=e;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)(v.Z,{numItems:4,className:"gap-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(k.Z,{children:a.total_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Successful Requests"}),(0,c.jsx)(k.Z,{children:a.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(k.Z,{children:a.total_tokens.toLocaleString()}),(0,c.jsxs)(w.Z,{children:[Math.round(a.total_tokens/a.total_successful_requests)," ","avg per successful request"]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Spend"}),(0,c.jsxs)(k.Z,{children:["$",eD(a.total_spend,2)]}),(0,c.jsxs)(w.Z,{children:["$",eD(a.total_spend/a.total_successful_requests,3)," ","per successful request"]})]})]}),a.top_api_keys&&a.top_api_keys.length>0&&(0,c.jsxs)(W.Z,{className:"mt-4",children:[(0,c.jsx)(k.Z,{children:"Top API Keys by Spend"}),(0,c.jsx)("div",{className:"mt-3",children:(0,c.jsx)("div",{className:"grid grid-cols-1 gap-2",children:a.top_api_keys.map((e,s)=>(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:e.key_alias||"".concat(e.api_key.substring(0,10),"...")}),e.team_id&&(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,c.jsxs)("div",{className:"text-right",children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["$",eD(e.spend,2)]}),(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(ak,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:ab,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Requests per day"}),(0,c.jsx)(ak,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:ab,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Spend per day"}),(0,c.jsx)(ak,{categories:["metrics.spend"],colors:["green"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:aN,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Success vs Failed Requests"}),(0,c.jsx)(ak,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:ab,stack:!0,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Prompt Caching Metrics"}),(0,c.jsx)(ak,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,c.jsxs)("div",{className:"mb-2",children:[(0,c.jsxs)(w.Z,{children:["Cache Read:"," ",(null===(s=a.total_cache_read_input_tokens)||void 0===s?void 0:s.toLocaleString())||0," ","tokens"]}),(0,c.jsxs)(w.Z,{children:["Cache Creation:"," ",(null===(t=a.total_cache_creation_input_tokens)||void 0===t?void 0:t.toLocaleString())||0," ","tokens"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:ab,customTooltip:aw,showLegend:!1})]})]})]})},aC=e=>{let{modelMetrics:s}=e,t=Object.keys(s).sort((e,t)=>""===e?1:""===t?-1:s[t].total_spend-s[e].total_spend),l={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(s).forEach(e=>{l.total_requests+=e.total_requests,l.total_successful_requests+=e.total_successful_requests,l.total_tokens+=e.total_tokens,l.total_spend+=e.total_spend,l.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,l.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{l.daily_data[e.date]||(l.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),l.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,l.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,l.daily_data[e.date].total_tokens+=e.metrics.total_tokens,l.daily_data[e.date].api_requests+=e.metrics.api_requests,l.daily_data[e.date].spend+=e.metrics.spend,l.daily_data[e.date].successful_requests+=e.metrics.successful_requests,l.daily_data[e.date].failed_requests+=e.metrics.failed_requests,l.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,l.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let a=Object.entries(l.daily_data).map(e=>{let[s,t]=e;return{date:s,metrics:t}}).sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime());return(0,c.jsxs)("div",{className:"space-y-8",children:[(0,c.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,c.jsx)(k.Z,{children:"Overall Usage"}),(0,c.jsxs)(v.Z,{numItems:4,className:"gap-4 mb-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(k.Z,{children:l.total_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Successful Requests"}),(0,c.jsx)(k.Z,{children:l.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(k.Z,{children:l.total_tokens.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Spend"}),(0,c.jsxs)(k.Z,{children:["$",eD(l.total_spend,2)]})]})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Tokens Over Time"}),(0,c.jsx)(ak,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:ab,customTooltip:aw,showLegend:!1})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Requests Over Time"}),(0,c.jsx)(ak,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,c.jsx)(sW.Z,{className:"mt-4",data:a,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:ab,stack:!0,customTooltip:aw,showLegend:!1})]})]})]}),(0,c.jsx)(tx.default,{defaultActiveKey:t[0],children:t.map(e=>(0,c.jsx)(tx.default.Panel,{header:(0,c.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,c.jsx)(k.Z,{children:s[e].label||"Unknown Item"}),(0,c.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,c.jsxs)("span",{children:["$",eD(s[e].total_spend,2)]}),(0,c.jsxs)("span",{children:[s[e].total_requests.toLocaleString()," ","requests"]})]})]}),children:(0,c.jsx)(aS,{modelName:e||"Unknown Model",metrics:s[e]})},e))})]})},aI=(e,s)=>{let t=e.metadata.key_alias||"key-hash-".concat(s),l=e.metadata.team_id;return l?"".concat(t," (team_id: ").concat(l,")"):t},aP=(e,s)=>{let t={};return e.results.forEach(e=>{Object.entries(e.breakdown[s]||{}).forEach(l=>{let[a,r]=l;t[a]||(t[a]={label:"api_keys"===s?aI(r,a):a,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],daily_data:[]}),t[a].total_requests+=r.metrics.api_requests,t[a].prompt_tokens+=r.metrics.prompt_tokens,t[a].completion_tokens+=r.metrics.completion_tokens,t[a].total_tokens+=r.metrics.total_tokens,t[a].total_spend+=r.metrics.spend,t[a].total_successful_requests+=r.metrics.successful_requests,t[a].total_failed_requests+=r.metrics.failed_requests,t[a].total_cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,t[a].total_cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0,t[a].daily_data.push({date:e.date,metrics:{prompt_tokens:r.metrics.prompt_tokens,completion_tokens:r.metrics.completion_tokens,total_tokens:r.metrics.total_tokens,api_requests:r.metrics.api_requests,spend:r.metrics.spend,successful_requests:r.metrics.successful_requests,failed_requests:r.metrics.failed_requests,cache_read_input_tokens:r.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:r.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==s&&Object.entries(t).forEach(l=>{let[a,r]=l,i={};e.results.forEach(e=>{var t;let l=null===(t=e.breakdown[s])||void 0===t?void 0:t[a];l&&"api_key_breakdown"in l&&Object.entries(l.api_key_breakdown||{}).forEach(e=>{let[s,t]=e;i[s]||(i[s]={api_key:s,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),i[s].spend+=t.metrics.spend,i[s].requests+=t.metrics.api_requests,i[s].tokens+=t.metrics.total_tokens})}),t[a].top_api_keys=Object.values(i).sort((e,s)=>s.spend-e.spend).slice(0,5)}),Object.values(t).forEach(e=>{e.daily_data.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime())}),t};var aA=e=>{let{accessToken:s,entityType:t,entityId:l,userID:a,userRole:r,entityList:i,premiumUser:n}=e,[o,m]=(0,d.useState)({results:[],metadata:{total_spend:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0}}),u=aP(o,"models"),x=aP(o,"api_keys"),[h,p]=(0,d.useState)([]),[j,_]=(0,d.useState)({from:new Date(Date.now()-24192e5),to:new Date}),y=async()=>{if(!s||!j.from||!j.to)return;let e=new Date(j.from),l=new Date(j.to);if("tag"===t)m(await (0,g.tagDailyActivityCall)(s,e,l,1,h.length>0?h:null));else if("team"===t)m(await (0,g.teamDailyActivityCall)(s,e,l,1,h.length>0?h:null));else throw Error("Invalid entity type")};(0,d.useEffect)(()=>{y()},[s,j,l,h]);let b=()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=l.metrics.spend,e[t].requests+=l.metrics.api_requests,e[t].successful_requests+=l.metrics.successful_requests,e[t].failed_requests+=l.metrics.failed_requests,e[t].tokens+=l.metrics.total_tokens}catch(e){console.error("Error processing provider ".concat(t,": ").concat(e))}})}),Object.values(e).filter(e=>e.spend>0).sort((e,s)=>s.spend-e.spend)},N=e=>0===h.length?e:e.filter(e=>h.includes(e.metadata.id)),Z=()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.entities||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:l.metadata.team_alias||t,id:t}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.total_tokens+=l.metrics.total_tokens})}),N(Object.values(e).sort((e,s)=>s.metrics.spend-e.metrics.spend))};return(0,c.jsxs)("div",{style:{width:"100%"},children:[(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full mb-4",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:j,onValueChange:_})}),i&&i.length>0&&(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(w.Z,{children:["Filter by ","tag"===t?"Tags":"Teams"]}),(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select ".concat("tag"===t?"tags":"teams"," to filter..."),value:h,onChange:p,options:(()=>{if(i)return i})(),className:"mt-2",allowClear:!0})]})]}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eY.Z,{children:"Cost"}),(0,c.jsx)(eY.Z,{children:"Model Activity"}),(0,c.jsx)(eY.Z,{children:"Key Activity"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full",children:[(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(k.Z,{children:["tag"===t?"Tag":"Team"," Spend Overview"]}),(0,c.jsxs)(v.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Spend"}),(0,c.jsxs)(w.Z,{className:"text-2xl font-bold mt-2",children:["$",eD(o.metadata.total_spend,2)]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:o.metadata.total_api_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Successful Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:o.metadata.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Failed Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:o.metadata.total_failed_requests.toLocaleString()})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:o.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend"}),(0,c.jsx)(s$.Z,{data:[...o.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aN,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:l}=e;if(!l||!(null==s?void 0:s[0]))return null;let a=s[0].payload,r=Object.keys(a.breakdown.entities||{}).length;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:a.date}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",eD(a.metrics.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",a.metrics.api_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Successful: ",a.metrics.successful_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Failed: ",a.metrics.failed_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",a.metrics.total_tokens]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["tag"===t?"Total Tags":"Total Teams",": ",r]}),(0,c.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,c.jsxs)("p",{className:"font-semibold",children:["Spend by ","tag"===t?"Tag":"Team",":"]}),Object.entries(a.breakdown.entities||{}).sort((e,s)=>{let[,t]=e,[,l]=s,a=t.metrics.spend;return l.metrics.spend-a}).slice(0,5).map(e=>{let[s,t]=e;return(0,c.jsxs)("p",{className:"text-sm text-gray-600",children:[t.metadata.team_alias||s,": $",eD(t.metrics.spend,2)]},s)}),r>5&&(0,c.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",r-5," more"]})]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,c.jsxs)(k.Z,{children:["Spend Per ","tag"===t?"Tag":"Team"]}),(0,c.jsx)(sT.Z,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,c.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,c.jsxs)("span",{children:["Get Started by Tracking cost per ",t," "]}),(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-6",children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(s$.Z,{className:"mt-4 h-52",data:Z().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?"".concat(e.metadata.alias.slice(0,15),"..."):e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aN,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.metadata.alias}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eD(l.metrics.spend,4)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Requests:"," ",l.metrics.api_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-green-600",children:["Successful:"," ",l.metrics.successful_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-red-600",children:["Failed:"," ",l.metrics.failed_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens:"," ",l.metrics.total_tokens.toLocaleString()]})]})}})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"tag"===t?"Tag":"Team"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sb.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sb.Z,{children:"Tokens"})]})}),(0,c.jsx)(sv.Z,{children:Z().filter(e=>e.metrics.spend>0).map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.metadata.alias}),(0,c.jsxs)(s_.Z,{children:["$",eD(e.metrics.spend,4)]}),(0,c.jsx)(s_.Z,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ay,{topKeys:(()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:l.metadata.key_alias,team_id:l.metadata.team_id||null}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:s,userID:a,userRole:r,teams:null,premiumUser:n})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Top Models"}),(0,c.jsx)(s$.Z,{className:"mt-4 h-40",data:(()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=l.metrics.spend}catch(e){console.error("Error adding spend for ".concat(t,": ").concat(e,", got metrics: ").concat(JSON.stringify(l)))}e[t].requests+=l.metrics.api_requests,e[t].successful_requests+=l.metrics.successful_requests,e[t].failed_requests+=l.metrics.failed_requests,e[t].tokens+=l.metrics.total_tokens})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,...t}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"display_key",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$".concat(eD(e,2)),layout:"vertical",yAxisWidth:200,showLegend:!1})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsx)(k.Z,{children:"Provider Usage"}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(af.Z,{className:"mt-4 h-40",data:b(),index:"provider",category:"spend",valueFormatter:e=>"$".concat(eD(e,2)),colors:["cyan","blue","indigo","violet","purple"]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Provider"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sb.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sb.Z,{children:"Tokens"})]})}),(0,c.jsx)(sv.Z,{children:b().map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.provider}),(0,c.jsxs)(s_.Z,{children:["$",eD(e.spend,2)]}),(0,c.jsx)(s_.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:u})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:x})})]})]})]})},aE=e=>{let{isOpen:s,onClose:t,accessToken:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)("cloudzero"),[p,g]=(0,d.useState)(!1);(0,d.useEffect)(()=>{s&&l&&j()},[s,l]);let j=async()=>{u(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"}});if(e.ok){let s=await e.json();o(s),a.setFieldsValue({connection_id:s.connection_id})}else if(404!==e.status){let s=await e.json();P.ZP.error("Failed to load existing settings: ".concat(s.error||"Unknown error"))}}catch(e){console.error("Error loading CloudZero settings:",e),P.ZP.error("Failed to load existing settings")}finally{u(!1)}},f=async e=>{if(!l){P.ZP.error("No access token available");return}i(!0);try{let s={...e,timezone:"UTC"},t=await fetch(n?"/cloudzero/settings":"/cloudzero/init",{method:n?"PUT":"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(t.ok)return P.ZP.success(a.message||"CloudZero settings saved successfully"),o({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return P.ZP.error(a.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),P.ZP.error("Failed to save CloudZero settings"),!1}finally{i(!1)}},v=async()=>{if(!l){P.ZP.error("No access token available");return}g(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),s=await e.json();e.ok?(P.ZP.success(s.message||"Export to CloudZero completed successfully"),t()):P.ZP.error(s.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),P.ZP.error("Failed to export to CloudZero")}finally{g(!1)}},b=async()=>{g(!0);try{P.ZP.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),P.ZP.error("Failed to export CSV")}finally{g(!1)}},N=async()=>{if("cloudzero"===x){if(!n){let e=await a.validateFields();if(!await f(e))return}await v()}else await b()},Z=()=>{a.resetFields(),h("cloudzero"),o(null),t()},k=[{value:"cloudzero",label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,c.jsx)("span",{children:"Export to CSV"})]})}];return(0,c.jsx)(A.Z,{title:"Export Data",open:s,onCancel:Z,footer:null,width:600,destroyOnClose:!0,children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,c.jsx)(C.default,{value:x,onChange:h,options:k,className:"w-full",size:"large"})]}),"cloudzero"===x&&(0,c.jsx)("div",{children:m?(0,c.jsx)("div",{className:"flex justify-center py-8",children:(0,c.jsx)(lm.Z,{size:"large"})}):(0,c.jsxs)(c.Fragment,{children:[n&&(0,c.jsx)(lN.Z,{title:"Existing CloudZero Configuration",icon:()=>(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,c.jsxs)(w.Z,{children:["API Key: ",n.api_key_masked,(0,c.jsx)("br",{}),"Connection ID: ",n.connection_id]})}),!n&&(0,c.jsxs)(I.Z,{form:a,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,c.jsx)(y.Z,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,c.jsx)(I.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===x&&(0,c.jsx)(lN.Z,{title:"CSV Export",icon:()=>(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,c.jsx)(w.Z,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:Z,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:N,loading:r||p,disabled:r||p,children:"cloudzero"===x?"Export to CloudZero":"Export CSV"})]})]})})},aT=e=>{var s,t,l,a,r,i,n,o,m,u;let{accessToken:x,userRole:h,userID:p,teams:j,premiumUser:_}=e,[y,b]=(0,d.useState)({results:[],metadata:{}}),[N,Z]=(0,d.useState)({from:new Date(Date.now()-24192e5),to:new Date}),[S,C]=(0,d.useState)([]),[I,P]=(0,d.useState)("groups"),[A,E]=(0,d.useState)(!1),T=async()=>{x&&C(Object.values(await (0,g.tagListCall)(x)).map(e=>({label:e.name,value:e.name})))};(0,d.useEffect)(()=>{T()},[x]);let L=(null===(s=y.metadata)||void 0===s?void 0:s.total_spend)||0,O=()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{provider:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}})},M=async()=>{if(!x||!N.from||!N.to)return;let e=new Date(N.from),s=new Date(N.to);try{let t=await (0,g.userDailyActivityCall)(x,e,s);if(t.metadata.total_pages>10)throw Error("Too many pages of data (>10). Please select a smaller date range.");if(t.metadata.total_pages<=1){b(t);return}let l=[...t.results],a={...t.metadata};for(let r=2;r<=t.metadata.total_pages;r++){let t=await (0,g.userDailyActivityCall)(x,e,s,r);l.push(...t.results),t.metadata&&(a.total_spend+=t.metadata.total_spend||0,a.total_api_requests+=t.metadata.total_api_requests||0,a.total_successful_requests+=t.metadata.total_successful_requests||0,a.total_failed_requests+=t.metadata.total_failed_requests||0,a.total_tokens+=t.metadata.total_tokens||0)}b({results:l,metadata:a})}catch(e){throw console.error("Error fetching user spend data:",e),e}};(0,d.useEffect)(()=>{M()},[x,N]);let D=aP(y,"models"),F=aP(y,"api_keys"),R=aP(y,"mcp_servers");return(0,c.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"solid",className:"mt-1",children:[eE.ZL.includes(h||"")?(0,c.jsx)(eY.Z,{children:"Global Usage"}):(0,c.jsx)(eY.Z,{children:"Your Usage"}),(0,c.jsx)(eY.Z,{children:"Team Usage"}),eE.ZL.includes(h||"")?(0,c.jsx)(eY.Z,{children:"Tag Usage"}):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(v.Z,{numItems:2,className:"gap-2 w-full mb-4",children:(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:N,onValueChange:e=>{Z(e)}})})}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eY.Z,{children:"Cost"}),(0,c.jsx)(eY.Z,{children:"Model Activity"}),(0,c.jsx)(eY.Z,{children:"Key Activity"}),(0,c.jsx)(eY.Z,{children:"MCP Server Activity"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(w.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend"," ",new Date().toLocaleString("default",{month:"long"})," ","1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,c.jsx)(av,{userID:p,userRole:h,accessToken:x,userSpend:L,selectedTeam:null,userMaxBudget:null})]}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Usage Metrics"}),(0,c.jsxs)(v.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:(null===(l=y.metadata)||void 0===l?void 0:null===(t=l.total_api_requests)||void 0===t?void 0:t.toLocaleString())||0})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Successful Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:(null===(r=y.metadata)||void 0===r?void 0:null===(a=r.total_successful_requests)||void 0===a?void 0:a.toLocaleString())||0})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Failed Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:(null===(n=y.metadata)||void 0===n?void 0:null===(i=n.total_failed_requests)||void 0===i?void 0:i.toLocaleString())||0})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:(null===(m=y.metadata)||void 0===m?void 0:null===(o=m.total_tokens)||void 0===o?void 0:o.toLocaleString())||0})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Average Cost per Request"}),(0,c.jsxs)(w.Z,{className:"text-2xl font-bold mt-2",children:["$",eD((L||0)/((null===(u=y.metadata)||void 0===u?void 0:u.total_api_requests)||1),4)]})]})]})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend"}),(0,c.jsx)(s$.Z,{data:[...y.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aN,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.date}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eD(l.metrics.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Requests: ",l.metrics.api_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Successful: ",l.metrics.successful_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Failed: ",l.metrics.failed_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",l.metrics.total_tokens]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ay,{topKeys:(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:l.metadata.key_alias,team_id:null}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:x,userID:p,userRole:h,teams:null,premiumUser:_})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"groups"===I?"Top Public Model Names":"Top Litellm Models"}),(0,c.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,c.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("groups"===I?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>P("groups"),children:"Public Model Name"}),(0,c.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("individual"===I?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>P("individual"),children:"Litellm Model Name"})]})]}),(0,c.jsx)(s$.Z,{className:"mt-4 h-40",data:"groups"===I?(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.model_groups||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})():(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:aN,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.key}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eD(l.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Requests:"," ",l.requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-green-600",children:["Successful:"," ",l.successful_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-red-600",children:["Failed:"," ",l.failed_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",l.tokens.toLocaleString()]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(k.Z,{children:"Spend by Provider"})}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(af.Z,{className:"mt-4 h-40",data:O(),index:"provider",category:"spend",valueFormatter:e=>"$".concat(eD(e,2)),colors:["cyan"]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Provider"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sb.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sb.Z,{children:"Tokens"})]})}),(0,c.jsx)(sv.Z,{children:O().filter(e=>e.spend>0).map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.provider}),(0,c.jsxs)(s_.Z,{children:["$",eD(e.spend,2)]}),(0,c.jsx)(s_.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,c.jsx)(s_.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:D})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:F})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aC,{modelMetrics:R})})]})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aA,{accessToken:x,entityType:"team",userID:p,userRole:h,entityList:(null==j?void 0:j.map(e=>({label:e.team_alias,value:e.team_id})))||null,premiumUser:_})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(aA,{accessToken:x,entityType:"tag",userID:p,userRole:h,entityList:S,premiumUser:_})})]})]}),(0,c.jsx)(aE,{isOpen:A,onClose:()=>E(!1),accessToken:x})]})},aL=e=>{let{proxySettings:s}=e,t="<your_proxy_base_url>";return s&&s.PROXY_BASE_URL&&void 0!==s.PROXY_BASE_URL&&(t=s.PROXY_BASE_URL),(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(v.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,c.jsxs)("div",{className:"mb-5",children:[(0,c.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,c.jsx)(w.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,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsx)(eY.Z,{children:"OpenAI Python SDK"}),(0,c.jsx)(eY.Z,{children:"LlamaIndex"}),(0,c.jsx)(eY.Z,{children:"Langchain Py"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(t,'" # 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,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.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="'.concat(t,'", # 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="').concat(t,'",\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,c.jsx)(eQ.Z,{children:(0,c.jsx)(l4.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="'.concat(t,'",\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 ')})})]})]})]})})})},aO=t(243),aM=t(93837);async function aD(e,s,t,l,a,r,i,n,o,c,d,m,u){console.log=function(){},console.log("isLocal:",!1);let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new lW.ZP.OpenAI({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a;let h=Date.now(),g=!1,w=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0;for await(let l of(await p.chat.completions.create({model:t,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:c,messages:e,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...w?{tools:w,tool_choice:"auto"}:{}},{signal:r}))){var j,f,v,_,y,b,N,Z;console.log("Stream chunk:",l);let e=null===(j=l.choices[0])||void 0===j?void 0:j.delta;if(console.log("Delta content:",null===(v=l.choices[0])||void 0===v?void 0:null===(f=v.delta)||void 0===f?void 0:f.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!g&&((null===(y=l.choices[0])||void 0===y?void 0:null===(_=y.delta)||void 0===_?void 0:_.content)||e&&e.reasoning_content)&&(g=!0,a=Date.now()-h,console.log("First token received! Time:",a,"ms"),n?(console.log("Calling onTimingData with:",a),n(a)):console.log("onTimingData callback is not defined!")),null===(N=l.choices[0])||void 0===N?void 0:null===(b=N.delta)||void 0===b?void 0:b.content){let e=l.choices[0].delta.content;s(e,l.model)}if(e&&e.reasoning_content){let s=e.reasoning_content;i&&i(s)}if(l.usage&&o){console.log("Usage data found:",l.usage);let e={completionTokens:l.usage.completion_tokens,promptTokens:l.usage.prompt_tokens,totalTokens:l.usage.total_tokens};(null===(Z=l.usage.completion_tokens_details)||void 0===Z?void 0:Z.reasoning_tokens)&&(e.reasoningTokens=l.usage.completion_tokens_details.reasoning_tokens),o(e)}}}catch(e){throw(null==r?void 0:r.aborted)&&console.log("Chat completion request was cancelled"),e}}async function aF(e,s,t,l,a,r){console.log=function(){},console.log("isLocal:",!1);let i=(0,g.getProxyBaseUrl)(),n=new lW.ZP.OpenAI({apiKey:l,baseURL:i,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let l=await n.images.generate({model:t,prompt:e},{signal:r});if(console.log(l.data),l.data&&l.data[0]){if(l.data[0].url)s(l.data[0].url,t);else if(l.data[0].b64_json){let e=l.data[0].b64_json;s("data:image/png;base64,".concat(e),t)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==r?void 0:r.aborted)?console.log("Image generation request was cancelled"):P.ZP.error("Error occurred while generating image. Please try again. Error: ".concat(e),20),e}}async function aR(e,s,t,l,a,r,i){console.log=function(){},console.log("isLocal:",!1);let n=(0,g.getProxyBaseUrl)(),o=new lW.ZP.OpenAI({apiKey:a,baseURL:n,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{let a=await o.images.edit({model:l,image:e,prompt:s},{signal:i});if(console.log(a.data),a.data&&a.data[0]){if(a.data[0].url)t(a.data[0].url,l);else if(a.data[0].b64_json){let e=a.data[0].b64_json;t("data:image/png;base64,".concat(e),l)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==i?void 0:i.aborted)?console.log("Image edits request was cancelled"):P.ZP.error("Error occurred while editing image. Please try again. Error: ".concat(e),20),e}}async function aq(e,s,t,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,n=arguments.length>7?arguments[7]:void 0,o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!l)throw Error("API key is required");console.log=function(){};let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new lW.ZP.OpenAI({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a=Date.now(),h=!1,g=e.map(e=>({role:e.role,content:e.content,type:"message"})),_=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0,y=await p.responses.create({model:t,input:g,stream:!0,litellm_trace_id:c,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},..._?{tools:_,tool_choice:"required"}:{}},{signal:r}),b="";for await(let e of y)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var j,f,v;if("response.output_item.done"===e.type&&(null===(j=e.item)||void 0===j?void 0:j.type)==="mcp_call"&&(null===(f=e.item)||void 0===f?void 0:f.name)&&(b=e.item.name,console.log("MCP tool used:",b)),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let l=e.delta;if(console.log("Text delta",l),l.trim().length>0&&(s("assistant",l,t),!h)){h=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),n&&n(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let s=e.delta;"string"==typeof s&&i&&i(s)}if("response.completed"===e.type&&"response"in e){let s=e.response.usage;if(console.log("Usage data:",s),s&&o){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(v=s.completion_tokens_details)||void 0===v?void 0:v.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),o(e,b)}}}return y}catch(e){throw(null==r?void 0:r.aborted)?console.log("Responses API request was cancelled"):P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20),e}}var aU=t(85498);async function az(e,s,t,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,n=arguments.length>7?arguments[7]:void 0,o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!l)throw Error("API key is required");console.log=function(){};let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new aU.ZP({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a=Date.now(),h=!1,g=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0,j={model:t,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(j.vector_store_ids=d),m&&(j.guardrails=m),g&&(j.tools=g,j.tool_choice="auto"),p.messages.stream(j,{signal:r}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let l=e.delta;if(!h){h=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),n&&n(e)}"text_delta"===l.type?s("assistant",l.text,t):"reasoning_delta"===l.type&&i&&i(l.text)}if("message_delta"===e.type&&e.usage&&o){let s=e.usage;console.log("Usage data found:",s);let t={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.input_tokens+s.output_tokens};o(t)}}}catch(e){throw(null==r?void 0:r.aborted)?console.log("Anthropic messages request was cancelled"):P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20),e}}async function aV(e){try{return(await (0,g.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),P.ZP.error("Failed to fetch MCP tools"),[]}}var aK=t(49817),aB=t(94263),aG=e=>{let{endpointType:s,onEndpointChange:t,className:l}=e,a=[{value:aK.KP.CHAT,label:"/v1/chat/completions"},{value:aK.KP.RESPONSES,label:"/v1/responses"},{value:aK.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:aK.KP.IMAGE,label:"/v1/images/generations"},{value:aK.KP.IMAGE_EDITS,label:"/v1/images/edits"}];return(0,c.jsxs)("div",{className:l,children:[(0,c.jsx)(w.Z,{children:"Endpoint Type:"}),(0,c.jsx)(C.default,{showSearch:!0,value:s,style:{width:"100%"},onChange:t,options:a,className:"rounded-md"})]})},aH=e=>{let{onChange:s,value:t,className:l,accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a)try{let e=await (0,g.tagListCall)(a);console.log("List tags response:",e),i(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}})()},[]),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select tags",onChange:s,value:t,loading:n,className:l,options:r.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})},aJ=e=>{let{onChange:s,value:t,className:l,accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a){o(!0);try{let e=await (0,g.getGuardrailsList)(a);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),i(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{o(!1)}}})()},[a]),(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:t,loading:n,className:l,options:r.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})},aY=t(88658),aW=t(83322),a$=e=>{let{reasoningContent:s}=e,[t,l]=(0,d.useState)(!0);return s?(0,c.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,c.jsxs)(T.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>l(!t),icon:(0,c.jsx)(aW.Z,{}),children:[t?"Hide reasoning":"Show reasoning",t?(0,c.jsx)(tp.Z,{className:"ml-1"}):(0,c.jsx)(t$.Z,{className:"ml-1"})]}),t&&(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,c.jsx)(aO.U,{components:{code(e){let{node:s,inline:t,className:l,children:a,...r}=e,i=/language-(\w+)/.exec(l||"");return!t&&i?(0,c.jsx)(l4.Z,{style:aB.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(a).replace(/\n$/,"")}):(0,c.jsx)("code",{className:"".concat(l," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...r,children:a})}},children:s})})]}):null},aQ=t(5540),aX=t(71282),a0=t(11741),a1=t(16601),a2=t(58630),a4=e=>{let{timeToFirstToken:s,usage:t,toolName:l}=e;return s||t?(0,c.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==s&&(0,c.jsx)(z.Z,{title:"Time to first token",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(aQ.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:[(s/1e3).toFixed(2),"s"]})]})}),(null==t?void 0:t.promptTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Prompt tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(aX.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["In: ",t.promptTokens]})]})}),(null==t?void 0:t.completionTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Completion tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a0.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Out: ",t.completionTokens]})]})}),(null==t?void 0:t.reasoningTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Reasoning tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(aW.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Reasoning: ",t.reasoningTokens]})]})}),(null==t?void 0:t.totalTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Total tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a1.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Total: ",t.totalTokens]})]})}),l&&(0,c.jsx)(z.Z,{title:"Tool used",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Tool: ",l]})]})})]}):null},a5=t(61935),a6=t(69993),a3=t(71891),a8=t(44625),a7=t(57400),a9=t(26430),re=t(11894),rs=t(15883),rt=t(99890),rl=t(23907);let{TextArea:ra}=L.default,{Dragger:rr}=ex.default;var ri=e=>{let{accessToken:s,token:t,userRole:l,userID:a,disabledPersonalKeyCreation:r}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let s=e?JSON.parse(e):[];return Array.isArray(s)?s[0]||"":s}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),""}}),[h,p]=(0,d.useState)(!1),[g,j]=(0,d.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return r?"custom":"session"}),[f,v]=(0,d.useState)(()=>sessionStorage.getItem("apiKey")||""),[b,N]=(0,d.useState)(""),[Z,S]=(0,d.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[I,E]=(0,d.useState)(()=>sessionStorage.getItem("selectedModel")||void 0),[L,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)([]),F=(0,d.useRef)(null),[R,q]=(0,d.useState)(()=>sessionStorage.getItem("endpointType")||aK.KP.CHAT),[V,K]=(0,d.useState)(!1),B=(0,d.useRef)(null),[G,J]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[Y,$]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[Q,X]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[ee,es]=(0,d.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[et,el]=(0,d.useState)(null),[ea,er]=(0,d.useState)(null),[ei,en]=(0,d.useState)(!1),[eo,ec]=(0,d.useState)(""),[ed,eu]=(0,d.useState)("openai"),ex=(0,d.useRef)(null),eh=async()=>{let e="session"===g?s:f;if(e){p(!0);try{let s=await aV(e);m(s)}catch(e){console.error("Error fetching MCP tools:",e)}finally{p(!1)}}};(0,d.useEffect)(()=>{i&&eh()},[i,s,f,g]),(0,d.useEffect)(()=>{ei&&ec((0,aY.L)({apiKeySource:g,accessToken:s,apiKey:f,inputMessage:b,chatHistory:Z,selectedTags:G,selectedVectorStores:Y,selectedGuardrails:Q,endpointType:R,selectedModel:I,selectedSdk:ed}))},[ei,ed,g,s,f,b,Z,G,Y,Q,R,I]),(0,d.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(Z))},500);return()=>{clearTimeout(e)}},[Z]),(0,d.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(g)),sessionStorage.setItem("apiKey",f),sessionStorage.setItem("endpointType",R),sessionStorage.setItem("selectedTags",JSON.stringify(G)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(Y)),sessionStorage.setItem("selectedGuardrails",JSON.stringify(Q)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(u)),I?sessionStorage.setItem("selectedModel",I):sessionStorage.removeItem("selectedModel"),ee?sessionStorage.setItem("messageTraceId",ee):sessionStorage.removeItem("messageTraceId")},[g,f,I,R,G,Y,Q,ee,u]),(0,d.useEffect)(()=>{let e="session"===g?s:f;if(!e||!t||!l||!a){console.log("userApiKey or token or userRole or userID is missing = ",e,t,l,a);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let s=await tu(e);console.log("Fetched models:",s),s.length>0&&(D(s),I||E(s[0].model_group))}catch(e){console.error("Error fetching model info:",e)}})(),eh()},[s,a,l,g,f,t]),(0,d.useEffect)(()=>{ex.current&&setTimeout(()=>{var e;null===(e=ex.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[Z]);let ep=(e,s,t)=>{console.log("updateTextUI called with:",e,s,t),S(l=>{let a=l[l.length-1];if(!a||a.role!==e||a.isImage)return[...l,{role:e,content:s,model:t}];{var r;let e={...a,content:a.content+s,model:null!==(r=a.model)&&void 0!==r?r:t};return[...l.slice(0,-1),e]}})},eg=e=>{S(s=>{let t=s[s.length-1];return t&&"assistant"===t.role&&!t.isImage?[...s.slice(0,s.length-1),{...t,reasoningContent:(t.reasoningContent||"")+e}]:s.length>0&&"user"===s[s.length-1].role?[...s,{role:"assistant",content:"",reasoningContent:e}]:s})},ej=e=>{console.log("updateTimingData called with:",e),S(s=>{let t=s[s.length-1];if(console.log("Current last message:",t),t&&"assistant"===t.role){console.log("Updating assistant message with timeToFirstToken:",e);let l=[...s.slice(0,s.length-1),{...t,timeToFirstToken:e}];return console.log("Updated chat history:",l),l}return t&&"user"===t.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...s,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),s)})},ev=(e,s)=>{console.log("Received usage data:",e),S(t=>{let l=t[t.length-1];if(l&&"assistant"===l.role){console.log("Updating message with usage data:",e);let a={...l,usage:e,toolName:s};return console.log("Updated message:",a),[...t.slice(0,t.length-1),a]}return t})},e_=(e,s)=>{S(t=>[...t,{role:"assistant",content:e,model:s,isImage:!0}])},ey=()=>{ea&&URL.revokeObjectURL(ea),el(null),er(null)},eb=async()=>{if(""===b.trim())return;if(R===aK.KP.IMAGE_EDITS&&!et){P.ZP.error("Please upload an image for editing");return}if(!t||!l||!a)return;let e="session"===g?s:f;if(!e){P.ZP.error("Please provide an API key or select Current UI Session");return}B.current=new AbortController;let r=B.current.signal,i={role:"user",content:b},n=ee||(0,aM.Z)();ee||es(n),S([...Z,i]),K(!0);try{if(I){if(R===aK.KP.CHAT){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aD(s,(e,s)=>ep("assistant",e,s),I,e,G,r,eg,ej,ev,n,Y.length>0?Y:void 0,Q.length>0?Q:void 0,u)}else if(R===aK.KP.IMAGE)await aF(b,(e,s)=>e_(e,s),I,e,G,r);else if(R===aK.KP.IMAGE_EDITS)et&&await aR(et,b,(e,s)=>e_(e,s),I,e,G,r);else if(R===aK.KP.RESPONSES){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aq(s,(e,s,t)=>ep(e,s,t),I,e,G,r,eg,ej,ev,n,Y.length>0?Y:void 0,Q.length>0?Q:void 0,u)}else if(R===aK.KP.ANTHROPIC_MESSAGES){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await az(s,(e,s,t)=>ep(e,s,t),I,e,G,r,eg,ej,ev,n,Y.length>0?Y:void 0,Q.length>0?Q:void 0,u)}}}catch(e){r.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),ep("assistant","Error fetching response:"+e))}finally{K(!1),B.current=null,R===aK.KP.IMAGE_EDITS&&ey()}N("")};if(l&&"Admin Viewer"===l){let{Title:e,Paragraph:s}=em.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to test models"})]})}let eN=(0,c.jsx)(a5.Z,{style:{fontSize:24},spin:!0});return(0,c.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,c.jsx)(W.Z,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,c.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,c.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,c.jsx)(k.Z,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(lC.Z,{className:"mr-2"})," API Key Source"]}),(0,c.jsx)(C.default,{disabled:r,value:g,style:{width:"100%"},onChange:e=>{j(e),x("")},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===g&&(0,c.jsx)(y.Z,{className:"mt-2",placeholder:"Enter custom API key",type:"password",onValueChange:v,value:f,icon:lC.Z})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a6.Z,{className:"mr-2"})," Select Model"]}),(0,c.jsx)(C.default,{value:I,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),E(e),O("custom"===e)},options:[...Array.from(new Set(M.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),L&&(0,c.jsx)(y.Z,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{E(e)},500)}})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(tJ.Z,{className:"mr-2"})," Endpoint Type"]}),(0,c.jsx)(aG,{endpointType:R,onEndpointChange:e=>{q(e),e!==aK.KP.RESPONSES&&x("")},className:"mb-4"})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a3.Z,{className:"mr-2"})," Tags"]}),(0,c.jsx)(aH,{value:G,onChange:J,className:"mb-4",accessToken:s||""})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-2"})," MCP Tool",(0,c.jsx)(z.Z,{className:"ml-1",title:"Select an MCP tool to use in your conversation, only available for virtual keys and /v1/responses endpoint",children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(C.default,{style:{width:"100%"},placeholder:"Select MCP tool",value:u,onChange:e=>x(e),loading:h,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:!("custom"===g&&R===aK.KP.RESPONSES),children:Array.isArray(o)&&o.map(e=>(0,c.jsx)(C.default.Option,{value:e.name,label:(0,c.jsx)("div",{className:"font-medium",children:e.name}),children:(0,c.jsxs)("div",{className:"flex flex-col py-1",children:[(0,c.jsx)("span",{className:"font-medium",children:e.name}),(0,c.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a8.Z,{className:"mr-2"})," Vector Store",(0,c.jsx)(z.Z,{className:"ml-1",title:(0,c.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store ",(0,c.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(H,{value:Y,onChange:$,className:"mb-4",accessToken:s||""})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a7.Z,{className:"mr-2"})," Guardrails",(0,c.jsx)(z.Z,{className:"ml-1",title:(0,c.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails ",(0,c.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(aJ,{value:Q,onChange:X,className:"mb-4",accessToken:s||""})]}),(0,c.jsx)("div",{className:"space-y-2 mt-4",children:(0,c.jsx)(_.Z,{onClick:()=>{S([]),es(null),ey(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),P.ZP.success("Chat history cleared.")},className:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:a9.Z,children:"Clear Chat"})})]})]}),(0,c.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,c.jsx)(k.Z,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,c.jsx)("div",{className:"flex gap-2",children:(0,c.jsx)(_.Z,{onClick:()=>en(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:re.Z,children:"Get Code"})})]}),(0,c.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===Z.length&&(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a6.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(w.Z,{children:"Start a conversation or generate an image"})]}),Z.map((e,s)=>(0,c.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,c.jsx)(rs.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,c.jsx)(a6.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,c.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,c.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,c.jsx)(a$,{reasoningContent:e.reasoningContent}),(0,c.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,c.jsx)("img",{src:e.content,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):(0,c.jsx)(aO.U,{components:{code(e){let{node:s,inline:t,className:l,children:a,...r}=e,i=/language-(\w+)/.exec(l||"");return!t&&i?(0,c.jsx)(l4.Z,{style:aB.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...r,children:String(a).replace(/\n$/,"")}):(0,c.jsx)("code",{className:"".concat(l," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...r,children:a})},pre:e=>{let{node:s,...t}=e;return(0,c.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...t})}},children:e.content}),"assistant"===e.role&&(e.timeToFirstToken||e.usage)&&(0,c.jsx)(a4,{timeToFirstToken:e.timeToFirstToken,usage:e.usage,toolName:e.toolName})]})]})},s)),V&&(0,c.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,c.jsx)(lm.Z,{indicator:eN})}),(0,c.jsx)("div",{ref:ex,style:{height:"1px"}})]}),(0,c.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[R===aK.KP.IMAGE_EDITS&&(0,c.jsx)("div",{className:"mb-4",children:et?(0,c.jsxs)("div",{className:"relative inline-block",children:[(0,c.jsx)("img",{src:ea||"",alt:"Upload preview",className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,c.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:ey,children:(0,c.jsx)(ef.Z,{})})]}):(0,c.jsxs)(rr,{beforeUpload:e=>(el(e),er(URL.createObjectURL(e)),!1),accept:"image/*",showUploadList:!1,className:"border-dashed border-2 border-gray-300 rounded-lg p-4",children:[(0,c.jsx)("p",{className:"ant-upload-drag-icon",children:(0,c.jsx)(rt.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,c.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag image to upload"}),(0,c.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats"})]})}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(ra,{value:b,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eb())},placeholder:R===aK.KP.CHAT||R===aK.KP.RESPONSES||R===aK.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":R===aK.KP.IMAGE_EDITS?"Describe how you want to edit the image...":"Describe the image you want to generate...",disabled:V,className:"flex-1",autoSize:{minRows:1,maxRows:6},style:{resize:"none",paddingRight:"10px",paddingLeft:"10px"}}),V?(0,c.jsx)(_.Z,{onClick:()=>{B.current&&(B.current.abort(),B.current=null,K(!1),P.ZP.info("Request cancelled"))},className:"ml-2 bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:ef.Z,children:"Cancel"}):(0,c.jsx)(_.Z,{onClick:eb,className:"ml-2 text-white",icon:R===aK.KP.CHAT||R===aK.KP.RESPONSES||R===aK.KP.ANTHROPIC_MESSAGES?rl.Z:a6.Z,children:R===aK.KP.CHAT||R===aK.KP.RESPONSES||R===aK.KP.ANTHROPIC_MESSAGES?"Send":R===aK.KP.IMAGE_EDITS?"Edit":"Generate"})]})]})]})]})}),(0,c.jsxs)(A.Z,{title:"Generated Code",visible:ei,onCancel:()=>en(!1),footer:null,width:800,children:[(0,c.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,c.jsx)(C.default,{value:ed,onChange:e=>eu(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,c.jsx)(T.ZP,{onClick:()=>{navigator.clipboard.writeText(eo),P.ZP.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,c.jsx)(l4.Z,{language:"python",style:aB.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:eo})]}),"custom"===g&&(0,c.jsx)(A.Z,{title:"Select MCP Tool",visible:i,onCancel:()=>n(!1),onOk:()=>{n(!1),P.ZP.success("MCP tool selection updated")},width:800,children:h?(0,c.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,c.jsx)(lm.Z,{indicator:(0,c.jsx)(a5.Z,{style:{fontSize:24},spin:!0})})}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(w.Z,{className:"text-gray-600 block mb-4",children:"Select the MCP tool you want to use in your conversation."}),(0,c.jsx)(C.default,{style:{width:"100%"},placeholder:"Select MCP tool",value:u,onChange:e=>x(e),optionLabelProp:"label",allowClear:!0,children:o.map(e=>(0,c.jsx)(C.default.Option,{value:e.name,label:(0,c.jsx)("div",{className:"font-medium",children:e.name}),children:(0,c.jsxs)("div",{className:"flex flex-col py-1",children:[(0,c.jsx)("span",{className:"font-medium",children:e.name}),(0,c.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})},rn=t(19226),ro=t(45937),rc=t(28595),rd=t(68208),rm=t(9775),ru=t(41361),rx=t(37527),rh=t(88009),rp=t(48231),rg=t(41169),rj=t(55322),rf=t(76865),rv=t(70525),r_=t(95805),ry=t(51817),rb=t(21047);t(22135),t(40875);var rN=t(49663);let rZ=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter(Boolean).join(" ")};function rw(e){let{accessToken:s,width:t=220}=e,[l,a]=(0,d.useState)(!1),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{if(s){u(!0),h(null);try{let e=await (0,g.getRemainingUsers)(s);o(e)}catch(e){console.error("Failed to fetch usage data:",e),h("Failed to load usage data")}finally{u(!1)}}})()},[s]);let{isOverLimit:p,isNearLimit:j,usagePercentage:f,userMetrics:v,teamMetrics:_}=(e=>{if(!e)return{isOverLimit:!1,isNearLimit:!1,usagePercentage:0,userMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0},teamMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0}};let s=!!e.total_users_remaining&&e.total_users_remaining<=0,t=!!e.total_users_remaining&&e.total_users_remaining<=5&&e.total_users_remaining>0,l=e.total_users?e.total_users_used/e.total_users*100:0,a=!!e.total_teams_remaining&&e.total_teams_remaining<=0,r=!!e.total_teams_remaining&&e.total_teams_remaining<=5&&e.total_teams_remaining>0,i=e.total_teams?e.total_teams_used/e.total_teams*100:0,n=s||a;return{isOverLimit:n,isNearLimit:(t||r)&&!n,usagePercentage:Math.max(l,i),userMetrics:{isOverLimit:s,isNearLimit:t,usagePercentage:l},teamMetrics:{isOverLimit:a,isNearLimit:r,usagePercentage:i}}})(n),y=()=>p?"red":j?"yellow":"green",b=()=>p?"Over Limit":j?"Near Limit":"Active",N=()=>p?(0,c.jsx)(rf.Z,{className:"h-3 w-3"}):j?(0,c.jsx)(rv.Z,{className:"h-3 w-3"}):null;return s&&((null==n?void 0:n.total_users)!==null||(null==n?void 0:n.total_teams)!==null)?(0,c.jsx)("div",{className:"fixed bottom-4 left-4 z-50",style:{width:"".concat(Math.min(t,220),"px")},children:(0,c.jsx)(()=>{if(r){let e=p||j;return(0,c.jsx)("button",{onClick:()=>i(!1),className:rZ("bg-white border border-gray-200 rounded-lg shadow-sm p-3 hover:shadow-md transition-all w-full",e&&p&&"border-red-200 bg-red-50",e&&j&&"border-yellow-200 bg-yellow-50"),title:"Show usage details",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(r_.Z,{className:"h-4 w-4 flex-shrink-0"}),e&&(0,c.jsx)("span",{className:"flex-shrink-0",children:N()}),(0,c.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium truncate",children:[n&&null!==n.total_users&&(0,c.jsxs)("span",{className:"flex-shrink-0",children:["U: ",n.total_users_used,"/",n.total_users]}),n&&null!==n.total_teams&&(0,c.jsxs)("span",{className:"flex-shrink-0",children:["T: ",n.total_teams_used,"/",n.total_teams]}),!n||null===n.total_users&&null===n.total_teams&&(0,c.jsx)("span",{className:"truncate",children:"Usage"})]})]})})}return m?(0,c.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 w-full",children:(0,c.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,c.jsx)(ry.Z,{className:"h-4 w-4 animate-spin"}),(0,c.jsx)("span",{className:"text-sm text-gray-500 truncate",children:"Loading..."})]})}):x||!n?(0,c.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 group w-full",children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex-1 min-w-0",children:(0,c.jsx)("span",{className:"text-sm text-gray-500 truncate block",children:x||"No data"})}),(0,c.jsx)("button",{onClick:()=>i(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,c.jsx)(rb.Z,{className:"h-3 w-3 text-gray-400"})})]})}):(0,c.jsxs)("div",{className:rZ("bg-white border rounded-lg shadow-sm p-3 transition-all duration-200 group w-full",p&&"border-red-200 bg-red-50",j&&"border-yellow-200 bg-yellow-50"),children:[(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,c.jsx)(r_.Z,{className:"h-4 w-4 flex-shrink-0"}),(0,c.jsx)("span",{className:"font-medium text-sm truncate",children:"Usage"}),(p||j)&&(0,c.jsx)(eJ.Z,{color:y(),className:"text-xs px-1.5 py-0.5 flex-shrink-0",children:b()})]}),(0,c.jsx)("button",{onClick:()=>i(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,c.jsx)(rb.Z,{className:"h-3 w-3 text-gray-400"})})]}),(0,c.jsxs)("div",{className:"space-y-3 text-sm",children:[null!==n.total_users&&(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-600 mb-1",children:[(0,c.jsx)(r_.Z,{className:"h-3 w-3"}),(0,c.jsx)("span",{className:"font-medium",children:"Users"})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[n.total_users_used,"/",n.total_users]})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,c.jsx)("span",{className:rZ("font-medium text-right",v.isOverLimit&&"text-red-600",v.isNearLimit&&"text-yellow-600"),children:n.total_users_remaining})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[Math.round(v.usagePercentage),"%"]})]}),(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,c.jsx)("div",{className:rZ("h-2 rounded-full transition-all duration-300",v.isOverLimit&&"bg-red-500",v.isNearLimit&&"bg-yellow-500",!v.isOverLimit&&!v.isNearLimit&&"bg-green-500"),style:{width:"".concat(Math.min(v.usagePercentage,100),"%")}})})]}),null!==n.total_teams&&(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-600 mb-1",children:[(0,c.jsx)(rN.Z,{className:"h-3 w-3"}),(0,c.jsx)("span",{className:"font-medium",children:"Teams"})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[n.total_teams_used,"/",n.total_teams]})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,c.jsx)("span",{className:rZ("font-medium text-right",_.isOverLimit&&"text-red-600",_.isNearLimit&&"text-yellow-600"),children:n.total_teams_remaining})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[Math.round(_.usagePercentage),"%"]})]}),(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,c.jsx)("div",{className:rZ("h-2 rounded-full transition-all duration-300",_.isOverLimit&&"bg-red-500",_.isNearLimit&&"bg-yellow-500",!_.isOverLimit&&!_.isNearLimit&&"bg-green-500"),style:{width:"".concat(Math.min(_.usagePercentage,100),"%")}})})]})]})]})},{})}):null}let{Sider:rk}=rn.default;var rS=e=>{let{accessToken:s,setPage:t,userRole:l,defaultSelectedKey:a}=e,r=[{key:"1",page:"api-keys",label:"Virtual Keys",icon:(0,c.jsx)(lC.Z,{})},{key:"3",page:"llm-playground",label:"Test Key",icon:(0,c.jsx)(rc.Z,{}),roles:eE.LQ},{key:"2",page:"models",label:"Models + Endpoints",icon:(0,c.jsx)(rd.Z,{}),roles:eE.LQ},{key:"12",page:"new_usage",label:"Usage",icon:(0,c.jsx)(rm.Z,{}),roles:[...eE.ZL,...eE.lo]},{key:"6",page:"teams",label:"Teams",icon:(0,c.jsx)(ru.Z,{})},{key:"17",page:"organizations",label:"Organizations",icon:(0,c.jsx)(rx.Z,{}),roles:eE.ZL},{key:"5",page:"users",label:"Internal Users",icon:(0,c.jsx)(rs.Z,{}),roles:eE.ZL},{key:"14",page:"api_ref",label:"API Reference",icon:(0,c.jsx)(tJ.Z,{})},{key:"16",page:"model-hub-table",label:"Model Hub",icon:(0,c.jsx)(rh.Z,{})},{key:"15",page:"logs",label:"Logs",icon:(0,c.jsx)(rp.Z,{})},{key:"11",page:"guardrails",label:"Guardrails",icon:(0,c.jsx)(a7.Z,{}),roles:eE.ZL},{key:"26",page:"tools",label:"Tools",icon:(0,c.jsx)(a2.Z,{}),children:[{key:"18",page:"mcp-servers",label:"MCP Servers",icon:(0,c.jsx)(a2.Z,{})},{key:"21",page:"vector-stores",label:"Vector Stores",icon:(0,c.jsx)(a8.Z,{}),roles:eE.ZL}]},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,c.jsx)(rg.Z,{}),children:[{key:"9",page:"caching",label:"Caching",icon:(0,c.jsx)(a8.Z,{}),roles:eE.ZL},{key:"10",page:"budgets",label:"Budgets",icon:(0,c.jsx)(rx.Z,{}),roles:eE.ZL},{key:"20",page:"transform-request",label:"API Playground",icon:(0,c.jsx)(tJ.Z,{}),roles:[...eE.ZL,...eE.lo]},{key:"19",page:"tag-management",label:"Tag Management",icon:(0,c.jsx)(a3.Z,{}),roles:eE.ZL},{key:"4",page:"usage",label:"Old Usage",icon:(0,c.jsx)(rm.Z,{})}]},{key:"settings",page:"settings",label:"Settings",icon:(0,c.jsx)(rj.Z,{}),roles:eE.ZL,children:[{key:"11",page:"general-settings",label:"Router Settings",icon:(0,c.jsx)(rj.Z,{}),roles:eE.ZL},{key:"8",page:"settings",label:"Logging & Alerts",icon:(0,c.jsx)(rj.Z,{}),roles:eE.ZL},{key:"13",page:"admin-panel",label:"Admin Settings",icon:(0,c.jsx)(rj.Z,{}),roles:eE.ZL}]}],i=(e=>{let s=r.find(s=>s.page===e);if(s)return s.key;for(let s of r)if(s.children){let t=s.children.find(s=>s.page===e);if(t)return t.key}return"1"})(a),n=r.filter(e=>{let s=!e.roles||e.roles.includes(l);return console.log("Menu item ".concat(e.label,": roles=").concat(e.roles,", userRole=").concat(l,", hasAccess=").concat(s)),!!s&&(e.children&&(e.children=e.children.filter(e=>!e.roles||e.roles.includes(l))),!0)});return(0,c.jsx)(rn.default,{style:{minHeight:"100vh"},children:(0,c.jsxs)(rk,{theme:"light",width:220,children:[(0,c.jsx)(ro.Z,{mode:"inline",selectedKeys:[i],defaultOpenKeys:["llm-tools"],style:{borderRight:0,backgroundColor:"transparent",fontSize:"14px"},items:n.map(e=>{var s;return{key:e.key,icon:e.icon,label:e.label,children:null===(s=e.children)||void 0===s?void 0:s.map(e=>({key:e.key,icon:e.icon,label:e.label,onClick:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}})),onClick:e.children?void 0:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}}})}),(0,eE.tY)(l)&&(0,c.jsx)(rw,{accessToken:s,width:220})]})})},rC=t(96889);console.log("process.env.NODE_ENV","production");let rI=e=>null!==e&&("Admin"===e||"Admin Viewer"===e);var rP=e=>{let{accessToken:s,token:t,userRole:l,userID:a,keys:r,premiumUser:i}=e,n=new Date,[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,y]=(0,d.useState)([]),[b,N]=(0,d.useState)([]),[Z,S]=(0,d.useState)([]),[C,I]=(0,d.useState)([]),[P,A]=(0,d.useState)([]),[E,T]=(0,d.useState)([]),[L,O]=(0,d.useState)([]),[M,D]=(0,d.useState)({}),[F,R]=(0,d.useState)([]),[q,U]=(0,d.useState)(""),[z,V]=(0,d.useState)(["all-tags"]),[K,B]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)(0),$=new Date(n.getFullYear(),n.getMonth(),1),Q=new Date(n.getFullYear(),n.getMonth()+1,0),X=er($),ee=er(Q);function es(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",r),console.log("premium user in usage",i);let et=async()=>{if(s)try{let e=await (0,g.getProxyUISettings)(s);return console.log("usage tab: proxy_settings",e),e}catch(e){console.error("Error fetching proxy settings:",e)}};(0,d.useEffect)(()=>{ea(K.from,K.to)},[K,z]);let el=async(e,t,l)=>{if(!e||!t||!s)return;console.log("uiSelectedKey",l);let a=await (0,g.adminTopEndUsersCall)(s,l,e.toISOString(),t.toISOString());console.log("End user data updated successfully",a),y(a)},ea=async(e,t)=>{if(!e||!t||!s)return;let l=await et();null!=l&&l.DISABLE_EXPENSIVE_DB_QUERIES||(S((await (0,g.tagsSpendLogsCall)(s,e.toISOString(),t.toISOString(),0===z.length?void 0:z)).spend_per_tag),console.log("Tag spend data updated successfully"))};function er(e){let s=e.getFullYear(),t=e.getMonth()+1,l=e.getDate();return"".concat(s,"-").concat(t<10?"0"+t:t,"-").concat(l<10?"0"+l:l)}console.log("Start date is ".concat(X)),console.log("End date is ".concat(ee));let ei=async(e,s,t)=>{try{let t=await e();s(t)}catch(e){console.error(t,e)}},en=(e,s,t,l)=>{let a=[],r=new Date(s),i=e=>{if(e.includes("-"))return e;{let[s,t]=e.split(" ");return new Date(new Date().getFullYear(),new Date("".concat(s," 01 2024")).getMonth(),parseInt(t)).toISOString().split("T")[0]}},n=new Map(e.map(e=>{let s=i(e.date);return[s,{...e,date:s}]}));for(;r<=t;){let e=r.toISOString().split("T")[0];if(n.has(e))a.push(n.get(e));else{let s={date:e,api_requests:0,total_tokens:0};l.forEach(e=>{s[e]||(s[e]=0)}),a.push(s)}r.setDate(r.getDate()+1)}return a},eo=async()=>{if(s)try{let e=await (0,g.adminSpendLogsCall)(s),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=en(e,l,a,[]),i=Number(r.reduce((e,s)=>e+(s.spend||0),0).toFixed(2));Y(i),m(r)}catch(e){console.error("Error fetching overall spend:",e)}},ec=()=>ei(()=>s&&t?(0,g.adminspendByProvider)(s,t,X,ee):Promise.reject("No access token or token"),O,"Error fetching provider spend"),em=async()=>{s&&await ei(async()=>(await (0,g.adminTopKeysCall)(s)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),x,"Error fetching top keys")},eu=async()=>{s&&await ei(async()=>(await (0,g.adminTopModelsCall)(s)).map(e=>({key:e.model,spend:eD(e.total_spend,2)})),p,"Error fetching top models")},ex=async()=>{s&&await ei(async()=>{let e=await (0,g.teamSpendLogsCall)(s),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0);return N(en(e.daily_spend,l,a,e.teams)),A(e.teams),e.total_spend_per_team.map(e=>({name:e.team_id||"",value:eD(e.total_spend||0,2)}))},T,"Error fetching team spend")},eh=()=>{s&&ei(async()=>(await (0,g.allTagNamesCall)(s)).tag_names,I,"Error fetching tag names")},ep=()=>{s&&ei(()=>{var e,t;return(0,g.tagsSpendLogsCall)(s,null===(e=K.from)||void 0===e?void 0:e.toISOString(),null===(t=K.to)||void 0===t?void 0:t.toISOString(),void 0)},e=>S(e.spend_per_tag),"Error fetching top tags")},eg=()=>{s&&ei(()=>(0,g.adminTopEndUsersCall)(s,null,void 0,void 0),y,"Error fetching top end users")},ej=async()=>{if(s)try{let e=await (0,g.adminGlobalActivity)(s,X,ee),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=en(e.daily_data||[],l,a,["api_requests","total_tokens"]);D({...e,daily_data:r})}catch(e){console.error("Error fetching global activity:",e)}},ef=async()=>{if(s)try{let e=await (0,g.adminGlobalActivityPerModel)(s,X,ee),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=e.map(e=>({...e,daily_data:en(e.daily_data||[],l,a,["api_requests","total_tokens"])}));R(r)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,d.useEffect)(()=>{(async()=>{if(s&&t&&l&&a){let e=await et();e&&(H(e),null!=e&&e.DISABLE_EXPENSIVE_DB_QUERIES)||(console.log("fetching data - valiue of proxySettings",G),eo(),ec(),em(),eu(),ej(),ef(),rI(l)&&(ex(),eh(),ep(),eg()))}})()},[s,t,l,a,X,ee]),null==G?void 0:G.DISABLE_EXPENSIVE_DB_QUERIES)?(0,c.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Database Query Limit Reached"}),(0,c.jsxs)(w.Z,{className:"mt-4",children:["SpendLogs in DB has ",G.NUM_SPEND_LOGS_ROWS," rows.",(0,c.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,c.jsx)(_.Z,{className:"mt-4",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,c.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mt-2",children:[(0,c.jsx)(eY.Z,{children:"All Up"}),rI(l)?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(eY.Z,{children:"Team Based Usage"}),(0,c.jsx)(eY.Z,{children:"Customer Usage"}),(0,c.jsx)(eY.Z,{children:"Tag Based Usage"})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{})})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eY.Z,{children:"Cost"}),(0,c.jsx)(eY.Z,{children:"Activity"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(w.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 - ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,c.jsx)(av,{userID:a,userRole:l,accessToken:s,userSpend:J,selectedTeam:null,userMaxBudget:null})]}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Monthly Spend"}),(0,c.jsx)(s$.Z,{data:o,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$ ".concat(eD(e,2)),yAxisWidth:100,tickGap:5})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ay,{topKeys:u,accessToken:s,userID:a,userRole:l,teams:null,premiumUser:i})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(W.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top Models"}),(0,c.jsx)(s$.Z,{className:"mt-4 h-40",data:h,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>"$".concat(eD(e,2))})]})}),(0,c.jsx)(f.Z,{numColSpan:1}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{className:"mb-2",children:[(0,c.jsx)(k.Z,{children:"Spend by Provider"}),(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(af.Z,{className:"mt-4 h-40",variant:"pie",data:L,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>"$".concat(eD(e,2))})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sf.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Provider"}),(0,c.jsx)(sb.Z,{children:"Spend"})]})}),(0,c.jsx)(sv.Z,{children:L.map(e=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.provider}),(0,c.jsx)(s_.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":eD(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"All Up"}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",es(M.sum_api_requests)]}),(0,c.jsx)(sW.Z,{className:"h-40",data:M.daily_data,valueFormatter:es,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",es(M.sum_total_tokens)]}),(0,c.jsx)(s$.Z,{className:"h-40",data:M.daily_data,valueFormatter:es,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,c.jsx)(c.Fragment,{children:F.map((e,s)=>(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:e.model}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",es(e.sum_api_requests)]}),(0,c.jsx)(sW.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:es,onValueChange:e=>console.log(e)})]}),(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sT.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",es(e.sum_total_tokens)]}),(0,c.jsx)(s$.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:es,onValueChange:e=>console.log(e)})]})]})]},s))})]})})]})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(W.Z,{className:"mb-2",children:[(0,c.jsx)(k.Z,{children:"Total Spend Per Team"}),(0,c.jsx)(rC.Z,{data:E})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend Per Team"}),(0,c.jsx)(s$.Z,{className:"h-72",data:b,showLegend:!0,index:"date",categories:P,yAxisWidth:80,stack:!0})]})]}),(0,c.jsx)(f.Z,{numColSpan:2})]})}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls ",(0,c.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:K,onValueChange:e=>{B(e),el(e.from,e.to,null)}})}),(0,c.jsxs)(f.Z,{children:[(0,c.jsx)(w.Z,{children:"Select Key"}),(0,c.jsxs)(eH.Z,{defaultValue:"all-keys",children:[(0,c.jsx)(ed.Z,{value:"all-keys",onClick:()=>{el(K.from,K.to,null)},children:"All Keys"},"all-keys"),null==r?void 0:r.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,c.jsx)(ed.Z,{value:String(s),onClick:()=>{el(K.from,K.to,e.token)},children:e.key_alias},s):null)]})]})]}),(0,c.jsx)(W.Z,{className:"mt-4",children:(0,c.jsxs)(sf.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(sb.Z,{children:"Customer"}),(0,c.jsx)(sb.Z,{children:"Spend"}),(0,c.jsx)(sb.Z,{children:"Total Events"})]})}),(0,c.jsx)(sv.Z,{children:null==j?void 0:j.map((e,s)=>(0,c.jsxs)(sN.Z,{children:[(0,c.jsx)(s_.Z,{children:e.end_user}),(0,c.jsx)(s_.Z,{children:eD(e.total_spend,2)}),(0,c.jsx)(s_.Z,{children:e.total_count})]},s))})]})})]}),(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(sY,{className:"mb-4",value:K,onValueChange:e=>{B(e),ea(e.from,e.to)}})}),(0,c.jsx)(f.Z,{children:i?(0,c.jsx)("div",{children:(0,c.jsxs)(lG.Z,{value:z,onValueChange:e=>V(e),children:[(0,c.jsx)(lH.Z,{value:"all-tags",onClick:()=>V(["all-tags"]),children:"All Tags"},"all-tags"),C&&C.filter(e=>"all-tags"!==e).map((e,s)=>(0,c.jsx)(lH.Z,{value:String(e),children:e},e))]})}):(0,c.jsx)("div",{children:(0,c.jsxs)(lG.Z,{value:z,onValueChange:e=>V(e),children:[(0,c.jsx)(lH.Z,{value:"all-tags",onClick:()=>V(["all-tags"]),children:"All Tags"},"all-tags"),C&&C.filter(e=>"all-tags"!==e).map((e,s)=>(0,c.jsxs)(ed.Z,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(k.Z,{children:"Spend Per Tag"}),(0,c.jsxs)(w.Z,{children:["Get Started by Tracking cost per tag ",(0,c.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,c.jsx)(s$.Z,{className:"h-72",data:Z,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,c.jsx)(f.Z,{numColSpan:2})]})]})]})]})})},rA=t(51853);let rE=e=>{let{responseTimeMs:s}=e;return null==s?null:(0,c.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-500 font-mono",children:[(0,c.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{d:"M12 6V12L16 14M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,c.jsxs)("span",{children:[s.toFixed(0),"ms"]})]})},rT=e=>{let s=e;if("string"==typeof s)try{s=JSON.parse(s)}catch(e){}return s},rL=e=>{let{label:s,value:t}=e,[l,a]=d.useState(!1),[r,i]=d.useState(!1),n=(null==t?void 0:t.toString())||"N/A",o=n.length>50?n.substring(0,50)+"...":n;return(0,c.jsx)("tr",{className:"hover:bg-gray-50",children:(0,c.jsx)("td",{className:"px-4 py-2 align-top",colSpan:2,children:(0,c.jsxs)("div",{className:"flex items-center justify-between group",children:[(0,c.jsxs)("div",{className:"flex items-center flex-1",children:[(0,c.jsx)("button",{onClick:()=>a(!l),className:"text-gray-400 hover:text-gray-600 mr-2",children:l?"▼":"▶"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-sm text-gray-600",children:s}),(0,c.jsx)("pre",{className:"mt-1 text-sm font-mono text-gray-800 whitespace-pre-wrap",children:l?n:o})]})]}),(0,c.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2e3)},className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-gray-600",children:(0,c.jsx)(rA.Z,{className:"h-4 w-4"})})]})})})},rO=e=>{var s,t,l,a,r,i,n,o,d,m,u,x,h,p;let{response:g}=e,j=null,f={},v={};try{if(null==g?void 0:g.error)try{let e="string"==typeof g.error.message?JSON.parse(g.error.message):g.error.message;j={message:(null==e?void 0:e.message)||"Unknown error",traceback:(null==e?void 0:e.traceback)||"No traceback available",litellm_params:(null==e?void 0:e.litellm_cache_params)||{},health_check_cache_params:(null==e?void 0:e.health_check_cache_params)||{}},f=rT(j.litellm_params)||{},v=rT(j.health_check_cache_params)||{}}catch(e){console.warn("Error parsing error details:",e),j={message:String(g.error.message||"Unknown error"),traceback:"Error parsing details",litellm_params:{},health_check_cache_params:{}}}else f=rT(null==g?void 0:g.litellm_cache_params)||{},v=rT(null==g?void 0:g.health_check_cache_params)||{}}catch(e){console.warn("Error in response parsing:",e),f={},v={}}let _={redis_host:(null==v?void 0:null===(l=v.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==v?void 0:null===(i=v.redis_async_client)||void 0===i?void 0:null===(r=i.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host)||(null==v?void 0:null===(n=v.connection_kwargs)||void 0===n?void 0:n.host)||(null==v?void 0:v.host)||"N/A",redis_port:(null==v?void 0:null===(m=v.redis_client)||void 0===m?void 0:null===(d=m.connection_pool)||void 0===d?void 0:null===(o=d.connection_kwargs)||void 0===o?void 0:o.port)||(null==v?void 0:null===(h=v.redis_async_client)||void 0===h?void 0:null===(x=h.connection_pool)||void 0===x?void 0:null===(u=x.connection_kwargs)||void 0===u?void 0:u.port)||(null==v?void 0:null===(p=v.connection_kwargs)||void 0===p?void 0:p.port)||(null==v?void 0:v.port)||"N/A",redis_version:(null==v?void 0:v.redis_version)||"N/A",startup_nodes:(()=>{try{var e,s,t,l,a,r,i,n,o,c,d,m,u;if(null==v?void 0:null===(e=v.redis_kwargs)||void 0===e?void 0:e.startup_nodes)return JSON.stringify(v.redis_kwargs.startup_nodes);let x=(null==v?void 0:null===(l=v.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==v?void 0:null===(i=v.redis_async_client)||void 0===i?void 0:null===(r=i.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host),h=(null==v?void 0:null===(c=v.redis_client)||void 0===c?void 0:null===(o=c.connection_pool)||void 0===o?void 0:null===(n=o.connection_kwargs)||void 0===n?void 0:n.port)||(null==v?void 0:null===(u=v.redis_async_client)||void 0===u?void 0:null===(m=u.connection_pool)||void 0===m?void 0:null===(d=m.connection_kwargs)||void 0===d?void 0:d.port);return x&&h?JSON.stringify([{host:x,port:h}]):"N/A"}catch(e){return"N/A"}})(),namespace:(null==v?void 0:v.namespace)||"N/A"};return(0,c.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"border-b border-gray-200 px-4",children:[(0,c.jsx)(eY.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Summary"}),(0,c.jsx)(eY.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Raw Response"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{className:"p-4",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-6",children:[(null==g?void 0:g.status)==="healthy"?(0,c.jsx)(eZ.Z,{className:"h-5 w-5 text-green-500 mr-2"}):(0,c.jsx)(eN.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsxs)(w.Z,{className:"text-sm font-medium ".concat((null==g?void 0:g.status)==="healthy"?"text-green-500":"text-red-500"),children:["Cache Status: ",(null==g?void 0:g.status)||"unhealthy"]})]}),(0,c.jsx)("table",{className:"w-full border-collapse",children:(0,c.jsxs)("tbody",{children:[j&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold text-red-600",children:"Error Details"})}),(0,c.jsx)(rL,{label:"Error Message",value:j.message}),(0,c.jsx)(rL,{label:"Traceback",value:j.traceback})]}),(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Cache Details"})}),(0,c.jsx)(rL,{label:"Cache Configuration",value:String(null==f?void 0:f.type)}),(0,c.jsx)(rL,{label:"Ping Response",value:String(g.ping_response)}),(0,c.jsx)(rL,{label:"Set Cache Response",value:g.set_cache_response||"N/A"}),(0,c.jsx)(rL,{label:"litellm_settings.cache_params",value:JSON.stringify(f,null,2)}),(null==f?void 0:f.type)==="redis"&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Redis Details"})}),(0,c.jsx)(rL,{label:"Redis Host",value:_.redis_host||"N/A"}),(0,c.jsx)(rL,{label:"Redis Port",value:_.redis_port||"N/A"}),(0,c.jsx)(rL,{label:"Redis Version",value:_.redis_version||"N/A"}),(0,c.jsx)(rL,{label:"Startup Nodes",value:_.startup_nodes||"N/A"}),(0,c.jsx)(rL,{label:"Namespace",value:_.namespace||"N/A"})]})]})})]})}),(0,c.jsx)(eQ.Z,{className:"p-4",children:(0,c.jsx)("div",{className:"bg-gray-50 rounded-md p-4 font-mono text-sm",children:(0,c.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto max-h-[500px]",children:(()=>{try{let e={...g,litellm_cache_params:f,health_check_cache_params:v},s=JSON.parse(JSON.stringify(e,(e,s)=>{if("string"==typeof s)try{return JSON.parse(s)}catch(e){}return s}));return JSON.stringify(s,null,2)}catch(e){return"Error formatting JSON: "+e.message}})()})})})]})]})})},rM=e=>{let{accessToken:s,healthCheckResponse:t,runCachingHealthCheck:l,responseTimeMs:a}=e,[r,i]=d.useState(null),[n,o]=d.useState(!1),m=async()=>{o(!0);let e=performance.now();await l(),i(performance.now()-e),o(!1)};return(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)(_.Z,{onClick:m,disabled:n,className:"bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 text-white text-sm px-4 py-2 rounded-md",children:n?"Running Health Check...":"Run Health Check"}),(0,c.jsx)(rE,{responseTimeMs:r})]}),t&&(0,c.jsx)(rO,{response:t})]})},rD=e=>{if(e)return e.toISOString().split("T")[0]};function rF(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}var rR=e=>{let{accessToken:s,token:t,userRole:l,userID:a,premiumUser:r}=e,[i,n]=(0,d.useState)([]),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,_]=(0,d.useState)("0"),[y,b]=(0,d.useState)("0"),[N,Z]=(0,d.useState)("0"),[k,S]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[C,I]=(0,d.useState)(""),[A,E]=(0,d.useState)("");(0,d.useEffect)(()=>{s&&k&&((async()=>{p(await (0,g.adminGlobalCacheActivity)(s,rD(k.from),rD(k.to)))})(),I(new Date().toLocaleString()))},[s]);let T=Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.api_key)&&void 0!==s?s:""}))),L=Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.model)&&void 0!==s?s:""})));Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.call_type)&&void 0!==s?s:""})));let O=async(e,t)=>{e&&t&&s&&p(await (0,g.adminGlobalCacheActivity)(s,rD(e),rD(t)))};(0,d.useEffect)(()=>{console.log("DATA IN CACHE DASHBOARD",h);let e=h;o.length>0&&(e=e.filter(e=>o.includes(e.api_key))),u.length>0&&(e=e.filter(e=>u.includes(e.model))),console.log("before processed data in cache dashboard",e);let s=0,t=0,l=0,a=e.reduce((e,a)=>{console.log("Processing item:",a),a.call_type||(console.log("Item has no call_type:",a),a.call_type="Unknown"),s+=(a.total_rows||0)-(a.cache_hit_true_rows||0),t+=a.cache_hit_true_rows||0,l+=a.cached_completion_tokens||0;let r=e.find(e=>e.name===a.call_type);return r?(r["LLM API requests"]+=(a.total_rows||0)-(a.cache_hit_true_rows||0),r["Cache hit"]+=a.cache_hit_true_rows||0,r["Cached Completion Tokens"]+=a.cached_completion_tokens||0,r["Generated Completion Tokens"]+=a.generated_completion_tokens||0):e.push({name:a.call_type,"LLM API requests":(a.total_rows||0)-(a.cache_hit_true_rows||0),"Cache hit":a.cache_hit_true_rows||0,"Cached Completion Tokens":a.cached_completion_tokens||0,"Generated Completion Tokens":a.generated_completion_tokens||0}),e},[]);_(rF(t)),b(rF(l));let r=t+s;r>0?Z((t/r*100).toFixed(2)):Z("0"),n(a),console.log("PROCESSED DATA IN CACHE DASHBOARD",a)},[o,u,k,h]);let M=async()=>{try{P.ZP.info("Running cache health check..."),E("");let e=await (0,g.cachingHealthCheckCall)(null!==s?s:"");console.log("CACHING HEALTH CHECK RESPONSE",e),E(e)}catch(s){let e;if(console.error("Error running health check:",s),s&&s.message)try{let t=JSON.parse(s.message);t.error&&(t=t.error),e=t}catch(t){e={message:s.message}}else e={message:"Unknown error occurred"};E({error:e})}};return(0,c.jsxs)(eW.Z,{className:"gap-2 p-8 h-full w-full mt-2 mb-8",children:[(0,c.jsxs)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eY.Z,{children:"Cache Analytics"}),(0,c.jsx)(eY.Z,{children:(0,c.jsx)("pre",{children:"Cache Health"})})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[C&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",C]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center",onClick:()=>{I(new Date().toLocaleString())}})]})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)(v.Z,{numItems:3,className:"gap-4 mt-4",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(lG.Z,{placeholder:"Select API Keys",value:o,onValueChange:m,children:T.map(e=>(0,c.jsx)(lH.Z,{value:e,children:e},e))})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(lG.Z,{placeholder:"Select Models",value:u,onValueChange:x,children:L.map(e=>(0,c.jsx)(lH.Z,{value:e,children:e},e))})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(sY,{value:k,onValueChange:e=>{S(e),O(e.from,e.to)}})})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-4",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hit Ratio"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsxs)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[N,"%"]})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hits"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:j})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cached Tokens"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:y})})]})]}),(0,c.jsx)(sT.Z,{className:"mt-4",children:"Cache Hits vs API Requests"}),(0,c.jsx)(s$.Z,{title:"Cache Hits vs API Requests",data:i,stack:!0,index:"name",valueFormatter:rF,categories:["LLM API requests","Cache hit"],colors:["sky","teal"],yAxisWidth:48}),(0,c.jsx)(sT.Z,{className:"mt-4",children:"Cached Completion Tokens vs Generated Completion Tokens"}),(0,c.jsx)(s$.Z,{className:"mt-6",data:i,stack:!0,index:"name",valueFormatter:rF,categories:["Generated Completion Tokens","Cached Completion Tokens"],colors:["sky","teal"],yAxisWidth:48})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(rM,{accessToken:s,healthCheckResponse:A,runCachingHealthCheck:M})})]})]})},rq=t(91810),rU=t(3810);(a=n||(n={})).PresidioPII="Presidio PII",a.Bedrock="Bedrock Guardrail",a.Lakera="Lakera";let rz={},rV=e=>{let s={};return s.PresidioPII="Presidio PII",s.Bedrock="Bedrock Guardrail",s.Lakera="Lakera",Object.entries(e).forEach(e=>{let[t,l]=e;l&&"object"==typeof l&&"ui_friendly_name"in l&&(s[t.split("_").map((e,s)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l.ui_friendly_name)}),rz=s,s},rK=()=>Object.keys(rz).length>0?rz:n,rB={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2"},rG=e=>{Object.entries(e).forEach(e=>{let[s,t]=e;t&&"object"==typeof t&&"ui_friendly_name"in t&&(rB[s.split("_").map((e,s)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=s)})},rH=e=>!!e&&"Presidio PII"===rK()[e],rJ="../ui/assets/logos/",rY={"Presidio PII":"".concat(rJ,"presidio.png"),"Bedrock Guardrail":"".concat(rJ,"bedrock.svg"),Lakera:"".concat(rJ,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(rJ,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(rJ,"presidio.png")},rW=e=>{if(!e)return{logo:"",displayName:"-"};let s=Object.keys(rB).find(s=>rB[s].toLowerCase()===e.toLowerCase());if(!s)return{logo:"",displayName:e};let t=rK()[s];return{logo:rY[t]||"",displayName:t||e}};var r$=t(33866),rQ=t(97416),rX=t(8881),r0=t(10798),r1=t(49638);let{Text:r2}=em.default,{Option:r4}=C.default,r5=e=>e.replace(/_/g," "),r6=e=>{switch(e){case"MASK":return(0,c.jsx)(rQ.Z,{style:{marginRight:4}});case"BLOCK":return(0,c.jsx)(rX.Z,{style:{marginRight:4}});default:return null}},r3=e=>{let{categories:s,selectedCategories:t,onChange:l}=e;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)(r0.Z,{className:"text-gray-500 mr-1"}),(0,c.jsx)(r2,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:l,value:t,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,c.jsx)(rU.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:s.map(e=>(0,c.jsx)(r4,{value:e.category,children:e.category},e.category))})]})},r8=e=>{let{onSelectAll:s,onUnselectAll:t,hasSelectedEntities:l}=e;return(0,c.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(r2,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,c.jsx)(z.Z,{title:"Apply action to all PII types at once",children:(0,c.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,c.jsx)(T.ZP,{type:"default",onClick:t,disabled:!l,icon:(0,c.jsx)(r1.Z,{}),className:"border-gray-300 hover:text-red-600 hover:border-red-300",children:"Unselect All"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsx)(T.ZP,{type:"default",onClick:()=>s("MASK"),className:"flex items-center justify-center h-10 border-blue-200 hover:border-blue-300 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 text-blue-600",block:!0,icon:(0,c.jsx)(rQ.Z,{}),children:"Select All & Mask"}),(0,c.jsx)(T.ZP,{type:"default",onClick:()=>s("BLOCK"),className:"flex items-center justify-center h-10 border-red-200 hover:border-red-300 hover:text-red-700 bg-red-50 hover:bg-red-100 text-red-600",block:!0,icon:(0,c.jsx)(rX.Z,{}),children:"Select All & Block"})]})]})},r7=e=>{let{entities:s,selectedEntities:t,selectedActions:l,actions:a,onEntitySelect:r,onActionSelect:i,entityToCategoryMap:n}=e;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,c.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,c.jsx)(r2,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,c.jsx)(r2,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,c.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===s.length?(0,c.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):s.map(e=>(0,c.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(t.includes(e)?"bg-blue-50":""),children:[(0,c.jsxs)("div",{className:"flex items-center flex-1",children:[(0,c.jsx)(s2.Z,{checked:t.includes(e),onChange:()=>r(e),className:"mr-3"}),(0,c.jsx)(r2,{className:t.includes(e)?"font-medium text-gray-900":"text-gray-700",children:r5(e)}),n.get(e)&&(0,c.jsx)(rU.Z,{className:"ml-2 text-xs",color:"blue",children:n.get(e)})]}),(0,c.jsx)("div",{className:"w-32",children:(0,c.jsx)(C.default,{value:t.includes(e)&&l[e]||"MASK",onChange:s=>i(e,s),style:{width:120},disabled:!t.includes(e),className:"".concat(t.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:a.map(e=>(0,c.jsx)(r4,{value:e,children:(0,c.jsxs)("div",{className:"flex items-center",children:[r6(e),e]})},e))})})]},e))})]})},{Title:r9,Text:ie}=em.default;var is=e=>{let{entities:s,actions:t,selectedEntities:l,selectedActions:a,onEntitySelect:r,onActionSelect:i,entityCategories:n=[]}=e,[o,m]=(0,d.useState)([]),u=new Map;n.forEach(e=>{e.entities.forEach(s=>{u.set(s,e.category)})});let x=s.filter(e=>0===o.length||o.includes(u.get(e)||""));return(0,c.jsxs)("div",{className:"pii-configuration",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)(r9,{level:4,className:"mb-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,c.jsx)(r$.Z,{count:l.length,showZero:!0,style:{backgroundColor:l.length>0?"#4f46e5":"#d9d9d9"},overflowCount:999,children:(0,c.jsxs)(ie,{className:"text-gray-500",children:[l.length," items selected"]})})]}),(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsx)(r3,{categories:n,selectedCategories:o,onChange:m}),(0,c.jsx)(r8,{onSelectAll:e=>{s.forEach(s=>{l.includes(s)||r(s),i(s,e)})},onUnselectAll:()=>{l.forEach(e=>{r(e)})},hasSelectedEntities:l.length>0})]}),(0,c.jsx)(r7,{entities:x,selectedEntities:l,selectedActions:a,actions:t,onEntitySelect:r,onActionSelect:i,entityToCategoryMap:u})]})},it=e=>{var s;let{selectedProvider:t,accessToken:l,providerParams:a=null,value:r=null}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(a),[u,x]=(0,d.useState)(null);if((0,d.useEffect)(()=>{if(a){m(a);return}let e=async()=>{if(l){n(!0),x(null);try{let e=await (0,g.getGuardrailProviderSpecificParams)(l);console.log("Provider params API response:",e),m(e),rV(e),rG(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{n(!1)}}};a||e()},[l,a]),!t)return null;if(i)return(0,c.jsx)(lm.Z,{tip:"Loading provider parameters..."});if(u)return(0,c.jsx)("div",{className:"text-red-500",children:u});let h=null===(s=rB[t])||void 0===s?void 0:s.toLowerCase(),p=o&&o[h];if(console.log("Provider key:",h),console.log("Provider fields:",p),!p||0===Object.keys(p).length)return(0,c.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",r);let j=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[l,a]=e,i=s?"".concat(s,".").concat(l):l,n=t?t[l]:null==r?void 0:r[l];return(console.log("Field value:",n),"ui_friendly_name"===l||"optional_params"===l&&"nested"===a.type&&a.fields)?null:"nested"===a.type&&a.fields?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"mb-2 font-medium",children:l}),(0,c.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:j(a.fields,i,n)})]},i):(0,c.jsx)(I.Z.Item,{name:i,label:l,tooltip:a.description,rules:a.required?[{required:!0,message:"".concat(l," is required")}]:void 0,children:"select"===a.type&&a.options?(0,c.jsx)(C.default,{placeholder:a.description,defaultValue:n||a.default_value,children:a.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"multiselect"===a.type&&a.options?(0,c.jsx)(C.default,{mode:"multiple",placeholder:a.description,defaultValue:n||a.default_value,children:a.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"bool"===a.type||"boolean"===a.type?(0,c.jsxs)(C.default,{placeholder:a.description,defaultValue:void 0!==n?String(n):a.default_value,children:[(0,c.jsx)(C.default.Option,{value:"true",children:"True"}),(0,c.jsx)(C.default.Option,{value:"false",children:"False"})]}):"number"===a.type?(0,c.jsx)(M,{step:1,width:400,placeholder:a.description,defaultValue:void 0!==n?Number(n):void 0}):l.includes("password")||l.includes("secret")||l.includes("key")?(0,c.jsx)(y.Z,{placeholder:a.description,type:"password",defaultValue:n||""}):(0,c.jsx)(y.Z,{placeholder:a.description,type:"text",defaultValue:n||""})},i)})};return(0,c.jsx)(c.Fragment,{children:j(p)})};let{Title:il}=em.default,ia=e=>{let{field:s,fieldKey:t,fullFieldKey:l,value:a}=e,[r,i]=d.useState([]),[n,o]=d.useState(s.dict_key_options||[]);d.useEffect(()=>{if(a&&"object"==typeof a){let e=Object.keys(a);i(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),o((s.dict_key_options||[]).filter(s=>!e.includes(s)))}},[a,s.dict_key_options]);let m=e=>{e&&(i([...r,{key:e,id:"".concat(e,"_").concat(Date.now())}]),o(n.filter(s=>s!==e)))},u=(e,s)=>{i(r.filter(s=>s.id!==e)),o([...n,s].sort())};return(0,c.jsxs)("div",{className:"space-y-3",children:[r.map(e=>(0,c.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,c.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,c.jsx)("div",{className:"flex-1",children:(0,c.jsx)(I.Z.Item,{name:Array.isArray(l)?[...l,e.key]:[l,e.key],style:{marginBottom:0},initialValue:a&&"object"==typeof a?a[e.key]:void 0,normalize:"number"===s.dict_value_type?e=>{if(null==e||""===e)return;let s=Number(e);return isNaN(s)?e:s}:void 0,children:"number"===s.dict_value_type?(0,c.jsx)(M,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===s.dict_value_type?(0,c.jsxs)(C.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,c.jsx)(C.default.Option,{value:!0,children:"True"}),(0,c.jsx)(C.default.Option,{value:!1,children:"False"})]}):(0,c.jsx)(y.Z,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,c.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>u(e.id,e.key),children:"Remove"})]},e.id)),n.length>0&&(0,c.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,c.jsx)(C.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&m(e),value:void 0,children:n.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var ir=e=>{let{optionalParams:s,parentFieldKey:t,values:l}=e,a=(e,s)=>{let a="".concat(t,".").concat(e),r=null==l?void 0:l[e];return(console.log("value",r),"dict"===s.type&&s.dict_key_options)?(0,c.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,c.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,c.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,c.jsx)(ia,{field:s,fieldKey:e,fullFieldKey:[t,e],value:r})]},a):(0,c.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,c.jsx)(I.Z.Item,{name:[t,e],label:(0,c.jsxs)("div",{className:"mb-2",children:[(0,c.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,c.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),rules:s.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==r?r:s.default_value,normalize:"number"===s.type?e=>{if(null==e||""===e)return;let s=Number(e);return isNaN(s)?e:s}:void 0,children:"select"===s.type&&s.options?(0,c.jsx)(C.default,{placeholder:s.description,children:s.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"multiselect"===s.type&&s.options?(0,c.jsx)(C.default,{mode:"multiple",placeholder:s.description,children:s.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"bool"===s.type||"boolean"===s.type?(0,c.jsxs)(C.default,{placeholder:s.description,children:[(0,c.jsx)(C.default.Option,{value:"true",children:"True"}),(0,c.jsx)(C.default.Option,{value:"false",children:"False"})]}):"number"===s.type?(0,c.jsx)(M,{step:1,width:400,placeholder:s.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,c.jsx)(y.Z,{placeholder:s.description,type:"password"}):(0,c.jsx)(y.Z,{placeholder:s.description,type:"text"})})},a)};return s.fields&&0!==Object.keys(s.fields).length?(0,c.jsxs)("div",{className:"guardrail-optional-params",children:[(0,c.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,c.jsx)(il,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,c.jsx)("p",{className:"text-gray-600 text-sm",children:s.description||"Configure additional settings for this guardrail provider"})]}),(0,c.jsx)("div",{className:"space-y-8",children:Object.entries(s.fields).map(e=>{let[s,t]=e;return a(s,t)})})]}):null};let{Title:ii,Text:io,Link:ic}=em.default,{Option:id}=C.default,{Step:im}=rq.default,iu={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call"};var ix=e=>{let{visible:s,onClose:t,accessToken:l,onSuccess:a}=e,[r]=I.Z.useForm(),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)({}),[v,b]=(0,d.useState)(0),[N,Z]=(0,d.useState)(null),[w,k]=(0,d.useState)([]),[S,E]=(0,d.useState)(2),[T,L]=(0,d.useState)({});(0,d.useEffect)(()=>{l&&(async()=>{try{let[e,s]=await Promise.all([(0,g.getGuardrailUISettings)(l),(0,g.getGuardrailProviderSpecificParams)(l)]);x(e),Z(s),rV(s),rG(s)}catch(e){console.error("Error fetching guardrail data:",e),P.ZP.error("Failed to load guardrail configuration")}})()},[l]);let O=e=>{m(e),r.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),p([]),f({}),k([]),E(2),L({})},M=e=>{p(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},D=(e,s)=>{f(t=>({...t,[e]:s}))},F=async()=>{try{if(0===v&&(await r.validateFields(["guardrail_name","provider","mode","default_on"]),o)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===o&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await r.validateFields(e)}if(1===v&&rH(o)&&0===h.length){P.ZP.error("Please select at least one PII entity to continue");return}b(v+1)}catch(e){console.error("Form validation failed:",e)}},R=()=>{r.resetFields(),m(null),p([]),f({}),k([]),E(2),L({}),b(0)},q=()=>{R(),t()},U=async()=>{try{n(!0),await r.validateFields();let s=r.getFieldsValue(!0),i=rB[s.provider],c={guardrail_name:s.guardrail_name,litellm_params:{guardrail:i,mode:s.mode,default_on:s.default_on},guardrail_info:{}};if("PresidioPII"===s.provider&&h.length>0){let e={};h.forEach(s=>{e[s]=j[s]||"MASK"}),c.litellm_params.pii_entities_config=e,s.presidio_analyzer_api_base&&(c.litellm_params.presidio_analyzer_api_base=s.presidio_analyzer_api_base),s.presidio_anonymizer_api_base&&(c.litellm_params.presidio_anonymizer_api_base=s.presidio_anonymizer_api_base)}else if(s.config)try{let e=JSON.parse(s.config);c.guardrail_info=e}catch(e){P.ZP.error("Invalid JSON in configuration"),n(!1);return}if(console.log("values: ",JSON.stringify(s)),N&&o){var e;let t=null===(e=rB[o])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",t);let l=N[t]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(e=>{let t=s[e];if(null==t||""===t){var l;t=null===(l=s.optional_params)||void 0===l?void 0:l[e]}null!=t&&""!==t&&(c.litellm_params[e]=t)})}if(!l)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(c)),await (0,g.createGuardrailCall)(l,c),P.ZP.success("Guardrail created successfully"),R(),a(),t()}catch(e){console.error("Failed to create guardrail:",e),P.ZP.error("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{n(!1)}},z=()=>{var e;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter a name for this guardrail"})}),(0,c.jsx)(I.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{placeholder:"Select a guardrail provider",onChange:O,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(rK()).map(e=>{let[s,t]=e;return(0,c.jsx)(id,{value:s,label:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rY[t]&&(0,c.jsx)("img",{src:rY[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]}),children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rY[t]&&(0,c.jsx)("img",{src:rY[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(I.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,c.jsx)(C.default,{optionLabelProp:"label",mode:"multiple",children:(null==u?void 0:null===(e=u.supported_modes)||void 0===e?void 0:e.map(e=>(0,c.jsx)(id,{value:e,label:e,children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:e}),"pre_call"===e&&(0,c.jsx)(rU.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu[e]})]})},e)))||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(id,{value:"pre_call",label:"pre_call",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:"pre_call"})," ",(0,c.jsx)(rU.Z,{color:"green",children:"Recommended"})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu.pre_call})]})}),(0,c.jsx)(id,{value:"during_call",label:"during_call",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"during_call"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu.during_call})]})}),(0,c.jsx)(id,{value:"post_call",label:"post_call",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"post_call"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu.post_call})]})}),(0,c.jsx)(id,{value:"logging_only",label:"logging_only",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"logging_only"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:iu.logging_only})]})})]})})}),(0,c.jsx)(I.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:!0,children:"Yes"}),(0,c.jsx)(C.default.Option,{value:!1,children:"No"})]})}),(0,c.jsx)(it,{selectedProvider:o,accessToken:l,providerParams:N})]})},V=()=>u&&"PresidioPII"===o?(0,c.jsx)(is,{entities:u.supported_entities,actions:u.supported_actions,selectedEntities:h,selectedActions:j,onEntitySelect:M,onActionSelect:D,entityCategories:u.pii_entity_categories}):null,K=()=>{var e;if(!o||!N)return null;console.log("guardrail_provider_map: ",rB),console.log("selectedProvider: ",o);let s=null===(e=rB[o])||void 0===e?void 0:e.toLowerCase(),t=N&&N[s];return t&&t.optional_params?(0,c.jsx)(ir,{optionalParams:t.optional_params,parentFieldKey:"optional_params"}):null};return(0,c.jsx)(A.Z,{title:"Add Guardrail",open:s,onCancel:q,footer:null,width:700,children:(0,c.jsxs)(I.Z,{form:r,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,c.jsxs)(rq.default,{current:v,className:"mb-6",children:[(0,c.jsx)(im,{title:"Basic Info"}),(0,c.jsx)(im,{title:rH(o)?"PII Configuration":"Provider Configuration"})]}),(()=>{switch(v){case 0:return z();case 1:if(rH(o))return V();return K();default:return null}})(),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[v>0&&(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{b(v-1)},children:"Previous"}),v<2&&(0,c.jsx)(_.Z,{onClick:F,children:"Next"}),2===v&&(0,c.jsx)(_.Z,{onClick:U,loading:i,children:"Create Guardrail"}),(0,c.jsx)(_.Z,{variant:"secondary",onClick:q,children:"Cancel"})]})]})})};let{Title:ih,Text:ip}=em.default,{Option:ig}=C.default;var ij=e=>{var s;let{visible:t,onClose:l,accessToken:a,onSuccess:r,guardrailId:i,initialValues:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)((null==n?void 0:n.provider)||null),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)([]),[b,N]=(0,d.useState)({});(0,d.useEffect)(()=>{(async()=>{try{if(!a)return;let e=await (0,g.getGuardrailUISettings)(a);j(e)}catch(e){console.error("Error fetching guardrail settings:",e),P.ZP.error("Failed to load guardrail settings")}})()},[a]),(0,d.useEffect)(()=>{(null==n?void 0:n.pii_entities_config)&&Object.keys(n.pii_entities_config).length>0&&(v(Object.keys(n.pii_entities_config)),N(n.pii_entities_config))},[n]);let Z=e=>{v(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},w=(e,s)=>{N(t=>({...t,[e]:s}))},k=async()=>{try{u(!0);let e=await o.validateFields(),s=rB[e.provider],t={guardrail_id:i,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:s,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&f.length>0){let e={};f.forEach(s=>{e[s]=b[s]||"MASK"}),t.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let s=JSON.parse(e.config);"Bedrock"===e.provider&&s?(s.guardrail_id&&(t.guardrail.litellm_params.guardrailIdentifier=s.guardrail_id),s.guardrail_version&&(t.guardrail.litellm_params.guardrailVersion=s.guardrail_version)):t.guardrail.guardrail_info=s}catch(e){P.ZP.error("Invalid JSON in configuration"),u(!1);return}if(!a)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(t));let n=await fetch("/guardrails/".concat(i),{method:"PUT",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw Error(e||"Failed to update guardrail")}P.ZP.success("Guardrail updated successfully"),r(),l()}catch(e){console.error("Failed to update guardrail:",e),P.ZP.error("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{u(!1)}},S=()=>p&&x&&"PresidioPII"===x?(0,c.jsx)(is,{entities:p.supported_entities,actions:p.supported_actions,selectedEntities:f,selectedActions:b,onEntitySelect:Z,onActionSelect:w,entityCategories:p.pii_entity_categories}):null;return(0,c.jsx)(A.Z,{title:"Edit Guardrail",open:t,onCancel:l,footer:null,width:700,children:(0,c.jsxs)(I.Z,{form:o,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter a name for this guardrail"})}),(0,c.jsx)(I.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{placeholder:"Select a guardrail provider",onChange:e=>{h(e),o.setFieldsValue({config:void 0}),v([]),N({})},disabled:!0,optionLabelProp:"label",children:Object.entries(rK()).map(e=>{let[s,t]=e;return(0,c.jsx)(ig,{value:s,label:t,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rY[t]&&(0,c.jsx)("img",{src:rY[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(I.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,c.jsx)(C.default,{children:(null==p?void 0:null===(s=p.supported_modes)||void 0===s?void 0:s.map(e=>(0,c.jsx)(ig,{value:e,children:e},e)))||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ig,{value:"pre_call",children:"pre_call"}),(0,c.jsx)(ig,{value:"post_call",children:"post_call"})]})})}),(0,c.jsx)(I.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,c.jsx)(tn.Z,{})}),(()=>{if(!x)return null;if("PresidioPII"===x)return S();switch(x){case"Aporia":return(0,c.jsx)(I.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,c.jsx)(I.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,c.jsx)(I.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,c.jsx)(I.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,c.jsx)(I.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,c.jsx)(I.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,c.jsx)(I.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:k,loading:m,children:"Update Guardrail"})]})]})})},iv=e=>{let{guardrailsList:s,isLoading:t,onDeleteClick:l,accessToken:a,onGuardrailUpdated:r,isAdmin:i=!1,onGuardrailClick:n}=e,[o,m]=(0,d.useState)([{id:"created_at",desc:!0}]),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(null),g=e=>e?new Date(e).toLocaleString():"-",j=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&n(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.guardrail_name,children:(0,c.jsx)("span",{className:"text-xs font-medium",children:t.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:s}=e,{logo:t,displayName:l}=rW(s.original.litellm_params.guardrail);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:"".concat(l," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)("span",{className:"text-xs",children:l})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var s,t;let{row:l}=e,a=l.original;return(0,c.jsx)(eJ.Z,{color:(null===(s=a.litellm_params)||void 0===s?void 0:s.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(t=a.litellm_params)||void 0===t?void 0:t.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.created_at,children:(0,c.jsx)("span",{className:"text-xs",children:g(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.updated_at,children:(0,c.jsx)("span",{className:"text-xs",children:g(t.updated_at)})})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"flex space-x-2",children:(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>t.guardrail_id&&l(t.guardrail_id,t.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500",tooltip:"Delete guardrail"})})}}],f=(0,sp.b7)({data:s,columns:j,state:{sorting:o},onSortingChange:m,getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0});return(0,c.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sf.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sy.Z,{children:f.getHeaderGroups().map(e=>(0,c.jsx)(sN.Z,{children:e.headers.map(e=>(0,c.jsx)(sb.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(sv.Z,{children:t?(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:j.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"Loading..."})})})}):s.length>0?f.getRowModel().rows.map(e=>(0,c.jsx)(sN.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(s_.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:j.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No guardrails found"})})})})})]})}),h&&(0,c.jsx)(ij,{visible:u,onClose:()=>x(!1),accessToken:a,onSuccess:()=>{x(!1),p(null),r()},guardrailId:h.guardrail_id||"",initialValues:{guardrail_name:h.guardrail_name||"",provider:Object.keys(rB).find(e=>rB[e]===(null==h?void 0:h.litellm_params.guardrail))||"",mode:h.litellm_params.mode,default_on:h.litellm_params.default_on,pii_entities_config:h.litellm_params.pii_entities_config,...h.guardrail_info}})]})},i_=e=>{var s,t,l,a,r,i,n,o,m,u,x;let{guardrailId:h,onClose:p,accessToken:j,isAdmin:f}=e,[b,N]=(0,d.useState)(null),[Z,S]=(0,d.useState)(null),[A,E]=(0,d.useState)(!0),[O,M]=(0,d.useState)(!1),[D]=I.Z.useForm(),[F,R]=(0,d.useState)([]),[q,U]=(0,d.useState)({}),[z,V]=(0,d.useState)(null),[K,B]=(0,d.useState)({}),G=async()=>{try{var e;if(E(!0),!j)return;let s=await (0,g.getGuardrailInfo)(j,h);if(N(s),null===(e=s.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=s.litellm_params.pii_entities_config;if(R([]),U({}),Object.keys(e).length>0){let s=[],t={};Object.entries(e).forEach(e=>{let[l,a]=e;s.push(l),t[l]="string"==typeof a?a:"MASK"}),R(s),U(t)}}else R([]),U({})}catch(e){P.ZP.error("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{E(!1)}},H=async()=>{try{if(!j)return;let e=await (0,g.getGuardrailProviderSpecificParams)(j);S(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},J=async()=>{try{if(!j)return;let e=await (0,g.getGuardrailUISettings)(j);V(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,d.useEffect)(()=>{H()},[j]),(0,d.useEffect)(()=>{G(),J()},[h,j]),(0,d.useEffect)(()=>{if(b&&D){var e;D.setFieldsValue({guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(e=b.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:b.litellm_params.optional_params}})}},[b,Z,D]);let $=async e=>{try{var s,t,l;if(!j)return;let a={litellm_params:{}};e.guardrail_name!==b.guardrail_name&&(a.guardrail_name=e.guardrail_name),e.default_on!==(null===(s=b.litellm_params)||void 0===s?void 0:s.default_on)&&(a.litellm_params.default_on=e.default_on);let r=b.guardrail_info,i=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(r)!==JSON.stringify(i)&&(a.guardrail_info=i);let n=(null===(t=b.litellm_params)||void 0===t?void 0:t.pii_entities_config)||{},o={};F.forEach(e=>{o[e]=q[e]||"MASK"}),JSON.stringify(n)!==JSON.stringify(o)&&(a.litellm_params.pii_entities_config=o);let c=Object.keys(rB).find(e=>{var s;return rB[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)});if(console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",c),Z&&c){let s=Z[null===(l=rB[c])||void 0===l?void 0:l.toLowerCase()]||{},t=new Set;console.log("providerSpecificParams: ",JSON.stringify(s)),Object.keys(s).forEach(e=>{"optional_params"!==e&&t.add(e)}),s.optional_params&&s.optional_params.fields&&Object.keys(s.optional_params.fields).forEach(e=>{t.add(e)}),console.log("allowedParams: ",t),t.forEach(s=>{var t,l;let r=e[s];(null==r||""===r)&&(r=null===(l=e.optional_params)||void 0===l?void 0:l[s]);let i=null===(t=b.litellm_params)||void 0===t?void 0:t[s];JSON.stringify(r)!==JSON.stringify(i)&&(null!=r&&""!==r?a.litellm_params[s]=r:null!=i&&""!==i&&(a.litellm_params[s]=null))})}if(0===Object.keys(a.litellm_params).length&&delete a.litellm_params,0===Object.keys(a).length){P.ZP.info("No changes detected"),M(!1);return}await (0,g.updateGuardrailCall)(j,h,a),P.ZP.success("Guardrail updated successfully"),G(),M(!1)}catch(e){console.error("Error updating guardrail:",e),P.ZP.error("Failed to update guardrail")}};if(A)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!b)return(0,c.jsx)("div",{className:"p-4",children:"Guardrail not found"});let Q=e=>e?new Date(e).toLocaleString():"-",{logo:X,displayName:ee}=rW((null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)||""),es=async(e,s)=>{await eF(e)&&(B(e=>({...e,[s]:!0})),setTimeout(()=>{B(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",onClick:p,className:"mb-4",children:"Back to Guardrails"}),(0,c.jsx)(k.Z,{children:b.guardrail_name||"Unnamed Guardrail"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:b.guardrail_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:K["guardrail-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>es(b.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(K["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"},"overview"),f?(0,c.jsx)(eY.Z,{children:"Settings"},"settings"):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Provider"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[X&&(0,c.jsx)("img",{src:X,alt:"".concat(ee," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)(k.Z,{children:ee})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Mode"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:(null===(t=b.litellm_params)||void 0===t?void 0:t.mode)||"-"}),(0,c.jsx)(eJ.Z,{color:(null===(l=b.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",children:(null===(a=b.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})]})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Created At"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:Q(b.created_at)}),(0,c.jsxs)(w.Z,{children:["Last Updated: ",Q(b.updated_at)]})]})]})]}),(null===(r=b.litellm_params)||void 0===r?void 0:r.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,c.jsx)(W.Z,{className:"mt-6",children:(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"PII Protection"}),(0,c.jsxs)(eJ.Z,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),b.guardrail_info&&Object.keys(b.guardrail_info).length>0&&(0,c.jsxs)(W.Z,{className:"mt-6",children:[(0,c.jsx)(w.Z,{children:"Guardrail Info"}),(0,c.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(b.guardrail_info).map(e=>{let[s,t]=e;return(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(w.Z,{className:"font-medium w-1/3",children:s}),(0,c.jsx)(w.Z,{className:"w-2/3",children:"object"==typeof t?JSON.stringify(t,null,2):String(t)})]},s)})})]})]}),f&&(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Guardrail Settings"}),!O&&(0,c.jsx)(_.Z,{onClick:()=>M(!0),children:"Edit Settings"})]}),O?(0,c.jsxs)(I.Z,{form:D,onFinish:$,initialValues:{guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(i=b.litellm_params)||void 0===i?void 0:i.optional_params)&&{optional_params:b.litellm_params.optional_params}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Default On",name:"default_on",children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:!0,children:"Yes"}),(0,c.jsx)(C.default.Option,{value:!1,children:"No"})]})}),(null===(n=b.litellm_params)||void 0===n?void 0:n.guardrail)==="presidio"&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Y.Z,{orientation:"left",children:"PII Protection"}),(0,c.jsx)("div",{className:"mb-6",children:z&&(0,c.jsx)(is,{entities:z.supported_entities,actions:z.supported_actions,selectedEntities:F,selectedActions:q,onEntitySelect:e=>{R(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},onActionSelect:(e,s)=>{U(t=>({...t,[e]:s}))},entityCategories:z.pii_entity_categories})})]}),(0,c.jsx)(Y.Z,{orientation:"left",children:"Provider Settings"}),(0,c.jsx)(it,{selectedProvider:Object.keys(rB).find(e=>{var s;return rB[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)})||null,accessToken:j,providerParams:Z,value:b.litellm_params}),Z&&(()=>{var e;let s=Object.keys(rB).find(e=>{var s;return rB[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)});if(!s)return null;let t=Z[null===(e=rB[s])||void 0===e?void 0:e.toLowerCase()];return t&&t.optional_params?(0,c.jsx)(ir,{optionalParams:t.optional_params,parentFieldKey:"optional_params",values:b.litellm_params}):null})(),(0,c.jsx)(Y.Z,{orientation:"left",children:"Advanced Settings"}),(0,c.jsx)(I.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,c.jsx)(L.default.TextArea,{rows:5})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,c.jsx)(T.ZP,{onClick:()=>M(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{children:"Save Changes"})]})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Guardrail ID"}),(0,c.jsx)("div",{className:"font-mono",children:b.guardrail_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Guardrail Name"}),(0,c.jsx)("div",{children:b.guardrail_name||"Unnamed Guardrail"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Provider"}),(0,c.jsx)("div",{children:ee})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Mode"}),(0,c.jsx)("div",{children:(null===(o=b.litellm_params)||void 0===o?void 0:o.mode)||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Default On"}),(0,c.jsx)(eJ.Z,{color:(null===(m=b.litellm_params)||void 0===m?void 0:m.default_on)?"green":"gray",children:(null===(u=b.litellm_params)||void 0===u?void 0:u.default_on)?"Yes":"No"})]}),(null===(x=b.litellm_params)||void 0===x?void 0:x.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"PII Protection"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(eJ.Z,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:Q(b.created_at)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)("div",{children:Q(b.updated_at)})]})]})]})})]})]})]})},iy=e=>{let{accessToken:s,userRole:t}=e,[l,a]=(0,d.useState)([]),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),f=!!t&&(0,eE.tY)(t),v=async()=>{if(s){o(!0);try{let e=await (0,g.getGuardrailsList)(s);console.log("guardrails: ".concat(JSON.stringify(e))),a(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{o(!1)}}};(0,d.useEffect)(()=>{v()},[s]);let y=async()=>{if(x&&s){u(!0);try{await (0,g.deleteGuardrailCall)(s,x.id),P.ZP.success('Guardrail "'.concat(x.name,'" deleted successfully')),v()}catch(e){console.error("Error deleting guardrail:",e),P.ZP.error("Failed to delete guardrail")}finally{u(!1),h(null)}}};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(_.Z,{onClick:()=>{p&&j(null),i(!0)},disabled:!s,children:"+ Add New Guardrail"})}),p?(0,c.jsx)(i_,{guardrailId:p,onClose:()=>j(null),accessToken:s,isAdmin:f}):(0,c.jsx)(iv,{guardrailsList:l,isLoading:n,onDeleteClick:(e,s)=>{h({id:e,name:s})},accessToken:s,onGuardrailUpdated:v,isAdmin:f,onGuardrailClick:e=>j(e)}),(0,c.jsx)(ix,{visible:r,onClose:()=>{i(!1)},accessToken:s,onSuccess:()=>{v()}}),x&&(0,c.jsxs)(A.Z,{title:"Delete Guardrail",open:null!==x,onOk:y,onCancel:()=>{h(null)},confirmLoading:m,okText:"Delete",okButtonProps:{danger:!0},children:[(0,c.jsxs)("p",{children:["Are you sure you want to delete guardrail: ",x.name," ?"]}),(0,c.jsx)("p",{children:"This action cannot be undone."})]})]})},ib=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[a,r]=(0,d.useState)(""),[i,n]=(0,d.useState)(!1),o=(e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")},m=async()=>{n(!0);try{let e;try{e=JSON.parse(t)}catch(e){P.ZP.error("Invalid JSON in request body"),n(!1);return}let l={call_type:"completion",request_body:e};if(!s){P.ZP.error("No access token found"),n(!1);return}let a=await (0,g.transformRequestCall)(s,l);if(a.raw_request_api_base&&a.raw_request_body){let e=o(a.raw_request_api_base,a.raw_request_body,a.raw_request_headers||{});r(e),P.ZP.success("Request transformed successfully")}else{let e="string"==typeof a?a:JSON.stringify(a);r(e),P.ZP.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),P.ZP.error("Failed to transform request")}finally{n(!1)}};return(0,c.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,c.jsx)(k.Z,{children:"Playground"}),(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,c.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,c.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,c.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,c.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,c.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,c.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>l(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),m())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,c.jsxs)(T.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:m,loading:i,children:[(0,c.jsx)("span",{children:"Transform"}),(0,c.jsx)("span",{children:"→"})]})})]}),(0,c.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,c.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,c.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,c.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,c.jsx)("br",{}),(0,c.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,c.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,c.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:a||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,c.jsx)(T.ZP,{type:"text",icon:(0,c.jsx)(tC.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(a||""),P.ZP.success("Copied to clipboard")}})]})]})]}),(0,c.jsx)("div",{className:"mt-4 text-right w-full",children:(0,c.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue ",(0,c.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})};let iN=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let t=e.split("/mcp/");if(2!==t.length)return{token:null,baseUrl:e};let l=t[0]+"/mcp/",a=t[1];if(!a)return{token:null,baseUrl:e};return{token:a,baseUrl:l}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},iZ=e=>{let{token:s,baseUrl:t}=iN(e);return s?t+"...":e},iw=e=>{let{token:s}=iN(e);return{maskedUrl:iZ(e),hasToken:!!s}},ik=(e,s,t,l)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:t}=e;return(0,c.jsxs)("button",{onClick:()=>s(t.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[t.original.server_id.slice(0,7),"..."]})}},{accessorKey:"server_name",header:"Name"},{accessorKey:"alias",header:"Alias"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:t}=iw(s.original.url);return(0,c.jsx)("span",{className:"font-mono text-sm",children:t})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,c.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,c.jsx)("span",{children:s()||"none"})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,t=s.original.mcp_access_groups;if(Array.isArray(t)&&t.length>0&&"string"==typeof t[0]){let e=t.join(", ");return(0,c.jsx)(z.Z,{title:e,children:(0,c.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,c.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.created_at?new Date(t.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.updated_at?new Date(t.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>t(s.original.server_id),className:"cursor-pointer"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>l(s.original.server_id),className:"cursor-pointer"})]})}}];var iS=t(82376),iC=t(71437);let iI={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic"},iP={SSE:"sse"},iA=e=>(console.log(e),null==e)?iP.SSE:e,iE=e=>null==e?iI.NONE:e,iT=e=>iE(e)!==iI.NONE;var iL=t(62670),iO=e=>{let{value:s={},onChange:t,tools:l=[],disabled:a=!1}=e,r=(e,l)=>{let a={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:l}};null==t||t(a)};return(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,c.jsx)(iL.Z,{className:"text-green-600"}),(0,c.jsx)(k.Z,{children:"Cost Configuration"}),(0,c.jsx)(z.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,c.jsx)(z.Z,{title:"Default cost charged for each tool call to this server.",children:(0,c.jsx)(U.Z,{className:"ml-1 text-gray-400"})})]}),(0,c.jsx)(q.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let l={...s,default_cost_per_query:e};null==t||t(l)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,c.jsx)(w.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),l.length>0&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,c.jsx)(z.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,c.jsx)(U.Z,{className:"ml-1 text-gray-400"})})]}),(0,c.jsx)(tx.default,{items:[{key:"1",label:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-2 text-blue-500"}),(0,c.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,c.jsx)(r$.Z,{count:l.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,c.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:l.map((e,t)=>{var l;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,c.jsx)("div",{className:"ml-4",children:(0,c.jsx)(q.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(l=s.tool_name_to_cost_per_query)||void 0===l?void 0:l[e.name],onChange:s=>r(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},t)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,c.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,c.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,t]=e;return null!=t&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• ",s,": $",t.toFixed(4)," per query"]},s)})]})]})]})})},iM=e=>{let{mcpServer:s,accessToken:t,onCancel:l,onSuccess:a,availableAccessGroups:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)({}),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(!1);(0,d.useEffect)(()=>{var e;(null===(e=s.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&o(s.mcp_info.mcp_server_cost_info)},[s]),(0,d.useEffect)(()=>{if(s.mcp_access_groups){let e=s.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));i.setFieldValue("mcp_access_groups",e)}},[s]),(0,d.useEffect)(()=>{b()},[s,t]);let b=async()=>{if(t&&s.url){h(!0);try{let e={server_id:s.server_id,server_name:s.server_name,url:s.url,transport:s.transport,spec_version:s.spec_version,auth_type:s.auth_type,mcp_info:s.mcp_info},l=await (0,g.testMCPToolsListRequest)(t,e);l.tools&&!l.error?u(l.tools):(console.error("Failed to fetch tools:",l.message),u([]))}catch(e){console.error("Tools fetch error:",e),u([])}finally{h(!1)}}},N=async e=>{if(t)try{let l=(e.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),r={...e,server_id:s.server_id,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(n).length>0?n:null},mcp_access_groups:l,alias:e.alias},i=await (0,g.updateMCPServer)(t,r);P.ZP.success("MCP Server updated successfully"),a(i)}catch(e){P.ZP.error("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"grid w-full grid-cols-2",children:[(0,c.jsx)(eY.Z,{children:"Server Configuration"}),(0,c.jsx)(eY.Z,{children:"Cost Configuration"})]}),(0,c.jsxs)(eX.Z,{className:"mt-6",children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:N,initialValues:s,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Alias",name:"alias",rules:[{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{onChange:()=>v(!0)})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,c.jsx)(C.default.Option,{value:"http",children:"HTTP"})]})}),(0,c.jsx)(I.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"none",children:"None"}),(0,c.jsx)(C.default.Option,{value:"api_key",children:"API Key"}),(0,c.jsx)(C.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,c.jsx)(C.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,c.jsx)(I.Z.Item,{label:"MCP Version",name:"spec_version",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"2025-03-26",children:"2025-03-26 (Latest)"}),(0,c.jsx)(C.default.Option,{value:"2024-11-05",children:"2024-11-05"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,c.jsx)(z.Z,{title:"Define access groups for this MCP server. Each group represents a set of permissions.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",getValueFromEvent:e=>e,children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},showSearch:!0,placeholder:"Add or select access groups",tokenSeparators:[","],optionFilterProp:"value",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.value)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>j(e),options:(()=>{let e=r.map(e=>({value:e,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})}));return p&&!r.some(e=>e.toLowerCase().includes(p.toLowerCase()))&&e.push({value:p,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:p}),(0,c.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e})(),getPopupContainer:e=>e.parentNode})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,c.jsx)(T.ZP,{onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsx)(iO,{value:n,onChange:o,tools:m,disabled:x}),(0,c.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,c.jsx)(T.ZP,{onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:()=>i.submit(),children:"Save Changes"})]})]})})]})]})},iD=e=>{let{costConfig:s}=e,t=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,l=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return t||l?(0,c.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,c.jsxs)("div",{className:"space-y-4",children:[t&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Default Cost per Query"}),(0,c.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Tool-Specific Costs"}),(0,c.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,t]=e;return null!=t&&(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:s}),(0,c.jsxs)(w.Z,{className:"text-green-600 font-mono",children:["$",t.toFixed(4)," per query"]})]},s)})})]}),(0,c.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,c.jsxs)("div",{className:"mt-2 space-y-1",children:[t&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,c.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,c.jsx)("div",{className:"space-y-4",children:(0,c.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,c.jsx)(w.Z,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})};let iF=e=>{var s,t,l,a;let{mcpServer:r,onBack:i,isEditing:n,isProxyAdmin:o,accessToken:m,userRole:u,userID:x,availableAccessGroups:h}=e,[p,g]=(0,d.useState)(n),[j,f]=(0,d.useState)(!1),[y,b]=(0,d.useState)({}),{maskedUrl:N,hasToken:Z}=iw(r.url),S=(e,s)=>Z?s?e:N:e,C=async(e,s)=>{await eF(e)&&(b(e=>({...e,[s]:!0})),setTimeout(()=>{b(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4 max-w-full",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",className:"mb-4",onClick:i,children:"Back to All Servers"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(k.Z,{children:r.server_name}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-server_name"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>C(r.server_name,"mcp-server_name"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),r.alias&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"ml-4 text-gray-500",children:"Alias:"}),(0,c.jsx)("span",{className:"ml-1 font-mono text-blue-600",children:r.alias}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-alias"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>C(r.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:r.server_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-server-id"]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>C(r.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(eW.Z,{defaultIndex:p?2:0,children:[(0,c.jsx)(e$.Z,{className:"mb-4",children:[(0,c.jsx)(eY.Z,{children:"Overview"},"overview"),(0,c.jsx)(eY.Z,{children:"MCP Tools"},"tools"),...o?[(0,c.jsx)(eY.Z,{children:"Settings"},"settings")]:[]]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Transport"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{children:iA(null!==(l=r.transport)&&void 0!==l?l:void 0)})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Auth Type"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(w.Z,{children:iE(null!==(a=r.auth_type)&&void 0!==a?a:void 0)})})]}),(0,c.jsxs)(W.Z,{children:[(0,c.jsx)(w.Z,{children:"Host Url"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,c.jsx)(w.Z,{className:"break-all overflow-wrap-anywhere",children:S(r.url,j)}),Z&&(0,c.jsx)("button",{onClick:()=>f(!j),className:"p-1 hover:bg-gray-100 rounded",children:(0,c.jsx)(sj.Z,{icon:j?iS.Z:iC.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,c.jsxs)(W.Z,{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:"Cost Configuration"}),(0,c.jsx)(iD,{costConfig:null===(s=r.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(nt,{serverId:r.server_id,accessToken:m,auth_type:r.auth_type,userRole:u,userID:x})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsxs)(W.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"MCP Server Settings"}),p?null:(0,c.jsx)(_.Z,{variant:"light",onClick:()=>g(!0),children:"Edit Settings"})]}),p?(0,c.jsx)(iM,{mcpServer:r,accessToken:m,onCancel:()=>g(!1),onSuccess:e=>{g(!1),i()},availableAccessGroups:h}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Server Name"}),(0,c.jsx)("div",{children:r.server_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Alias"}),(0,c.jsx)("div",{children:r.alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Description"}),(0,c.jsx)("div",{children:r.description})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"URL"}),(0,c.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[S(r.url,j),Z&&(0,c.jsx)("button",{onClick:()=>f(!j),className:"p-1 hover:bg-gray-100 rounded",children:(0,c.jsx)(sj.Z,{icon:j?iS.Z:iC.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Transport"}),(0,c.jsx)("div",{children:iA(r.transport)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Auth Type"}),(0,c.jsx)("div",{children:iE(r.auth_type)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Spec Version"}),(0,c.jsx)("div",{children:r.spec_version})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Access Groups"}),(0,c.jsx)("div",{children:r.mcp_access_groups&&r.mcp_access_groups.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:r.mcp_access_groups.map((e,s)=>{var t;return(0,c.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:""},s)})}):(0,c.jsx)(w.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cost Configuration"}),(0,c.jsx)(iD,{costConfig:null===(t=r.mcp_info)||void 0===t?void 0:t.mcp_server_cost_info})]})]})]})})]})]})]})};var iR=t(83669);let{Panel:iq}=tx.default;var iU=e=>{let{accessToken:s,formValues:t,onToolsLoaded:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),h=t.url&&t.transport&&t.auth_type&&s,p=async()=>{if(s&&t.url){n(!0),m(null);try{let e={server_id:t.server_id||"",server_name:t.server_name||"",url:t.url,transport:t.transport,spec_version:t.spec_version,auth_type:t.auth_type,mcp_info:t.mcp_info},a=await (0,g.testMCPToolsListRequest)(s,e);if(a.tools&&!a.error)r(a.tools),m(null),null==l||l(a.tools),a.tools.length>0&&!u&&x(!0);else{let e=a.message||"Failed to retrieve tools list";m(e),r([]),null==l||l([]),x(!1)}}catch(e){console.error("Tools fetch error:",e),m(e instanceof Error?e.message:String(e)),r([]),null==l||l([]),x(!1)}finally{n(!1)}}};return((0,d.useEffect)(()=>{h?p():(r([]),m(null),x(!1),null==l||l([]))},[t.url,t.transport,t.auth_type,t.spec_version,s]),h||t.url)?(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(iR.Z,{className:"text-blue-600"}),(0,c.jsx)(k.Z,{children:"Connection Status"})]}),!h&&t.url&&(0,c.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,c.jsx)(a2.Z,{className:"text-2xl mb-2"}),(0,c.jsx)(w.Z,{children:"Complete required fields to test connection"}),(0,c.jsx)("br",{}),(0,c.jsx)(w.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),h&&(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":a.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,c.jsx)("br",{}),(0,c.jsxs)(w.Z,{className:"text-gray-500 text-sm",children:["Server: ",t.url]})]}),i&&(0,c.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,c.jsx)(lm.Z,{size:"small",className:"mr-2"}),(0,c.jsx)(w.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&a.length>0&&(0,c.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,c.jsx)(iR.Z,{className:"mr-1"}),(0,c.jsx)(w.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,c.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,c.jsx)(lI.Z,{className:"mr-1"}),(0,c.jsx)(w.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,c.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,c.jsx)(lm.Z,{size:"large"}),(0,c.jsx)(w.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,c.jsx)(tH.Z,{message:"Connection Failed",description:o,type:"error",showIcon:!0,action:(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(s5.Z,{}),onClick:p,size:"small",children:"Retry"})}),!i&&a.length>0&&(0,c.jsx)(tx.default,{items:[{key:"1",label:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-2 text-green-500"}),(0,c.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,c.jsx)(r$.Z,{count:a.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,c.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:a.map((e,s)=>(0,c.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]},s))})}]}),!i&&0===a.length&&!o&&(0,c.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,c.jsx)(iR.Z,{className:"text-2xl mb-2 text-green-500"}),(0,c.jsx)(w.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,c.jsx)("br",{}),(0,c.jsx)(w.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},iz=e=>{let{isVisible:s}=e;return s?(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,c.jsx)(z.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,c.jsx)(L.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null};let iV="".concat("../ui/assets/logos/","mcp_logo.png");var iK=e=>{let{userRole:s,accessToken:t,onCreateSuccess:l,isModalVisible:a,setModalVisible:r,availableAccessGroups:i}=e,[n]=I.Z.useForm(),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)({}),[h,p]=(0,d.useState)({}),[j,f]=(0,d.useState)(!1),[v,b]=(0,d.useState)([]),[N,Z]=(0,d.useState)("sse"),[w,k]=(0,d.useState)(""),S=async e=>{m(!0);try{let s=e.mcp_access_groups,a={};if(e.stdio_config&&"stdio"===N)try{let s=JSON.parse(e.stdio_config),t=s;if(s.mcpServers&&"object"==typeof s.mcpServers){let l=Object.keys(s.mcpServers);if(l.length>0){let a=l[0];t=s.mcpServers[a],e.server_name||(e.server_name=a.replace(/-/g,"_"))}}a={command:t.command,args:t.args,env:t.env},console.log("Parsed stdio config:",a)}catch(e){P.ZP.error("Invalid JSON in stdio configuration");return}let i={...e,...a,stdio_config:void 0,mcp_info:{server_name:e.server_name||e.url,description:e.description,mcp_server_cost_info:Object.keys(u).length>0?u:null},mcp_access_groups:s,alias:e.alias};if(console.log("Payload: ".concat(JSON.stringify(i))),null!=t){let e=await (0,g.createMCPServer)(t,i);P.ZP.success("MCP Server created successfully"),n.resetFields(),x({}),b([]),r(!1),l(e)}}catch(e){P.ZP.error("Error creating MCP Server: "+e,20)}finally{m(!1)}},E=()=>{n.resetFields(),x({}),b([]),r(!1)};return(d.useEffect(()=>{if(!j&&h.server_name){let e=h.server_name.replace(/\s+/g,"_");n.setFieldsValue({alias:e}),p(s=>({...s,alias:e}))}},[h.server_name]),(0,eE.tY)(s))?(0,c.jsx)(A.Z,{title:(0,c.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,c.jsx)("img",{src:iV,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:a,width:1e3,onCancel:E,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsxs)(I.Z,{form:n,onFinish:S,onValuesChange:(e,s)=>p(s),layout:"vertical",className:"space-y-6",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,c.jsx)(z.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,c.jsx)(z.Z,{title:"A short, unique identifier for this server. Defaults to the server name with spaces replaced by underscores.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>f(!0)})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description"}],children:(0,c.jsx)(y.Z,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,c.jsxs)(C.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{Z(e),"stdio"===e?n.setFieldsValue({url:void 0,auth_type:void 0}):n.setFieldsValue({command:void 0,args:void 0,env:void 0})},value:N,children:[(0,c.jsx)(C.default.Option,{value:"http",children:"HTTP"}),(0,c.jsx)(C.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,c.jsx)(C.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==N&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{type:"url",message:"Please enter a valid URL"}],children:(0,c.jsx)(y.Z,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==N&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,c.jsxs)(C.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,c.jsx)(C.default.Option,{value:"none",children:"None"}),(0,c.jsx)(C.default.Option,{value:"api_key",children:"API Key"}),(0,c.jsx)(C.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,c.jsx)(C.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,c.jsx)(iz,{isVisible:"stdio"===N}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Version",(0,c.jsx)(z.Z,{title:"Select the MCP specification version your server supports",children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"spec_version",rules:[{required:!0,message:"Please select a spec version"}],children:(0,c.jsxs)(C.default,{placeholder:"Select MCP version",className:"rounded-lg",size:"large",children:[(0,c.jsx)(C.default.Option,{value:"2025-03-26",children:"2025-03-26 (Latest)"}),(0,c.jsx)(C.default.Option,{value:"2024-11-05",children:"2024-11-05"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,c.jsx)(z.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.value)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>k(e),tokenSeparators:[","],options:(()=>{let e=i.map(e=>({value:e,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})}));return w&&!i.some(e=>e.toLowerCase().includes(w.toLowerCase()))&&e.push({value:w,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:w}),(0,c.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e})(),maxTagCount:"responsive",allowClear:!0})})]}),(0,c.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,c.jsx)(iU,{accessToken:t,formValues:h,onToolsLoaded:b})}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(iO,{value:u,onChange:x,tools:v,disabled:!1})}),(0,c.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:E,children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",loading:o,children:o?"Creating...":"Add MCP Server"})]})]})})}):null},iB=t(64935),iG=t(11239),iH=t(54001),iJ=t(96137),iY=t(96362),iW=t(80221),i$=t(29202);let{Title:iQ,Text:iX}=em.default,{Panel:i0}=tx.default,i1=e=>{let{icon:s,title:t,description:l,children:a,serverName:r,accessGroups:i=["dev"]}=e,[n,o]=(0,d.useState)(!1),m=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(n&&r){let s=[r.replace(/\s+/g,"_"),...i].join(",");e["x-mcp-servers"]=[s]}return e};return(0,c.jsxs)(th.Z,{className:"border border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,c.jsxs)("div",{children:[(0,c.jsx)(iQ,{level:5,className:"mb-0",children:t}),(0,c.jsx)(iX,{className:"text-gray-600",children:l})]})]}),r&&("Implementation Example"===t||"Configuration"===t)&&(0,c.jsxs)(I.Z.Item,{className:"mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(tn.Z,{size:"small",checked:n,onChange:o}),(0,c.jsxs)(iX,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,c.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),n&&(0,c.jsx)(tH.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,c.jsxs)("div",{children:[(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,c.jsxs)("code",{children:['["',r.replace(/\s+/g,"_"),'"]']})]}),(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,c.jsx)("code",{children:'["dev-group"]'})]}),(0,c.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,c.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),d.Children.map(a,e=>{if(d.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return d.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(m(),null,8)))})}return e})]})};var i2=e=>{let{currentServerAccessGroups:s=[]}=e,t=(0,g.getProxyBaseUrl)(),[l,a]=(0,d.useState)({}),[r,i]=(0,d.useState)({openai:[],litellm:[],cursor:[],http:[]}),[n]=(0,d.useState)("Zapier_MCP"),o=async(e,s)=>{await eF(e)&&(a(e=>({...e,[s]:!0})),setTimeout(()=>{a(e=>({...e,[s]:!1}))},2e3))},m=e=>{let{code:s,copyKey:t,title:a,className:r=""}=e;return(0,c.jsxs)("div",{className:"relative group",children:[a&&(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(iB.Z,{size:16,className:"text-blue-600"}),(0,c.jsx)(iX,{strong:!0,className:"text-gray-700",children:a})]}),(0,c.jsxs)(th.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(r),children:[(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:l[t]?(0,c.jsx)(sr.Z,{size:12}):(0,c.jsx)(si.Z,{size:12}),onClick:()=>o(s,t),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(l[t]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,c.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},u=e=>{let{step:s,title:t,children:l}=e;return(0,c.jsxs)("div",{className:"flex gap-4",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsx)(iX,{strong:!0,className:"text-gray-800 block mb-2",children:t}),l]})]})};return(0,c.jsx)("div",{children:(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,c.jsx)(w.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,c.jsxs)(eW.Z,{className:"w-full",children:[(0,c.jsx)(e$.Z,{className:"flex justify-start mt-8 mb-6",children:(0,c.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,c.jsx)(eY.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iB.Z,{size:18}),"OpenAI API"]})}),(0,c.jsx)(eY.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iG.Z,{size:18}),"LiteLLM Proxy"]})}),(0,c.jsx)(eY.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iW.Z,{size:18}),"Cursor"]})}),(0,c.jsx)(eY.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(i$.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iB.Z,{className:"text-blue-600",size:24}),(0,c.jsx)(iQ,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,c.jsx)(iX,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(i1,{icon:(0,c.jsx)(iH.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,c.jsxs)(tY.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsxs)(iX,{children:["Get your API key from the"," ",(0,c.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,c.jsx)(iY.Z,{size:12})]})]})}),(0,c.jsx)(m,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iJ.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"openai-server-url"})}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iB.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,c.jsx)(m,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(t,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,c.jsx)(eQ.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iG.Z,{className:"text-emerald-600",size:24}),(0,c.jsx)(iQ,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,c.jsx)(iX,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(i1,{icon:(0,c.jsx)(iH.Z,{className:"text-emerald-600",size:16}),title:"API Key Setup",description:"Configure your LiteLLM Proxy API key for authentication",children:(0,c.jsxs)(tY.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsx)(iX,{children:"Get your API key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,c.jsx)(m,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iJ.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"litellm-server-url"})}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iB.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:n,accessGroups:["dev"],children:(0,c.jsx)(m,{code:"curl --location '".concat(t,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_API_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(t,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,c.jsx)(eQ.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iW.Z,{className:"text-purple-600",size:24}),(0,c.jsx)(iQ,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,c.jsx)(iX,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,c.jsxs)(th.Z,{className:"border border-gray-200",children:[(0,c.jsx)(iQ,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(u,{step:1,title:"Open Cursor Settings",children:(0,c.jsxs)(iX,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,c.jsx)(u,{step:2,title:"Navigate to MCP Tools",children:(0,c.jsx)(iX,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,c.jsxs)(u,{step:3,title:"Add Configuration",children:[(0,c.jsxs)(iX,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,c.jsx)(i1,{icon:(0,c.jsx)(iB.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,c.jsx)(m,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "server_url": "'.concat(t,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,c.jsx)(eQ.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tY.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(i$.Z,{className:"text-green-600",size:24}),(0,c.jsx)(iQ,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,c.jsx)(iX,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,c.jsx)(i1,{icon:(0,c.jsx)(i$.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,c.jsxs)(tY.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsx)(iX,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"http-server-url"}),(0,c.jsx)(m,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(T.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,c.jsx)(iY.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},i4=t(67187);let{Option:i5}=C.default,i6=e=>{let{isModalOpen:s,title:t,confirmDelete:l,cancelDelete:a}=e;return s?(0,c.jsx)(A.Z,{open:s,onOk:l,okType:"danger",onCancel:a,children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:t}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)("p",{children:"Are you sure you want to delete this MCP Server?"})})]})}):null};var i3=e=>{let{accessToken:s,userRole:t,userID:l}=e,{data:a,isLoading:r,refetch:i}=(0,sd.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,g.fetchMCPServers)(s)},enabled:!!s}),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)("all"),[y,b]=(0,d.useState)("all"),[N,Z]=(0,d.useState)([]),[S,I]=(0,d.useState)(!1),A="Internal User"===t,E=d.useMemo(()=>{if(!a)return[];let e=new Set,s=[];return a.forEach(t=>{t.teams&&t.teams.forEach(t=>{let l=t.team_id;e.has(l)||(e.add(l),s.push(t))})}),s},[a]),T=d.useMemo(()=>a?Array.from(new Set(a.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[a]),L=e=>{v(e),M(e,y)},O=e=>{b(e),M(f,e)},M=(e,s)=>{if(!a)return Z([]);let t=a;if("personal"===e){Z([]);return}"all"!==e&&(t=t.filter(s=>{var t;return null===(t=s.teams)||void 0===t?void 0:t.some(s=>s.team_id===e)})),"all"!==s&&(t=t.filter(e=>{var t;return null===(t=e.mcp_access_groups)||void 0===t?void 0:t.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),Z(t)};(0,d.useEffect)(()=>{M(f,y)},[a]);let D=d.useMemo(()=>ik(null!=t?t:"",e=>{h(e),j(!1)},e=>{h(e),j(!0)},F),[t]);function F(e){o(e),u(!0)}let R=async()=>{if(null!=n&&null!=s){try{await (0,g.deleteMCPServer)(s,n),P.ZP.success("Deleted MCP Server successfully"),i()}catch(e){console.error("Error deleting the mcp server:",e)}u(!1),o(null)}};return s&&t&&l?(0,c.jsxs)("div",{className:"w-full h-full p-6",children:[(0,c.jsx)(i6,{isModalOpen:m,title:"Delete MCP Server",confirmDelete:R,cancelDelete:()=>{u(!1),o(null)}}),(0,c.jsx)(iK,{userRole:t,accessToken:s,onCreateSuccess:e=>{Z(s=>[...s,e]),I(!1)},isModalVisible:S,setModalVisible:I,availableAccessGroups:T}),(0,c.jsx)(k.Z,{children:"MCP Servers"}),(0,c.jsx)(w.Z,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,eE.tY)(t)&&(0,c.jsx)(_.Z,{className:"mt-4 mb-4",onClick:()=>I(!0),children:"+ Add New MCP Server"}),(0,c.jsxs)(eW.Z,{className:"w-full h-full",children:[(0,c.jsx)(e$.Z,{className:"flex justify-between mt-2 w-full items-center",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eY.Z,{children:"All Servers"}),(0,c.jsx)(eY.Z,{children:"Connect"})]})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(()=>x?(0,c.jsx)(iF,{mcpServer:N.find(e=>e.server_id===x)||{server_id:"",server_name:"",alias:"",url:"",transport:"",spec_version:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{j(!1),h(null),i()},isProxyAdmin:(0,eE.tY)(t),isEditing:p,accessToken:s,userID:l,userRole:t,availableAccessGroups:T}):(0,c.jsxs)("div",{className:"w-full h-full",children:[(0,c.jsx)("div",{className:"w-full px-6",children:(0,c.jsx)("div",{className:"flex flex-col space-y-4",children:(0,c.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,c.jsxs)(C.default,{value:f,onChange:L,style:{width:300},children:[(0,c.jsx)(i5,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:A?"All Available Servers":"All Servers"})]})}),(0,c.jsx)(i5,{value:"personal",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Personal"})]})}),E.map(e=>(0,c.jsx)(i5,{value:e.team_id,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,c.jsxs)(w.Z,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,c.jsx)(z.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,c.jsx)(i4.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,c.jsxs)(C.default,{value:y,onChange:O,style:{width:300},children:[(0,c.jsx)(i5,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),T.map(e=>(0,c.jsx)(i5,{value:e,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,c.jsx)("div",{className:"w-full px-6 mt-6",children:(0,c.jsx)(t3,{data:N,columns:D,renderSubComponent:()=>(0,c.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:r,noDataMessage:"No MCP servers configured"})})]}),{})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(i2,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:t,userID:l}),(0,c.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},i8=t(21770);function i7(e){let{tool:s,needsAuth:t,authValue:l,onSubmit:a,isLoading:r,result:i,error:n,onClose:o}=e,[m]=I.Z.useForm(),[u,x]=d.useState("formatted"),[h,p]=d.useState(null),[g,j]=d.useState(null),f=d.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),v=d.useMemo(()=>f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{type:"object",properties:f.properties.params.properties,required:f.properties.params.required||[]}:f,[f]);d.useEffect(()=>{h&&(i||n)&&j(Date.now()-h)},[i,n,h]);let b=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let t=document.execCommand("copy");if(document.body.removeChild(s),!t)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},N=async()=>{await b(JSON.stringify(i,null,2))?P.ZP.success("Result copied to clipboard"):P.ZP.error("Failed to copy result")},Z=async()=>{await b(s.name)?P.ZP.success("Tool name copied to clipboard"):P.ZP.error("Failed to copy tool name")};return(0,c.jsxs)("div",{className:"space-y-4 h-full",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,c.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,c.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,c.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:Z,title:"Click to copy tool name",children:[(0,c.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,c.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,c.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,c.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,c.jsx)(_.Z,{onClick:o,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,c.jsx)(z.Z,{title:"Configure the input parameters for this tool call",children:(0,c.jsx)(U.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,c.jsx)("div",{className:"p-4",children:(0,c.jsxs)(I.Z,{form:m,onFinish:e=>{p(Date.now()),j(null);let s={};Object.entries(e).forEach(e=>{var t;let[l,a]=e,r=null===(t=v.properties)||void 0===t?void 0:t[l];if(r&&null!=a&&""!==a)switch(r.type){case"boolean":s[l]="true"===a||!0===a;break;case"number":s[l]=Number(a);break;case"string":s[l]=String(a);break;default:s[l]=a}else null!=a&&""!==a&&(s[l]=a)}),a(f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,c.jsx)("div",{className:"space-y-3",children:(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,c.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,c.jsx)(y.Z,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===v.properties?(0,c.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,c.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,c.jsx)("div",{className:"space-y-3",children:Object.entries(v.properties).map(e=>{var s,t,l,a,r;let[i,n]=e;return(0,c.jsxs)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=v.required)||void 0===s?void 0:s.includes(i))&&(0,c.jsx)("span",{className:"text-red-500",children:"*"}),n.description&&(0,c.jsx)(z.Z,{title:n.description,children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(t=v.required)||void 0===t?void 0:t.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===n.type&&n.enum&&(0,c.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:n.default,children:[!(null===(l=v.required)||void 0===l?void 0:l.includes(i))&&(0,c.jsxs)("option",{value:"",children:["Select ",i]}),n.enum.map(e=>(0,c.jsx)("option",{value:e,children:e},e))]}),"string"===n.type&&!n.enum&&(0,c.jsx)(y.Z,{placeholder:n.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===n.type&&(0,c.jsx)("input",{type:"number",placeholder:n.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===n.type&&(0,c.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=n.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(r=v.required)||void 0===r?void 0:r.includes(i))&&(0,c.jsxs)("option",{value:"",children:["Select ",i]}),(0,c.jsx)("option",{value:"true",children:"True"}),(0,c.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,c.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,c.jsx)(_.Z,{onClick:()=>m.submit(),disabled:r,variant:"primary",className:"w-full",loading:r,children:r?"Calling Tool...":i||n?"Call Again":"Call Tool"})})]})})]}),(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,c.jsx)("div",{className:"p-4",children:i||n||r?(0,c.jsxs)("div",{className:"space-y-3",children:[i&&!r&&!n&&(0,c.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,c.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,c.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,c.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,c.jsx)("button",{onClick:()=>x("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,c.jsx)("button",{onClick:()=>x("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,c.jsx)("button",{onClick:N,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,c.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[r&&(0,c.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,c.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,c.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,c.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),n&&(0,c.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,c.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,c.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,c.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,c.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:n.message})})]})]})}),i&&!r&&!n&&(0,c.jsx)("div",{className:"space-y-3",children:"formatted"===u?i.map((e,s)=>(0,c.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,c.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let t=e.replace(/^#+\s/,"");return(0,c.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:t})},s)}let t=/(https?:\/\/[^\s\)]+)/g;if(t.test(e)){let l=e.split(t);return(0,c.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,c.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:l.map((e,s)=>t.test(e)?(0,c.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,c.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,c.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,c.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,c.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,c.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,c.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,c.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,c.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,c.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,c.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,c.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(i,null,2)})})})})]})]}):(0,c.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,c.jsxs)("div",{className:"text-center max-w-sm",children:[(0,c.jsx)("div",{className:"mb-3",children:(0,c.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,c.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,c.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var i9=t(36724);let ne=e=>{let s,{visible:t,onOk:l,onCancel:a,authType:r}=e,[i]=I.Z.useForm();if(r===iI.API_KEY||r===iI.BEARER_TOKEN){let e=r===iI.API_KEY?"API Key":"Bearer Token";s=(0,c.jsx)(I.Z.Item,{name:"authValue",label:e,rules:[{required:!0,message:"Please input your ".concat(e)}],children:(0,c.jsx)(L.default.Password,{})})}else r===iI.BASIC&&(s=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{name:"username",label:"Username",rules:[{required:!0,message:"Please input your username"}],children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{name:"password",label:"Password",rules:[{required:!0,message:"Please input your password"}],children:(0,c.jsx)(L.default.Password,{})})]}));return(0,c.jsx)(A.Z,{open:t,title:"Authentication",onOk:()=>{i.validateFields().then(e=>{r===iI.BASIC?l("".concat(e.username.trim(),":").concat(e.password.trim())):l(e.authValue.trim())})},onCancel:a,destroyOnClose:!0,children:(0,c.jsx)(I.Z,{form:i,layout:"vertical",children:s})})},ns=e=>{let{authType:s,onAuthSubmit:t,hasAuth:l}=e,[a,r]=(0,d.useState)(!1);return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)(i9.xv,{className:"text-sm font-medium text-gray-700",children:["Authentication ",l?"✓":""]}),(0,c.jsx)(i9.zx,{onClick:()=>r(!0),size:"sm",variant:"secondary",className:"text-xs",children:l?"Update":"Add Auth"})]}),(0,c.jsx)(i9.xv,{className:"text-xs text-gray-500",children:l?"Authentication configured":"Some tools may require authentication"}),(0,c.jsx)(ne,{visible:a,onOk:e=>{t(e),r(!1)},onCancel:()=>r(!1),authType:s})]})};var nt=e=>{let{serverId:s,accessToken:t,auth_type:l,userRole:a,userID:r}=e,[i,n]=(0,d.useState)(""),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)(null),{data:j,isLoading:f,error:v}=(0,sd.a)({queryKey:["mcpTools"],queryFn:()=>{if(!t)throw Error("Access Token required");return(0,g.listMCPTools)(t,s)},enabled:!!t}),{mutate:_,isPending:y}=(0,i8.D)({mutationFn:e=>{if(!t)throw Error("Access Token required");return(0,g.callMCPTool)(t,e.tool.name,e.arguments,e.authValue)},onSuccess:e=>{x(e),p(null)},onError:e=>{p(e),x(null)}}),b=(null==j?void 0:j.tools)||[],N=""!==i;return(0,c.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,c.jsx)(i9.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,c.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,c.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,c.jsx)(i9.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,c.jsxs)("div",{className:"flex flex-col flex-1 space-y-6",children:[(0,c.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,c.jsxs)(i9.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-2"})," Available Tools",b.length>0&&(0,c.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:b.length})]}),f&&(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,c.jsxs)("div",{className:"relative mb-3",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,c.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,c.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==j?void 0:j.error)&&(0,c.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,c.jsxs)("p",{className:"font-medium",children:["Error: ",j.message]})}),!f&&!(null==j?void 0:j.error)&&(!b||0===b.length)&&(0,c.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,c.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!f&&!(null==j?void 0:j.error)&&b.length>0&&(0,c.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:b.map(e=>(0,c.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==o?void 0:o.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{m(e),x(null),p(null)},children:[(0,c.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,c.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,c.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,c.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==o?void 0:o.name)===e.name&&(0,c.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,c.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,c.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]}),iT(l)&&(0,c.jsxs)("div",{className:"pt-4 border-t border-gray-200 flex-shrink-0",children:[(0,c.jsxs)(i9.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,c.jsx)(a7.Z,{className:"mr-2"})," Authentication"]}),(0,c.jsx)(ns,{authType:l,onAuthSubmit:e=>n(e),hasAuth:N})]})]})]}),(0,c.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,c.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,c.jsx)(i9.Dx,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,c.jsx)("div",{className:"flex-1 overflow-auto p-4",children:o?(0,c.jsx)("div",{className:"h-full",children:(0,c.jsx)(i7,{tool:o,needsAuth:iT(l),authValue:i,onSubmit:e=>{_({tool:o,arguments:e,authValue:i})},result:u,error:h,isLoading:y,onClose:()=>m(null)})}):(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a6.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(i9.xv,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,c.jsx)(i9.xv,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})},nl=t(57018),na=e=>{let{tagId:s,onClose:t,accessToken:l,is_admin:a,editTag:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(r),[x,h]=(0,d.useState)([]),p=async()=>{if(l)try{let e=(await (0,g.tagInfoCall)(l,[s]))[s];e&&(o(e),r&&i.setFieldsValue({name:e.name,description:e.description,models:e.models}))}catch(e){console.error("Error fetching tag details:",e),P.ZP.error("Error fetching tag details: "+e)}};(0,d.useEffect)(()=>{p()},[s,l]),(0,d.useEffect)(()=>{l&&eV("dummy-user","Admin",l,h)},[l]);let j=async e=>{if(l)try{await (0,g.tagUpdateCall)(l,{name:e.name,description:e.description,models:e.models}),P.ZP.success("Tag updated successfully"),u(!1),p()}catch(e){console.error("Error updating tag:",e),P.ZP.error("Error updating tag: "+e)}};return n?(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.zx,{onClick:t,className:"mb-4",children:"← Back to Tags"}),(0,c.jsxs)(nl.Dx,{children:["Tag Name: ",n.name]}),(0,c.jsx)(nl.xv,{className:"text-gray-500",children:n.description||"No description"})]}),a&&!m&&(0,c.jsx)(nl.zx,{onClick:()=>u(!0),children:"Edit Tag"})]}),m?(0,c.jsx)(nl.Zb,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:j,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{label:"Tag Name",name:"name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed LLMs"," ",(0,c.jsx)(z.Z,{title:"Select which LLMs are allowed to process this type of data",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select LLMs",children:x.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(nl.zx,{onClick:()=>u(!1),children:"Cancel"}),(0,c.jsx)(nl.zx,{type:"submit",children:"Save Changes"})]})]})}):(0,c.jsx)("div",{className:"space-y-6",children:(0,c.jsxs)(nl.Zb,{children:[(0,c.jsx)(nl.Dx,{children:"Tag Details"}),(0,c.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Name"}),(0,c.jsx)(nl.xv,{children:n.name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Description"}),(0,c.jsx)(nl.xv,{children:n.description||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Allowed LLMs"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:0===n.models.length?(0,c.jsx)(nl.Ct,{color:"red",children:"All Models"}):n.models.map(e=>{var s;return(0,c.jsx)(nl.Ct,{color:"blue",children:(0,c.jsx)(z.Z,{title:"ID: ".concat(e),children:(null===(s=n.model_info)||void 0===s?void 0:s[e])||e})},e)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Created"}),(0,c.jsx)(nl.xv,{children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(nl.xv,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(nl.xv,{children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]})]})]})})]}):(0,c.jsx)("div",{children:"Loading..."})},nr=e=>{let{data:s,onEdit:t,onDelete:l,onSelectTag:a}=e,[r,i]=d.useState([{id:"created_at",desc:!0}]),n=[{header:"Tag Name",accessorKey:"name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:t.name,children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5",onClick:()=>a(t.name),children:t.name})})})}},{header:"Description",accessorKey:"description",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.description,children:(0,c.jsx)("span",{className:"text-xs",children:t.description||"-"})})}},{header:"Allowed LLMs",accessorKey:"models",cell:e=>{var s,t;let{row:l}=e,a=l.original;return(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:(null==a?void 0:null===(s=a.models)||void 0===s?void 0:s.length)===0?(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"red",children:"All Models"}):null==a?void 0:null===(t=a.models)||void 0===t?void 0:t.map(e=>{var s;return(0,c.jsx)(eJ.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,c.jsx)(z.Z,{title:"ID: ".concat(e),children:(0,c.jsx)(w.Z,{children:(null===(s=a.model_info)||void 0===s?void 0:s[e])||e})})},e)})})}},{header:"Created",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,a=s.original;return(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>t(a),className:"cursor-pointer"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>l(a.name),className:"cursor-pointer"})]})}}],o=(0,sp.b7)({data:s,columns:n,state:{sorting:r},onSortingChange:i,getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0});return(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sf.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sy.Z,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(sN.Z,{children:e.headers.map(e=>(0,c.jsx)(sb.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(sv.Z,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsx)(sN.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(s_.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:n.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No tags found"})})})})})]})})})},ni=e=>{let{accessToken:s,userID:t,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[j,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(""),[k]=I.Z.useForm(),[S,E]=(0,d.useState)([]),T=async()=>{if(s)try{let e=await (0,g.tagListCall)(s);console.log("List tags response:",e),r(Object.values(e))}catch(e){console.error("Error fetching tags:",e),P.ZP.error("Error fetching tags: "+e)}},O=async e=>{if(s)try{await (0,g.tagCreateCall)(s,{name:e.tag_name,description:e.description,models:e.allowed_llms}),P.ZP.success("Tag created successfully"),n(!1),k.resetFields(),T()}catch(e){console.error("Error creating tag:",e),P.ZP.error("Error creating tag: "+e)}},M=async e=>{b(e),p(!0)},D=async()=>{if(s&&j){try{await (0,g.tagDeleteCall)(s,j),P.ZP.success("Tag deleted successfully"),T()}catch(e){console.error("Error deleting tag:",e),P.ZP.error("Error deleting tag: "+e)}p(!1),b(null)}};return(0,d.useEffect)(()=>{t&&l&&s&&(async()=>{try{let e=await (0,g.modelInfoCall)(s,t,l);e&&e.data&&E(e.data)}catch(e){console.error("Error fetching models:",e),P.ZP.error("Error fetching models: "+e)}})()},[s,t,l]),(0,d.useEffect)(()=>{T()},[s]),(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:o?(0,c.jsx)(na,{tagId:o,onClose:()=>{m(null),x(!1)},accessToken:s,is_admin:"Admin"===l,editTag:u}):(0,c.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,c.jsx)("h1",{children:"Tag Management"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[N&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",N]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{T(),Z(new Date().toLocaleString())}})]})]}),(0,c.jsxs)(w.Z,{className:"mb-4",children:["Click on a tag name to view and edit its details.",(0,c.jsxs)("p",{children:["You can use tags to restrict the usage of certain LLMs based on tags passed in the request. Read more about tag routing ",(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/tag_routing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})]}),(0,c.jsx)(_.Z,{className:"mb-4",onClick:()=>n(!0),children:"+ Create New Tag"}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(nr,{data:a,onEdit:e=>{m(e.name),x(!0)},onDelete:M,onSelectTag:m})})}),(0,c.jsx)(A.Z,{title:"Create New Tag",visible:i,width:800,footer:null,onCancel:()=>{n(!1),k.resetFields()},children:(0,c.jsxs)(I.Z,{form:k,onFinish:O,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"Tag Name",name:"tag_name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Models"," ",(0,c.jsx)(z.Z,{title:"Select which LLMs are allowed to process requests from this tag",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_llms",children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select LLMs",children:S.map(e=>(0,c.jsx)(C.default.Option,{value:e.model_info.id,children:(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{children:e.model_name}),(0,c.jsxs)("span",{className:"text-gray-400 ml-2",children:["(",e.model_info.id,")"]})]})},e.model_info.id))})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(_.Z,{type:"submit",children:"Create Tag"})})]})}),h&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Tag"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this tag?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:D,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{p(!1),b(null)},children:"Cancel"})]})]})]})})]})})},nn=e=>{let{data:s,onView:t,onEdit:l,onDelete:a}=e,[r,i]=d.useState([{id:"created_at",desc:!0}]),n=[{header:"Vector Store ID",accessorKey:"vector_store_id",cell:e=>{let{row:s}=e,l=s.original;return(0,c.jsx)("button",{onClick:()=>t(l.vector_store_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:l.vector_store_id.length>15?"".concat(l.vector_store_id.slice(0,15),"..."):l.vector_store_id})}},{header:"Name",accessorKey:"vector_store_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.vector_store_name,children:(0,c.jsx)("span",{className:"text-xs",children:t.vector_store_name||"-"})})}},{header:"Description",accessorKey:"vector_store_description",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.vector_store_description,children:(0,c.jsx)("span",{className:"text-xs",children:t.vector_store_description||"-"})})}},{header:"Provider",accessorKey:"custom_llm_provider",cell:e=>{let{row:s}=e,t=s.original,{displayName:l,logo:a}=(0,sL.dr)(t.custom_llm_provider);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,c.jsx)("img",{src:a,alt:l,className:"h-4 w-4"}),(0,c.jsx)("span",{className:"text-xs",children:l})]})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.updated_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)(sj.Z,{icon:sD.Z,size:"sm",onClick:()=>l(t.vector_store_id),className:"cursor-pointer"}),(0,c.jsx)(sj.Z,{icon:ee.Z,size:"sm",onClick:()=>a(t.vector_store_id),className:"cursor-pointer"})]})}}],o=(0,sp.b7)({data:s,columns:n,state:{sorting:r},onSortingChange:i,getCoreRowModel:(0,sg.sC)(),getSortedRowModel:(0,sg.tj)(),enableSorting:!0});return(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sf.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sy.Z,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(sN.Z,{children:e.headers.map(e=>(0,c.jsx)(sb.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sp.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sk.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sZ.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(sv.Z,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsx)(sN.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(s_.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sp.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sN.Z,{children:(0,c.jsx)(s_.Z,{colSpan:n.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No vector stores found"})})})})})]})})})};(r=o||(o={})).Bedrock="Amazon Bedrock",r.PgVector="PostgreSQL pgvector (LiteLLM Connector)",r.VertexRagEngine="Vertex AI RAG Engine",r.OpenAI="OpenAI",r.Azure="Azure OpenAI";let no={Bedrock:"bedrock",PgVector:"pg_vector",VertexRagEngine:"vertex_ai",OpenAI:"openai",Azure:"azure"},nc="/ui/assets/logos/",nd={"Amazon Bedrock":"".concat(nc,"bedrock.svg"),"PostgreSQL pgvector (LiteLLM Connector)":"".concat(nc,"postgresql.svg"),"Vertex AI RAG Engine":"".concat(nc,"google.svg"),OpenAI:"".concat(nc,"openai_small.svg"),"Azure OpenAI":"".concat(nc,"microsoft_azure.svg")},nm={bedrock:[],pg_vector:[{name:"api_base",label:"API Base",tooltip:"Enter the base URL of your deployed litellm-pgvector server (e.g., http://your-server:8000)",placeholder:"http://your-deployed-server:8000",required:!0,type:"text"},{name:"api_key",label:"API Key",tooltip:"Enter the API key from your deployed litellm-pgvector server",placeholder:"your-deployed-api-key",required:!0,type:"password"}],vertex_rag_engine:[],openai:[{name:"api_key",label:"API Key",tooltip:"Enter your OpenAI API key",placeholder:"sk-...",required:!0,type:"password"}],azure:[{name:"api_key",label:"API Key",tooltip:"Enter your Azure OpenAI API key",placeholder:"your-azure-api-key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Azure OpenAI endpoint (e.g., https://your-resource.openai.azure.com/)",placeholder:"https://your-resource.openai.azure.com/",required:!0,type:"text"}]},nu=e=>nm[e]||[];var nx=e=>{let{isVisible:s,onCancel:t,onSuccess:l,accessToken:a,credentials:r}=e,[i]=I.Z.useForm(),[n,m]=(0,d.useState)("{}"),[u,x]=(0,d.useState)("bedrock"),h=async e=>{if(a)try{let s={};try{s=n.trim()?JSON.parse(n):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:s,litellm_credential_name:e.litellm_credential_name},r=nu(e.custom_llm_provider).reduce((s,t)=>(s[t.name]=e[t.name],s),{});t.litellm_params=r,await (0,g.vectorStoreCreateCall)(a,t),P.ZP.success("Vector store created successfully"),i.resetFields(),m("{}"),l()}catch(e){console.error("Error creating vector store:",e),P.ZP.error("Error creating vector store: "+e)}},p=()=>{i.resetFields(),m("{}"),x("bedrock"),t()};return(0,c.jsx)(A.Z,{title:"Add New Vector Store",visible:s,width:1e3,footer:null,onCancel:p,children:(0,c.jsxs)(I.Z,{form:i,onFinish:h,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Provider"," ",(0,c.jsx)(z.Z,{title:"Select the provider for this vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],initialValue:"bedrock",children:(0,c.jsx)(C.default,{onChange:e=>x(e),children:Object.entries(o).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:no[s],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:nd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),"pg_vector"===u&&(0,c.jsx)(tH.Z,{message:"PG Vector Setup Required",description:(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"LiteLLM provides a server to connect to PG Vector. To use this provider:"}),(0,c.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,c.jsxs)("li",{children:["Deploy the litellm-pgvector server from: ",(0,c.jsx)("a",{href:"https://github.com/BerriAI/litellm-pgvector",target:"_blank",rel:"noopener noreferrer",children:"https://github.com/BerriAI/litellm-pgvector"})]}),(0,c.jsx)("li",{children:"Configure your PostgreSQL database with pgvector extension"}),(0,c.jsx)("li",{children:"Start the server and note the API base URL and API key"}),(0,c.jsx)("li",{children:"Enter those details in the fields below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_rag_engine"===u&&(0,c.jsx)(tH.Z,{message:"Vertex AI RAG Engine Setup",description:(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"To use Vertex AI RAG Engine:"}),(0,c.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,c.jsxs)("li",{children:["Set up your Vertex AI RAG Engine corpus following the guide: ",(0,c.jsx)("a",{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-overview",target:"_blank",rel:"noopener noreferrer",children:"Vertex AI RAG Engine Overview"})]}),(0,c.jsx)("li",{children:"Create a corpus in your Google Cloud project"}),(0,c.jsx)("li",{children:"Note the corpus ID from the Vertex AI console"}),(0,c.jsx)("li",{children:"Enter the corpus ID in the Vector Store ID field below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Vector Store ID"," ",(0,c.jsx)(z.Z,{title:"Enter the vector store ID from your api provider",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_id",rules:[{required:!0,message:"Please input the vector store ID from your api provider"}],children:(0,c.jsx)(y.Z,{placeholder:"vertex_rag_engine"===u?"6917529027641081856 (Get corpus ID from Vertex AI console)":"Enter vector store ID from your provider"})}),nu(u).map(e=>(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:[e.label," ",(0,c.jsx)(z.Z,{title:e.tooltip,children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:e.name,rules:e.required?[{required:!0,message:"Please input the ".concat(e.label.toLowerCase())}]:[],children:(0,c.jsx)(y.Z,{type:e.type||"text",placeholder:e.placeholder})},e.name)),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Vector Store Name"," ",(0,c.jsx)(z.Z,{title:"Custom name you want to give to the vector store, this name will be rendered on the LiteLLM UI",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_name",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"vector_store_description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Existing Credentials"," ",(0,c.jsx)(z.Z,{title:"Optionally select API provider credentials for this vector store eg. Bedrock API KEY",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...r.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON metadata for the vector store (optional)",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),children:(0,c.jsx)(L.default.TextArea,{rows:4,value:n,onChange:e=>m(e.target.value),placeholder:'{"key": "value"}'})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,c.jsx)(_.Z,{onClick:p,variant:"secondary",children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",type:"submit",children:"Create"})]})]})})},nh=e=>{let{isVisible:s,onCancel:t,onConfirm:l}=e;return(0,c.jsxs)(A.Z,{title:"Delete Vector Store",visible:s,footer:null,onCancel:t,children:[(0,c.jsx)("p",{children:"Are you sure you want to delete this vector store? This action cannot be undone."}),(0,c.jsxs)("div",{className:"px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:l,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:t,variant:"primary",children:"Cancel"})]})]})};let{TextArea:np}=L.default,{Text:ng,Title:nj}=em.default;var nf=e=>{let{vectorStoreId:s,accessToken:t,className:l=""}=e,[a,r]=(0,d.useState)(""),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)({}),h=async()=>{if(!a.trim()){P.ZP.warning("Please enter a search query");return}n(!0);try{let e=await (0,g.vectorStoreSearchCall)(t,s,a),l={query:a,response:e,timestamp:Date.now()};m(e=>[l,...e]),r("")}catch(e){console.error("Error searching vector store:",e),P.ZP.error("Failed to search vector store")}finally{n(!1)}},p=e=>new Date(e).toLocaleString(),j=(e,s)=>{let t="".concat(e,"-").concat(s);x(e=>({...e,[t]:!e[t]}))};return(0,c.jsx)(th.Z,{className:"w-full rounded-xl shadow-md",children:(0,c.jsxs)("div",{className:"flex flex-col h-[600px]",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a8.Z,{className:"mr-2 text-blue-500"}),(0,c.jsx)(nj,{level:4,className:"mb-0",children:"Test Vector Store"})]}),o.length>0&&(0,c.jsx)(T.ZP,{onClick:()=>{m([]),x({}),P.ZP.success("Search history cleared")},size:"small",children:"Clear History"})]}),(0,c.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===o.length?(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a8.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(ng,{children:"Test your vector store by entering a search query below"})]}):(0,c.jsx)("div",{className:"space-y-4",children:o.map((e,s)=>{var t;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("div",{className:"text-right",children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-blue-50 border border-blue-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,c.jsx)("strong",{className:"text-sm",children:"Query"}),(0,c.jsx)("span",{className:"text-xs text-gray-500",children:p(e.timestamp)})]}),(0,c.jsx)("div",{className:"text-left",children:e.query})]})}),(0,c.jsx)("div",{className:"text-left",children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-white border border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(a8.Z,{className:"text-green-500"}),(0,c.jsx)("strong",{className:"text-sm",children:"Vector Store Results"}),e.response&&(0,c.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600",children:[(null===(t=e.response.data)||void 0===t?void 0:t.length)||0," results"]})]}),e.response&&e.response.data&&e.response.data.length>0?(0,c.jsx)("div",{className:"space-y-3",children:e.response.data.map((e,t)=>{let l=u["".concat(s,"-").concat(t)]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden bg-gray-50",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>j(s,t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[l?(0,c.jsx)(tp.Z,{className:"text-gray-500 mr-2"}):(0,c.jsx)(t$.Z,{className:"text-gray-500 mr-2"}),(0,c.jsxs)("span",{className:"font-medium text-sm",children:["Result ",t+1]}),!l&&e.content&&e.content[0]&&(0,c.jsxs)("span",{className:"ml-2 text-xs text-gray-500 truncate max-w-md",children:["- ",e.content[0].text.substring(0,100),"..."]})]}),(0,c.jsxs)("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:["Score: ",e.score.toFixed(4)]})]}),l&&(0,c.jsxs)("div",{className:"border-t bg-white p-3",children:[e.content&&e.content.map((e,s)=>(0,c.jsxs)("div",{className:"mb-3",children:[(0,c.jsxs)("div",{className:"text-xs text-gray-500 mb-1",children:["Content (",e.type,")"]}),(0,c.jsx)("div",{className:"text-sm bg-gray-50 p-3 rounded border text-gray-800 max-h-40 overflow-y-auto",children:e.text})]},s)),(e.file_id||e.filename||e.attributes)&&(0,c.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[(0,c.jsx)("div",{className:"text-xs text-gray-500 mb-2 font-medium",children:"Metadata"}),(0,c.jsxs)("div",{className:"space-y-2 text-xs",children:[e.file_id&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium",children:"File ID:"})," ",e.file_id]}),e.filename&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium",children:"Filename:"})," ",e.filename]}),e.attributes&&Object.keys(e.attributes).length>0&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium block mb-1",children:"Attributes:"}),(0,c.jsx)("pre",{className:"text-xs bg-white p-2 rounded border overflow-x-auto",children:JSON.stringify(e.attributes,null,2)})]})]})]})]})]},t)})}):(0,c.jsx)("div",{className:"text-gray-500 text-sm",children:"No results found"})]})}),s<o.length-1&&(0,c.jsx)(Y.Z,{})]},s)})}),i&&(0,c.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,c.jsx)(lm.Z,{indicator:(0,c.jsx)(a5.Z,{style:{fontSize:24},spin:!0})})})]}),(0,c.jsx)("div",{className:"p-4 border-t border-gray-200 bg-white",children:(0,c.jsxs)("div",{className:"flex items-end space-x-2",children:[(0,c.jsx)("div",{className:"flex-1",children:(0,c.jsx)(np,{value:a,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),h())},placeholder:"Enter your search query... (Shift+Enter for new line)",disabled:i,autoSize:{minRows:1,maxRows:4},style:{resize:"none"}})}),(0,c.jsx)(T.ZP,{type:"primary",onClick:h,disabled:i||!a.trim(),icon:(0,c.jsx)(rl.Z,{}),loading:i,children:"Search"})]})})]})})},nv=e=>{let{vectorStoreId:s,onClose:t,accessToken:l,is_admin:a,editVectorStore:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(r),[x,h]=(0,d.useState)("{}"),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)("details"),y=async()=>{if(l)try{let e=await (0,g.vectorStoreInfoCall)(l,s);if(e&&e.vector_store){if(o(e.vector_store),e.vector_store.vector_store_metadata){let s="string"==typeof e.vector_store.vector_store_metadata?JSON.parse(e.vector_store.vector_store_metadata):e.vector_store.vector_store_metadata;h(JSON.stringify(s,null,2))}r&&i.setFieldsValue({vector_store_id:e.vector_store.vector_store_id,custom_llm_provider:e.vector_store.custom_llm_provider,vector_store_name:e.vector_store.vector_store_name,vector_store_description:e.vector_store.vector_store_description})}}catch(e){console.error("Error fetching vector store details:",e),P.ZP.error("Error fetching vector store details: "+e)}},b=async()=>{if(l)try{let e=await (0,g.credentialListCall)(l);console.log("List credentials response:",e),j(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e)}};(0,d.useEffect)(()=>{y(),b()},[s,l]);let N=async e=>{if(l)try{let s={};try{s=x?JSON.parse(x):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:s};await (0,g.vectorStoreUpdateCall)(l,t),P.ZP.success("Vector store updated successfully"),u(!1),y()}catch(e){console.error("Error updating vector store:",e),P.ZP.error("Error updating vector store: "+e)}};return n?(0,c.jsxs)("div",{className:"p-4 max-w-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e0.Z,variant:"light",className:"mb-4",onClick:t,children:"Back to Vector Stores"}),(0,c.jsxs)(k.Z,{children:["Vector Store ID: ",n.vector_store_id]}),(0,c.jsx)(w.Z,{className:"text-gray-500",children:n.vector_store_description||"No description"})]}),a&&!m&&(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Vector Store"})]}),(0,c.jsxs)(eW.Z,{children:[(0,c.jsxs)(e$.Z,{className:"mb-6",children:[(0,c.jsx)(eY.Z,{children:"Details"}),(0,c.jsx)(eY.Z,{children:"Test Vector Store"})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(eQ.Z,{children:m?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(k.Z,{children:"Edit Vector Store"})}),(0,c.jsx)(W.Z,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:N,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{label:"Vector Store ID",name:"vector_store_id",rules:[{required:!0,message:"Please input a vector store ID"}],children:(0,c.jsx)(L.default,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{label:"Vector Store Name",name:"vector_store_name",children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"vector_store_description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Provider"," ",(0,c.jsx)(z.Z,{title:"Select the provider for this vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{children:Object.entries(sL.Cl).map(e=>{let[s,t]=e;return"Bedrock"===s?(0,c.jsx)(C.default.Option,{value:sL.fK[s],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sL.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s):null})})}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsx)(w.Z,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter provider credentials below"})}),(0,c.jsx)(I.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...p.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON metadata for the vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),children:(0,c.jsx)(L.default.TextArea,{rows:4,value:x,onChange:e=>h(e.target.value),placeholder:'{"key": "value"}'})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:()=>u(!1),children:"Cancel"}),(0,c.jsx)(T.ZP,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]})})]}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Vector Store Details"}),a&&(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Vector Store"})]}),(0,c.jsx)(W.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"ID"}),(0,c.jsx)(w.Z,{children:n.vector_store_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Name"}),(0,c.jsx)(w.Z,{children:n.vector_store_name||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Description"}),(0,c.jsx)(w.Z,{children:n.vector_store_description||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Provider"}),(0,c.jsx)("div",{className:"flex items-center space-x-2 mt-1",children:(()=>{let e=n.custom_llm_provider||"bedrock",{displayName:s,logo:t}=(()=>{let s=Object.keys(sL.fK).find(s=>sL.fK[s].toLowerCase()===e.toLowerCase());if(!s)return{displayName:e,logo:""};let t=sL.Cl[s],l=sL.cd[t];return{displayName:t,logo:l}})();return(0,c.jsxs)(c.Fragment,{children:[t&&(0,c.jsx)("img",{src:t,alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let t=e.target,l=t.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=s.charAt(0),l.replaceChild(e,t)}}}),(0,c.jsx)(eJ.Z,{color:"blue",children:s})]})})()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("div",{className:"bg-gray-50 p-3 rounded mt-2 font-mono text-xs overflow-auto max-h-48",children:(0,c.jsx)("pre",{children:x})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(w.Z,{children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]})]})})]})}),(0,c.jsx)(eQ.Z,{children:(0,c.jsx)(nf,{vectorStoreId:n.vector_store_id,accessToken:l||""})})]})]})]}):(0,c.jsx)("div",{children:"Loading..."})},n_=e=>{let{accessToken:s,userID:t,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)(""),[j,y]=(0,d.useState)([]),[b,N]=(0,d.useState)(null),[Z,k]=(0,d.useState)(!1),S=async()=>{if(s)try{let e=await (0,g.vectorStoreListCall)(s);console.log("List vector stores response:",e),r(e.data||[])}catch(e){console.error("Error fetching vector stores:",e),P.ZP.error("Error fetching vector stores: "+e)}},C=async()=>{if(s)try{let e=await (0,g.credentialListCall)(s);console.log("List credentials response:",e),y(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e),P.ZP.error("Error fetching credentials: "+e)}},I=async e=>{x(e),m(!0)},A=async()=>{if(s&&u){try{await (0,g.vectorStoreDeleteCall)(s,u),P.ZP.success("Vector store deleted successfully"),S()}catch(e){console.error("Error deleting vector store:",e),P.ZP.error("Error deleting vector store: "+e)}m(!1),x(null)}};return(0,d.useEffect)(()=>{S(),C()},[s]),b?(0,c.jsx)("div",{className:"w-full h-full",children:(0,c.jsx)(nv,{vectorStoreId:b,onClose:()=>{N(null),k(!1),S()},accessToken:s,is_admin:(0,eE.tY)(l||""),editVectorStore:Z})}):(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,c.jsx)("h1",{children:"Vector Store Management"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[h&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",h]}),(0,c.jsx)(sj.Z,{icon:e1.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{S(),C(),p(new Date().toLocaleString())}})]})]}),(0,c.jsx)(w.Z,{className:"mb-4",children:(0,c.jsx)("p",{children:"You can use vector stores to store and retrieve LLM embeddings.."})}),(0,c.jsx)(_.Z,{className:"mb-4",onClick:()=>n(!0),children:"+ Add Vector Store"}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(nn,{data:a,onView:e=>{N(e),k(!1)},onEdit:e=>{N(e),k(!0)},onDelete:I})})}),(0,c.jsx)(nx,{isVisible:i,onCancel:()=>n(!1),onSuccess:()=>{n(!1),S()},accessToken:s,credentials:j}),(0,c.jsx)(nh,{isVisible:o,onCancel:()=>m(!1),onConfirm:A})]})})},ny=t(49096),nb=t(53335);let{cva:nN,cx:nZ,compose:nw}=(0,ny.ZD)({hooks:{onComplete:e=>(0,nb.m6)(e)}});function nk(e){var s,t;let{className:l="",...a}=e,r=(0,d.useId)();return s=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),s=e.find(e=>{var s;return(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))===r}),t=e.find(e=>{var s;return e.effect instanceof KeyframeEffect&&(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))!==r});s&&t&&(s.currentTime=t.currentTime)},t=[r],(0,d.useLayoutEffect)(s,t),(0,c.jsxs)("svg",{"data-spinner-id":r,className:nZ("pointer-events-none size-12 animate-spin text-current",l),fill:"none",viewBox:"0 0 24 24",...a,children:[(0,c.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,c.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}let nS=new x.S;function nC(){return(0,c.jsxs)("div",{className:nZ("h-screen","flex items-center justify-center gap-4"),children:[(0,c.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"\uD83D\uDE85 LiteLLM"}),(0,c.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,c.jsx)(nk,{className:"size-4"}),(0,c.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}function nI(){let[e,s]=(0,d.useState)(""),[t,l]=(0,d.useState)(!1),[a,r]=(0,d.useState)(!1),[i,n]=(0,d.useState)(null),[o,x]=(0,d.useState)(null),[f,v]=(0,d.useState)([]),[_,y]=(0,d.useState)([]),[b,N]=(0,d.useState)([]),[Z,w]=(0,d.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),[k,S]=(0,d.useState)(!0),C=(0,m.useSearchParams)(),[I,P]=(0,d.useState)({data:[]}),[A,E]=(0,d.useState)(null),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(!0),[D,F]=(0,d.useState)(null),R=C.get("invitation_id"),[q,U]=(0,d.useState)(()=>C.get("page")||"api-keys"),[z,V]=(0,d.useState)(null),K=e=>{v(s=>s?[...s,e]:[e]),L(()=>!T)},B=!1===O&&null===A&&null===R;return((0,d.useEffect)(()=>{let e=function(e){let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));return s?s.split("=")[1]:null}("token");(0,g.getUiConfig)().then(s=>{E(e),M(!1)})},[]),(0,d.useEffect)(()=>{B&&(window.location.href=(g.proxyBaseUrl||"")+"/sso/key/generate")},[B]),(0,d.useEffect)(()=>{if(!A)return;let e=(0,u.o)(A);if(e){if(V(e.key),r(e.disabled_non_admin_personal_key_creation),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);s(t),"Admin Viewer"==t&&U("usage")}e.user_email&&n(e.user_email),e.login_method&&S("username_password"==e.login_method),e.premium_user&&l(e.premium_user),e.auth_header_name&&(0,g.setGlobalLitellmHeaderName)(e.auth_header_name),e.user_id&&F(e.user_id)}},[A]),(0,d.useEffect)(()=>{z&&D&&e&&eV(D,e,z,N),z&&D&&e&&j(z,D,e,null,x),z&&ly(z,y)},[z,D,e]),O||B)?(0,c.jsx)(nC,{}):(0,c.jsx)(d.Suspense,{fallback:(0,c.jsx)(nC,{}),children:(0,c.jsx)(h.aH,{client:nS,children:R?(0,c.jsx)(sE,{userID:D,userRole:e,premiumUser:t,teams:o,keys:f,setUserRole:s,userEmail:i,setUserEmail:n,setTeams:x,setKeys:v,organizations:_,addKey:K,createClicked:T}):(0,c.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,c.jsx)(p.Z,{userID:D,userRole:e,premiumUser:t,userEmail:i,setProxySettings:w,proxySettings:Z,accessToken:z,isPublicPage:!1}),(0,c.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,c.jsx)("div",{className:"mt-8",children:(0,c.jsx)(rS,{accessToken:z,setPage:e=>{let s=new URLSearchParams(C);s.set("page",e),window.history.pushState(null,"","?".concat(s.toString())),U(e)},userRole:e,defaultSelectedKey:q})}),"api-keys"==q?(0,c.jsx)(sE,{userID:D,userRole:e,premiumUser:t,teams:o,keys:f,setUserRole:s,userEmail:i,setUserEmail:n,setTeams:x,setKeys:v,organizations:_,addKey:K,createClicked:T}):"models"==q?(0,c.jsx)(le,{userID:D,userRole:e,token:A,keys:f,accessToken:z,modelData:I,setModelData:P,premiumUser:t,teams:o}):"llm-playground"==q?(0,c.jsx)(ri,{userID:D,userRole:e,token:A,accessToken:z,disabledPersonalKeyCreation:a}):"users"==q?(0,c.jsx)(lp,{userID:D,userRole:e,token:A,keys:f,teams:o,accessToken:z,setKeys:v}):"teams"==q?(0,c.jsx)(lv,{teams:o,setTeams:x,searchParams:C,accessToken:z,userID:D,userRole:e,organizations:_,premiumUser:t}):"organizations"==q?(0,c.jsx)(lb,{organizations:_,setOrganizations:y,userModels:b,accessToken:z,userRole:e,premiumUser:t}):"admin-panel"==q?(0,c.jsx)(lO,{setTeams:x,searchParams:C,accessToken:z,userID:D,showSSOBanner:k,premiumUser:t,proxySettings:Z}):"api_ref"==q?(0,c.jsx)(aL,{proxySettings:Z}):"settings"==q?(0,c.jsx)(lB,{userID:D,userRole:e,accessToken:z,premiumUser:t}):"budgets"==q?(0,c.jsx)(l5,{accessToken:z}):"guardrails"==q?(0,c.jsx)(iy,{accessToken:z,userRole:e}):"transform-request"==q?(0,c.jsx)(ib,{accessToken:z}):"general-settings"==q?(0,c.jsx)(l0,{userID:D,userRole:e,accessToken:z,modelData:I}):"model-hub-table"==q?(0,c.jsx)(aj.Z,{accessToken:z,publicPage:!1,premiumUser:t,userRole:e}):"caching"==q?(0,c.jsx)(rR,{userID:D,userRole:e,token:A,accessToken:z,premiumUser:t}):"pass-through-settings"==q?(0,c.jsx)(t7,{userID:D,userRole:e,accessToken:z,modelData:I}):"logs"==q?(0,c.jsx)(ap,{userID:D,userRole:e,token:A,accessToken:z,allTeams:null!=o?o:[],premiumUser:t}):"mcp-servers"==q?(0,c.jsx)(i3,{accessToken:z,userRole:e,userID:D}):"tag-management"==q?(0,c.jsx)(ni,{accessToken:z,userRole:e,userID:D}):"vector-stores"==q?(0,c.jsx)(n_,{accessToken:z,userRole:e,userID:D}):"new_usage"==q?(0,c.jsx)(aT,{userID:D,userRole:e,accessToken:z,teams:null!=o?o:[],premiumUser:t}):(0,c.jsx)(rP,{userID:D,userRole:e,token:A,accessToken:z,keys:f,premiumUser:t})]})]})})})}}},function(e){e.O(0,[665,990,445,152,634,475,199,338,162,172,971,117,744],function(){return e(e.s=36362)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/page-f64fe7b1998a3ca8.js b/ui/litellm-dashboard/out/_next/static/chunks/app/page-f64fe7b1998a3ca8.jsdeleted file mode 100644index 6119f5206d0..00000000000--- a/ui/litellm-dashboard/out/_next/static/chunks/app/page-f64fe7b1998a3ca8.js+++ /dev/null@@ -1 +0,0 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{1900:function(e,s,t){Promise.resolve().then(t.bind(t,45976))},12011:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return _}});var l=t(57437),a=t(2265),r=t(99376),i=t(20831),n=t(94789),o=t(12514),c=t(49804),d=t(67101),m=t(84264),u=t(49566),x=t(96761),h=t(84566),p=t(19250),g=t(14474),j=t(13634),f=t(73002),v=t(3914);function _(){let[e]=j.Z.useForm(),s=(0,r.useSearchParams)();(0,v.e)("token");let t=s.get("invitation_id"),_=s.get("action"),[y,b]=(0,a.useState)(null),[N,Z]=(0,a.useState)(""),[w,k]=(0,a.useState)(""),[S,C]=(0,a.useState)(null),[I,P]=(0,a.useState)(""),[E,A]=(0,a.useState)(""),[T,L]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(0,p.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),L(!1)})},[]),(0,a.useEffect)(()=>{t&&!T&&(0,p.getOnboardingCredentials)(t).then(e=>{let s=e.login_url;console.log("login_url:",s),P(s);let t=e.token,l=(0,g.o)(t);A(t),console.log("decoded:",l),b(l.key),console.log("decoded user email:",l.user_email),k(l.user_email),C(l.user_id)})},[t,T]),(0,l.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,l.jsxs)(o.Z,{children:[(0,l.jsx)(x.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,l.jsx)(x.Z,{className:"text-xl",children:"reset_password"===_?"Reset Password":"Sign up"}),(0,l.jsx)(m.Z,{children:"reset_password"===_?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==_&&(0,l.jsx)(n.Z,{className:"mt-4",title:"SSO",icon:h.GH$,color:"sky",children:(0,l.jsxs)(d.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,l.jsx)(c.Z,{children:"SSO is under the Enterprise Tier."}),(0,l.jsx)(c.Z,{children:(0,l.jsx)(i.Z,{variant:"primary",className:"mb-2",children:(0,l.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,l.jsxs)(j.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",y,"token:",E,"formValues:",e),y&&E&&(e.user_email=w,S&&t&&(0,p.claimOnboardingToken)(y,t,S,e.password).then(e=>{let s="/ui/";s+="?login=success",document.cookie="token="+E,console.log("redirecting to:",s);let t=(0,p.getProxyBaseUrl)();console.log("proxyBaseUrl:",t),t?window.location.href=t+s:window.location.href=s}))},children:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(j.Z.Item,{label:"Email Address",name:"user_email",children:(0,l.jsx)(u.Z,{type:"email",disabled:!0,value:w,defaultValue:w,className:"max-w-md"})}),(0,l.jsx)(j.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===_?"Enter your new password":"Create a password for your account",children:(0,l.jsx)(u.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,l.jsx)("div",{className:"mt-10",children:(0,l.jsx)(f.ZP,{htmlType:"submit",children:"reset_password"===_?"Reset Password":"Sign Up"})})]})]})})}},45976:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return nP}});var l,a,r,i,n,o,c=t(57437),d=t(2265),m=t(99376),u=t(14474),x=t(21623),h=t(29827),p=t(65373),g=t(19250);let j=async(e,s,t,l,a)=>{let r;r="Admin"!=t&&"Admin Viewer"!=t?await (0,g.teamListCall)(e,(null==l?void 0:l.organization_id)||null,s):await (0,g.teamListCall)(e,(null==l?void 0:l.organization_id)||null),console.log("givenTeams: ".concat(r)),a(r)};var f=t(49804),v=t(67101),_=t(20831),y=t(49566),b=t(87452),N=t(88829),Z=t(72208),w=t(84264),k=t(96761),S=t(29233),C=t(52787),I=t(13634),P=t(41021),E=t(91679),A=t(29967),T=t(73002),L=t(64482),O=t(30150),M=e=>{let{step:s=.01,style:t={width:"100%"},placeholder:l="Enter a numerical value",min:a,max:r,onChange:i,...n}=e;return(0,c.jsx)(O.Z,{onWheel:e=>e.currentTarget.blur(),step:s,style:t,placeholder:l,min:a,max:r,onChange:i,...n})};let D=async(e,s,t)=>{try{if(null===e||null===s)return;if(null!==t){let l=(await (0,g.modelAvailableCall)(t,e,s,!0,null,!0)).data.map(e=>e.id),a=[],r=[];return l.forEach(e=>{e.endsWith("/*")?a.push(e):r.push(e)}),[...a,...r]}}catch(e){console.error("Error fetching user models:",e)}},F=e=>{if(e.endsWith("/*")){let s=e.replace("/*","");return"All ".concat(s," models")}return e},R=(e,s)=>{let t=[],l=[];return console.log("teamModels",e),console.log("allModels",s),e.forEach(e=>{if(e.endsWith("/*")){let a=e.replace("/*",""),r=s.filter(e=>e.startsWith(a+"/"));l.push(...r),t.push(e)}else l.push(e)}),[...t,...l].filter((e,s,t)=>t.indexOf(e)===s)};var q=t(20577),U=t(15424),z=t(89970);let V=(e,s)=>["metadata","config","enforced_params","aliases"].includes(e)||"json"===s.format,K=e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}},B=(e,s,t)=>{let l={max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"}[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[t]||"Text input";return V(e,s)?"".concat(l,"\nMust be valid JSON format"):s.enum?"Select from available options\nAllowed values: ".concat(s.enum.join(", ")):l};var G=e=>{let{schemaComponent:s,excludedFields:t=[],form:l,overrideLabels:a={},overrideTooltips:r={},customValidation:i={},defaultValues:n={}}=e,[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getOpenAPISchema)()).components.schemas[s];if(!e)throw Error('Schema component "'.concat(s,'" not found'));m(e);let a={};Object.keys(e.properties).filter(e=>!t.includes(e)&&void 0!==n[e]).forEach(e=>{a[e]=n[e]}),l.setFieldsValue(a)}catch(e){console.error("Schema fetch error:",e),x(e instanceof Error?e.message:"Failed to fetch schema")}})()},[s,l,t]);let h=e=>{if(e.type)return e.type;if(e.anyOf){let s=e.anyOf.map(e=>e.type);if(s.includes("number")||s.includes("integer"))return"number";s.includes("string")}return"string"},p=(e,s)=>{var t;let l;let d=h(s),m=null==o?void 0:null===(t=o.required)||void 0===t?void 0:t.includes(e),u=a[e]||s.title||e,x=r[e]||s.description,p=[];m&&p.push({required:!0,message:"".concat(u," is required")}),i[e]&&p.push({validator:i[e]}),V(e,s)&&p.push({validator:async(e,s)=>{if(s&&!K(s))throw Error("Please enter valid JSON")}});let g=x?(0,c.jsxs)("span",{children:[u," ",(0,c.jsx)(z.Z,{title:x,children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}):u;return l=V(e,s)?(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):s.enum?(0,c.jsx)(C.default,{children:s.enum.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"number"===d||"integer"===d?(0,c.jsx)(q.Z,{style:{width:"100%"},precision:"integer"===d?0:void 0}):"duration"===e?(0,c.jsx)(y.Z,{placeholder:"eg: 30s, 30h, 30d"}):(0,c.jsx)(y.Z,{placeholder:x||""}),(0,c.jsx)(I.Z.Item,{label:g,name:e,className:"mt-8",rules:p,initialValue:n[e],help:(0,c.jsx)("div",{className:"text-xs text-gray-500",children:B(e,s,d)}),children:l},e)};return u?(0,c.jsxs)("div",{className:"text-red-500",children:["Error: ",u]}):(null==o?void 0:o.properties)?(0,c.jsx)("div",{children:Object.entries(o.properties).filter(e=>{let[s]=e;return!t.includes(s)}).map(e=>{let[s,t]=e;return p(s,t)})}):null},H=e=>{let{onChange:s,value:t,className:l,accessToken:a,placeholder:r="Select vector stores",disabled:i=!1}=e,[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a){u(!0);try{let e=await (0,g.vectorStoreListCall)(a);e.data&&o(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{u(!1)}}})()},[a]),(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:r,onChange:s,value:t,loading:m,className:l,options:n.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:i})})},J=function(e){let{onChange:s,value:t,accessToken:l,placeholder:a="Select vector stores",premiumUser:r=!1}=e;return r?(0,c.jsx)(H,{onChange:s,value:t,accessToken:l,placeholder:a}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium opacity-50",children:"✨ premium-vector-store-1"}),(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium opacity-50",children:"✨ premium-vector-store-2"})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,c.jsxs)(w.Z,{className:"text-sm text-yellow-800",children:["Vector store access control is a LiteLLM Enterprise feature. Get a trial key ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})},Y=e=>{let{onChange:s,value:t,className:l,accessToken:a,placeholder:r="Select MCP servers",disabled:i=!1}=e,[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(a){h(!0);try{let[e,s]=await Promise.all([(0,g.fetchMCPServers)(a),(0,g.fetchMCPAccessGroups)(a)]),t=Array.isArray(e)?e:e.data||[],l=Array.isArray(s)?s:s.data||[];o(t),u(l)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[a]);let p=[...m.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...n.map(e=>({label:"".concat(e.alias||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.alias||e.server_id," ").concat(e.server_id," MCP Server")}))],j=[...(null==t?void 0:t.servers)||[],...(null==t?void 0:t.accessGroups)||[]];return(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:r,onChange:e=>{s({servers:e.filter(e=>!m.includes(e)),accessGroups:e.filter(e=>m.includes(e))})},value:j,loading:x,className:l,showSearch:!0,style:{width:"100%"},disabled:i,filterOption:(e,s)=>{var t;return((null===(t=p.find(e=>e.value===(null==s?void 0:s.value)))||void 0===t?void 0:t.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:p.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,label:e.label,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,c.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,c.jsx)("span",{style:{flex:1},children:e.label}),(0,c.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})},W=function(e){let{onChange:s,value:t,accessToken:l,placeholder:a="Select MCP servers",premiumUser:r=!1}=e;return r?(0,c.jsx)(Y,{onChange:s,value:t,accessToken:l,placeholder:a}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-purple-50 border border-purple-200 text-purple-800 text-sm font-medium opacity-50",children:"✨ premium-mcp-server-1"}),(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-purple-50 border border-purple-200 text-purple-800 text-sm font-medium opacity-50",children:"✨ premium-mcp-server-2"})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,c.jsxs)(w.Z,{className:"text-sm text-yellow-800",children:["MCP server access control is a LiteLLM Enterprise feature. Get a trial key ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})},$=e=>{let{teams:s,value:t,onChange:l,disabled:a}=e;return console.log("disabled",a),(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Search or select a team",value:t,onChange:l,disabled:a,filterOption:(e,t)=>{if(!t)return!1;let l=null==s?void 0:s.find(e=>e.team_id===t.key);if(!l)return!1;let a=e.toLowerCase().trim(),r=(l.team_alias||"").toLowerCase(),i=(l.team_id||"").toLowerCase();return r.includes(a)||i.includes(a)},optionFilterProp:"children",children:null==s?void 0:s.map(e=>(0,c.jsxs)(C.default.Option,{value:e.team_id,children:[(0,c.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,c.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})},Q=t(23496),X=t(12514),ee=t(91777),es=t(82182),et=t(22452),el=t(74998);(l=i||(i={})).Braintrust="Braintrust",l.CustomCallbackAPI="Custom Callback API",l.Datadog="Datadog",l.Langfuse="Langfuse",l.LangSmith="LangSmith",l.Lago="Lago",l.OpenMeter="OpenMeter",l.OTel="Open Telemetry",l.S3="S3",l.Arize="Arize";let ea={Braintrust:"braintrust",CustomCallbackAPI:"custom_callback_api",Datadog:"datadog",Langfuse:"langfuse",LangSmith:"langsmith",Lago:"lago",OpenMeter:"openmeter",OTel:"otel",S3:"s3",Arize:"arize"},er=Object.fromEntries(Object.entries(ea).map(e=>{let[s,t]=e;return[t,s]})),ei=e=>e.map(e=>er[e]||e),en=e=>e.map(e=>ea[e]||e),eo="/assets/logos/",ec={Langfuse:{logo:"".concat(eo,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"}},Arize:{logo:"".concat(eo,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"text"}},LangSmith:{logo:"".concat(eo,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text"}},Braintrust:{logo:"".concat(eo,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{}},"Custom Callback API":{logo:"".concat(eo,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{}},Datadog:{logo:"".concat(eo,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{}},Lago:{logo:"".concat(eo,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{}},OpenMeter:{logo:"".concat(eo,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{}},"Open Telemetry":{logo:"".concat(eo,"otel.png"),supports_key_team_logging:!1,dynamic_params:{}},S3:{logo:"".concat(eo,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{}}},{Option:ed}=C.default;var em=e=>{let{value:s=[],onChange:t,disabledCallbacks:l=[],onDisabledCallbacksChange:a}=e,r=Object.entries(ec).filter(e=>{let[s,t]=e;return t.supports_key_team_logging}).map(e=>{let[s,t]=e;return s}),i=Object.keys(ec),n=e=>{null==t||t(e)},o=e=>{n(s.filter((s,t)=>t!==e))},d=(e,t,l)=>{let a=[...s];if("callback_name"===t){let s=ea[l]||l;a[e]={...a[e],[t]:s,callback_vars:{}}}else a[e]={...a[e],[t]:l};n(a)},m=(e,t,l)=>{let a=[...s];a[e]={...a[e],callback_vars:{...a[e].callback_vars,[t]:l}},n(a)},u=(e,s)=>{var t,l;if(!e.callback_name)return null;let a=null===(t=Object.entries(ea).find(s=>{let[t,l]=s;return l===e.callback_name}))||void 0===t?void 0:t[0];if(!a)return null;let r=(null===(l=ec[a])||void 0===l?void 0:l.dynamic_params)||{};return 0===Object.keys(r).length?null:(0,c.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,c.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,c.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,c.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(r).map(t=>{let[l,a]=t;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,c.jsx)("span",{children:l.replace(/_/g," ")}),(0,c.jsx)(z.Z,{title:"Environment variable reference recommended: os.environ/".concat(l.toUpperCase()),children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===a&&(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"})]}),(0,c.jsx)(y.Z,{type:"password"===a?"password":"text",placeholder:"os.environ/".concat(l.toUpperCase()),value:e.callback_vars[l]||"",onChange:e=>m(s,l,e.target.value)})]},l)})})]})};return(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(ee.Z,{className:"w-5 h-5 text-red-500"}),(0,c.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,c.jsx)(z.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help"})})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:l,onChange:e=>{let s=en(e);null==a||a(s)},style:{width:"100%"},optionLabelProp:"label",children:i.map(e=>{var s;let t=null===(s=ec[e])||void 0===s?void 0:s.logo;return(0,c.jsx)(ed,{value:e,label:e,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:e,className:"w-4 h-4 object-contain"}),(0,c.jsx)("span",{children:e})]})},e)})}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,c.jsx)(Q.Z,{}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(es.Z,{className:"w-5 h-5 text-blue-500"}),(0,c.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,c.jsx)(z.Z,{title:"Configure callback logging integrations for this team.",children:(0,c.jsx)(U.Z,{className:"text-gray-400 cursor-help"})})]}),(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{n([...s,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:et.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,c.jsx)("div",{className:"space-y-4",children:s.map((e,s)=>{var t,l;let a=e.callback_name?null===(t=Object.entries(ea).find(s=>{let[t,l]=s;return l===e.callback_name}))||void 0===t?void 0:t[0]:void 0,i=a?null===(l=ec[a])||void 0===l?void 0:l.logo:null;return(0,c.jsxs)(X.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,c.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[i&&(0,c.jsx)("img",{src:i,alt:a,className:"w-5 h-5 object-contain"}),(0,c.jsxs)("span",{className:"text-sm font-medium",children:[a||"New Integration"," Configuration"]})]}),(0,c.jsx)(_.Z,{variant:"light",onClick:()=>o(s),icon:el.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,c.jsx)(C.default,{value:a,placeholder:"Select integration",onChange:e=>d(s,"callback_name",e),className:"w-full",optionLabelProp:"label",children:r.map(e=>{var s;let t=null===(s=ec[e])||void 0===s?void 0:s.logo;return(0,c.jsx)(ed,{value:e,label:e,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:e,className:"w-4 h-4 object-contain"}),(0,c.jsx)("span",{children:e})]})},e)})})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,c.jsxs)(C.default,{value:e.callback_type,onChange:e=>d(s,"callback_type",e),className:"w-full",children:[(0,c.jsx)(ed,{value:"success",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{children:"Success Only"})]})}),(0,c.jsx)(ed,{value:"failure",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,c.jsx)("span",{children:"Failure Only"})]})}),(0,c.jsx)(ed,{value:"success_and_failure",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),u(e,s)]})]},s)})}),0===s.length&&(0,c.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,c.jsx)(es.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,c.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,c.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})},eu=function(e){let{value:s,onChange:t,premiumUser:l=!1,disabledCallbacks:a=[],onDisabledCallbacksChange:r}=e;return l?(0,c.jsx)(em,{value:s,onChange:t,disabledCallbacks:a,onDisabledCallbacksChange:r}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ langfuse-logging"}),(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium opacity-50",children:"✨ datadog-logging"})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,c.jsxs)(w.Z,{className:"text-sm text-yellow-800",children:["Setting Key/Team logging settings is a LiteLLM Enterprise feature. Global Logging Settings are available for all free users. Get a trial key ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})},ex=t(57365),eh=t(93192);function ep(e){let{isInvitationLinkModalVisible:s,setIsInvitationLinkModalVisible:t,baseUrl:l,invitationLinkData:a,modalType:r="invitation"}=e,{Title:i,Paragraph:n}=eh.default,o=()=>{if(!l)return"";let e=new URL(l).pathname,s=e&&"/"!==e?"".concat(e,"/ui"):"ui";if(null==a?void 0:a.has_user_setup_sso)return new URL(s,l).toString();let t="".concat(s,"?invitation_id=").concat(null==a?void 0:a.id);return"resetPassword"===r&&(t+="&action=reset_password"),new URL(t,l).toString()};return(0,c.jsxs)(E.Z,{title:"invitation"===r?"Invitation Link":"Reset Password Link",visible:s,width:800,footer:null,onOk:()=>{t(!1)},onCancel:()=>{t(!1)},children:[(0,c.jsx)(n,{children:"invitation"===r?"Copy and send the generated link to onboard this user to the proxy.":"Copy and send the generated link to the user to reset their password."}),(0,c.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,c.jsx)(w.Z,{className:"text-base",children:"User ID"}),(0,c.jsx)(w.Z,{children:null==a?void 0:a.user_id})]}),(0,c.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,c.jsx)(w.Z,{children:"invitation"===r?"Invitation Link":"Reset Password Link"}),(0,c.jsx)(w.Z,{children:(0,c.jsx)(w.Z,{children:o()})})]}),(0,c.jsx)("div",{className:"flex justify-end mt-5",children:(0,c.jsx)(S.CopyToClipboard,{text:o(),onCopy:()=>P.ZP.success("Copied!"),children:(0,c.jsx)(_.Z,{variant:"primary",children:"invitation"===r?"Copy invitation link":"Copy password reset link"})})})]})}var eg=t(85010),ej=t(72188),ef=t(73879),ev=t(34310),e_=t(38434),ey=t(26349),eb=t(35291),eN=t(3632),eZ=t(15452),ew=t.n(eZ),ek=t(71157),eS=t(44643),eC=t(88532),eI=e=>{let{accessToken:s,teams:t,possibleUIRoles:l,onUsersCreated:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)([]),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(null),[k,C]=(0,d.useState)("http://localhost:4000");(0,d.useEffect)(()=>{(async()=>{try{let e=await (0,g.getProxyUISettings)(s);Z(e)}catch(e){console.error("Error fetching UI settings:",e)}})(),C(new URL("/",window.location.href).toString())},[s]);let I=async()=>{u(!0);let e=n.map(e=>({...e,status:"pending"}));o(e);let t=!1;for(let a=0;a<e.length;a++){var l,r,i;let n=e[a];try{let e={user_email:n.user_email,user_role:n.user_role};if(n.teams&&"string"==typeof n.teams&&""!==n.teams.trim()&&(e.teams=n.teams.split(",").map(e=>e.trim()).filter(Boolean),0===e.teams.length&&delete e.teams),n.models&&"string"==typeof n.models&&""!==n.models.trim()&&(e.models=n.models.split(",").map(e=>e.trim()).filter(Boolean),0===e.models.length&&delete e.models),n.max_budget&&""!==n.max_budget.toString().trim()){let s=parseFloat(n.max_budget.toString());!isNaN(s)&&s>0&&(e.max_budget=s)}n.budget_duration&&""!==n.budget_duration.trim()&&(e.budget_duration=n.budget_duration.trim()),n.metadata&&"string"==typeof n.metadata&&""!==n.metadata.trim()&&(e.metadata=n.metadata.trim()),console.log("Sending user data:",e);let r=await (0,g.userCreateCall)(s,null,e);if(console.log("Full response:",r),r&&(r.key||r.user_id)){t=!0,console.log("Success case triggered");let e=(null===(l=r.data)||void 0===l?void 0:l.user_id)||r.user_id;try{if(null==N?void 0:N.SSO_ENABLED){let e=new URL("/ui",k).toString();o(s=>s.map((s,t)=>t===a?{...s,status:"success",key:r.key||r.user_id,invitation_link:e}:s))}else{let t=await (0,g.invitationCreateCall)(s,e),l=new URL("/ui?invitation_id=".concat(t.id),k).toString();o(e=>e.map((e,s)=>s===a?{...e,status:"success",key:r.key||r.user_id,invitation_link:l}:e))}}catch(e){console.error("Error creating invitation:",e),o(e=>e.map((e,s)=>s===a?{...e,status:"success",key:r.key||r.user_id,error:"User created but failed to generate invitation link"}:e))}}else{console.log("Error case triggered");let e=(null==r?void 0:r.error)||"Failed to create user";console.log("Error message:",e),o(s=>s.map((s,t)=>t===a?{...s,status:"failed",error:e}:s))}}catch(s){console.error("Caught error:",s);let e=(null==s?void 0:null===(i=s.response)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.error)||(null==s?void 0:s.message)||String(s);o(s=>s.map((s,t)=>t===a?{...s,status:"failed",error:e}:s))}}u(!1),t&&a&&a()};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_.Z,{className:"mb-0",onClick:()=>i(!0),children:"+ Bulk Invite Users"}),(0,c.jsx)(E.Z,{title:"Bulk Invite Users",visible:r,width:800,onCancel:()=>i(!1),bodyStyle:{maxHeight:"70vh",overflow:"auto"},footer:null,children:(0,c.jsx)("div",{className:"flex flex-col",children:0===n.length?(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"1"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Download and fill the template"})]}),(0,c.jsxs)("div",{className:"ml-11 mb-6",children:[(0,c.jsx)("p",{className:"mb-4",children:"Add multiple users at once by following these steps:"}),(0,c.jsxs)("ol",{className:"list-decimal list-inside space-y-2 ml-2 mb-4",children:[(0,c.jsx)("li",{children:"Download our CSV template"}),(0,c.jsx)("li",{children:"Add your users' information to the spreadsheet"}),(0,c.jsx)("li",{children:"Save the file and upload it here"}),(0,c.jsx)("li",{children:"After creation, download the results file containing the API keys for each user"})]}),(0,c.jsxs)("div",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 mb-4",children:[(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Template Column Names"}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"user_email"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"User's email address (required)"})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"user_role"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'User\'s role (one of: "proxy_admin", "proxy_admin_view_only", "internal_user", "internal_user_view_only")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"teams"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated team IDs (e.g., "team-1,team-2")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"max_budget"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Maximum budget as a number (e.g., "100")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"budget_duration"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Budget reset period (e.g., "30d", "1mo")'})]})]}),(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"font-medium",children:"models"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated allowed models (e.g., "gpt-3.5-turbo,gpt-4")'})]})]})]})]}),(0,c.jsxs)(_.Z,{onClick:()=>{let e=new Blob([ew().unparse([["user_email","user_role","teams","max_budget","budget_duration","models"],["[email protected]","internal_user","team-id-1,team-id-2","100","30d","gpt-3.5-turbo,gpt-4"]])],{type:"text/csv"}),s=window.URL.createObjectURL(e),t=document.createElement("a");t.href=s,t.download="bulk_users_template.csv",document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(s)},size:"lg",className:"w-full md:w-auto",children:[(0,c.jsx)(ef.Z,{className:"mr-2"})," Download CSV Template"]})]}),(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"2"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Upload your completed CSV"})]}),(0,c.jsxs)("div",{className:"ml-11",children:[y?(0,c.jsxs)("div",{className:"mb-4 p-4 rounded-md border ".concat(f?"bg-red-50 border-red-200":"bg-blue-50 border-blue-200"),children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[f?(0,c.jsx)(ev.Z,{className:"text-red-500 text-xl mr-3"}):(0,c.jsx)(e_.Z,{className:"text-blue-500 text-xl mr-3"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(eh.default.Text,{strong:!0,className:f?"text-red-800":"text-blue-800",children:y.name}),(0,c.jsxs)(eh.default.Text,{className:"block text-xs ".concat(f?"text-red-600":"text-blue-600"),children:[(y.size/1024).toFixed(1)," KB • ",new Date().toLocaleDateString()]})]})]}),(0,c.jsxs)(_.Z,{size:"xs",variant:"secondary",onClick:()=>{b(null),o([]),h(null),j(null),v(null)},className:"flex items-center",children:[(0,c.jsx)(ey.Z,{className:"mr-1"})," Remove"]})]}),f?(0,c.jsxs)("div",{className:"mt-3 text-red-600 text-sm flex items-start",children:[(0,c.jsx)(eb.Z,{className:"mr-2 mt-0.5"}),(0,c.jsx)("span",{children:f})]}):!p&&(0,c.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1.5",children:(0,c.jsx)("div",{className:"bg-blue-500 h-1.5 rounded-full w-full animate-pulse"})}),(0,c.jsx)("span",{className:"ml-2 text-xs text-blue-600",children:"Processing..."})]})]}):(0,c.jsx)(eg.default,{beforeUpload:e=>((h(null),j(null),v(null),b(e),"text/csv"===e.type||e.name.endsWith(".csv"))?e.size>5242880?v("File is too large (".concat((e.size/1048576).toFixed(1)," MB). Please upload a CSV file smaller than 5MB.")):ew().parse(e,{complete:e=>{if(!e.data||0===e.data.length){j("The CSV file appears to be empty. Please upload a file with data."),o([]);return}if(1===e.data.length){j("The CSV file only contains headers but no user data. Please add user data to your CSV."),o([]);return}let s=e.data[0];if(0===s.length||1===s.length&&""===s[0]){j("The CSV file doesn't contain any column headers. Please make sure your CSV has headers."),o([]);return}let l=["user_email","user_role"].filter(e=>!s.includes(e));if(l.length>0){j("Your CSV is missing these required columns: ".concat(l.join(", "),". Please add these columns to your CSV file.")),o([]);return}try{let l=e.data.slice(1).map((e,l)=>{var a,r,i,n,o,c;if(0===e.length||1===e.length&&""===e[0])return null;if(e.length<s.length)return{rowNumber:l+2,isValid:!1,error:"Row ".concat(l+2," has fewer columns than the header row. Please ensure all data is properly formatted."),user_email:"",user_role:""};let d={user_email:(null===(a=e[s.indexOf("user_email")])||void 0===a?void 0:a.trim())||"",user_role:(null===(r=e[s.indexOf("user_role")])||void 0===r?void 0:r.trim())||"",teams:null===(i=e[s.indexOf("teams")])||void 0===i?void 0:i.trim(),max_budget:null===(n=e[s.indexOf("max_budget")])||void 0===n?void 0:n.trim(),budget_duration:null===(o=e[s.indexOf("budget_duration")])||void 0===o?void 0:o.trim(),models:null===(c=e[s.indexOf("models")])||void 0===c?void 0:c.trim(),rowNumber:l+2,isValid:!0,error:""},m=[];if(d.user_email?d.user_email.includes("@")&&d.user_email.includes(".")||m.push("Invalid email format (must contain @ and domain)"):m.push("Email is required"),d.user_role){let e=["proxy_admin","proxy_admin_view_only","internal_user","internal_user_view_only"];e.includes(d.user_role)||m.push('Invalid role "'.concat(d.user_role,'". Must be one of: ').concat(e.join(", ")))}else m.push("Role is required");if(d.max_budget&&""!==d.max_budget.toString().trim()&&(isNaN(parseFloat(d.max_budget.toString()))?m.push('Max budget "'.concat(d.max_budget,'" must be a number')):0>=parseFloat(d.max_budget.toString())&&m.push("Max budget must be greater than 0")),d.budget_duration&&!d.budget_duration.match(/^\d+[dhmwy]$|^\d+mo$/)&&m.push('Invalid budget duration format "'.concat(d.budget_duration,'". Use format like "30d", "1mo", "2w", "6h"')),d.teams&&"string"==typeof d.teams&&t&&t.length>0){let e=t.map(e=>e.team_id),s=d.teams.split(",").map(e=>e.trim()).filter(s=>!e.includes(s));s.length>0&&m.push("Unknown team(s): ".concat(s.join(", ")))}return m.length>0&&(d.isValid=!1,d.error=m.join(", ")),d}).filter(Boolean),a=l.filter(e=>e.isValid);o(l),0===l.length?j("No valid data rows found in the CSV file. Please check your file format."):0===a.length?h("No valid users found in the CSV. Please check the errors below and fix your CSV file."):a.length<l.length?h("Found ".concat(l.length-a.length," row(s) with errors out of ").concat(l.length," total rows. Please correct them before proceeding.")):P.ZP.success("Successfully parsed ".concat(a.length," users"))}catch(s){let e=s instanceof Error?s.message:"Unknown error";h("Error parsing CSV: ".concat(e)),o([])}},error:e=>{h("Failed to parse CSV file: ".concat(e.message)),o([])},header:!1}):(v("Invalid file type: ".concat(e.name,". Please upload a CSV file (.csv extension).")),P.ZP.error("Invalid file type. Please upload a CSV file.")),!1),accept:".csv",maxCount:1,showUploadList:!1,children:(0,c.jsxs)("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-500 transition-colors cursor-pointer",children:[(0,c.jsx)(eN.Z,{className:"text-3xl text-gray-400 mb-2"}),(0,c.jsx)("p",{className:"mb-1",children:"Drag and drop your CSV file here"}),(0,c.jsx)("p",{className:"text-sm text-gray-500 mb-3",children:"or"}),(0,c.jsx)(_.Z,{size:"sm",children:"Browse files"}),(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-4",children:"Only CSV files (.csv) are supported"})]})}),p&&(0,c.jsx)("div",{className:"mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(eC.Z,{className:"h-5 w-5 text-yellow-500 mr-2 mt-0.5"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(eh.default.Text,{strong:!0,className:"text-yellow-800",children:"CSV Structure Error"}),(0,c.jsx)(eh.default.Paragraph,{className:"text-yellow-700 mt-1 mb-0",children:p}),(0,c.jsx)(eh.default.Paragraph,{className:"text-yellow-700 mt-2 mb-0",children:"Please download our template and ensure your CSV follows the required format."})]})]})})]})]}):(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsxs)("div",{className:"flex items-center mb-4",children:[(0,c.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"3"}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:n.some(e=>"success"===e.status||"failed"===e.status)?"User Creation Results":"Review and create users"})]}),x&&(0,c.jsx)("div",{className:"ml-11 mb-4 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(eb.Z,{className:"text-red-500 mr-2 mt-1"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-red-600 font-medium",children:x}),n.some(e=>!e.isValid)&&(0,c.jsxs)("ul",{className:"mt-2 list-disc list-inside text-red-600 text-sm",children:[(0,c.jsx)("li",{children:"Check the table below for specific errors in each row"}),(0,c.jsx)("li",{children:"Common issues include invalid email formats, missing required fields, or incorrect role values"}),(0,c.jsx)("li",{children:"Fix these issues in your CSV file and upload again"})]})]})]})}),(0,c.jsxs)("div",{className:"ml-11",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,c.jsx)("div",{className:"flex items-center",children:n.some(e=>"success"===e.status||"failed"===e.status)?(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{className:"text-lg font-medium mr-3",children:"Creation Summary"}),(0,c.jsxs)(w.Z,{className:"text-sm bg-green-100 text-green-800 px-2 py-1 rounded mr-2",children:[n.filter(e=>"success"===e.status).length," Successful"]}),n.some(e=>"failed"===e.status)&&(0,c.jsxs)(w.Z,{className:"text-sm bg-red-100 text-red-800 px-2 py-1 rounded",children:[n.filter(e=>"failed"===e.status).length," Failed"]})]}):(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{className:"text-lg font-medium mr-3",children:"User Preview"}),(0,c.jsxs)(w.Z,{className:"text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded",children:[n.filter(e=>e.isValid).length," of ",n.length," users valid"]})]})}),!n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",children:"Back"}),(0,c.jsx)(_.Z,{onClick:I,disabled:0===n.filter(e=>e.isValid).length||m,children:m?"Creating...":"Create ".concat(n.filter(e=>e.isValid).length," Users")})]})]}),n.some(e=>"success"===e.status)&&(0,c.jsx)("div",{className:"mb-4 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)("div",{className:"mr-3 mt-1",children:(0,c.jsx)(eS.Z,{className:"h-5 w-5 text-blue-500"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-blue-800",children:"User creation complete"}),(0,c.jsxs)(w.Z,{className:"block text-sm text-blue-700 mt-1",children:[(0,c.jsx)("span",{className:"font-medium",children:"Next step:"})," Download the credentials file containing API keys and invitation links. Users will need these API keys to make LLM requests through LiteLLM."]})]})]})}),(0,c.jsx)(ej.Z,{dataSource:n,columns:[{title:"Row",dataIndex:"rowNumber",key:"rowNumber",width:80},{title:"Email",dataIndex:"user_email",key:"user_email"},{title:"Role",dataIndex:"user_role",key:"user_role"},{title:"Teams",dataIndex:"teams",key:"teams"},{title:"Budget",dataIndex:"max_budget",key:"max_budget"},{title:"Status",key:"status",render:(e,s)=>s.isValid?s.status&&"pending"!==s.status?"success"===s.status?(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(eS.Z,{className:"h-5 w-5 text-green-500 mr-2"}),(0,c.jsx)("span",{className:"text-green-500",children:"Success"})]}),s.invitation_link&&(0,c.jsx)("div",{className:"mt-1",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{className:"text-xs text-gray-500 truncate max-w-[150px]",children:s.invitation_link}),(0,c.jsx)(S.CopyToClipboard,{text:s.invitation_link,onCopy:()=>P.ZP.success("Invitation link copied!"),children:(0,c.jsx)("button",{className:"ml-1 text-blue-500 text-xs hover:text-blue-700",children:"Copy"})})]})})]}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(ek.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsx)("span",{className:"text-red-500",children:"Failed"})]}),s.error&&(0,c.jsx)("span",{className:"text-sm text-red-500 ml-7",children:JSON.stringify(s.error)})]}):(0,c.jsx)("span",{className:"text-gray-500",children:"Pending"}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(ek.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsx)("span",{className:"text-red-500",children:"Invalid"})]}),s.error&&(0,c.jsx)("span",{className:"text-sm text-red-500 ml-7",children:s.error})]})}],size:"small",pagination:{pageSize:5},scroll:{y:300},rowClassName:e=>e.isValid?"":"bg-red-50"}),!n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",className:"mr-3",children:"Back"}),(0,c.jsx)(_.Z,{onClick:I,disabled:0===n.filter(e=>e.isValid).length||m,children:m?"Creating...":"Create ".concat(n.filter(e=>e.isValid).length," Users")})]}),n.some(e=>"success"===e.status||"failed"===e.status)&&(0,c.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,c.jsx)(_.Z,{onClick:()=>{o([]),h(null)},variant:"secondary",className:"mr-3",children:"Start New Bulk Import"}),(0,c.jsxs)(_.Z,{onClick:()=>{let e=n.map(e=>({user_email:e.user_email,user_role:e.user_role,status:e.status,key:e.key||"",invitation_link:e.invitation_link||"",error:e.error||""})),s=new Blob([ew().unparse(e)],{type:"text/csv"}),t=window.URL.createObjectURL(s),l=document.createElement("a");l.href=t,l.download="bulk_users_results.csv",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(t)},variant:"primary",className:"flex items-center",children:[(0,c.jsx)(ef.Z,{className:"mr-2"})," Download User Credentials"]})]})]})]})})})]})};let{Option:eP}=C.default;var eE=e=>{let{userID:s,accessToken:t,teams:l,possibleUIRoles:a,onUserCreated:r,isEmbedded:i=!1}=e,n=(0,h.NL)(),[o,m]=(0,d.useState)(null),[u]=I.Z.useForm(),[x,p]=(0,d.useState)(!1),[j,f]=(0,d.useState)(!1),[v,S]=(0,d.useState)([]),[A,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(null),[R,q]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=async()=>{try{let e=await (0,g.modelAvailableCall)(t,s,"any"),l=[];for(let s=0;s<e.data.length;s++){let t=e.data[s];l.push(t.id)}console.log("Model data response:",e.data),console.log("Available models:",l),S(l);let a=await (0,g.getProxyUISettings)(t);console.log("uiSettingsResponse:",a),m(a)}catch(e){console.error("Error fetching model data:",e)}};q((0,g.getProxyBaseUrl)()),e()},[]);let V=async e=>{var l,a,c;try{P.ZP.info("Making API Call"),i||p(!0),e.models&&0!==e.models.length||"proxy_admin"===e.user_role||(console.log("formValues.user_role",e.user_role),e.models=["no-default-models"]),console.log("formValues in create user:",e);let a=await (0,g.userCreateCall)(t,null,e);await n.invalidateQueries({queryKey:["userList"]}),console.log("user create Response:",a),f(!0);let c=(null===(l=a.data)||void 0===l?void 0:l.user_id)||a.user_id;if(r&&i){r(c),u.resetFields();return}if(null==o?void 0:o.SSO_ENABLED){let e={id:crypto.randomUUID(),user_id:c,is_accepted:!1,accepted_at:null,expires_at:new Date(Date.now()+6048e5),created_at:new Date,created_by:s,updated_at:new Date,updated_by:s,has_user_setup_sso:!0};D(e),O(!0)}else(0,g.invitationCreateCall)(t,c).then(e=>{e.has_user_setup_sso=!1,D(e),O(!0)});P.ZP.success("API user Created"),u.resetFields(),localStorage.removeItem("userData"+s)}catch(s){let e=(null===(c=s.response)||void 0===c?void 0:null===(a=c.data)||void 0===a?void 0:a.detail)||(null==s?void 0:s.message)||"Error creating the user";P.ZP.error(e),console.error("Error creating the user:",s)}};return i?(0,c.jsxs)(I.Z,{form:u,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"User Email",name:"user_email",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"User Role",name:"user_role",children:(0,c.jsx)(C.default,{children:a&&Object.entries(a).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ex.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",children:(0,c.jsx)(C.default,{placeholder:"Select Team ID",style:{width:"100%"},children:l?l.map(e=>(0,c.jsx)(eP,{value:e.team_id,children:e.team_alias},e.team_id)):(0,c.jsx)(eP,{value:null,children:"Default Team"},"default")})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create User"})})]}):(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{className:"mb-0",onClick:()=>p(!0),children:"+ Invite User"}),(0,c.jsx)(eI,{accessToken:t,teams:l,possibleUIRoles:a}),(0,c.jsxs)(E.Z,{title:"Invite User",visible:x,width:800,footer:null,onOk:()=>{p(!1),u.resetFields()},onCancel:()=>{p(!1),f(!1),u.resetFields()},children:[(0,c.jsx)(w.Z,{className:"mb-1",children:"Create a User who can own keys"}),(0,c.jsxs)(I.Z,{form:u,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"User Email",name:"user_email",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Global Proxy Role"," ",(0,c.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,c.jsx)(U.Z,{})})]}),name:"user_role",children:(0,c.jsx)(C.default,{children:a&&Object.entries(a).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ex.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",className:"gap-2",name:"team_id",help:"If selected, user will be added as a 'user' role to the team.",children:(0,c.jsx)(C.default,{placeholder:"Select Team ID",style:{width:"100%"},children:l?l.map(e=>(0,c.jsx)(eP,{value:e.team_id,children:e.team_alias},e.team_id)):(0,c.jsx)(eP,{value:null,children:"Default Team"},"default")})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsxs)(b.Z,{children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)(k.Z,{children:"Personal Key Creation"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)(I.Z.Item,{className:"gap-2",label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"Models user has access to, outside of team scope.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",help:"Models user has access to, outside of team scope.",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),v.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})})})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create User"})})]})]}),j&&(0,c.jsx)(ep,{isInvitationLinkModalVisible:A,setIsInvitationLinkModalVisible:O,baseUrl:R||"",invitationLinkData:M})]})},eA=t(7310),eT=t.n(eA),eL=t(20347);let{Option:eO}=C.default,eM=e=>e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";var eD=e=>{let{value:s,onChange:t,className:l="",style:a={}}=e;return(0,c.jsxs)(C.default,{style:{width:"100%",...a},value:s||void 0,onChange:t,className:l,placeholder:"n/a",children:[(0,c.jsx)(eO,{value:"24h",children:"daily"}),(0,c.jsx)(eO,{value:"7d",children:"weekly"}),(0,c.jsx)(eO,{value:"30d",children:"monthly"})]})};function eF(e,s){let t=structuredClone(e);for(let[e,l]of Object.entries(s))e in t&&(t[e]=l);return t}let eR=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null==e?"-":e.toLocaleString("en-US",{minimumFractionDigits:s,maximumFractionDigits:s})},eq=async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;try{return await navigator.clipboard.writeText(e),P.ZP.success(s),!0}catch(e){return P.ZP.error("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}},{Option:eU}=C.default,ez=e=>{let s=[];if(console.log("data:",JSON.stringify(e)),e)for(let t of e)t.metadata&&t.metadata.tags&&s.push(...t.metadata.tags);let t=Array.from(new Set(s)).map(e=>({value:e,label:e}));return console.log("uniqueTags:",t),t},eV=async(e,s,t,l)=>{try{if(null===e||null===s)return[];if(null!==t){let a=(await (0,g.modelAvailableCall)(t,e,s,!0,l,!0)).data.map(e=>e.id);return console.log("available_model_names:",a),a}return[]}catch(e){return console.error("Error fetching user models:",e),[]}},eK=async(e,s,t,l)=>{try{if(null===e||null===s)return;if(null!==t){let a=(await (0,g.modelAvailableCall)(t,e,s)).data.map(e=>e.id);console.log("available_model_names:",a),l(a)}}catch(e){console.error("Error fetching user models:",e)}};var eB=e=>{let{userID:s,team:t,teams:l,userRole:a,accessToken:r,data:i,addKey:n,premiumUser:o=!1}=e,[m]=I.Z.useForm(),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(null),[j,O]=(0,d.useState)(null),[D,R]=(0,d.useState)([]),[q,V]=(0,d.useState)([]),[K,B]=(0,d.useState)("you"),[H,Y]=(0,d.useState)(ez(i)),[Q,X]=(0,d.useState)([]),[ee,es]=(0,d.useState)([]),[et,el]=(0,d.useState)(t),[ea,er]=(0,d.useState)(!1),[ei,eo]=(0,d.useState)(null),[ec,ed]=(0,d.useState)({}),[em,ex]=(0,d.useState)([]),[eh,ep]=(0,d.useState)(!1),[eg,ej]=(0,d.useState)([]),[ef,ev]=(0,d.useState)(!1),[e_,ey]=(0,d.useState)([]),[eb,eN]=(0,d.useState)("default"),eZ=()=>{x(!1),m.resetFields(),es([]),ey([]),eN("default")},ew=()=>{x(!1),p(null),el(null),m.resetFields(),es([]),ey([]),eN("default")};(0,d.useEffect)(()=>{s&&a&&r&&eK(s,a,r,R)},[r,s,a]);let ek=async()=>{try{if(null==r)return;let e=await (0,g.fetchMCPAccessGroups)(r);ej(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,d.useEffect)(()=>{ek()},[r]),(0,d.useEffect)(()=>{(async()=>{try{let e=(await (0,g.getGuardrailsList)(r)).guardrails.map(e=>e.guardrail_name);X(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[r]),(0,d.useEffect)(()=>{(async()=>{try{if(r){let e=sessionStorage.getItem("possibleUserRoles");if(e)ed(JSON.parse(e));else{let e=await (0,g.getPossibleUserRoles)(r);sessionStorage.setItem("possibleUserRoles",JSON.stringify(e)),ed(e)}}}catch(e){console.error("Error fetching possible user roles:",e)}})()},[r]);let eS=q.includes("no-default-models")&&!et,eC=async e=>{try{var t,l,a,o,c;let d;let u=null!==(a=null==e?void 0:e.key_alias)&&void 0!==a?a:"",h=null!==(o=null==e?void 0:e.team_id)&&void 0!==o?o:null;if((null!==(c=null==i?void 0:i.filter(e=>e.team_id===h).map(e=>e.key_alias))&&void 0!==c?c:[]).includes(u))throw Error("Key alias ".concat(u," already exists for team with ID ").concat(h,", please provide another key alias"));P.ZP.info("Making API Call"),x(!0),"you"===K&&(e.user_id=s);let j={};try{j=JSON.parse(e.metadata||"{}")}catch(e){console.error("Error parsing metadata:",e)}if("service_account"===K&&(j.service_account_id=e.key_alias),ee.length>0&&(j={...j,logging:ee.filter(e=>e.callback_name)}),e_.length>0){let e=en(e_);j={...j,litellm_disabled_callbacks:e}}if(e.metadata=JSON.stringify(j),e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission={vector_stores:e.allowed_vector_store_ids},delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(l=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===l?void 0:l.length)>0)){e.object_permission||(e.object_permission={});let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups),d="service_account"===K?await (0,g.keyCreateServiceAccountCall)(r,e):await (0,g.keyCreateCall)(r,s,e),console.log("key create Response:",d),n(d),p(d.key),O(d.soft_budget),P.ZP.success("API Key Created"),m.resetFields(),localStorage.removeItem("userData"+s)}catch(e){console.log("error in create key:",e),P.ZP.error("Error creating the key: ".concat(e))}};(0,d.useEffect)(()=>{if(s&&a&&r){var e;eV(s,a,r,null!==(e=null==et?void 0:et.team_id)&&void 0!==e?e:null).then(e=>{var s;V(Array.from(new Set([...null!==(s=null==et?void 0:et.models)&&void 0!==s?s:[],...e])))})}m.setFieldValue("models",[])},[et,r,s,a]);let eI=async e=>{if(!e){ex([]);return}ep(!0);try{let s=new URLSearchParams;if(s.append("user_email",e),null==r)return;let t=(await (0,g.userFilterUICall)(r,s)).map(e=>({label:"".concat(e.user_email," (").concat(e.user_id,")"),value:e.user_id,user:e}));ex(t)}catch(e){console.error("Error fetching users:",e),P.ZP.error("Failed to search for users")}finally{ep(!1)}},eP=(0,d.useCallback)(eT()(e=>eI(e),300),[r]),eA=(e,s)=>{let t=s.user;m.setFieldsValue({user_id:t.user_id})};return(0,c.jsxs)("div",{children:[a&&eL.LQ.includes(a)&&(0,c.jsx)(_.Z,{className:"mx-auto",onClick:()=>x(!0),children:"+ Create New Key"}),(0,c.jsx)(E.Z,{visible:u,width:1e3,footer:null,onOk:eZ,onCancel:ew,children:(0,c.jsxs)(I.Z,{form:m,onFinish:eC,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(k.Z,{className:"mb-4",children:"Key Ownership"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Owned By"," ",(0,c.jsx)(z.Z,{title:"Select who will own this API key",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),className:"mb-4",children:(0,c.jsxs)(A.ZP.Group,{onChange:e=>B(e.target.value),value:K,children:[(0,c.jsx)(A.ZP,{value:"you",children:"You"}),(0,c.jsx)(A.ZP,{value:"service_account",children:"Service Account"}),"Admin"===a&&(0,c.jsx)(A.ZP,{value:"another_user",children:"Another User"})]})}),"another_user"===K&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["User ID"," ",(0,c.jsx)(z.Z,{title:"The user who will own this key and be responsible for its usage",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"user_id",className:"mt-4",rules:[{required:"another_user"===K,message:"Please input the user ID of the user you are assigning the key to"}],children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{style:{display:"flex",marginBottom:"8px"},children:[(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Type email to search for users",filterOption:!1,onSearch:e=>{eP(e)},onSelect:(e,s)=>eA(e,s),options:em,loading:eh,allowClear:!0,style:{width:"100%"},notFoundContent:eh?"Searching...":"No users found"}),(0,c.jsx)(T.ZP,{onClick:()=>er(!0),style:{marginLeft:"8px"},children:"Create User"})]}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"Search by email to find users"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Team"," ",(0,c.jsx)(z.Z,{title:"The team this key belongs to, which determines available models and budget limits",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"team_id",initialValue:t?t.team_id:null,className:"mt-4",children:(0,c.jsx)($,{teams:l,onChange:e=>{el((null==l?void 0:l.find(s=>s.team_id===e))||null)}})})]}),eS&&(0,c.jsx)("div",{className:"mb-8 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-blue-800 text-sm",children:"Please select a team to continue configuring your API key. If you do not see any teams, please contact your Proxy Admin to either provide you with access to models or to add you to a team."})}),!eS&&(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(k.Z,{className:"mb-4",children:"Key Details"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["you"===K||"another_user"===K?"Key Name":"Service Account ID"," ",(0,c.jsx)(z.Z,{title:"you"===K||"another_user"===K?"A descriptive name to identify this key":"Unique identifier for this service account",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"key_alias",rules:[{required:!0,message:"Please input a ".concat("you"===K?"key name":"service account ID")}],help:"required",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"Select which models this key can access. Choose 'All Team Models' to grant access to all models available to the team",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",rules:"management"===eb||"read_only"===eb?[]:[{required:!0,message:"Please select a model"}],help:"management"===eb||"read_only"===eb?"Models field is disabled for this key type":"required",className:"mt-4",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:"management"===eb||"read_only"===eb,onChange:e=>{e.includes("all-team-models")&&m.setFieldsValue({models:["all-team-models"]})},children:[(0,c.jsx)(eU,{value:"all-team-models",children:"All Team Models"},"all-team-models"),q.map(e=>(0,c.jsx)(eU,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Key Type"," ",(0,c.jsx)(z.Z,{title:"Select the type of key to determine what routes and operations this key can access",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"key_type",initialValue:"default",className:"mt-4",children:(0,c.jsxs)(C.default,{defaultValue:"default",placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",onChange:e=>{eN(e),("management"===e||"read_only"===e)&&m.setFieldsValue({models:[]})},children:[(0,c.jsx)(eU,{value:"default",label:"Default",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call LLM API + Management routes"})]})}),(0,c.jsx)(eU,{value:"llm_api",label:"LLM API",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"LLM API"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only LLM API routes (chat/completions, embeddings, etc.)"})]})}),(0,c.jsx)(eU,{value:"management",label:"Management",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})}),(0,c.jsx)(eU,{value:"read_only",label:"Read Only",children:(0,c.jsxs)("div",{style:{padding:"4px 0"},children:[(0,c.jsx)("div",{style:{fontWeight:500},children:"Read Only"}),(0,c.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can only call only info routes (e.g. /key/info, /user/info, /team/info)"})]})})]})})]}),!eS&&(0,c.jsx)("div",{className:"mb-8",children:(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",onClick:()=>{ef||(ek(),ev(!0))},children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)(k.Z,{className:"m-0",children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Max Budget (USD)"," ",(0,c.jsx)(z.Z,{title:"Maximum amount in USD this key can spend. When reached, the key will be blocked from making further requests",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"max_budget",help:"Budget cannot exceed team max budget: $".concat((null==t?void 0:t.max_budget)!==null&&(null==t?void 0:t.max_budget)!==void 0?null==t?void 0:t.max_budget:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.max_budget&&s>t.max_budget)throw Error("Budget cannot exceed team max budget: $".concat(eR(t.max_budget,4)))}}],children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Reset Budget"," ",(0,c.jsx)(z.Z,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",help:"Team Reset Budget: ".concat((null==t?void 0:t.budget_duration)!==null&&(null==t?void 0:t.budget_duration)!==void 0?null==t?void 0:t.budget_duration:"None"),children:(0,c.jsx)(eD,{onChange:e=>m.setFieldValue("budget_duration",e)})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Tokens per minute Limit (TPM)"," ",(0,c.jsx)(z.Z,{title:"Maximum number of tokens this key can process per minute. Helps control usage and costs",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"tpm_limit",help:"TPM cannot exceed team TPM limit: ".concat((null==t?void 0:t.tpm_limit)!==null&&(null==t?void 0:t.tpm_limit)!==void 0?null==t?void 0:t.tpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.tpm_limit&&s>t.tpm_limit)throw Error("TPM limit cannot exceed team TPM limit: ".concat(t.tpm_limit))}}],children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{className:"mt-4",label:(0,c.jsxs)("span",{children:["Requests per minute Limit (RPM)"," ",(0,c.jsx)(z.Z,{title:"Maximum number of API requests this key can make per minute. Helps prevent abuse and manage load",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"rpm_limit",help:"RPM cannot exceed team RPM limit: ".concat((null==t?void 0:t.rpm_limit)!==null&&(null==t?void 0:t.rpm_limit)!==void 0?null==t?void 0:t.rpm_limit:"unlimited"),rules:[{validator:async(e,s)=>{if(s&&t&&null!==t.rpm_limit&&s>t.rpm_limit)throw Error("RPM limit cannot exceed team RPM limit: ".concat(t.rpm_limit))}}],children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Expire Key"," ",(0,c.jsx)(z.Z,{title:"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days)",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"duration",className:"mt-4",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:Q.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this key can access. If none selected, the key will have access to all available vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this key can access. Leave empty for access to all vector stores",children:(0,c.jsx)(J,{onChange:e=>m.setFieldValue("allowed_vector_store_ids",e),value:m.getFieldValue("allowed_vector_store_ids"),accessToken:r,placeholder:"Select vector stores (optional)",premiumUser:o})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers or access groups this key can access. ",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers or access groups this key can access. ",children:(0,c.jsx)(W,{onChange:e=>m.setFieldValue("allowed_mcp_servers_and_groups",e),value:m.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:r,placeholder:"Select MCP servers or access groups (optional)",premiumUser:o})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON object with additional information about this key. Used for tracking or custom logic",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"metadata",className:"mt-4",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Tags"," ",(0,c.jsx)(z.Z,{title:"Tags for tracking spend and/or doing tag-based routing. Used for analytics and filtering",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"tags",className:"mt-4",help:"Tags for tracking spend and/or doing tag-based routing.",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Enter tags",tokenSeparators:[","],options:H})}),(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Logging Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(eu,{value:ee,onChange:es,premiumUser:o,disabledCallbacks:e_,onDisabledCallbacksChange:ey})})})]}),(0,c.jsxs)(b.Z,{className:"mt-4 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("b",{children:"Advanced Settings"}),(0,c.jsx)(z.Z,{title:(0,c.jsxs)("span",{children:["Learn more about advanced settings in our"," ",(0,c.jsx)("a",{href:g.proxyBaseUrl?"".concat(g.proxyBaseUrl,"/#/key%20management/generate_key_fn_key_generate_post"):"/#/key%20management/generate_key_fn_key_generate_post",target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300",children:"documentation"})]}),children:(0,c.jsx)(U.Z,{className:"text-gray-400 hover:text-gray-300 cursor-help"})})]})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)(G,{schemaComponent:"GenerateKeyRequest",form:m,excludedFields:["key_alias","team_id","models","duration","metadata","tags","guardrails","max_budget","budget_duration","tpm_limit","rpm_limit"]})})]})]})]})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",disabled:eS,style:{opacity:eS?.5:1},children:"Create Key"})})]})}),ea&&(0,c.jsx)(E.Z,{title:"Create New User",visible:ea,onCancel:()=>er(!1),footer:null,width:800,children:(0,c.jsx)(eE,{userID:s,accessToken:r,teams:l,possibleUIRoles:ec,onUserCreated:e=>{eo(e),m.setFieldsValue({user_id:e}),er(!1)},isEmbedded:!0})}),h&&(0,c.jsx)(E.Z,{visible:u,onOk:eZ,onCancel:ew,footer:null,children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Save your Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,c.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,c.jsx)(f.Z,{numColSpan:1,children:null!=h?(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"API Key:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:h})}),(0,c.jsx)(S.CopyToClipboard,{text:h,onCopy:()=>{P.ZP.success("API Key copied to clipboard")},children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]}):(0,c.jsx)(w.Z,{children:"Key being created, this might take 30s"})})]})})]})},eG=t(7366),eH=e=>{let{selectedTeam:s,currentOrg:t,selectedKeyAlias:l,accessToken:a,createClicked:r}=e,[i,n]=(0,d.useState)({keys:[],total_count:0,current_page:1,total_pages:0}),[o,c]=(0,d.useState)(!0),[m,u]=(0,d.useState)(null),x=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(console.log("calling fetchKeys"),!a){console.log("accessToken",a);return}c(!0);let s="number"==typeof e.page?e.page:1,t="number"==typeof e.pageSize?e.pageSize:100,l=await (0,g.keyListCall)(a,null,null,null,null,null,s,t);console.log("data",l),n(l),u(null)}catch(e){u(e instanceof Error?e:Error("An error occurred"))}finally{c(!1)}};return(0,d.useEffect)(()=>{x(),console.log("selectedTeam",s,"currentOrg",t,"accessToken",a,"selectedKeyAlias",l)},[s,t,a,l,r]),{keys:i.keys,isLoading:o,error:m,pagination:{currentPage:i.current_page,totalPages:i.total_pages,totalCount:i.total_count},refresh:x,setKeys:e=>{n(s=>{let t="function"==typeof e?e(s.keys):e;return{...s,keys:t}})}}},eJ=t(27281),eY=t(41649),eW=t(12485),e$=t(18135),eQ=t(35242),eX=t(29706),e0=t(77991),e1=t(10900),e2=t(23628),e4=e=>{let{value:s,onChange:t,disabledCallbacks:l=[],onDisabledCallbacksChange:a}=e;return(0,c.jsx)(em,{value:s,onChange:t,disabledCallbacks:l,onDisabledCallbacksChange:a})};let e5=["logging"],e6=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!e5.includes(s)})):{},e3=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],e8=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(e6(e),null,s)};function e7(e){var s,t,l,a,r,i,n;let{keyData:o,onCancel:m,onSubmit:u,teams:x,accessToken:h,userID:p,userRole:j,premiumUser:f=!1}=e,[v]=I.Z.useForm(),[b,N]=(0,d.useState)([]),Z=null==x?void 0:x.find(e=>e.team_id===o.team_id),[w,k]=(0,d.useState)([]),[S,P]=(0,d.useState)([]),[E,A]=(0,d.useState)(!1),[O,D]=(0,d.useState)(Array.isArray(null===(s=o.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?ei(o.metadata.litellm_disabled_callbacks):[]);(0,d.useEffect)(()=>{(async()=>{if(p&&j&&h)try{if(null===o.team_id){let e=(await (0,g.modelAvailableCall)(h,p,j)).data.map(e=>e.id);k(e)}else if(null==Z?void 0:Z.team_id){let e=await eV(p,j,h,Z.team_id);k(Array.from(new Set([...Z.models,...e])))}}catch(e){console.error("Error fetching models:",e)}})()},[p,j,h,Z,o.team_id]),(0,d.useEffect)(()=>{v.setFieldValue("disabled_callbacks",O)},[v,O]);let F={...o,budget_duration:(n=o.budget_duration)&&({"24h":"daily","7d":"weekly","30d":"monthly"})[n]||null,metadata:e8(o.metadata),guardrails:(null===(t=o.metadata)||void 0===t?void 0:t.guardrails)||[],vector_stores:(null===(l=o.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=o.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(r=o.object_permission)||void 0===r?void 0:r.mcp_access_groups)||[]},logging_settings:e3(o.metadata),disabled_callbacks:Array.isArray(null===(i=o.metadata)||void 0===i?void 0:i.litellm_disabled_callbacks)?ei(o.metadata.litellm_disabled_callbacks):[]};return(0,c.jsxs)(I.Z,{form:v,onFinish:u,initialValues:F,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[w.length>0&&(0,c.jsx)(C.default.Option,{value:"all-team-models",children:"All Team Models"}),w.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"daily",children:"Daily"}),(0,c.jsx)(C.default.Option,{value:"weekly",children:"Weekly"}),(0,c.jsx)(C.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,c.jsx)(M,{min:0})}),(0,c.jsx)(I.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,c.jsx)(I.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,c.jsx)(I.Z.Item,{label:"Guardrails",name:"guardrails",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails"})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>v.setFieldValue("vector_stores",e),value:v.getFieldValue("vector_stores"),accessToken:h||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(Y,{onChange:e=>v.setFieldValue("mcp_servers_and_groups",e),value:v.getFieldValue("mcp_servers_and_groups"),accessToken:h||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",children:(0,c.jsx)(C.default,{placeholder:"Select team",style:{width:"100%"},children:null==x?void 0:x.map(e=>(0,c.jsx)(C.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,c.jsx)(I.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,c.jsx)(e4,{value:v.getFieldValue("logging_settings"),onChange:e=>v.setFieldValue("logging_settings",e),disabledCallbacks:O,onDisabledCallbacksChange:e=>{D(ei(e)),v.setFieldValue("disabled_callbacks",e)}})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:10})}),(0,c.jsx)(I.Z.Item,{name:"token",hidden:!0,children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,c.jsx)(L.default,{})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{onClick:m,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]})}function e9(e){let{selectedToken:s,visible:t,onClose:l,accessToken:a,premiumUser:r,setAccessToken:i,onKeyUpdate:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(null),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),[b,N]=(0,d.useState)(!1),[Z,C]=(0,d.useState)(!1),[A,T]=(0,d.useState)(null);(0,d.useEffect)(()=>{t&&s&&a&&(o.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),T(a),C(s.key_name===a))},[t,s,o,a]),(0,d.useEffect)(()=>{t||(u(null),N(!1),C(!1),T(null),o.resetFields())},[t,o]);let L=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,eG.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,eG.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,eG.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,d.useEffect)(()=>{(null==x?void 0:x.duration)?j(L(x.duration)):j(null)},[null==x?void 0:x.duration]);let O=async()=>{if(s&&A){N(!0);try{let e=await o.validateFields(),t=await (0,g.regenerateKeyCall)(A,s.token||s.token_id,e);u(t.key),P.ZP.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let l={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?L(e.duration):s.expires,...t};console.log("Updated key data with new token:",l),Z&&(T(t.key),i&&i(t.key)),n&&n(l),N(!1)}catch(e){console.error("Error regenerating key:",e),P.ZP.error("Failed to regenerate API Key"),N(!1)}}},M=()=>{u(null),N(!1),C(!1),T(null),o.resetFields(),l()};return(0,c.jsx)(E.Z,{title:"Regenerate API Key",open:t,onCancel:M,footer:m?[(0,c.jsx)(_.Z,{onClick:M,children:"Close"},"close")]:[(0,c.jsx)(_.Z,{onClick:M,className:"mr-2",children:"Cancel"},"cancel"),(0,c.jsx)(_.Z,{onClick:O,disabled:b,children:b?"Regenerating...":"Regenerate"},"regenerate")],children:m?(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Regenerated Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons, ",(0,c.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,c.jsxs)(f.Z,{numColSpan:1,children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"Key Alias:"}),(0,c.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,c.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,c.jsx)(w.Z,{className:"mt-3",children:"New API Key:"}),(0,c.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,c.jsx)("pre",{className:"break-words whitespace-normal",children:m})}),(0,c.jsx)(S.CopyToClipboard,{text:m,onCopy:()=>P.ZP.success("API Key copied to clipboard"),children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,c.jsxs)(I.Z,{form:o,layout:"vertical",onValuesChange:e=>{"duration"in e&&h(s=>({...s,duration:e.duration}))},children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,c.jsx)(y.Z,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),p&&(0,c.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",p]})]})})}var se=t(79814),ss=function(e){let{vectorStores:s,accessToken:t}=e,[l,a]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,g.vectorStoreListCall)(t);e.data&&a(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[t,s.length]);let r=e=>{let s=l.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(se.Z,{className:"h-4 w-4 text-blue-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,c.jsx)(eY.Z,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:r(e)},s))}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(se.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},st=t(25327),sl=function(e){let{mcpServers:s,mcpAccessGroups:l=[],accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(a&&s.length>0)try{let e=await (0,g.fetchMCPServers)(a);e&&Array.isArray(e)?i(e):e.data&&Array.isArray(e.data)&&i(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[a,s.length]),(0,d.useEffect)(()=>{(async()=>{if(a&&l.length>0)try{let e=await Promise.resolve().then(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(a));o(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[a,l.length]);let m=e=>{let s=r.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}return e},u=e=>e,x=[...s.map(e=>({type:"server",value:e})),...l.map(e=>({type:"accessGroup",value:e}))],h=x.length;return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(st.Z,{className:"h-4 w-4 text-gray-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,c.jsx)(eY.Z,{color:"gray",size:"xs",children:h})]}),h>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:x.map((e,s)=>"server"===e.type?(0,c.jsx)(z.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,c.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium cursor-help",children:m(e.value)})},s):(0,c.jsxs)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-green-50 border border-green-200 text-green-800 text-sm font-medium",children:[(0,c.jsx)("span",{className:"inline-block w-2 h-2 bg-green-500 rounded-full mr-2"}),u(e.value)," ",(0,c.jsx)("span",{className:"ml-1 text-xs text-green-500",children:"(Access Group)"})]},s))}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(st.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},sa=function(e){let{objectPermission:s,variant:t="card",className:l="",accessToken:a}=e,r=(null==s?void 0:s.vector_stores)||[],i=(null==s?void 0:s.mcp_servers)||[],n=(null==s?void 0:s.mcp_access_groups)||[],o=(0,c.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,c.jsx)(ss,{vectorStores:r,accessToken:a}),(0,c.jsx)(sl,{mcpServers:i,mcpAccessGroups:n,accessToken:a})]});return"card"===t?(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,c.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),o]}):(0,c.jsxs)("div",{className:"".concat(l),children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),o]})},sr=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:l="card",className:a=""}=e,r=e=>{var s;return(null===(s=Object.entries(ea).find(s=>{let[t,l]=s;return l===e}))||void 0===s?void 0:s[0])||e},i=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},n=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},o=(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(es.Z,{className:"h-4 w-4 text-blue-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,c.jsx)(eY.Z,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,c.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let l=r(e.callback_name),a=null===(t=ec[l])||void 0===t?void 0:t.logo;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[a?(0,c.jsx)("img",{src:a,alt:l,className:"w-5 h-5 object-contain"}):(0,c.jsx)(es.Z,{className:"h-5 w-5 text-gray-400"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-blue-800",children:l}),(0,c.jsxs)(w.Z,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,c.jsx)(eY.Z,{color:i(e.callback_type),size:"sm",children:n(e.callback_type)})]},s)})}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(es.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(ee.Z,{className:"h-4 w-4 text-red-600"}),(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,c.jsx)(eY.Z,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,c.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let l=er[e]||e,a=null===(t=ec[l])||void 0===t?void 0:t.logo;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[a?(0,c.jsx)("img",{src:a,alt:l,className:"w-5 h-5 object-contain"}):(0,c.jsx)(ee.Z,{className:"h-5 w-5 text-gray-400"}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium text-red-800",children:l}),(0,c.jsx)(w.Z,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,c.jsx)(eY.Z,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,c.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,c.jsx)(ee.Z,{className:"h-4 w-4 text-gray-400"}),(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===l?(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(a),children:[(0,c.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),o]}):(0,c.jsxs)("div",{className:"".concat(a),children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),o]})},si=t(30401),sn=t(78867);function so(e){var s,t,l,a;let{keyId:r,onClose:i,keyData:n,accessToken:o,userID:m,userRole:u,teams:x,onKeyDataUpdate:h,onDelete:p,premiumUser:j,setAccessToken:f}=e,[y,b]=(0,d.useState)(!1),[N]=I.Z.useForm(),[Z,S]=(0,d.useState)(!1),[C,E]=(0,d.useState)(!1),[A,L]=(0,d.useState)({}),[O,M]=(0,d.useState)(n),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)(!1);if((0,d.useEffect)(()=>{n&&M(n)},[n]),(0,d.useEffect)(()=>{if(R){let e=setTimeout(()=>{q(!1)},5e3);return()=>clearTimeout(e)}},[R]),!O)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:i,className:"mb-4",children:"Back to Keys"}),(0,c.jsx)(w.Z,{children:"Key not found"})]});let U=async e=>{try{var s,t,l,a;if(!o)return;let r=e.token;if(e.key=r,void 0!==e.vector_stores&&(e.object_permission={...O.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...O.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},delete e.mcp_servers_and_groups}if(e.metadata&&"string"==typeof e.metadata)try{let l=JSON.parse(e.metadata);e.metadata={...l,...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:en(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),P.ZP.error("Invalid metadata JSON");return}else e.metadata={...e.metadata||{},...(null===(l=e.guardrails)||void 0===l?void 0:l.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(a=e.disabled_callbacks)||void 0===a?void 0:a.length)>0?{litellm_disabled_callbacks:en(e.disabled_callbacks)}:{}};delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let i=await (0,g.keyUpdateCall)(o,e);M(e=>e?{...e,...i}:void 0),h&&h(i),P.ZP.success("Key updated successfully"),b(!1)}catch(e){P.ZP.error("Failed to update key"),console.error("Error updating key:",e)}},V=async()=>{try{if(!o)return;await (0,g.keyDeleteCall)(o,O.token||O.token_id),P.ZP.success("Key deleted successfully"),p&&p(),i()}catch(e){console.error("Error deleting the key:",e),P.ZP.error("Failed to delete key")}},K=async(e,s)=>{await eq(e)&&(L(e=>({...e,[s]:!0})),setTimeout(()=>{L(e=>({...e,[s]:!1}))},2e3))},B=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),l=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(l)};return(0,c.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:i,className:"mb-4",children:"Back to Keys"}),(0,c.jsx)(k.Z,{children:O.key_alias||"API Key"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono text-sm",children:O.token_id||O.token})]}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:A["key-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>K(O.token_id||O.token,"key-id"),className:"ml-2 transition-all duration-200".concat(A["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,c.jsx)(w.Z,{className:"text-sm text-gray-500",children:O.updated_at&&O.updated_at!==O.created_at?"Updated: ".concat(B(O.updated_at)):"Created: ".concat(B(O.created_at))}),R&&(0,c.jsx)(eY.Z,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),D&&(0,c.jsx)(eY.Z,{color:"blue",size:"xs",children:"Regenerated"})]})]}),u&&eL.LQ.includes(u)&&(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(z.Z,{title:j?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,c.jsx)("span",{className:"inline-block",children:(0,c.jsx)(_.Z,{icon:e2.Z,variant:"secondary",onClick:()=>E(!0),className:"flex items-center",disabled:!j,children:"Regenerate Key"})})}),(0,c.jsx)(_.Z,{icon:el.Z,variant:"secondary",onClick:()=>S(!0),className:"flex items-center",children:"Delete Key"})]})]}),(0,c.jsx)(e9,{selectedToken:O,visible:C,onClose:()=>E(!1),accessToken:o,premiumUser:j,setAccessToken:f,onKeyUpdate:e=>{M(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),F(new Date),q(!0),h&&h({...e,created_at:new Date().toLocaleString()})}}),Z&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:V,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>S(!1),children:"Cancel"})]})]})]})}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"}),(0,c.jsx)(eW.Z,{children:"Settings"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Spend"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eR(O.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null!==O.max_budget?"$".concat(eR(O.max_budget)):"Unlimited"]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",null!==O.tpm_limit?O.tpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",null!==O.rpm_limit?O.rpm_limit:"Unlimited"]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:O.models&&O.models.length>0?O.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s)):(0,c.jsx)(w.Z,{children:"No models specified"})})]}),(0,c.jsx)(X.Z,{children:(0,c.jsx)(sa,{objectPermission:O.object_permission,variant:"inline",accessToken:o})}),(0,c.jsx)(sr,{loggingConfigs:e3(O.metadata),disabledCallbacks:Array.isArray(null===(s=O.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?ei(O.metadata.litellm_disabled_callbacks):[],variant:"card"})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Key Settings"}),!y&&u&&eL.LQ.includes(u)&&(0,c.jsx)(_.Z,{variant:"light",onClick:()=>b(!0),children:"Edit Settings"})]}),y?(0,c.jsx)(e7,{keyData:O,onCancel:()=>b(!1),onSubmit:U,teams:x,accessToken:o,userID:m,userRole:u}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Key ID"}),(0,c.jsx)(w.Z,{className:"font-mono",children:O.token_id||O.token})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Key Alias"}),(0,c.jsx)(w.Z,{children:O.key_alias||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Secret Key"}),(0,c.jsx)(w.Z,{className:"font-mono",children:O.key_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)(w.Z,{children:O.team_id||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization"}),(0,c.jsx)(w.Z,{children:O.organization_id||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:B(O.created_at)})]}),D&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Regenerated"}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:B(D)}),(0,c.jsx)(eY.Z,{color:"green",size:"xs",children:"Recent"})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Expires"}),(0,c.jsx)(w.Z,{children:O.expires?B(O.expires):"Never"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Spend"}),(0,c.jsxs)(w.Z,{children:["$",eR(O.spend,4)," USD"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Budget"}),(0,c.jsx)(w.Z,{children:null!==O.max_budget?"$".concat(eR(O.max_budget,2)):"Unlimited"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:O.models&&O.models.length>0?O.models.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,c.jsx)(w.Z,{children:"No models specified"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)(w.Z,{children:["TPM: ",null!==O.tpm_limit?O.tpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",null!==O.rpm_limit?O.rpm_limit:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Max Parallel Requests:"," ",null!==O.max_parallel_requests?O.max_parallel_requests:"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Model TPM Limits:"," ",(null===(t=O.metadata)||void 0===t?void 0:t.model_tpm_limit)?JSON.stringify(O.metadata.model_tpm_limit):"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["Model RPM Limits:"," ",(null===(l=O.metadata)||void 0===l?void 0:l.model_rpm_limit)?JSON.stringify(O.metadata.model_rpm_limit):"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:e8(O.metadata)})]}),(0,c.jsx)(sa,{objectPermission:O.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o}),(0,c.jsx)(sr,{loggingConfigs:e3(O.metadata),disabledCallbacks:Array.isArray(null===(a=O.metadata)||void 0===a?void 0:a.litellm_disabled_callbacks)?ei(O.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}var sc=t(2356),sd=e=>{let{options:s,onApplyFilters:t,onResetFilters:l,initialValues:a={},buttonLabel:r="Filters"}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(a),[u,x]=(0,d.useState)({}),[h,p]=(0,d.useState)({}),[g,j]=(0,d.useState)({}),f=(0,d.useCallback)(eT()(async(e,s)=>{if(s.isSearchable&&s.searchFn){p(e=>({...e,[s.name]:!0}));try{let t=await s.searchFn(e);x(e=>({...e,[s.name]:t}))}catch(e){console.error("Error searching:",e),x(e=>({...e,[s.name]:[]}))}finally{p(e=>({...e,[s.name]:!1}))}}},300),[]),v=(e,s)=>{let l={...o,[e]:s};m(l),t(l)};return(0,c.jsxs)("div",{className:"w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(sc.Z,{className:"h-4 w-4"}),onClick:()=>n(!i),className:"flex items-center gap-2",children:r}),(0,c.jsx)(T.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),m(e),l()},children:"Reset Filters"})]}),i&&(0,c.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Key Hash","Model"].map(e=>{let t=s.find(s=>s.label===e||s.name===e);return t?(0,c.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,c.jsx)("label",{className:"text-sm text-gray-600",children:t.label||t.name}),t.isSearchable?(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(t.label||t.name,"..."),value:o[t.name]||void 0,onChange:e=>v(t.name,e),onSearch:e=>{j(s=>({...s,[t.name]:e})),t.searchFn&&f(e,t)},filterOption:!1,loading:h[t.name],options:u[t.name]||[],allowClear:!0}):t.options?(0,c.jsx)(C.default,{className:"w-full",placeholder:"Select ".concat(t.label||t.name,"..."),value:o[t.name]||void 0,onChange:e=>v(t.name,e),allowClear:!0,children:t.options.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))}):(0,c.jsx)(L.default,{className:"w-full",placeholder:"Enter ".concat(t.label||t.name,"..."),value:o[t.name]||"",onChange:e=>v(t.name,e.target.value),allowClear:!0})]},t.name):null})})]})},sm=t(16593);let su=async e=>{if(!e)return[];try{let s=[],t=1,l=!0;for(;l;){let a=await (0,g.keyListCall)(e,null,"",null,null,null,t,100),r=a.keys.map(e=>e.key_alias).filter(Boolean);s=[...s,...r],t<a.total_pages?t++:l=!1}return Array.from(new Set(s))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},sx=async(e,s)=>{if(!e)return[];try{let t=[],l=1,a=!0;for(;a;){let r=await (0,g.teamListCall)(e,s||null,null);t=[...t,...r],l<r.total_pages?l++:a=!1}return t}catch(e){return console.error("Error fetching all teams:",e),[]}},sh=async e=>{if(!e)return[];try{let s=[],t=1,l=!0;for(;l;){let a=await (0,g.organizationListCall)(e);s=[...s,...a],t<a.total_pages?t++:l=!1}return s}catch(e){return console.error("Error fetching all organizations:",e),[]}},sp=()=>{let[e,s]=(0,d.useState)("http://localhost:4000");return(0,d.useEffect)(()=>{{let{protocol:e,host:t}=window.location;s("".concat(e,"//").concat(t))}},[]),e};var sg=t(71594),sj=t(24525),sf=t(47323),sv=t(21626),s_=t(97214),sy=t(28241),sb=t(58834),sN=t(69552),sZ=t(71876),sw=t(86462),sk=t(47686),sS=t(44633),sC=t(49084);function sI(e){let{keys:s,setKeys:t,isLoading:l=!1,pagination:a,onPageChange:r,pageSize:i=50,teams:n,selectedTeam:o,setSelectedTeam:m,selectedKeyAlias:u,setSelectedKeyAlias:x,accessToken:h,userID:p,userRole:j,organizations:f,setCurrentOrg:v,refresh:y,onSortChange:b,currentSort:N,premiumUser:Z,setAccessToken:k}=e,[S,C]=(0,d.useState)(null),[I,P]=(0,d.useState)([]),[E,A]=d.useState(()=>N?[{id:N.sortBy,desc:"desc"===N.sortOrder}]:[{id:"created_at",desc:!0}]),[T,L]=(0,d.useState)({}),{filters:O,filteredKeys:M,allKeyAliases:D,allTeams:R,allOrganizations:q,handleFilterChange:U,handleFilterReset:V}=function(e){let{keys:s,teams:t,organizations:l,accessToken:a}=e,r={"Team ID":"","Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"},[i,n]=(0,d.useState)(r),[o,c]=(0,d.useState)(t||[]),[m,u]=(0,d.useState)(l||[]),[x,h]=(0,d.useState)(s),p=(0,d.useRef)(0),j=(0,d.useCallback)(eT()(async e=>{if(!a)return;let s=Date.now();p.current=s;try{let t=await (0,g.keyListCall)(a,e["Organization ID"]||null,e["Team ID"]||null,e["Key Alias"]||null,e["User ID"]||null,e["Key Hash"]||null,1,25,e["Sort By"]||null,e["Sort Order"]||null);s===p.current&&t&&(h(t.keys),console.log("called from debouncedSearch filters:",JSON.stringify(e)),console.log("called from debouncedSearch data:",JSON.stringify(t)))}catch(e){console.error("Error searching users:",e)}},300),[a]);(0,d.useEffect)(()=>{if(!s){h([]);return}let e=[...s];i["Team ID"]&&(e=e.filter(e=>e.team_id===i["Team ID"])),i["Organization ID"]&&(e=e.filter(e=>e.organization_id===i["Organization ID"])),h(e)},[s,i]),(0,d.useEffect)(()=>{let e=async()=>{let e=await sx(a);e.length>0&&c(e);let s=await sh(a);s.length>0&&u(s)};a&&e()},[a]);let f=(0,sm.a)({queryKey:["allKeys"],queryFn:async()=>{if(!a)throw Error("Access token required");return await su(a)},enabled:!!a}).data||[];return(0,d.useEffect)(()=>{t&&t.length>0&&c(e=>e.length<t.length?t:e)},[t]),(0,d.useEffect)(()=>{l&&l.length>0&&u(e=>e.length<l.length?l:e)},[l]),{filters:i,filteredKeys:x,allKeyAliases:f,allTeams:o,allOrganizations:m,handleFilterChange:e=>{n({"Team ID":e["Team ID"]||"","Organization ID":e["Organization ID"]||"","Key Alias":e["Key Alias"]||"","User ID":e["User ID"]||"","Sort By":e["Sort By"]||"created_at","Sort Order":e["Sort Order"]||"desc"}),j({...i,...e})},handleFilterReset:()=>{n(r),j(r)}}}({keys:s,teams:n,organizations:f,accessToken:h});(0,d.useEffect)(()=>{if(h){let e=s.map(e=>e.user_id).filter(e=>null!==e);(async()=>{P((await (0,g.userListCall)(h,e,1,100)).users)})()}},[h,s]),(0,d.useEffect)(()=>{if(y){let e=()=>{y()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},[y]);let K=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return s.getCanExpand()?(0,c.jsx)("button",{onClick:s.getToggleExpandedHandler(),style:{cursor:"pointer"},children:s.getIsExpanded()?"▼":"▶"}):null}},{id:"token",accessorKey:"token",header:"Key ID",cell:e=>(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.getValue(),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>C(e.getValue()),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",cell:e=>{let s=e.getValue();return(0,c.jsx)(z.Z,{title:s,children:s?s.length>20?"".concat(s.slice(0,20),"..."):s:"-"})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",cell:e=>(0,c.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"team_alias",accessorKey:"team_id",header:"Team Alias",cell:e=>{let{row:s,getValue:t}=e,l=t(),a=null==n?void 0:n.find(e=>e.team_id===l);return(null==a?void 0:a.team_alias)||"Unknown"}},{id:"team_id",accessorKey:"team_id",header:"Team ID",cell:e=>(0,c.jsx)(z.Z,{title:e.getValue(),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user_id",header:"User Email",cell:e=>{let s=e.getValue(),t=I.find(e=>e.user_id===s);return(null==t?void 0:t.user_email)?(0,c.jsx)(z.Z,{title:null==t?void 0:t.user_email,children:(0,c.jsxs)("span",{children:[null==t?void 0:t.user_email.slice(0,20),"..."]})}):"-"}},{id:"user_id",accessorKey:"user_id",header:"User ID",cell:e=>{let s=e.getValue();return s&&s.length>15?(0,c.jsx)(z.Z,{title:s,children:(0,c.jsxs)("span",{children:[s.slice(0,7),"..."]})}):s||"-"}},{id:"created_at",accessorKey:"created_at",header:"Created At",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",cell:e=>{let s=e.getValue();return s&&s.length>15?(0,c.jsx)(z.Z,{title:s,children:(0,c.jsxs)("span",{children:[s.slice(0,7),"..."]})}):s}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"Never"}},{id:"expires",accessorKey:"expires",header:"Expires",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",cell:e=>eR(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",cell:e=>{let s=e.getValue();return null===s?"Unlimited":"$".concat(eR(s))}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",cell:e=>{let s=e.getValue();return s?new Date(s).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",cell:e=>{let s=e.getValue();return(0,c.jsx)("div",{className:"flex flex-col py-2",children:Array.isArray(s)?(0,c.jsx)("div",{className:"flex flex-col",children:0===s.length?(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[s.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sf.Z,{icon:T[e.row.id]?sw.Z:sk.Z,className:"cursor-pointer",size:"xs",onClick:()=>{L(s=>({...s,[e.row.id]:!s[e.row.id]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[s.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),s.length>3&&!T[e.row.id]&&(0,c.jsx)(eY.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",s.length-3," ",s.length-3==1?"more model":"more models"]})}),T[e.row.id]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:s.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:["TPM: ",null!==t.tpm_limit?t.tpm_limit:"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",null!==t.rpm_limit?t.rpm_limit:"Unlimited"]})]})}}];console.log("keys: ".concat(JSON.stringify(s)));let B=(0,sg.b7)({data:M,columns:K.filter(e=>"expander"!==e.id),state:{sorting:E},onSortingChange:e=>{let s="function"==typeof e?e(E):e;if(console.log("newSorting: ".concat(JSON.stringify(s))),A(s),s&&s.length>0){let e=s[0],t=e.id,l=e.desc?"desc":"asc";console.log("sortBy: ".concat(t,", sortOrder: ").concat(l)),U({...O,"Sort By":t,"Sort Order":l}),null==b||b(t,l)}},getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0,manualSorting:!1});return d.useEffect(()=>{N&&A([{id:N.sortBy,desc:"desc"===N.sortOrder}])},[N]),(0,c.jsx)("div",{className:"w-full h-full overflow-hidden",children:S?(0,c.jsx)(so,{keyId:S,onClose:()=>C(null),keyData:M.find(e=>e.token===S),onKeyDataUpdate:e=>{t(s=>s.map(s=>s.token===e.token?eF(s,e):s)),y&&y()},onDelete:()=>{t(e=>e.filter(e=>e.token!==S)),y&&y()},accessToken:h,userID:p,userRole:j,teams:R,premiumUser:Z,setAccessToken:k}):(0,c.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,c.jsx)("div",{className:"w-full mb-6",children:(0,c.jsx)(sd,{options:[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>R&&0!==R.length?R.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Organization ID",label:"Organization ID",isSearchable:!0,searchFn:async e=>q&&0!==q.length?q.filter(s=>{var t,l;return null!==(l=null===(t=s.organization_id)||void 0===t?void 0:t.toLowerCase().includes(e.toLowerCase()))&&void 0!==l&&l}).filter(e=>null!==e.organization_id&&void 0!==e.organization_id).map(e=>({label:"".concat(e.organization_id||"Unknown"," (").concat(e.organization_id,")"),value:e.organization_id})):[]},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>D.filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))},{name:"User ID",label:"User ID",isSearchable:!1},{name:"Key Hash",label:"Key Hash",isSearchable:!1}],onApplyFilters:U,initialValues:O,onResetFilters:V})}),(0,c.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[(0,c.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",l?"...":"".concat((a.currentPage-1)*i+1," - ").concat(Math.min(a.currentPage*i,a.totalCount))," of ",l?"...":a.totalCount," results"]}),(0,c.jsxs)("div",{className:"inline-flex items-center gap-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",l?"...":a.currentPage," of ",l?"...":a.totalPages]}),(0,c.jsx)("button",{onClick:()=>r(a.currentPage-1),disabled:l||1===a.currentPage,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>r(a.currentPage+1),disabled:l||a.currentPage===a.totalPages,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,c.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sv.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sb.Z,{children:B.getHeaderGroups().map(e=>(0,c.jsx)(sZ.Z,{children:e.headers.map(e=>(0,c.jsx)(sN.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(s_.Z,{children:l?(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:K.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"\uD83D\uDE85 Loading keys..."})})})}):M.length>0?B.getRowModel().rows.map(e=>(0,c.jsx)(sZ.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(sy.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("models"===e.column.id&&e.getValue().length>3?"px-0":""),children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:K.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No keys found"})})})})})]})})})})]})})}var sP=e=>{let{userID:s,userRole:t,accessToken:l,selectedTeam:a,setSelectedTeam:r,data:i,setData:n,teams:o,premiumUser:m,currentOrg:u,organizations:x,setCurrentOrg:h,selectedKeyAlias:p,setSelectedKeyAlias:j,createClicked:b,setAccessToken:N}=e,[Z,C]=(0,d.useState)(!1),[A,T]=(0,d.useState)(!1),[L,O]=(0,d.useState)(null),[M,F]=(0,d.useState)(null),[R,U]=(0,d.useState)(null),[z,V]=(0,d.useState)((null==a?void 0:a.team_id)||"");(0,d.useEffect)(()=>{V((null==a?void 0:a.team_id)||"")},[a]);let{keys:K,isLoading:B,error:G,pagination:H,refresh:J,setKeys:Y}=eH({selectedTeam:a||void 0,currentOrg:u,selectedKeyAlias:p,accessToken:l||"",createClicked:b}),[W,$]=(0,d.useState)(!1),[Q,X]=(0,d.useState)(!1),[ee,es]=(0,d.useState)(null),[et,el]=(0,d.useState)([]),ea=new Set,[er,ei]=(0,d.useState)(!1),[en,eo]=(0,d.useState)(!1),[ec,ed]=(0,d.useState)(null),[em,eu]=(0,d.useState)(null),[ex]=I.Z.useForm(),[eh,ep]=(0,d.useState)(null),[eg,ej]=(0,d.useState)(ea),[ef,ev]=(0,d.useState)([]);(0,d.useEffect)(()=>{console.log("in calculateNewExpiryTime for selectedToken",ee),(null==em?void 0:em.duration)?ep((e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,eG.Z)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,eG.Z)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,eG.Z)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}catch(e){return null}})(em.duration)):ep(null),console.log("calculateNewExpiryTime:",eh)},[ee,null==em?void 0:em.duration]),(0,d.useEffect)(()=>{(async()=>{try{if(null===s||null===t||null===l)return;let e=await D(s,t,l);e&&el(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,s,t]),(0,d.useEffect)(()=>{if(o){let e=new Set;o.forEach((s,t)=>{let l=s.team_id;e.add(l)}),ej(e)}},[o]);let e_=async()=>{if(null!=L&&null!=i){try{if(!l)return;await (0,g.keyDeleteCall)(l,L);let e=i.filter(e=>e.token!==L);n(e)}catch(e){console.error("Error deleting the key:",e)}T(!1),O(null)}},ey=(e,s)=>{eu(t=>({...t,[e]:s}))},eb=async()=>{if(!m){P.ZP.error("Regenerate API Key is an Enterprise feature. Please upgrade to use this feature.");return}if(null!=ee)try{let e=await ex.validateFields();if(!l)return;let s=await (0,g.regenerateKeyCall)(l,ee.token||ee.token_id,e);if(ed(s.key),i){let t=i.map(t=>t.token===(null==ee?void 0:ee.token)?{...t,key_name:s.key_name,...e}:t);n(t)}eo(!1),ex.resetFields(),P.ZP.success("API Key regenerated successfully")}catch(e){console.error("Error regenerating key:",e),P.ZP.error("Failed to regenerate API Key")}};return(0,c.jsxs)("div",{children:[(0,c.jsx)(sI,{keys:K,setKeys:Y,isLoading:B,pagination:H,onPageChange:e=>{J({page:e})},pageSize:100,teams:o,selectedTeam:a,setSelectedTeam:r,accessToken:l,userID:s,userRole:t,organizations:x,setCurrentOrg:h,refresh:J,selectedKeyAlias:p,setSelectedKeyAlias:j,premiumUser:m,setAccessToken:N}),A&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Key"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this key ?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:e_,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{T(!1),O(null)},children:"Cancel"})]})]})]})}),(0,c.jsx)(E.Z,{title:"Regenerate API Key",visible:en,onCancel:()=>{eo(!1),ex.resetFields()},footer:[(0,c.jsx)(_.Z,{onClick:()=>{eo(!1),ex.resetFields()},className:"mr-2",children:"Cancel"},"cancel"),(0,c.jsx)(_.Z,{onClick:eb,disabled:!m,children:m?"Regenerate":"Upgrade to Regenerate"},"regenerate")],children:m?(0,c.jsxs)(I.Z,{form:ex,layout:"vertical",onValuesChange:(e,s)=>{"duration"in e&&ey("duration",e.duration)},children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,c.jsx)(y.Z,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,c.jsx)(q.Z,{style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry:"," ",(null==ee?void 0:ee.expires)!=null?new Date(ee.expires).toLocaleString():"Never"]}),eh&&(0,c.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",eh]})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,c.jsx)(_.Z,{variant:"primary",className:"mb-2",children:(0,c.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",children:"Get Free Trial"})})]})}),ec&&(0,c.jsx)(E.Z,{visible:!!ec,onCancel:()=>ed(null),footer:[(0,c.jsx)(_.Z,{onClick:()=>ed(null),children:"Close"},"close")],children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:"Regenerated Key"}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons, ",(0,c.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,c.jsxs)(f.Z,{numColSpan:1,children:[(0,c.jsx)(w.Z,{className:"mt-3",children:"Key Alias:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:(null==ee?void 0:ee.key_alias)||"No alias set"})}),(0,c.jsx)(w.Z,{className:"mt-3",children:"New API Key:"}),(0,c.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,c.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:ec})}),(0,c.jsx)(S.CopyToClipboard,{text:ec,onCopy:()=>P.ZP.success("API Key copied to clipboard"),children:(0,c.jsx)(_.Z,{className:"mt-3",children:"Copy API Key"})})]})]})})]})},sE=t(12011),sA=t(3914),sT=e=>{let{userID:s,userRole:t,teams:l,keys:a,setUserRole:r,userEmail:i,setUserEmail:n,setTeams:o,setKeys:x,premiumUser:h,organizations:p,addKey:_,createClicked:y}=e,[b,N]=(0,d.useState)(null),[Z,w]=(0,d.useState)(null),k=(0,m.useSearchParams)(),S=function(e){console.log("COOKIES",document.cookie);let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));return s?s.split("=")[1]:null}("token"),C=k.get("invitation_id"),[I,P]=(0,d.useState)(null),[E,A]=(0,d.useState)(null),[T,L]=(0,d.useState)([]),[O,M]=(0,d.useState)(null),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)(null);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,d.useEffect)(()=>{if(S){let e=(0,u.o)(S);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),P(e.key),e.user_role){let s=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";case"internal_user":return"Internal User";case"internal_user_viewer":return"Internal Viewer";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",s),r(s)}else console.log("User role not defined");e.user_email?n(e.user_email):console.log("User Email is not set ".concat(e))}}if(s&&I&&t&&!a&&!b){let e=sessionStorage.getItem("userModels"+s);e?L(JSON.parse(e)):(console.log("currentOrg: ".concat(JSON.stringify(Z))),(async()=>{try{let e=await (0,g.getProxyUISettings)(I);M(e);let l=await (0,g.userInfoCall)(I,s,t,!1,null,null);N(l.user_info),console.log("userSpendData: ".concat(JSON.stringify(b))),(null==l?void 0:l.teams[0].keys)?x(l.keys.concat(l.teams.filter(e=>"Admin"===t||e.user_id===s).flatMap(e=>e.keys))):x(l.keys),sessionStorage.setItem("userData"+s,JSON.stringify(l.keys)),sessionStorage.setItem("userSpendData"+s,JSON.stringify(l.user_info));let a=(await (0,g.modelAvailableCall)(I,s,t)).data.map(e=>e.id);console.log("available_model_names:",a),L(a),console.log("userModels:",T),sessionStorage.setItem("userModels"+s,JSON.stringify(a))}catch(e){console.error("There was an error fetching the data",e),e.message.includes("Invalid proxy server token passed")&&U()}})(),j(I,s,t,Z,o))}},[s,S,I,a,t]),(0,d.useEffect)(()=>{I&&(async()=>{try{let e=await (0,g.keyInfoCall)(I,[I]);console.log("keyInfo: ",e)}catch(e){e.message.includes("Invalid proxy server token passed")&&U()}})()},[I]),(0,d.useEffect)(()=>{console.log("currentOrg: ".concat(JSON.stringify(Z),", accessToken: ").concat(I,", userID: ").concat(s,", userRole: ").concat(t)),I&&(console.log("fetching teams"),j(I,s,t,Z,o))},[Z]),(0,d.useEffect)(()=>{if(null!==a&&null!=D&&null!==D.team_id){let e=0;for(let s of(console.log("keys: ".concat(JSON.stringify(a))),a))D.hasOwnProperty("team_id")&&null!==s.team_id&&s.team_id===D.team_id&&(e+=s.spend);console.log("sum: ".concat(e)),A(e)}else if(null!==a){let e=0;for(let s of a)e+=s.spend;A(e)}},[D]),null!=C)return(0,c.jsx)(sE.default,{});function U(){(0,sA.b)();let e=(0,g.getProxyBaseUrl)();console.log("proxyBaseUrl:",e);let s=e?"".concat(e,"/sso/key/generate"):"/sso/key/generate";return console.log("Full URL:",s),window.location.href=s,null}if(null==S)return console.log("All cookies before redirect:",document.cookie),U(),null;try{let e=(0,u.o)(S);console.log("Decoded token:",e);let s=e.exp,t=Math.floor(Date.now()/1e3);if(s&&t>=s)return console.log("Token expired, redirecting to login"),U(),null}catch(e){return console.error("Error decoding token:",e),(0,sA.b)(),U(),null}if(null==I)return null;if(null==s)return(0,c.jsx)("h1",{children:"User ID is not set"});if(null==t&&r("App Owner"),t&&"Admin Viewer"==t){let{Title:e,Paragraph:s}=eh.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",D),console.log("All cookies after redirect:",document.cookie),(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,c.jsx)(eB,{userID:s,team:D,teams:l,userRole:t,accessToken:I,data:a,addKey:_,premiumUser:h},D?D.team_id:null),(0,c.jsx)(sP,{userID:s,userRole:t,accessToken:I,selectedTeam:D||null,setSelectedTeam:F,selectedKeyAlias:R,setSelectedKeyAlias:q,data:a,setData:x,premiumUser:h,teams:l,currentOrg:Z,setCurrentOrg:w,organizations:p,createClicked:y,setAccessToken:P})]})})})},sL=t(97765),sO=t(42673);let sM=async(e,s,t)=>{try{console.log("handling submit for formValues:",e);let s=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,l=sO.fK[t]+"/*";e.model_name=l,s.push({public_name:l,litellm_model:l}),e.model=l}let t=[];for(let l of s){let s={},a={},r=l.public_name;for(let[t,r]of(s.model=l.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),s.model=l.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==r&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)s.model=r;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",r);let e=sO.fK[r];s.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)a[t]=r;else if("team_id"===t)a.team_id=r;else if("model_access_group"===t)a.access_groups=r;else if("mode"==t)console.log("placing mode in modelInfo"),a.mode=r,delete s.mode;else if("custom_model_name"===t)s.model=r;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw P.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,l]of Object.entries(e))s[t]=l}}else if("model_info_params"==t){console.log("model_info_params:",r);let e={};if(r&&void 0!=r){try{e=JSON.parse(r)}catch(e){throw P.ZP.error("Failed to parse LiteLLM Extra Params: "+e,10),Error("Failed to parse litellm_extra_params: "+e)}for(let[s,t]of Object.entries(e))a[s]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){r&&(s[t]=Number(r));continue}else s[t]=r}t.push({litellmParamsObj:s,modelInfoObj:a,modelName:r})}return t}catch(e){P.ZP.error("Failed to create model: "+e,10)}},sD=async(e,s,t,l)=>{try{let a=await sM(e,s,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:l,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:l},i=await (0,g.modelCreateCall)(s,r);console.log("response for model create call: ".concat(i.data))}l&&l(),t.resetFields()}catch(e){P.ZP.error("Failed to add model: "+e,10)}};var sF=t(53410),sR=t(47451),sq=t(69410);let{Link:sU}=eh.default,sz={[sO.Cl.OpenAI]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sO.Cl.OpenAI_Text]:[{key:"api_base",label:"API Base",type:"select",options:["https://api.openai.com/v1","https://eu.api.openai.com"],defaultValue:"https://api.openai.com/v1"},{key:"organization",label:"OpenAI Organization ID",placeholder:"[OPTIONAL] my-unique-org"},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sO.Cl.Vertex_AI]:[{key:"vertex_project",label:"Vertex Project",placeholder:"adroit-cadet-1234..",required:!0},{key:"vertex_location",label:"Vertex Location",placeholder:"us-east-1",required:!0},{key:"vertex_credentials",label:"Vertex Credentials",required:!0,type:"upload"}],[sO.Cl.AssemblyAI]:[{key:"api_base",label:"API Base",type:"select",required:!0,options:["https://api.assemblyai.com","https://api.eu.assemblyai.com"]},{key:"api_key",label:"AssemblyAI API Key",type:"password",required:!0}],[sO.Cl.Azure]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_version",label:"API Version",placeholder:"2023-07-01-preview",tooltip:"By default litellm will use the latest version. If you want to use a different version, you can specify it here"},{key:"base_model",label:"Base Model",placeholder:"azure/gpt-3.5-turbo"},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[sO.Cl.Azure_AI_Studio]:[{key:"api_base",label:"API Base",placeholder:"https://<test>.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",tooltip:"Enter your full Target URI from Azure Foundry here. Example: https://litellm8397336933.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-10-21",required:!0},{key:"api_key",label:"Azure API Key",type:"password",required:!0}],[sO.Cl.OpenAI_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sO.Cl.OpenAI_Text_Compatible]:[{key:"api_base",label:"API Base",placeholder:"https://...",required:!0},{key:"api_key",label:"OpenAI API Key",type:"password",required:!0}],[sO.Cl.Bedrock]:[{key:"aws_access_key_id",label:"AWS Access Key ID",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_secret_access_key",label:"AWS Secret Access Key",type:"password",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."},{key:"aws_region_name",label:"AWS Region Name",placeholder:"us-east-1",required:!1,tooltip:"You can provide the raw key or the environment variable (e.g. `os.environ/MY_SECRET_KEY`)."}],[sO.Cl.Ollama]:[{key:"api_base",label:"API Base",placeholder:"http://localhost:11434",defaultValue:"http://localhost:11434",required:!1,tooltip:"The base URL for your Ollama server. Defaults to http://localhost:11434 if not specified."}],[sO.Cl.Anthropic]:[{key:"api_key",label:"API Key",placeholder:"sk-",type:"password",required:!0}],[sO.Cl.Deepgram]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.ElevenLabs]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Google_AI_Studio]:[{key:"api_key",label:"API Key",placeholder:"aig-",type:"password",required:!0}],[sO.Cl.Groq]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.MistralAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Deepseek]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Cohere]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Databricks]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.xAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Cerebras]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Sambanova]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Perplexity]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.TogetherAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Openrouter]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.FireworksAI]:[{key:"api_key",label:"API Key",type:"password",required:!0}],[sO.Cl.Triton]:[{key:"api_key",label:"API Key",type:"password",required:!1},{key:"api_base",label:"API Base",placeholder:"http://localhost:8000/generate",required:!1}]};var sV=e=>{let{selectedProvider:s,uploadProps:t}=e,l=sO.Cl[s],a=I.Z.useFormInstance(),r=d.useMemo(()=>sz[l]||[],[l]),i={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let s=new FileReader;s.onload=e=>{if(e.target){let s=e.target.result;console.log("Setting field value from JSON, length: ".concat(s.length)),a.setFieldsValue({vertex_credentials:s}),console.log("Form values after setting:",a.getFieldsValue())}},s.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",a.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,c.jsx)(c.Fragment,{children:r.map(e=>{var s;return(0,c.jsxs)(d.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,c.jsx)(C.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(s=e.options)||void 0===s?void 0:s.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,c.jsx)(eg.default,{...i,onChange:s=>{(null==t?void 0:t.onChange)&&t.onChange(s),setTimeout(()=>{let s=a.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(s))},500)},children:(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(eN.Z,{}),children:"Click to Upload"})}):(0,c.jsx)(y.Z,{placeholder:e.placeholder,type:"password"===e.type?"password":"text"})}),"vertex_credentials"===e.key&&(0,c.jsx)(sR.Z,{children:(0,c.jsx)(sq.Z,{children:(0,c.jsx)(w.Z,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,c.jsxs)(sR.Z,{children:[(0,c.jsx)(sq.Z,{span:10}),(0,c.jsx)(sq.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,c.jsx)(sU,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})})};let{Title:sK,Link:sB}=eh.default;var sG=e=>{let{isVisible:s,onCancel:t,onAddCredential:l,onUpdateCredential:a,uploadProps:r,addOrEdit:i,existingCredential:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(sO.Cl.OpenAI),[x,h]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{n&&(o.setFieldsValue({credential_name:n.credential_name,custom_llm_provider:n.credential_info.custom_llm_provider,api_base:n.credential_values.api_base,api_version:n.credential_values.api_version,base_model:n.credential_values.base_model,api_key:n.credential_values.api_key}),u(n.credential_info.custom_llm_provider))},[n]),(0,c.jsx)(E.Z,{title:"add"===i?"Add New Credential":"Edit Credential",visible:s,onCancel:()=>{t(),o.resetFields()},footer:null,width:600,children:(0,c.jsxs)(I.Z,{form:o,onFinish:e=>{let s=Object.entries(e).reduce((e,s)=>{let[t,l]=s;return""!==l&&null!=l&&(e[t]=l),e},{});"add"===i?l(s):a(s),o.resetFields()},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==n?void 0:n.credential_name,children:(0,c.jsx)(y.Z,{placeholder:"Enter a friendly name for these credentials",disabled:null!=n&&!!n.credential_name})}),(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,c.jsx)(C.default,{showSearch:!0,onChange:e=>{u(e),o.setFieldValue("custom_llm_provider",e)},children:Object.entries(sO.Cl).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sO.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(sV,{selectedProvider:m,uploadProps:r}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(sB,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:()=>{t(),o.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"add"===i?"Add Credential":"Update Credential"})]})]})]})})},sH=e=>{let{accessToken:s,uploadProps:t,credentialList:l,fetchCredentials:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(null),[x]=I.Z.useForm(),h=["credential_name","custom_llm_provider"],p=async e=>{if(!s)return;let t=Object.entries(e).filter(e=>{let[s]=e;return!h.includes(s)}).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:l}},{}),l={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,g.credentialUpdateCall)(s,e.credential_name,l),P.ZP.success("Credential updated successfully"),o(!1),a(s)},j=async e=>{if(!s)return;let t=Object.entries(e).filter(e=>{let[s]=e;return!h.includes(s)}).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:l}},{}),l={credential_name:e.credential_name,credential_values:t,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,g.credentialCreateCall)(s,l),P.ZP.success("Credential added successfully"),i(!1),a(s)};(0,d.useEffect)(()=>{s&&a(s)},[s]);let f=e=>{let s={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=s[e.toLowerCase()]||s.default;return(0,c.jsx)(eY.Z,{color:t,size:"xs",children:e})},v=async e=>{s&&(await (0,g.credentialDeleteCall)(s,e),P.ZP.success("Credential deleted successfully"),a(s))};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(w.Z,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,c.jsx)(X.Z,{children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Credential Name"}),(0,c.jsx)(sN.Z,{children:"Provider"}),(0,c.jsx)(sN.Z,{children:"Description"})]})}),(0,c.jsx)(s_.Z,{children:l&&0!==l.length?l.map((e,s)=>{var t,l;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.credential_name}),(0,c.jsx)(sy.Z,{children:f((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,c.jsx)(sy.Z,{children:(null===(l=e.credential_info)||void 0===l?void 0:l.description)||"-"}),(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(_.Z,{icon:sF.Z,variant:"light",size:"sm",onClick:()=>{u(e),o(!0)}}),(0,c.jsx)(_.Z,{icon:el.Z,variant:"light",size:"sm",onClick:()=>v(e.credential_name)})]})]},s)}):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),(0,c.jsx)(_.Z,{onClick:()=>i(!0),className:"mt-4",children:"Add Credential"}),r&&(0,c.jsx)(sG,{onAddCredential:j,isVisible:r,onCancel:()=>i(!1),uploadProps:t,addOrEdit:"add",onUpdateCredential:p,existingCredential:null}),n&&(0,c.jsx)(sG,{onAddCredential:j,isVisible:n,existingCredential:m,onUpdateCredential:p,uploadProps:t,onCancel:()=>o(!1),addOrEdit:"edit"})]})};let sJ=e=>{var s;return(null==e?void 0:null===(s=e.model_info)||void 0===s?void 0:s.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var sY=t(53003),sW=e=>{let{value:s,onValueChange:t,label:l="Select Time Range",className:a="",showTimeRange:r=!0}=e;return(0,c.jsxs)("div",{className:a,children:[l&&(0,c.jsx)(w.Z,{className:"mb-2",children:l}),(0,c.jsx)(sY.Z,{enableSelect:!0,value:s,onValueChange:e=>{if(e.from){let s;let l={...e},a=new Date(e.from);s=new Date(e.to?e.to:e.from),a.toDateString(),s.toDateString(),a.setHours(0,0,0,0),s.setHours(23,59,59,999),l.from=a,l.to=s,t(l)}else t(e)}}),r&&s.from&&s.to&&(0,c.jsx)(w.Z,{className:"mt-1 text-xs text-gray-500",children:((e,s)=>{if(!e||!s)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==s.toDateString())return"".concat(t(e)," - ").concat(t(s));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),l=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(l," - ").concat(a)}})(s.from,s.to)})]})},s$=t(75105),sQ=t(40278),sX=t(14301),s0=t(59664),s1=e=>{let{modelMetrics:s,modelMetricsCategories:t,customTooltip:l,premiumUser:a}=e;return(0,c.jsx)(s0.Z,{title:"Time to First token (s)",className:"h-72",data:s,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:l})},s2=e=>{let{teamData:s,canEditTeam:t,handleMemberDelete:l,setSelectedEditMember:a,setIsEditMemberModalVisible:r,setIsAddMemberModalVisible:i}=e,n=e=>{if(null==e)return"0";if("number"==typeof e){let s=Number(e);return s===Math.floor(s)?s.toString():eR(s,8).replace(/\.?0+$/,"")}return"0"},o=e=>{if(!e)return 0;let t=s.team_memberships.find(s=>s.user_id===e);return(null==t?void 0:t.spend)||0},d=e=>{var t;if(!e)return null;let l=s.team_memberships.find(s=>s.user_id===e);console.log("membership=".concat(l));let a=null==l?void 0:null===(t=l.litellm_budget_table)||void 0===t?void 0:t.max_budget;return null==a?null:n(a)};return(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(X.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"User ID"}),(0,c.jsx)(sN.Z,{children:"User Email"}),(0,c.jsx)(sN.Z,{children:"Role"}),(0,c.jsxs)(sN.Z,{children:["Team Member Spend (USD)"," ",(0,c.jsx)(z.Z,{title:"This is the amount spent by a user in the team.",children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(sN.Z,{children:"Team Member Budget (USD)"}),(0,c.jsx)(sN.Z,{})]})}),(0,c.jsx)(s_.Z,{children:s.team_info.members_with_roles.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_id})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.role})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{className:"font-mono",children:["$",eR(o(e.user_id),4)]})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:d(e.user_id)?"$".concat(eR(Number(d(e.user_id)),4)):"No Limit"})}),(0,c.jsx)(sy.Z,{children:t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{a(e),r(!0)}}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>l(e)})]})})]},s))})]})}),(0,c.jsx)(_.Z,{onClick:()=>i(!0),children:"Add Member"})]})},s4=t(61994),s5=t(85180),s6=t(89245),s3=t(78355);let s8={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team"},s7=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",s9=e=>{let s=s7(e),t=s8[e];if(!t){for(let[s,l]of Object.entries(s8))if(e.includes(s)){t=l;break}}return t||(t="Access ".concat(e)),{method:s,endpoint:e,description:t,route:e}};var te=e=>{let{teamId:s,accessToken:t,canEditTeam:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)([]),[o,m]=(0,d.useState)(!0),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),j=async()=>{try{if(m(!0),!t)return;let e=await (0,g.getTeamPermissionsCall)(t,s),l=e.all_available_permissions||[];r(l);let a=e.team_member_permissions||[];n(a),p(!1)}catch(e){P.ZP.error("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{m(!1)}};(0,d.useEffect)(()=>{j()},[s,t]);let f=(e,s)=>{n(s?[...i,e]:i.filter(s=>s!==e)),p(!0)},v=async()=>{try{if(!t)return;x(!0),await (0,g.teamPermissionsUpdateCall)(t,s,i),P.ZP.success("Permissions updated successfully"),p(!1)}catch(e){P.ZP.error("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(o)return(0,c.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let y=a.length>0;return(0,c.jsxs)(X.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,c.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,c.jsx)(k.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),l&&h&&(0,c.jsxs)("div",{className:"flex gap-3",children:[(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(s6.Z,{}),onClick:()=>{j()},children:"Reset"}),(0,c.jsxs)(_.Z,{onClick:v,loading:u,className:"flex items-center gap-2",children:[(0,c.jsx)(s3.Z,{})," Save Changes"]})]})]}),(0,c.jsx)(w.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),y?(0,c.jsxs)(sv.Z,{className:"mt-4",children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Method"}),(0,c.jsx)(sN.Z,{children:"Endpoint"}),(0,c.jsx)(sN.Z,{children:"Description"}),(0,c.jsx)(sN.Z,{className:"text-right",children:"Access"})]})}),(0,c.jsx)(s_.Z,{children:a.map(e=>{let s=s9(e);return(0,c.jsxs)(sZ.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===s.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:s.method})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)("span",{className:"font-mono text-sm text-gray-800",children:s.endpoint})}),(0,c.jsx)(sy.Z,{className:"text-gray-700",children:s.description}),(0,c.jsx)(sy.Z,{className:"text-right",children:(0,c.jsx)(s4.Z,{checked:i.includes(e),onChange:s=>f(e,s.target.checked),disabled:!l})})]},e)})})]}):(0,c.jsx)("div",{className:"py-12",children:(0,c.jsx)(s5.Z,{description:"No permissions available"})})]})},ts=e=>{var s,t,l;let{visible:a,onCancel:r,onSubmit:i,initialData:n,mode:o,config:m}=e,[u]=I.Z.useForm();console.log("Initial Data:",n),(0,d.useEffect)(()=>{if(a){if("edit"===o&&n)u.setFieldsValue({...n,role:n.role||m.defaultRole});else{var e;u.resetFields(),u.setFieldsValue({role:m.defaultRole||(null===(e=m.roleOptions[0])||void 0===e?void 0:e.value)})}}},[a,n,o,u,m.defaultRole,m.roleOptions]);let x=async e=>{try{let s=Object.entries(e).reduce((e,s)=>{let[t,l]=s;return{...e,[t]:"string"==typeof l?l.trim():l}},{});i(s),u.resetFields()}catch(e){console.error("Form submission error:",e)}},h=e=>{switch(e.type){case"input":return(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",onChange:e=>{e.target.value=e.target.value.trim()}});case"select":var s;return(0,c.jsx)(C.default,{children:null===(s=e.options)||void 0===s?void 0:s.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))});default:return null}};return(0,c.jsx)(E.Z,{title:m.title||("add"===o?"Add Member":"Edit Member"),open:a,width:800,footer:null,onCancel:r,children:(0,c.jsxs)(I.Z,{form:u,onFinish:x,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[m.showEmail&&(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",placeholder:"[email protected]",onChange:e=>{e.target.value=e.target.value.trim()}})}),m.showEmail&&m.showUserId&&(0,c.jsx)("div",{className:"text-center mb-4",children:(0,c.jsx)(w.Z,{children:"OR"})}),m.showUserId&&(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,c.jsx)(L.default,{className:"px-3 py-2 border rounded-md w-full",placeholder:"user_123",onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{children:"Role"}),"edit"===o&&n&&(0,c.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(t=n.role,(null===(l=m.roleOptions.find(e=>e.value===t))||void 0===l?void 0:l.label)||t),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,c.jsx)(C.default,{children:"edit"===o&&n?[...m.roleOptions.filter(e=>e.value===n.role),...m.roleOptions.filter(e=>e.value!==n.role)].map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value)):m.roleOptions.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:e.label},e.value))})}),null===(s=m.additionalFields)||void 0===s?void 0:s.map(e=>(0,c.jsx)(I.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:h(e)},e.name)),(0,c.jsxs)("div",{className:"text-right mt-6",children:[(0,c.jsx)(T.ZP,{onClick:r,className:"mr-2",children:"Cancel"}),(0,c.jsx)(T.ZP,{type:"default",htmlType:"submit",children:"add"===o?"Add Member":"Save Changes"})]})]})})},tt=e=>{let{isVisible:s,onCancel:t,onSubmit:l,accessToken:a,title:r="Add Team Member",roles:i=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:n="user"}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)("user_email"),f=async(e,s)=>{if(!e){u([]);return}h(!0);try{let t=new URLSearchParams;if(t.append(s,e),null==a)return;let l=(await (0,g.userFilterUICall)(a,t)).map(e=>({label:"user_email"===s?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===s?e.user_email:e.user_id,user:e}));u(l)}catch(e){console.error("Error fetching users:",e)}finally{h(!1)}},v=(0,d.useCallback)(eT()((e,s)=>f(e,s),300),[]),_=(e,s)=>{j(s),v(e,s)},y=(e,s)=>{let t=s.user;o.setFieldsValue({user_email:t.user_email,user_id:t.user_id,role:o.getFieldValue("role")})};return(0,c.jsx)(E.Z,{title:r,open:s,onCancel:()=>{o.resetFields(),u([]),t()},footer:null,width:800,children:(0,c.jsxs)(I.Z,{form:o,onFinish:l,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:n},children:[(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>_(e,"user_email"),onSelect:(e,s)=>y(e,s),options:"user_email"===p?m:[],loading:x,allowClear:!0})}),(0,c.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,c.jsx)(C.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>_(e,"user_id"),onSelect:(e,s)=>y(e,s),options:"user_id"===p?m:[],loading:x,allowClear:!0})}),(0,c.jsx)(I.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,c.jsx)(C.default,{defaultValue:n,children:i.map(e=>(0,c.jsx)(C.default.Option,{value:e.value,children:(0,c.jsxs)(z.Z,{title:e.description,children:[(0,c.jsx)("span",{className:"font-medium",children:e.label}),(0,c.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,c.jsx)("div",{className:"text-right mt-4",children:(0,c.jsx)(T.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})},tl=e=>{var s,t,l,a,r,i,n,o,m,u,x;let{teamId:h,onClose:p,accessToken:j,is_team_admin:f,is_proxy_admin:b,userModels:N,editTeam:Z,premiumUser:S=!1,onUpdate:E}=e,[A,O]=(0,d.useState)(null),[D,R]=(0,d.useState)(!0),[q,V]=(0,d.useState)(!1),[K]=I.Z.useForm(),[B,G]=(0,d.useState)(!1),[J,W]=(0,d.useState)(null),[$,Q]=(0,d.useState)(!1),[ee,es]=(0,d.useState)([]),[et,el]=(0,d.useState)(!1),[ea,er]=(0,d.useState)({}),[ei,en]=(0,d.useState)([]);console.log("userModels in team info",N);let eo=f||b,ec=async()=>{try{if(R(!0),!j)return;let e=await (0,g.teamInfoCall)(j,h);O(e)}catch(e){P.ZP.error("Failed to load team information"),console.error("Error fetching team info:",e)}finally{R(!1)}};(0,d.useEffect)(()=>{ec()},[h,j]),(0,d.useEffect)(()=>{(async()=>{try{if(!j)return;let e=(await (0,g.getGuardrailsList)(j)).guardrails.map(e=>e.guardrail_name);en(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[j]);let ed=async e=>{try{if(null==j)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.teamMemberAddCall)(j,h,s),P.ZP.success("Team member added successfully"),V(!1),K.resetFields();let t=await (0,g.teamInfoCall)(j,h);O(t),E(t)}catch(a){var s,t,l;let e="Failed to add team member";(null==a?void 0:null===(l=a.raw)||void 0===l?void 0:null===(t=l.detail)||void 0===t?void 0:null===(s=t.error)||void 0===s?void 0:s.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==a?void 0:a.message)&&(e=a.message),P.ZP.error(e),console.error("Error adding team member:",a)}},em=async e=>{try{if(null==j)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};P.ZP.destroy(),await (0,g.teamMemberUpdateCall)(j,h,s),P.ZP.success("Team member updated successfully"),G(!1);let t=await (0,g.teamInfoCall)(j,h);O(t),E(t)}catch(l){var s,t;let e="Failed to update team member";(null==l?void 0:null===(t=l.raw)||void 0===t?void 0:null===(s=t.detail)||void 0===s?void 0:s.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==l?void 0:l.message)&&(e=l.message),G(!1),P.ZP.destroy(),P.ZP.error(e),console.error("Error updating team member:",l)}},eu=async e=>{try{if(null==j)return;await (0,g.teamMemberDeleteCall)(j,h,e),P.ZP.success("Team member removed successfully");let s=await (0,g.teamInfoCall)(j,h);O(s),E(s)}catch(e){P.ZP.error("Failed to remove team member"),console.error("Error removing team member:",e)}},ex=async e=>{try{if(!j)return;let s={};try{s=e.metadata?JSON.parse(e.metadata):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={team_id:h,team_alias:e.team_alias,models:e.models,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...s,guardrails:e.guardrails||[],logging:e.logging_settings||[]},organization_id:e.organization_id};void 0!==e.team_member_budget&&(t.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(t.team_member_key_duration=e.team_member_key_duration);let{servers:l,accessGroups:a}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};(l&&l.length>0||a&&a.length>0)&&(t.object_permission={},l&&l.length>0&&(t.object_permission.mcp_servers=l),a&&a.length>0&&(t.object_permission.mcp_access_groups=a)),delete e.mcp_servers_and_groups,await (0,g.teamUpdateCall)(j,t),P.ZP.success("Team settings updated successfully"),Q(!1),ec()}catch(e){console.error("Error updating team:",e)}};if(D)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==A?void 0:A.team_info))return(0,c.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:eh}=A,ep=async(e,s)=>{await eq(e)&&(er(e=>({...e,[s]:!0})),setTimeout(()=>{er(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:p,className:"mb-4",children:"Back to Teams"}),(0,c.jsx)(k.Z,{children:eh.team_alias}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:eh.team_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:ea["team-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>ep(eh.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(ea["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:Z?3:0,children:[(0,c.jsx)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"},"overview"),...eo?[(0,c.jsx)(eW.Z,{children:"Members"},"members"),(0,c.jsx)(eW.Z,{children:"Member Permissions"},"member-permissions"),(0,c.jsx)(eW.Z,{children:"Settings"},"settings")]:[]]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Budget Status"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eR(eh.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null===eh.max_budget?"Unlimited":"$".concat(eR(eh.max_budget,4))]}),eh.budget_duration&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Reset: ",eh.budget_duration]}),(0,c.jsx)("br",{}),eh.team_member_budget_table&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Team Member Budget: $",eR(eh.team_member_budget_table.max_budget,4)]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",eh.tpm_limit||"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",eh.rpm_limit||"Unlimited"]}),eh.max_parallel_requests&&(0,c.jsxs)(w.Z,{children:["Max Parallel Requests: ",eh.max_parallel_requests]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===eh.models.length?(0,c.jsx)(eY.Z,{color:"red",children:"All proxy models"}):eh.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["User Keys: ",A.keys.filter(e=>e.user_id).length]}),(0,c.jsxs)(w.Z,{children:["Service Account Keys: ",A.keys.filter(e=>!e.user_id).length]}),(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Total: ",A.keys.length]})]})]}),(0,c.jsx)(sa,{objectPermission:eh.object_permission,variant:"card",accessToken:j}),(0,c.jsx)(sr,{loggingConfigs:(null===(s=eh.metadata)||void 0===s?void 0:s.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(s2,{teamData:A,canEditTeam:eo,handleMemberDelete:eu,setSelectedEditMember:W,setIsEditMemberModalVisible:G,setIsAddMemberModalVisible:V})}),eo&&(0,c.jsx)(eX.Z,{children:(0,c.jsx)(te,{teamId:h,accessToken:j,canEditTeam:eo})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Team Settings"}),eo&&!$&&(0,c.jsx)(_.Z,{onClick:()=>Q(!0),children:"Edit Settings"})]}),$?(0,c.jsxs)(I.Z,{form:K,onFinish:ex,initialValues:{...eh,team_alias:eh.team_alias,models:eh.models,tpm_limit:eh.tpm_limit,rpm_limit:eh.rpm_limit,max_budget:eh.max_budget,budget_duration:eh.budget_duration,guardrails:(null===(t=eh.metadata)||void 0===t?void 0:t.guardrails)||[],metadata:eh.metadata?JSON.stringify((e=>{let{logging:s,...t}=e;return t})(eh.metadata),null,2):"",logging_settings:(null===(l=eh.metadata)||void 0===l?void 0:l.logging)||[],organization_id:eh.organization_id,vector_stores:(null===(a=eh.object_permission)||void 0===a?void 0:a.vector_stores)||[],mcp_servers:(null===(r=eh.object_permission)||void 0===r?void 0:r.mcp_servers)||[],mcp_access_groups:(null===(i=eh.object_permission)||void 0===i?void 0:i.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(n=eh.object_permission)||void 0===n?void 0:n.mcp_servers)||[],accessGroups:(null===(o=eh.object_permission)||void 0===o?void 0:o.mcp_access_groups)||[]}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,c.jsx)(L.default,{type:""})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),Array.from(new Set(N)).map((e,s)=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},s))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Setup your first guardrail",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",placeholder:"Select or enter guardrails",options:ei.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>K.setFieldValue("vector_stores",e),value:K.getFieldValue("vector_stores"),accessToken:j||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(Y,{onChange:e=>K.setFieldValue("mcp_servers_and_groups",e),value:K.getFieldValue("mcp_servers_and_groups"),accessToken:j||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,c.jsx)(L.default,{type:""})}),(0,c.jsx)(I.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,c.jsx)(e4,{value:K.getFieldValue("logging_settings"),onChange:e=>K.setFieldValue("logging_settings",e)})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:10})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{htmlType:"button",onClick:()=>Q(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team Name"}),(0,c.jsx)("div",{children:eh.team_alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)("div",{className:"font-mono",children:eh.team_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:new Date(eh.created_at).toLocaleString()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eh.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)("div",{children:["TPM: ",eh.tpm_limit||"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",eh.rpm_limit||"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team Budget"}),(0,c.jsxs)("div",{children:["Max Budget:"," ",null!==eh.max_budget?"$".concat(eR(eh.max_budget,4)):"No Limit"]}),(0,c.jsxs)("div",{children:["Budget Reset: ",eh.budget_duration||"Never"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Team Member Settings"," ",(0,c.jsx)(z.Z,{title:"These are limits on individual team members",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),(0,c.jsxs)("div",{children:["Max Budget:"," ",(null===(m=eh.team_member_budget_table)||void 0===m?void 0:m.max_budget)||"No Limit"]}),(0,c.jsxs)("div",{children:["Key Duration:"," ",(null===(u=eh.metadata)||void 0===u?void 0:u.team_member_key_duration)||"No Limit"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization ID"}),(0,c.jsx)("div",{children:eh.organization_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Status"}),(0,c.jsx)(eY.Z,{color:eh.blocked?"red":"green",children:eh.blocked?"Blocked":"Active"})]}),(0,c.jsx)(sa,{objectPermission:eh.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:j}),(0,c.jsx)(sr,{loggingConfigs:(null===(x=eh.metadata)||void 0===x?void 0:x.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,c.jsx)(ts,{visible:B,onCancel:()=>G(!1),onSubmit:em,initialData:J,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}]}}),(0,c.jsx)(tt,{isVisible:q,onCancel:()=>V(!1),onSubmit:ed,accessToken:j})]})},ta=t(45589);let{Title:tr,Link:ti}=eh.default;var tn=e=>{let{isVisible:s,onCancel:t,onAddCredential:l,existingCredential:a,setIsCredentialModalOpen:r}=e,[i]=I.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(a))),(0,c.jsx)(E.Z,{title:"Reuse Credentials",visible:s,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,c.jsxs)(I.Z,{form:i,onFinish:e=>{l(e),i.resetFields(),r(!1)},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==a?void 0:a.credential_name,children:(0,c.jsx)(y.Z,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==a?void 0:a.credential_values)||{}).map(e=>{let[s,t]=e;return(0,c.jsx)(I.Z.Item,{label:s,name:s,initialValue:t,children:(0,c.jsx)(y.Z,{placeholder:"Enter ".concat(s),disabled:!0})},s)}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(ti,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})},to=t(63709),tc=t(45246),td=t(96473);let{Text:tm}=eh.default;var tu=e=>{let{form:s,showCacheControl:t,onCacheControlChange:l}=e,a=e=>{let t=s.getFieldValue("litellm_extra_params");try{let l=t?JSON.parse(t):{};e.length>0?l.cache_control_injection_points=e:delete l.cache_control_injection_points,Object.keys(l).length>0?s.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):s.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,c.jsx)(to.Z,{onChange:l,className:"bg-gray-600"})}),t&&(0,c.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,c.jsx)(tm,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,c.jsx)(I.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:l,remove:r}=t;return(0,c.jsxs)(c.Fragment,{children:[e.map((t,l)=>(0,c.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,c.jsx)(I.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,c.jsx)(C.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,c.jsx)(I.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,c.jsx)(C.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{a(s.getFieldValue("cache_control_points"))}})}),(0,c.jsx)(I.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,c.jsx)(M,{type:"number",placeholder:"Optional",step:1,min:0,onChange:()=>{a(s.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,c.jsx)(tc.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{r(t.name),setTimeout(()=>{a(s.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,c.jsx)(I.Z.Item,{children:(0,c.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>l(),children:[(0,c.jsx)(td.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})};let tx=async e=>{try{let s=await (0,g.modelHubCall)(e);if(console.log("model_info:",s),(null==s?void 0:s.data.length)>0){let e=s.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,s)=>e.model_group.localeCompare(s.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}};var th=t(44851),tp=t(67960),tg=t(70464);let{TextArea:tj}=L.default,{Panel:tf}=th.default;var tv=e=>{let{modelInfo:s,value:t,onChange:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]);(0,d.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,s)=>({id:e.id||"route-".concat(s,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));r(e),m(e.map(e=>e.id))}else r([]),m([])},[t]);let u=e=>{let s=a.filter(s=>s.id!==e);r(s),h(s),m(s=>s.filter(s=>s!==e))},x=(e,s,t)=>{let l=a.map(l=>l.id===e?{...l,[s]:t}:l);r(l),h(l)},h=e=>{let s={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==l||l(s)},p=s.map(e=>({value:e.model_group,label:e.model_group}));return(0,c.jsxs)("div",{className:"w-full max-w-none",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,c.jsx)(z.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(T.ZP,{type:"primary",icon:(0,c.jsx)(td.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),s=[...a,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];r(s),h(s),m(s=>[...s,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===a.length?(0,c.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,c.jsx)(w.Z,{children:"No routes configured. Click “Add Route” to get started."})}):(0,c.jsx)("div",{className:"space-y-3 mb-6 w-full",children:a.map((e,s)=>(0,c.jsx)(tp.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,c.jsx)(th.default,{ghost:!0,expandIcon:e=>{let{isActive:s}=e;return(0,c.jsx)(tg.Z,{rotate:s?180:0})},activeKey:o,onChange:e=>m(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,c.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,c.jsxs)(w.Z,{className:"font-medium text-base",children:["Route ",s+1,": ",e.model||"Unnamed"]}),(0,c.jsx)(T.ZP,{type:"text",danger:!0,icon:(0,c.jsx)(ey.Z,{}),onClick:s=>{s.stopPropagation(),u(e.id)},className:"mr-2"})]}),children:(0,c.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,c.jsx)(C.default,{value:e.model,onChange:s=>x(e.id,"model",s),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,c.jsx)(tj,{value:e.description,onChange:s=>x(e.id,"description",s.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,c.jsxs)("div",{className:"mb-4 w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium",children:"Score Threshold"}),(0,c.jsx)(z.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(q.Z,{value:e.score_threshold,onChange:s=>x(e.id,"score_threshold",s||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,c.jsxs)("div",{className:"w-full",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium",children:"Example Utterances"}),(0,c.jsx)(z.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsx)(w.Z,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,c.jsx)(C.default,{mode:"tags",value:e.utterances,onChange:s=>x(e.id,"utterances",s),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,c.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,c.jsx)(T.ZP,{type:"link",onClick:()=>n(!i),className:"text-blue-600 p-0",children:i?"Hide":"Show"})]}),i&&(0,c.jsx)(tp.Z,{className:"bg-gray-50 w-full",children:(0,c.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:a.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})},t_=e=>{let{isVisible:s,onCancel:t,onSuccess:l,modelData:a,accessToken:r,userRole:i}=e,[n]=I.Z.useForm(),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)(!1),[v,_]=(0,d.useState)(!1),[b,N]=(0,d.useState)(null);(0,d.useEffect)(()=>{s&&a&&Z()},[s,a]),(0,d.useEffect)(()=>{let e=async()=>{if(r)try{let e=await (0,g.modelAvailableCall)(r,"","",!1,null,!0,!0);x(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(r)try{let e=await tx(r);p(e)}catch(e){console.error("Error fetching model info:",e)}};s&&(e(),t())},[s,r]);let Z=()=>{try{var e,s,t,l,r,i;let o=null;(null===(e=a.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(o="string"==typeof a.litellm_params.auto_router_config?JSON.parse(a.litellm_params.auto_router_config):a.litellm_params.auto_router_config),N(o),n.setFieldsValue({auto_router_name:a.model_name,auto_router_default_model:(null===(s=a.litellm_params)||void 0===s?void 0:s.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=a.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(l=a.model_info)||void 0===l?void 0:l.access_groups)||[]});let c=new Set(h.map(e=>e.model_group));f(!c.has(null===(r=a.litellm_params)||void 0===r?void 0:r.auto_router_default_model)),_(!c.has(null===(i=a.litellm_params)||void 0===i?void 0:i.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),P.ZP.error("Error loading auto router configuration")}},k=async()=>{try{m(!0);let e=await n.validateFields(),s={...a.litellm_params,auto_router_config:JSON.stringify(b),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},i={...a.model_info,access_groups:e.model_access_group||[]},o={model_name:e.auto_router_name,litellm_params:s,model_info:i};await (0,g.modelPatchUpdateCall)(r,o,a.model_info.id);let c={...a,model_name:e.auto_router_name,litellm_params:s,model_info:i};P.ZP.success("Auto router configuration updated successfully"),l(c),t()}catch(e){console.error("Error updating auto router:",e),P.ZP.error("Failed to update auto router configuration")}finally{m(!1)}},S=h.map(e=>({value:e.model_group,label:e.model_group}));return(0,c.jsx)(E.Z,{title:"Edit Auto Router Configuration",open:s,onCancel:t,footer:[(0,c.jsx)(T.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,c.jsx)(T.ZP,{loading:o,onClick:k,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsx)(w.Z,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,c.jsxs)(I.Z,{form:n,layout:"vertical",className:"space-y-4",children:[(0,c.jsx)(I.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,c.jsx)("div",{className:"w-full",children:(0,c.jsx)(tv,{modelInfo:h,value:b,onChange:e=>{N(e)}})}),(0,c.jsx)(I.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,c.jsx)(C.default,{placeholder:"Select a default model",onChange:e=>{f("custom"===e)},options:[...S,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,c.jsx)(I.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,c.jsx)(C.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{_("custom"===e)},options:[...S,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===i&&(0,c.jsx)(I.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:u.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};function ty(e){var s,t,l,a,r,i,n,o,m,u,x,h,p,j,f,b,N,Z,S,A,O,D,F,R,q,U;let{modelId:z,onClose:V,modelData:K,accessToken:B,userID:G,userRole:H,editModel:J,setEditModalVisible:Y,setSelectedModel:W,onModelUpdate:$,modelAccessGroups:Q}=e,[ee]=I.Z.useForm(),[es,et]=(0,d.useState)(null),[ea,er]=(0,d.useState)(!1),[ei,en]=(0,d.useState)(!1),[eo,ec]=(0,d.useState)(!1),[ed,em]=(0,d.useState)(!1),[eu,ex]=(0,d.useState)(!1),[eh,ep]=(0,d.useState)(null),[eg,ej]=(0,d.useState)(!1),[ef,ev]=(0,d.useState)({}),[e_,ey]=(0,d.useState)(!1),eb="Admin"===H||(null==K?void 0:null===(s=K.model_info)||void 0===s?void 0:s.created_by)===G,eN=(null==K?void 0:null===(t=K.litellm_params)||void 0===t?void 0:t.auto_router_config)!=null,eZ=(null==K?void 0:null===(l=K.litellm_params)||void 0===l?void 0:l.litellm_credential_name)!=null&&(null==K?void 0:null===(a=K.litellm_params)||void 0===a?void 0:a.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eZ),console.log("modelData.litellm_params.litellm_credential_name, ",null==K?void 0:null===(r=K.litellm_params)||void 0===r?void 0:r.litellm_credential_name),(0,d.useEffect)(()=>{let e=async()=>{var e;if(!B)return;let s=await (0,g.modelInfoV1Call)(B,z);console.log("modelInfoResponse, ",s);let t=s.data[0];et(t),(null==t?void 0:null===(e=t.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&ej(!0)};(async()=>{if(console.log("accessToken, ",B),!B||eZ)return;let e=await (0,g.credentialGetCall)(B,null,z);console.log("existingCredentialResponse, ",e),ep({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e()},[B,z]);let ew=async e=>{var s;if(console.log("values, ",e),!B)return;let t={credential_name:e.credential_name,model_id:z,credential_info:{custom_llm_provider:null===(s=es.litellm_params)||void 0===s?void 0:s.custom_llm_provider}};P.ZP.info("Storing credential.."),console.log("credentialResponse, ",await (0,g.credentialCreateCall)(B,t)),P.ZP.success("Credential stored successfully")},ek=async e=>{try{var s;let t;if(!B)return;em(!0),console.log("values.model_name, ",e.model_name);let l={...es.litellm_params,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6};e.cache_control&&(null===(s=e.cache_control_injection_points)||void 0===s?void 0:s.length)>0?l.cache_control_injection_points=e.cache_control_injection_points:delete l.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):K.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){P.ZP.error("Invalid JSON in Model Info");return}let a={model_name:e.model_name,litellm_params:l,model_info:t};await (0,g.modelPatchUpdateCall)(B,a,z);let r={...es,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:l,model_info:t};et(r),$&&$(r),P.ZP.success("Model settings updated successfully"),ec(!1),ex(!1)}catch(e){console.error("Error updating model:",e),P.ZP.error("Failed to update model settings")}finally{em(!1)}};if(!K)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:V,className:"mb-4",children:"Back to Models"}),(0,c.jsx)(w.Z,{children:"Model not found"})]});let eS=async()=>{try{if(!B)return;await (0,g.modelDeleteCall)(B,z),P.ZP.success("Model deleted successfully"),$&&$({deleted:!0,model_info:{id:z}}),V()}catch(e){console.error("Error deleting the model:",e),P.ZP.error("Failed to delete model")}},eC=async(e,s)=>{await eq(e)&&(ev(e=>({...e,[s]:!0})),setTimeout(()=>{ev(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:V,className:"mb-4",children:"Back to Models"}),(0,c.jsxs)(k.Z,{children:["Public Model Name: ",sJ(K)]}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:K.model_info.id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:ef["model-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>eC(K.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(ef["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{className:"flex gap-2",children:["Admin"===H&&(0,c.jsx)(_.Z,{icon:ta.Z,variant:"secondary",onClick:()=>en(!0),className:"flex items-center",children:"Re-use Credentials"}),eb&&(0,c.jsx)(_.Z,{icon:el.Z,variant:"secondary",onClick:()=>er(!0),className:"flex items-center",children:"Delete Model"})]})]}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-6",children:[(0,c.jsx)(eW.Z,{children:"Overview"}),(0,c.jsx)(eW.Z,{children:"Raw JSON"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Provider"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[K.provider&&(0,c.jsx)("img",{src:(0,sO.dr)(K.provider).logo,alt:"".concat(K.provider," logo"),className:"w-4 h-4",onError:e=>{let s=e.target,t=s.parentElement;if(t){var l;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(l=K.provider)||void 0===l?void 0:l.charAt(0))||"-",t.replaceChild(e,s)}}}),(0,c.jsx)(k.Z,{children:K.provider||"Not Set"})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"LiteLLM Model"}),(0,c.jsx)("pre",{children:(0,c.jsx)(k.Z,{children:K.litellm_model_name||"Not Set"})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Pricing"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["Input: $",K.input_cost,"/1M tokens"]}),(0,c.jsxs)(w.Z,{children:["Output: $",K.output_cost,"/1M tokens"]})]})]})]}),(0,c.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,c.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",K.model_info.created_at?new Date(K.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,c.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",K.model_info.created_by||"Not Set"]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Model Settings"}),(0,c.jsxs)("div",{className:"flex gap-2",children:[eN&&eb&&!eu&&(0,c.jsx)(_.Z,{variant:"primary",onClick:()=>ey(!0),className:"flex items-center",children:"Edit Auto Router"}),eb&&!eu&&(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>ex(!0),className:"flex items-center",children:"Edit Model"})]})]}),es?(0,c.jsx)(I.Z,{form:ee,onFinish:ek,initialValues:{model_name:es.model_name,litellm_model_name:es.litellm_model_name,api_base:es.litellm_params.api_base,custom_llm_provider:es.litellm_params.custom_llm_provider,organization:es.litellm_params.organization,tpm:es.litellm_params.tpm,rpm:es.litellm_params.rpm,max_retries:es.litellm_params.max_retries,timeout:es.litellm_params.timeout,stream_timeout:es.litellm_params.stream_timeout,input_cost:es.litellm_params.input_cost_per_token?1e6*es.litellm_params.input_cost_per_token:(null===(i=es.model_info)||void 0===i?void 0:i.input_cost_per_token)*1e6||null,output_cost:(null===(n=es.litellm_params)||void 0===n?void 0:n.output_cost_per_token)?1e6*es.litellm_params.output_cost_per_token:(null===(o=es.model_info)||void 0===o?void 0:o.output_cost_per_token)*1e6||null,cache_control:null!==(m=es.litellm_params)&&void 0!==m&&!!m.cache_control_injection_points,cache_control_injection_points:(null===(u=es.litellm_params)||void 0===u?void 0:u.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(x=es.model_info)||void 0===x?void 0:x.access_groups)?es.model_info.access_groups:[]},layout:"vertical",onValuesChange:()=>ec(!0),children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Name"}),eu?(0,c.jsx)(I.Z.Item,{name:"model_name",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter model name"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:es.model_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eu?(0,c.jsx)(I.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter LiteLLM model name"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:es.litellm_model_name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eu?(0,c.jsx)(I.Z.Item,{name:"input_cost",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter input cost"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==es?void 0:null===(h=es.litellm_params)||void 0===h?void 0:h.input_cost_per_token)?((null===(p=es.litellm_params)||void 0===p?void 0:p.input_cost_per_token)*1e6).toFixed(4):(null==es?void 0:null===(j=es.model_info)||void 0===j?void 0:j.input_cost_per_token)?(1e6*es.model_info.input_cost_per_token).toFixed(4):null})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eu?(0,c.jsx)(I.Z.Item,{name:"output_cost",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter output cost"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==es?void 0:null===(f=es.litellm_params)||void 0===f?void 0:f.output_cost_per_token)?(1e6*es.litellm_params.output_cost_per_token).toFixed(4):(null==es?void 0:null===(b=es.model_info)||void 0===b?void 0:b.output_cost_per_token)?(1e6*es.model_info.output_cost_per_token).toFixed(4):null})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"API Base"}),eu?(0,c.jsx)(I.Z.Item,{name:"api_base",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter API base"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(N=es.litellm_params)||void 0===N?void 0:N.api_base)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Custom LLM Provider"}),eu?(0,c.jsx)(I.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter custom LLM provider"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(Z=es.litellm_params)||void 0===Z?void 0:Z.custom_llm_provider)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization"}),eu?(0,c.jsx)(I.Z.Item,{name:"organization",className:"mb-0",children:(0,c.jsx)(y.Z,{placeholder:"Enter organization"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(S=es.litellm_params)||void 0===S?void 0:S.organization)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eu?(0,c.jsx)(I.Z.Item,{name:"tpm",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter TPM"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(A=es.litellm_params)||void 0===A?void 0:A.tpm)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eu?(0,c.jsx)(I.Z.Item,{name:"rpm",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter RPM"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(O=es.litellm_params)||void 0===O?void 0:O.rpm)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Max Retries"}),eu?(0,c.jsx)(I.Z.Item,{name:"max_retries",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter max retries"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=es.litellm_params)||void 0===D?void 0:D.max_retries)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Timeout (seconds)"}),eu?(0,c.jsx)(I.Z.Item,{name:"timeout",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter timeout"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(F=es.litellm_params)||void 0===F?void 0:F.timeout)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eu?(0,c.jsx)(I.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,c.jsx)(M,{placeholder:"Enter stream timeout"})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=es.litellm_params)||void 0===R?void 0:R.stream_timeout)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Access Groups"}),eu?(0,c.jsx)(I.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==Q?void 0:Q.map(e=>({value:e,label:e}))})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=es.model_info)||void 0===q?void 0:q.access_groups)?Array.isArray(es.model_info.access_groups)?es.model_info.access_groups.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:es.model_info.access_groups.map((e,s)=>(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},s))}):"No groups assigned":es.model_info.access_groups:"Not Set"})]}),eu?(0,c.jsx)(tu,{form:ee,showCacheControl:eg,onCacheControlChange:e=>ej(e)}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cache Control"}),(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(U=es.litellm_params)||void 0===U?void 0:U.cache_control_injection_points)?(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"Enabled"}),(0,c.jsx)("div",{className:"mt-2",children:es.litellm_params.cache_control_injection_points.map((e,s)=>(0,c.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,c.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,c.jsxs)("span",{children:[" Index: ",e.index]})]},s))})]}):"Disabled"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Model Info"}),eu?(0,c.jsx)(I.Z.Item,{name:"model_info",className:"mb-0",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify(K.model_info,null,2)})}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(es.model_info,null,2)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Team ID"}),(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:K.model_info.team_id||"Not Set"})]})]}),eu&&(0,c.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{ee.resetFields(),ec(!1),ex(!1)},children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",onClick:()=>ee.submit(),loading:ed,children:"Save Changes"})]})]})}):(0,c.jsx)(w.Z,{children:"Loading..."})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(X.Z,{children:(0,c.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify(K,null,2)})})})]})]}),ea&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Model"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this model?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(T.ZP,{onClick:eS,className:"ml-2",danger:!0,children:"Delete"}),(0,c.jsx)(T.ZP,{onClick:()=>er(!1),children:"Cancel"})]})]})]})}),ei&&!eZ?(0,c.jsx)(tn,{isVisible:ei,onCancel:()=>en(!1),onAddCredential:ew,existingCredential:eh,setIsCredentialModalOpen:en}):(0,c.jsx)(E.Z,{open:ei,onCancel:()=>en(!1),title:"Using Existing Credential",children:(0,c.jsx)(w.Z,{children:K.litellm_params.litellm_credential_name})}),(0,c.jsx)(t_,{isVisible:e_,onCancel:()=>ey(!1),onSuccess:e=>{et(e),$&&$(e)},modelData:es||K,accessToken:B||"",userRole:H||""})]})}var tb=e=>{let{selectedProvider:s,providerModels:t,getPlaceholder:l}=e,a=I.Z.useFormInstance(),r=e=>{let s=e.target.value,t=(a.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?{public_name:s,litellm_model:s}:e);a.setFieldsValue({model_mappings:t})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(I.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"Actual model name used for making litellm.completion() / litellm.embedding() call.",className:"mb-0",children:[(0,c.jsx)(I.Z.Item,{name:"model",rules:[{required:!0,message:"Please select at least one model."}],noStyle:!0,children:s===sO.Cl.Azure||s===sO.Cl.OpenAI_Compatible||s===sO.Cl.Ollama?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(y.Z,{placeholder:l(s)})}):t.length>0?(0,c.jsx)(C.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let s=Array.isArray(e)?e:[e];if(s.includes("all-wildcard"))a.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(a.getFieldValue("model"))!==JSON.stringify(s)){let e=s.map(e=>({public_name:e,litellm_model:e}));a.setFieldsValue({model:s,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(s," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,c.jsx)(y.Z,{placeholder:l(s)})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.model!==s.model,children:e=>{let{getFieldValue:s}=e,t=s("model")||[];return(Array.isArray(t)?t:[t]).includes("custom")&&(0,c.jsx)(I.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,c.jsx)(y.Z,{placeholder:"Enter custom model name",onChange:r})})}})]}),(0,c.jsxs)(sR.Z,{children:[(0,c.jsx)(sq.Z,{span:10}),(0,c.jsx)(sq.Z,{span:10,children:(0,c.jsx)(w.Z,{className:"mb-3 mt-1",children:"Actual model name used for making litellm.completion() call. We loadbalance models with the same public name"})})]})]})},tN=()=>{let e=I.Z.useFormInstance(),[s,t]=(0,d.useState)(0),l=I.Z.useWatch("model",e)||[],a=Array.isArray(l)?l:[l],r=I.Z.useWatch("custom_model_name",e),i=!a.includes("all-wildcard");if((0,d.useEffect)(()=>{if(r&&a.includes("custom")){let s=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?{public_name:r,litellm_model:r}:e);e.setFieldValue("model_mappings",s),t(e=>e+1)}},[r,a,e]),(0,d.useEffect)(()=>{if(a.length>0&&!a.includes("all-wildcard")){let s=e.getFieldValue("model_mappings")||[];if(s.length!==a.length||!a.every(e=>s.some(s=>"custom"===e?"custom"===s.litellm_model||s.litellm_model===r:s.litellm_model===e))){let s=a.map(e=>"custom"===e&&r?{public_name:r,litellm_model:r}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",s),t(e=>e+1)}}},[a,r,e]),!i)return null;let n=[{title:"Public Name",dataIndex:"public_name",key:"public_name",render:(s,t,l)=>(0,c.jsx)(y.Z,{value:s,onChange:s=>{let t=[...e.getFieldValue("model_mappings")];t[l].public_name=s.target.value,e.setFieldValue("model_mappings",t)}})},{title:"LiteLLM Model",dataIndex:"litellm_model",key:"litellm_model"}];return(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(I.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",required:!0,children:(0,c.jsx)(ej.Z,{dataSource:e.getFieldValue("model_mappings"),columns:n,pagination:!1,size:"small"},s)})})},tZ=t(90464);let{Link:tw}=eh.default;var tk=e=>{let{showAdvancedSettings:s,setShowAdvancedSettings:t,teams:l}=e,[a]=I.Z.useForm(),[r,i]=d.useState(!1),[n,o]=d.useState("per_token"),[m,u]=d.useState(!1),x=(e,s)=>s&&(isNaN(Number(s))||0>Number(s))?Promise.reject("Please enter a valid positive number"):Promise.resolve(),h=(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}};return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(b.Z,{className:"mt-2 mb-4",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Advanced Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,c.jsx)(I.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,c.jsx)(to.Z,{onChange:e=>{i(e),e||a.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),r&&(0,c.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,c.jsx)(I.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,c.jsx)(C.default,{defaultValue:"per_token",onChange:e=>o(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,c.jsx)(y.Z,{})})]}):(0,c.jsx)(I.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:x}],className:"mb-4",children:(0,c.jsx)(y.Z,{})})]}),(0,c.jsx)(I.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,c.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,c.jsx)(tw,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,c.jsx)(to.Z,{onChange:e=>{let s=a.getFieldValue("litellm_extra_params");try{let t=s?JSON.parse(s):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?a.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):a.setFieldValue("litellm_extra_params","")}catch(s){e?a.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):a.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,c.jsx)(tu,{form:a,showCacheControl:m,onCacheControlChange:e=>{if(u(e),!e){let e=a.getFieldValue("litellm_extra_params");try{let s=e?JSON.parse(e):{};delete s.cache_control_injection_points,Object.keys(s).length>0?a.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):a.setFieldValue("litellm_extra_params","")}catch(e){a.setFieldValue("litellm_extra_params","")}}}}),(0,c.jsx)(I.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:h}],children:(0,c.jsx)(tZ.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,c.jsxs)(sR.Z,{className:"mb-4",children:[(0,c.jsx)(sq.Z,{span:10}),(0,c.jsx)(sq.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,c.jsx)(tw,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,c.jsx)(I.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:h}],children:(0,c.jsx)(tZ.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},tS=t(29),tC=t.n(tS),tI=t(23639);let{Text:tP}=eh.default;var tE=e=>{let{formValues:s,accessToken:t,testMode:l,modelName:a="this model",onClose:r,onTestComplete:i}=e,[n,o]=d.useState(null),[m,u]=d.useState(null),[x,h]=d.useState(null),[p,j]=d.useState(!0),[f,v]=d.useState(!1),[_,y]=d.useState(!1),b=async()=>{j(!0),y(!1),o(null),u(null),h(null),v(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",s);let a=await sM(s,t,null);if(!a){console.log("No result from prepareModelAddRequest"),o("Failed to prepare model data. Please check your form inputs."),v(!1),j(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:i,modelName:n}=a[0],c=await (0,g.testConnectionRequest)(t,r,null==i?void 0:i.mode);if("success"===c.status)P.ZP.success("Connection test successful!"),o(null),v(!0);else{var e,l;let s=(null===(e=c.result)||void 0===e?void 0:e.error)||c.message||"Unknown error";o(s),u(r),h(null===(l=c.result)||void 0===l?void 0:l.raw_request_typed_dict),v(!1)}}catch(e){console.error("Test connection error:",e),o(e instanceof Error?e.message:String(e)),v(!1)}finally{j(!1),i&&i()}};d.useEffect(()=>{let e=setTimeout(()=>{b()},200);return()=>clearTimeout(e)},[]);let N=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",Z="string"==typeof n?N(n):(null==n?void 0:n.message)?N(n.message):"Unknown error",w=x?((e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")})(x.raw_request_api_base,x.raw_request_body,x.raw_request_headers||{}):"";return(0,c.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[p?(0,c.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-776cdcbc0448e4ea",children:[(0,c.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-776cdcbc0448e4ea loading-spinner",children:(0,c.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-776cdcbc0448e4ea"})}),(0,c.jsxs)(tP,{style:{fontSize:"16px"},children:["Testing connection to ",a,"..."]}),(0,c.jsx)(tC(),{id:"776cdcbc0448e4ea",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):f?(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,c.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,c.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,c.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,c.jsxs)(tP,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",a," successful!"]})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,c.jsx)(eb.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,c.jsxs)(tP,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",a," failed"]})]}),(0,c.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,c.jsx)(tP,{strong:!0,style:{display:"block",marginBottom:"8px"},children:"Error: "}),(0,c.jsx)(tP,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:Z}),n&&(0,c.jsx)("div",{style:{marginTop:"12px"},children:(0,c.jsx)(T.ZP,{type:"link",onClick:()=>y(!_),style:{paddingLeft:0,height:"auto"},children:_?"Hide Details":"Show Details"})})]}),_&&(0,c.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,c.jsx)(tP,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,c.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof n?n:JSON.stringify(n,null,2)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(tP,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,c.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:w||"No request data available"}),(0,c.jsx)(T.ZP,{style:{marginTop:"8px"},icon:(0,c.jsx)(tI.Z,{}),onClick:()=>{navigator.clipboard.writeText(w||""),P.ZP.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,c.jsx)(Q.Z,{style:{margin:"24px 0 16px"}}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,c.jsx)(T.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,c.jsx)(U.Z,{}),children:"View Documentation"})})]})};let tA=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"}];var tT=t(92858);let tL=async(e,s,t,l)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",s?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",l?"Present":"Missing");let a={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:s?"Present":"Missing",config:a});let r=await (0,g.modelCreateCall)(s,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),P.ZP.error("Failed to add auto router: "+e,10)}},{Title:tO,Link:tM}=eh.default;var tD=e=>{let{form:s,handleOk:t,accessToken:l,userRole:a}=e,[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)([]),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)(!1),[_,b]=(0,d.useState)(!1),[N,Z]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{h((await (0,g.modelAvailableCall)(l,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[l]),(0,d.useEffect)(()=>{(async()=>{try{let e=await tx(l);console.log("Fetched models for auto router:",e),j(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[l]);let k=eL.ZL.includes(a),S=async()=>{o(!0),u("test-".concat(Date.now())),i(!0)},A=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",N);let e=s.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){P.ZP.error("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){P.ZP.error("Please select a Default Model");return}if(s.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!N||!N.routes||0===N.routes.length){P.ZP.error("Please configure at least one route for the auto router");return}if(N.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){P.ZP.error("Please ensure all routes have a target model, description, and at least one utterance");return}s.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let a={...e,auto_router_config:N};console.log("Final submit values:",a),tL(a,l,s,t)}).catch(e=>{console.error("Validation failed:",e);let s=e.errorFields||[];if(s.length>0){let e=s.map(e=>{let s=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[s]||s});P.ZP.error("Please fill in the following required fields: ".concat(e.join(", ")))}else P.ZP.error("Please fill in all required fields")})};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(tO,{level:2,children:"Add Auto Router"}),(0,c.jsx)(w.Z,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,c.jsx)(tp.Z,{children:(0,c.jsxs)(I.Z,{form:s,onFinish:A,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(y.Z,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,c.jsx)("div",{className:"w-full mb-4",children:(0,c.jsx)(tv,{modelInfo:p,value:N,onChange:e=>{Z(e),s.setFieldValue("auto_router_config",e)}})}),(0,c.jsx)(I.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(C.default,{placeholder:"Select a default model",onChange:e=>{v("custom"===e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,c.jsx)(I.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,c.jsx)(C.default,{value:s.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{b("custom"===e),s.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),k&&(0,c.jsx)(I.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(eh.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{className:"space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:S,loading:n,children:"Test Connect"}),(0,c.jsx)(T.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",N),console.log("Current form values:",s.getFieldsValue()),A()},children:"Add Auto Router"})]})]})]})}),(0,c.jsx)(E.Z,{title:"Connection Test Results",open:r,onCancel:()=>{i(!1),o(!1)},footer:[(0,c.jsx)(T.ZP,{onClick:()=>{i(!1),o(!1)},children:"Close"},"close")],width:700,children:r&&(0,c.jsx)(tE,{formValues:s.getFieldsValue(),accessToken:l,testMode:"chat",modelName:s.getFieldValue("auto_router_name"),onClose:()=>{i(!1),o(!1)},onTestComplete:()=>o(!1)},m)})]})};let{Title:tF,Link:tR}=eh.default;var tq=e=>{let{form:s,handleOk:t,selectedProvider:l,setSelectedProvider:a,providerModels:r,setProviderModelsFn:i,getPlaceholder:n,uploadProps:o,showAdvancedSettings:m,setShowAdvancedSettings:u,teams:x,credentials:h,accessToken:p,userRole:j,premiumUser:f}=e,[v,_]=(0,d.useState)("chat"),[y,b]=(0,d.useState)(!1),[N,Z]=(0,d.useState)(!1),[k,S]=(0,d.useState)(""),P=async()=>{Z(!0),S("test-".concat(Date.now())),b(!0)},[A,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{M((await (0,g.modelAvailableCall)(p,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[p]);let D=eL.ZL.includes(j);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(e$.Z,{className:"w-full",children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Add Model"}),(0,c.jsx)(eW.Z,{children:"Add Auto Router"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(tF,{level:2,children:"Add Model"}),(0,c.jsx)(tp.Z,{children:(0,c.jsx)(I.Z,{form:s,onFinish:t,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(C.default,{showSearch:!0,value:l,onChange:e=>{a(e),i(e),s.setFieldsValue({model:[],model_name:void 0})},children:Object.entries(sO.Cl).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sO.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(tb,{selectedProvider:l,providerModels:r,getPlaceholder:n}),(0,c.jsx)(tN,{}),(0,c.jsx)(I.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,c.jsx)(C.default,{style:{width:"100%"},value:v,onChange:e=>_(e),options:tA})}),(0,c.jsxs)(sR.Z,{children:[(0,c.jsx)(sq.Z,{span:10}),(0,c.jsx)(sq.Z,{span:10,children:(0,c.jsxs)(w.Z,{className:"mb-5 mt-1",children:[(0,c.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model ",(0,c.jsx)(tR,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsx)(eh.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,c.jsx)(I.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...h.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.litellm_credential_name!==s.litellm_credential_name||e.provider!==s.provider,children:e=>{let{getFieldValue:s}=e,t=s("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?(0,c.jsx)("div",{className:"text-gray-500 text-sm text-center",children:"Using existing credentials - no additional provider fields needed"}):(0,c.jsx)(sV,{selectedProvider:l,uploadProps:o})}}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,c.jsx)(z.Z,{title:f?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,c.jsx)(tT.Z,{checked:A,onChange:e=>{L(e),e||s.setFieldValue("team_id",void 0)},disabled:!f})})}),A&&(0,c.jsx)(I.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:A&&!D,message:"Please select a team."}],children:(0,c.jsx)($,{teams:x,disabled:!f})}),D&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(I.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:O.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,c.jsx)(tk,{showAdvancedSettings:m,setShowAdvancedSettings:u,teams:x}),(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(z.Z,{title:"Get help on our github",children:(0,c.jsx)(eh.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,c.jsxs)("div",{className:"space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:P,loading:N,children:"Test Connect"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(tD,{form:s,handleOk:()=>{s.validateFields().then(e=>{tL(e,p,s,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:p,userRole:j})})]})]}),(0,c.jsx)(E.Z,{title:"Connection Test Results",open:y,onCancel:()=>{b(!1),Z(!1)},footer:[(0,c.jsx)(T.ZP,{onClick:()=>{b(!1),Z(!1)},children:"Close"},"close")],width:700,children:y&&(0,c.jsx)(tE,{formValues:s.getFieldsValue(),accessToken:p,testMode:v,modelName:s.getFieldValue("model_name")||s.getFieldValue("model"),onClose:()=>{b(!1),Z(!1)},onTestComplete:()=>Z(!1)},k)})]})},tU=t(8048);let tz=(e,s,t,l,a,r,i,n,o,d,m)=>[{header:"Model ID",accessorKey:"model_info.id",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.model_info.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>l(t.model_info.id),children:t.model_info.id})})}},{header:"Public Model Name",accessorKey:"model_name",cell:e=>{let{row:s}=e,t=r(s.original)||"-";return(0,c.jsx)(z.Z,{title:t,children:(0,c.jsx)("div",{className:"text-xs truncate whitespace-nowrap",children:t})})}},{header:"Provider",accessorKey:"provider",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t.provider&&(0,c.jsx)("img",{src:(0,sO.dr)(t.provider).logo,alt:"".concat(t.provider," logo"),className:"w-4 h-4",onError:e=>{let s=e.target,l=s.parentElement;if(l){var a;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(a=t.provider)||void 0===a?void 0:a.charAt(0))||"-",l.replaceChild(e,s)}}}),(0,c.jsx)("p",{className:"text-xs",children:t.provider||"-"})]})}},{header:"LiteLLM Model Name",accessorKey:"litellm_model_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.litellm_model_name,children:(0,c.jsx)("div",{className:"text-xs truncate whitespace-nowrap",children:t.litellm_model_name||"-"})})}},{header:"Created At",accessorKey:"model_info.created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.created_at?new Date(t.model_info.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:"Created By",accessorKey:"model_info.created_by",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.model_info.created_by||"-"})}},{header:()=>(0,c.jsx)(z.Z,{title:"Cost per 1M tokens",children:(0,c.jsx)("span",{children:"Input Cost"})}),accessorKey:"input_cost",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("pre",{className:"text-xs",children:t.input_cost||"-"})}},{header:()=>(0,c.jsx)(z.Z,{title:"Cost per 1M tokens",children:(0,c.jsx)("span",{children:"Output Cost"})}),accessorKey:"output_cost",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("pre",{className:"text-xs",children:t.output_cost||"-"})}},{header:"Team ID",accessorKey:"model_info.team_id",cell:e=>{let{row:s}=e,t=s.original;return t.model_info.team_id?(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:t.model_info.team_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>a(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:"Model Access Group",accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:s}=e,t=s.original,l=t.model_info.access_groups;if(!l||0===l.length)return"-";let a=t.model_info.id,r=d.has(a),i=l.length>1,n=()=>{let e=new Set(d);r?e.delete(a):e.add(a),m(e)};return(0,c.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,c.jsx)(eY.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:l[0]}),(r||!i&&2===l.length)&&l.slice(1).map((e,s)=>(0,c.jsx)(eY.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},s+1)),i&&(0,c.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:r?"−":"+".concat(l.length-1)})]})}},{header:"Credentials",accessorKey:"litellm_credential_name",cell:e=>{let{row:s}=e,t=s.original;return t.litellm_params&&t.litellm_params.litellm_credential_name?(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsxs)(z.Z,{title:t.litellm_params.litellm_credential_name,children:[t.litellm_params.litellm_credential_name.slice(0,7),"..."]})}):(0,c.jsx)("span",{className:"text-gray-400",children:"-"})}},{header:"Status",accessorKey:"model_info.db_model",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:"",cell:t=>{var a;let{row:r}=t,i=r.original,n="Admin"===e||(null===(a=i.model_info)||void 0===a?void 0:a.created_by)===s;return(0,c.jsxs)("div",{className:"flex items-center justify-end gap-2 pr-4",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{n&&(l(i.model_info.id),o(!0))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>{n&&(l(i.model_info.id),o(!1))},className:n?"cursor-pointer":"opacity-50 cursor-not-allowed"})]})}}];var tV=t(15731),tK=t(91126);let tB=(e,s,t,l,a,r,i,n,o,d,m)=>[{header:()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(s4.Z,{checked:t,indeterminate:s.length>0&&!t,onChange:e=>a(e.target.checked),onClick:e=>e.stopPropagation()}),(0,c.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,a=t.original,r=a.model_name,i=s.includes(r);return(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(s4.Z,{checked:i,onChange:e=>l(r,e.target.checked),onClick:e=>e.stopPropagation()}),(0,c.jsx)(z.Z,{title:a.model_info.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(a.model_info.id),children:a.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,t=s.original,l=n(t)||t.model_name;return(0,c.jsx)("div",{className:"font-medium text-sm",children:(0,c.jsx)(z.Z,{title:l,children:(0,c.jsx)("div",{className:"truncate max-w-[200px]",children:l})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,s,t)=>{var l,a;let r=e.getValue("health_status")||"unknown",i=s.getValue("health_status")||"unknown",n={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(l=n[r])&&void 0!==l?l:4)-(null!==(a=n[i])&&void 0!==a?a:4)},cell:s=>{var t;let{row:l}=s,a=l.original,r={status:a.health_status,loading:a.health_loading,error:a.health_error};if(r.loading)return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,c.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:"Checking..."})]});let n=a.model_name,o="healthy"===r.status&&(null===(t=e[n])||void 0===t?void 0:t.successResponse);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[i(r.status),o&&d&&(0,c.jsx)(z.Z,{title:"View response details",placement:"top",children:(0,c.jsx)("button",{onClick:()=>{var s;return d(n,null===(s=e[n])||void 0===s?void 0:s.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,c.jsx)(tV.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:s=>{let{row:t}=s,l=t.original.model_name,a=e[l];if(!(null==a?void 0:a.error))return(0,c.jsx)(w.Z,{className:"text-gray-400 text-sm",children:"No errors"});let r=a.error,i=a.fullError||a.error;return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"max-w-[200px]",children:(0,c.jsx)(z.Z,{title:r,placement:"top",children:(0,c.jsx)(w.Z,{className:"text-red-600 text-sm truncate",children:r})})}),o&&i!==r&&(0,c.jsx)(z.Z,{title:"View full error details",placement:"top",children:(0,c.jsx)("button",{onClick:()=>o(l,r,i),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,c.jsx)(tV.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,s,t)=>{let l=e.getValue("last_check")||"Never checked",a=s.getValue("last_check")||"Never checked";if("Never checked"===l&&"Never checked"===a)return 0;if("Never checked"===l)return 1;if("Never checked"===a)return -1;if("Check in progress..."===l&&"Check in progress..."===a)return 0;if("Check in progress..."===l)return -1;if("Check in progress..."===a)return 1;let r=new Date(l),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,s,t)=>{let l=e.getValue("last_success")||"Never succeeded",a=s.getValue("last_success")||"Never succeeded";if("Never succeeded"===l&&"Never succeeded"===a)return 0;if("Never succeeded"===l)return 1;if("Never succeeded"===a)return -1;if("None"===l&&"None"===a)return 0;if("None"===l)return 1;if("None"===a)return -1;let r=new Date(l),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:s=>{let{row:t}=s,l=e[t.original.model_name],a=(null==l?void 0:l.lastSuccess)||"None";return(0,c.jsx)(w.Z,{className:"text-gray-600 text-sm",children:a})}},{header:"Actions",id:"actions",cell:e=>{let{row:s}=e,t=s.original,l=t.model_name,a=t.health_status&&"none"!==t.health_status,i=t.health_loading?"Checking...":a?"Re-run Health Check":"Run Health Check";return(0,c.jsx)(z.Z,{title:i,placement:"top",children:(0,c.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||r(l)},disabled:t.health_loading,children:t.health_loading?(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,c.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):a?(0,c.jsx)(e2.Z,{className:"h-4 w-4"}):(0,c.jsx)(tK.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],tG=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var tH=e=>{let{accessToken:s,modelData:t,all_models_on_proxy:l,getDisplayModelName:a,setSelectedModelId:r}=e,[i,n]=(0,d.useState)({}),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[j,f]=(0,d.useState)(null),[v,y]=(0,d.useState)(!1),[b,N]=(0,d.useState)(null),Z=(0,d.useRef)(null);(0,d.useEffect)(()=>{s&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(s=>{e[s.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let l=await (0,g.latestHealthChecksCall)(s);l&&l.latest_health_checks&&"object"==typeof l.latest_health_checks&&Object.entries(l.latest_health_checks).forEach(s=>{let[l,a]=s;if(!a)return;let r=null,i=t.data.find(e=>e.model_name===l);if(i)r=i.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===l);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let s=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:s?S(s):void 0,fullError:s,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}n(e)})()},[s,t]);let S=e=>{var s;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),l=t.match(/(\w+Error):\s*(\d{3})/i);if(l)return"".concat(l[1],": ").concat(l[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],s={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return s?"".concat(e,": ").concat(s):e}for(let{pattern:e,replacement:s}of tG)if(e.test(t))return s;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let i=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),n=null===(s=i.split(/[.!?]/)[0])||void 0===s?void 0:s.trim();return n&&n.length>0?n.length>100?n.substring(0,97)+"...":n:i.length>100?i.substring(0,97)+"...":i},C=async e=>{if(s){n(s=>({...s,[e]:{...s[e],loading:!0,status:"checking"}}));try{var l,a;let r=await (0,g.individualModelHealthCheckCall)(s,e),i=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let s=(null===(l=r.unhealthy_endpoints[0])||void 0===l?void 0:l.error)||"Health check failed",t=S(s);n(l=>{var a;return{...l,[e]:{status:"unhealthy",lastCheck:i,lastSuccess:(null===(a=l[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:s}}})}else n(s=>({...s,[e]:{status:"healthy",lastCheck:i,lastSuccess:i,loading:!1,successResponse:r}}));try{let l=await (0,g.latestHealthChecksCall)(s),r=t.data.find(s=>s.model_name===e);if(r){let s=r.model_info.id,t=null===(a=l.latest_health_checks)||void 0===a?void 0:a[s];if(t){let s=t.error_message||void 0;n(l=>{var a,r,i,n,o,c,d;return{...l,[e]:{status:t.status||(null===(a=l[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=l[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(i=l[e])||void 0===i?void 0:i.lastSuccess)||"None":(null===(n=l[e])||void 0===n?void 0:n.lastSuccess)||"None",loading:!1,error:s?S(s):null===(o=l[e])||void 0===o?void 0:o.error,fullError:s||(null===(c=l[e])||void 0===c?void 0:c.fullError),successResponse:"healthy"===t.status?t:null===(d=l[e])||void 0===d?void 0:d.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let s=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),l=S(t);n(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:s,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:l,fullError:t}}})}}},I=async()=>{let e=o.length>0?o:l,a=e.reduce((e,s)=>(e[s]={...i[s],loading:!0,status:"checking"},e),{});n(e=>({...e,...a}));let r={},c=e.map(async e=>{if(s)try{let l=await (0,g.individualModelHealthCheckCall)(s,e);r[e]=l;let a=new Date().toLocaleString();if(l.unhealthy_count>0&&l.unhealthy_endpoints&&l.unhealthy_endpoints.length>0){var t;let s=(null===(t=l.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",r=S(s);n(t=>{var l;return{...t,[e]:{status:"unhealthy",lastCheck:a,lastSuccess:(null===(l=t[e])||void 0===l?void 0:l.lastSuccess)||"None",loading:!1,error:r,fullError:s}}})}else n(s=>({...s,[e]:{status:"healthy",lastCheck:a,lastSuccess:a,loading:!1,successResponse:l}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let s=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),l=S(t);n(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:s,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:l,fullError:t}}})}});await Promise.allSettled(c);try{if(!s)return;let l=await (0,g.latestHealthChecksCall)(s);l.latest_health_checks&&Object.entries(l.latest_health_checks).forEach(s=>{let[l,a]=s,r=t.data.find(e=>e.model_info.id===l);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,s=a.error_message||void 0;n(t=>{let l=t[e];return{...t,[e]:{status:a.status||(null==l?void 0:l.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==l?void 0:l.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==l?void 0:l.lastSuccess)||"None",loading:!1,error:s?S(s):null==l?void 0:l.error,fullError:s||(null==l?void 0:l.fullError),successResponse:"healthy"===a.status?a:null==l?void 0:l.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},P=e=>{x(e),e?m(l):m([])},A=()=>{p(!1),f(null)},L=()=>{y(!1),N(null)};return(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"mb-6",children:(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Model Health Status"}),(0,c.jsx)(w.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[o.length>0&&(0,c.jsx)(_.Z,{size:"sm",variant:"light",onClick:()=>P(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,c.jsx)(_.Z,{size:"sm",variant:"secondary",onClick:I,disabled:Object.values(i).some(e=>e.loading),className:"px-3 py-1 text-sm",children:o.length>0&&o.length<l.length?"Run Selected Checks":"Run All Checks"})]})]})}),(0,c.jsx)("div",{children:(0,c.jsx)(tU.C,{columns:tB(i,o,u,(e,s)=>{s?m(s=>[...s,e]):(m(s=>s.filter(s=>s!==e)),x(!1))},P,C,e=>{switch(e){case"healthy":return(0,c.jsx)(eY.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,c.jsx)(eY.Z,{color:"red",children:"unhealthy"});case"checking":return(0,c.jsx)(eY.Z,{color:"blue",children:"checking"});case"none":return(0,c.jsx)(eY.Z,{color:"gray",children:"none"});default:return(0,c.jsx)(eY.Z,{color:"gray",children:"unknown"})}},a,(e,s,t)=>{f({modelName:e,cleanedError:s,fullError:t}),p(!0)},(e,s)=>{N({modelName:e,response:s}),y(!0)},r),data:t.data.map(e=>{let s=i[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:s.status,last_check:s.lastCheck,last_success:s.lastSuccess||"None",health_loading:s.loading,health_error:s.error,health_full_error:s.fullError}}),isLoading:!1,table:Z})}),(0,c.jsx)(E.Z,{title:j?"Health Check Error - ".concat(j.modelName):"Error Details",open:h,onCancel:A,footer:[(0,c.jsx)(T.ZP,{onClick:A,children:"Close"},"close")],width:800,children:j&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Error:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-red-800",children:j.cleanedError})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Full Error Details:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:j.fullError})})]})]})}),(0,c.jsx)(E.Z,{title:b?"Health Check Response - ".concat(b.modelName):"Response Details",open:v,onCancel:L,footer:[(0,c.jsx)(T.ZP,{onClick:L,children:"Close"},"close")],width:800,children:b&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Status:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,c.jsx)(w.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Response Details:"}),(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(b.response,null,2)})})]})]})})]})},tJ=t(61778),tY=t(12660),tW=t(93142),t$=e=>{let{value:s={},onChange:t}=e,[l,a]=(0,d.useState)(Object.entries(s)),r=e=>{let s=l.filter((s,t)=>t!==e);a(s),null==t||t(Object.fromEntries(s))},i=(e,s,r)=>{let i=[...l];i[e]=[s,r],a(i),null==t||t(Object.fromEntries(i))};return(0,c.jsxs)("div",{children:[l.map((e,s)=>{let[t,l]=e;return(0,c.jsxs)(tW.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,c.jsx)(y.Z,{placeholder:"Header Name",value:t,onChange:e=>i(s,e.target.value,l)}),(0,c.jsx)(y.Z,{placeholder:"Header Value",value:l,onChange:e=>i(s,t,e.target.value)}),(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,c.jsx)(tc.Z,{onClick:()=>r(s),style:{cursor:"pointer"}})})]},s)}),(0,c.jsx)(T.ZP,{type:"dashed",onClick:()=>{a([...l,["",""]])},icon:(0,c.jsx)(td.Z,{}),children:"Add Header"})]})},tQ=t(77565),tX=e=>{let{pathValue:s,targetValue:t,includeSubpath:l}=e,a=(0,g.getProxyBaseUrl)();return s&&t?(0,c.jsxs)(X.Z,{className:"p-5",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,c.jsx)(sL.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,c.jsxs)("div",{className:"space-y-5",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,c.jsx)("code",{className:"font-mono text-sm text-gray-900",children:s?"".concat(a).concat(s):""})]}),(0,c.jsx)("div",{className:"text-gray-400",children:(0,c.jsx)(tQ.Z,{className:"text-lg"})}),(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,c.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),l&&(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,c.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[s&&"".concat(a).concat(s),(0,c.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,c.jsx)("div",{className:"text-gray-400",children:(0,c.jsx)(tQ.Z,{className:"text-lg"})}),(0,c.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,c.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,c.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,c.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,c.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",s," will be appended to the target URL"]})]})}),!l&&(0,c.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,c.jsxs)("div",{className:"flex items-start",children:[(0,c.jsx)(U.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,c.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,c.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like ",(0,c.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null};let{Option:t0}=C.default;var t1=e=>{let{accessToken:s,setPassThroughItems:t,passThroughItems:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)(""),[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(!0),b=()=>{a.resetFields(),h(""),j(""),v(!0),i(!1)},N=e=>{let s=e;e&&!e.startsWith("/")&&(s="/"+e),h(s),a.setFieldsValue({path:s})},Z=async e=>{console.log("addPassThrough called with:",e),o(!0);try{console.log("formValues: ".concat(JSON.stringify(e)));let r=(await (0,g.createPassThroughEndpoint)(s,e)).endpoints[0],n=[...l,r];t(n),P.ZP.success("Pass-through endpoint created successfully"),a.resetFields(),h(""),j(""),v(!0),i(!1)}catch(e){P.ZP.error("Error creating pass-through endpoint: "+e,20)}finally{o(!1)}};return(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>i(!0),children:"+ Add Pass-Through Endpoint"}),(0,c.jsx)(E.Z,{title:(0,c.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,c.jsx)(tY.Z,{className:"text-xl text-blue-500"}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:r,width:1e3,onCancel:b,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,c.jsxs)("div",{className:"mt-6",children:[(0,c.jsx)(tJ.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,c.jsxs)(I.Z,{form:a,onFinish:Z,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:x,target:p},children:[(0,c.jsxs)(X.Z,{className:"p-5",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,c.jsx)(sL.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,c.jsxs)("div",{className:"space-y-5",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)(y.Z,{placeholder:"bria",value:x,onChange:e=>N(e.target.value),className:"flex-1"})})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,c.jsx)(y.Z,{placeholder:"https://engine.prod.bria-api.com",value:p,onChange:e=>{j(e.target.value),a.setFieldsValue({target:e.target.value})}})}),(0,c.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,c.jsx)(I.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,c.jsx)(tT.Z,{checked:f,onChange:v})})]})]})]}),(0,c.jsx)(tX,{pathValue:x,targetValue:p,includeSubpath:f}),(0,c.jsxs)(X.Z,{className:"p-6",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,c.jsx)(sL.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,c.jsx)(z.Z,{title:"Authentication and other headers to forward with requests",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,c.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,c.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,c.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,c.jsx)(t$,{})})]}),(0,c.jsxs)(X.Z,{className:"p-6",children:[(0,c.jsx)(k.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,c.jsx)(sL.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,c.jsx)(z.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,c.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,c.jsx)(M,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,c.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:b,children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",loading:n,onClick:()=>{console.log("Submit button clicked"),a.submit()},children:n?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},t2=t(87769),t4=t(42208);let t5=e=>{let{value:s}=e,[t,l]=(0,d.useState)(!1),a=JSON.stringify(s,null,2);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?a:"••••••••"}),(0,c.jsx)("button",{onClick:()=>l(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,c.jsx)(t2.Z,{className:"w-4 h-4 text-gray-500"}):(0,c.jsx)(t4.Z,{className:"w-4 h-4 text-gray-500"})})]})};var t6=e=>{let{endpointData:s,onClose:t,accessToken:l,isAdmin:a,onEndpointUpdated:r}=e,[i,n]=(0,d.useState)(s),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)(!1),[h]=I.Z.useForm(),p=async e=>{try{if(!l||!(null==i?void 0:i.id))return;let s={};if(e.headers)try{s="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){P.ZP.error("Invalid JSON format for headers");return}let t={path:i.path,target:e.target,headers:s,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request};await (0,g.updatePassThroughEndpoint)(l,i.id,t),n({...i,...t}),x(!1),r&&r()}catch(e){console.error("Error updating endpoint:",e),P.ZP.error("Failed to update pass through endpoint")}},j=async()=>{try{if(!l||!(null==i?void 0:i.id))return;await (0,g.deletePassThroughEndpointsCall)(l,i.id),P.ZP.success("Pass through endpoint deleted successfully"),t(),r&&r()}catch(e){console.error("Error deleting endpoint:",e),P.ZP.error("Failed to delete pass through endpoint")}};return o?(0,c.jsx)("div",{className:"p-4",children:"Loading..."}):i?(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(T.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,c.jsxs)(k.Z,{children:["Pass Through Endpoint: ",i.path]}),(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:i.id})]})}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"},"overview"),a?(0,c.jsx)(eW.Z,{children:"Settings"},"settings"):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Path"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{className:"font-mono",children:i.path})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Target"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{children:i.target})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Configuration"}),(0,c.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,c.jsx)("div",{children:(0,c.jsx)(eY.Z,{color:i.include_subpath?"green":"gray",children:i.include_subpath?"Include Subpath":"Exact Path"})}),void 0!==i.cost_per_request&&(0,c.jsx)("div",{children:(0,c.jsxs)(w.Z,{children:["Cost per request: $",i.cost_per_request]})})]})]})]}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(tX,{pathValue:i.path,targetValue:i.target,includeSubpath:i.include_subpath||!1})}),i.headers&&Object.keys(i.headers).length>0&&(0,c.jsxs)(X.Z,{className:"mt-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Headers"}),(0,c.jsxs)(eY.Z,{color:"blue",children:[Object.keys(i.headers).length," headers configured"]})]}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(t5,{value:i.headers})})]})]}),a&&(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Pass Through Endpoint Settings"}),(0,c.jsx)("div",{className:"space-x-2",children:!u&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(_.Z,{onClick:()=>x(!0),children:"Edit Settings"}),(0,c.jsx)(_.Z,{onClick:j,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),u?(0,c.jsxs)(I.Z,{form:h,onFinish:p,initialValues:{target:i.target,headers:i.headers?JSON.stringify(i.headers,null,2):"",include_subpath:i.include_subpath||!1,cost_per_request:i.cost_per_request},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,c.jsx)(y.Z,{placeholder:"https://api.example.com"})}),(0,c.jsx)(I.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,c.jsx)(L.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,c.jsx)(I.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,c.jsx)(to.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,c.jsx)(q.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,c.jsx)(T.ZP,{onClick:()=>x(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{children:"Save Changes"})]})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Path"}),(0,c.jsx)("div",{className:"font-mono",children:i.path})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Target URL"}),(0,c.jsx)("div",{children:i.target})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Include Subpath"}),(0,c.jsx)(eY.Z,{color:i.include_subpath?"green":"gray",children:i.include_subpath?"Yes":"No"})]}),void 0!==i.cost_per_request&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cost per Request"}),(0,c.jsxs)("div",{children:["$",i.cost_per_request]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Headers"}),i.headers&&Object.keys(i.headers).length>0?(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(t5,{value:i.headers})}):(0,c.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,c.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},t3=t(19130);function t8(e){let{data:s=[],columns:t,getRowCanExpand:l,renderSubComponent:a,isLoading:r=!1,loadingMessage:i="\uD83D\uDE85 Loading logs...",noDataMessage:n="No logs found"}=e,o=(0,sg.b7)({data:s,columns:t,getRowCanExpand:l,getRowId:(e,s)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(s)},getCoreRowModel:(0,sj.sC)(),getExpandedRowModel:(0,sj.rV)()});return(0,c.jsx)("div",{className:"rounded-lg custom-border",children:(0,c.jsxs)(t3.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(t3.ss,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(t3.SC,{children:e.headers.map(e=>(0,c.jsx)(t3.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,c.jsx)(t3.RM,{children:r?(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:i})})})}):o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsxs)(d.Fragment,{children:[(0,c.jsx)(t3.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(t3.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:e.getVisibleCells().length,children:a({row:e})})})]},e.id)):(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:n})})})})})]})})}let t7=e=>{let{value:s}=e,[t,l]=(0,d.useState)(!1),a=JSON.stringify(s);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"font-mono text-xs",children:t?a:"••••••••"}),(0,c.jsx)("button",{onClick:()=>l(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,c.jsx)(t2.Z,{className:"w-4 h-4 text-gray-500"}):(0,c.jsx)(t4.Z,{className:"w-4 h-4 text-gray-500"})})]})};var t9=e=>{let{accessToken:s,userRole:t,userID:l,modelData:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{s&&t&&l&&(0,g.getPassThroughEndpointsCall)(s).then(e=>{i(e.endpoints)})},[s,t,l]);let p=async e=>{h(e),u(!0)},j=async()=>{if(null!=x&&s){try{await (0,g.deletePassThroughEndpointsCall)(s,x);let e=r.filter(e=>e.id!==x);i(e),P.ZP.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.ZP.error("Error deleting the endpoint: "+e)}u(!1),h(null)}},f=(e,s)=>{p(e)},v=[{header:"ID",accessorKey:"id",cell:e=>(0,c.jsx)(z.Z,{title:e.row.original.id,children:(0,c.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&o(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,c.jsx)(w.Z,{children:e.getValue()})},{header:"Headers",accessorKey:"headers",cell:e=>(0,c.jsx)(t7,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex space-x-1",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>s.original.id&&o(s.original.id),title:"Edit"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>f(s.original.id,s.index),title:"Delete"})]})}}];if(!s)return null;if(n){console.log("selectedEndpointId",n),console.log("generalSettings",r);let e=r.find(e=>e.id===n);return e?(0,c.jsx)(t6,{endpointData:e,onClose:()=>o(null),accessToken:s,isAdmin:"Admin"===t||"admin"===t,onEndpointUpdated:()=>{s&&(0,g.getPassThroughEndpointsCall)(s).then(e=>{i(e.endpoints)})}}):(0,c.jsx)("div",{children:"Endpoint not found"})}return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Pass Through Endpoints"}),(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,c.jsx)(t1,{accessToken:s,setPassThroughItems:i,passThroughItems:r}),(0,c.jsx)(t8,{data:r,columns:v,renderSubComponent:()=>(0,c.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),m&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:j,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{u(!1),h(null)},children:"Cancel"})]})]})]})})]})};let le={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var ls=e=>{let{accessToken:s,token:t,userRole:l,userID:a,modelData:r={data:[]},keys:i,setModelData:n,premiumUser:o,teams:m}=e,[u]=I.Z.useForm(),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(""),[y,b]=(0,d.useState)([]),[N,Z]=(0,d.useState)([]),[S,C]=(0,d.useState)(sO.Cl.OpenAI),[E,A]=(0,d.useState)(null),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(!1),[D,F]=(0,d.useState)(null),[R,z]=(0,d.useState)([]),[V,K]=(0,d.useState)([]),[B,G]=(0,d.useState)(null),[H,J]=(0,d.useState)([]),[Y,W]=(0,d.useState)([]),[$,Q]=(0,d.useState)([]),[ee,es]=(0,d.useState)([]),[et,el]=(0,d.useState)([]),[ea,er]=(0,d.useState)([]),[ei,en]=(0,d.useState)([]),[eo,ec]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ed,em]=(0,d.useState)(null),[eu,ep]=(0,d.useState)(0),[eg,ej]=(0,d.useState)({}),[ef,ev]=(0,d.useState)([]),[e_,ey]=(0,d.useState)(!1),[eb,eN]=(0,d.useState)(null),[eZ,ew]=(0,d.useState)(null),[ek,eS]=(0,d.useState)([]),[eC,eI]=(0,d.useState)([]),[eP,eE]=(0,d.useState)(!1),[eA,eT]=(0,d.useState)(null),[eO,eM]=(0,d.useState)(!1),[eD,eF]=(0,d.useState)(null),[eR,eq]=(0,d.useState)(null),[eU,ez]=(0,d.useState)(null),[eV,eK]=(0,d.useState)(null),[eB,eG]=(0,d.useState)("personal"),[eH,eY]=(0,d.useState)("current_team"),[e1,e4]=(0,d.useState)(!1),[e5,e6]=(0,d.useState)(!1),[e3,e8]=(0,d.useState)(new Set),e7=(0,d.useRef)(null),e9=(0,d.useRef)(null),[se,ss]=(0,d.useState)(0),st=async(e,t,r)=>{if(console.log("Updating model metrics for group:",e),!s||!a||!l||!t||!r)return;console.log("inside updateModelMetrics - startTime:",t,"endTime:",r),G(e);let i=null==eb?void 0:eb.token;void 0===i&&(i=null);let n=eZ;void 0===n&&(n=null);try{let o=await (0,g.modelMetricsCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);console.log("Model metrics response:",o),J(o.data),W(o.all_api_bases);let c=await (0,g.streamingModelMetricsCall)(s,e,t.toISOString(),r.toISOString());Q(c.data),es(c.all_api_bases);let d=await (0,g.modelExceptionsCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);console.log("Model exceptions response:",d),el(d.data),er(d.exception_types);let m=await (0,g.modelMetricsSlowResponsesCall)(s,a,l,e,t.toISOString(),r.toISOString(),i,n);if(console.log("slowResponses:",m),en(m),e){let l=await (0,g.adminGlobalActivityExceptions)(s,null==t?void 0:t.toISOString().split("T")[0],null==r?void 0:r.toISOString().split("T")[0],e);ej(l);let a=await (0,g.adminGlobalActivityExceptionsPerDeployment)(s,null==t?void 0:t.toISOString().split("T")[0],null==r?void 0:r.toISOString().split("T")[0],e);ev(a)}}catch(e){console.error("Failed to fetch model metrics",e)}},sl=async e=>{try{let s=await (0,g.credentialListCall)(e);console.log("credentials: ".concat(JSON.stringify(s))),eI(s.credentials)}catch(e){console.error("Error fetching credentials:",e)}};(0,d.useEffect)(()=>{st(B,eo.from,eo.to)},[eb,eZ,eR]),(0,d.useEffect)(()=>{let e=e=>{e7.current&&!e7.current.contains(e.target)&&e6(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let sa={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let s=new FileReader;s.onload=e=>{if(e.target){let s=e.target.result;console.log("Resetting vertex_credentials to JSON; jsonStr: ".concat(s)),u.setFieldsValue({vertex_credentials:s}),console.log("Form values right after setting:",u.getFieldsValue())}},s.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered with values:",e),console.log("Current form values:",u.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList),"done"===e.file.status?P.ZP.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&P.ZP.error("".concat(e.file.name," file upload failed."))}},sr=()=>{j(new Date().toLocaleString())},si=async()=>{if(!s){console.error("Access token is missing");return}console.log("new modelGroupRetryPolicy:",ed);try{await (0,g.setCallbacksCall)(s,{router_settings:{model_group_retry_policy:ed}}),P.ZP.success("Retry settings saved successfully")}catch(e){console.error("Failed to save retry settings:",e),P.ZP.error("Failed to save retry settings")}};if((0,d.useEffect)(()=>{if(!s||!t||!l||!a)return;let e=async()=>{try{var e,t,r,i,o,c,d,m,u,x,h,p;let j=await (0,g.modelInfoCall)(s,a,l);console.log("Model data response:",j.data),n(j);let f=await (0,g.modelSettingsCall)(s);f&&Z(f);let v=new Set;for(let e=0;e<j.data.length;e++){let s=j.data[e];v.add(s.model_name)}console.log("all_model_groups:",v);let _=Array.from(v);_=_.sort(),z(_);let y=new Set;for(let e=0;e<j.data.length;e++){let s=j.data[e].model_info;if(s){let e=s.access_groups;if(e)for(let s=0;s<e.length;s++)y.add(e[s])}}K(Array.from(y)),console.log("array_model_groups:",_);let b="all";_.length>0&&(b=_[_.length-1],console.log("_initial_model_group:",b)),console.log("selectedModelGroup:",B);let N=await (0,g.modelMetricsCall)(s,a,l,b,null===(e=eo.from)||void 0===e?void 0:e.toISOString(),null===(t=eo.to)||void 0===t?void 0:t.toISOString(),null==eb?void 0:eb.token,eZ);console.log("Model metrics response:",N),J(N.data),W(N.all_api_bases);let w=await (0,g.streamingModelMetricsCall)(s,b,null===(r=eo.from)||void 0===r?void 0:r.toISOString(),null===(i=eo.to)||void 0===i?void 0:i.toISOString());Q(w.data),es(w.all_api_bases);let k=await (0,g.modelExceptionsCall)(s,a,l,b,null===(o=eo.from)||void 0===o?void 0:o.toISOString(),null===(c=eo.to)||void 0===c?void 0:c.toISOString(),null==eb?void 0:eb.token,eZ);console.log("Model exceptions response:",k),el(k.data),er(k.exception_types);let S=await (0,g.modelMetricsSlowResponsesCall)(s,a,l,b,null===(d=eo.from)||void 0===d?void 0:d.toISOString(),null===(m=eo.to)||void 0===m?void 0:m.toISOString(),null==eb?void 0:eb.token,eZ),C=await (0,g.adminGlobalActivityExceptions)(s,null===(u=eo.from)||void 0===u?void 0:u.toISOString().split("T")[0],null===(x=eo.to)||void 0===x?void 0:x.toISOString().split("T")[0],b);ej(C);let I=await (0,g.adminGlobalActivityExceptionsPerDeployment)(s,null===(h=eo.from)||void 0===h?void 0:h.toISOString().split("T")[0],null===(p=eo.to)||void 0===p?void 0:p.toISOString().split("T")[0],b);ev(I),console.log("dailyExceptions:",C),console.log("dailyExceptionsPerDeplyment:",I),console.log("slowResponses:",S),en(S);let P=await (0,g.allEndUsersCall)(s);eS(null==P?void 0:P.end_users);let E=(await (0,g.getCallbacksCall)(s,a,l)).router_settings;console.log("routerSettingsInfo:",E);let A=E.model_group_retry_policy,T=E.num_retries;console.log("model_group_retry_policy:",A),console.log("default_retries:",T),em(A),ep(T)}catch(e){console.error("There was an error fetching the model data",e)}};s&&t&&l&&a&&e();let r=async()=>{let e=await (0,g.modelCostMap)(s);console.log("received model cost map data: ".concat(Object.keys(e))),h(e)};null==x&&r(),sr()},[s,t,l,a,x,p,eR]),!r||!s||!t||!l||!a)return(0,c.jsx)("div",{children:"Loading..."});let sn=[],so=[];for(let e=0;e<r.data.length;e++){var sd,sm,su;let s=r.data[e],t=null==s?void 0:null===(sd=s.litellm_params)||void 0===sd?void 0:sd.model,l=null==s?void 0:null===(sm=s.litellm_params)||void 0===sm?void 0:sm.custom_llm_provider,a=null==s?void 0:s.model_info,i="",n="Undefined",o="Undefined",c="Undefined",d="Undefined",m={},u=e=>(console.log("GET PROVIDER CALLED! - ".concat(x)),null!=x&&"object"==typeof x&&e in x)?x[e].litellm_provider:"openai";if(t){let e=t.split("/"),s=e[0];(i=l)||(i=1===e.length?u(t):s)}else i="-";a&&(n=null==a?void 0:a.input_cost_per_token,o=null==a?void 0:a.output_cost_per_token,c=null==a?void 0:a.max_tokens,d=null==a?void 0:a.max_input_tokens),(null==s?void 0:s.litellm_params)&&(m=Object.fromEntries(Object.entries(null==s?void 0:s.litellm_params).filter(e=>{let[s]=e;return"model"!==s&&"api_base"!==s}))),r.data[e].provider=i,r.data[e].input_cost=n,r.data[e].output_cost=o,r.data[e].litellm_model_name=t,so.push(i),r.data[e].input_cost&&(r.data[e].input_cost=(1e6*Number(r.data[e].input_cost)).toFixed(2)),r.data[e].output_cost&&(r.data[e].output_cost=(1e6*Number(r.data[e].output_cost)).toFixed(2)),r.data[e].max_tokens=c,r.data[e].max_input_tokens=d,r.data[e].api_base=null==s?void 0:null===(su=s.litellm_params)||void 0===su?void 0:su.api_base,r.data[e].cleanedLitellmParams=m,sn.push(s.model_name),console.log(r.data[e])}if(l&&"Admin Viewer"==l){let{Title:e,Paragraph:s}=eh.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to view all models"})]})}let sx=(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mb-1",children:"Select API Key Name"}),o?(0,c.jsxs)("div",{children:[(0,c.jsxs)(eJ.Z,{defaultValue:"all-keys",children:[(0,c.jsx)(ex.Z,{value:"all-keys",onClick:()=>{eN(null)},children:"All Keys"},"all-keys"),null==i?void 0:i.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,c.jsx)(ex.Z,{value:String(s),onClick:()=>{eN(e)},children:e.key_alias},s):null)]}),(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Customer Name"}),(0,c.jsxs)(eJ.Z,{defaultValue:"all-customers",children:[(0,c.jsx)(ex.Z,{value:"all-customers",onClick:()=>{ew(null)},children:"All Customers"},"all-customers"),null==ek?void 0:ek.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,onClick:()=>{ew(e)},children:e},s))]}),(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Team"}),(0,c.jsxs)(eJ.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=eU?eU:"all",onValueChange:e=>ez("all"===e?null:e),children:[(0,c.jsx)(ex.Z,{value:"all",children:"All Teams"}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ex.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-1",children:"Select Team"}),(0,c.jsxs)(eJ.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=eU?eU:"all",onValueChange:e=>ez("all"===e?null:e),children:[(0,c.jsx)(ex.Z,{value:"all",children:"All Teams"}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ex.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]}),sh=e=>{var s,t;let{payload:l,active:a}=e;if(!a||!l)return null;let r=null===(t=l[0])||void 0===t?void 0:null===(s=t.payload)||void 0===s?void 0:s.date,i=l.sort((e,s)=>s.value-e.value);if(i.length>5){let e=i.length-5;(i=i.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:l.slice(5).reduce((e,s)=>e+s.value,0),color:"gray"})}return(0,c.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,c.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",r]}),i.map((e,s)=>{let t=parseFloat(e.value.toFixed(5)),l=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,c.jsxs)("div",{className:"flex justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,c.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,c.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:l})]},s)})]})};console.log("selectedProvider: ".concat(S)),console.log("providerModels.length: ".concat(y.length));let sp=Object.keys(sO.Cl).find(e=>sO.Cl[e]===S);return(sp&&N&&N.find(e=>e.name===sO.fK[sp]),eD)?(0,c.jsx)("div",{className:"w-full h-full",children:(0,c.jsx)(tl,{teamId:eD,onClose:()=>eF(null),accessToken:s,is_team_admin:"Admin"===l,is_proxy_admin:"Proxy Admin"===l,userModels:sn,editTeam:!1,onUpdate:sr})}):(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:eA?(0,c.jsx)(ty,{modelId:eA,editModel:!0,onClose:()=>{eT(null),eM(!1)},modelData:r.data.find(e=>e.model_info.id===eA),accessToken:s,userID:a,userRole:l,setEditModalVisible:M,setSelectedModel:F,onModelUpdate:e=>{n({...r,data:r.data.map(s=>s.model_info.id===e.model_info.id?e:s)}),sr()},modelAccessGroups:V}):(0,c.jsxs)(e$.Z,{index:se,onIndexChange:ss,className:"gap-2 h-[75vh] w-full ",children:[(0,c.jsxs)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[eL.ZL.includes(l)?(0,c.jsx)(eW.Z,{children:"All Models"}):(0,c.jsx)(eW.Z,{children:"Your Models"}),(0,c.jsx)(eW.Z,{children:"Add Model"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"LLM Credentials"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"Pass-Through Endpoints"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"Health Status"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"Model Analytics"}),eL.ZL.includes(l)&&(0,c.jsx)(eW.Z,{children:"Model Retry Settings"})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[p&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",p]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center",onClick:sr})]})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsx)(v.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{children:"Model Management"}),eL.ZL.includes(l)?(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Add and manage models for the proxy"}):(0,c.jsx)(w.Z,{className:"text-tremor-content",children:"Add models for teams you are an admin for."})]})}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,c.jsxs)(eJ.Z,{className:"w-80",defaultValue:"personal",value:eB,onValueChange:e=>eG(e),children:[(0,c.jsx)(ex.Z,{value:"personal",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==m?void 0:m.filter(e=>e.team_id).map(e=>(0,c.jsx)(ex.Z,{value:e.team_id,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),"current_team"===eH&&(0,c.jsxs)("div",{className:"flex items-start gap-2 mt-2 bg-gray-50 rounded",children:[(0,c.jsx)(U.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,c.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===eB?(0,c.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,c.jsx)("a",{href:"/?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,c.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',eB,'" on the'," ",(0,c.jsx)("a",{href:"/?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,c.jsxs)(eJ.Z,{className:"w-64",defaultValue:"current_team",value:eH,onValueChange:e=>eY(e),children:[(0,c.jsx)(ex.Z,{value:"current_team",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,c.jsx)(ex.Z,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),(0,c.jsx)("div",{className:"flex items-center justify-between",children:(0,c.jsxs)("div",{className:"flex items-center gap-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:"Filter by Public Model Name:"}),(0,c.jsxs)(eJ.Z,{className:"w-64",defaultValue:null!=B?B:"all",onValueChange:e=>G("all"===e?"all":e),value:null!=B?B:"all",children:[(0,c.jsx)(ex.Z,{value:"all",children:"All Models"}),(0,c.jsx)(ex.Z,{value:"wildcard",children:"Wildcard Models (*)"}),R.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,children:e},s))]})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(w.Z,{children:"Filter by Model Access Group:"}),(0,c.jsxs)(eJ.Z,{className:"w-64",defaultValue:"all",value:null!=eV?eV:"all",onValueChange:e=>eK("all"===e?null:e),children:[(0,c.jsx)(ex.Z,{value:"all",children:"All Model Access Groups"}),V.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,children:e},s))]})]})]})}),(0,c.jsx)("div",{className:"flex justify-between items-center",children:(0,c.jsxs)(w.Z,{className:"text-sm text-gray-700",children:["Showing"," ",r&&r.data.length>0?r.data.filter(e=>{var s,t,l,a;let r="all"===B||e.model_name===B||!B,i="all"===eV||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(eV))||!eV,n=!0;return"current_team"===eH&&(n="personal"===eB?(null===(t=e.model_info)||void 0===t?void 0:t.direct_access)===!0:(null===(a=e.model_info)||void 0===a?void 0:null===(l=a.access_via_team_ids)||void 0===l?void 0:l.includes(eB))===!0),r&&i&&n}).length:0," ","results"]})})]})}),(0,c.jsx)(tU.C,{columns:tz(l,a,o,eT,eF,sJ,e=>{F(e),M(!0)},sr,eM,e3,e8),data:r.data.filter(e=>{var s,t,l,a;let r="all"===B||e.model_name===B||!B||"wildcard"===B&&e.model_name.includes("*"),i="all"===eV||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(eV))||!eV,n=!0;return"current_team"===eH&&(n="personal"===eB?(null===(t=e.model_info)||void 0===t?void 0:t.direct_access)===!0:(null===(a=e.model_info)||void 0===a?void 0:null===(l=a.access_via_team_ids)||void 0===l?void 0:l.includes(eB))===!0),r&&i&&n}),isLoading:!1,table:e9})]})]})})}),(0,c.jsx)(eX.Z,{className:"h-full",children:(0,c.jsx)(tq,{form:u,handleOk:()=>{u.validateFields().then(e=>{sD(e,s,u,sr)}).catch(e=>{console.error("Validation failed:",e)})},selectedProvider:S,setSelectedProvider:C,providerModels:y,setProviderModelsFn:e=>{let s=(0,sO.bK)(e,x);b(s),console.log("providerModels: ".concat(s))},getPlaceholder:sO.ph,uploadProps:sa,showAdvancedSettings:eP,setShowAdvancedSettings:eE,teams:m,credentials:eC,accessToken:s,userRole:l,premiumUser:o})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(sH,{accessToken:s,uploadProps:sa,credentialList:eC,fetchCredentials:sl})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(t9,{accessToken:s,userRole:l,userID:a,modelData:r})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(tH,{accessToken:s,modelData:r,all_models_on_proxy:sn,getDisplayModelName:sJ,setSelectedModelId:eT})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:eo,className:"mr-2",onValueChange:e=>{ec(e),st(B,e.from,e.to)}})}),(0,c.jsxs)(f.Z,{className:"ml-2",children:[(0,c.jsx)(w.Z,{children:"Select Model Group"}),(0,c.jsx)(eJ.Z,{defaultValue:B||R[0],value:B||R[0],children:R.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,onClick:()=>st(e,eo.from,eo.to),children:e},s))})]}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(sX.Z,{trigger:"click",content:sx,overlayStyle:{width:"20vw"},children:(0,c.jsx)(_.Z,{icon:sc.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>ey(!0)})})})]}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(X.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eW.Z,{value:"1",children:"Avg. Latency per Token"}),(0,c.jsx)(eW.Z,{value:"2",children:"Time to first token"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)("p",{className:"text-gray-500 italic",children:[" ","(seconds/token)"]}),(0,c.jsx)(w.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),H&&Y&&(0,c.jsx)(s$.Z,{title:"Model Latency",className:"h-72",data:H,showLegend:!1,index:"date",categories:Y,connectNulls:!0,customTooltip:sh})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(s1,{modelMetrics:$,modelMetricsCategories:ee,customTooltip:sh,premiumUser:o})})]})]})})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(X.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Deployment"}),(0,c.jsx)(sN.Z,{children:"Success Responses"}),(0,c.jsxs)(sN.Z,{children:["Slow Responses"," ",(0,c.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,c.jsx)(s_.Z,{children:ei.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.api_base}),(0,c.jsx)(sy.Z,{children:e.total_count}),(0,c.jsx)(sy.Z,{children:e.slow_count})]},s))})]})})})]}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(k.Z,{children:["All Exceptions for ",B]}),(0,c.jsx)(sQ.Z,{className:"h-60",data:et,index:"model",categories:ea,stack:!0,yAxisWidth:30})]})}),(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(k.Z,{children:["All Up Rate Limit Errors (429) for ",B]}),(0,c.jsxs)(v.Z,{numItems:1,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors"," ",eg.sum_num_rate_limit_exceptions]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:eg.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,c.jsx)(f.Z,{})]})]}),o?(0,c.jsx)(c.Fragment,{children:ef.map((e,s)=>(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429)"," ",e.sum_num_rate_limit_exceptions]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},s))}):(0,c.jsx)(c.Fragment,{children:ef&&ef.length>0&&ef.slice(0,1).map((e,s)=>(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,c.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,c.jsx)(_.Z,{variant:"primary",className:"mb-2",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:e.api_base}),(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors"," ",e.sum_num_rate_limit_exceptions]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},s))})]})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(w.Z,{children:"Filter by Public Model Name"}),(0,c.jsx)(eJ.Z,{className:"mb-4 mt-2 ml-2 w-50",defaultValue:B||R[0],value:B||R[0],onValueChange:e=>G(e),children:R.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,onClick:()=>G(e),children:e},s))})]}),(0,c.jsxs)(k.Z,{children:["Retry Policy for ",B]}),(0,c.jsx)(w.Z,{className:"mb-6",children:"How many retries should be attempted based on the Exception"}),le&&(0,c.jsx)("table",{children:(0,c.jsx)("tbody",{children:Object.entries(le).map((e,s)=>{var t;let[l,a]=e,r=null==ed?void 0:null===(t=ed[B])||void 0===t?void 0:t[a];return null==r&&(r=eu),(0,c.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,c.jsx)("td",{children:(0,c.jsx)(w.Z,{children:l})}),(0,c.jsx)("td",{children:(0,c.jsx)(q.Z,{className:"ml-5",value:r,min:0,step:1,onChange:e=>{em(s=>{var t;let l=null!==(t=null==s?void 0:s[B])&&void 0!==t?t:{};return{...null!=s?s:{},[B]:{...l,[a]:e}}})}})})]},s)})})}),(0,c.jsx)(_.Z,{className:"mt-6 mr-8",onClick:si,children:"Save"})]})]})]})})})})},lt=e=>{let{visible:s,possibleUIRoles:t,onCancel:l,user:a,onSubmit:r}=e,[i,n]=(0,d.useState)(a),[o]=I.Z.useForm();(0,d.useEffect)(()=>{o.resetFields()},[a]);let m=async()=>{o.resetFields(),l()},u=async e=>{r(e),o.resetFields(),l()};return a?(0,c.jsx)(E.Z,{visible:s,onCancel:m,footer:null,title:"Edit User "+a.user_id,width:1e3,children:(0,c.jsx)(I.Z,{form:o,onFinish:u,initialValues:a,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"User Role",name:"user_role",children:(0,c.jsx)(C.default,{children:t&&Object.entries(t).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ex.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,c.jsx)(q.Z,{min:0,step:.01})}),(0,c.jsx)(I.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,c.jsx)(M,{min:0,step:.01})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},ll=t(16853);function la(e){let{userData:s,onCancel:t,onSubmit:l,teams:a,accessToken:r,userID:i,userRole:n,userModels:o,possibleUIRoles:m,isBulkEdit:u=!1}=e,[x]=I.Z.useForm();return d.useEffect(()=>{var e,t,l,a,r;x.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_role:null===(t=s.user_info)||void 0===t?void 0:t.user_role,models:(null===(l=s.user_info)||void 0===l?void 0:l.models)||[],max_budget:null===(a=s.user_info)||void 0===a?void 0:a.max_budget,metadata:(null===(r=s.user_info)||void 0===r?void 0:r.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,x]),(0,c.jsxs)(I.Z,{form:x,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}l(e)},layout:"vertical",children:[!u&&(0,c.jsx)(I.Z.Item,{label:"User ID",name:"user_id",children:(0,c.jsx)(y.Z,{disabled:!0})}),!u&&(0,c.jsx)(I.Z.Item,{label:"Email",name:"user_email",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Global Proxy Role"," ",(0,c.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,c.jsx)(U.Z,{})})]}),name:"user_role",children:(0,c.jsx)(C.default,{children:m&&Object.entries(m).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(ex.Z,{value:s,title:t,children:(0,c.jsxs)("div",{className:"flex",children:[t," ",(0,c.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:l})]})},s)})})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Personal Models"," ",(0,c.jsx)(z.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!eL.ZL.includes(n||""),children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),o.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(ll.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:t,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})]})}let{Text:lr,Title:li}=eh.default;var ln=e=>{let{visible:s,onCancel:t,selectedUsers:l,possibleUIRoles:a,accessToken:r,onSuccess:i,teams:n,userRole:o,userModels:m}=e,[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)(null),[v,_]=(0,d.useState)(!1),y=()=>{p([]),f(null),_(!1),t()},b=async e=>{if(!r){P.ZP.error("Access token not found");return}x(!0);try{let s=l.map(e=>e.user_id),a={};e.user_role&&""!==e.user_role&&(a.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(a.max_budget=e.max_budget),e.models&&e.models.length>0&&(a.models=e.models),e.metadata&&Object.keys(e.metadata).length>0&&(a.metadata=e.metadata);let n=Object.keys(a).length>0,o=v&&h.length>0;if(!n&&!o){P.ZP.error("Please modify at least one field or select teams to add users to");return}let c=[];if(n&&(await (0,g.userBulkUpdateUserCall)(r,a,s),c.push("Updated ".concat(s.length," user(s)"))),o){let e=[];for(let s of h)try{let t=l.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null})),a=await (0,g.teamBulkMemberAddCall)(r,s,t,j||void 0);e.push({teamId:s,success:!0,successfulAdditions:a.successful_additions,failedAdditions:a.failed_additions})}catch(t){console.error("Failed to add users to team ".concat(s,":"),t),e.push({teamId:s,success:!1,error:t})}let s=e.filter(e=>e.success),t=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);c.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}t.length>0&&P.ZP.warning("Failed to add users to ".concat(t.length," team(s)"))}c.length>0&&P.ZP.success(c.join(". ")),p([]),f(null),_(!1),i(),t()}catch(e){console.error("Bulk operation failed:",e),P.ZP.error("Failed to perform bulk operations")}finally{x(!1)}};return(0,c.jsxs)(E.Z,{visible:s,onCancel:y,footer:null,title:"Bulk Edit ".concat(l.length," User(s)"),width:800,children:[(0,c.jsxs)("div",{className:"mb-4",children:[(0,c.jsxs)(li,{level:5,children:["Selected Users (",l.length,"):"]}),(0,c.jsx)(ej.Z,{size:"small",bordered:!0,dataSource:l,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,c.jsx)(lr,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,c.jsx)(lr,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,c.jsx)(lr,{style:{fontSize:"12px"},children:(null==a?void 0:null===(s=a[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,c.jsx)(lr,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,c.jsx)(Q.Z,{}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsxs)(lr,{children:[(0,c.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,c.jsx)(tp.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,c.jsxs)(tW.Z,{direction:"vertical",style:{width:"100%"},children:[(0,c.jsx)(s4.Z,{checked:v,onChange:e=>_(e.target.checked),children:"Add selected users to teams"}),v&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(lr,{strong:!0,children:"Select Teams:"}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select teams to add users to",value:h,onChange:p,style:{width:"100%",marginTop:8},options:(null==n?void 0:n.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(lr,{strong:!0,children:"Team Budget (Optional):"}),(0,c.jsx)(q.Z,{placeholder:"Max budget per user in team",value:j,onChange:e=>f(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,c.jsx)(lr,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,c.jsx)(lr,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,c.jsx)(la,{userData:{user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:n||[]},onCancel:y,onSubmit:b,teams:n,accessToken:r,userID:"bulk_edit",userRole:o,userModels:m,possibleUIRoles:a,isBulkEdit:!0}),u&&(0,c.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,c.jsxs)(lr,{children:["Updating ",l.length," user(s)..."]})})]})};let lo=(e,s,t,l,a,r)=>{let i=[{header:"User ID",accessorKey:"user_id",cell:e=>{let{row:s}=e;return(0,c.jsx)(z.Z,{title:s.original.user_id,children:(0,c.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"User Email",accessorKey:"user_email",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",cell:s=>{var t;let{row:l}=s;return(0,c.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(t=e[l.original.user_role])||void 0===t?void 0:t.ui_label)||"-"})}},{header:"User Spend ($ USD)",accessorKey:"spend",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.spend?eR(s.original.spend,4):"-"})}},{header:"User Max Budget ($ USD)",accessorKey:"max_budget",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{children:"SSO ID"}),(0,c.jsx)(z.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,c.jsx)(tV.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"API Keys",accessorKey:"key_count",cell:e=>{let{row:s}=e;return(0,c.jsx)(v.Z,{numItems:2,children:s.original.key_count>0?(0,c.jsxs)(eY.Z,{size:"xs",color:"indigo",children:[s.original.key_count," Keys"]}):(0,c.jsx)(eY.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e;return(0,c.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(z.Z,{title:"Edit user details",zIndex:9999,children:(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>a(s.original.user_id,!0)})}),(0,c.jsx)(z.Z,{title:"Delete user",zIndex:9999,children:(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>t(s.original.user_id)})}),(0,c.jsx)(z.Z,{title:"Reset Password",zIndex:9999,children:(0,c.jsx)(sf.Z,{icon:e2.Z,size:"sm",onClick:()=>l(s.original.user_id)})})]})}}];if(r){let{onSelectUser:e,onSelectAll:s,isUserSelected:t,isAllSelected:l,isIndeterminate:a}=r;return[{id:"select",header:()=>(0,c.jsx)(s4.Z,{indeterminate:a,checked:l,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:l}=s;return(0,c.jsx)(s4.Z,{checked:t(l.original),onChange:s=>e(l.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...i]}return i};function lc(e){var s,t,l,a,r,i,n,o,m,u,x,h,p,j,f,y,b,N,Z,S,C,I,E,A,L,O,M;let{userId:D,onClose:F,accessToken:R,userRole:q,onDelete:U,possibleUIRoles:z,initialTab:V=0,startInEditMode:K=!1}=e,[B,G]=(0,d.useState)(null),[H,J]=(0,d.useState)(!1),[Y,W]=(0,d.useState)(!0),[$,Q]=(0,d.useState)(K),[ee,es]=(0,d.useState)([]),[et,ea]=(0,d.useState)(!1),[er,ei]=(0,d.useState)(null),[en,eo]=(0,d.useState)(null),[ec,ed]=(0,d.useState)(V),[em,eu]=(0,d.useState)({});d.useEffect(()=>{eo((0,g.getProxyBaseUrl)())},[]),d.useEffect(()=>{console.log("userId: ".concat(D,", userRole: ").concat(q,", accessToken: ").concat(R)),(async()=>{try{if(!R)return;let e=await (0,g.userInfoCall)(R,D,q||"",!1,null,null,!0);G(e);let s=(await (0,g.modelAvailableCall)(R,D,q||"")).data.map(e=>e.id);es(s)}catch(e){console.error("Error fetching user data:",e),P.ZP.error("Failed to fetch user data")}finally{W(!1)}})()},[R,D,q]);let ex=async()=>{if(!R){P.ZP.error("Access token not found");return}try{P.ZP.success("Generating password reset link...");let e=await (0,g.invitationCreateCall)(R,D);ei(e),ea(!0)}catch(e){P.ZP.error("Failed to generate password reset link")}},eh=async()=>{try{if(!R)return;await (0,g.userDeleteCall)(R,[D]),P.ZP.success("User deleted successfully"),U&&U(),F()}catch(e){console.error("Error deleting user:",e),P.ZP.error("Failed to delete user")}},eg=async e=>{try{if(!R||!B)return;await (0,g.userUpdateUserCall)(R,e,null),G({...B,user_info:{...B.user_info,user_email:e.user_email,models:e.models,max_budget:e.max_budget,metadata:e.metadata}}),P.ZP.success("User updated successfully"),Q(!1)}catch(e){console.error("Error updating user:",e),P.ZP.error("Failed to update user")}};if(Y)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(w.Z,{children:"Loading user data..."})]});if(!B)return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(w.Z,{children:"User not found"})]});let ej=async(e,s)=>{await eq(e)&&(eu(e=>({...e,[s]:!0})),setTimeout(()=>{eu(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:F,className:"mb-4",children:"Back to Users"}),(0,c.jsx)(k.Z,{children:(null===(s=B.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:B.user_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:em["user-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>ej(B.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(em["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),q&&eL.LQ.includes(q)&&(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)(_.Z,{icon:e2.Z,variant:"secondary",onClick:ex,className:"flex items-center",children:"Reset Password"}),(0,c.jsx)(_.Z,{icon:el.Z,variant:"secondary",onClick:()=>J(!0),className:"flex items-center",children:"Delete User"})]})]}),H&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:eh,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>J(!1),children:"Cancel"})]})]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:ec,onIndexChange:ed,children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"}),(0,c.jsx)(eW.Z,{children:"Details"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Spend"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eR((null===(t=B.user_info)||void 0===t?void 0:t.spend)||0,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",(null===(l=B.user_info)||void 0===l?void 0:l.max_budget)!==null?"$".concat(eR(B.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Teams"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(w.Z,{children:[(null===(a=B.teams)||void 0===a?void 0:a.length)||0," teams"]})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"API Keys"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(w.Z,{children:[(null===(r=B.keys)||void 0===r?void 0:r.length)||0," keys"]})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Personal Models"}),(0,c.jsx)("div",{className:"mt-2",children:(null===(n=B.user_info)||void 0===n?void 0:null===(i=n.models)||void 0===i?void 0:i.length)&&(null===(m=B.user_info)||void 0===m?void 0:null===(o=m.models)||void 0===o?void 0:o.length)>0?null===(x=B.user_info)||void 0===x?void 0:null===(u=x.models)||void 0===u?void 0:u.map((e,s)=>(0,c.jsx)(w.Z,{children:e},s)):(0,c.jsx)(w.Z,{children:"All proxy models"})})]})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"User Settings"}),!$&&q&&eL.LQ.includes(q)&&(0,c.jsx)(_.Z,{variant:"light",onClick:()=>Q(!0),children:"Edit Settings"})]}),$&&B?(0,c.jsx)(la,{userData:B,onCancel:()=>Q(!1),onSubmit:eg,teams:B.teams,accessToken:R,userID:D,userRole:q,userModels:ee,possibleUIRoles:z}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"User ID"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"font-mono",children:B.user_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:em["user-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>ej(B.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(em["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Email"}),(0,c.jsx)(w.Z,{children:(null===(h=B.user_info)||void 0===h?void 0:h.user_email)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Role"}),(0,c.jsx)(w.Z,{children:(null===(p=B.user_info)||void 0===p?void 0:p.user_role)||"Not Set"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:(null===(j=B.user_info)||void 0===j?void 0:j.created_at)?new Date(B.user_info.created_at).toLocaleString():"Unknown"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(w.Z,{children:(null===(f=B.user_info)||void 0===f?void 0:f.updated_at)?new Date(B.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Teams"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(y=B.teams)||void 0===y?void 0:y.length)&&(null===(b=B.teams)||void 0===b?void 0:b.length)>0?null===(N=B.teams)||void 0===N?void 0:N.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e.team_alias||e.team_id},s)):(0,c.jsx)(w.Z,{children:"No teams"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(S=B.user_info)||void 0===S?void 0:null===(Z=S.models)||void 0===Z?void 0:Z.length)&&(null===(I=B.user_info)||void 0===I?void 0:null===(C=I.models)||void 0===C?void 0:C.length)>0?null===(A=B.user_info)||void 0===A?void 0:null===(E=A.models)||void 0===E?void 0:E.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,c.jsx)(w.Z,{children:"All proxy models"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"API Keys"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(L=B.keys)||void 0===L?void 0:L.length)&&(null===(O=B.keys)||void 0===O?void 0:O.length)>0?B.keys.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,c.jsx)(w.Z,{children:"No API keys"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(M=B.user_info)||void 0===M?void 0:M.metadata)||{},null,2)})]})]})]})})]})]}),(0,c.jsx)(ep,{isInvitationLinkModalVisible:et,setIsInvitationLinkModalVisible:ea,baseUrl:en||"",invitationLinkData:er,modalType:"resetPassword"})]})}function ld(e){let{data:s=[],columns:t,isLoading:l=!1,onSortChange:a,currentSort:r,accessToken:i,userRole:n,possibleUIRoles:o,handleEdit:m,handleDelete:u,handleResetPassword:x,selectedUsers:h=[],onSelectionChange:p,enableSelection:g=!1}=e,[j,f]=d.useState([{id:(null==r?void 0:r.sortBy)||"created_at",desc:(null==r?void 0:r.sortOrder)==="desc"}]),[v,_]=d.useState(null),[y,b]=d.useState(!1),N=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_(e),b(s)},Z=(e,s)=>{p&&(s?p([...h,e]):p(h.filter(s=>s.user_id!==e.user_id)))},w=e=>{p&&(e?p(s):p([]))},k=e=>h.some(s=>s.user_id===e.user_id),S=s.length>0&&h.length===s.length,C=h.length>0&&h.length<s.length,I=d.useMemo(()=>o?lo(o,m,u,x,N,g?{selectedUsers:h,onSelectUser:Z,onSelectAll:w,isUserSelected:k,isAllSelected:S,isIndeterminate:C}:void 0):t,[o,m,u,x,N,t,g,h,S,C]),P=(0,sg.b7)({data:s,columns:I,state:{sorting:j},onSortingChange:e=>{if(f(e),e.length>0){let s=e[0],t=s.id,l=s.desc?"desc":"asc";null==a||a(t,l)}},getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0});return(d.useEffect(()=>{r&&f([{id:r.sortBy,desc:"desc"===r.sortOrder}])},[r]),v)?(0,c.jsx)(lc,{userId:v,onClose:()=>{_(null),b(!1)},accessToken:i,userRole:n,possibleUIRoles:o,initialTab:y?1:0,startInEditMode:y}):(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(t3.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(t3.ss,{children:P.getHeaderGroups().map(e=>(0,c.jsx)(t3.SC,{children:e.headers.map(e=>(0,c.jsx)(t3.xs,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(t3.RM,{children:l?(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:I.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?P.getRowModel().rows.map(e=>(0,c.jsx)(t3.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(t3.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&N(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(t3.SC,{children:(0,c.jsx)(t3.pj,{colSpan:I.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No users found"})})})})})]})})})}var lm=t(67982),lu=t(87908),lx=e=>{var s;let{accessToken:t,possibleUIRoles:l,userID:a,userRole:r}=e,[i,n]=(0,d.useState)(!0),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)({}),[j,f]=(0,d.useState)(!1),[v,b]=(0,d.useState)([]),{Paragraph:N}=eh.default,{Option:Z}=C.default;(0,d.useEffect)(()=>{(async()=>{if(!t){n(!1);return}try{let e=await (0,g.getInternalUserSettings)(t);if(m(e),p(e.values||{}),t)try{let e=await (0,g.modelAvailableCall)(t,a,r);if(e&&e.data){let s=e.data.map(e=>e.id);b(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),P.ZP.error("Failed to fetch SSO settings")}finally{n(!1)}})()},[t]);let S=async()=>{if(t){f(!0);try{let e=Object.entries(h).reduce((e,s)=>{let[t,l]=s;return e[t]=""===l?null:l,e},{}),s=await (0,g.updateInternalUserSettings)(t,e);m({...o,values:s.settings}),x(!1)}catch(e){console.error("Error updating SSO settings:",e),P.ZP.error("Failed to update settings: "+e)}finally{f(!1)}}},I=(e,s)=>{p(t=>({...t,[e]:s}))},E=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],A=e=>{let s=E(e),t=(e,t,l)=>{let a=[...s];a[e]={...a[e],[t]:l},I("teams",a)},l=e=>{I("teams",s.filter((s,t)=>t!==e))};return(0,c.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,c.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["Team ",s+1]}),(0,c.jsx)(_.Z,{size:"sm",variant:"secondary",icon:ey.Z,onClick:()=>l(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,c.jsx)(y.Z,{value:e.team_id,onChange:e=>t(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,c.jsx)(q.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>t(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,c.jsxs)(C.default,{style:{width:"100%"},value:e.user_role,onChange:e=>t(s,"user_role",e),children:[(0,c.jsx)(Z,{value:"user",children:"User"}),(0,c.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,c.jsx)(_.Z,{variant:"secondary",icon:td.Z,onClick:()=>{I("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},T=(e,s,t)=>{var a;let r=s.type;if("teams"===e)return(0,c.jsx)("div",{className:"mt-2",children:A(h[e]||[])});if("user_role"===e&&l)return(0,c.jsx)(C.default,{style:{width:"100%"},value:h[e]||"",onChange:s=>I(e,s),className:"mt-2",children:Object.entries(l).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:t,description:l}]=e;return(0,c.jsx)(Z,{value:s,children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{children:t}),(0,c.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:l})]})},s)})});if("budget_duration"===e)return(0,c.jsx)(eD,{value:h[e]||null,onChange:s=>I(e,s),className:"mt-2"});if("boolean"===r)return(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(to.Z,{checked:!!h[e],onChange:s=>I(e,s)})});if("array"===r&&(null===(a=s.items)||void 0===a?void 0:a.enum))return(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:h[e]||[],onChange:s=>I(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,c.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,c.jsxs)(C.default,{mode:"multiple",style:{width:"100%"},value:h[e]||[],onChange:s=>I(e,s),className:"mt-2",children:[(0,c.jsx)(Z,{value:"no-default-models",children:"No Default Models"}),v.map(e=>(0,c.jsx)(Z,{value:e,children:F(e)},e))]});if("string"===r&&s.enum)return(0,c.jsx)(C.default,{style:{width:"100%"},value:h[e]||"",onChange:s=>I(e,s),className:"mt-2",children:s.enum.map(e=>(0,c.jsx)(Z,{value:e,children:e},e))});else return(0,c.jsx)(y.Z,{value:void 0!==h[e]?String(h[e]):"",onChange:s=>I(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},L=(e,s)=>{if(null==s)return(0,c.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,c.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=E(s);return(0,c.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,c.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,c.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,c.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat(eR(e.max_budget_in_team,4)):"No limit"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,c.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&l&&l[s]){let{ui_label:e,description:t}=l[s];return(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-medium",children:e}),t&&(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:t})]})}return"budget_duration"===e?(0,c.jsx)("span",{children:eM(s)}):"boolean"==typeof s?(0,c.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:F(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,c.jsx)("span",{children:String(s)})};return i?(0,c.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,c.jsx)(lu.Z,{size:"large"})}):o?(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Default User Settings"}),!i&&o&&(u?(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{x(!1),p(o.values||{})},disabled:j,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:S,loading:j,children:"Save Changes"})]}):(0,c.jsx)(_.Z,{onClick:()=>x(!0),children:"Edit Settings"}))]}),(null==o?void 0:null===(s=o.field_schema)||void 0===s?void 0:s.description)&&(0,c.jsx)(N,{className:"mb-4",children:o.field_schema.description}),(0,c.jsx)(lm.Z,{}),(0,c.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=o;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,l]=s,a=e[t],r=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,c.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,c.jsx)(w.Z,{className:"font-medium text-lg",children:r}),(0,c.jsx)(N,{className:"text-sm text-gray-500 mt-1",children:l.description||"No description available"}),u?(0,c.jsx)("div",{className:"mt-2",children:T(t,l,a)}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:L(t,a)})]},t)}):(0,c.jsx)(w.Z,{children:"No schema information available"})})()})]}):(0,c.jsx)(X.Z,{children:(0,c.jsx)(w.Z,{children:"No settings available or you do not have permission to view them."})})},lh=t(19616);let lp={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var lg=e=>{var s;let{accessToken:t,token:l,userRole:a,userID:r,teams:i}=e,n=(0,h.NL)(),[o,m]=(0,d.useState)(1),[u,x]=(0,d.useState)(!1),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)(!1),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)("users"),[w,k]=(0,d.useState)(lp),[S,C,I]=(0,lh.G)(w,{wait:300}),[E,A]=(0,d.useState)(!1),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(null),[D,F]=(0,d.useState)(null),[R,q]=(0,d.useState)([]),[U,z]=(0,d.useState)(!1),[V,K]=(0,d.useState)(!1),[B,G]=(0,d.useState)([]),H=e=>{b(e),v(!0)};(0,d.useEffect)(()=>()=>{I.cancel()},[I]),(0,d.useEffect)(()=>{F((0,g.getProxyBaseUrl)())},[]),(0,d.useEffect)(()=>{(async()=>{try{if(!r||!a||!t)return;let e=(await (0,g.modelAvailableCall)(t,r,a)).data.map(e=>e.id);console.log("available_model_names:",e),G(e)}catch(e){console.error("Error fetching user models:",e)}})()},[t,r,a]);let J=e=>{k(s=>{let t={...s,...e};return C(t),t})},Y=async e=>{if(!t){P.ZP.error("Access token not found");return}try{P.ZP.success("Generating password reset link...");let s=await (0,g.invitationCreateCall)(t,e);M(s),L(!0)}catch(e){P.ZP.error("Failed to generate password reset link")}},W=async()=>{if(y&&t)try{await (0,g.userDeleteCall)(t,[y]),n.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==y);return{...e,users:s}}),P.ZP.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),P.ZP.error("Failed to delete user")}v(!1),b(null)},$=async()=>{j(null),x(!1)},Q=async e=>{if(console.log("inside handleEditSubmit:",e),t&&l&&a&&r){try{let s=await (0,g.userUpdateUserCall)(t,e,null);n.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let t=e.users.map(e=>e.user_id===s.data.user_id?eF(e,s.data):e);return{...e,users:t}}),P.ZP.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}j(null),x(!1)}},X=async e=>{m(e)},ee=(0,sm.a)({queryKey:["userList",{debouncedFilter:S,currentPage:o}],queryFn:async()=>{if(!t)throw Error("Access token required");return await (0,g.userListCall)(t,S.user_id?[S.user_id]:null,o,25,S.email||null,S.user_role||null,S.team||null,S.sso_user_id||null,S.sort_by,S.sort_order)},enabled:!!(t&&l&&a&&r),placeholderData:e=>e}),es=ee.data,et=(0,sm.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!t)throw Error("Access token required");return await (0,g.getPossibleUserRoles)(t)},enabled:!!(t&&l&&a&&r)}).data;if(ee.isLoading||!t||!l||!a||!r)return(0,c.jsx)("div",{children:"Loading..."});let el=lo(et,e=>{j(e),x(!0)},H,Y,()=>{});return(0,c.jsxs)("div",{className:"w-full p-6",children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)(eE,{userID:r,accessToken:t,teams:i,possibleUIRoles:et}),(0,c.jsx)(_.Z,{onClick:()=>{K(!V),q([])},variant:V?"primary":"secondary",className:"flex items-center",children:V?"Cancel Selection":"Select Users"}),V&&(0,c.jsxs)(_.Z,{onClick:()=>{if(0===R.length){P.ZP.error("Please select users to edit");return}z(!0)},disabled:0===R.length,className:"flex items-center",children:["Bulk Edit (",R.length," selected)"]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:0,onIndexChange:e=>Z(0===e?"users":"settings"),children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Users"}),(0,c.jsx)(eW.Z,{children:"Default User Settings"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by email...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.email,onChange:e=>J({email:e.target.value})}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(E?"bg-gray-100":""),onClick:()=>A(!E),children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(w.user_id||w.user_role||w.team)&&(0,c.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{J(lp)},children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),E&&(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Filter by User ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.user_id,onChange:e=>J({user_id:e.target.value})}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eJ.Z,{value:w.user_role,onValueChange:e=>J({user_role:e}),placeholder:"Select Role",children:Object.entries(et).map(e=>{let[s,t]=e;return(0,c.jsx)(ex.Z,{value:s,children:t.ui_label},s)})})}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eJ.Z,{value:w.team,onValueChange:e=>J({team:e}),placeholder:"Select Team",children:null==i?void 0:i.map(e=>(0,c.jsx)(ex.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,c.jsx)("div",{className:"relative w-64",children:(0,c.jsx)("input",{type:"text",placeholder:"Filter by SSO ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w.sso_user_id,onChange:e=>J({sso_user_id:e.target.value})})})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",es&&es.users&&es.users.length>0?(es.page-1)*es.page_size+1:0," ","-"," ",es&&es.users?Math.min(es.page*es.page_size,es.total):0," ","of ",es?es.total:0," results"]}),(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{onClick:()=>X(o-1),disabled:1===o,className:"px-3 py-1 text-sm border rounded-md ".concat(1===o?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,c.jsx)("button",{onClick:()=>X(o+1),disabled:!es||o>=es.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!es||o>=es.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,c.jsx)(ld,{data:(null===(s=ee.data)||void 0===s?void 0:s.users)||[],columns:el,isLoading:ee.isLoading,accessToken:t,userRole:a,onSortChange:(e,s)=>{J({sort_by:e,sort_order:s})},currentSort:{sortBy:w.sort_by,sortOrder:w.sort_order},possibleUIRoles:et,handleEdit:e=>{j(e),x(!0)},handleDelete:H,handleResetPassword:Y,enableSelection:V,selectedUsers:R,onSelectionChange:e=>{q(e)}})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lx,{accessToken:t,possibleUIRoles:et,userID:r,userRole:a})})]})]}),(0,c.jsx)(lt,{visible:u,possibleUIRoles:et,onCancel:$,user:p,onSubmit:Q}),f&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete User"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this user?"}),(0,c.jsxs)("p",{className:"text-sm font-medium text-gray-900 mt-2",children:["User ID: ",y]})]})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:W,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{v(!1),b(null)},children:"Cancel"})]})]})]})}),(0,c.jsx)(ep,{isInvitationLinkModalVisible:T,setIsInvitationLinkModalVisible:L,baseUrl:D||"",invitationLinkData:O,modalType:"resetPassword"}),(0,c.jsx)(ln,{visible:U,onCancel:()=>z(!1),selectedUsers:R,possibleUIRoles:et,accessToken:t,onSuccess:()=>{n.invalidateQueries({queryKey:["userList"]}),q([]),K(!1)},teams:i,userRole:a,userModels:B})]})},lj=e=>{var s;let{accessToken:t,userID:l,userRole:a}=e,[r,i]=(0,d.useState)(!0),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)({}),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)([]),{Paragraph:b}=eh.default,{Option:N}=C.default;(0,d.useEffect)(()=>{(async()=>{if(!t){i(!1);return}try{let e=await (0,g.getDefaultTeamSettings)(t);if(o(e),h(e.values||{}),t)try{let e=await (0,g.modelAvailableCall)(t,l,a);if(e&&e.data){let s=e.data.map(e=>e.id);v(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching team SSO settings:",e),P.ZP.error("Failed to fetch team settings")}finally{i(!1)}})()},[t]);let Z=async()=>{if(t){j(!0);try{let e=await (0,g.updateDefaultTeamSettings)(t,x);o({...n,values:e.settings}),u(!1),P.ZP.success("Default team settings updated successfully")}catch(e){console.error("Error updating team settings:",e),P.ZP.error("Failed to update team settings")}finally{j(!1)}}},S=(e,s)=>{h(t=>({...t,[e]:s}))},I=(e,s,t)=>{var l;let a=s.type;return"budget_duration"===e?(0,c.jsx)(eD,{value:x[e]||null,onChange:s=>S(e,s),className:"mt-2"}):"boolean"===a?(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(to.Z,{checked:!!x[e],onChange:s=>S(e,s)})}):"array"===a&&(null===(l=s.items)||void 0===l?void 0:l.enum)?(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:x[e]||[],onChange:s=>S(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,c.jsx)(N,{value:e,children:e},e))}):"models"===e?(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},value:x[e]||[],onChange:s=>S(e,s),className:"mt-2",children:f.map(e=>(0,c.jsx)(N,{value:e,children:F(e)},e))}):"string"===a&&s.enum?(0,c.jsx)(C.default,{style:{width:"100%"},value:x[e]||"",onChange:s=>S(e,s),className:"mt-2",children:s.enum.map(e=>(0,c.jsx)(N,{value:e,children:e},e))}):(0,c.jsx)(y.Z,{value:void 0!==x[e]?String(x[e]):"",onChange:s=>S(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},E=(e,s)=>null==s?(0,c.jsx)("span",{className:"text-gray-400",children:"Not set"}):"budget_duration"===e?(0,c.jsx)("span",{children:eM(s)}):"boolean"==typeof s?(0,c.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:F(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,c.jsx)("span",{className:"text-gray-400",children:"None"}):(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,c.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,c.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,c.jsx)("span",{children:String(s)});return r?(0,c.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,c.jsx)(lu.Z,{size:"large"})}):n?(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{className:"text-xl",children:"Default Team Settings"}),!r&&n&&(m?(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{u(!1),h(n.values||{})},disabled:p,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:Z,loading:p,children:"Save Changes"})]}):(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Settings"}))]}),(0,c.jsx)(w.Z,{children:"These settings will be applied by default when creating new teams."}),(null==n?void 0:null===(s=n.field_schema)||void 0===s?void 0:s.description)&&(0,c.jsx)(b,{className:"mb-4 mt-2",children:n.field_schema.description}),(0,c.jsx)(lm.Z,{}),(0,c.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=n;return s&&s.properties?Object.entries(s.properties).map(s=>{let[t,l]=s,a=e[t],r=t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,c.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,c.jsx)(w.Z,{className:"font-medium text-lg",children:r}),(0,c.jsx)(b,{className:"text-sm text-gray-500 mt-1",children:l.description||"No description available"}),m?(0,c.jsx)("div",{className:"mt-2",children:I(t,l,a)}):(0,c.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:E(t,a)})]},t)}):(0,c.jsx)(w.Z,{children:"No schema information available"})})()})]}):(0,c.jsx)(X.Z,{children:(0,c.jsx)(w.Z,{children:"No team settings available or you do not have permission to view them."})})},lf=e=>{let{accessToken:s,userID:t}=e,[l,a]=(0,d.useState)([]);(0,d.useEffect)(()=>{(async()=>{if(s&&t)try{let e=await (0,g.availableTeamListCall)(s);a(e)}catch(e){console.error("Error fetching available teams:",e)}})()},[s,t]);let r=async e=>{if(s&&t)try{await (0,g.teamMemberAddCall)(s,e,{user_id:t,role:"user"}),P.ZP.success("Successfully joined team"),a(s=>s.filter(s=>s.team_id!==e))}catch(e){console.error("Error joining team:",e),P.ZP.error("Failed to join team")}};return(0,c.jsx)(X.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Team Name"}),(0,c.jsx)(sN.Z,{children:"Description"}),(0,c.jsx)(sN.Z,{children:"Members"}),(0,c.jsx)(sN.Z,{children:"Models"}),(0,c.jsx)(sN.Z,{children:"Actions"})]})}),(0,c.jsxs)(s_.Z,{children:[l.map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:e.team_alias})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:e.description||"No description available"})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{children:[e.members_with_roles.length," members"]})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)("div",{className:"flex flex-col",children:e.models&&0!==e.models.length?e.models.map((e,s)=>(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(e.slice(0,30),"..."):e})},s)):(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})})})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(_.Z,{size:"xs",variant:"secondary",onClick:()=>r(e.team_id),children:"Join Team"})})]},e.team_id)),0===l.length&&(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:5,className:"text-center",children:(0,c.jsx)(w.Z,{children:"No available teams to join"})})})]})]})})};let lv=(e,s)=>{let t=[];return e&&e.models.length>0?(console.log("organization.models: ".concat(e.models)),t=e.models):t=s,R(t,s)};var l_=e=>{let{teams:s,searchParams:t,accessToken:l,setTeams:a,userID:r,userRole:i,organizations:n,premiumUser:o=!1}=e,[m,u]=(0,d.useState)(""),[x,h]=(0,d.useState)(null),[p,k]=(0,d.useState)(null),[S,A]=(0,d.useState)(!1),[O,R]=(0,d.useState)({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"});(0,d.useEffect)(()=>{console.log("inside useeffect - ".concat(m)),l&&j(l,r,i,x,a),ez()},[m]);let[q]=I.Z.useForm(),[V]=I.Z.useForm(),{Title:K,Paragraph:B}=eh.default,[G,H]=(0,d.useState)(""),[Y,$]=(0,d.useState)(!1),[Q,ee]=(0,d.useState)(null),[es,et]=(0,d.useState)(null),[ea,er]=(0,d.useState)(!1),[ei,en]=(0,d.useState)(!1),[eo,ec]=(0,d.useState)(!1),[ed,em]=(0,d.useState)(!1),[ep,eg]=(0,d.useState)([]),[ej,ef]=(0,d.useState)(!1),[ev,e_]=(0,d.useState)(null),[ey,eb]=(0,d.useState)([]),[eN,eZ]=(0,d.useState)({}),[ew,ek]=(0,d.useState)([]),[eS,eC]=(0,d.useState)({}),[eI,eP]=(0,d.useState)([]),[eE,eA]=(0,d.useState)([]),[eT,eO]=(0,d.useState)(!1);(0,d.useEffect)(()=>{console.log("currentOrgForCreateTeam: ".concat(p));let e=lv(p,ep);console.log("models: ".concat(e)),eb(e),q.setFieldValue("models",[])},[p,ep]),(0,d.useEffect)(()=>{(async()=>{try{if(null==l)return;let e=(await (0,g.getGuardrailsList)(l)).guardrails.map(e=>e.guardrail_name);ek(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[l]);let eM=async()=>{try{if(null==l)return;let e=await (0,g.fetchMCPAccessGroups)(l);eA(e)}catch(e){console.error("Failed to fetch MCP access groups:",e)}};(0,d.useEffect)(()=>{eM()},[l]),(0,d.useEffect)(()=>{s&&eZ(s.reduce((e,s)=>(e[s.team_id]={keys:s.keys||[],team_info:{members_with_roles:s.members_with_roles||[]}},e),{}))},[s]);let eD=async e=>{e_(e),ef(!0)},eq=async()=>{if(null!=ev&&null!=s&&null!=l){try{await (0,g.teamDeleteCall)(l,ev),j(l,r,i,x,a)}catch(e){console.error("Error deleting the team:",e)}ef(!1),e_(null)}};(0,d.useEffect)(()=>{(async()=>{try{if(null===r||null===i||null===l)return;let e=await D(r,i,l);e&&eg(e)}catch(e){console.error("Error fetching user models:",e)}})()},[l,r,i,s]);let eU=async e=>{try{if(console.log("formValues: ".concat(JSON.stringify(e))),null!=l){var t,r,i;let n=null==e?void 0:e.team_alias,o=null!==(i=null==s?void 0:s.map(e=>e.team_alias))&&void 0!==i?i:[],c=(null==e?void 0:e.organization_id)||(null==x?void 0:x.organization_id);if(""===c||"string"!=typeof c?e.organization_id=null:e.organization_id=c.trim(),o.includes(n))throw Error("Team alias ".concat(n," already exists, please pick another alias"));if(P.ZP.info("Creating Team"),eI.length>0){let s={};if(e.metadata)try{s=JSON.parse(e.metadata)}catch(e){console.warn("Invalid JSON in metadata field, starting with empty object")}s={...s,logging:eI.filter(e=>e.callback_name)},e.metadata=JSON.stringify(s)}if((e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(t=e.allowed_mcp_servers_and_groups.servers)||void 0===t?void 0:t.length)>0||(null===(r=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===r?void 0:r.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups)){let{servers:s,accessGroups:t}=e.allowed_mcp_servers_and_groups;s&&s.length>0&&(e.object_permission.mcp_servers=s),t&&t.length>0&&(e.object_permission.mcp_access_groups=t),delete e.allowed_mcp_servers_and_groups}e.allowed_mcp_access_groups&&e.allowed_mcp_access_groups.length>0&&(e.object_permission||(e.object_permission={}),e.object_permission.mcp_access_groups=e.allowed_mcp_access_groups,delete e.allowed_mcp_access_groups);let d=await (0,g.teamCreateCall)(l,e);null!==s?a([...s,d]):a([d]),console.log("response for team create call: ".concat(d)),P.ZP.success("Team created"),q.resetFields(),eP([]),en(!1)}}catch(e){console.error("Error creating the team:",e),P.ZP.error("Error creating the team: "+e,20)}},ez=()=>{u(new Date().toLocaleString())},eV=(e,s)=>{let t={...O,[e]:s};R(t),l&&(0,g.v2TeamListCall)(l,t.organization_id||null,null,t.team_id||null,t.team_alias||null).then(e=>{e&&e.teams&&a(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})};return(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"==i||"Org Admin"==i)&&(0,c.jsx)(_.Z,{className:"w-fit",onClick:()=>en(!0),children:"+ Create New Team"}),es?(0,c.jsx)(tl,{teamId:es,onUpdate:e=>{a(s=>{if(null==s)return s;let t=s.map(s=>e.team_id===s.team_id?eF(s,e):s);return l&&j(l,r,i,x,a),t})},onClose:()=>{et(null),er(!1)},accessToken:l,is_team_admin:(e=>{if(null==e||null==e.members_with_roles)return!1;for(let s=0;s<e.members_with_roles.length;s++){let t=e.members_with_roles[s];if(t.user_id==r&&"admin"==t.role)return!0}return!1})(null==s?void 0:s.find(e=>e.team_id===es)),is_proxy_admin:"Admin"==i,userModels:ep,editTeam:ea}):(0,c.jsxs)(e$.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eW.Z,{children:"Your Teams"}),(0,c.jsx)(eW.Z,{children:"Available Teams"}),(0,eL.tY)(i||"")&&(0,c.jsx)(eW.Z,{children:"Default Team Settings"})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[m&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",m]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center",onClick:ez})]})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(w.Z,{children:["Click on “Team ID” to view team details"," ",(0,c.jsx)("b",{children:"and"})," manage team members."]}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by Team Name...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:O.team_alias,onChange:e=>eV("team_alias",e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(S?"bg-gray-100":""),onClick:()=>A(!S),children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(O.team_id||O.team_alias||O.organization_id)&&(0,c.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,c.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{R({team_id:"",team_alias:"",organization_id:"",sort_by:"created_at",sort_order:"desc"}),l&&(0,g.v2TeamListCall)(l,null,r||null,null,null).then(e=>{e&&e.teams&&a(e.teams)}).catch(e=>{console.error("Error fetching teams:",e)})},children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),S&&(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Enter Team ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:O.team_id,onChange:e=>eV("team_id",e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,c.jsx)("div",{className:"w-64",children:(0,c.jsx)(eJ.Z,{value:O.organization_id||"",onValueChange:e=>eV("organization_id",e),placeholder:"Select Organization",children:null==n?void 0:n.map(e=>(0,c.jsx)(ex.Z,{value:e.organization_id||"",children:e.organization_alias||e.organization_id},e.organization_id))})})]})]})}),(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Team Name"}),(0,c.jsx)(sN.Z,{children:"Team ID"}),(0,c.jsx)(sN.Z,{children:"Created"}),(0,c.jsx)(sN.Z,{children:"Spend (USD)"}),(0,c.jsx)(sN.Z,{children:"Budget (USD)"}),(0,c.jsx)(sN.Z,{children:"Models"}),(0,c.jsx)(sN.Z,{children:"Organization"}),(0,c.jsx)(sN.Z,{children:"Info"})]})}),(0,c.jsx)(s_.Z,{children:s&&s.length>0?s.filter(e=>!x||e.organization_id===x.organization_id).sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.team_alias}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.team_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>{et(e.team_id)},children:[e.team_id.slice(0,7),"..."]})})})}),(0,c.jsx)(sy.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,c.jsx)(sy.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:eR(e.spend,4)}),(0,c.jsx)(sy.Z,{style:{maxWidth:"4px",whiteSpace:"pre-wrap",overflow:"hidden"},children:null!==e.max_budget&&void 0!==e.max_budget?e.max_budget:"No limit"}),(0,c.jsx)(sy.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,c.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,c.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sf.Z,{icon:eS[e.team_id]?sw.Z:sk.Z,className:"cursor-pointer",size:"xs",onClick:()=>{eC(s=>({...s,[e.team_id]:!s[e.team_id]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),e.models.length>3&&!eS[e.team_id]&&(0,c.jsx)(eY.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),eS[e.team_id]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}),(0,c.jsx)(sy.Z,{children:e.organization_id}),(0,c.jsxs)(sy.Z,{children:[(0,c.jsxs)(w.Z,{children:[eN&&e.team_id&&eN[e.team_id]&&eN[e.team_id].keys&&eN[e.team_id].keys.length," ","Keys"]}),(0,c.jsxs)(w.Z,{children:[eN&&e.team_id&&eN[e.team_id]&&eN[e.team_id].team_info&&eN[e.team_id].team_info.members_with_roles&&eN[e.team_id].team_info.members_with_roles.length," ","Members"]})]}),(0,c.jsx)(sy.Z,{children:"Admin"==i?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{et(e.team_id),er(!0)}}),(0,c.jsx)(sf.Z,{onClick:()=>eD(e.team_id),icon:el.Z,size:"sm"})]}):null})]},e.team_id)):null})]}),ej&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Team"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this team ?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:eq,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{ef(!1),e_(null)},children:"Cancel"})]})]})]})})]})})})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lf,{accessToken:l,userID:r})}),(0,eL.tY)(i||"")&&(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lj,{accessToken:l,userID:r||"",userRole:i||""})})]})]}),("Admin"==i||"Org Admin"==i)&&(0,c.jsx)(E.Z,{title:"Create Team",visible:ei,width:1e3,footer:null,onOk:()=>{en(!1),q.resetFields(),eP([])},onCancel:()=>{en(!1),q.resetFields(),eP([])},children:(0,c.jsxs)(I.Z,{form:q,onFinish:eU,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Organization"," ",(0,c.jsx)(z.Z,{title:(0,c.jsxs)("span",{children:["Organizations can have multiple teams. Learn more about"," ",(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/user_management_heirarchy",target:"_blank",rel:"noopener noreferrer",style:{color:"#1890ff",textDecoration:"underline"},onClick:e=>e.stopPropagation(),children:"user management hierarchy"})]}),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"organization_id",initialValue:x?x.organization_id:null,className:"mt-8",children:(0,c.jsx)(C.default,{showSearch:!0,allowClear:!0,placeholder:"Search or select an Organization",onChange:e=>{q.setFieldValue("organization_id",e),k((null==n?void 0:n.find(s=>s.organization_id===e))||null)},filterOption:(e,s)=>{var t;return!!s&&((null===(t=s.children)||void 0===t?void 0:t.toString())||"").toLowerCase().includes(e.toLowerCase())},optionFilterProp:"children",children:null==n?void 0:n.map(e=>(0,c.jsxs)(C.default.Option,{value:e.organization_id,children:[(0,c.jsx)("span",{className:"font-medium",children:e.organization_alias})," ",(0,c.jsxs)("span",{className:"text-gray-500",children:["(",e.organization_id,")"]})]},e.organization_id))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Models"," ",(0,c.jsx)(z.Z,{title:"These are the models that your selected team has access to",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),ey.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",onClick:()=>{eT||(eM(),eO(!0))},children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Additional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Team ID",name:"team_id",help:"ID of the team you want to create. If not provided, it will be generated automatically.",children:(0,c.jsx)(y.Z,{onChange:e=>{e.target.value=e.target.value.trim()}})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",normalize:e=>e?Number(e):void 0,tooltip:"This is the individual budget for a user in the team.",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,c.jsx)(y.Z,{placeholder:"e.g., 30d"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",help:"Additional team metadata. Enter metadata as JSON object.",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Guardrails"," ",(0,c.jsx)(z.Z,{title:"Setup your first guardrail",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-8",help:"Select existing guardrails or enter new ones",children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:ew.map(e=>({value:e,label:e}))})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this team can access by default. Leave empty for access to all vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-8",help:"Select vector stores this team can access. Leave empty for access to all vector stores",children:(0,c.jsx)(J,{onChange:e=>q.setFieldValue("allowed_vector_store_ids",e),value:q.getFieldValue("allowed_vector_store_ids"),accessToken:l||"",placeholder:"Select vector stores (optional)",premiumUser:o})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers or access groups this team can access by default. ",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-8",help:"Select MCP servers or access groups this team can access. ",children:(0,c.jsx)(W,{onChange:e=>q.setFieldValue("allowed_mcp_servers_and_groups",e),value:q.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:l||"",placeholder:"Select MCP servers or access groups (optional)",premiumUser:o})})]})]}),(0,c.jsxs)(b.Z,{className:"mt-8 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Logging Settings"})}),(0,c.jsx)(N.Z,{children:(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(eu,{value:eI,onChange:eP,premiumUser:o})})})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create Team"})})]})})]})})})},ly=e=>{var s,t,l,a,r;let{organizationId:i,onClose:n,accessToken:o,is_org_admin:m,is_proxy_admin:u,userModels:x,editOrg:h}=e,[p,j]=(0,d.useState)(null),[f,b]=(0,d.useState)(!0),[N]=I.Z.useForm(),[Z,S]=(0,d.useState)(!1),[E,A]=(0,d.useState)(!1),[O,D]=(0,d.useState)(!1),[R,q]=(0,d.useState)(null),[U,z]=(0,d.useState)({}),V=m||u,K=async()=>{try{if(b(!0),!o)return;let e=await (0,g.organizationInfoCall)(o,i);j(e)}catch(e){P.ZP.error("Failed to load organization information"),console.error("Error fetching organization info:",e)}finally{b(!1)}};(0,d.useEffect)(()=>{K()},[i,o]);let B=async e=>{try{if(null==o)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.organizationMemberAddCall)(o,i,s),P.ZP.success("Organization member added successfully"),A(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to add organization member"),console.error("Error adding organization member:",e)}},G=async e=>{try{if(!o)return;let s={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,g.organizationMemberUpdateCall)(o,i,s),P.ZP.success("Organization member updated successfully"),D(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to update organization member"),console.error("Error updating organization member:",e)}},J=async e=>{try{if(!o)return;await (0,g.organizationMemberDeleteCall)(o,i,e.user_id),P.ZP.success("Organization member deleted successfully"),D(!1),N.resetFields(),K()}catch(e){P.ZP.error("Failed to delete organization member"),console.error("Error deleting organization member:",e)}},W=async e=>{try{if(!o)return;let s={organization_id:i,organization_alias:e.organization_alias,models:e.models,litellm_budget_table:{tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration},metadata:e.metadata?JSON.parse(e.metadata):null};if((void 0!==e.vector_stores||void 0!==e.mcp_servers_and_groups)&&(s.object_permission={...null==p?void 0:p.object_permission,vector_stores:e.vector_stores||[]},void 0!==e.mcp_servers_and_groups)){let{servers:t,accessGroups:l}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};t&&t.length>0&&(s.object_permission.mcp_servers=t),l&&l.length>0&&(s.object_permission.mcp_access_groups=l)}await (0,g.organizationUpdateCall)(o,s),P.ZP.success("Organization settings updated successfully"),S(!1),K()}catch(e){P.ZP.error("Failed to update organization settings"),console.error("Error updating organization:",e)}};if(f)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!p)return(0,c.jsx)("div",{className:"p-4",children:"Organization not found"});let $=async(e,s)=>{await eq(e)&&(z(e=>({...e,[s]:!0})),setTimeout(()=>{z(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,onClick:n,variant:"light",className:"mb-4",children:"Back to Organizations"}),(0,c.jsx)(k.Z,{children:p.organization_alias}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:p.organization_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:U["org-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>$(p.organization_id,"org-id"),className:"left-2 z-10 transition-all duration-200 ".concat(U["org-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:h?2:0,children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"}),(0,c.jsx)(eW.Z,{children:"Members"}),(0,c.jsx)(eW.Z,{children:"Settings"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Organization Details"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["Created: ",new Date(p.created_at).toLocaleDateString()]}),(0,c.jsxs)(w.Z,{children:["Updated: ",new Date(p.updated_at).toLocaleDateString()]}),(0,c.jsxs)(w.Z,{children:["Created By: ",p.created_by]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Budget Status"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(k.Z,{children:["$",eR(p.spend,4)]}),(0,c.jsxs)(w.Z,{children:["of"," ",null===p.litellm_budget_table.max_budget?"Unlimited":"$".concat(eR(p.litellm_budget_table.max_budget,4))]}),p.litellm_budget_table.budget_duration&&(0,c.jsxs)(w.Z,{className:"text-gray-500",children:["Reset: ",p.litellm_budget_table.budget_duration]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Rate Limits"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsxs)(w.Z,{children:["TPM: ",p.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,c.jsxs)(w.Z,{children:["RPM: ",p.litellm_budget_table.rpm_limit||"Unlimited"]}),p.litellm_budget_table.max_parallel_requests&&(0,c.jsxs)(w.Z,{children:["Max Parallel Requests: ",p.litellm_budget_table.max_parallel_requests]})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Models"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===p.models.length?(0,c.jsx)(eY.Z,{color:"red",children:"All proxy models"}):p.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Teams"}),(0,c.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:null===(s=p.teams)||void 0===s?void 0:s.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e.team_id},s))})]}),(0,c.jsx)(sa,{objectPermission:p.object_permission,variant:"card",accessToken:o})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(X.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[75vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"User ID"}),(0,c.jsx)(sN.Z,{children:"Role"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{children:"Created At"}),(0,c.jsx)(sN.Z,{})]})}),(0,c.jsx)(s_.Z,{children:null===(t=p.members)||void 0===t?void 0:t.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_id})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{className:"font-mono",children:e.user_role})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{children:["$",eR(e.spend,4)]})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:new Date(e.created_at).toLocaleString()})}),(0,c.jsx)(sy.Z,{children:V&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{q({role:e.user_role,user_email:e.user_email,user_id:e.user_id}),D(!0)}}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>{J(e)}})]})})]},s))})]})}),V&&(0,c.jsx)(_.Z,{onClick:()=>{A(!0)},children:"Add Member"})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Organization Settings"}),V&&!Z&&(0,c.jsx)(_.Z,{onClick:()=>S(!0),children:"Edit Settings"})]}),Z?(0,c.jsxs)(I.Z,{form:N,onFinish:W,initialValues:{organization_alias:p.organization_alias,models:p.models,tpm_limit:p.litellm_budget_table.tpm_limit,rpm_limit:p.litellm_budget_table.rpm_limit,max_budget:p.litellm_budget_table.max_budget,budget_duration:p.litellm_budget_table.budget_duration,metadata:p.metadata?JSON.stringify(p.metadata,null,2):"",vector_stores:(null===(l=p.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=p.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(r=p.object_permission)||void 0===r?void 0:r.mcp_access_groups)||[]}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),x.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,style:{width:"100%"}})}),(0,c.jsx)(I.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,c.jsx)(H,{onChange:e=>N.setFieldValue("vector_stores",e),value:N.getFieldValue("vector_stores"),accessToken:o||"",placeholder:"Select vector stores"})}),(0,c.jsx)(I.Z.Item,{label:"MCP Servers & Access Groups",name:"mcp_servers_and_groups",children:(0,c.jsx)(Y,{onChange:e=>N.setFieldValue("mcp_servers_and_groups",e),value:N.getFieldValue("mcp_servers_and_groups"),accessToken:o||"",placeholder:"Select MCP servers and access groups"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,c.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,c.jsx)(T.ZP,{onClick:()=>S(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization Name"}),(0,c.jsx)("div",{children:p.organization_alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Organization ID"}),(0,c.jsx)("div",{className:"font-mono",children:p.organization_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:new Date(p.created_at).toLocaleString()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Models"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:p.models.map((e,s)=>(0,c.jsx)(eY.Z,{color:"red",children:e},s))})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Rate Limits"}),(0,c.jsxs)("div",{children:["TPM: ",p.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,c.jsxs)("div",{children:["RPM: ",p.litellm_budget_table.rpm_limit||"Unlimited"]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Budget"}),(0,c.jsxs)("div",{children:["Max:"," ",null!==p.litellm_budget_table.max_budget?"$".concat(eR(p.litellm_budget_table.max_budget,4)):"No Limit"]}),(0,c.jsxs)("div",{children:["Reset: ",p.litellm_budget_table.budget_duration||"Never"]})]}),(0,c.jsx)(sa,{objectPermission:p.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:o})]})]})})]})]}),(0,c.jsx)(tt,{isVisible:E,onCancel:()=>A(!1),onSubmit:B,accessToken:o,title:"Add Organization Member",roles:[{label:"org_admin",value:"org_admin",description:"Can add and remove members, and change their roles."},{label:"internal_user",value:"internal_user",description:"Can view/create keys for themselves within organization."},{label:"internal_user_viewer",value:"internal_user_viewer",description:"Can only view their keys within organization."}],defaultRole:"internal_user"}),(0,c.jsx)(ts,{visible:O,onCancel:()=>D(!1),onSubmit:G,initialData:R,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Org Admin",value:"org_admin"},{label:"Internal User",value:"internal_user"},{label:"Internal User Viewer",value:"internal_user_viewer"}]}})]})};let lb=async(e,s)=>{s(await (0,g.organizationListCall)(e))};var lN=e=>{let{organizations:s,userRole:t,userModels:l,accessToken:a,lastRefreshed:r,handleRefreshClick:i,currentOrg:n,guardrailsList:o=[],setOrganizations:m,premiumUser:u}=e,[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(!1),[b,N]=(0,d.useState)(!1),[Z,k]=(0,d.useState)(null),[S,A]=(0,d.useState)(!1),[T]=I.Z.useForm(),[O,D]=(0,d.useState)({});(0,d.useEffect)(()=>{a&&lb(a,m)},[a]);let R=e=>{e&&(k(e),N(!0))},q=async()=>{if(Z&&a)try{await (0,g.organizationDeleteCall)(a,Z),P.ZP.success("Organization deleted successfully"),N(!1),k(null),lb(a,m)}catch(e){console.error("Error deleting organization:",e)}},V=async e=>{try{var s,t,l,r;if(!a)return;console.log("values in organizations new create call: ".concat(JSON.stringify(e))),(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(s=e.allowed_mcp_servers_and_groups.servers)||void 0===s?void 0:s.length)>0||(null===(t=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===t?void 0:t.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(l=e.allowed_mcp_servers_and_groups.servers)||void 0===l?void 0:l.length)>0&&(e.object_permission.mcp_servers=e.allowed_mcp_servers_and_groups.servers),(null===(r=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===r?void 0:r.length)>0&&(e.object_permission.mcp_access_groups=e.allowed_mcp_servers_and_groups.accessGroups),delete e.allowed_mcp_servers_and_groups)),await (0,g.organizationCreateCall)(a,e),A(!1),T.resetFields(),lb(a,m)}catch(e){console.error("Error creating organization:",e)}};return u?(0,c.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(f.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"===t||"Org Admin"===t)&&(0,c.jsx)(_.Z,{className:"w-fit",onClick:()=>A(!0),children:"+ Create New Organization"}),x?(0,c.jsx)(ly,{organizationId:x,onClose:()=>{h(null),j(!1)},accessToken:a,is_org_admin:!0,is_proxy_admin:"Admin"===t,userModels:l,editOrg:p}):(0,c.jsxs)(e$.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsx)("div",{className:"flex",children:(0,c.jsx)(eW.Z,{children:"Your Organizations"})}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",r]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center",onClick:i})]})]}),(0,c.jsx)(e0.Z,{children:(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(w.Z,{children:"Click on “Organization ID” to view organization details."}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(X.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Organization ID"}),(0,c.jsx)(sN.Z,{children:"Organization Name"}),(0,c.jsx)(sN.Z,{children:"Created"}),(0,c.jsx)(sN.Z,{children:"Spend (USD)"}),(0,c.jsx)(sN.Z,{children:"Budget (USD)"}),(0,c.jsx)(sN.Z,{children:"Models"}),(0,c.jsx)(sN.Z,{children:"TPM / RPM Limits"}),(0,c.jsx)(sN.Z,{children:"Info"}),(0,c.jsx)(sN.Z,{children:"Actions"})]})}),(0,c.jsx)(s_.Z,{children:s&&s.length>0?s.sort((e,s)=>new Date(s.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>{var s,l,a,r,i,n,o,d,m;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.organization_id,children:(0,c.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>h(e.organization_id),children:[null===(s=e.organization_id)||void 0===s?void 0:s.slice(0,7),"..."]})})})}),(0,c.jsx)(sy.Z,{children:e.organization_alias}),(0,c.jsx)(sy.Z,{children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,c.jsx)(sy.Z,{children:eR(e.spend,4)}),(0,c.jsx)(sy.Z,{children:(null===(l=e.litellm_budget_table)||void 0===l?void 0:l.max_budget)!==null&&(null===(a=e.litellm_budget_table)||void 0===a?void 0:a.max_budget)!==void 0?null===(r=e.litellm_budget_table)||void 0===r?void 0:r.max_budget:"No limit"}),(0,c.jsx)(sy.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,c.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,c.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,c.jsx)("div",{children:(0,c.jsx)(sf.Z,{icon:O[e.organization_id||""]?sw.Z:sk.Z,className:"cursor-pointer",size:"xs",onClick:()=>{D(s=>({...s,[e.organization_id||""]:!s[e.organization_id||""]}))}})}),(0,c.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s)),e.models.length>3&&!O[e.organization_id||""]&&(0,c.jsx)(eY.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,c.jsxs)(w.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),O[e.organization_id||""]&&(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,s)=>"all-proxy-models"===e?(0,c.jsx)(eY.Z,{size:"xs",color:"red",children:(0,c.jsx)(w.Z,{children:"All Proxy Models"})},s+3):(0,c.jsx)(eY.Z,{size:"xs",color:"blue",children:(0,c.jsx)(w.Z,{children:e.length>30?"".concat(F(e).slice(0,30),"..."):F(e)})},s+3))})]})]})})}):null})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{children:["TPM:"," ",(null===(i=e.litellm_budget_table)||void 0===i?void 0:i.tpm_limit)?null===(n=e.litellm_budget_table)||void 0===n?void 0:n.tpm_limit:"Unlimited",(0,c.jsx)("br",{}),"RPM:"," ",(null===(o=e.litellm_budget_table)||void 0===o?void 0:o.rpm_limit)?null===(d=e.litellm_budget_table)||void 0===d?void 0:d.rpm_limit:"Unlimited"]})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(w.Z,{children:[(null===(m=e.members)||void 0===m?void 0:m.length)||0," Members"]})}),(0,c.jsx)(sy.Z,{children:"Admin"===t&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{h(e.organization_id),j(!0)}}),(0,c.jsx)(sf.Z,{onClick:()=>R(e.organization_id),icon:el.Z,size:"sm"})]})})]},e.organization_id)}):null})]})})})})]})})]})]})}),(0,c.jsx)(E.Z,{title:"Create Organization",visible:S,width:800,footer:null,onCancel:()=>{A(!1),T.resetFields()},children:(0,c.jsxs)(I.Z,{form:T,onFinish:V,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Models",name:"models",children:(0,c.jsxs)(C.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,c.jsx)(C.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),l&&l.length>0&&l.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))]})}),(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(M,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})}),(0,c.jsx)(I.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,c.jsx)(M,{step:1,width:400})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,c.jsx)(z.Z,{title:"Select which vector stores this organization can access by default. Leave empty for access to all vector stores",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this organization can access. Leave empty for access to all vector stores",children:(0,c.jsx)(H,{onChange:e=>T.setFieldValue("allowed_vector_store_ids",e),value:T.getFieldValue("allowed_vector_store_ids"),accessToken:a||"",placeholder:"Select vector stores (optional)"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,c.jsx)(z.Z,{title:"Select which MCP servers and access groups this organization can access by default.",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers and access groups this organization can access.",children:(0,c.jsx)(Y,{onChange:e=>T.setFieldValue("allowed_mcp_servers_and_groups",e),value:T.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:a||"",placeholder:"Select MCP servers and access groups (optional)"})}),(0,c.jsx)(I.Z.Item,{label:"Metadata",name:"metadata",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(_.Z,{type:"submit",children:"Create Organization"})})]})}),b?(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Organization"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this organization?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:q,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{N(!1),k(null)},children:"Cancel"})]})]})]})}):(0,c.jsx)(c.Fragment,{})]}):(0,c.jsx)("div",{children:(0,c.jsxs)(w.Z,{children:["This is a LiteLLM Enterprise feature, and requires a valid key to use. Get a trial key"," ",(0,c.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})},lZ=t(94789);let lw={google:"https://artificialanalysis.ai/img/logos/google_small.svg",microsoft:"https://upload.wikimedia.org/wikipedia/commons/a/a8/Microsoft_Azure_Logo.svg",okta:"https://www.okta.com/sites/default/files/Okta_Logo_BrightBlue_Medium.png",generic:""},lk={google:{envVarMap:{google_client_id:"GOOGLE_CLIENT_ID",google_client_secret:"GOOGLE_CLIENT_SECRET"},fields:[{label:"GOOGLE CLIENT ID",name:"google_client_id"},{label:"GOOGLE CLIENT SECRET",name:"google_client_secret"}]},microsoft:{envVarMap:{microsoft_client_id:"MICROSOFT_CLIENT_ID",microsoft_client_secret:"MICROSOFT_CLIENT_SECRET",microsoft_tenant:"MICROSOFT_TENANT"},fields:[{label:"MICROSOFT CLIENT ID",name:"microsoft_client_id"},{label:"MICROSOFT CLIENT SECRET",name:"microsoft_client_secret"},{label:"MICROSOFT TENANT",name:"microsoft_tenant"}]},okta:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"GENERIC CLIENT ID",name:"generic_client_id"},{label:"GENERIC CLIENT SECRET",name:"generic_client_secret"},{label:"AUTHORIZATION ENDPOINT",name:"generic_authorization_endpoint",placeholder:"https://your-okta-domain/authorize"},{label:"TOKEN ENDPOINT",name:"generic_token_endpoint",placeholder:"https://your-okta-domain/token"},{label:"USERINFO ENDPOINT",name:"generic_userinfo_endpoint",placeholder:"https://your-okta-domain/userinfo"}]},generic:{envVarMap:{generic_client_id:"GENERIC_CLIENT_ID",generic_client_secret:"GENERIC_CLIENT_SECRET",generic_authorization_endpoint:"GENERIC_AUTHORIZATION_ENDPOINT",generic_token_endpoint:"GENERIC_TOKEN_ENDPOINT",generic_userinfo_endpoint:"GENERIC_USERINFO_ENDPOINT"},fields:[{label:"GENERIC CLIENT ID",name:"generic_client_id"},{label:"GENERIC CLIENT SECRET",name:"generic_client_secret"},{label:"AUTHORIZATION ENDPOINT",name:"generic_authorization_endpoint"},{label:"TOKEN ENDPOINT",name:"generic_token_endpoint"},{label:"USERINFO ENDPOINT",name:"generic_userinfo_endpoint"}]}};var lS=e=>{let{isAddSSOModalVisible:s,isInstructionsModalVisible:t,handleAddSSOOk:l,handleAddSSOCancel:a,handleShowInstructions:r,handleInstructionsOk:i,handleInstructionsCancel:n,form:o,accessToken:m,ssoConfigured:u=!1}=e,[x,h]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(s&&m)try{let s=await (0,g.getSSOSettings)(m);if(console.log("Raw SSO data received:",s),s&&s.values){console.log("SSO values:",s.values),console.log("user_email from API:",s.values.user_email);let l=null;if(s.values.google_client_id)l="google";else if(s.values.microsoft_client_id)l="microsoft";else if(s.values.generic_client_id){var e,t;l=(null===(e=s.values.generic_authorization_endpoint)||void 0===e?void 0:e.includes("okta"))||(null===(t=s.values.generic_authorization_endpoint)||void 0===t?void 0:t.includes("auth0"))?"okta":"generic"}let a={sso_provider:l,proxy_base_url:s.values.proxy_base_url,user_email:s.values.user_email,...s.values};console.log("Setting form values:",a),o.resetFields(),setTimeout(()=>{o.setFieldsValue(a),console.log("Form values set, current form values:",o.getFieldsValue())},100)}}catch(e){console.error("Failed to load SSO settings:",e)}})()},[s,m,o]);let p=async e=>{if(!m){P.ZP.error("No access token available");return}try{await (0,g.updateSSOSettings)(m,e),r(e)}catch(e){console.error("Failed to save SSO settings:",e),P.ZP.error("Failed to save SSO settings")}},j=async()=>{if(!m){P.ZP.error("No access token available");return}try{await (0,g.updateSSOSettings)(m,{google_client_id:"",google_client_secret:"",microsoft_client_id:"",microsoft_client_secret:"",microsoft_tenant:"",generic_client_id:"",generic_client_secret:"",generic_authorization_endpoint:"",generic_token_endpoint:"",generic_userinfo_endpoint:"",proxy_base_url:"",user_email:"",sso_provider:""}),o.resetFields(),h(!1),l(),P.ZP.success("SSO settings cleared successfully")}catch(e){console.error("Failed to clear SSO settings:",e),P.ZP.error("Failed to clear SSO settings")}},f=e=>{let s=lk[e];return s?s.fields.map(e=>(0,c.jsx)(I.Z.Item,{label:e.label,name:e.name,rules:[{required:!0,message:"Please enter the ".concat(e.label.toLowerCase())}],children:e.name.includes("client")?(0,c.jsx)(L.default.Password,{}):(0,c.jsx)(y.Z,{placeholder:e.placeholder})},e.name)):null};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(E.Z,{title:u?"Edit SSO Settings":"Add SSO",visible:s,width:800,footer:null,onOk:l,onCancel:a,children:(0,c.jsxs)(I.Z,{form:o,onFinish:p,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"SSO Provider",name:"sso_provider",rules:[{required:!0,message:"Please select an SSO provider"}],children:(0,c.jsx)(C.default,{children:Object.entries(lw).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:s,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0"},children:[t&&(0,c.jsx)("img",{src:t,alt:s,style:{height:24,width:24,marginRight:12,objectFit:"contain"}}),(0,c.jsxs)("span",{children:[s.charAt(0).toUpperCase()+s.slice(1)," SSO"]})]})},s)})})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.sso_provider!==s.sso_provider,children:e=>{let{getFieldValue:s}=e,t=s("sso_provider");return t?f(t):null}}),(0,c.jsx)(I.Z.Item,{label:"Proxy Admin Email",name:"user_email",rules:[{required:!0,message:"Please enter the email of the proxy admin"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"PROXY BASE URL",name:"proxy_base_url",rules:[{required:!0,message:"Please enter the proxy base url"}],children:(0,c.jsx)(y.Z,{})})]}),(0,c.jsxs)("div",{style:{textAlign:"right",marginTop:"10px",display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px"},children:[u&&(0,c.jsx)(T.ZP,{onClick:()=>h(!0),style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#5558eb",e.currentTarget.style.borderColor="#5558eb"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1",e.currentTarget.style.borderColor="#6366f1"},children:"Clear"}),(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})]})]})}),(0,c.jsxs)(E.Z,{title:"Confirm Clear SSO Settings",visible:x,onOk:j,onCancel:()=>h(!1),okText:"Yes, Clear",cancelText:"Cancel",okButtonProps:{danger:!0,style:{backgroundColor:"#dc2626",borderColor:"#dc2626"}},children:[(0,c.jsx)("p",{children:"Are you sure you want to clear all SSO settings? This action cannot be undone."}),(0,c.jsx)("p",{children:"Users will no longer be able to login using SSO after this change."})]}),(0,c.jsxs)(E.Z,{title:"SSO Setup Instructions",visible:t,width:800,footer:null,onOk:i,onCancel:n,children:[(0,c.jsx)("p",{children:"Follow these steps to complete the SSO setup:"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"1. DO NOT Exit this TAB"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"2. Open a new tab, visit your proxy base url"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"3. Confirm your SSO is configured correctly and you can login on the new Tab"}),(0,c.jsx)(w.Z,{className:"mt-2",children:"4. If Step 3 is successful, you can close this tab"}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{onClick:i,children:"Done"})})]})]})},lC=t(62272),lI=t(92403),lP=t(29271),lE=t(34419);let lA=e=>{if(!e)return"An unknown error occurred";if("string"==typeof e)return e;if(e.message)try{let s=JSON.parse(e.message);if(s.error&&s.error.message)return s.error.message;return"string"==typeof s?s:JSON.stringify(s,null,2)}catch(s){return e.message}if(e.response&&e.response.data){if("string"==typeof e.response.data)return e.response.data;if(e.response.data.message)return e.response.data.message;if(e.response.data.error)return"string"==typeof e.response.data.error?e.response.data.error:e.response.data.error.message||JSON.stringify(e.response.data.error)}return String(e)};var lT=e=>{let{accessToken:s,userID:t,proxySettings:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)("<your_proxy_base_url>");(0,d.useEffect)(()=>{let e="<your_proxy_base_url>";u(l&&l.PROXY_BASE_URL&&void 0!==l.PROXY_BASE_URL?l.PROXY_BASE_URL:window.location.origin)},[l]);let x="".concat(m,"/scim/v2"),h=async e=>{if(!s||!t){P.ZP.error("You need to be logged in to create a SCIM token");return}try{i(!0);let l={key_alias:e.key_alias||"SCIM Access Token",team_id:null,models:[],allowed_routes:["/scim/*"]},a=await (0,g.keyCreateCall)(s,t,l);o(a),P.ZP.success("SCIM token created successfully")}catch(e){console.error("Error creating SCIM token:",e),P.ZP.error("Failed to create SCIM token: "+lA(e))}finally{i(!1)}};return(0,c.jsx)(v.Z,{numItems:1,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)("div",{className:"flex items-center mb-4",children:(0,c.jsx)(k.Z,{children:"SCIM Configuration"})}),(0,c.jsx)(w.Z,{className:"text-gray-600",children:"System for Cross-domain Identity Management (SCIM) allows you to automatically provision and manage users and groups in LiteLLM."}),(0,c.jsx)(lm.Z,{}),(0,c.jsxs)("div",{className:"space-y-8",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"1"}),(0,c.jsxs)(k.Z,{className:"text-lg flex items-center",children:[(0,c.jsx)(lC.Z,{className:"h-5 w-5 mr-2"}),"SCIM Tenant URL"]})]}),(0,c.jsx)(w.Z,{className:"text-gray-600 mb-3",children:"Use this URL in your identity provider SCIM integration settings."}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(y.Z,{value:x,disabled:!0,className:"flex-grow"}),(0,c.jsx)(S.CopyToClipboard,{text:x,onCopy:()=>P.ZP.success("URL copied to clipboard"),children:(0,c.jsxs)(_.Z,{variant:"primary",className:"ml-2 flex items-center",children:[(0,c.jsx)(tI.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-blue-100 text-blue-700 mr-2",children:"2"}),(0,c.jsxs)(k.Z,{className:"text-lg flex items-center",children:[(0,c.jsx)(lI.Z,{className:"h-5 w-5 mr-2"}),"Authentication Token"]})]}),(0,c.jsx)(lZ.Z,{title:"Using SCIM",color:"blue",className:"mb-4",children:"You need a SCIM token to authenticate with the SCIM API. Create one below and use it in your SCIM provider configuration."}),n?(0,c.jsxs)(X.Z,{className:"border border-yellow-300 bg-yellow-50",children:[(0,c.jsxs)("div",{className:"flex items-center mb-2 text-yellow-800",children:[(0,c.jsx)(lP.Z,{className:"h-5 w-5 mr-2"}),(0,c.jsx)(k.Z,{className:"text-lg text-yellow-800",children:"Your SCIM Token"})]}),(0,c.jsx)(w.Z,{className:"text-yellow-800 mb-4 font-medium",children:"Make sure to copy this token now. You will not be able to see it again."}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(y.Z,{value:n.key,className:"flex-grow mr-2 bg-white",type:"password",disabled:!0}),(0,c.jsx)(S.CopyToClipboard,{text:n.key,onCopy:()=>P.ZP.success("Token copied to clipboard"),children:(0,c.jsxs)(_.Z,{variant:"primary",className:"flex items-center",children:[(0,c.jsx)(tI.Z,{className:"h-4 w-4 mr-1"}),"Copy"]})})]}),(0,c.jsxs)(_.Z,{className:"mt-4 flex items-center",variant:"secondary",onClick:()=>o(null),children:[(0,c.jsx)(lE.Z,{className:"h-4 w-4 mr-1"}),"Create Another Token"]})]}):(0,c.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,c.jsxs)(I.Z,{form:a,onFinish:h,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{name:"key_alias",label:"Token Name",rules:[{required:!0,message:"Please enter a name for your token"}],children:(0,c.jsx)(y.Z,{placeholder:"SCIM Access Token"})}),(0,c.jsx)(I.Z.Item,{children:(0,c.jsxs)(_.Z,{variant:"primary",type:"submit",loading:r,className:"flex items-center",children:[(0,c.jsx)(lI.Z,{className:"h-4 w-4 mr-1"}),"Create SCIM Token"]})})]})})]})]})]})})},lL=e=>{let{accessToken:s,onSuccess:t}=e,[l]=I.Z.useForm(),[a,r]=(0,d.useState)(!1);(0,d.useEffect)(()=>{(async()=>{if(s)try{let e=await (0,g.getSSOSettings)(s);if(e&&e.values){let s=e.values.ui_access_mode,t={};s&&"object"==typeof s?t={ui_access_mode_type:s.type,restricted_sso_group:s.restricted_sso_group,sso_group_jwt_field:s.sso_group_jwt_field}:"string"==typeof s&&(t={ui_access_mode_type:s,restricted_sso_group:e.values.restricted_sso_group,sso_group_jwt_field:e.values.team_ids_jwt_field||e.values.sso_group_jwt_field}),l.setFieldsValue(t)}}catch(e){console.error("Failed to load UI access settings:",e)}})()},[s,l]);let i=async e=>{if(!s){P.ZP.error("No access token available");return}r(!0);try{let l={ui_access_mode:{type:e.ui_access_mode_type,restricted_sso_group:e.restricted_sso_group,sso_group_jwt_field:e.sso_group_jwt_field}};await (0,g.updateSSOSettings)(s,l),t()}catch(e){console.error("Failed to save UI access settings:",e),P.ZP.error("Failed to save UI access settings")}finally{r(!1)}};return(0,c.jsxs)("div",{style:{padding:"16px"},children:[(0,c.jsx)("div",{style:{marginBottom:"16px"},children:(0,c.jsx)(w.Z,{style:{fontSize:"14px",color:"#6b7280"},children:"Configure who can access the UI interface and how group information is extracted from JWT tokens."})}),(0,c.jsxs)(I.Z,{form:l,onFinish:i,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"UI Access Mode",name:"ui_access_mode_type",tooltip:"Controls who can access the UI interface",children:(0,c.jsxs)(C.default,{placeholder:"Select access mode",children:[(0,c.jsx)(C.default.Option,{value:"all_authenticated_users",children:"All Authenticated Users"}),(0,c.jsx)(C.default.Option,{value:"restricted_sso_group",children:"Restricted SSO Group"})]})}),(0,c.jsx)(I.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.ui_access_mode_type!==s.ui_access_mode_type,children:e=>{let{getFieldValue:s}=e;return"restricted_sso_group"===s("ui_access_mode_type")?(0,c.jsx)(I.Z.Item,{label:"Restricted SSO Group",name:"restricted_sso_group",rules:[{required:!0,message:"Please enter the restricted SSO group"}],children:(0,c.jsx)(y.Z,{placeholder:"ui-access-group"})}):null}}),(0,c.jsx)(I.Z.Item,{label:"SSO Group JWT Field",name:"sso_group_jwt_field",tooltip:"JWT field name that contains team/group information. Use dot notation to access nested fields.",children:(0,c.jsx)(y.Z,{placeholder:"groups"})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"16px"},children:(0,c.jsx)(T.ZP,{type:"primary",htmlType:"submit",loading:a,style:{backgroundColor:"#6366f1",borderColor:"#6366f1"},children:"Update UI Access Control"})})]})]})},lO=t(382),lM=e=>{let{searchParams:s,accessToken:t,userID:l,showSSOBanner:a,premiumUser:r,proxySettings:i,userRole:n}=e,[o]=I.Z.useForm(),[u]=I.Z.useForm(),{Title:x,Paragraph:h}=eh.default,[p,j]=(0,d.useState)(""),[f,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(!1),[w,k]=(0,d.useState)(!1),[S,C]=(0,d.useState)(!1),[A,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)(!1),[F,R]=(0,d.useState)(!1),[q,U]=(0,d.useState)(!1),[z,V]=(0,d.useState)(!1),[K,B]=(0,d.useState)(!1),[G,H]=(0,d.useState)(!1),[J,Y]=(0,d.useState)([]),[W,$]=(0,d.useState)(null),[Q,ee]=(0,d.useState)(!1);(0,m.useRouter)();let[es,et]=(0,d.useState)(null);console.log=function(){};let el=sp(),ea="All IP Addresses Allowed",er=el;er+="/fallback/login";let ei=async()=>{if(t&&r)try{let e=await (0,g.getSSOSettings)(t);if(console.log("SSO data:",e),e&&e.values){let s=e.values.google_client_id&&e.values.google_client_secret,t=e.values.microsoft_client_id&&e.values.microsoft_client_secret,l=e.values.generic_client_id&&e.values.generic_client_secret;ee(s||t||l)}else ee(!1)}catch(e){console.error("Error checking SSO configuration:",e),ee(!1)}},en=async()=>{try{if(!0!==r){P.ZP.error("This feature is only available for premium users. Please upgrade your account.");return}if(t){let e=await (0,g.getAllowedIPs)(t);Y(e&&e.length>0?e:[ea])}else Y([ea])}catch(e){console.error("Error fetching allowed IPs:",e),P.ZP.error("Failed to fetch allowed IPs ".concat(e)),Y([ea])}finally{!0===r&&U(!0)}},eo=async e=>{try{if(t){await (0,g.addAllowedIP)(t,e.ip);let s=await (0,g.getAllowedIPs)(t);Y(s),P.ZP.success("IP address added successfully")}}catch(e){console.error("Error adding IP:",e),P.ZP.error("Failed to add IP address ".concat(e))}finally{V(!1)}},ec=async e=>{$(e),B(!0)},ed=async()=>{if(W&&t)try{await (0,g.deleteAllowedIP)(t,W);let e=await (0,g.getAllowedIPs)(t);Y(e.length>0?e:[ea]),P.ZP.success("IP address deleted successfully")}catch(e){console.error("Error deleting IP:",e),P.ZP.error("Failed to delete IP address ".concat(e))}finally{B(!1),$(null)}};(0,d.useEffect)(()=>{(async()=>{if(null!=t){let e=[],s=await (0,g.userGetAllUsersCall)(t,"proxy_admin_viewer");console.log("proxy admin viewer response: ",s);let l=s.users;console.log("proxy viewers response: ".concat(l)),l.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy viewers: ".concat(l));let a=(await (0,g.userGetAllUsersCall)(t,"proxy_admin")).users;a.forEach(s=>{e.push({user_role:s.user_role,user_id:s.user_id,user_email:s.user_email})}),console.log("proxy admins: ".concat(a)),console.log("combinedList: ".concat(e)),v(e),et(await (0,g.getPossibleUserRoles)(t))}})()},[t]),(0,d.useEffect)(()=>{ei()},[t,r]);let em=()=>{H(!1)};return console.log("admins: ".concat(null==f?void 0:f.length)),(0,c.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,c.jsx)(x,{level:4,children:"Admin Access "}),(0,c.jsx)(h,{children:"Go to 'Internal Users' page to add other admins."}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(eW.Z,{children:"Security Settings"}),(0,c.jsx)(eW.Z,{children:"SCIM"}),(0,c.jsx)(eW.Z,{children:"Useful Links"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(x,{level:4,children:" ✨ Security Settings"}),(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",marginTop:"1rem",marginLeft:"0.5rem"},children:[(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:()=>!0===r?D(!0):P.ZP.error("Only premium users can add SSO"),children:Q?"Edit SSO Settings":"Add SSO"})}),(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:en,children:"Allowed IPs"})}),(0,c.jsx)("div",{children:(0,c.jsx)(_.Z,{style:{width:"150px"},onClick:()=>!0===r?H(!0):P.ZP.error("Only premium users can configure UI access control"),children:"UI Access Control"})})]})]}),(0,c.jsxs)("div",{className:"flex justify-start mb-4",children:[(0,c.jsx)(lS,{isAddSSOModalVisible:M,isInstructionsModalVisible:F,handleAddSSOOk:()=>{D(!1),o.resetFields(),t&&r&&ei()},handleAddSSOCancel:()=>{D(!1),o.resetFields()},handleShowInstructions:e=>{D(!1),R(!0)},handleInstructionsOk:()=>{R(!1),t&&r&&ei()},handleInstructionsCancel:()=>{R(!1),t&&r&&ei()},form:o,accessToken:t,ssoConfigured:Q}),(0,c.jsx)(E.Z,{title:"Manage Allowed IP Addresses",width:800,visible:q,onCancel:()=>U(!1),footer:[(0,c.jsx)(_.Z,{className:"mx-1",onClick:()=>V(!0),children:"Add IP Address"},"add"),(0,c.jsx)(_.Z,{onClick:()=>U(!1),children:"Close"},"close")],children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"IP Address"}),(0,c.jsx)(sN.Z,{className:"text-right",children:"Action"})]})}),(0,c.jsx)(s_.Z,{children:J.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e}),(0,c.jsx)(sy.Z,{className:"text-right",children:e!==ea&&(0,c.jsx)(_.Z,{onClick:()=>ec(e),color:"red",size:"xs",children:"Delete"})})]},s))})]})}),(0,c.jsx)(E.Z,{title:"Add Allowed IP Address",visible:z,onCancel:()=>V(!1),footer:null,children:(0,c.jsxs)(I.Z,{onFinish:eo,children:[(0,c.jsx)(I.Z.Item,{name:"ip",rules:[{required:!0,message:"Please enter an IP address"}],children:(0,c.jsx)(L.default,{placeholder:"Enter IP address"})}),(0,c.jsx)(I.Z.Item,{children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add IP Address"})})]})}),(0,c.jsx)(E.Z,{title:"Confirm Delete",visible:K,onCancel:()=>B(!1),onOk:ed,footer:[(0,c.jsx)(_.Z,{className:"mx-1",onClick:()=>ed(),children:"Yes"},"delete"),(0,c.jsx)(_.Z,{onClick:()=>B(!1),children:"Close"},"close")],children:(0,c.jsxs)("p",{children:["Are you sure you want to delete the IP address: ",W,"?"]})}),(0,c.jsx)(E.Z,{title:"UI Access Control Settings",visible:G,width:600,footer:null,onOk:em,onCancel:()=>{H(!1)},children:(0,c.jsx)(lL,{accessToken:t,onSuccess:()=>{em(),P.ZP.success("UI Access Control settings updated successfully")}})})]}),(0,c.jsxs)(lZ.Z,{title:"Login without SSO",color:"teal",children:["If you need to login without sso, you can access"," ",(0,c.jsxs)("a",{href:er,target:"_blank",children:[(0,c.jsx)("b",{children:er})," "]})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lT,{accessToken:t,userID:l,proxySettings:i})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lO.Z,{accessToken:t,userRole:n||null})})]})]})]})};let{Title:lD}=eh.default;var lF=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)([]);(0,d.useEffect)(()=>{i()},[s]);let i=async()=>{if(s){l(!0);try{let e=await (0,g.getEmailEventSettings)(s);r(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),P.ZP.error("Failed to fetch email event settings")}finally{l(!1)}}},n=(e,s)=>{r(a.map(t=>t.event===e?{...t,enabled:s}:t))},o=async()=>{if(s)try{await (0,g.updateEmailEventSettings)(s,{settings:a}),P.ZP.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),P.ZP.error("Failed to update email event settings")}},m=async()=>{if(s)try{await (0,g.resetEmailEventSettings)(s),P.ZP.success("Email event settings reset to defaults"),i()}catch(e){console.error("Failed to reset email event settings:",e),P.ZP.error("Failed to reset email event settings")}},u=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let s=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(s)}};return(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(lD,{level:4,children:"Email Notifications"}),(0,c.jsx)(w.Z,{children:"Select which events should trigger email notifications."}),(0,c.jsx)(Q.Z,{}),t?(0,c.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,c.jsx)(lu.Z,{size:"large"})}):(0,c.jsx)("div",{className:"space-y-4",children:a.map(e=>(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(s4.Z,{checked:e.enabled,onChange:s=>n(e.event,s.target.checked)}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)(w.Z,{children:e.event}),(0,c.jsx)("div",{className:"text-sm text-gray-500 block",children:u(e.event)})]})]},e.event))}),(0,c.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,c.jsx)(_.Z,{onClick:o,disabled:t,children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:m,variant:"secondary",disabled:t,children:"Reset to Defaults"})]})]})};let{Title:lR}=eh.default;var lq=e=>{let{accessToken:s,premiumUser:t,alerts:l}=e,a=()=>{if(!s)return;let e={};l.filter(e=>"email"===e.name).forEach(s=>{var t;Object.entries(null!==(t=s.variables)&&void 0!==t?t:{}).forEach(s=>{let[t,l]=s,a=document.querySelector('input[name="'.concat(t,'"]'));a&&a.value&&(e[t]=null==a?void 0:a.value)})}),console.log("updatedVariables",e);try{(0,g.setCallbacksCall)(s,{general_settings:{alerting:["email"]},environment_variables:e})}catch(e){P.ZP.error("Failed to update alerts: "+e,20)}P.ZP.success("Email settings updated successfully")};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 mb-6",children:(0,c.jsx)(lF,{accessToken:s})}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(lR,{level:4,children:"Email Server Settings"}),(0,c.jsxs)(w.Z,{children:[(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:" LiteLLM Docs: email alerts"})," ",(0,c.jsx)("br",{})]}),(0,c.jsx)("div",{className:"flex w-full",children:l.filter(e=>"email"===e.name).map((e,s)=>{var l;return(0,c.jsx)(sy.Z,{children:(0,c.jsx)("ul",{children:(0,c.jsx)(v.Z,{numItems:2,children:Object.entries(null!==(l=e.variables)&&void 0!==l?l:{}).map(e=>{let[s,l]=e;return(0,c.jsxs)("li",{className:"mx-2 my-2",children:[!0!=t&&("EMAIL_LOGO_URL"===s||"EMAIL_SUPPORT_CONTACT"===s)?(0,c.jsxs)("div",{children:[(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,c.jsxs)(w.Z,{className:"mt-2",children:[" ","✨ ",s]})}),(0,c.jsx)(y.Z,{name:s,defaultValue:l,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"mt-2",children:s}),(0,c.jsx)(y.Z,{name:s,defaultValue:l,type:"password",style:{width:"400px"}})]}),(0,c.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===s&&(0,c.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `[email protected]`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===s&&(0,c.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `[email protected]`",(0,c.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===s&&(0,c.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===s&&(0,c.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is [email protected]"})]})]},s)})})})},s)})}),(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>a(),children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:()=>s&&(0,g.serviceHealthCheck)(s,"email"),className:"mx-2",children:"Test Email Alerts"})]})]})},lU=e=>{let{alertingSettings:s,handleInputChange:t,handleResetField:l,handleSubmit:a,premiumUser:r}=e,[i]=I.Z.useForm();return(0,c.jsxs)(I.Z,{form:i,onFinish:()=>{console.log("INSIDE ONFINISH");let e=i.getFieldsValue(),s=Object.entries(e).every(e=>{let[s,t]=e;return"boolean"!=typeof t&&(""===t||null==t)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(s)),s?console.log("Some form fields are empty."):a(e)},labelAlign:"left",children:[s.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsxs)(sy.Z,{align:"center",children:[(0,c.jsx)(w.Z,{children:e.field_name}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?r?(0,c.jsx)(I.Z.Item,{name:e.field_name,children:(0,c.jsx)(sy.Z,{children:"Integer"===e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>t(e.field_name,s)}):"Boolean"===e.field_type?(0,c.jsx)(tT.Z,{checked:e.field_value,onChange:s=>t(e.field_name,s)}):(0,c.jsx)(L.default,{value:e.field_value,onChange:s=>t(e.field_name,s)})})}):(0,c.jsx)(sy.Z,{children:(0,c.jsx)(_.Z,{className:"flex items-center justify-center",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,c.jsx)(I.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,c.jsx)(sy.Z,{children:"Integer"===e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>t(e.field_name,s),className:"p-0"}):"Boolean"===e.field_type?(0,c.jsx)(tT.Z,{checked:e.field_value,onChange:s=>{t(e.field_name,s),i.setFieldsValue({[e.field_name]:s})}}):(0,c.jsx)(L.default,{value:e.field_value,onChange:s=>t(e.field_name,s)})})}),(0,c.jsx)(sy.Z,{children:!0==e.stored_in_db?(0,c.jsx)(eY.Z,{icon:eS.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,c.jsx)(eY.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,c.jsx)(eY.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(sf.Z,{icon:el.Z,color:"red",onClick:()=>l(e.field_name,s),children:"Reset"})})]},s)),(0,c.jsx)("div",{children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Update Settings"})})]})},lz=e=>{let{accessToken:s,premiumUser:t}=e,[l,a]=(0,d.useState)([]);return(0,d.useEffect)(()=>{s&&(0,g.alertingSettingsCall)(s).then(e=>{a(e)})},[s]),(0,c.jsx)(lU,{alertingSettings:l,handleInputChange:(e,s)=>{let t=l.map(t=>t.field_name===e?{...t,field_value:s}:t);console.log("updatedSettings: ".concat(JSON.stringify(t))),a(t)},handleResetField:(e,t)=>{if(s)try{let s=l.map(s=>s.field_name===e?{...s,stored_in_db:null,field_value:s.field_default_value}:s);a(s)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!s||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let t={};l.forEach(e=>{t[e.field_name]=e.field_value});let a={...e,...t};console.log("mergedFormValues: ".concat(JSON.stringify(a)));let{slack_alerting:r,...i}=a;console.log("slack_alerting: ".concat(r,", alertingArgs: ").concat(JSON.stringify(i)));try{(0,g.updateConfigFieldSetting)(s,"alerting_args",i),"boolean"==typeof r&&(!0==r?(0,g.updateConfigFieldSetting)(s,"alerting",["slack"]):(0,g.updateConfigFieldSetting)(s,"alerting",[])),P.ZP.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:t})},lV=t(38994);let{Title:lK,Paragraph:lB}=eh.default;var lG=e=>{let{accessToken:s,userRole:t,userID:l,premiumUser:a}=e,[r,n]=(0,d.useState)([]),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(!1),[h]=I.Z.useForm(),[p,j]=(0,d.useState)(null),[f,b]=(0,d.useState)(""),[N,Z]=(0,d.useState)({}),[k,S]=(0,d.useState)([]),[A,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)([]),[D,F]=(0,d.useState)([]),[R,q]=(0,d.useState)(!1),[U,z]=(0,d.useState)(null),[V,K]=(0,d.useState)(!1),[B,G]=(0,d.useState)(null),H=e=>{k.includes(e)?S(k.filter(s=>s!==e)):S([...k,e])},J={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,d.useEffect)(()=>{s&&t&&l&&(0,g.getCallbacksCall)(s,l,t).then(e=>{n(e.callbacks),M(e.available_callbacks);let s=e.alerts;if(s&&s.length>0){let e=s[0],t=e.variables.SLACK_WEBHOOK_URL;S(e.active_alerts),b(t),Z(e.alerts_to_webhook)}m(s)})},[s,t,l]);let Y=e=>k&&k.includes(e),W=async e=>{if(!s)return;let t={};Object.entries(e).forEach(e=>{let[s,l]=e;"callback"!==s&&(t[s]=l)});try{await (0,g.setCallbacksCall)(s,{environment_variables:t}),P.ZP.success("Callback added successfully"),x(!1),h.resetFields(),j(null)}catch(e){P.ZP.error("Failed to add callback: "+e,20)}},$=async e=>{if(!s)return;let t=null==e?void 0:e.callback,l={};Object.entries(e).forEach(e=>{let[s,t]=e;"callback"!==s&&(l[s]=t)});try{await (0,g.setCallbacksCall)(s,{environment_variables:l,litellm_settings:{success_callback:[t]}}),P.ZP.success("Callback ".concat(t," added successfully")),x(!1),h.resetFields(),j(null)}catch(e){P.ZP.error("Failed to add callback: "+e,20)}},Q=e=>{j(e.litellm_callback_name),e&&e.litellm_callback_params?F(e.litellm_callback_params):F([])},ee=e=>{G(e),K(!0)},es=async()=>{if(B&&s)try{if(await (0,g.deleteCallback)(s,B),P.ZP.success("Callback ".concat(B," deleted successfully")),l&&t){let e=await (0,g.getCallbacksCall)(s,l,t);n(e.callbacks)}K(!1),G(null)}catch(e){console.error("Failed to delete callback:",e),P.ZP.error("Failed to delete callback: ".concat(e))}};return s?(0,c.jsxs)("div",{className:"w-full mx-4",children:[(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eW.Z,{value:"1",children:"Logging Callbacks"}),(0,c.jsx)(eW.Z,{value:"2",children:"Alerting Types"}),(0,c.jsx)(eW.Z,{value:"3",children:"Alerting Settings"}),(0,c.jsx)(eW.Z,{value:"4",children:"Email Alerts"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(lK,{level:4,children:"Active Logging Callbacks"}),(0,c.jsx)(v.Z,{numItems:2,children:(0,c.jsx)(X.Z,{className:"max-h-[50vh]",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sN.Z,{children:"Callback Name"})})}),(0,c.jsx)(s_.Z,{children:r.map((e,t)=>(0,c.jsxs)(sZ.Z,{className:"flex justify-between",children:[(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:e.name})}),(0,c.jsx)(sy.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"flex justify-between",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>{z(e),q(!0)}}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>ee(e.name),className:"text-red-500 hover:text-red-700 cursor-pointer"}),(0,c.jsx)(_.Z,{onClick:()=>(0,g.serviceHealthCheck)(s,e.name),className:"ml-2",variant:"secondary",children:"Test Callback"})]})})]},t))})]})})}),(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>L(!0),children:"Add Callback"})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(w.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,c.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{}),(0,c.jsx)(sN.Z,{}),(0,c.jsx)(sN.Z,{children:"Slack Webhook URL"})]})}),(0,c.jsx)(s_.Z,{children:Object.entries(J).map((e,s)=>{let[t,l]=e;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:"region_outage_alerts"==t?a?(0,c.jsx)(tT.Z,{id:"switch",name:"switch",checked:Y(t),onChange:()=>H(t)}):(0,c.jsx)(_.Z,{className:"flex items-center justify-center",children:(0,c.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,c.jsx)(tT.Z,{id:"switch",name:"switch",checked:Y(t),onChange:()=>H(t)})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(w.Z,{children:l})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(y.Z,{name:t,type:"password",defaultValue:N&&N[t]?N[t]:f})})]},s)})})]}),(0,c.jsx)(_.Z,{size:"xs",className:"mt-2",onClick:()=>{if(!s)return;let e={};Object.entries(J).forEach(s=>{let[t,l]=s,a=document.querySelector('input[name="'.concat(t,'"]')),r=(null==a?void 0:a.value)||"";e[t]=r});try{(0,g.setCallbacksCall)(s,{general_settings:{alert_to_webhook_url:e,alert_types:k}})}catch(e){P.ZP.error("Failed to update alerts: "+e,20)}P.ZP.success("Alerts updated successfully")},children:"Save Changes"}),(0,c.jsx)(_.Z,{onClick:()=>(0,g.serviceHealthCheck)(s,"slack"),className:"mx-2",children:"Test Alerts"})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lz,{accessToken:s,premiumUser:a})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(lq,{accessToken:s,premiumUser:a,alerts:o})})]})]})}),(0,c.jsxs)(E.Z,{title:"Add Logging Callback",visible:A,width:800,onCancel:()=>L(!1),footer:null,children:[(0,c.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,c.jsx)(I.Z,{form:h,onFinish:$,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(lV.Z,{label:"Callback",name:"callback",rules:[{required:!0,message:"Please select a callback"}],children:(0,c.jsx)(C.default,{onChange:e=>{let s=O[e];s&&Q(s)},children:Object.entries(i).map(e=>{var s;let[t,l]=e;return(0,c.jsx)(ex.Z,{value:ea[t],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(null===(s=ec[l])||void 0===s?void 0:s.logo)?(0,c.jsx)("div",{className:"w-5 h-5 flex items-center justify-center",children:(0,c.jsx)("img",{src:ec[l].logo,alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{e.currentTarget.style.display="none"}})}):(0,c.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:l.charAt(0).toUpperCase()}),(0,c.jsx)("span",{children:l})]})},l)})})}),D&&D.map(e=>(0,c.jsx)(lV.Z,{label:e,name:e,rules:[{required:!0,message:"Please enter the value for "+e}],children:(0,c.jsx)(y.Z,{type:"password"})},e)),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})]}),(0,c.jsx)(E.Z,{visible:R,width:800,title:"Edit ".concat(null==U?void 0:U.name," Settings"),onCancel:()=>q(!1),footer:null,children:(0,c.jsxs)(I.Z,{form:h,onFinish:W,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(c.Fragment,{children:U&&U.variables&&Object.entries(U.variables).map(e=>{let[s,t]=e;return(0,c.jsx)(lV.Z,{label:s,name:s,children:(0,c.jsx)(y.Z,{type:"password",defaultValue:t})},s)})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})}),(0,c.jsx)(E.Z,{title:"Confirm Delete",visible:V,onOk:es,onCancel:()=>{K(!1),G(null)},okText:"Delete",cancelText:"Cancel",okButtonProps:{danger:!0},children:(0,c.jsxs)("p",{children:["Are you sure you want to delete the callback - ",B,"? This action cannot be undone."]})})]}):null},lH=t(92414),lJ=t(46030);let{Option:lY}=C.default;var lW=e=>{let{models:s,accessToken:t,routerSettings:l,setRouterSettings:a}=e,[r]=I.Z.useForm(),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)("");return(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{className:"mx-auto",onClick:()=>n(!0),children:"+ Add Fallbacks"}),(0,c.jsx)(E.Z,{title:"Add Fallbacks",visible:i,width:800,footer:null,onOk:()=>{n(!1),r.resetFields()},onCancel:()=>{n(!1),r.resetFields()},children:(0,c.jsxs)(I.Z,{form:r,onFinish:e=>{console.log(e);let{model_name:s,models:i}=e,o=[...l.fallbacks||[],{[s]:i}],c={...l,fallbacks:o};console.log(c);try{(0,g.setCallbacksCall)(t,{router_settings:c}),a(c)}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}P.ZP.success("router settings updated successfully"),n(!1),r.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{label:"Public Model Name",name:"model_name",rules:[{required:!0,message:"Set the model to fallback for"}],help:"required",children:(0,c.jsx)(eJ.Z,{defaultValue:o,children:s&&s.map((e,s)=>(0,c.jsx)(ex.Z,{value:e,onClick:()=>m(e),children:e},s))})}),(0,c.jsx)(I.Z.Item,{label:"Fallback Models",name:"models",rules:[{required:!0,message:"Please select a model"}],help:"required",children:(0,c.jsx)(lH.Z,{value:s,children:s&&s.filter(e=>e!=o).map(e=>(0,c.jsx)(lJ.Z,{value:e,children:e},e))})})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Add Fallbacks"})})]})})]})},l$=t(26433);async function lQ(e,s){console.log=function(){},console.log("isLocal:",!1);let t=window.location.origin,l=new l$.ZP.OpenAI({apiKey:s,baseURL:t,dangerouslyAllowBrowser:!0});try{let s=await l.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});P.ZP.success((0,c.jsxs)("span",{children:["Test model=",(0,c.jsx)("strong",{children:e}),", received model=",(0,c.jsx)("strong",{children:s.model}),". See"," ",(0,c.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20)}}let lX={ttl:3600,lowest_latency_buffer:0},l0=e=>{let{selectedStrategy:s,strategyArgs:t,paramExplanation:l}=e;return(0,c.jsxs)(b.Z,{children:[(0,c.jsx)(Z.Z,{className:"text-sm font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong",children:"Routing Strategy Specific Args"}),(0,c.jsx)(N.Z,{children:"latency-based-routing"==s?(0,c.jsx)(X.Z,{children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Setting"}),(0,c.jsx)(sN.Z,{children:"Value"})]})}),(0,c.jsx)(s_.Z,{children:Object.entries(t).map(e=>{let[s,t]=e;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(w.Z,{children:s}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:l[s]})]}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(y.Z,{name:s,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t.toString()})})]},s)})})]})}):(0,c.jsx)(w.Z,{children:"No specific settings"})})]})};var l1=e=>{let{accessToken:s,userRole:t,userID:l,modelData:a}=e,[r,i]=(0,d.useState)({}),[n,o]=(0,d.useState)({}),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p]=I.Z.useForm(),[j,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),E={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,d.useEffect)(()=>{s&&t&&l&&((0,g.getCallbacksCall)(s,l,t).then(e=>{console.log("callbacks",e);let s=e.router_settings;"model_group_retry_policy"in s&&delete s.model_group_retry_policy,i(s)}),(0,g.getGeneralSettingsCall)(s).then(e=>{u(e)}))},[s,t,l]);let A=async e=>{if(!s)return;console.log("received key: ".concat(e)),console.log("routerSettings['fallbacks']: ".concat(r.fallbacks));let t=r.fallbacks.map(s=>(e in s&&delete s[e],s)).filter(e=>Object.keys(e).length>0),l={...r,fallbacks:t};try{await (0,g.setCallbacksCall)(s,{router_settings:l}),i(l),P.ZP.success("Router settings updated successfully")}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}},T=(e,s)=>{u(m.map(t=>t.field_name===e?{...t,field_value:s}:t))},L=(e,t)=>{if(!s)return;let l=m[t].field_value;if(null!=l&&void 0!=l)try{(0,g.updateConfigFieldSetting)(s,e,l);let t=m.map(s=>s.field_name===e?{...s,stored_in_db:!0}:s);u(t)}catch(e){}},O=(e,t)=>{if(s)try{(0,g.deleteConfigFieldSetting)(s,e);let t=m.map(s=>s.field_name===e?{...s,stored_in_db:null,field_value:null}:s);u(t)}catch(e){}},M=e=>{if(!s)return;console.log("router_settings",e);let t=Object.fromEntries(Object.entries(e).map(e=>{let[s,t]=e;if("routing_strategy_args"!==s&&"routing_strategy"!==s){var l;return[s,(null===(l=document.querySelector('input[name="'.concat(s,'"]')))||void 0===l?void 0:l.value)||t]}if("routing_strategy"==s)return[s,N];if("routing_strategy_args"==s&&"latency-based-routing"==N){let e={},s=document.querySelector('input[name="lowest_latency_buffer"]'),t=document.querySelector('input[name="ttl"]');return(null==s?void 0:s.value)&&(e.lowest_latency_buffer=Number(s.value)),(null==t?void 0:t.value)&&(e.ttl=Number(t.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",t);try{(0,g.setCallbacksCall)(s,{router_settings:t})}catch(e){P.ZP.error("Failed to update router settings: "+e,20)}P.ZP.success("router settings updated successfully")};return s?(0,c.jsx)("div",{className:"w-full mx-4",children:(0,c.jsxs)(e$.Z,{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)(eQ.Z,{variant:"line",defaultValue:"1",children:[(0,c.jsx)(eW.Z,{value:"1",children:"Loadbalancing"}),(0,c.jsx)(eW.Z,{value:"2",children:"Fallbacks"}),(0,c.jsx)(eW.Z,{value:"3",children:"General"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:[(0,c.jsx)(k.Z,{children:"Router Settings"}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Setting"}),(0,c.jsx)(sN.Z,{children:"Value"})]})}),(0,c.jsx)(s_.Z,{children:Object.entries(r).filter(e=>{let[s,t]=e;return"fallbacks"!=s&&"context_window_fallbacks"!=s&&"routing_strategy_args"!=s}).map(e=>{let[s,t]=e;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(w.Z,{children:s}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:E[s]})]}),(0,c.jsx)(sy.Z,{children:"routing_strategy"==s?(0,c.jsxs)(eJ.Z,{defaultValue:t,className:"w-full max-w-md",onValueChange:Z,children:[(0,c.jsx)(ex.Z,{value:"usage-based-routing",children:"usage-based-routing"}),(0,c.jsx)(ex.Z,{value:"latency-based-routing",children:"latency-based-routing"}),(0,c.jsx)(ex.Z,{value:"simple-shuffle",children:"simple-shuffle"})]}):(0,c.jsx)(y.Z,{name:s,defaultValue:"object"==typeof t?JSON.stringify(t,null,2):t.toString()})})]},s)})})]}),(0,c.jsx)(l0,{selectedStrategy:N,strategyArgs:r&&r.routing_strategy_args&&Object.keys(r.routing_strategy_args).length>0?r.routing_strategy_args:lX,paramExplanation:E})]}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(_.Z,{className:"mt-2",onClick:()=>M(r),children:"Save Changes"})})]})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Model Name"}),(0,c.jsx)(sN.Z,{children:"Fallbacks"})]})}),(0,c.jsx)(s_.Z,{children:r.fallbacks&&r.fallbacks.map((e,t)=>Object.entries(e).map(e=>{let[l,a]=e;return(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:l}),(0,c.jsx)(sy.Z,{children:Array.isArray(a)?a.join(", "):a}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(_.Z,{onClick:()=>lQ(l,s),children:"Test Fallback"})}),(0,c.jsx)(sy.Z,{children:(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>A(l)})})]},t.toString()+l)}))})]}),(0,c.jsx)(lW,{models:(null==a?void 0:a.data)?a.data.map(e=>e.model_name):[],accessToken:s,routerSettings:r,setRouterSettings:i})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(X.Z,{children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Setting"}),(0,c.jsx)(sN.Z,{children:"Value"}),(0,c.jsx)(sN.Z,{children:"Status"}),(0,c.jsx)(sN.Z,{children:"Action"})]})}),(0,c.jsx)(s_.Z,{children:m.filter(e=>"TypedDictionary"!==e.field_type).map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(w.Z,{children:e.field_name}),(0,c.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,c.jsx)(sy.Z,{children:"Integer"==e.field_type?(0,c.jsx)(q.Z,{step:1,value:e.field_value,onChange:s=>T(e.field_name,s)}):null}),(0,c.jsx)(sy.Z,{children:!0==e.stored_in_db?(0,c.jsx)(eY.Z,{icon:eS.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,c.jsx)(eY.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,c.jsx)(eY.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,c.jsxs)(sy.Z,{children:[(0,c.jsx)(_.Z,{onClick:()=>L(e.field_name,s),children:"Update"}),(0,c.jsx)(sf.Z,{icon:el.Z,color:"red",onClick:()=>O(e.field_name,s),children:"Reset"})]})]},s))})]})})})]})]})}):null},l2=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:l,setBudgetList:a}=e,[r]=I.Z.useForm(),i=async e=>{if(null!=t&&void 0!=t)try{P.ZP.info("Making API Call");let s=await (0,g.budgetCreateCall)(t,e);console.log("key create Response:",s),a(e=>e?[...e,s]:[s]),P.ZP.success("Budget Created"),r.resetFields()}catch(e){console.error("Error creating the key:",e),P.ZP.error("Error creating the key: ".concat(e),20)}};return(0,c.jsx)(E.Z,{title:"Create Budget",visible:s,width:800,footer:null,onOk:()=>{l(!1),r.resetFields()},onCancel:()=>{l(!1),r.resetFields()},children:(0,c.jsxs)(I.Z,{form:r,onFinish:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Create Budget"})})]})})},l4=e=>{let{isModalVisible:s,accessToken:t,setIsModalVisible:l,setBudgetList:a,existingBudget:r,handleUpdateCall:i}=e;console.log("existingBudget",r);let[n]=I.Z.useForm();(0,d.useEffect)(()=>{n.setFieldsValue(r)},[r,n]);let o=async e=>{if(null!=t&&void 0!=t)try{P.ZP.info("Making API Call"),l(!0);let s=await (0,g.budgetUpdateCall)(t,e);a(e=>e?[...e,s]:[s]),P.ZP.success("Budget Updated"),n.resetFields(),i()}catch(e){console.error("Error creating the key:",e),P.ZP.error("Error creating the key: ".concat(e),20)}};return(0,c.jsx)(E.Z,{title:"Edit Budget",visible:s,width:800,footer:null,onOk:()=>{l(!1),n.resetFields()},onCancel:()=>{l(!1),n.resetFields()},children:(0,c.jsxs)(I.Z,{form:n,onFinish:o,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:r,children:[(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.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,c.jsx)(y.Z,{placeholder:""})}),(0,c.jsx)(I.Z.Item,{label:"Max Tokens per minute",name:"tpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{label:"Max Requests per minute",name:"rpm_limit",help:"Default is model limit.",children:(0,c.jsx)(q.Z,{step:1,precision:2,width:200})}),(0,c.jsxs)(b.Z,{className:"mt-20 mb-8",children:[(0,c.jsx)(Z.Z,{children:(0,c.jsx)("b",{children:"Optional Settings"})}),(0,c.jsxs)(N.Z,{children:[(0,c.jsx)(I.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,c.jsx)(q.Z,{step:.01,precision:2,width:200})}),(0,c.jsx)(I.Z.Item,{className:"mt-8",label:"Reset Budget",name:"budget_duration",children:(0,c.jsxs)(C.default,{defaultValue:null,placeholder:"n/a",children:[(0,c.jsx)(C.default.Option,{value:"24h",children:"daily"}),(0,c.jsx)(C.default.Option,{value:"7d",children:"weekly"}),(0,c.jsx)(C.default.Option,{value:"30d",children:"monthly"})]})})]})]})]}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(T.ZP,{htmlType:"submit",children:"Save"})})]})})},l5=t(17906),l6=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)(!1),[a,r]=(0,d.useState)(!1),[i,n]=(0,d.useState)(null),[o,m]=(0,d.useState)([]);(0,d.useEffect)(()=>{s&&(0,g.getBudgetList)(s).then(e=>{m(e)})},[s]);let u=async(e,t)=>{console.log("budget_id",e),null!=s&&(n(o.find(s=>s.budget_id===e)||null),r(!0))},x=async(e,t)=>{if(null==s)return;P.ZP.info("Request made"),await (0,g.budgetDeleteCall)(s,e);let l=[...o];l.splice(t,1),m(l),P.ZP.success("Budget Deleted.")},h=async()=>{null!=s&&(0,g.getBudgetList)(s).then(e=>{m(e)})};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)(_.Z,{size:"sm",variant:"primary",className:"mb-2",onClick:()=>l(!0),children:"+ Create Budget"}),(0,c.jsx)(l2,{accessToken:s,isModalVisible:t,setIsModalVisible:l,setBudgetList:m}),i&&(0,c.jsx)(l4,{accessToken:s,isModalVisible:a,setIsModalVisible:r,setBudgetList:m,existingBudget:i,handleUpdateCall:h}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Create a budget to assign to customers."}),(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Budget ID"}),(0,c.jsx)(sN.Z,{children:"Max Budget"}),(0,c.jsx)(sN.Z,{children:"TPM"}),(0,c.jsx)(sN.Z,{children:"RPM"})]})}),(0,c.jsx)(s_.Z,{children:o.slice().sort((e,s)=>new Date(s.updated_at).getTime()-new Date(e.updated_at).getTime()).map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.budget_id}),(0,c.jsx)(sy.Z,{children:e.max_budget?e.max_budget:"n/a"}),(0,c.jsx)(sy.Z,{children:e.tpm_limit?e.tpm_limit:"n/a"}),(0,c.jsx)(sy.Z,{children:e.rpm_limit?e.rpm_limit:"n/a"}),(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>u(e.budget_id,s)}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>x(e.budget_id,s)})]},s))})]})]}),(0,c.jsxs)("div",{className:"mt-5",children:[(0,c.jsx)(w.Z,{className:"text-base",children:"How to use budget id"}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(eW.Z,{children:"Assign Budget to Customer"}),(0,c.jsx)(eW.Z,{children:"Test it (Curl)"}),(0,c.jsx)(eW.Z,{children:"Test it (OpenAI SDK)"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.Z,{language:"bash",children:"\ncurl -X POST --location '<your_proxy_base_url>/end_user/new' \n-H 'Authorization: Bearer <your-master-key>' \n-H 'Content-Type: application/json' \n-d '{\"user_id\": \"my-customer-id', \"budget_id\": \"<BUDGET_ID>\"}' # \uD83D\uDC48 KEY CHANGE\n\n "})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.Z,{language:"bash",children:'\ncurl -X POST --location \'<your_proxy_base_url>/chat/completions\' \n-H \'Authorization: Bearer <your-master-key>\' \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,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.Z,{language:"python",children:'from openai import OpenAI\nclient = OpenAI(\n base_url="<your_proxy_base_url>",\n api_key="<your_proxy_key>"\n)\n\ncompletion = client.chat.completions.create(\n model="gpt-3.5-turbo",\n messages=[\n {"role": "system", "content": "You are a helpful assistant."},\n {"role": "user", "content": "Hello!"}\n ],\n user="my-customer-id"\n)\n\nprint(completion.choices[0].message)'})})]})]})]})]})},l3=t(77398),l8=t.n(l3);let l7=e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}},l9=e=>{let{utcTime:s}=e;return(0,c.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:l7(s)})},ae=(e,s)=>{var t,l;return(null===(l=e.metadata)||void 0===l?void 0:null===(t=l.mcp_tool_call_metadata)||void 0===t?void 0:t.mcp_server_logo_url)?e.metadata.mcp_tool_call_metadata.mcp_server_logo_url:s?(0,sO.dr)(s).logo:""},as=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,c.jsx)(()=>{let[e,t]=d.useState(s.getIsExpanded()),l=d.useCallback(()=>{t(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,c.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,c.jsx)("svg",{className:"w-4 h-4 transform transition-transform duration-75 ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,c.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Time",accessorKey:"startTime",cell:e=>(0,c.jsx)(l9,{utcTime:e.getValue()})},{header:"Status",accessorKey:"metadata.status",cell:e=>{let s="failure"!==(e.getValue()||"Success").toLowerCase();return(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat(s?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let s=String(e.getValue()||""),t=e.row.original.onSessionClick;return(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>null==t?void 0:t(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:"Cost",accessorKey:"spend",cell:e=>(0,c.jsxs)("span",{children:["$",eR(e.getValue()||0,6)]})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let s=String(e.getValue()||"-"),t=e.row.original.onKeyHashClick;return(0,c.jsx)(z.Z,{title:s,children:(0,c.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>null==t?void 0:t(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Model",accessorKey:"model",cell:e=>{let s=e.row.original,t=s.custom_llm_provider,l=String(e.getValue()||"");return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:ae(s,t),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)(z.Z,{title:l,children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:l})})]})}},{header:"Tokens",accessorKey:"total_tokens",cell:e=>{let s=e.row.original;return(0,c.jsxs)("span",{className:"text-sm",children:[String(s.total_tokens||"0"),(0,c.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(s.prompt_tokens||"0"),"+",String(s.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||"-"),children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let s=e.getValue();if(!s||0===Object.keys(s).length)return"-";let t=Object.entries(s),l=t[0],a=t.slice(1);return(0,c.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,c.jsx)(z.Z,{title:(0,c.jsx)("div",{className:"flex flex-col gap-1",children:t.map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{children:[s,": ",String(t)]},s)})}),children:(0,c.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[l[0],": ",String(l[1]),a.length>0&&" +".concat(a.length)]})})})}}],at=e=>(0,c.jsx)(eY.Z,{color:"gray",className:"flex items-center gap-1",children:(0,c.jsx)("span",{className:"whitespace-nowrap text-xs",children:e})}),al=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,c.jsx)(()=>{let[e,t]=d.useState(s.getIsExpanded()),l=d.useCallback(()=>{t(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,c.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,c.jsx)("svg",{className:"w-4 h-4 transform transition-transform ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,c.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Timestamp",accessorKey:"updated_at",cell:e=>(0,c.jsx)(l9,{utcTime:e.getValue()})},{header:"Table Name",accessorKey:"table_name",cell:e=>{let s=e.getValue(),t=s;switch(s){case"LiteLLM_VerificationToken":t="Keys";break;case"LiteLLM_TeamTable":t="Teams";break;case"LiteLLM_OrganizationTable":t="Organizations";break;case"LiteLLM_UserTable":t="Users";break;case"LiteLLM_ProxyModelTable":t="Models";break;default:t=s}return(0,c.jsx)("span",{children:t})}},{header:"Action",accessorKey:"action",cell:e=>(0,c.jsx)("span",{children:at(e.getValue())})},{header:"Changed By",accessorKey:"changed_by",cell:e=>{let s=e.row.original.changed_by,t=e.row.original.changed_by_api_key;return(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsx)("div",{className:"font-medium",children:s}),t&&(0,c.jsx)(z.Z,{title:t,children:(0,c.jsxs)("div",{className:"text-xs text-muted-foreground max-w-[15ch] truncate",children:[" ",t]})})]})}},{header:"Affected Item ID",accessorKey:"object_id",cell:e=>(0,c.jsx)(()=>{let s=e.getValue(),[t,l]=(0,d.useState)(!1);if(!s)return(0,c.jsx)(c.Fragment,{children:"-"});let a=async()=>{try{await navigator.clipboard.writeText(String(s)),l(!0),setTimeout(()=>l(!1),1500)}catch(e){console.error("Failed to copy object ID: ",e)}};return(0,c.jsx)(z.Z,{title:t?"Copied!":String(s),children:(0,c.jsx)("span",{className:"max-w-[20ch] truncate block cursor-pointer hover:text-blue-600",onClick:a,children:String(s)})})},{})}],aa=async(e,s,t,l)=>{console.log("prefetchLogDetails called with",e.length,"logs");let a=e.map(e=>{if(e.request_id)return console.log("Prefetching details for request_id:",e.request_id),l.prefetchQuery({queryKey:["logDetails",e.request_id,s],queryFn:async()=>{console.log("Fetching details for",e.request_id);let l=await (0,g.uiSpendLogDetailsCall)(t,e.request_id,s);return console.log("Received details for",e.request_id,":",l?"success":"failed"),l},staleTime:6e5,gcTime:6e5})});try{let e=await Promise.all(a);return console.log("All prefetch promises completed:",e.length),e}catch(e){throw console.error("Error in prefetchLogDetails:",e),e}};function ar(e){let{row:s,hasMessages:t,hasResponse:l,hasError:a,errorInfo:r,getRawRequest:i,formattedResponse:n}=e,o=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let t=document.execCommand("copy");if(document.body.removeChild(s),!t)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},d=async()=>{await o(JSON.stringify(i(),null,2))?P.ZP.success("Request copied to clipboard"):P.ZP.error("Failed to copy request")},m=async()=>{await o(JSON.stringify(n(),null,2))?P.ZP.success("Response copied to clipboard"):P.ZP.error("Failed to copy response")};return(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request"}),(0,c.jsx)("button",{onClick:d,className:"p-1 hover:bg-gray-200 rounded",title:"Copy request",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-96",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(i(),null,2)})})]}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsxs)("h3",{className:"text-lg font-medium",children:["Response",a&&(0,c.jsxs)("span",{className:"ml-2 text-sm text-red-600",children:["• HTTP code ",(null==r?void 0:r.error_code)||400]})]}),(0,c.jsx)("button",{onClick:m,className:"p-1 hover:bg-gray-200 rounded",title:"Copy response",disabled:!l,children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-96 bg-gray-50",children:l?(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(n(),null,2)}):(0,c.jsx)("div",{className:"text-gray-500 text-sm italic text-center py-4",children:"Response data not available"})})]})]})}let ai=e=>{var s;let{errorInfo:t}=e,[l,a]=d.useState({}),[r,i]=d.useState(!1),n=e=>{a(s=>({...s,[e]:!s[e]}))},o=t.traceback&&(s=t.traceback)?Array.from(s.matchAll(/File "([^"]+)", line (\d+)/g)).map(e=>{let t=e[1],l=e[2],a=t.split("/").pop()||t,r=e.index||0,i=s.indexOf('File "',r+1),n=i>-1?s.substring(r,i).trim():s.substring(r).trim(),o=n.split("\n"),c="";return o.length>1&&(c=o[o.length-1].trim()),{filePath:t,fileName:a,lineNumber:l,code:c,inFunction:n.includes(" in ")?n.split(" in ")[1].split("\n")[0]:""}}):[];return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"p-4 border-b",children:(0,c.jsxs)("h3",{className:"text-lg font-medium flex items-center text-red-600",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Error Details"]})}),(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"bg-red-50 rounded-md p-4 mb-4",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"text-red-800 font-medium w-20",children:"Type:"}),(0,c.jsx)("span",{className:"text-red-700",children:t.error_class||"Unknown Error"})]}),(0,c.jsxs)("div",{className:"flex mt-2",children:[(0,c.jsx)("span",{className:"text-red-800 font-medium w-20 flex-shrink-0",children:"Message:"}),(0,c.jsx)("span",{className:"text-red-700 break-words whitespace-pre-wrap",children:t.error_message||"Unknown error occurred"})]})]}),t.traceback&&(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,c.jsx)("h4",{className:"font-medium",children:"Traceback"}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsx)("button",{onClick:()=>{let e=!r;if(i(e),o.length>0){let s={};o.forEach((t,l)=>{s[l]=e}),a(s)}},className:"text-gray-500 hover:text-gray-700 flex items-center text-sm",children:r?"Collapse All":"Expand All"}),(0,c.jsxs)("button",{onClick:()=>navigator.clipboard.writeText(t.traceback||""),className:"text-gray-500 hover:text-gray-700 flex items-center",title:"Copy traceback",children:[(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,c.jsx)("span",{className:"ml-1",children:"Copy"})]})]})]}),(0,c.jsx)("div",{className:"bg-white rounded-md border border-gray-200 overflow-hidden shadow-sm",children:o.map((e,s)=>(0,c.jsxs)("div",{className:"border-b border-gray-200 last:border-b-0",children:[(0,c.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between cursor-pointer hover:bg-gray-50",onClick:()=>n(s),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("span",{className:"text-gray-400 mr-2 w-12 text-right",children:e.lineNumber}),(0,c.jsx)("span",{className:"text-gray-600 font-medium",children:e.fileName}),(0,c.jsx)("span",{className:"text-gray-500 mx-1",children:"in"}),(0,c.jsx)("span",{className:"text-indigo-600 font-medium",children:e.inFunction||e.fileName})]}),(0,c.jsx)("svg",{className:"w-5 h-5 text-gray-500 transition-transform ".concat(l[s]?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(l[s]||!1)&&e.code&&(0,c.jsx)("div",{className:"px-12 py-2 font-mono text-sm text-gray-800 bg-gray-50 overflow-x-auto border-t border-gray-100",children:e.code})]},s))})]})]})]})},an=e=>{let{show:s}=e;return s?(0,c.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start",children:[(0,c.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Request/Response Data Not Available"}),(0,c.jsxs)("p",{className:"text-sm text-blue-700 mt-1",children:["To view request and response details, enable prompt storage in your LiteLLM configuration by adding the following to your ",(0,c.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded",children:"proxy_config.yaml"})," file:"]}),(0,c.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"general_settings:\n store_model_in_db: true\n store_prompts_in_spend_logs: true"}),(0,c.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change."})]})]}):null};var ao=t(35829);let ac=e=>{let{sessionId:s,logs:t,onBack:l}=e,[a,r]=(0,d.useState)(null),[i,n]=(0,d.useState)({}),o=t.reduce((e,s)=>e+(s.spend||0),0),m=t.reduce((e,s)=>e+(s.total_tokens||0),0),u=t.length>0?new Date(t[0].startTime):new Date;(((t.length>0?new Date(t[t.length-1].endTime):new Date).getTime()-u.getTime())/1e3).toFixed(2),t.map(e=>({time:new Date(e.startTime).toISOString(),tokens:e.total_tokens||0,cost:e.spend||0}));let x=async(e,s)=>{await eq(e)&&(n(e=>({...e,[s]:!0})),setTimeout(()=>{n(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"mb-8",children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:l,className:"mb-4",children:"Back to All Logs"}),(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsx)("h1",{className:"text-2xl font-semibold text-gray-900",children:"Session Details"}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)("p",{className:"text-sm text-gray-500 font-mono",children:s}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:i["session-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>x(s,"session-id"),className:"left-2 z-10 transition-all duration-200 ".concat(i["session-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/ui_logs_sessions",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 flex items-center gap-1",children:["Get started with session management here",(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(ao.Z,{children:t.length})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Cost"}),(0,c.jsxs)(ao.Z,{children:["$",eR(o,6)]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(ao.Z,{children:m})]})]}),(0,c.jsx)(k.Z,{children:"Session Logs"}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(t8,{columns:as,data:t,renderSubComponent:aj,getRowCanExpand:()=>!0,loadingMessage:"Loading logs...",noDataMessage:"No logs found"})})]})};function ad(e){let{data:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)({});if(!s||0===s.length)return null;let i=e=>new Date(1e3*e).toLocaleString(),n=(e,s)=>"".concat(((s-e)*1e3).toFixed(2),"ms"),o=(e,s)=>{let t="".concat(e,"-").concat(s);r(e=>({...e,[t]:!e[t]}))};return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Vector Store Requests"})]}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:t?"Click to collapse":"Click to expand"})]}),t&&(0,c.jsx)("div",{className:"p-4",children:s.map((e,s)=>(0,c.jsxs)("div",{className:"mb-6 last:mb-0",children:[(0,c.jsx)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Query:"}),(0,c.jsx)("span",{className:"font-mono",children:e.query})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Vector Store ID:"}),(0,c.jsx)("span",{className:"font-mono",children:e.vector_store_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,c.jsx)("span",{className:"flex items-center",children:(()=>{let{logo:s,displayName:t}=(0,sO.dr)(e.custom_llm_provider);return(0,c.jsxs)(c.Fragment,{children:[s&&(0,c.jsx)("img",{src:s,alt:"".concat(t," logo"),className:"h-5 w-5 mr-2"}),t]})})()})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:i(e.start_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:i(e.end_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsx)("span",{children:n(e.start_time,e.end_time)})]})]})]})}),(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Search Results"}),(0,c.jsx)("div",{className:"space-y-2",children:e.vector_store_search_response.data.map((e,t)=>{let l=a["".concat(s,"-").concat(t)]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,c.jsxs)("div",{className:"flex items-center p-3 bg-gray-50 cursor-pointer",onClick:()=>o(s,t),children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(l?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsxs)("span",{className:"font-medium mr-2",children:["Result ",t+1]}),(0,c.jsxs)("span",{className:"text-gray-500 text-sm",children:["Score: ",(0,c.jsx)("span",{className:"font-mono",children:e.score.toFixed(4)})]})]})]}),l&&(0,c.jsx)("div",{className:"p-3 border-t bg-white",children:e.content.map((e,s)=>(0,c.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,c.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:e.type}),(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all bg-gray-50 p-2 rounded",children:e.text})]},s))})]},t)})})]},s))})]})}function am(e){let{data:s}=e,[t,l]=(0,d.useState)(!0),[a,r]=(0,d.useState)(!0),[i,n]=(0,d.useState)({});if(!s)return null;let o=s.masked_entity_count?Object.values(s.masked_entity_count).reduce((e,s)=>e+s,0):0,m=e=>new Date(1e3*e).toLocaleString(),u=e=>{n(s=>({...s,[e]:!s[e]}))},x=e=>e>=.8?"text-green-600":"text-yellow-600";return(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Guardrail Information"}),(0,c.jsx)("span",{className:"ml-3 px-2 py-1 rounded-md text-xs font-medium inline-block ".concat("success"===s.guardrail_status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.guardrail_status}),o>0&&(0,c.jsxs)("span",{className:"ml-3 px-2 py-1 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[o," masked ",1===o?"entity":"entities"]})]}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:t?"Click to collapse":"Click to expand"})]}),t&&(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:[(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail Name:"}),(0,c.jsx)("span",{className:"font-mono",children:s.guardrail_name})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Mode:"}),(0,c.jsx)("span",{className:"font-mono",children:s.guardrail_mode})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat("success"===s.guardrail_status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s.guardrail_status})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:m(s.start_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:m(s.end_time)})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsxs)("span",{children:[s.duration.toFixed(4),"s"]})]})]})]}),s.masked_entity_count&&Object.keys(s.masked_entity_count).length>0&&(0,c.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,c.jsx)("h4",{className:"font-medium mb-2",children:"Masked Entity Summary"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(s.masked_entity_count).map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{className:"px-3 py-1.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[s,": ",t]},s)})})]})]}),s.guardrail_response&&s.guardrail_response.length>0&&(0,c.jsxs)("div",{className:"mt-4",children:[(0,c.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>r(!a),children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsxs)("h4",{className:"font-medium",children:["Detected Entities (",s.guardrail_response.length,")"]})]}),a&&(0,c.jsx)("div",{className:"space-y-2",children:s.guardrail_response.map((e,s)=>{let t=i[s]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>u(s),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(t?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,c.jsx)("span",{className:"font-medium mr-2",children:e.entity_type}),(0,c.jsxs)("span",{className:"font-mono ".concat(x(e.score)),children:["Score: ",e.score.toFixed(2)]})]}),(0,c.jsxs)("span",{className:"text-xs text-gray-500",children:["Position: ",e.start,"-",e.end]})]}),t&&(0,c.jsx)("div",{className:"p-3 border-t bg-white",children:(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-2",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Entity Type:"}),(0,c.jsx)("span",{children:e.entity_type})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Position:"}),(0,c.jsxs)("span",{children:["Characters ",e.start,"-",e.end]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Confidence:"}),(0,c.jsx)("span",{className:x(e.score),children:e.score.toFixed(2)})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[e.recognition_metadata&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Recognizer:"}),(0,c.jsx)("span",{children:e.recognition_metadata.recognizer_name})]}),(0,c.jsxs)("div",{className:"flex overflow-hidden",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Identifier:"}),(0,c.jsx)("span",{className:"truncate text-xs font-mono",children:e.recognition_metadata.recognizer_identifier})]})]}),e.analysis_explanation&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Explanation:"}),(0,c.jsx)("span",{children:e.analysis_explanation})]})]})]})})]},s)})})]})]})]})}let au={TEAM_ID:"Team ID",KEY_HASH:"Key Hash",REQUEST_ID:"Request ID",MODEL:"Model",USER_ID:"User ID",END_USER:"End User",STATUS:"Status",KEY_ALIAS:"Key Alias"},ax="".concat("../ui/assets/","audit-logs-preview.png");function ah(e){let{userID:s,userRole:t,token:l,accessToken:a,isActive:r,premiumUser:i,allTeams:n}=e,[o,m]=(0,d.useState)(l8()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),u=(0,d.useRef)(null),x=(0,d.useRef)(null),[h,p]=(0,d.useState)(1),[j]=(0,d.useState)(50),[f,v]=(0,d.useState)({}),[_,y]=(0,d.useState)(""),[b,N]=(0,d.useState)(""),[Z,k]=(0,d.useState)(""),[S,C]=(0,d.useState)("all"),[I,P]=(0,d.useState)("all"),[E,A]=(0,d.useState)(!1),[T,L]=(0,d.useState)(!1),O=(0,sm.a)({queryKey:["all_audit_logs",a,l,t,s,o],queryFn:async()=>{if(!a||!l||!t||!s)return[];let e=l8()(o).utc().format("YYYY-MM-DD HH:mm:ss"),r=l8()().utc().format("YYYY-MM-DD HH:mm:ss"),i=[],n=1,c=1;do{let s=await (0,g.uiAuditLogsCall)(a,e,r,n,50);i=i.concat(s.audit_logs),c=s.total_pages,n++}while(n<=c);return i},enabled:!!a&&!!l&&!!t&&!!s&&r,refetchInterval:5e3,refetchIntervalInBackground:!0}),M=(0,d.useCallback)(async e=>{if(a)try{let s=(await (0,g.keyListCall)(a,null,null,e,null,null,1,10)).keys.find(s=>s.key_alias===e);s?N(s.token):N("")}catch(e){console.error("Error fetching key hash for alias:",e),N("")}},[a]);(0,d.useEffect)(()=>{if(!a)return;let e=!1,s=!1;f["Team ID"]?_!==f["Team ID"]&&(y(f["Team ID"]),e=!0):""!==_&&(y(""),e=!0),f["Key Hash"]?b!==f["Key Hash"]&&(N(f["Key Hash"]),s=!0):f["Key Alias"]?M(f["Key Alias"]):""!==b&&(N(""),s=!0),(e||s)&&p(1)},[f,a,M,_,b]),(0,d.useEffect)(()=>{p(1)},[_,b,o,Z,S,I]),(0,d.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&A(!1),x.current&&!x.current.contains(e.target)&&L(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let D=(0,d.useMemo)(()=>O.data?O.data.filter(e=>{var s,t,l,a,r,i,n;let o=!0,c=!0,d=!0,m=!0,u=!0;if(_){let r="string"==typeof e.before_value?null===(s=JSON.parse(e.before_value))||void 0===s?void 0:s.team_id:null===(t=e.before_value)||void 0===t?void 0:t.team_id,i="string"==typeof e.updated_values?null===(l=JSON.parse(e.updated_values))||void 0===l?void 0:l.team_id:null===(a=e.updated_values)||void 0===a?void 0:a.team_id;o=r===_||i===_}if(b)try{let s="string"==typeof e.before_value?JSON.parse(e.before_value):e.before_value,t="string"==typeof e.updated_values?JSON.parse(e.updated_values):e.updated_values,l=null==s?void 0:s.token,a=null==t?void 0:t.token;c="string"==typeof l&&l.includes(b)||"string"==typeof a&&a.includes(b)}catch(e){c=!1}if(Z&&(d=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(Z.toLowerCase())),"all"!==S&&(m=(null===(i=e.action)||void 0===i?void 0:i.toLowerCase())===S.toLowerCase()),"all"!==I){let s="";switch(I){case"keys":s="litellm_verificationtoken";break;case"teams":s="litellm_teamtable";break;case"users":s="litellm_usertable";break;default:s=I}u=(null===(n=e.table_name)||void 0===n?void 0:n.toLowerCase())===s}return o&&c&&d&&m&&u}):[],[O.data,_,b,Z,S,I]),F=D.length,R=Math.ceil(F/j)||1,q=(0,d.useMemo)(()=>{let e=(h-1)*j,s=e+j;return D.slice(e,s)},[D,h,j]),U=!O.data||0===O.data.length,z=(0,d.useCallback)(e=>{let{row:s}=e;return(0,c.jsx)(e=>{let{rowData:s}=e,{before_value:t,updated_values:l,table_name:a,action:r}=s,i=(e,s)=>{if(!e||0===Object.keys(e).length)return(0,c.jsx)(w.Z,{children:"N/A"});if(s){let s=Object.keys(e),t=["token","spend","max_budget"];if(s.every(e=>t.includes(e))&&s.length>0)return(0,c.jsxs)("div",{children:[s.includes("token")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Token:"})," ",e.token||"N/A"]}),s.includes("spend")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Spend:"})," ",void 0!==e.spend?"$".concat(eR(e.spend,6)):"N/A"]}),s.includes("max_budget")&&(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Max Budget:"})," ",void 0!==e.max_budget?"$".concat(eR(e.max_budget,6)):"N/A"]})]});if(e["No differing fields detected in 'before' state"]||e["No differing fields detected in 'updated' state"]||e["No fields changed"])return(0,c.jsx)(w.Z,{children:e[Object.keys(e)[0]]})}return(0,c.jsx)("pre",{className:"p-2 bg-gray-50 border rounded text-xs overflow-auto max-h-60",children:JSON.stringify(e,null,2)})},n=t,o=l;if(("updated"===r||"rotated"===r)&&t&&l&&("LiteLLM_TeamTable"===a||"LiteLLM_UserTable"===a||"LiteLLM_VerificationToken"===a)){let e={},s={};new Set([...Object.keys(t),...Object.keys(l)]).forEach(a=>{JSON.stringify(t[a])!==JSON.stringify(l[a])&&(t.hasOwnProperty(a)&&(e[a]=t[a]),l.hasOwnProperty(a)&&(s[a]=l[a]))}),Object.keys(t).forEach(a=>{l.hasOwnProperty(a)||e.hasOwnProperty(a)||(e[a]=t[a],s[a]=void 0)}),Object.keys(l).forEach(a=>{t.hasOwnProperty(a)||s.hasOwnProperty(a)||(s[a]=l[a],e[a]=void 0)}),n=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},o=Object.keys(s).length>0?s:{"No differing fields detected in 'updated' state":"N/A"},0===Object.keys(e).length&&0===Object.keys(s).length&&(n={"No fields changed":"N/A"},o={"No fields changed":"N/A"})}return(0,c.jsxs)("div",{className:"-mx-4 p-4 bg-slate-100 border-y border-slate-300 grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Before Value:"}),i(n,"LiteLLM_VerificationToken"===a)]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Updated Value:"}),i(o,"LiteLLM_VerificationToken"===a)]})]})},{rowData:s.original})},[]);if(!i)return(0,c.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,c.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,c.jsx)(w.Z,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,c.jsx)(w.Z,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,c.jsx)("img",{src:ax,alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{console.error("Failed to load audit logs preview image"),e.target.style.display="none"}})]});let V=F>0?(h-1)*j+1:0,K=Math.min(h*j,F);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4"}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,c.jsx)("h1",{className:"text-xl font-semibold py-4",children:"Audit Logs"}),(0,c.jsx)(e=>{let{show:s}=e;return s?(0,c.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start mb-6",children:[(0,c.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,c.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,c.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Audit Logs Not Available"}),(0,c.jsx)("p",{className:"text-sm text-blue-700 mt-1",children:"To enable audit logging, add the following configuration to your LiteLLM proxy configuration file:"}),(0,c.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"litellm_settings:\n store_audit_logs: true"}),(0,c.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change and proxy restart."})]})]}):null},{show:U}),(0,c.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,c.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)("input",{type:"text",placeholder:"Search by Object ID...",value:Z,onChange:e=>k(e.target.value),className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,c.jsxs)("button",{onClick:()=>{O.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,c.jsx)("svg",{className:"w-4 h-4 ".concat(O.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,c.jsx)("span",{children:"Refresh"})]})]})}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsxs)("div",{className:"relative",ref:u,children:[(0,c.jsx)("label",{htmlFor:"actionFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Action:"}),(0,c.jsxs)("button",{id:"actionFilterDisplay",onClick:()=>A(!E),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,c.jsxs)("span",{children:["all"===S&&"All Actions","created"===S&&"Created","updated"===S&&"Updated","deleted"===S&&"Deleted","rotated"===S&&"Rotated"]}),(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),E&&(0,c.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,c.jsx)("div",{className:"space-y-1",children:[{label:"All Actions",value:"all"},{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}].map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(S===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{C(e.value),A(!1)},children:e.label},e.value))})})]}),(0,c.jsxs)("div",{className:"relative",ref:x,children:[(0,c.jsx)("label",{htmlFor:"tableFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Table:"}),(0,c.jsxs)("button",{id:"tableFilterDisplay",onClick:()=>L(!T),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,c.jsxs)("span",{children:["all"===I&&"All Tables","keys"===I&&"Keys","teams"===I&&"Teams","users"===I&&"Users"]}),(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),T&&(0,c.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,c.jsx)("div",{className:"space-y-1",children:[{label:"All Tables",value:"all"},{label:"Keys",value:"keys"},{label:"Teams",value:"teams"},{label:"Users",value:"users"}].map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(I===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{P(e.value),L(!1)},children:e.label},e.value))})})]}),(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",O.isLoading?"...":V," ","-"," ",O.isLoading?"...":K," ","of"," ",O.isLoading?"...":F," ","results"]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",O.isLoading?"...":h," of"," ",O.isLoading?"...":R]}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.max(1,e-1)),disabled:O.isLoading||1===h,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>p(e=>Math.min(R,e+1)),disabled:O.isLoading||h===R,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),(0,c.jsx)(t8,{columns:al,data:q,renderSubComponent:z,getRowCanExpand:()=>!0})]})]})}let ap=(e,s,t)=>{if(e)return"".concat(l8()(s).format("MMM D, h:mm A")," - ").concat(l8()(t).format("MMM D, h:mm A"));let l=l8()(),a=l8()(s),r=l.diff(a,"minutes");if(r>=0&&r<2)return"Last 1 Minute";if(r>=2&&r<16)return"Last 15 Minutes";if(r>=16&&r<61)return"Last Hour";let i=l.diff(a,"hours");return i>=1&&i<5?"Last 4 Hours":i>=5&&i<25?"Last 24 Hours":i>=25&&i<169?"Last 7 Days":"".concat(a.format("MMM D")," - ").concat(l.format("MMM D"))};function ag(e){var s,t,l;let{accessToken:a,token:r,userRole:i,userID:n,allTeams:o,premiumUser:m}=e,[u,x]=(0,d.useState)(""),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)(!1),[_,y]=(0,d.useState)(1),[b]=(0,d.useState)(50),N=(0,d.useRef)(null),Z=(0,d.useRef)(null),w=(0,d.useRef)(null),[k,S]=(0,d.useState)(l8()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[C,I]=(0,d.useState)(l8()().format("YYYY-MM-DDTHH:mm")),[P,E]=(0,d.useState)(!1),[A,T]=(0,d.useState)(!1),[L,O]=(0,d.useState)(""),[M,D]=(0,d.useState)(""),[F,R]=(0,d.useState)(""),[q,U]=(0,d.useState)(""),[z,V]=(0,d.useState)(""),[K,B]=(0,d.useState)(null),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)(""),[W,$]=(0,d.useState)(i&&eL.lo.includes(i)),[Q,X]=(0,d.useState)("request logs"),[ee,es]=(0,d.useState)(null),[et,el]=(0,d.useState)(null),ea=(0,h.NL)(),[er,ei]=(0,d.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,d.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(er))},[er]);let[en,eo]=(0,d.useState)({value:24,unit:"hours"});(0,d.useEffect)(()=>{(async()=>{G&&a&&B({...(await (0,g.keyInfoV1Call)(a,G)).info,token:G,api_key:G})})()},[G,a]),(0,d.useEffect)(()=>{function e(e){N.current&&!N.current.contains(e.target)&&v(!1),Z.current&&!Z.current.contains(e.target)&&j(!1),w.current&&!w.current.contains(e.target)&&T(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,d.useEffect)(()=>{i&&eL.lo.includes(i)&&$(!0)},[i]);let ec=(0,sm.a)({queryKey:["logs","table",_,b,k,C,F,q,W?n:null,J,z],queryFn:async()=>{if(!a||!r||!i||!n)return{data:[],total:0,page:1,page_size:b,total_pages:0};let e=l8()(k).utc().format("YYYY-MM-DD HH:mm:ss"),s=P?l8()(C).utc().format("YYYY-MM-DD HH:mm:ss"):l8()().utc().format("YYYY-MM-DD HH:mm:ss"),t=await (0,g.uiSpendLogsCall)(a,q||void 0,F||void 0,void 0,e,s,_,b,W?n:void 0,J,z);return await aa(t.data,e,a,ea),t.data=t.data.map(s=>{let t=ea.getQueryData(["logDetails",s.request_id,e]);return(null==t?void 0:t.messages)&&(null==t?void 0:t.response)&&(s.messages=t.messages,s.response=t.response),s}),t},enabled:!!a&&!!r&&!!i&&!!n&&"request logs"===Q,refetchInterval:!!er&&1===_&&15e3,refetchIntervalInBackground:!0}),{filters:ed,filteredLogs:em,allTeams:eu,allKeyAliases:ex,handleFilterChange:eh,handleFilterReset:ep}=function(e){let{logs:s,accessToken:t,startTime:l,endTime:a,pageSize:r=25,isCustomDate:i,setCurrentPage:n,userID:o,userRole:c}=e,m=(0,d.useMemo)(()=>({[au.TEAM_ID]:"",[au.KEY_HASH]:"",[au.REQUEST_ID]:"",[au.MODEL]:"",[au.USER_ID]:"",[au.END_USER]:"",[au.STATUS]:"",[au.KEY_ALIAS]:""}),[]),[u,x]=(0,d.useState)(m),[h,p]=(0,d.useState)(s),j=(0,d.useRef)(0),f=(0,d.useCallback)(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t)return;let n=Date.now();j.current=n;let o=l8()(l).utc().format("YYYY-MM-DD HH:mm:ss"),c=i?l8()(a).utc().format("YYYY-MM-DD HH:mm:ss"):l8()().utc().format("YYYY-MM-DD HH:mm:ss");try{let l=await (0,g.uiSpendLogsCall)(t,e[au.KEY_HASH]||void 0,e[au.TEAM_ID]||void 0,e[au.REQUEST_ID]||void 0,o,c,s,r,e[au.USER_ID]||void 0,e[au.END_USER]||void 0,e[au.STATUS]||void 0,e[au.MODEL]||void 0);n===j.current&&l.data&&p(l)}catch(e){console.error("Error searching users:",e)}},[t,l,a,i,r]),v=(0,d.useMemo)(()=>eT()((e,s)=>f(e,s),300),[f]);(0,d.useEffect)(()=>()=>v.cancel(),[v]);let _=(0,sm.a)({queryKey:["allKeys"],queryFn:async()=>{if(!t)throw Error("Access token required");return await su(t)},enabled:!!t}).data||[];(0,d.useEffect)(()=>{if(!s||!s.data){p({data:[],total:0,page:1,page_size:50,total_pages:0});return}let e=[...s.data];if(u[au.TEAM_ID]&&(e=e.filter(e=>e.team_id===u[au.TEAM_ID])),u[au.STATUS]&&(e=e.filter(e=>"success"===u[au.STATUS]?!e.status||"success"===e.status:e.status===u[au.STATUS])),u[au.MODEL]&&(e=e.filter(e=>e.model===u[au.MODEL])),u[au.KEY_HASH]&&(e=e.filter(e=>e.api_key===u[au.KEY_HASH])),u[au.END_USER]&&(e=e.filter(e=>e.end_user===u[au.END_USER])),u[au.KEY_ALIAS])try{let s=u[au.KEY_ALIAS];s&&(e=e.filter(e=>{var t;return(null===(t=e.metadata)||void 0===t?void 0:t.user_api_key_alias)===s}))}catch(e){console.error("Error fetching key info for alias:",e)}let t={data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages};JSON.stringify(t)!==JSON.stringify(h)&&p(t)},[s,u,h,t]);let{data:y}=(0,sm.a)({queryKey:["allTeamsForLogFilters",t],queryFn:async()=>t&&await sx(t)||[],enabled:!!t});return{filters:u,filteredLogs:h,allKeyAliases:_,allTeams:y,handleFilterChange:e=>{x(s=>{let t={...s,...e};for(let e of Object.keys(m))e in t||(t[e]=m[e]);return JSON.stringify(t)!==JSON.stringify(s)&&(n(1),v(t,1)),t})},handleFilterReset:()=>{x(m),v(m,1)}}}({logs:ec.data||{data:[],total:0,page:1,page_size:b||10,total_pages:1},accessToken:a,startTime:k,endTime:C,pageSize:b,isCustomDate:P,setCurrentPage:y,userID:n,userRole:i}),eg=(0,d.useCallback)(async e=>{if(a)try{let s=(await (0,g.keyListCall)(a,null,null,e,null,null,_,b)).keys.find(s=>s.key_alias===e);s&&U(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[a,_,b]);(0,d.useEffect)(()=>{a&&(ed["Team ID"]?R(ed["Team ID"]):R(""),Y(ed.Status||""),V(ed.Model||""),ed["Key Hash"]?U(ed["Key Hash"]):ed["Key Alias"]?eg(ed["Key Alias"]):U(""))},[ed,a,eg]);let ej=(0,sm.a)({queryKey:["sessionLogs",et],queryFn:async()=>{if(!a||!et)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,g.sessionSpendLogsCall)(a,et);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!a&&!!et});if((0,d.useEffect)(()=>{var e;(null===(e=ec.data)||void 0===e?void 0:e.data)&&ee&&!ec.data.data.some(e=>e.request_id===ee)&&es(null)},[null===(s=ec.data)||void 0===s?void 0:s.data,ee]),!a||!r||!i||!n)return null;let ef=em.data.filter(e=>!u||e.request_id.includes(u)||e.model.includes(u)||e.user&&e.user.includes(u)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>H(e),onSessionClick:e=>{e&&el(e)}}))||[],ev=(null===(l=ej.data)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.map(e=>({...e,onKeyHashClick:e=>H(e),onSessionClick:e=>{}})))||[],e_=[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>o&&0!==o.length?o.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",isSearchable:!1},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>a?(await su(a)).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e})):[]},{name:"End User",label:"End User",isSearchable:!0,searchFn:async e=>{if(!a)return[];let s=await (0,g.allEndUsersCall)(a);return((null==s?void 0:s.end_users)||[]).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Key Hash",label:"Key Hash",isSearchable:!1}];if(et&&ej.data)return(0,c.jsx)("div",{className:"w-full p-6",children:(0,c.jsx)(ac,{sessionId:et,logs:ej.data.data,onBack:()=>el(null)})});let ey=[{label:"Last 15 Minutes",value:15,unit:"minutes"},{label:"Last Hour",value:1,unit:"hours"},{label:"Last 4 Hours",value:4,unit:"hours"},{label:"Last 24 Hours",value:24,unit:"hours"},{label:"Last 7 Days",value:7,unit:"days"}],eb=ey.find(e=>e.value===en.value&&e.unit===en.unit),eN=P?ap(P,k,C):null==eb?void 0:eb.label;return(0,c.jsx)("div",{className:"w-full p-6",children:(0,c.jsxs)(e$.Z,{defaultIndex:0,onIndexChange:e=>X(0===e?"request logs":"audit logs"),children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(eW.Z,{children:"Request Logs"}),(0,c.jsx)(eW.Z,{children:"Audit Logs"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,c.jsx)("h1",{className:"text-xl font-semibold",children:et?(0,c.jsxs)(c.Fragment,{children:["Session: ",(0,c.jsx)("span",{className:"font-mono",children:et}),(0,c.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>el(null),children:"← Back to All Logs"})]}):"Request Logs"})}),K&&G&&K.api_key===G?(0,c.jsx)(so,{keyId:G,keyData:K,accessToken:a,userID:n,userRole:i,teams:o,onClose:()=>H(null),premiumUser:m}):et?(0,c.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,c.jsx)(t8,{columns:as,data:ev,renderSubComponent:aj,getRowCanExpand:()=>!0})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(sd,{options:e_,onApplyFilters:eh,onResetFilters:ep}),(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"border-b px-6 py-4",children:(0,c.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,c.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,c.jsxs)("div",{className:"relative w-64",children:[(0,c.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:u,onChange:e=>x(e.target.value)}),(0,c.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsxs)("div",{className:"relative",ref:w,children:[(0,c.jsxs)("button",{onClick:()=>T(!A),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),eN]}),A&&(0,c.jsx)("div",{className:"absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,c.jsxs)("div",{className:"space-y-1",children:[ey.map(e=>(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eN===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{I(l8()().format("YYYY-MM-DDTHH:mm")),S(l8()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eo({value:e.value,unit:e.unit}),E(!1),T(!1)},children:e.label},e.label)),(0,c.jsx)("div",{className:"border-t my-2"}),(0,c.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(P?"bg-blue-50 text-blue-600":""),onClick:()=>E(!P),children:"Custom Range"})]})})]}),(0,c.jsx)(()=>(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,c.jsx)(tT.Z,{color:"green",checked:er,defaultChecked:!0,onChange:ei})]}),{}),(0,c.jsxs)("button",{onClick:()=>{ec.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,c.jsx)("svg",{className:"w-4 h-4 ".concat(ec.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,c.jsx)("span",{children:"Refresh"})]})]}),P&&(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{children:(0,c.jsx)("input",{type:"datetime-local",value:k,onChange:e=>{S(e.target.value),y(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,c.jsx)("span",{className:"text-gray-500",children:"to"}),(0,c.jsx)("div",{children:(0,c.jsx)("input",{type:"datetime-local",value:C,onChange:e=>{I(e.target.value),y(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",ec.isLoading?"...":em?(_-1)*b+1:0," ","-"," ",ec.isLoading?"...":em?Math.min(_*b,em.total):0," ","of"," ",ec.isLoading?"...":em?em.total:0," ","results"]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",ec.isLoading?"...":_," of"," ",ec.isLoading?"...":em?em.total_pages:1]}),(0,c.jsx)("button",{onClick:()=>y(e=>Math.max(1,e-1)),disabled:ec.isLoading||1===_,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,c.jsx)("button",{onClick:()=>y(e=>Math.min(em.total_pages||1,e+1)),disabled:ec.isLoading||_===(em.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),er&&1===_&&(0,c.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-greem-200 rounded-md flex items-center justify-between",children:[(0,c.jsx)("div",{className:"flex items-center gap-2",children:(0,c.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,c.jsx)("button",{onClick:()=>ei(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,c.jsx)(t8,{columns:as,data:ef,renderSubComponent:aj,getRowCanExpand:()=>!0})]})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(ah,{userID:n,userRole:i,token:r,accessToken:a,isActive:"audit logs"===Q,premiumUser:m,allTeams:o})})]})]})})}function aj(e){var s,t,l,a,r;let{row:i}=e,n=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},o=i.original.metadata||{},d="failure"===o.status,m=d?o.error_information:null,u=i.original.messages&&(Array.isArray(i.original.messages)?i.original.messages.length>0:Object.keys(i.original.messages).length>0),x=i.original.response&&Object.keys(n(i.original.response)).length>0,h=o.vector_store_request_metadata&&Array.isArray(o.vector_store_request_metadata)&&o.vector_store_request_metadata.length>0,p=i.original.metadata&&i.original.metadata.guardrail_information,g=p&&(null===(r=i.original.metadata)||void 0===r?void 0:r.guardrail_information.masked_entity_count)?Object.values(i.original.metadata.guardrail_information.masked_entity_count).reduce((e,s)=>e+("number"==typeof s?s:0),0):0;return(0,c.jsxs)("div",{className:"p-6 bg-gray-50 space-y-6",children:[(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"p-4 border-b",children:(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request Details"})}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 p-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Request ID:"}),(0,c.jsx)("span",{className:"font-mono text-sm",children:i.original.request_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Model:"}),(0,c.jsx)("span",{children:i.original.model})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Model ID:"}),(0,c.jsx)("span",{children:i.original.model_id})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Call Type:"}),(0,c.jsx)("span",{children:i.original.call_type})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,c.jsx)("span",{children:i.original.custom_llm_provider||"-"})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"API Base:"}),(0,c.jsx)(z.Z,{title:i.original.api_base||"-",children:(0,c.jsx)("span",{className:"max-w-[15ch] truncate block",children:i.original.api_base||"-"})})]}),(null==i?void 0:null===(s=i.original)||void 0===s?void 0:s.requester_ip_address)&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"IP Address:"}),(0,c.jsx)("span",{children:null==i?void 0:null===(t=i.original)||void 0===t?void 0:t.requester_ip_address})]}),p&&(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail:"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{className:"font-mono",children:i.original.metadata.guardrail_information.guardrail_name}),g>0&&(0,c.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[g," masked"]})]})]})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Tokens:"}),(0,c.jsxs)("span",{children:[i.original.total_tokens," (",i.original.prompt_tokens,"+",i.original.completion_tokens,")"]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Cost:"}),(0,c.jsxs)("span",{children:["$",eR(i.original.spend||0,6)]})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Cache Hit:"}),(0,c.jsx)("span",{children:i.original.cache_hit})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,c.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat("failure"!==((null===(l=i.original.metadata)||void 0===l?void 0:l.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(a=i.original.metadata)||void 0===a?void 0:a.status)||"Success").toLowerCase()?"Success":"Failure"})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,c.jsx)("span",{children:i.original.startTime})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,c.jsx)("span",{children:i.original.endTime})]}),(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,c.jsxs)("span",{children:[i.original.duration," s."]})]})]})]})]}),(0,c.jsx)(an,{show:!u&&!x}),(0,c.jsx)(ar,{row:i,hasMessages:u,hasResponse:x,hasError:d,errorInfo:m,getRawRequest:()=>{var e;return(null===(e=i.original)||void 0===e?void 0:e.proxy_server_request)?n(i.original.proxy_server_request):n(i.original.messages)},formattedResponse:()=>d&&m?{error:{message:m.error_message||"An error occurred",type:m.error_class||"error",code:m.error_code||"unknown",param:null}}:n(i.original.response)}),p&&(0,c.jsx)(am,{data:i.original.metadata.guardrail_information}),h&&(0,c.jsx)(ad,{data:o.vector_store_request_metadata}),d&&m&&(0,c.jsx)(ai,{errorInfo:m}),i.original.request_tags&&Object.keys(i.original.request_tags).length>0&&(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsx)("div",{className:"flex justify-between items-center p-4 border-b",children:(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Request Tags"})}),(0,c.jsx)("div",{className:"p-4",children:(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(i.original.request_tags).map(e=>{let[s,t]=e;return(0,c.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[s,": ",String(t)]},s)})})})]}),i.original.metadata&&Object.keys(i.original.metadata).length>0&&(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,c.jsx)("h3",{className:"text-lg font-medium",children:"Metadata"}),(0,c.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(i.original.metadata,null,2))},className:"p-1 hover:bg-gray-200 rounded",title:"Copy metadata",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,c.jsx)("div",{className:"p-4 overflow-auto max-h-64",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(i.original.metadata,null,2)})})]})]})}var af=t(36172),av=t(14042),a_=e=>{let{userID:s,userRole:t,accessToken:l,userSpend:a,userMaxBudget:r,selectedTeam:i}=e;console.log("userSpend: ".concat(a));let[n,o]=(0,d.useState)(null!==a?a:0),[m,u]=(0,d.useState)(i?Number(eR(i.max_budget,4)):null);(0,d.useEffect)(()=>{if(i){if("Default Team"===i.team_alias)u(r);else{let e=!1;if(i.team_memberships)for(let t of i.team_memberships)t.user_id===s&&"max_budget"in t.litellm_budget_table&&null!==t.litellm_budget_table.max_budget&&(u(t.litellm_budget_table.max_budget),e=!0);e||u(i.max_budget)}}},[i,r]);let[x,h]=(0,d.useState)([]);(0,d.useEffect)(()=>{let e=async()=>{if(!l||!s||!t)return};(async()=>{try{if(null===s||null===t)return;if(null!==l){let e=(await (0,g.modelAvailableCall)(l,s,t)).data.map(e=>e.id);console.log("available_model_names:",e),h(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[t,l,s]),(0,d.useEffect)(()=>{null!==a&&o(a)},[a]);let p=[];i&&i.models&&(p=i.models),p&&p.includes("all-proxy-models")?(console.log("user models:",x),p=x):p&&p.includes("all-team-models")?p=i.models:p&&0===p.length&&(p=x);let j=null!==m?"$".concat(eR(Number(m),4)," limit"):"No limit",f=void 0!==n?eR(n,4):null;return console.log("spend in view user spend: ".concat(n)),(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,c.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",f]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,c.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:j})]})]})})};let ay=e=>{let{key:s,info:t}=e;return{token:s,...t}};var ab=e=>{let{topKeys:s,accessToken:t,userID:l,userRole:a,teams:r,premiumUser:i}=e,[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(null),[x,h]=(0,d.useState)(void 0),[p,j]=(0,d.useState)("table"),f=async e=>{if(t)try{let s=await (0,g.keyInfoV1Call)(t,e.api_key),l=ay(s);h(l),u(e.api_key),o(!0)}catch(e){console.error("Error fetching key info:",e)}},v=()=>{o(!1),u(null),h(void 0)};d.useEffect(()=>{let e=e=>{"Escape"===e.key&&n&&v()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n]);let y=s.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{onClick:()=>j("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===p?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,c.jsx)("button",{onClick:()=>j("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===p?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===p?(0,c.jsx)("div",{className:"relative",children:(0,c.jsx)(sQ.Z,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:y,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>e?"$".concat(eR(e,2)):"No Key Alias",onValueChange:e=>f(e),showTooltip:!0,customTooltip:e=>{var s,t;let l=null===(t=e.payload)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.payload;return(0,c.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,c.jsxs)("div",{className:"space-y-1.5",children:[(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,c.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==l?void 0:l.key_alias})]}),(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,c.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==l?void 0:l.api_key})]}),(0,c.jsxs)("div",{className:"text-sm",children:[(0,c.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,c.jsxs)("span",{className:"text-white font-medium",children:["$",eR(null==l?void 0:l.spend,2)]})]})]})})}})}):(0,c.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,c.jsx)(t8,{columns:[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:e.getValue(),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>f(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>"$".concat(eR(e.getValue(),2))}],data:s,renderSubComponent:()=>(0,c.jsx)(c.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),n&&m&&x&&(console.log("Rendering modal with:",{isModalOpen:n,selectedKey:m,keyData:x}),(0,c.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&v()},children:(0,c.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,c.jsx)("button",{onClick:v,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,c.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,c.jsx)("div",{className:"p-6 h-full",children:(0,c.jsx)(so,{keyId:m,onClose:v,keyData:x,accessToken:t,userID:l,userRole:a,teams:r,premiumUser:i})})]})}))]})};function aN(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function aZ(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}let aw={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6"},ak=e=>{let{active:s,payload:t,label:l}=e;if(s&&t&&t.length){let e=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),s=(e,s)=>{let t=s.substring(s.indexOf(".")+1);if(e.metrics&&t in e.metrics)return e.metrics[t]};return(0,c.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,c.jsx)("p",{className:"text-tremor-content-strong",children:l}),t.map(t=>{var l;let a=null===(l=t.dataKey)||void 0===l?void 0:l.toString();if(!a||!t.payload)return null;let r=s(t.payload,a),i=a.includes("spend"),n=void 0!==r?i?"$".concat(r.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})):r.toLocaleString():"N/A",o=aw[t.color]||t.color;return(0,c.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:o}}),(0,c.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:e(a)})]}),(0,c.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:n})]},a)})]})}return null},aS=e=>{let{categories:s,colors:t}=e,l=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return(0,c.jsx)("div",{className:"flex items-center justify-end space-x-4",children:s.map((e,s)=>{let a=aw[t[s]]||t[s];return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:a}}),(0,c.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:l(e)})]},e)})})},aC=e=>{var s,t;let{modelName:l,metrics:a}=e;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)(v.Z,{numItems:4,className:"gap-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(k.Z,{children:a.total_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Successful Requests"}),(0,c.jsx)(k.Z,{children:a.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(k.Z,{children:a.total_tokens.toLocaleString()}),(0,c.jsxs)(w.Z,{children:[Math.round(a.total_tokens/a.total_successful_requests)," ","avg per successful request"]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Spend"}),(0,c.jsxs)(k.Z,{children:["$",eR(a.total_spend,2)]}),(0,c.jsxs)(w.Z,{children:["$",eR(a.total_spend/a.total_successful_requests,3)," ","per successful request"]})]})]}),a.top_api_keys&&a.top_api_keys.length>0&&(0,c.jsxs)(X.Z,{className:"mt-4",children:[(0,c.jsx)(k.Z,{children:"Top API Keys by Spend"}),(0,c.jsx)("div",{className:"mt-3",children:(0,c.jsx)("div",{className:"grid grid-cols-1 gap-2",children:a.top_api_keys.map((e,s)=>(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:e.key_alias||"".concat(e.api_key.substring(0,10),"...")}),e.team_id&&(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,c.jsxs)("div",{className:"text-right",children:[(0,c.jsxs)(w.Z,{className:"font-medium",children:["$",eR(e.spend,2)]}),(0,c.jsxs)(w.Z,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(aS,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:aN,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Requests per day"}),(0,c.jsx)(aS,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,c.jsx)(sQ.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:aN,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Spend per day"}),(0,c.jsx)(aS,{categories:["metrics.spend"],colors:["green"]})]}),(0,c.jsx)(sQ.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:aZ,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Success vs Failed Requests"}),(0,c.jsx)(aS,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:aN,stack:!0,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Prompt Caching Metrics"}),(0,c.jsx)(aS,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,c.jsxs)("div",{className:"mb-2",children:[(0,c.jsxs)(w.Z,{children:["Cache Read:"," ",(null===(s=a.total_cache_read_input_tokens)||void 0===s?void 0:s.toLocaleString())||0," ","tokens"]}),(0,c.jsxs)(w.Z,{children:["Cache Creation:"," ",(null===(t=a.total_cache_creation_input_tokens)||void 0===t?void 0:t.toLocaleString())||0," ","tokens"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:aN,customTooltip:ak,showLegend:!1})]})]})]})},aI=e=>{let{modelMetrics:s}=e,t=Object.keys(s).sort((e,t)=>""===e?1:""===t?-1:s[t].total_spend-s[e].total_spend),l={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(s).forEach(e=>{l.total_requests+=e.total_requests,l.total_successful_requests+=e.total_successful_requests,l.total_tokens+=e.total_tokens,l.total_spend+=e.total_spend,l.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,l.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{l.daily_data[e.date]||(l.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),l.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,l.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,l.daily_data[e.date].total_tokens+=e.metrics.total_tokens,l.daily_data[e.date].api_requests+=e.metrics.api_requests,l.daily_data[e.date].spend+=e.metrics.spend,l.daily_data[e.date].successful_requests+=e.metrics.successful_requests,l.daily_data[e.date].failed_requests+=e.metrics.failed_requests,l.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,l.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let a=Object.entries(l.daily_data).map(e=>{let[s,t]=e;return{date:s,metrics:t}}).sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime());return(0,c.jsxs)("div",{className:"space-y-8",children:[(0,c.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,c.jsx)(k.Z,{children:"Overall Usage"}),(0,c.jsxs)(v.Z,{numItems:4,className:"gap-4 mb-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Requests"}),(0,c.jsx)(k.Z,{children:l.total_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Successful Requests"}),(0,c.jsx)(k.Z,{children:l.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Tokens"}),(0,c.jsx)(k.Z,{children:l.total_tokens.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Total Spend"}),(0,c.jsxs)(k.Z,{children:["$",eR(l.total_spend,2)]})]})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Tokens Over Time"}),(0,c.jsx)(aS,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:aN,customTooltip:ak,showLegend:!1})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(k.Z,{children:"Total Requests Over Time"}),(0,c.jsx)(aS,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,c.jsx)(s$.Z,{className:"mt-4",data:a,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:aN,stack:!0,customTooltip:ak,showLegend:!1})]})]})]}),(0,c.jsx)(th.default,{defaultActiveKey:t[0],children:t.map(e=>(0,c.jsx)(th.default.Panel,{header:(0,c.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,c.jsx)(k.Z,{children:s[e].label||"Unknown Item"}),(0,c.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,c.jsxs)("span",{children:["$",eR(s[e].total_spend,2)]}),(0,c.jsxs)("span",{children:[s[e].total_requests.toLocaleString()," ","requests"]})]})]}),children:(0,c.jsx)(aC,{modelName:e||"Unknown Model",metrics:s[e]})},e))})]})},aP=(e,s)=>{let t=e.metadata.key_alias||"key-hash-".concat(s),l=e.metadata.team_id;return l?"".concat(t," (team_id: ").concat(l,")"):t},aE=(e,s)=>{let t={};return e.results.forEach(e=>{Object.entries(e.breakdown[s]||{}).forEach(l=>{let[a,r]=l;t[a]||(t[a]={label:"api_keys"===s?aP(r,a):a,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],daily_data:[]}),t[a].total_requests+=r.metrics.api_requests,t[a].prompt_tokens+=r.metrics.prompt_tokens,t[a].completion_tokens+=r.metrics.completion_tokens,t[a].total_tokens+=r.metrics.total_tokens,t[a].total_spend+=r.metrics.spend,t[a].total_successful_requests+=r.metrics.successful_requests,t[a].total_failed_requests+=r.metrics.failed_requests,t[a].total_cache_read_input_tokens+=r.metrics.cache_read_input_tokens||0,t[a].total_cache_creation_input_tokens+=r.metrics.cache_creation_input_tokens||0,t[a].daily_data.push({date:e.date,metrics:{prompt_tokens:r.metrics.prompt_tokens,completion_tokens:r.metrics.completion_tokens,total_tokens:r.metrics.total_tokens,api_requests:r.metrics.api_requests,spend:r.metrics.spend,successful_requests:r.metrics.successful_requests,failed_requests:r.metrics.failed_requests,cache_read_input_tokens:r.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:r.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==s&&Object.entries(t).forEach(l=>{let[a,r]=l,i={};e.results.forEach(e=>{var t;let l=null===(t=e.breakdown[s])||void 0===t?void 0:t[a];l&&"api_key_breakdown"in l&&Object.entries(l.api_key_breakdown||{}).forEach(e=>{let[s,t]=e;i[s]||(i[s]={api_key:s,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),i[s].spend+=t.metrics.spend,i[s].requests+=t.metrics.api_requests,i[s].tokens+=t.metrics.total_tokens})}),t[a].top_api_keys=Object.values(i).sort((e,s)=>s.spend-e.spend).slice(0,5)}),Object.values(t).forEach(e=>{e.daily_data.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime())}),t};var aA=e=>{let{accessToken:s,entityType:t,entityId:l,userID:a,userRole:r,entityList:i,premiumUser:n}=e,[o,m]=(0,d.useState)({results:[],metadata:{total_spend:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0}}),u=aE(o,"models"),x=aE(o,"api_keys"),[h,p]=(0,d.useState)([]),[j,_]=(0,d.useState)({from:new Date(Date.now()-24192e5),to:new Date}),y=async()=>{if(!s||!j.from||!j.to)return;let e=new Date(j.from),l=new Date(j.to);if("tag"===t)m(await (0,g.tagDailyActivityCall)(s,e,l,1,h.length>0?h:null));else if("team"===t)m(await (0,g.teamDailyActivityCall)(s,e,l,1,h.length>0?h:null));else throw Error("Invalid entity type")};(0,d.useEffect)(()=>{y()},[s,j,l,h]);let b=()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=l.metrics.spend,e[t].requests+=l.metrics.api_requests,e[t].successful_requests+=l.metrics.successful_requests,e[t].failed_requests+=l.metrics.failed_requests,e[t].tokens+=l.metrics.total_tokens}catch(e){console.error("Error processing provider ".concat(t,": ").concat(e))}})}),Object.values(e).filter(e=>e.spend>0).sort((e,s)=>s.spend-e.spend)},N=e=>0===h.length?e:e.filter(e=>h.includes(e.metadata.id)),Z=()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.entities||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:l.metadata.team_alias||t,id:t}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.total_tokens+=l.metrics.total_tokens})}),N(Object.values(e).sort((e,s)=>s.metrics.spend-e.metrics.spend))};return(0,c.jsxs)("div",{style:{width:"100%"},children:[(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full mb-4",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:j,onValueChange:_})}),i&&i.length>0&&(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(w.Z,{children:["Filter by ","tag"===t?"Tags":"Teams"]}),(0,c.jsx)(C.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select ".concat("tag"===t?"tags":"teams"," to filter..."),value:h,onChange:p,options:(()=>{if(i)return i})(),className:"mt-2",allowClear:!0})]})]}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eW.Z,{children:"Cost"}),(0,c.jsx)(eW.Z,{children:"Model Activity"}),(0,c.jsx)(eW.Z,{children:"Key Activity"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full",children:[(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(k.Z,{children:["tag"===t?"Tag":"Team"," Spend Overview"]}),(0,c.jsxs)(v.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Spend"}),(0,c.jsxs)(w.Z,{className:"text-2xl font-bold mt-2",children:["$",eR(o.metadata.total_spend,2)]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:o.metadata.total_api_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Successful Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:o.metadata.total_successful_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Failed Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:o.metadata.total_failed_requests.toLocaleString()})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:o.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend"}),(0,c.jsx)(sQ.Z,{data:[...o.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aZ,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:l}=e;if(!l||!(null==s?void 0:s[0]))return null;let a=s[0].payload,r=Object.keys(a.breakdown.entities||{}).length;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:a.date}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",eR(a.metrics.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",a.metrics.api_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Successful: ",a.metrics.successful_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Failed: ",a.metrics.failed_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",a.metrics.total_tokens]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["tag"===t?"Total Tags":"Total Teams",": ",r]}),(0,c.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,c.jsxs)("p",{className:"font-semibold",children:["Spend by ","tag"===t?"Tag":"Team",":"]}),Object.entries(a.breakdown.entities||{}).sort((e,s)=>{let[,t]=e,[,l]=s,a=t.metrics.spend;return l.metrics.spend-a}).slice(0,5).map(e=>{let[s,t]=e;return(0,c.jsxs)("p",{className:"text-sm text-gray-600",children:[t.metadata.team_alias||s,": $",eR(t.metrics.spend,2)]},s)}),r>5&&(0,c.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",r-5," more"]})]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,c.jsxs)(k.Z,{children:["Spend Per ","tag"===t?"Tag":"Team"]}),(0,c.jsx)(sL.Z,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,c.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,c.jsxs)("span",{children:["Get Started by Tracking cost per ",t," "]}),(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-6",children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(sQ.Z,{className:"mt-4 h-52",data:Z().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?"".concat(e.metadata.alias.slice(0,15),"..."):e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aZ,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.metadata.alias}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eR(l.metrics.spend,4)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Requests:"," ",l.metrics.api_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-green-600",children:["Successful:"," ",l.metrics.successful_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-red-600",children:["Failed:"," ",l.metrics.failed_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens:"," ",l.metrics.total_tokens.toLocaleString()]})]})}})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"tag"===t?"Tag":"Team"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sN.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sN.Z,{children:"Tokens"})]})}),(0,c.jsx)(s_.Z,{children:Z().filter(e=>e.metrics.spend>0).map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.metadata.alias}),(0,c.jsxs)(sy.Z,{children:["$",eR(e.metrics.spend,4)]}),(0,c.jsx)(sy.Z,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ab,{topKeys:(()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:l.metadata.key_alias,team_id:l.metadata.team_id||null}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:s,userID:a,userRole:r,teams:null,premiumUser:n})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Top Models"}),(0,c.jsx)(sQ.Z,{className:"mt-4 h-40",data:(()=>{let e={};return o.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=l.metrics.spend}catch(e){console.error("Error adding spend for ".concat(t,": ").concat(e,", got metrics: ").concat(JSON.stringify(l)))}e[t].requests+=l.metrics.api_requests,e[t].successful_requests+=l.metrics.successful_requests,e[t].failed_requests+=l.metrics.failed_requests,e[t].tokens+=l.metrics.total_tokens})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,...t}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"display_key",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$".concat(eR(e,2)),layout:"vertical",yAxisWidth:200,showLegend:!1})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,c.jsx)(k.Z,{children:"Provider Usage"}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(av.Z,{className:"mt-4 h-40",data:b(),index:"provider",category:"spend",valueFormatter:e=>"$".concat(eR(e,2)),colors:["cyan","blue","indigo","violet","purple"]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Provider"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sN.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sN.Z,{children:"Tokens"})]})}),(0,c.jsx)(s_.Z,{children:b().map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.provider}),(0,c.jsxs)(sy.Z,{children:["$",eR(e.spend,2)]}),(0,c.jsx)(sy.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:u})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:x})})]})]})]})},aT=e=>{let{isOpen:s,onClose:t,accessToken:l}=e,[a]=I.Z.useForm(),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)("cloudzero"),[p,g]=(0,d.useState)(!1);(0,d.useEffect)(()=>{s&&l&&j()},[s,l]);let j=async()=>{u(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"}});if(e.ok){let s=await e.json();o(s),a.setFieldsValue({connection_id:s.connection_id})}else if(404!==e.status){let s=await e.json();P.ZP.error("Failed to load existing settings: ".concat(s.error||"Unknown error"))}}catch(e){console.error("Error loading CloudZero settings:",e),P.ZP.error("Failed to load existing settings")}finally{u(!1)}},f=async e=>{if(!l){P.ZP.error("No access token available");return}i(!0);try{let s={...e,timezone:"UTC"},t=await fetch(n?"/cloudzero/settings":"/cloudzero/init",{method:n?"PUT":"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(t.ok)return P.ZP.success(a.message||"CloudZero settings saved successfully"),o({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return P.ZP.error(a.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),P.ZP.error("Failed to save CloudZero settings"),!1}finally{i(!1)}},v=async()=>{if(!l){P.ZP.error("No access token available");return}g(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),s=await e.json();e.ok?(P.ZP.success(s.message||"Export to CloudZero completed successfully"),t()):P.ZP.error(s.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),P.ZP.error("Failed to export to CloudZero")}finally{g(!1)}},b=async()=>{g(!0);try{P.ZP.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),P.ZP.error("Failed to export CSV")}finally{g(!1)}},N=async()=>{if("cloudzero"===x){if(!n){let e=await a.validateFields();if(!await f(e))return}await v()}else await b()},Z=()=>{a.resetFields(),h("cloudzero"),o(null),t()},k=[{value:"cloudzero",label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,c.jsx)("span",{children:"Export to CSV"})]})}];return(0,c.jsx)(E.Z,{title:"Export Data",open:s,onCancel:Z,footer:null,width:600,destroyOnClose:!0,children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,c.jsx)(C.default,{value:x,onChange:h,options:k,className:"w-full",size:"large"})]}),"cloudzero"===x&&(0,c.jsx)("div",{children:m?(0,c.jsx)("div",{className:"flex justify-center py-8",children:(0,c.jsx)(lu.Z,{size:"large"})}):(0,c.jsxs)(c.Fragment,{children:[n&&(0,c.jsx)(lZ.Z,{title:"Existing CloudZero Configuration",icon:()=>(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,c.jsxs)(w.Z,{children:["API Key: ",n.api_key_masked,(0,c.jsx)("br",{}),"Connection ID: ",n.connection_id]})}),!n&&(0,c.jsxs)(I.Z,{form:a,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,c.jsx)(y.Z,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,c.jsx)(I.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===x&&(0,c.jsx)(lZ.Z,{title:"CSV Export",icon:()=>(0,c.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,c.jsx)(w.Z,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:Z,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:N,loading:r||p,disabled:r||p,children:"cloudzero"===x?"Export to CloudZero":"Export CSV"})]})]})})},aL=e=>{var s,t,l,a,r,i,n,o,m,u;let{accessToken:x,userRole:h,userID:p,teams:j,premiumUser:_}=e,[y,b]=(0,d.useState)({results:[],metadata:{}}),[N,Z]=(0,d.useState)({from:new Date(Date.now()-24192e5),to:new Date}),[S,C]=(0,d.useState)([]),[I,P]=(0,d.useState)("groups"),[E,A]=(0,d.useState)(!1),T=async()=>{x&&C(Object.values(await (0,g.tagListCall)(x)).map(e=>({label:e.name,value:e.name})))};(0,d.useEffect)(()=>{T()},[x]);let L=(null===(s=y.metadata)||void 0===s?void 0:s.total_spend)||0,O=()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{provider:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}})},M=async()=>{if(!x||!N.from||!N.to)return;let e=new Date(N.from),s=new Date(N.to);try{let t=await (0,g.userDailyActivityCall)(x,e,s);if(t.metadata.total_pages>10)throw Error("Too many pages of data (>10). Please select a smaller date range.");if(t.metadata.total_pages<=1){b(t);return}let l=[...t.results],a={...t.metadata};for(let r=2;r<=t.metadata.total_pages;r++){let t=await (0,g.userDailyActivityCall)(x,e,s,r);l.push(...t.results),t.metadata&&(a.total_spend+=t.metadata.total_spend||0,a.total_api_requests+=t.metadata.total_api_requests||0,a.total_successful_requests+=t.metadata.total_successful_requests||0,a.total_failed_requests+=t.metadata.total_failed_requests||0,a.total_tokens+=t.metadata.total_tokens||0)}b({results:l,metadata:a})}catch(e){throw console.error("Error fetching user spend data:",e),e}};(0,d.useEffect)(()=>{M()},[x,N]);let D=aE(y,"models"),F=aE(y,"api_keys"),R=aE(y,"mcp_servers");return(0,c.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"solid",className:"mt-1",children:[eL.ZL.includes(h||"")?(0,c.jsx)(eW.Z,{children:"Global Usage"}):(0,c.jsx)(eW.Z,{children:"Your Usage"}),(0,c.jsx)(eW.Z,{children:"Team Usage"}),eL.ZL.includes(h||"")?(0,c.jsx)(eW.Z,{children:"Tag Usage"}):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsx)(v.Z,{numItems:2,className:"gap-2 w-full mb-4",children:(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:N,onValueChange:e=>{Z(e)}})})}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eW.Z,{children:"Cost"}),(0,c.jsx)(eW.Z,{children:"Model Activity"}),(0,c.jsx)(eW.Z,{children:"Key Activity"}),(0,c.jsx)(eW.Z,{children:"MCP Server Activity"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(w.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend"," ",new Date().toLocaleString("default",{month:"long"})," ","1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,c.jsx)(a_,{userID:p,userRole:h,accessToken:x,userSpend:L,selectedTeam:null,userMaxBudget:null})]}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Usage Metrics"}),(0,c.jsxs)(v.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:(null===(l=y.metadata)||void 0===l?void 0:null===(t=l.total_api_requests)||void 0===t?void 0:t.toLocaleString())||0})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Successful Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:(null===(r=y.metadata)||void 0===r?void 0:null===(a=r.total_successful_requests)||void 0===a?void 0:a.toLocaleString())||0})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Failed Requests"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:(null===(n=y.metadata)||void 0===n?void 0:null===(i=n.total_failed_requests)||void 0===i?void 0:i.toLocaleString())||0})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Total Tokens"}),(0,c.jsx)(w.Z,{className:"text-2xl font-bold mt-2",children:(null===(m=y.metadata)||void 0===m?void 0:null===(o=m.total_tokens)||void 0===o?void 0:o.toLocaleString())||0})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Average Cost per Request"}),(0,c.jsxs)(w.Z,{className:"text-2xl font-bold mt-2",children:["$",eR((L||0)/((null===(u=y.metadata)||void 0===u?void 0:u.total_api_requests)||1),4)]})]})]})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend"}),(0,c.jsx)(sQ.Z,{data:[...y.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:aZ,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.date}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eR(l.metrics.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Requests: ",l.metrics.api_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Successful: ",l.metrics.successful_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Failed: ",l.metrics.failed_requests]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",l.metrics.total_tokens]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ab,{topKeys:(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:l.metadata.key_alias,team_id:null}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests,e[t].metrics.failed_requests+=l.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),accessToken:x,userID:p,userRole:h,teams:null,premiumUser:_})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"groups"===I?"Top Public Model Names":"Top Litellm Models"}),(0,c.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,c.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("groups"===I?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>P("groups"),children:"Public Model Name"}),(0,c.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("individual"===I?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>P("individual"),children:"Litellm Model Name"})]})]}),(0,c.jsx)(sQ.Z,{className:"mt-4 h-40",data:"groups"===I?(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.model_groups||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})():(()=>{let e={};return y.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,l]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=l.metrics.spend,e[t].metrics.prompt_tokens+=l.metrics.prompt_tokens,e[t].metrics.completion_tokens+=l.metrics.completion_tokens,e[t].metrics.total_tokens+=l.metrics.total_tokens,e[t].metrics.api_requests+=l.metrics.api_requests,e[t].metrics.successful_requests+=l.metrics.successful_requests||0,e[t].metrics.failed_requests+=l.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=l.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=l.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:aZ,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let l=s[0].payload;return(0,c.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,c.jsx)("p",{className:"font-bold",children:l.key}),(0,c.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",eR(l.spend,2)]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Total Requests:"," ",l.requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-green-600",children:["Successful:"," ",l.successful_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-red-600",children:["Failed:"," ",l.failed_requests.toLocaleString()]}),(0,c.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",l.tokens.toLocaleString()]})]})}})]})}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(k.Z,{children:"Spend by Provider"})}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(av.Z,{className:"mt-4 h-40",data:O(),index:"provider",category:"spend",valueFormatter:e=>"$".concat(eR(e,2)),colors:["cyan"]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Provider"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{className:"text-green-600",children:"Successful"}),(0,c.jsx)(sN.Z,{className:"text-red-600",children:"Failed"}),(0,c.jsx)(sN.Z,{children:"Tokens"})]})}),(0,c.jsx)(s_.Z,{children:O().filter(e=>e.spend>0).map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.provider}),(0,c.jsxs)(sy.Z,{children:["$",eR(e.spend,2)]}),(0,c.jsx)(sy.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,c.jsx)(sy.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:D})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:F})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aI,{modelMetrics:R})})]})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aA,{accessToken:x,entityType:"team",userID:p,userRole:h,entityList:(null==j?void 0:j.map(e=>({label:e.team_alias,value:e.team_id})))||null,premiumUser:_})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(aA,{accessToken:x,entityType:"tag",userID:p,userRole:h,entityList:S,premiumUser:_})})]})]}),(0,c.jsx)(aT,{isOpen:E,onClose:()=>A(!1),accessToken:x})]})},aO=e=>{let{proxySettings:s}=e,t="<your_proxy_base_url>";return s&&s.PROXY_BASE_URL&&void 0!==s.PROXY_BASE_URL&&(t=s.PROXY_BASE_URL),(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(v.Z,{className:"gap-2 p-8 h-[80vh] w-full mt-2",children:(0,c.jsxs)("div",{className:"mb-5",children:[(0,c.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:"OpenAI Compatible Proxy: API Reference"}),(0,c.jsx)(w.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,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{children:[(0,c.jsx)(eW.Z,{children:"OpenAI Python SDK"}),(0,c.jsx)(eW.Z,{children:"LlamaIndex"}),(0,c.jsx)(eW.Z,{children:"Langchain Py"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.Z,{language:"python",children:'\nimport openai\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="'.concat(t,'" # 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,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.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="'.concat(t,'", # 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="').concat(t,'",\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,c.jsx)(eX.Z,{children:(0,c.jsx)(l5.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="'.concat(t,'",\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 ')})})]})]})]})})})},aM=t(243),aD=t(93837);async function aF(e,s,t,l,a,r,i,n,o,c,d,m,u){console.log=function(){},console.log("isLocal:",!1);let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new l$.ZP.OpenAI({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a;let h=Date.now(),g=!1,w=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0;for await(let l of(await p.chat.completions.create({model:t,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:c,messages:e,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...w?{tools:w,tool_choice:"auto"}:{}},{signal:r}))){var j,f,v,_,y,b,N,Z;console.log("Stream chunk:",l);let e=null===(j=l.choices[0])||void 0===j?void 0:j.delta;if(console.log("Delta content:",null===(v=l.choices[0])||void 0===v?void 0:null===(f=v.delta)||void 0===f?void 0:f.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!g&&((null===(y=l.choices[0])||void 0===y?void 0:null===(_=y.delta)||void 0===_?void 0:_.content)||e&&e.reasoning_content)&&(g=!0,a=Date.now()-h,console.log("First token received! Time:",a,"ms"),n?(console.log("Calling onTimingData with:",a),n(a)):console.log("onTimingData callback is not defined!")),null===(N=l.choices[0])||void 0===N?void 0:null===(b=N.delta)||void 0===b?void 0:b.content){let e=l.choices[0].delta.content;s(e,l.model)}if(e&&e.reasoning_content){let s=e.reasoning_content;i&&i(s)}if(l.usage&&o){console.log("Usage data found:",l.usage);let e={completionTokens:l.usage.completion_tokens,promptTokens:l.usage.prompt_tokens,totalTokens:l.usage.total_tokens};(null===(Z=l.usage.completion_tokens_details)||void 0===Z?void 0:Z.reasoning_tokens)&&(e.reasoningTokens=l.usage.completion_tokens_details.reasoning_tokens),o(e)}}}catch(e){throw(null==r?void 0:r.aborted)&&console.log("Chat completion request was cancelled"),e}}async function aR(e,s,t,l,a,r){console.log=function(){},console.log("isLocal:",!1);let i=(0,g.getProxyBaseUrl)(),n=new l$.ZP.OpenAI({apiKey:l,baseURL:i,dangerouslyAllowBrowser:!0,defaultHeaders:a&&a.length>0?{"x-litellm-tags":a.join(",")}:void 0});try{let l=await n.images.generate({model:t,prompt:e},{signal:r});if(console.log(l.data),l.data&&l.data[0]){if(l.data[0].url)s(l.data[0].url,t);else if(l.data[0].b64_json){let e=l.data[0].b64_json;s("data:image/png;base64,".concat(e),t)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==r?void 0:r.aborted)?console.log("Image generation request was cancelled"):P.ZP.error("Error occurred while generating image. Please try again. Error: ".concat(e),20),e}}async function aq(e,s,t,l,a,r,i){console.log=function(){},console.log("isLocal:",!1);let n=(0,g.getProxyBaseUrl)(),o=new l$.ZP.OpenAI({apiKey:a,baseURL:n,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{let a=await o.images.edit({model:l,image:e,prompt:s},{signal:i});if(console.log(a.data),a.data&&a.data[0]){if(a.data[0].url)t(a.data[0].url,l);else if(a.data[0].b64_json){let e=a.data[0].b64_json;t("data:image/png;base64,".concat(e),l)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==i?void 0:i.aborted)?console.log("Image edits request was cancelled"):P.ZP.error("Error occurred while editing image. Please try again. Error: ".concat(e),20),e}}async function aU(e,s,t,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,n=arguments.length>7?arguments[7]:void 0,o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!l)throw Error("API key is required");console.log=function(){};let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new l$.ZP.OpenAI({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a=Date.now(),h=!1,g=e.map(e=>({role:e.role,content:e.content,type:"message"})),_=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0,y=await p.responses.create({model:t,input:g,stream:!0,litellm_trace_id:c,...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},..._?{tools:_,tool_choice:"required"}:{}},{signal:r}),b="";for await(let e of y)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var j,f,v;if("response.output_item.done"===e.type&&(null===(j=e.item)||void 0===j?void 0:j.type)==="mcp_call"&&(null===(f=e.item)||void 0===f?void 0:f.name)&&(b=e.item.name,console.log("MCP tool used:",b)),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let l=e.delta;if(console.log("Text delta",l),l.trim().length>0&&(s("assistant",l,t),!h)){h=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),n&&n(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let s=e.delta;"string"==typeof s&&i&&i(s)}if("response.completed"===e.type&&"response"in e){let s=e.response.usage;if(console.log("Usage data:",s),s&&o){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(v=s.completion_tokens_details)||void 0===v?void 0:v.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),o(e,b)}}}return y}catch(e){throw(null==r?void 0:r.aborted)?console.log("Responses API request was cancelled"):P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20),e}}var az=t(85498);async function aV(e,s,t,l){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,n=arguments.length>7?arguments[7]:void 0,o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0;if(!l)throw Error("API key is required");console.log=function(){};let x=(0,g.getProxyBaseUrl)(),h={};a&&a.length>0&&(h["x-litellm-tags"]=a.join(","));let p=new az.ZP({apiKey:l,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:h});try{let a=Date.now(),h=!1,g=u?[{type:"mcp",server_label:"litellm",server_url:"".concat(x,"/mcp"),require_approval:"never",headers:{"x-litellm-api-key":"Bearer ".concat(l)}}]:void 0,j={model:t,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(j.vector_store_ids=d),m&&(j.guardrails=m),g&&(j.tools=g,j.tool_choice="auto"),p.messages.stream(j,{signal:r}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let l=e.delta;if(!h){h=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),n&&n(e)}"text_delta"===l.type?s("assistant",l.text,t):"reasoning_delta"===l.type&&i&&i(l.text)}if("message_delta"===e.type&&e.usage&&o){let s=e.usage;console.log("Usage data found:",s);let t={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.input_tokens+s.output_tokens};o(t)}}}catch(e){throw(null==r?void 0:r.aborted)?console.log("Anthropic messages request was cancelled"):P.ZP.error("Error occurred while generating model response. Please try again. Error: ".concat(e),20),e}}async function aK(e){try{return(await (0,g.mcpToolsCall)(e)).tools||[]}catch(e){return console.error("Error fetching MCP tools:",e),P.ZP.error("Failed to fetch MCP tools"),[]}}var aB=t(49817),aG=t(94263),aH=e=>{let{endpointType:s,onEndpointChange:t,className:l}=e,a=[{value:aB.KP.CHAT,label:"/v1/chat/completions"},{value:aB.KP.RESPONSES,label:"/v1/responses"},{value:aB.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:aB.KP.IMAGE,label:"/v1/images/generations"},{value:aB.KP.IMAGE_EDITS,label:"/v1/images/edits"}];return(0,c.jsxs)("div",{className:l,children:[(0,c.jsx)(w.Z,{children:"Endpoint Type:"}),(0,c.jsx)(C.default,{showSearch:!0,value:s,style:{width:"100%"},onChange:t,options:a,className:"rounded-md"})]})},aJ=e=>{let{onChange:s,value:t,className:l,accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a)try{let e=await (0,g.tagListCall)(a);console.log("List tags response:",e),i(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}})()},[]),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select tags",onChange:s,value:t,loading:n,className:l,options:r.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})},aY=e=>{let{onChange:s,value:t,className:l,accessToken:a}=e,[r,i]=(0,d.useState)([]),[n,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{(async()=>{if(a){o(!0);try{let e=await (0,g.getGuardrailsList)(a);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),i(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{o(!1)}}})()},[a]),(0,c.jsx)("div",{children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:t,loading:n,className:l,options:r.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})},aW=t(88658),a$=t(83322),aQ=e=>{let{reasoningContent:s}=e,[t,l]=(0,d.useState)(!0);return s?(0,c.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,c.jsxs)(T.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>l(!t),icon:(0,c.jsx)(a$.Z,{}),children:[t?"Hide reasoning":"Show reasoning",t?(0,c.jsx)(tg.Z,{className:"ml-1"}):(0,c.jsx)(tQ.Z,{className:"ml-1"})]}),t&&(0,c.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,c.jsx)(aM.U,{components:{code(e){let{node:s,inline:t,className:l,children:a,...r}=e,i=/language-(\w+)/.exec(l||"");return!t&&i?(0,c.jsx)(l5.Z,{style:aG.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",...r,children:String(a).replace(/\n$/,"")}):(0,c.jsx)("code",{className:"".concat(l," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...r,children:a})}},children:s})})]}):null},aX=t(5540),a0=t(71282),a1=t(11741),a2=t(16601),a4=t(58630),a5=e=>{let{timeToFirstToken:s,usage:t,toolName:l}=e;return s||t?(0,c.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==s&&(0,c.jsx)(z.Z,{title:"Time to first token",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(aX.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:[(s/1e3).toFixed(2),"s"]})]})}),(null==t?void 0:t.promptTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Prompt tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a0.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["In: ",t.promptTokens]})]})}),(null==t?void 0:t.completionTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Completion tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a1.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Out: ",t.completionTokens]})]})}),(null==t?void 0:t.reasoningTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Reasoning tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a$.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Reasoning: ",t.reasoningTokens]})]})}),(null==t?void 0:t.totalTokens)!==void 0&&(0,c.jsx)(z.Z,{title:"Total tokens",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a2.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Total: ",t.totalTokens]})]})}),l&&(0,c.jsx)(z.Z,{title:"Tool used",children:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-1"}),(0,c.jsxs)("span",{children:["Tool: ",l]})]})})]}):null},a6=t(61935),a3=t(69993),a8=t(71891),a7=t(44625),a9=t(57400),re=t(26430),rs=t(11894),rt=t(15883),rl=t(99890),ra=t(23907);let{TextArea:rr}=L.default,{Dragger:ri}=eg.default;var rn=e=>{let{accessToken:s,token:t,userRole:l,userID:a,disabledPersonalKeyCreation:r}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedMCPTools");try{let s=e?JSON.parse(e):[];return Array.isArray(s)?s[0]||"":s}catch(e){return console.error("Error parsing selectedMCPTools from sessionStorage",e),""}}),[h,p]=(0,d.useState)(!1),[g,j]=(0,d.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return r?"custom":"session"}),[f,v]=(0,d.useState)(()=>sessionStorage.getItem("apiKey")||""),[b,N]=(0,d.useState)(""),[Z,S]=(0,d.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[I,A]=(0,d.useState)(()=>sessionStorage.getItem("selectedModel")||void 0),[L,O]=(0,d.useState)(!1),[M,D]=(0,d.useState)([]),F=(0,d.useRef)(null),[R,q]=(0,d.useState)(()=>sessionStorage.getItem("endpointType")||aB.KP.CHAT),[V,K]=(0,d.useState)(!1),B=(0,d.useRef)(null),[G,J]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[Y,W]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[$,Q]=(0,d.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[ee,es]=(0,d.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[et,el]=(0,d.useState)(null),[ea,er]=(0,d.useState)(null),[ei,en]=(0,d.useState)(!1),[eo,ec]=(0,d.useState)(""),[ed,em]=(0,d.useState)("openai"),eu=(0,d.useRef)(null),ex=async()=>{let e="session"===g?s:f;if(e){p(!0);try{let s=await aK(e);m(s)}catch(e){console.error("Error fetching MCP tools:",e)}finally{p(!1)}}};(0,d.useEffect)(()=>{i&&ex()},[i,s,f,g]),(0,d.useEffect)(()=>{ei&&ec((0,aW.L)({apiKeySource:g,accessToken:s,apiKey:f,inputMessage:b,chatHistory:Z,selectedTags:G,selectedVectorStores:Y,selectedGuardrails:$,endpointType:R,selectedModel:I,selectedSdk:ed}))},[ei,ed,g,s,f,b,Z,G,Y,$,R,I]),(0,d.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(Z))},500);return()=>{clearTimeout(e)}},[Z]),(0,d.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(g)),sessionStorage.setItem("apiKey",f),sessionStorage.setItem("endpointType",R),sessionStorage.setItem("selectedTags",JSON.stringify(G)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(Y)),sessionStorage.setItem("selectedGuardrails",JSON.stringify($)),sessionStorage.setItem("selectedMCPTools",JSON.stringify(u)),I?sessionStorage.setItem("selectedModel",I):sessionStorage.removeItem("selectedModel"),ee?sessionStorage.setItem("messageTraceId",ee):sessionStorage.removeItem("messageTraceId")},[g,f,I,R,G,Y,$,ee,u]),(0,d.useEffect)(()=>{let e="session"===g?s:f;if(!e||!t||!l||!a){console.log("userApiKey or token or userRole or userID is missing = ",e,t,l,a);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let s=await tx(e);console.log("Fetched models:",s),s.length>0&&(D(s),I||A(s[0].model_group))}catch(e){console.error("Error fetching model info:",e)}})(),ex()},[s,a,l,g,f,t]),(0,d.useEffect)(()=>{eu.current&&setTimeout(()=>{var e;null===(e=eu.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[Z]);let ep=(e,s,t)=>{console.log("updateTextUI called with:",e,s,t),S(l=>{let a=l[l.length-1];if(!a||a.role!==e||a.isImage)return[...l,{role:e,content:s,model:t}];{var r;let e={...a,content:a.content+s,model:null!==(r=a.model)&&void 0!==r?r:t};return[...l.slice(0,-1),e]}})},eg=e=>{S(s=>{let t=s[s.length-1];return t&&"assistant"===t.role&&!t.isImage?[...s.slice(0,s.length-1),{...t,reasoningContent:(t.reasoningContent||"")+e}]:s.length>0&&"user"===s[s.length-1].role?[...s,{role:"assistant",content:"",reasoningContent:e}]:s})},ej=e=>{console.log("updateTimingData called with:",e),S(s=>{let t=s[s.length-1];if(console.log("Current last message:",t),t&&"assistant"===t.role){console.log("Updating assistant message with timeToFirstToken:",e);let l=[...s.slice(0,s.length-1),{...t,timeToFirstToken:e}];return console.log("Updated chat history:",l),l}return t&&"user"===t.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...s,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),s)})},ef=(e,s)=>{console.log("Received usage data:",e),S(t=>{let l=t[t.length-1];if(l&&"assistant"===l.role){console.log("Updating message with usage data:",e);let a={...l,usage:e,toolName:s};return console.log("Updated message:",a),[...t.slice(0,t.length-1),a]}return t})},ev=(e,s)=>{S(t=>[...t,{role:"assistant",content:e,model:s,isImage:!0}])},e_=()=>{ea&&URL.revokeObjectURL(ea),el(null),er(null)},eb=async()=>{if(""===b.trim())return;if(R===aB.KP.IMAGE_EDITS&&!et){P.ZP.error("Please upload an image for editing");return}if(!t||!l||!a)return;let e="session"===g?s:f;if(!e){P.ZP.error("Please provide an API key or select Current UI Session");return}B.current=new AbortController;let r=B.current.signal,i={role:"user",content:b},n=ee||(0,aD.Z)();ee||es(n),S([...Z,i]),K(!0);try{if(I){if(R===aB.KP.CHAT){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aF(s,(e,s)=>ep("assistant",e,s),I,e,G,r,eg,ej,ef,n,Y.length>0?Y:void 0,$.length>0?$:void 0,u)}else if(R===aB.KP.IMAGE)await aR(b,(e,s)=>ev(e,s),I,e,G,r);else if(R===aB.KP.IMAGE_EDITS)et&&await aq(et,b,(e,s)=>ev(e,s),I,e,G,r);else if(R===aB.KP.RESPONSES){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aU(s,(e,s,t)=>ep(e,s,t),I,e,G,r,eg,ej,ef,n,Y.length>0?Y:void 0,$.length>0?$:void 0,u)}else if(R===aB.KP.ANTHROPIC_MESSAGES){let s=[...Z.filter(e=>!e.isImage).map(e=>{let{role:s,content:t}=e;return{role:s,content:t}}),i];await aV(s,(e,s,t)=>ep(e,s,t),I,e,G,r,eg,ej,ef,n,Y.length>0?Y:void 0,$.length>0?$:void 0,u)}}}catch(e){r.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),ep("assistant","Error fetching response:"+e))}finally{K(!1),B.current=null,R===aB.KP.IMAGE_EDITS&&e_()}N("")};if(l&&"Admin Viewer"===l){let{Title:e,Paragraph:s}=eh.default;return(0,c.jsxs)("div",{children:[(0,c.jsx)(e,{level:1,children:"Access Denied"}),(0,c.jsx)(s,{children:"Ask your proxy admin for access to test models"})]})}let eN=(0,c.jsx)(a6.Z,{style:{fontSize:24},spin:!0});return(0,c.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,c.jsx)(X.Z,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,c.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,c.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,c.jsx)(k.Z,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(lI.Z,{className:"mr-2"})," API Key Source"]}),(0,c.jsx)(C.default,{disabled:r,value:g,style:{width:"100%"},onChange:e=>{j(e),x("")},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===g&&(0,c.jsx)(y.Z,{className:"mt-2",placeholder:"Enter custom API key",type:"password",onValueChange:v,value:f,icon:lI.Z})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a3.Z,{className:"mr-2"})," Select Model"]}),(0,c.jsx)(C.default,{value:I,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),A(e),O("custom"===e)},options:[...Array.from(new Set(M.map(e=>e.model_group))).map((e,s)=>({value:e,label:e,key:s})),{value:"custom",label:"Enter custom model",key:"custom"}],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),L&&(0,c.jsx)(y.Z,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{A(e)},500)}})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(tY.Z,{className:"mr-2"})," Endpoint Type"]}),(0,c.jsx)(aH,{endpointType:R,onEndpointChange:e=>{q(e),e!==aB.KP.RESPONSES&&x("")},className:"mb-4"})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a8.Z,{className:"mr-2"})," Tags"]}),(0,c.jsx)(aJ,{value:G,onChange:J,className:"mb-4",accessToken:s||""})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-2"})," MCP Tool",(0,c.jsx)(z.Z,{className:"ml-1",title:"Select an MCP tool to use in your conversation, only available for virtual keys and /v1/responses endpoint",children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(C.default,{style:{width:"100%"},placeholder:"Select MCP tool",value:u,onChange:e=>x(e),loading:h,className:"mb-4",allowClear:!0,optionLabelProp:"label",disabled:!("custom"===g&&R===aB.KP.RESPONSES),children:Array.isArray(o)&&o.map(e=>(0,c.jsx)(C.default.Option,{value:e.name,label:(0,c.jsx)("div",{className:"font-medium",children:e.name}),children:(0,c.jsxs)("div",{className:"flex flex-col py-1",children:[(0,c.jsx)("span",{className:"font-medium",children:e.name}),(0,c.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a7.Z,{className:"mr-2"})," Vector Store",(0,c.jsx)(z.Z,{className:"ml-1",title:(0,c.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store ",(0,c.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(H,{value:Y,onChange:W,className:"mb-4",accessToken:s||""})]}),(0,c.jsxs)("div",{children:[(0,c.jsxs)(w.Z,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,c.jsx)(a9.Z,{className:"mr-2"})," Guardrails",(0,c.jsx)(z.Z,{className:"ml-1",title:(0,c.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails ",(0,c.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,c.jsx)(U.Z,{})})]}),(0,c.jsx)(aY,{value:$,onChange:Q,className:"mb-4",accessToken:s||""})]}),(0,c.jsx)("div",{className:"space-y-2 mt-4",children:(0,c.jsx)(_.Z,{onClick:()=>{S([]),es(null),e_(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),P.ZP.success("Chat history cleared.")},className:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:re.Z,children:"Clear Chat"})})]})]}),(0,c.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,c.jsx)(k.Z,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,c.jsx)("div",{className:"flex gap-2",children:(0,c.jsx)(_.Z,{onClick:()=>en(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:rs.Z,children:"Get Code"})})]}),(0,c.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===Z.length&&(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a3.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(w.Z,{children:"Start a conversation or generate an image"})]}),Z.map((e,s)=>(0,c.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,c.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,c.jsx)(rt.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,c.jsx)(a3.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,c.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,c.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,c.jsx)(aQ,{reasoningContent:e.reasoningContent}),(0,c.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,c.jsx)("img",{src:e.content,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):(0,c.jsx)(aM.U,{components:{code(e){let{node:s,inline:t,className:l,children:a,...r}=e,i=/language-(\w+)/.exec(l||"");return!t&&i?(0,c.jsx)(l5.Z,{style:aG.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...r,children:String(a).replace(/\n$/,"")}):(0,c.jsx)("code",{className:"".concat(l," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...r,children:a})},pre:e=>{let{node:s,...t}=e;return(0,c.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...t})}},children:e.content}),"assistant"===e.role&&(e.timeToFirstToken||e.usage)&&(0,c.jsx)(a5,{timeToFirstToken:e.timeToFirstToken,usage:e.usage,toolName:e.toolName})]})]})},s)),V&&(0,c.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,c.jsx)(lu.Z,{indicator:eN})}),(0,c.jsx)("div",{ref:eu,style:{height:"1px"}})]}),(0,c.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[R===aB.KP.IMAGE_EDITS&&(0,c.jsx)("div",{className:"mb-4",children:et?(0,c.jsxs)("div",{className:"relative inline-block",children:[(0,c.jsx)("img",{src:ea||"",alt:"Upload preview",className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,c.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:e_,children:(0,c.jsx)(ey.Z,{})})]}):(0,c.jsxs)(ri,{beforeUpload:e=>(el(e),er(URL.createObjectURL(e)),!1),accept:"image/*",showUploadList:!1,className:"border-dashed border-2 border-gray-300 rounded-lg p-4",children:[(0,c.jsx)("p",{className:"ant-upload-drag-icon",children:(0,c.jsx)(rl.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,c.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag image to upload"}),(0,c.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats"})]})}),(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(rr,{value:b,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),eb())},placeholder:R===aB.KP.CHAT||R===aB.KP.RESPONSES||R===aB.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":R===aB.KP.IMAGE_EDITS?"Describe how you want to edit the image...":"Describe the image you want to generate...",disabled:V,className:"flex-1",autoSize:{minRows:1,maxRows:6},style:{resize:"none",paddingRight:"10px",paddingLeft:"10px"}}),V?(0,c.jsx)(_.Z,{onClick:()=>{B.current&&(B.current.abort(),B.current=null,K(!1),P.ZP.info("Request cancelled"))},className:"ml-2 bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:ey.Z,children:"Cancel"}):(0,c.jsx)(_.Z,{onClick:eb,className:"ml-2 text-white",icon:R===aB.KP.CHAT||R===aB.KP.RESPONSES||R===aB.KP.ANTHROPIC_MESSAGES?ra.Z:a3.Z,children:R===aB.KP.CHAT||R===aB.KP.RESPONSES||R===aB.KP.ANTHROPIC_MESSAGES?"Send":R===aB.KP.IMAGE_EDITS?"Edit":"Generate"})]})]})]})]})}),(0,c.jsxs)(E.Z,{title:"Generated Code",visible:ei,onCancel:()=>en(!1),footer:null,width:800,children:[(0,c.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,c.jsx)(C.default,{value:ed,onChange:e=>em(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,c.jsx)(T.ZP,{onClick:()=>{navigator.clipboard.writeText(eo),P.ZP.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,c.jsx)(l5.Z,{language:"python",style:aG.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:eo})]}),"custom"===g&&(0,c.jsx)(E.Z,{title:"Select MCP Tool",visible:i,onCancel:()=>n(!1),onOk:()=>{n(!1),P.ZP.success("MCP tool selection updated")},width:800,children:h?(0,c.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,c.jsx)(lu.Z,{indicator:(0,c.jsx)(a6.Z,{style:{fontSize:24},spin:!0})})}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(w.Z,{className:"text-gray-600 block mb-4",children:"Select the MCP tool you want to use in your conversation."}),(0,c.jsx)(C.default,{style:{width:"100%"},placeholder:"Select MCP tool",value:u,onChange:e=>x(e),optionLabelProp:"label",allowClear:!0,children:o.map(e=>(0,c.jsx)(C.default.Option,{value:e.name,label:(0,c.jsx)("div",{className:"font-medium",children:e.name}),children:(0,c.jsxs)("div",{className:"flex flex-col py-1",children:[(0,c.jsx)("span",{className:"font-medium",children:e.name}),(0,c.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.name))})]})})]})},ro=t(19226),rc=t(45937),rd=t(28595),rm=t(68208),ru=t(9775),rx=t(41361),rh=t(37527),rp=t(88009),rg=t(48231),rj=t(41169),rf=t(55322),rv=t(76865),r_=t(70525),ry=t(95805),rb=t(51817),rN=t(21047);t(22135),t(40875);var rZ=t(49663);let rw=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter(Boolean).join(" ")};function rk(e){let{accessToken:s,width:t=220}=e,[l,a]=(0,d.useState)(!1),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{(async()=>{if(s){u(!0),h(null);try{let e=await (0,g.getRemainingUsers)(s);o(e)}catch(e){console.error("Failed to fetch usage data:",e),h("Failed to load usage data")}finally{u(!1)}}})()},[s]);let{isOverLimit:p,isNearLimit:j,usagePercentage:f,userMetrics:v,teamMetrics:_}=(e=>{if(!e)return{isOverLimit:!1,isNearLimit:!1,usagePercentage:0,userMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0},teamMetrics:{isOverLimit:!1,isNearLimit:!1,usagePercentage:0}};let s=!!e.total_users_remaining&&e.total_users_remaining<=0,t=!!e.total_users_remaining&&e.total_users_remaining<=5&&e.total_users_remaining>0,l=e.total_users?e.total_users_used/e.total_users*100:0,a=!!e.total_teams_remaining&&e.total_teams_remaining<=0,r=!!e.total_teams_remaining&&e.total_teams_remaining<=5&&e.total_teams_remaining>0,i=e.total_teams?e.total_teams_used/e.total_teams*100:0,n=s||a;return{isOverLimit:n,isNearLimit:(t||r)&&!n,usagePercentage:Math.max(l,i),userMetrics:{isOverLimit:s,isNearLimit:t,usagePercentage:l},teamMetrics:{isOverLimit:a,isNearLimit:r,usagePercentage:i}}})(n),y=()=>p?"red":j?"yellow":"green",b=()=>p?"Over Limit":j?"Near Limit":"Active",N=()=>p?(0,c.jsx)(rv.Z,{className:"h-3 w-3"}):j?(0,c.jsx)(r_.Z,{className:"h-3 w-3"}):null;return s&&((null==n?void 0:n.total_users)!==null||(null==n?void 0:n.total_teams)!==null)?(0,c.jsx)("div",{className:"fixed bottom-4 left-4 z-50",style:{width:"".concat(Math.min(t,220),"px")},children:(0,c.jsx)(()=>{if(r){let e=p||j;return(0,c.jsx)("button",{onClick:()=>i(!1),className:rw("bg-white border border-gray-200 rounded-lg shadow-sm p-3 hover:shadow-md transition-all w-full",e&&p&&"border-red-200 bg-red-50",e&&j&&"border-yellow-200 bg-yellow-50"),title:"Show usage details",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(ry.Z,{className:"h-4 w-4 flex-shrink-0"}),e&&(0,c.jsx)("span",{className:"flex-shrink-0",children:N()}),(0,c.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium truncate",children:[n&&null!==n.total_users&&(0,c.jsxs)("span",{className:"flex-shrink-0",children:["U: ",n.total_users_used,"/",n.total_users]}),n&&null!==n.total_teams&&(0,c.jsxs)("span",{className:"flex-shrink-0",children:["T: ",n.total_teams_used,"/",n.total_teams]}),!n||null===n.total_users&&null===n.total_teams&&(0,c.jsx)("span",{className:"truncate",children:"Usage"})]})]})})}return m?(0,c.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 w-full",children:(0,c.jsxs)("div",{className:"flex items-center justify-center gap-2 py-2",children:[(0,c.jsx)(rb.Z,{className:"h-4 w-4 animate-spin"}),(0,c.jsx)("span",{className:"text-sm text-gray-500 truncate",children:"Loading..."})]})}):x||!n?(0,c.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg shadow-sm p-4 group w-full",children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex-1 min-w-0",children:(0,c.jsx)("span",{className:"text-sm text-gray-500 truncate block",children:x||"No data"})}),(0,c.jsx)("button",{onClick:()=>i(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,c.jsx)(rN.Z,{className:"h-3 w-3 text-gray-400"})})]})}):(0,c.jsxs)("div",{className:rw("bg-white border rounded-lg shadow-sm p-3 transition-all duration-200 group w-full",p&&"border-red-200 bg-red-50",j&&"border-yellow-200 bg-yellow-50"),children:[(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-3",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,c.jsx)(ry.Z,{className:"h-4 w-4 flex-shrink-0"}),(0,c.jsx)("span",{className:"font-medium text-sm truncate",children:"Usage"}),(p||j)&&(0,c.jsx)(eY.Z,{color:y(),className:"text-xs px-1.5 py-0.5 flex-shrink-0",children:b()})]}),(0,c.jsx)("button",{onClick:()=>i(!0),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-gray-100 rounded transition-all flex-shrink-0",title:"Minimize",children:(0,c.jsx)(rN.Z,{className:"h-3 w-3 text-gray-400"})})]}),(0,c.jsxs)("div",{className:"space-y-3 text-sm",children:[null!==n.total_users&&(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-600 mb-1",children:[(0,c.jsx)(ry.Z,{className:"h-3 w-3"}),(0,c.jsx)("span",{className:"font-medium",children:"Users"})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[n.total_users_used,"/",n.total_users]})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,c.jsx)("span",{className:rw("font-medium text-right",v.isOverLimit&&"text-red-600",v.isNearLimit&&"text-yellow-600"),children:n.total_users_remaining})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[Math.round(v.usagePercentage),"%"]})]}),(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,c.jsx)("div",{className:rw("h-2 rounded-full transition-all duration-300",v.isOverLimit&&"bg-red-500",v.isNearLimit&&"bg-yellow-500",!v.isOverLimit&&!v.isNearLimit&&"bg-green-500"),style:{width:"".concat(Math.min(v.usagePercentage,100),"%")}})})]}),null!==n.total_teams&&(0,c.jsxs)("div",{className:"space-y-1",children:[(0,c.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-600 mb-1",children:[(0,c.jsx)(rZ.Z,{className:"h-3 w-3"}),(0,c.jsx)("span",{className:"font-medium",children:"Teams"})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Used:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[n.total_teams_used,"/",n.total_teams]})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Remaining:"}),(0,c.jsx)("span",{className:rw("font-medium text-right",_.isOverLimit&&"text-red-600",_.isNearLimit&&"text-yellow-600"),children:n.total_teams_remaining})]}),(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)("span",{className:"text-gray-600 text-xs",children:"Usage:"}),(0,c.jsxs)("span",{className:"font-medium text-right",children:[Math.round(_.usagePercentage),"%"]})]}),(0,c.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,c.jsx)("div",{className:rw("h-2 rounded-full transition-all duration-300",_.isOverLimit&&"bg-red-500",_.isNearLimit&&"bg-yellow-500",!_.isOverLimit&&!_.isNearLimit&&"bg-green-500"),style:{width:"".concat(Math.min(_.usagePercentage,100),"%")}})})]})]})]})},{})}):null}let{Sider:rS}=ro.default;var rC=e=>{let{accessToken:s,setPage:t,userRole:l,defaultSelectedKey:a}=e,r=[{key:"1",page:"api-keys",label:"Virtual Keys",icon:(0,c.jsx)(lI.Z,{})},{key:"3",page:"llm-playground",label:"Test Key",icon:(0,c.jsx)(rd.Z,{}),roles:eL.LQ},{key:"2",page:"models",label:"Models + Endpoints",icon:(0,c.jsx)(rm.Z,{}),roles:eL.LQ},{key:"12",page:"new_usage",label:"Usage",icon:(0,c.jsx)(ru.Z,{}),roles:[...eL.ZL,...eL.lo]},{key:"6",page:"teams",label:"Teams",icon:(0,c.jsx)(rx.Z,{})},{key:"17",page:"organizations",label:"Organizations",icon:(0,c.jsx)(rh.Z,{}),roles:eL.ZL},{key:"5",page:"users",label:"Internal Users",icon:(0,c.jsx)(rt.Z,{}),roles:eL.ZL},{key:"14",page:"api_ref",label:"API Reference",icon:(0,c.jsx)(tY.Z,{})},{key:"16",page:"model-hub-table",label:"Model Hub",icon:(0,c.jsx)(rp.Z,{})},{key:"15",page:"logs",label:"Logs",icon:(0,c.jsx)(rg.Z,{})},{key:"11",page:"guardrails",label:"Guardrails",icon:(0,c.jsx)(a9.Z,{}),roles:eL.ZL},{key:"26",page:"tools",label:"Tools",icon:(0,c.jsx)(a4.Z,{}),children:[{key:"18",page:"mcp-servers",label:"MCP Servers",icon:(0,c.jsx)(a4.Z,{})},{key:"21",page:"vector-stores",label:"Vector Stores",icon:(0,c.jsx)(a7.Z,{}),roles:eL.ZL}]},{key:"experimental",page:"experimental",label:"Experimental",icon:(0,c.jsx)(rj.Z,{}),children:[{key:"9",page:"caching",label:"Caching",icon:(0,c.jsx)(a7.Z,{}),roles:eL.ZL},{key:"10",page:"budgets",label:"Budgets",icon:(0,c.jsx)(rh.Z,{}),roles:eL.ZL},{key:"20",page:"transform-request",label:"API Playground",icon:(0,c.jsx)(tY.Z,{}),roles:[...eL.ZL,...eL.lo]},{key:"19",page:"tag-management",label:"Tag Management",icon:(0,c.jsx)(a8.Z,{}),roles:eL.ZL},{key:"4",page:"usage",label:"Old Usage",icon:(0,c.jsx)(ru.Z,{})}]},{key:"settings",page:"settings",label:"Settings",icon:(0,c.jsx)(rf.Z,{}),roles:eL.ZL,children:[{key:"11",page:"general-settings",label:"Router Settings",icon:(0,c.jsx)(rf.Z,{}),roles:eL.ZL},{key:"8",page:"settings",label:"Logging & Alerts",icon:(0,c.jsx)(rf.Z,{}),roles:eL.ZL},{key:"13",page:"admin-panel",label:"Admin Settings",icon:(0,c.jsx)(rf.Z,{}),roles:eL.ZL}]}],i=(e=>{let s=r.find(s=>s.page===e);if(s)return s.key;for(let s of r)if(s.children){let t=s.children.find(s=>s.page===e);if(t)return t.key}return"1"})(a),n=r.filter(e=>{let s=!e.roles||e.roles.includes(l);return console.log("Menu item ".concat(e.label,": roles=").concat(e.roles,", userRole=").concat(l,", hasAccess=").concat(s)),!!s&&(e.children&&(e.children=e.children.filter(e=>!e.roles||e.roles.includes(l))),!0)});return(0,c.jsx)(ro.default,{style:{minHeight:"100vh"},children:(0,c.jsxs)(rS,{theme:"light",width:220,children:[(0,c.jsx)(rc.Z,{mode:"inline",selectedKeys:[i],defaultOpenKeys:["llm-tools"],style:{borderRight:0,backgroundColor:"transparent",fontSize:"14px"},items:n.map(e=>{var s;return{key:e.key,icon:e.icon,label:e.label,children:null===(s=e.children)||void 0===s?void 0:s.map(e=>({key:e.key,icon:e.icon,label:e.label,onClick:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}})),onClick:e.children?void 0:()=>{let s=new URLSearchParams(window.location.search);s.set("page",e.page),window.history.pushState(null,"","?".concat(s.toString())),t(e.page)}}})}),(0,eL.tY)(l)&&(0,c.jsx)(rk,{accessToken:s,width:220})]})})},rI=t(96889);console.log("process.env.NODE_ENV","production");let rP=e=>null!==e&&("Admin"===e||"Admin Viewer"===e);var rE=e=>{let{accessToken:s,token:t,userRole:l,userID:a,keys:r,premiumUser:i}=e,n=new Date,[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,y]=(0,d.useState)([]),[b,N]=(0,d.useState)([]),[Z,S]=(0,d.useState)([]),[C,I]=(0,d.useState)([]),[P,E]=(0,d.useState)([]),[A,T]=(0,d.useState)([]),[L,O]=(0,d.useState)([]),[M,D]=(0,d.useState)({}),[F,R]=(0,d.useState)([]),[q,U]=(0,d.useState)(""),[z,V]=(0,d.useState)(["all-tags"]),[K,B]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[G,H]=(0,d.useState)(null),[J,Y]=(0,d.useState)(0),W=new Date(n.getFullYear(),n.getMonth(),1),$=new Date(n.getFullYear(),n.getMonth()+1,0),Q=er(W),ee=er($);function es(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",r),console.log("premium user in usage",i);let et=async()=>{if(s)try{let e=await (0,g.getProxyUISettings)(s);return console.log("usage tab: proxy_settings",e),e}catch(e){console.error("Error fetching proxy settings:",e)}};(0,d.useEffect)(()=>{ea(K.from,K.to)},[K,z]);let el=async(e,t,l)=>{if(!e||!t||!s)return;console.log("uiSelectedKey",l);let a=await (0,g.adminTopEndUsersCall)(s,l,e.toISOString(),t.toISOString());console.log("End user data updated successfully",a),y(a)},ea=async(e,t)=>{if(!e||!t||!s)return;let l=await et();null!=l&&l.DISABLE_EXPENSIVE_DB_QUERIES||(S((await (0,g.tagsSpendLogsCall)(s,e.toISOString(),t.toISOString(),0===z.length?void 0:z)).spend_per_tag),console.log("Tag spend data updated successfully"))};function er(e){let s=e.getFullYear(),t=e.getMonth()+1,l=e.getDate();return"".concat(s,"-").concat(t<10?"0"+t:t,"-").concat(l<10?"0"+l:l)}console.log("Start date is ".concat(Q)),console.log("End date is ".concat(ee));let ei=async(e,s,t)=>{try{let t=await e();s(t)}catch(e){console.error(t,e)}},en=(e,s,t,l)=>{let a=[],r=new Date(s),i=e=>{if(e.includes("-"))return e;{let[s,t]=e.split(" ");return new Date(new Date().getFullYear(),new Date("".concat(s," 01 2024")).getMonth(),parseInt(t)).toISOString().split("T")[0]}},n=new Map(e.map(e=>{let s=i(e.date);return[s,{...e,date:s}]}));for(;r<=t;){let e=r.toISOString().split("T")[0];if(n.has(e))a.push(n.get(e));else{let s={date:e,api_requests:0,total_tokens:0};l.forEach(e=>{s[e]||(s[e]=0)}),a.push(s)}r.setDate(r.getDate()+1)}return a},eo=async()=>{if(s)try{let e=await (0,g.adminSpendLogsCall)(s),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=en(e,l,a,[]),i=Number(r.reduce((e,s)=>e+(s.spend||0),0).toFixed(2));Y(i),m(r)}catch(e){console.error("Error fetching overall spend:",e)}},ec=()=>ei(()=>s&&t?(0,g.adminspendByProvider)(s,t,Q,ee):Promise.reject("No access token or token"),O,"Error fetching provider spend"),ed=async()=>{s&&await ei(async()=>(await (0,g.adminTopKeysCall)(s)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),x,"Error fetching top keys")},em=async()=>{s&&await ei(async()=>(await (0,g.adminTopModelsCall)(s)).map(e=>({key:e.model,spend:eR(e.total_spend,2)})),p,"Error fetching top models")},eu=async()=>{s&&await ei(async()=>{let e=await (0,g.teamSpendLogsCall)(s),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0);return N(en(e.daily_spend,l,a,e.teams)),E(e.teams),e.total_spend_per_team.map(e=>({name:e.team_id||"",value:eR(e.total_spend||0,2)}))},T,"Error fetching team spend")},eh=()=>{s&&ei(async()=>(await (0,g.allTagNamesCall)(s)).tag_names,I,"Error fetching tag names")},ep=()=>{s&&ei(()=>{var e,t;return(0,g.tagsSpendLogsCall)(s,null===(e=K.from)||void 0===e?void 0:e.toISOString(),null===(t=K.to)||void 0===t?void 0:t.toISOString(),void 0)},e=>S(e.spend_per_tag),"Error fetching top tags")},eg=()=>{s&&ei(()=>(0,g.adminTopEndUsersCall)(s,null,void 0,void 0),y,"Error fetching top end users")},ej=async()=>{if(s)try{let e=await (0,g.adminGlobalActivity)(s,Q,ee),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=en(e.daily_data||[],l,a,["api_requests","total_tokens"]);D({...e,daily_data:r})}catch(e){console.error("Error fetching global activity:",e)}},ef=async()=>{if(s)try{let e=await (0,g.adminGlobalActivityPerModel)(s,Q,ee),t=new Date,l=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0),r=e.map(e=>({...e,daily_data:en(e.daily_data||[],l,a,["api_requests","total_tokens"])}));R(r)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,d.useEffect)(()=>{(async()=>{if(s&&t&&l&&a){let e=await et();e&&(H(e),null!=e&&e.DISABLE_EXPENSIVE_DB_QUERIES)||(console.log("fetching data - valiue of proxySettings",G),eo(),ec(),ed(),em(),ej(),ef(),rP(l)&&(eu(),eh(),ep(),eg()))}})()},[s,t,l,a,Q,ee]),null==G?void 0:G.DISABLE_EXPENSIVE_DB_QUERIES)?(0,c.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Database Query Limit Reached"}),(0,c.jsxs)(w.Z,{className:"mt-4",children:["SpendLogs in DB has ",G.NUM_SPEND_LOGS_ROWS," rows.",(0,c.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,c.jsx)(_.Z,{className:"mt-4",children:(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,c.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mt-2",children:[(0,c.jsx)(eW.Z,{children:"All Up"}),rP(l)?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(eW.Z,{children:"Team Based Usage"}),(0,c.jsx)(eW.Z,{children:"Customer Usage"}),(0,c.jsx)(eW.Z,{children:"Tag Based Usage"})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{})})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{variant:"solid",className:"mt-1",children:[(0,c.jsx)(eW.Z,{children:"Cost"}),(0,c.jsx)(eW.Z,{children:"Activity"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(w.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 - ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,c.jsx)(a_,{userID:a,userRole:l,accessToken:s,userSpend:J,selectedTeam:null,userMaxBudget:null})]}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Monthly Spend"}),(0,c.jsx)(sQ.Z,{data:o,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$ ".concat(eR(e,2)),yAxisWidth:100,tickGap:5})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top API Keys"}),(0,c.jsx)(ab,{topKeys:u,accessToken:s,userID:a,userRole:l,teams:null,premiumUser:i})]})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(X.Z,{className:"h-full",children:[(0,c.jsx)(k.Z,{children:"Top Models"}),(0,c.jsx)(sQ.Z,{className:"mt-4 h-40",data:h,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>"$".concat(eR(e,2))})]})}),(0,c.jsx)(f.Z,{numColSpan:1}),(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{className:"mb-2",children:[(0,c.jsx)(k.Z,{children:"Spend by Provider"}),(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(av.Z,{className:"mt-4 h-40",variant:"pie",data:L,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>"$".concat(eR(e,2))})}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsxs)(sv.Z,{children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Provider"}),(0,c.jsx)(sN.Z,{children:"Spend"})]})}),(0,c.jsx)(s_.Z,{children:L.map(e=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.provider}),(0,c.jsx)(sy.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":eR(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"All Up"}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",es(M.sum_api_requests)]}),(0,c.jsx)(s$.Z,{className:"h-40",data:M.daily_data,valueFormatter:es,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",es(M.sum_total_tokens)]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:M.daily_data,valueFormatter:es,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,c.jsx)(c.Fragment,{children:F.map((e,s)=>(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:e.model}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",es(e.sum_api_requests)]}),(0,c.jsx)(s$.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:es,onValueChange:e=>console.log(e)})]}),(0,c.jsxs)(f.Z,{children:[(0,c.jsxs)(sL.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",es(e.sum_total_tokens)]}),(0,c.jsx)(sQ.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:es,onValueChange:e=>console.log(e)})]})]})]},s))})]})})]})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,c.jsxs)(f.Z,{numColSpan:2,children:[(0,c.jsxs)(X.Z,{className:"mb-2",children:[(0,c.jsx)(k.Z,{children:"Total Spend Per Team"}),(0,c.jsx)(rI.Z,{data:A})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Daily Spend Per Team"}),(0,c.jsx)(sQ.Z,{className:"h-72",data:b,showLegend:!0,index:"date",categories:P,yAxisWidth:80,stack:!0})]})]}),(0,c.jsx)(f.Z,{numColSpan:2})]})}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls ",(0,c.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:K,onValueChange:e=>{B(e),el(e.from,e.to,null)}})}),(0,c.jsxs)(f.Z,{children:[(0,c.jsx)(w.Z,{children:"Select Key"}),(0,c.jsxs)(eJ.Z,{defaultValue:"all-keys",children:[(0,c.jsx)(ex.Z,{value:"all-keys",onClick:()=>{el(K.from,K.to,null)},children:"All Keys"},"all-keys"),null==r?void 0:r.map((e,s)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,c.jsx)(ex.Z,{value:String(s),onClick:()=>{el(K.from,K.to,e.token)},children:e.key_alias},s):null)]})]})]}),(0,c.jsx)(X.Z,{className:"mt-4",children:(0,c.jsxs)(sv.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,c.jsx)(sb.Z,{children:(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sN.Z,{children:"Customer"}),(0,c.jsx)(sN.Z,{children:"Spend"}),(0,c.jsx)(sN.Z,{children:"Total Events"})]})}),(0,c.jsx)(s_.Z,{children:null==j?void 0:j.map((e,s)=>(0,c.jsxs)(sZ.Z,{children:[(0,c.jsx)(sy.Z,{children:e.end_user}),(0,c.jsx)(sy.Z,{children:eR(e.total_spend,2)}),(0,c.jsx)(sy.Z,{children:e.total_count})]},s))})]})})]}),(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:2,children:[(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(sW,{className:"mb-4",value:K,onValueChange:e=>{B(e),ea(e.from,e.to)}})}),(0,c.jsx)(f.Z,{children:i?(0,c.jsx)("div",{children:(0,c.jsxs)(lH.Z,{value:z,onValueChange:e=>V(e),children:[(0,c.jsx)(lJ.Z,{value:"all-tags",onClick:()=>V(["all-tags"]),children:"All Tags"},"all-tags"),C&&C.filter(e=>"all-tags"!==e).map((e,s)=>(0,c.jsx)(lJ.Z,{value:String(e),children:e},e))]})}):(0,c.jsx)("div",{children:(0,c.jsxs)(lH.Z,{value:z,onValueChange:e=>V(e),children:[(0,c.jsx)(lJ.Z,{value:"all-tags",onClick:()=>V(["all-tags"]),children:"All Tags"},"all-tags"),C&&C.filter(e=>"all-tags"!==e).map((e,s)=>(0,c.jsxs)(ex.Z,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,c.jsxs)(v.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,c.jsx)(f.Z,{numColSpan:2,children:(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(k.Z,{children:"Spend Per Tag"}),(0,c.jsxs)(w.Z,{children:["Get Started by Tracking cost per tag ",(0,c.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,c.jsx)(sQ.Z,{className:"h-72",data:Z,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,c.jsx)(f.Z,{numColSpan:2})]})]})]})]})})},rA=t(51853);let rT=e=>{let{responseTimeMs:s}=e;return null==s?null:(0,c.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-500 font-mono",children:[(0,c.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{d:"M12 6V12L16 14M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,c.jsxs)("span",{children:[s.toFixed(0),"ms"]})]})},rL=e=>{let s=e;if("string"==typeof s)try{s=JSON.parse(s)}catch(e){}return s},rO=e=>{let{label:s,value:t}=e,[l,a]=d.useState(!1),[r,i]=d.useState(!1),n=(null==t?void 0:t.toString())||"N/A",o=n.length>50?n.substring(0,50)+"...":n;return(0,c.jsx)("tr",{className:"hover:bg-gray-50",children:(0,c.jsx)("td",{className:"px-4 py-2 align-top",colSpan:2,children:(0,c.jsxs)("div",{className:"flex items-center justify-between group",children:[(0,c.jsxs)("div",{className:"flex items-center flex-1",children:[(0,c.jsx)("button",{onClick:()=>a(!l),className:"text-gray-400 hover:text-gray-600 mr-2",children:l?"▼":"▶"}),(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"text-sm text-gray-600",children:s}),(0,c.jsx)("pre",{className:"mt-1 text-sm font-mono text-gray-800 whitespace-pre-wrap",children:l?n:o})]})]}),(0,c.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2e3)},className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-gray-600",children:(0,c.jsx)(rA.Z,{className:"h-4 w-4"})})]})})})},rM=e=>{var s,t,l,a,r,i,n,o,d,m,u,x,h,p;let{response:g}=e,j=null,f={},v={};try{if(null==g?void 0:g.error)try{let e="string"==typeof g.error.message?JSON.parse(g.error.message):g.error.message;j={message:(null==e?void 0:e.message)||"Unknown error",traceback:(null==e?void 0:e.traceback)||"No traceback available",litellm_params:(null==e?void 0:e.litellm_cache_params)||{},health_check_cache_params:(null==e?void 0:e.health_check_cache_params)||{}},f=rL(j.litellm_params)||{},v=rL(j.health_check_cache_params)||{}}catch(e){console.warn("Error parsing error details:",e),j={message:String(g.error.message||"Unknown error"),traceback:"Error parsing details",litellm_params:{},health_check_cache_params:{}}}else f=rL(null==g?void 0:g.litellm_cache_params)||{},v=rL(null==g?void 0:g.health_check_cache_params)||{}}catch(e){console.warn("Error in response parsing:",e),f={},v={}}let _={redis_host:(null==v?void 0:null===(l=v.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==v?void 0:null===(i=v.redis_async_client)||void 0===i?void 0:null===(r=i.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host)||(null==v?void 0:null===(n=v.connection_kwargs)||void 0===n?void 0:n.host)||(null==v?void 0:v.host)||"N/A",redis_port:(null==v?void 0:null===(m=v.redis_client)||void 0===m?void 0:null===(d=m.connection_pool)||void 0===d?void 0:null===(o=d.connection_kwargs)||void 0===o?void 0:o.port)||(null==v?void 0:null===(h=v.redis_async_client)||void 0===h?void 0:null===(x=h.connection_pool)||void 0===x?void 0:null===(u=x.connection_kwargs)||void 0===u?void 0:u.port)||(null==v?void 0:null===(p=v.connection_kwargs)||void 0===p?void 0:p.port)||(null==v?void 0:v.port)||"N/A",redis_version:(null==v?void 0:v.redis_version)||"N/A",startup_nodes:(()=>{try{var e,s,t,l,a,r,i,n,o,c,d,m,u;if(null==v?void 0:null===(e=v.redis_kwargs)||void 0===e?void 0:e.startup_nodes)return JSON.stringify(v.redis_kwargs.startup_nodes);let x=(null==v?void 0:null===(l=v.redis_client)||void 0===l?void 0:null===(t=l.connection_pool)||void 0===t?void 0:null===(s=t.connection_kwargs)||void 0===s?void 0:s.host)||(null==v?void 0:null===(i=v.redis_async_client)||void 0===i?void 0:null===(r=i.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host),h=(null==v?void 0:null===(c=v.redis_client)||void 0===c?void 0:null===(o=c.connection_pool)||void 0===o?void 0:null===(n=o.connection_kwargs)||void 0===n?void 0:n.port)||(null==v?void 0:null===(u=v.redis_async_client)||void 0===u?void 0:null===(m=u.connection_pool)||void 0===m?void 0:null===(d=m.connection_kwargs)||void 0===d?void 0:d.port);return x&&h?JSON.stringify([{host:x,port:h}]):"N/A"}catch(e){return"N/A"}})(),namespace:(null==v?void 0:v.namespace)||"N/A"};return(0,c.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"border-b border-gray-200 px-4",children:[(0,c.jsx)(eW.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Summary"}),(0,c.jsx)(eW.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Raw Response"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{className:"p-4",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-6",children:[(null==g?void 0:g.status)==="healthy"?(0,c.jsx)(eS.Z,{className:"h-5 w-5 text-green-500 mr-2"}):(0,c.jsx)(ek.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,c.jsxs)(w.Z,{className:"text-sm font-medium ".concat((null==g?void 0:g.status)==="healthy"?"text-green-500":"text-red-500"),children:["Cache Status: ",(null==g?void 0:g.status)||"unhealthy"]})]}),(0,c.jsx)("table",{className:"w-full border-collapse",children:(0,c.jsxs)("tbody",{children:[j&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold text-red-600",children:"Error Details"})}),(0,c.jsx)(rO,{label:"Error Message",value:j.message}),(0,c.jsx)(rO,{label:"Traceback",value:j.traceback})]}),(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Cache Details"})}),(0,c.jsx)(rO,{label:"Cache Configuration",value:String(null==f?void 0:f.type)}),(0,c.jsx)(rO,{label:"Ping Response",value:String(g.ping_response)}),(0,c.jsx)(rO,{label:"Set Cache Response",value:g.set_cache_response||"N/A"}),(0,c.jsx)(rO,{label:"litellm_settings.cache_params",value:JSON.stringify(f,null,2)}),(null==f?void 0:f.type)==="redis"&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("tr",{children:(0,c.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Redis Details"})}),(0,c.jsx)(rO,{label:"Redis Host",value:_.redis_host||"N/A"}),(0,c.jsx)(rO,{label:"Redis Port",value:_.redis_port||"N/A"}),(0,c.jsx)(rO,{label:"Redis Version",value:_.redis_version||"N/A"}),(0,c.jsx)(rO,{label:"Startup Nodes",value:_.startup_nodes||"N/A"}),(0,c.jsx)(rO,{label:"Namespace",value:_.namespace||"N/A"})]})]})})]})}),(0,c.jsx)(eX.Z,{className:"p-4",children:(0,c.jsx)("div",{className:"bg-gray-50 rounded-md p-4 font-mono text-sm",children:(0,c.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto max-h-[500px]",children:(()=>{try{let e={...g,litellm_cache_params:f,health_check_cache_params:v},s=JSON.parse(JSON.stringify(e,(e,s)=>{if("string"==typeof s)try{return JSON.parse(s)}catch(e){}return s}));return JSON.stringify(s,null,2)}catch(e){return"Error formatting JSON: "+e.message}})()})})})]})]})})},rD=e=>{let{accessToken:s,healthCheckResponse:t,runCachingHealthCheck:l,responseTimeMs:a}=e,[r,i]=d.useState(null),[n,o]=d.useState(!1),m=async()=>{o(!0);let e=performance.now();await l(),i(performance.now()-e),o(!1)};return(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)(_.Z,{onClick:m,disabled:n,className:"bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 text-white text-sm px-4 py-2 rounded-md",children:n?"Running Health Check...":"Run Health Check"}),(0,c.jsx)(rT,{responseTimeMs:r})]}),t&&(0,c.jsx)(rM,{response:t})]})},rF=e=>{if(e)return e.toISOString().split("T")[0]};function rR(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}var rq=e=>{let{accessToken:s,token:t,userRole:l,userID:a,premiumUser:r}=e,[i,n]=(0,d.useState)([]),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)([]),[h,p]=(0,d.useState)([]),[j,_]=(0,d.useState)("0"),[y,b]=(0,d.useState)("0"),[N,Z]=(0,d.useState)("0"),[k,S]=(0,d.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[C,I]=(0,d.useState)(""),[E,A]=(0,d.useState)("");(0,d.useEffect)(()=>{s&&k&&((async()=>{p(await (0,g.adminGlobalCacheActivity)(s,rF(k.from),rF(k.to)))})(),I(new Date().toLocaleString()))},[s]);let T=Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.api_key)&&void 0!==s?s:""}))),L=Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.model)&&void 0!==s?s:""})));Array.from(new Set(h.map(e=>{var s;return null!==(s=null==e?void 0:e.call_type)&&void 0!==s?s:""})));let O=async(e,t)=>{e&&t&&s&&p(await (0,g.adminGlobalCacheActivity)(s,rF(e),rF(t)))};(0,d.useEffect)(()=>{console.log("DATA IN CACHE DASHBOARD",h);let e=h;o.length>0&&(e=e.filter(e=>o.includes(e.api_key))),u.length>0&&(e=e.filter(e=>u.includes(e.model))),console.log("before processed data in cache dashboard",e);let s=0,t=0,l=0,a=e.reduce((e,a)=>{console.log("Processing item:",a),a.call_type||(console.log("Item has no call_type:",a),a.call_type="Unknown"),s+=(a.total_rows||0)-(a.cache_hit_true_rows||0),t+=a.cache_hit_true_rows||0,l+=a.cached_completion_tokens||0;let r=e.find(e=>e.name===a.call_type);return r?(r["LLM API requests"]+=(a.total_rows||0)-(a.cache_hit_true_rows||0),r["Cache hit"]+=a.cache_hit_true_rows||0,r["Cached Completion Tokens"]+=a.cached_completion_tokens||0,r["Generated Completion Tokens"]+=a.generated_completion_tokens||0):e.push({name:a.call_type,"LLM API requests":(a.total_rows||0)-(a.cache_hit_true_rows||0),"Cache hit":a.cache_hit_true_rows||0,"Cached Completion Tokens":a.cached_completion_tokens||0,"Generated Completion Tokens":a.generated_completion_tokens||0}),e},[]);_(rR(t)),b(rR(l));let r=t+s;r>0?Z((t/r*100).toFixed(2)):Z("0"),n(a),console.log("PROCESSED DATA IN CACHE DASHBOARD",a)},[o,u,k,h]);let M=async()=>{try{P.ZP.info("Running cache health check..."),A("");let e=await (0,g.cachingHealthCheckCall)(null!==s?s:"");console.log("CACHING HEALTH CHECK RESPONSE",e),A(e)}catch(s){let e;if(console.error("Error running health check:",s),s&&s.message)try{let t=JSON.parse(s.message);t.error&&(t=t.error),e=t}catch(t){e={message:s.message}}else e={message:"Unknown error occurred"};A({error:e})}};return(0,c.jsxs)(e$.Z,{className:"gap-2 p-8 h-full w-full mt-2 mb-8",children:[(0,c.jsxs)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eW.Z,{children:"Cache Analytics"}),(0,c.jsx)(eW.Z,{children:(0,c.jsx)("pre",{children:"Cache Health"})})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[C&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",C]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center",onClick:()=>{I(new Date().toLocaleString())}})]})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)(v.Z,{numItems:3,className:"gap-4 mt-4",children:[(0,c.jsx)(f.Z,{children:(0,c.jsx)(lH.Z,{placeholder:"Select API Keys",value:o,onValueChange:m,children:T.map(e=>(0,c.jsx)(lJ.Z,{value:e,children:e},e))})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(lH.Z,{placeholder:"Select Models",value:u,onValueChange:x,children:L.map(e=>(0,c.jsx)(lJ.Z,{value:e,children:e},e))})}),(0,c.jsx)(f.Z,{children:(0,c.jsx)(sW,{value:k,onValueChange:e=>{S(e),O(e.from,e.to)}})})]}),(0,c.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-4",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hit Ratio"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsxs)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[N,"%"]})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hits"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:j})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cached Tokens"}),(0,c.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,c.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:y})})]})]}),(0,c.jsx)(sL.Z,{className:"mt-4",children:"Cache Hits vs API Requests"}),(0,c.jsx)(sQ.Z,{title:"Cache Hits vs API Requests",data:i,stack:!0,index:"name",valueFormatter:rR,categories:["LLM API requests","Cache hit"],colors:["sky","teal"],yAxisWidth:48}),(0,c.jsx)(sL.Z,{className:"mt-4",children:"Cached Completion Tokens vs Generated Completion Tokens"}),(0,c.jsx)(sQ.Z,{className:"mt-6",data:i,stack:!0,index:"name",valueFormatter:rR,categories:["Generated Completion Tokens","Cached Completion Tokens"],colors:["sky","teal"],yAxisWidth:48})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(rD,{accessToken:s,healthCheckResponse:E,runCachingHealthCheck:M})})]})]})},rU=t(91810),rz=t(3810);(a=n||(n={})).PresidioPII="Presidio PII",a.Bedrock="Bedrock Guardrail",a.Lakera="Lakera";let rV={},rK=e=>{let s={};return s.PresidioPII="Presidio PII",s.Bedrock="Bedrock Guardrail",s.Lakera="Lakera",Object.entries(e).forEach(e=>{let[t,l]=e;l&&"object"==typeof l&&"ui_friendly_name"in l&&(s[t.split("_").map((e,s)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l.ui_friendly_name)}),rV=s,s},rB=()=>Object.keys(rV).length>0?rV:n,rG={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2"},rH=e=>{Object.entries(e).forEach(e=>{let[s,t]=e;t&&"object"==typeof t&&"ui_friendly_name"in t&&(rG[s.split("_").map((e,s)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=s)})},rJ=e=>!!e&&"Presidio PII"===rB()[e],rY="../ui/assets/logos/",rW={"Presidio PII":"".concat(rY,"presidio.png"),"Bedrock Guardrail":"".concat(rY,"bedrock.svg"),Lakera:"".concat(rY,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(rY,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(rY,"presidio.png")},r$=e=>{if(!e)return{logo:"",displayName:"-"};let s=Object.keys(rG).find(s=>rG[s].toLowerCase()===e.toLowerCase());if(!s)return{logo:"",displayName:e};let t=rB()[s];return{logo:rW[t]||"",displayName:t||e}};var rQ=t(33866),rX=t(97416),r0=t(8881),r1=t(10798),r2=t(49638);let{Text:r4}=eh.default,{Option:r5}=C.default,r6=e=>e.replace(/_/g," "),r3=e=>{switch(e){case"MASK":return(0,c.jsx)(rX.Z,{style:{marginRight:4}});case"BLOCK":return(0,c.jsx)(r0.Z,{style:{marginRight:4}});default:return null}},r8=e=>{let{categories:s,selectedCategories:t,onChange:l}=e;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center mb-2",children:[(0,c.jsx)(r1.Z,{className:"text-gray-500 mr-1"}),(0,c.jsx)(r4,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:l,value:t,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,c.jsx)(rz.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:s.map(e=>(0,c.jsx)(r5,{value:e.category,children:e.category},e.category))})]})},r7=e=>{let{onSelectAll:s,onUnselectAll:t,hasSelectedEntities:l}=e;return(0,c.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(r4,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,c.jsx)(z.Z,{title:"Apply action to all PII types at once",children:(0,c.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,c.jsx)(T.ZP,{type:"default",onClick:t,disabled:!l,icon:(0,c.jsx)(r2.Z,{}),className:"border-gray-300 hover:text-red-600 hover:border-red-300",children:"Unselect All"})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,c.jsx)(T.ZP,{type:"default",onClick:()=>s("MASK"),className:"flex items-center justify-center h-10 border-blue-200 hover:border-blue-300 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 text-blue-600",block:!0,icon:(0,c.jsx)(rX.Z,{}),children:"Select All & Mask"}),(0,c.jsx)(T.ZP,{type:"default",onClick:()=>s("BLOCK"),className:"flex items-center justify-center h-10 border-red-200 hover:border-red-300 hover:text-red-700 bg-red-50 hover:bg-red-100 text-red-600",block:!0,icon:(0,c.jsx)(r0.Z,{}),children:"Select All & Block"})]})]})},r9=e=>{let{entities:s,selectedEntities:t,selectedActions:l,actions:a,onEntitySelect:r,onActionSelect:i,entityToCategoryMap:n}=e;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,c.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,c.jsx)(r4,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,c.jsx)(r4,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,c.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===s.length?(0,c.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):s.map(e=>(0,c.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(t.includes(e)?"bg-blue-50":""),children:[(0,c.jsxs)("div",{className:"flex items-center flex-1",children:[(0,c.jsx)(s4.Z,{checked:t.includes(e),onChange:()=>r(e),className:"mr-3"}),(0,c.jsx)(r4,{className:t.includes(e)?"font-medium text-gray-900":"text-gray-700",children:r6(e)}),n.get(e)&&(0,c.jsx)(rz.Z,{className:"ml-2 text-xs",color:"blue",children:n.get(e)})]}),(0,c.jsx)("div",{className:"w-32",children:(0,c.jsx)(C.default,{value:t.includes(e)&&l[e]||"MASK",onChange:s=>i(e,s),style:{width:120},disabled:!t.includes(e),className:"".concat(t.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:a.map(e=>(0,c.jsx)(r5,{value:e,children:(0,c.jsxs)("div",{className:"flex items-center",children:[r3(e),e]})},e))})})]},e))})]})},{Title:ie,Text:is}=eh.default;var it=e=>{let{entities:s,actions:t,selectedEntities:l,selectedActions:a,onEntitySelect:r,onActionSelect:i,entityCategories:n=[]}=e,[o,m]=(0,d.useState)([]),u=new Map;n.forEach(e=>{e.entities.forEach(s=>{u.set(s,e.category)})});let x=s.filter(e=>0===o.length||o.includes(u.get(e)||""));return(0,c.jsxs)("div",{className:"pii-configuration",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,c.jsx)("div",{className:"flex items-center",children:(0,c.jsx)(ie,{level:4,className:"mb-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,c.jsx)(rQ.Z,{count:l.length,showZero:!0,style:{backgroundColor:l.length>0?"#4f46e5":"#d9d9d9"},overflowCount:999,children:(0,c.jsxs)(is,{className:"text-gray-500",children:[l.length," items selected"]})})]}),(0,c.jsxs)("div",{className:"mb-6",children:[(0,c.jsx)(r8,{categories:n,selectedCategories:o,onChange:m}),(0,c.jsx)(r7,{onSelectAll:e=>{s.forEach(s=>{l.includes(s)||r(s),i(s,e)})},onUnselectAll:()=>{l.forEach(e=>{r(e)})},hasSelectedEntities:l.length>0})]}),(0,c.jsx)(r9,{entities:x,selectedEntities:l,selectedActions:a,actions:t,onEntitySelect:r,onActionSelect:i,entityToCategoryMap:u})]})},il=e=>{var s;let{selectedProvider:t,accessToken:l,providerParams:a=null,value:r=null}=e,[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(a),[u,x]=(0,d.useState)(null);if((0,d.useEffect)(()=>{if(a){m(a);return}let e=async()=>{if(l){n(!0),x(null);try{let e=await (0,g.getGuardrailProviderSpecificParams)(l);console.log("Provider params API response:",e),m(e),rK(e),rH(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{n(!1)}}};a||e()},[l,a]),!t)return null;if(i)return(0,c.jsx)(lu.Z,{tip:"Loading provider parameters..."});if(u)return(0,c.jsx)("div",{className:"text-red-500",children:u});let h=null===(s=rG[t])||void 0===s?void 0:s.toLowerCase(),p=o&&o[h];if(console.log("Provider key:",h),console.log("Provider fields:",p),!p||0===Object.keys(p).length)return(0,c.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",r);let j=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[l,a]=e,i=s?"".concat(s,".").concat(l):l,n=t?t[l]:null==r?void 0:r[l];return(console.log("Field value:",n),"ui_friendly_name"===l||"optional_params"===l&&"nested"===a.type&&a.fields)?null:"nested"===a.type&&a.fields?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"mb-2 font-medium",children:l}),(0,c.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:j(a.fields,i,n)})]},i):(0,c.jsx)(I.Z.Item,{name:i,label:l,tooltip:a.description,rules:a.required?[{required:!0,message:"".concat(l," is required")}]:void 0,children:"select"===a.type&&a.options?(0,c.jsx)(C.default,{placeholder:a.description,defaultValue:n||a.default_value,children:a.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"multiselect"===a.type&&a.options?(0,c.jsx)(C.default,{mode:"multiple",placeholder:a.description,defaultValue:n||a.default_value,children:a.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"bool"===a.type||"boolean"===a.type?(0,c.jsxs)(C.default,{placeholder:a.description,defaultValue:void 0!==n?String(n):a.default_value,children:[(0,c.jsx)(C.default.Option,{value:"true",children:"True"}),(0,c.jsx)(C.default.Option,{value:"false",children:"False"})]}):"number"===a.type?(0,c.jsx)(M,{step:1,width:400,placeholder:a.description,defaultValue:void 0!==n?Number(n):void 0}):l.includes("password")||l.includes("secret")||l.includes("key")?(0,c.jsx)(y.Z,{placeholder:a.description,type:"password",defaultValue:n||""}):(0,c.jsx)(y.Z,{placeholder:a.description,type:"text",defaultValue:n||""})},i)})};return(0,c.jsx)(c.Fragment,{children:j(p)})};let{Title:ia}=eh.default,ir=e=>{let{field:s,fieldKey:t,fullFieldKey:l,value:a}=e,[r,i]=d.useState([]),[n,o]=d.useState(s.dict_key_options||[]);d.useEffect(()=>{if(a&&"object"==typeof a){let e=Object.keys(a);i(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),o((s.dict_key_options||[]).filter(s=>!e.includes(s)))}},[a,s.dict_key_options]);let m=e=>{e&&(i([...r,{key:e,id:"".concat(e,"_").concat(Date.now())}]),o(n.filter(s=>s!==e)))},u=(e,s)=>{i(r.filter(s=>s.id!==e)),o([...n,s].sort())};return(0,c.jsxs)("div",{className:"space-y-3",children:[r.map(e=>(0,c.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,c.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,c.jsx)("div",{className:"flex-1",children:(0,c.jsx)(I.Z.Item,{name:Array.isArray(l)?[...l,e.key]:[l,e.key],style:{marginBottom:0},initialValue:a&&"object"==typeof a?a[e.key]:void 0,normalize:"number"===s.dict_value_type?e=>{if(null==e||""===e)return;let s=Number(e);return isNaN(s)?e:s}:void 0,children:"number"===s.dict_value_type?(0,c.jsx)(M,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===s.dict_value_type?(0,c.jsxs)(C.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,c.jsx)(C.default.Option,{value:!0,children:"True"}),(0,c.jsx)(C.default.Option,{value:!1,children:"False"})]}):(0,c.jsx)(y.Z,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,c.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>u(e.id,e.key),children:"Remove"})]},e.id)),n.length>0&&(0,c.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,c.jsx)(C.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&m(e),value:void 0,children:n.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}),(0,c.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var ii=e=>{let{optionalParams:s,parentFieldKey:t,values:l}=e,a=(e,s)=>{let a="".concat(t,".").concat(e),r=null==l?void 0:l[e];return(console.log("value",r),"dict"===s.type&&s.dict_key_options)?(0,c.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,c.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,c.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:s.description}),(0,c.jsx)(ir,{field:s,fieldKey:e,fullFieldKey:[t,e],value:r})]},a):(0,c.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,c.jsx)(I.Z.Item,{name:[t,e],label:(0,c.jsxs)("div",{className:"mb-2",children:[(0,c.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,c.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:s.description})]}),rules:s.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==r?r:s.default_value,normalize:"number"===s.type?e=>{if(null==e||""===e)return;let s=Number(e);return isNaN(s)?e:s}:void 0,children:"select"===s.type&&s.options?(0,c.jsx)(C.default,{placeholder:s.description,children:s.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"multiselect"===s.type&&s.options?(0,c.jsx)(C.default,{mode:"multiple",placeholder:s.description,children:s.options.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:e},e))}):"bool"===s.type||"boolean"===s.type?(0,c.jsxs)(C.default,{placeholder:s.description,children:[(0,c.jsx)(C.default.Option,{value:"true",children:"True"}),(0,c.jsx)(C.default.Option,{value:"false",children:"False"})]}):"number"===s.type?(0,c.jsx)(M,{step:1,width:400,placeholder:s.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,c.jsx)(y.Z,{placeholder:s.description,type:"password"}):(0,c.jsx)(y.Z,{placeholder:s.description,type:"text"})})},a)};return s.fields&&0!==Object.keys(s.fields).length?(0,c.jsxs)("div",{className:"guardrail-optional-params",children:[(0,c.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,c.jsx)(ia,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,c.jsx)("p",{className:"text-gray-600 text-sm",children:s.description||"Configure additional settings for this guardrail provider"})]}),(0,c.jsx)("div",{className:"space-y-8",children:Object.entries(s.fields).map(e=>{let[s,t]=e;return a(s,t)})})]}):null};let{Title:io,Text:ic,Link:id}=eh.default,{Option:im}=C.default,{Step:iu}=rU.default,ix={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call"};var ih=e=>{let{visible:s,onClose:t,accessToken:l,onSuccess:a}=e,[r]=I.Z.useForm(),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)([]),[j,f]=(0,d.useState)({}),[v,b]=(0,d.useState)(0),[N,Z]=(0,d.useState)(null),[w,k]=(0,d.useState)([]),[S,A]=(0,d.useState)(2),[T,L]=(0,d.useState)({});(0,d.useEffect)(()=>{l&&(async()=>{try{let[e,s]=await Promise.all([(0,g.getGuardrailUISettings)(l),(0,g.getGuardrailProviderSpecificParams)(l)]);x(e),Z(s),rK(s),rH(s)}catch(e){console.error("Error fetching guardrail data:",e),P.ZP.error("Failed to load guardrail configuration")}})()},[l]);let O=e=>{m(e),r.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),p([]),f({}),k([]),A(2),L({})},M=e=>{p(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},D=(e,s)=>{f(t=>({...t,[e]:s}))},F=async()=>{try{if(0===v&&(await r.validateFields(["guardrail_name","provider","mode","default_on"]),o)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===o&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await r.validateFields(e)}if(1===v&&rJ(o)&&0===h.length){P.ZP.error("Please select at least one PII entity to continue");return}b(v+1)}catch(e){console.error("Form validation failed:",e)}},R=()=>{r.resetFields(),m(null),p([]),f({}),k([]),A(2),L({}),b(0)},q=()=>{R(),t()},U=async()=>{try{n(!0),await r.validateFields();let s=r.getFieldsValue(!0),i=rG[s.provider],c={guardrail_name:s.guardrail_name,litellm_params:{guardrail:i,mode:s.mode,default_on:s.default_on},guardrail_info:{}};if("PresidioPII"===s.provider&&h.length>0){let e={};h.forEach(s=>{e[s]=j[s]||"MASK"}),c.litellm_params.pii_entities_config=e,s.presidio_analyzer_api_base&&(c.litellm_params.presidio_analyzer_api_base=s.presidio_analyzer_api_base),s.presidio_anonymizer_api_base&&(c.litellm_params.presidio_anonymizer_api_base=s.presidio_anonymizer_api_base)}else if(s.config)try{let e=JSON.parse(s.config);c.guardrail_info=e}catch(e){P.ZP.error("Invalid JSON in configuration"),n(!1);return}if(console.log("values: ",JSON.stringify(s)),N&&o){var e;let t=null===(e=rG[o])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",t);let l=N[t]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(e=>{let t=s[e];if(null==t||""===t){var l;t=null===(l=s.optional_params)||void 0===l?void 0:l[e]}null!=t&&""!==t&&(c.litellm_params[e]=t)})}if(!l)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(c)),await (0,g.createGuardrailCall)(l,c),P.ZP.success("Guardrail created successfully"),R(),a(),t()}catch(e){console.error("Failed to create guardrail:",e),P.ZP.error("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{n(!1)}},z=()=>{var e;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter a name for this guardrail"})}),(0,c.jsx)(I.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{placeholder:"Select a guardrail provider",onChange:O,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(rB()).map(e=>{let[s,t]=e;return(0,c.jsx)(im,{value:s,label:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rW[t]&&(0,c.jsx)("img",{src:rW[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]}),children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rW[t]&&(0,c.jsx)("img",{src:rW[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(I.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,c.jsx)(C.default,{optionLabelProp:"label",mode:"multiple",children:(null==u?void 0:null===(e=u.supported_modes)||void 0===e?void 0:e.map(e=>(0,c.jsx)(im,{value:e,label:e,children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:e}),"pre_call"===e&&(0,c.jsx)(rz.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix[e]})]})},e)))||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(im,{value:"pre_call",label:"pre_call",children:(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("strong",{children:"pre_call"})," ",(0,c.jsx)(rz.Z,{color:"green",children:"Recommended"})]}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix.pre_call})]})}),(0,c.jsx)(im,{value:"during_call",label:"during_call",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"during_call"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix.during_call})]})}),(0,c.jsx)(im,{value:"post_call",label:"post_call",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"post_call"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix.post_call})]})}),(0,c.jsx)(im,{value:"logging_only",label:"logging_only",children:(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{children:(0,c.jsx)("strong",{children:"logging_only"})}),(0,c.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:ix.logging_only})]})})]})})}),(0,c.jsx)(I.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:!0,children:"Yes"}),(0,c.jsx)(C.default.Option,{value:!1,children:"No"})]})}),(0,c.jsx)(il,{selectedProvider:o,accessToken:l,providerParams:N})]})},V=()=>u&&"PresidioPII"===o?(0,c.jsx)(it,{entities:u.supported_entities,actions:u.supported_actions,selectedEntities:h,selectedActions:j,onEntitySelect:M,onActionSelect:D,entityCategories:u.pii_entity_categories}):null,K=()=>{var e;if(!o||!N)return null;console.log("guardrail_provider_map: ",rG),console.log("selectedProvider: ",o);let s=null===(e=rG[o])||void 0===e?void 0:e.toLowerCase(),t=N&&N[s];return t&&t.optional_params?(0,c.jsx)(ii,{optionalParams:t.optional_params,parentFieldKey:"optional_params"}):null};return(0,c.jsx)(E.Z,{title:"Add Guardrail",open:s,onCancel:q,footer:null,width:700,children:(0,c.jsxs)(I.Z,{form:r,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,c.jsxs)(rU.default,{current:v,className:"mb-6",children:[(0,c.jsx)(iu,{title:"Basic Info"}),(0,c.jsx)(iu,{title:rJ(o)?"PII Configuration":"Provider Configuration"})]}),(()=>{switch(v){case 0:return z();case 1:if(rJ(o))return V();return K();default:return null}})(),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[v>0&&(0,c.jsx)(_.Z,{variant:"secondary",onClick:()=>{b(v-1)},children:"Previous"}),v<2&&(0,c.jsx)(_.Z,{onClick:F,children:"Next"}),2===v&&(0,c.jsx)(_.Z,{onClick:U,loading:i,children:"Create Guardrail"}),(0,c.jsx)(_.Z,{variant:"secondary",onClick:q,children:"Cancel"})]})]})})};let{Title:ip,Text:ig}=eh.default,{Option:ij}=C.default;var iv=e=>{var s;let{visible:t,onClose:l,accessToken:a,onSuccess:r,guardrailId:i,initialValues:n}=e,[o]=I.Z.useForm(),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)((null==n?void 0:n.provider)||null),[p,j]=(0,d.useState)(null),[f,v]=(0,d.useState)([]),[b,N]=(0,d.useState)({});(0,d.useEffect)(()=>{(async()=>{try{if(!a)return;let e=await (0,g.getGuardrailUISettings)(a);j(e)}catch(e){console.error("Error fetching guardrail settings:",e),P.ZP.error("Failed to load guardrail settings")}})()},[a]),(0,d.useEffect)(()=>{(null==n?void 0:n.pii_entities_config)&&Object.keys(n.pii_entities_config).length>0&&(v(Object.keys(n.pii_entities_config)),N(n.pii_entities_config))},[n]);let Z=e=>{v(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},w=(e,s)=>{N(t=>({...t,[e]:s}))},k=async()=>{try{u(!0);let e=await o.validateFields(),s=rG[e.provider],t={guardrail_id:i,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:s,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&f.length>0){let e={};f.forEach(s=>{e[s]=b[s]||"MASK"}),t.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let s=JSON.parse(e.config);"Bedrock"===e.provider&&s?(s.guardrail_id&&(t.guardrail.litellm_params.guardrailIdentifier=s.guardrail_id),s.guardrail_version&&(t.guardrail.litellm_params.guardrailVersion=s.guardrail_version)):t.guardrail.guardrail_info=s}catch(e){P.ZP.error("Invalid JSON in configuration"),u(!1);return}if(!a)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(t));let n=await fetch("/guardrails/".concat(i),{method:"PUT",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){let e=await n.text();throw Error(e||"Failed to update guardrail")}P.ZP.success("Guardrail updated successfully"),r(),l()}catch(e){console.error("Failed to update guardrail:",e),P.ZP.error("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{u(!1)}},S=()=>p&&x&&"PresidioPII"===x?(0,c.jsx)(it,{entities:p.supported_entities,actions:p.supported_actions,selectedEntities:f,selectedActions:b,onEntitySelect:Z,onActionSelect:w,entityCategories:p.pii_entity_categories}):null;return(0,c.jsx)(E.Z,{title:"Edit Guardrail",open:t,onCancel:l,footer:null,width:700,children:(0,c.jsxs)(I.Z,{form:o,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,c.jsx)(y.Z,{placeholder:"Enter a name for this guardrail"})}),(0,c.jsx)(I.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{placeholder:"Select a guardrail provider",onChange:e=>{h(e),o.setFieldsValue({config:void 0}),v([]),N({})},disabled:!0,optionLabelProp:"label",children:Object.entries(rB()).map(e=>{let[s,t]=e;return(0,c.jsx)(ij,{value:s,label:t,children:(0,c.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[rW[t]&&(0,c.jsx)("img",{src:rW[t],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,c.jsx)("span",{children:t})]})},s)})})}),(0,c.jsx)(I.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,c.jsx)(C.default,{children:(null==p?void 0:null===(s=p.supported_modes)||void 0===s?void 0:s.map(e=>(0,c.jsx)(ij,{value:e,children:e},e)))||(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(ij,{value:"pre_call",children:"pre_call"}),(0,c.jsx)(ij,{value:"post_call",children:"post_call"})]})})}),(0,c.jsx)(I.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,c.jsx)(to.Z,{})}),(()=>{if(!x)return null;if("PresidioPII"===x)return S();switch(x){case"Aporia":return(0,c.jsx)(I.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,c.jsx)(I.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,c.jsx)(I.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,c.jsx)(I.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,c.jsx)(I.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,c.jsx)(I.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,c.jsx)(I.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,c.jsx)(L.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,c.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:k,loading:m,children:"Update Guardrail"})]})]})})},i_=e=>{let{guardrailsList:s,isLoading:t,onDeleteClick:l,accessToken:a,onGuardrailUpdated:r,isAdmin:i=!1,onGuardrailClick:n}=e,[o,m]=(0,d.useState)([{id:"created_at",desc:!0}]),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(null),g=e=>e?new Date(e).toLocaleString():"-",j=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,c.jsx)(z.Z,{title:String(e.getValue()||""),children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&n(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.guardrail_name,children:(0,c.jsx)("span",{className:"text-xs font-medium",children:t.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:s}=e,{logo:t,displayName:l}=r$(s.original.litellm_params.guardrail);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,c.jsx)("img",{src:t,alt:"".concat(l," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)("span",{className:"text-xs",children:l})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var s,t;let{row:l}=e,a=l.original;return(0,c.jsx)(eY.Z,{color:(null===(s=a.litellm_params)||void 0===s?void 0:s.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(t=a.litellm_params)||void 0===t?void 0:t.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.created_at,children:(0,c.jsx)("span",{className:"text-xs",children:g(t.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.updated_at,children:(0,c.jsx)("span",{className:"text-xs",children:g(t.updated_at)})})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"flex space-x-2",children:(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>t.guardrail_id&&l(t.guardrail_id,t.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500",tooltip:"Delete guardrail"})})}}],f=(0,sg.b7)({data:s,columns:j,state:{sorting:o},onSortingChange:m,getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0});return(0,c.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sv.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sb.Z,{children:f.getHeaderGroups().map(e=>(0,c.jsx)(sZ.Z,{children:e.headers.map(e=>(0,c.jsx)(sN.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(s_.Z,{children:t?(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:j.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"Loading..."})})})}):s.length>0?f.getRowModel().rows.map(e=>(0,c.jsx)(sZ.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(sy.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:j.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No guardrails found"})})})})})]})}),h&&(0,c.jsx)(iv,{visible:u,onClose:()=>x(!1),accessToken:a,onSuccess:()=>{x(!1),p(null),r()},guardrailId:h.guardrail_id||"",initialValues:{guardrail_name:h.guardrail_name||"",provider:Object.keys(rG).find(e=>rG[e]===(null==h?void 0:h.litellm_params.guardrail))||"",mode:h.litellm_params.mode,default_on:h.litellm_params.default_on,pii_entities_config:h.litellm_params.pii_entities_config,...h.guardrail_info}})]})},iy=e=>{var s,t,l,a,r,i,n,o,m,u,x;let{guardrailId:h,onClose:p,accessToken:j,isAdmin:f}=e,[b,N]=(0,d.useState)(null),[Z,S]=(0,d.useState)(null),[E,A]=(0,d.useState)(!0),[O,M]=(0,d.useState)(!1),[D]=I.Z.useForm(),[F,R]=(0,d.useState)([]),[q,U]=(0,d.useState)({}),[z,V]=(0,d.useState)(null),[K,B]=(0,d.useState)({}),G=async()=>{try{var e;if(A(!0),!j)return;let s=await (0,g.getGuardrailInfo)(j,h);if(N(s),null===(e=s.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=s.litellm_params.pii_entities_config;if(R([]),U({}),Object.keys(e).length>0){let s=[],t={};Object.entries(e).forEach(e=>{let[l,a]=e;s.push(l),t[l]="string"==typeof a?a:"MASK"}),R(s),U(t)}}else R([]),U({})}catch(e){P.ZP.error("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{A(!1)}},H=async()=>{try{if(!j)return;let e=await (0,g.getGuardrailProviderSpecificParams)(j);S(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},J=async()=>{try{if(!j)return;let e=await (0,g.getGuardrailUISettings)(j);V(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,d.useEffect)(()=>{H()},[j]),(0,d.useEffect)(()=>{G(),J()},[h,j]),(0,d.useEffect)(()=>{if(b&&D){var e;D.setFieldsValue({guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(e=b.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:b.litellm_params.optional_params}})}},[b,Z,D]);let Y=async e=>{try{var s,t,l;if(!j)return;let a={litellm_params:{}};e.guardrail_name!==b.guardrail_name&&(a.guardrail_name=e.guardrail_name),e.default_on!==(null===(s=b.litellm_params)||void 0===s?void 0:s.default_on)&&(a.litellm_params.default_on=e.default_on);let r=b.guardrail_info,i=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(r)!==JSON.stringify(i)&&(a.guardrail_info=i);let n=(null===(t=b.litellm_params)||void 0===t?void 0:t.pii_entities_config)||{},o={};F.forEach(e=>{o[e]=q[e]||"MASK"}),JSON.stringify(n)!==JSON.stringify(o)&&(a.litellm_params.pii_entities_config=o);let c=Object.keys(rG).find(e=>{var s;return rG[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)});if(console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",c),Z&&c){let s=Z[null===(l=rG[c])||void 0===l?void 0:l.toLowerCase()]||{},t=new Set;console.log("providerSpecificParams: ",JSON.stringify(s)),Object.keys(s).forEach(e=>{"optional_params"!==e&&t.add(e)}),s.optional_params&&s.optional_params.fields&&Object.keys(s.optional_params.fields).forEach(e=>{t.add(e)}),console.log("allowedParams: ",t),t.forEach(s=>{var t,l;let r=e[s];(null==r||""===r)&&(r=null===(l=e.optional_params)||void 0===l?void 0:l[s]);let i=null===(t=b.litellm_params)||void 0===t?void 0:t[s];JSON.stringify(r)!==JSON.stringify(i)&&(null!=r&&""!==r?a.litellm_params[s]=r:null!=i&&""!==i&&(a.litellm_params[s]=null))})}if(0===Object.keys(a.litellm_params).length&&delete a.litellm_params,0===Object.keys(a).length){P.ZP.info("No changes detected"),M(!1);return}await (0,g.updateGuardrailCall)(j,h,a),P.ZP.success("Guardrail updated successfully"),G(),M(!1)}catch(e){console.error("Error updating guardrail:",e),P.ZP.error("Failed to update guardrail")}};if(E)return(0,c.jsx)("div",{className:"p-4",children:"Loading..."});if(!b)return(0,c.jsx)("div",{className:"p-4",children:"Guardrail not found"});let W=e=>e?new Date(e).toLocaleString():"-",{logo:$,displayName:ee}=r$((null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)||""),es=async(e,s)=>{await eq(e)&&(B(e=>({...e,[s]:!0})),setTimeout(()=>{B(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",onClick:p,className:"mb-4",children:"Back to Guardrails"}),(0,c.jsx)(k.Z,{children:b.guardrail_name||"Unnamed Guardrail"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:b.guardrail_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:K["guardrail-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>es(b.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(K["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"},"overview"),f?(0,c.jsx)(eW.Z,{children:"Settings"},"settings"):(0,c.jsx)(c.Fragment,{})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Provider"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[$&&(0,c.jsx)("img",{src:$,alt:"".concat(ee," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,c.jsx)(k.Z,{children:ee})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Mode"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:(null===(t=b.litellm_params)||void 0===t?void 0:t.mode)||"-"}),(0,c.jsx)(eY.Z,{color:(null===(l=b.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",children:(null===(a=b.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})]})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Created At"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:W(b.created_at)}),(0,c.jsxs)(w.Z,{children:["Last Updated: ",W(b.updated_at)]})]})]})]}),(null===(r=b.litellm_params)||void 0===r?void 0:r.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,c.jsx)(X.Z,{className:"mt-6",children:(0,c.jsxs)("div",{className:"flex justify-between items-center",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"PII Protection"}),(0,c.jsxs)(eY.Z,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),b.guardrail_info&&Object.keys(b.guardrail_info).length>0&&(0,c.jsxs)(X.Z,{className:"mt-6",children:[(0,c.jsx)(w.Z,{children:"Guardrail Info"}),(0,c.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(b.guardrail_info).map(e=>{let[s,t]=e;return(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(w.Z,{className:"font-medium w-1/3",children:s}),(0,c.jsx)(w.Z,{className:"w-2/3",children:"object"==typeof t?JSON.stringify(t,null,2):String(t)})]},s)})})]})]}),f&&(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Guardrail Settings"}),!O&&(0,c.jsx)(_.Z,{onClick:()=>M(!0),children:"Edit Settings"})]}),O?(0,c.jsxs)(I.Z,{form:D,onFinish:Y,initialValues:{guardrail_name:b.guardrail_name,...b.litellm_params,guardrail_info:b.guardrail_info?JSON.stringify(b.guardrail_info,null,2):"",...(null===(i=b.litellm_params)||void 0===i?void 0:i.optional_params)&&{optional_params:b.litellm_params.optional_params}},layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Default On",name:"default_on",children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:!0,children:"Yes"}),(0,c.jsx)(C.default.Option,{value:!1,children:"No"})]})}),(null===(n=b.litellm_params)||void 0===n?void 0:n.guardrail)==="presidio"&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Q.Z,{orientation:"left",children:"PII Protection"}),(0,c.jsx)("div",{className:"mb-6",children:z&&(0,c.jsx)(it,{entities:z.supported_entities,actions:z.supported_actions,selectedEntities:F,selectedActions:q,onEntitySelect:e=>{R(s=>s.includes(e)?s.filter(s=>s!==e):[...s,e])},onActionSelect:(e,s)=>{U(t=>({...t,[e]:s}))},entityCategories:z.pii_entity_categories})})]}),(0,c.jsx)(Q.Z,{orientation:"left",children:"Provider Settings"}),(0,c.jsx)(il,{selectedProvider:Object.keys(rG).find(e=>{var s;return rG[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)})||null,accessToken:j,providerParams:Z,value:b.litellm_params}),Z&&(()=>{var e;let s=Object.keys(rG).find(e=>{var s;return rG[e]===(null===(s=b.litellm_params)||void 0===s?void 0:s.guardrail)});if(!s)return null;let t=Z[null===(e=rG[s])||void 0===e?void 0:e.toLowerCase()];return t&&t.optional_params?(0,c.jsx)(ii,{optionalParams:t.optional_params,parentFieldKey:"optional_params",values:b.litellm_params}):null})(),(0,c.jsx)(Q.Z,{orientation:"left",children:"Advanced Settings"}),(0,c.jsx)(I.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,c.jsx)(L.default.TextArea,{rows:5})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,c.jsx)(T.ZP,{onClick:()=>M(!1),children:"Cancel"}),(0,c.jsx)(_.Z,{children:"Save Changes"})]})]}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Guardrail ID"}),(0,c.jsx)("div",{className:"font-mono",children:b.guardrail_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Guardrail Name"}),(0,c.jsx)("div",{children:b.guardrail_name||"Unnamed Guardrail"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Provider"}),(0,c.jsx)("div",{children:ee})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Mode"}),(0,c.jsx)("div",{children:(null===(o=b.litellm_params)||void 0===o?void 0:o.mode)||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Default On"}),(0,c.jsx)(eY.Z,{color:(null===(m=b.litellm_params)||void 0===m?void 0:m.default_on)?"green":"gray",children:(null===(u=b.litellm_params)||void 0===u?void 0:u.default_on)?"Yes":"No"})]}),(null===(x=b.litellm_params)||void 0===x?void 0:x.pii_entities_config)&&Object.keys(b.litellm_params.pii_entities_config).length>0&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"PII Protection"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsxs)(eY.Z,{color:"blue",children:[Object.keys(b.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created At"}),(0,c.jsx)("div",{children:W(b.created_at)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)("div",{children:W(b.updated_at)})]})]})]})})]})]})]})},ib=e=>{let{accessToken:s,userRole:t}=e,[l,a]=(0,d.useState)([]),[r,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(null),f=!!t&&(0,eL.tY)(t),v=async()=>{if(s){o(!0);try{let e=await (0,g.getGuardrailsList)(s);console.log("guardrails: ".concat(JSON.stringify(e))),a(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{o(!1)}}};(0,d.useEffect)(()=>{v()},[s]);let y=async()=>{if(x&&s){u(!0);try{await (0,g.deleteGuardrailCall)(s,x.id),P.ZP.success('Guardrail "'.concat(x.name,'" deleted successfully')),v()}catch(e){console.error("Error deleting guardrail:",e),P.ZP.error("Failed to delete guardrail")}finally{u(!1),h(null)}}};return(0,c.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(_.Z,{onClick:()=>{p&&j(null),i(!0)},disabled:!s,children:"+ Add New Guardrail"})}),p?(0,c.jsx)(iy,{guardrailId:p,onClose:()=>j(null),accessToken:s,isAdmin:f}):(0,c.jsx)(i_,{guardrailsList:l,isLoading:n,onDeleteClick:(e,s)=>{h({id:e,name:s})},accessToken:s,onGuardrailUpdated:v,isAdmin:f,onGuardrailClick:e=>j(e)}),(0,c.jsx)(ih,{visible:r,onClose:()=>{i(!1)},accessToken:s,onSuccess:()=>{v()}}),x&&(0,c.jsxs)(E.Z,{title:"Delete Guardrail",open:null!==x,onOk:y,onCancel:()=>{h(null)},confirmLoading:m,okText:"Delete",okButtonProps:{danger:!0},children:[(0,c.jsxs)("p",{children:["Are you sure you want to delete guardrail: ",x.name," ?"]}),(0,c.jsx)("p",{children:"This action cannot be undone."})]})]})},iN=e=>{let{accessToken:s}=e,[t,l]=(0,d.useState)('{\n "model": "openai/gpt-4o",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n },\n {\n "role": "user",\n "content": "Explain quantum computing in simple terms"\n }\n ],\n "temperature": 0.7,\n "max_tokens": 500,\n "stream": true\n}'),[a,r]=(0,d.useState)(""),[i,n]=(0,d.useState)(!1),o=(e,s,t)=>{let l=JSON.stringify(s,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[s,t]=e;return"-H '".concat(s,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(l,"\n }'")},m=async()=>{n(!0);try{let e;try{e=JSON.parse(t)}catch(e){P.ZP.error("Invalid JSON in request body"),n(!1);return}let l={call_type:"completion",request_body:e};if(!s){P.ZP.error("No access token found"),n(!1);return}let a=await (0,g.transformRequestCall)(s,l);if(a.raw_request_api_base&&a.raw_request_body){let e=o(a.raw_request_api_base,a.raw_request_body,a.raw_request_headers||{});r(e),P.ZP.success("Request transformed successfully")}else{let e="string"==typeof a?a:JSON.stringify(a);r(e),P.ZP.info("Transformed request received in unexpected format")}}catch(e){console.error("Error transforming request:",e),P.ZP.error("Failed to transform request")}finally{n(!1)}};return(0,c.jsxs)("div",{className:"w-full m-2",style:{overflow:"hidden"},children:[(0,c.jsx)(k.Z,{children:"Playground"}),(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"See how LiteLLM transforms your request for the specified provider."}),(0,c.jsxs)("div",{style:{display:"flex",gap:"16px",width:"100%",minWidth:0,overflow:"hidden"},className:"mt-4",children:[(0,c.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"600px",minWidth:0},children:[(0,c.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,c.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Original Request"}),(0,c.jsx)("p",{style:{color:"#666",margin:0},children:"The request you would send to LiteLLM /chat/completions endpoint."})]}),(0,c.jsx)("textarea",{style:{flex:"1 1 auto",width:"100%",minHeight:"240px",padding:"16px",border:"1px solid #e8e8e8",borderRadius:"6px",fontFamily:"monospace",fontSize:"14px",resize:"none",marginBottom:"24px",overflow:"auto"},value:t,onChange:e=>l(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),m())},placeholder:"Press Cmd/Ctrl + Enter to transform"}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"auto"},children:(0,c.jsxs)(T.ZP,{type:"primary",style:{backgroundColor:"#000",display:"flex",alignItems:"center",gap:"8px"},onClick:m,loading:i,children:[(0,c.jsx)("span",{children:"Transform"}),(0,c.jsx)("span",{children:"→"})]})})]}),(0,c.jsxs)("div",{style:{flex:"1 1 50%",display:"flex",flexDirection:"column",border:"1px solid #e8e8e8",borderRadius:"8px",padding:"24px",overflow:"hidden",maxHeight:"800px",minWidth:0},children:[(0,c.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,c.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",margin:"0 0 4px 0"},children:"Transformed Request"}),(0,c.jsx)("p",{style:{color:"#666",margin:0},children:"How LiteLLM transforms your request for the specified provider."}),(0,c.jsx)("br",{}),(0,c.jsx)("p",{style:{color:"#666",margin:0},className:"text-xs",children:"Note: Sensitive headers are not shown."})]}),(0,c.jsxs)("div",{style:{position:"relative",backgroundColor:"#f5f5f5",borderRadius:"6px",flex:"1 1 auto",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,c.jsx)("pre",{style:{padding:"16px",fontFamily:"monospace",fontSize:"14px",margin:0,overflow:"auto",flex:"1 1 auto"},children:a||'curl -X POST \\\n https://api.openai.com/v1/chat/completions \\\n -H \'Authorization: Bearer sk-xxx\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "model": "gpt-4",\n "messages": [\n {\n "role": "system",\n "content": "You are a helpful assistant."\n }\n ],\n "temperature": 0.7\n }\''}),(0,c.jsx)(T.ZP,{type:"text",icon:(0,c.jsx)(tI.Z,{}),style:{position:"absolute",right:"8px",top:"8px"},size:"small",onClick:()=>{navigator.clipboard.writeText(a||""),P.ZP.success("Copied to clipboard")}})]})]})]}),(0,c.jsx)("div",{className:"mt-4 text-right w-full",children:(0,c.jsxs)("p",{className:"text-sm text-gray-500",children:["Found an error? File an issue ",(0,c.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})]})};let iZ=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let t=e.split("/mcp/");if(2!==t.length)return{token:null,baseUrl:e};let l=t[0]+"/mcp/",a=t[1];if(!a)return{token:null,baseUrl:e};return{token:a,baseUrl:l}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},iw=e=>{let{token:s,baseUrl:t}=iZ(e);return s?t+"...":e},ik=e=>{let{token:s}=iZ(e);return{maskedUrl:iw(e),hasToken:!!s}},iS=(e,s,t,l)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:t}=e;return(0,c.jsxs)("button",{onClick:()=>s(t.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[t.original.server_id.slice(0,7),"..."]})}},{accessorKey:"alias",header:"Name"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:t}=ik(s.original.url);return(0,c.jsx)("span",{className:"font-mono text-sm",children:t})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,c.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,c.jsx)("span",{children:s()||"none"})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,t=s.original.mcp_access_groups;if(Array.isArray(t)&&t.length>0&&"string"==typeof t[0]){let e=t.join(", ");return(0,c.jsx)(z.Z,{title:e,children:(0,c.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,c.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.created_at?new Date(t.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:t.updated_at?new Date(t.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>t(s.original.server_id),className:"cursor-pointer"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>l(s.original.server_id),className:"cursor-pointer"})]})}}];var iC=t(82376),iI=t(71437);let iP={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic"},iE={SSE:"sse"},iA=e=>(console.log(e),null==e)?iE.SSE:e,iT=e=>null==e?iP.NONE:e,iL=e=>iT(e)!==iP.NONE;var iO=t(62670),iM=e=>{let{value:s={},onChange:t,tools:l=[],disabled:a=!1}=e,r=(e,l)=>{let a={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:l}};null==t||t(a)};return(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,c.jsx)(iO.Z,{className:"text-green-600"}),(0,c.jsx)(k.Z,{children:"Cost Configuration"}),(0,c.jsx)(z.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,c.jsx)(U.Z,{className:"text-gray-400"})})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,c.jsx)(z.Z,{title:"Default cost charged for each tool call to this server.",children:(0,c.jsx)(U.Z,{className:"ml-1 text-gray-400"})})]}),(0,c.jsx)(q.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let l={...s,default_cost_per_query:e};null==t||t(l)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,c.jsx)(w.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),l.length>0&&(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,c.jsx)(z.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,c.jsx)(U.Z,{className:"ml-1 text-gray-400"})})]}),(0,c.jsx)(th.default,{items:[{key:"1",label:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-2 text-blue-500"}),(0,c.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,c.jsx)(rQ.Z,{count:l.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,c.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:l.map((e,t)=>{var l;return(0,c.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,c.jsx)("div",{className:"ml-4",children:(0,c.jsx)(q.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(l=s.tool_name_to_cost_per_query)||void 0===l?void 0:l[e.name],onChange:s=>r(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},t)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,c.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,c.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,t]=e;return null!=t&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• ",s,": $",t.toFixed(4)," per query"]},s)})]})]})]})})},iD=e=>{let{mcpServer:s,accessToken:t,onCancel:l,onSuccess:a,availableAccessGroups:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)({}),[m,u]=(0,d.useState)([]),[x,h]=(0,d.useState)(!1),[p,j]=(0,d.useState)("");(0,d.useEffect)(()=>{var e;(null===(e=s.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&o(s.mcp_info.mcp_server_cost_info)},[s]),(0,d.useEffect)(()=>{if(s.mcp_access_groups){let e=s.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));i.setFieldValue("mcp_access_groups",e)}},[s]),(0,d.useEffect)(()=>{f()},[s,t]);let f=async()=>{if(t&&s.url){h(!0);try{let e={server_id:s.server_id,alias:s.alias,url:s.url,transport:s.transport,spec_version:s.spec_version,auth_type:s.auth_type,mcp_info:s.mcp_info},l=await (0,g.testMCPToolsListRequest)(t,e);l.tools&&!l.error?u(l.tools):(console.error("Failed to fetch tools:",l.message),u([]))}catch(e){console.error("Tools fetch error:",e),u([])}finally{h(!1)}}},v=async e=>{if(t)try{let l=(e.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),r={...e,server_id:s.server_id,mcp_info:{server_name:e.alias||e.url,description:e.description,mcp_server_cost_info:Object.keys(n).length>0?n:null},mcp_access_groups:l},i=await (0,g.updateMCPServer)(t,r);P.ZP.success("MCP Server updated successfully"),a(i)}catch(e){P.ZP.error("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"grid w-full grid-cols-2",children:[(0,c.jsx)(eW.Z,{children:"Server Configuration"}),(0,c.jsx)(eW.Z,{children:"Cost Configuration"})]}),(0,c.jsxs)(e0.Z,{className:"mt-6",children:[(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:v,initialValues:s,layout:"vertical",children:[(0,c.jsx)(I.Z.Item,{label:"MCP Server Name",name:"alias",rules:[{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,c.jsx)(C.default.Option,{value:"http",children:"HTTP"})]})}),(0,c.jsx)(I.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"none",children:"None"}),(0,c.jsx)(C.default.Option,{value:"api_key",children:"API Key"}),(0,c.jsx)(C.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,c.jsx)(C.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,c.jsx)(I.Z.Item,{label:"MCP Version",name:"spec_version",rules:[{required:!0}],children:(0,c.jsxs)(C.default,{children:[(0,c.jsx)(C.default.Option,{value:"2025-03-26",children:"2025-03-26 (Latest)"}),(0,c.jsx)(C.default.Option,{value:"2024-11-05",children:"2024-11-05"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,c.jsx)(z.Z,{title:"Define access groups for this MCP server. Each group represents a set of permissions.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",getValueFromEvent:e=>e,children:(0,c.jsx)(C.default,{mode:"tags",style:{width:"100%"},showSearch:!0,placeholder:"Add or select access groups",tokenSeparators:[","],optionFilterProp:"value",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.value)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>j(e),options:(()=>{let e=r.map(e=>({value:e,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})}));return p&&!r.some(e=>e.toLowerCase().includes(p.toLowerCase()))&&e.push({value:p,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:p}),(0,c.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e})(),getPopupContainer:e=>e.parentNode})}),(0,c.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,c.jsx)(T.ZP,{onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)("div",{className:"space-y-6",children:[(0,c.jsx)(iM,{value:n,onChange:o,tools:m,disabled:x}),(0,c.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,c.jsx)(T.ZP,{onClick:l,children:"Cancel"}),(0,c.jsx)(_.Z,{onClick:()=>i.submit(),children:"Save Changes"})]})]})})]})]})},iF=e=>{let{costConfig:s}=e,t=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,l=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return t||l?(0,c.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,c.jsxs)("div",{className:"space-y-4",children:[t&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Default Cost per Query"}),(0,c.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Tool-Specific Costs"}),(0,c.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,t]=e;return null!=t&&(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"font-medium",children:s}),(0,c.jsxs)(w.Z,{className:"text-green-600 font-mono",children:["$",t.toFixed(4)," per query"]})]},s)})})]}),(0,c.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,c.jsxs)("div",{className:"mt-2 space-y-1",children:[t&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,c.jsxs)(w.Z,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,c.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,c.jsx)("div",{className:"space-y-4",children:(0,c.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,c.jsx)(w.Z,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})};let iR=e=>{var s,t,l,a;let{mcpServer:r,onBack:i,isEditing:n,isProxyAdmin:o,accessToken:m,userRole:u,userID:x,availableAccessGroups:h}=e,[p,g]=(0,d.useState)(n),[j,f]=(0,d.useState)(!1),[y,b]=(0,d.useState)({}),{maskedUrl:N,hasToken:Z}=ik(r.url),S=(e,s)=>Z?s?e:N:e,C=async(e,s)=>{await eq(e)&&(b(e=>({...e,[s]:!0})),setTimeout(()=>{b(e=>({...e,[s]:!1}))},2e3))};return(0,c.jsxs)("div",{className:"p-4 max-w-full",children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",className:"mb-4",onClick:i,children:"Back to All Servers"}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(k.Z,{children:r.alias}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-alias"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>C(r.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,c.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,c.jsx)(w.Z,{className:"text-gray-500 font-mono",children:r.server_id}),(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:y["mcp-server-id"]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>C(r.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(y["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,c.jsxs)(e$.Z,{defaultIndex:p?2:0,children:[(0,c.jsx)(eQ.Z,{className:"mb-4",children:[(0,c.jsx)(eW.Z,{children:"Overview"},"overview"),(0,c.jsx)(eW.Z,{children:"MCP Tools"},"tools"),...o?[(0,c.jsx)(eW.Z,{children:"Settings"},"settings")]:[]]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsxs)(eX.Z,{children:[(0,c.jsxs)(v.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Transport"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(k.Z,{children:iA(null!==(l=r.transport)&&void 0!==l?l:void 0)})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Auth Type"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)(w.Z,{children:iT(null!==(a=r.auth_type)&&void 0!==a?a:void 0)})})]}),(0,c.jsxs)(X.Z,{children:[(0,c.jsx)(w.Z,{children:"Host Url"}),(0,c.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,c.jsx)(w.Z,{className:"break-all overflow-wrap-anywhere",children:S(r.url,j)}),Z&&(0,c.jsx)("button",{onClick:()=>f(!j),className:"p-1 hover:bg-gray-100 rounded",children:(0,c.jsx)(sf.Z,{icon:j?iC.Z:iI.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,c.jsxs)(X.Z,{className:"mt-2",children:[(0,c.jsx)(k.Z,{children:"Cost Configuration"}),(0,c.jsx)(iF,{costConfig:null===(s=r.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(nl,{serverId:r.server_id,accessToken:m,auth_type:r.auth_type,userRole:u,userID:x})}),(0,c.jsx)(eX.Z,{children:(0,c.jsxs)(X.Z,{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"MCP Server Settings"}),p?null:(0,c.jsx)(_.Z,{variant:"light",onClick:()=>g(!0),children:"Edit Settings"})]}),p?(0,c.jsx)(iD,{mcpServer:r,accessToken:m,onCancel:()=>g(!1),onSuccess:e=>{g(!1),i()},availableAccessGroups:h}):(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Server Name"}),(0,c.jsx)("div",{children:r.alias})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Description"}),(0,c.jsx)("div",{children:r.description})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"URL"}),(0,c.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[S(r.url,j),Z&&(0,c.jsx)("button",{onClick:()=>f(!j),className:"p-1 hover:bg-gray-100 rounded",children:(0,c.jsx)(sf.Z,{icon:j?iC.Z:iI.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Transport"}),(0,c.jsx)("div",{children:iA(r.transport)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Auth Type"}),(0,c.jsx)("div",{children:iT(r.auth_type)})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Spec Version"}),(0,c.jsx)("div",{children:r.spec_version})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Access Groups"}),(0,c.jsx)("div",{children:r.mcp_access_groups&&r.mcp_access_groups.length>0?(0,c.jsx)("div",{className:"flex flex-wrap gap-2",children:r.mcp_access_groups.map((e,s)=>{var t;return(0,c.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(t=null==e?void 0:e.name)&&void 0!==t?t:""},s)})}):(0,c.jsx)(w.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Cost Configuration"}),(0,c.jsx)(iF,{costConfig:null===(t=r.mcp_info)||void 0===t?void 0:t.mcp_server_cost_info})]})]})]})})]})]})]})};var iq=t(83669);let{Panel:iU}=th.default;var iz=e=>{let{accessToken:s,formValues:t,onToolsLoaded:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),h=t.url&&t.transport&&t.auth_type&&s,p=async()=>{if(s&&t.url){n(!0),m(null);try{let e={server_id:t.server_id||"",alias:t.alias||"",url:t.url,transport:t.transport,spec_version:t.spec_version,auth_type:t.auth_type,mcp_info:t.mcp_info},a=await (0,g.testMCPToolsListRequest)(s,e);if(a.tools&&!a.error)r(a.tools),m(null),null==l||l(a.tools),a.tools.length>0&&!u&&x(!0);else{let e=a.message||"Failed to retrieve tools list";m(e),r([]),null==l||l([]),x(!1)}}catch(e){console.error("Tools fetch error:",e),m(e instanceof Error?e.message:String(e)),r([]),null==l||l([]),x(!1)}finally{n(!1)}}};return((0,d.useEffect)(()=>{h?p():(r([]),m(null),x(!1),null==l||l([]))},[t.url,t.transport,t.auth_type,t.spec_version,s]),h||t.url)?(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)(iq.Z,{className:"text-blue-600"}),(0,c.jsx)(k.Z,{children:"Connection Status"})]}),!h&&t.url&&(0,c.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,c.jsx)(a4.Z,{className:"text-2xl mb-2"}),(0,c.jsx)(w.Z,{children:"Complete required fields to test connection"}),(0,c.jsx)("br",{}),(0,c.jsx)(w.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),h&&(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":a.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,c.jsx)("br",{}),(0,c.jsxs)(w.Z,{className:"text-gray-500 text-sm",children:["Server: ",t.url]})]}),i&&(0,c.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,c.jsx)(lu.Z,{size:"small",className:"mr-2"}),(0,c.jsx)(w.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&a.length>0&&(0,c.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,c.jsx)(iq.Z,{className:"mr-1"}),(0,c.jsx)(w.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,c.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,c.jsx)(lP.Z,{className:"mr-1"}),(0,c.jsx)(w.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,c.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,c.jsx)(lu.Z,{size:"large"}),(0,c.jsx)(w.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,c.jsx)(tJ.Z,{message:"Connection Failed",description:o,type:"error",showIcon:!0,action:(0,c.jsx)(T.ZP,{icon:(0,c.jsx)(s6.Z,{}),onClick:p,size:"small",children:"Retry"})}),!i&&a.length>0&&(0,c.jsx)(th.default,{items:[{key:"1",label:(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-2 text-green-500"}),(0,c.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,c.jsx)(rQ.Z,{count:a.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,c.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:a.map((e,s)=>(0,c.jsxs)("div",{className:"p-3 bg-gray-50 rounded-lg",children:[(0,c.jsx)(w.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,c.jsx)(w.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]},s))})}]}),!i&&0===a.length&&!o&&(0,c.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,c.jsx)(iq.Z,{className:"text-2xl mb-2 text-green-500"}),(0,c.jsx)(w.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,c.jsx)("br",{}),(0,c.jsx)(w.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},iV=e=>{let{isVisible:s}=e;return s?(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,c.jsx)(z.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,c.jsx)(L.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null};let iK="".concat("../ui/assets/logos/","mcp_logo.png");var iB=e=>{let{userRole:s,accessToken:t,onCreateSuccess:l,isModalVisible:a,setModalVisible:r,availableAccessGroups:i}=e,[n]=I.Z.useForm(),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)({}),[h,p]=(0,d.useState)({}),[j,f]=(0,d.useState)([]),[v,b]=(0,d.useState)("sse"),[N,Z]=(0,d.useState)(""),w=async e=>{m(!0);try{let s=e.mcp_access_groups,a={};if(e.stdio_config&&"stdio"===v)try{let s=JSON.parse(e.stdio_config),t=s;if(s.mcpServers&&"object"==typeof s.mcpServers){let l=Object.keys(s.mcpServers);if(l.length>0){let a=l[0];t=s.mcpServers[a],e.alias||(e.alias=a.replace(/-/g,"_"))}}a={command:t.command,args:t.args,env:t.env},console.log("Parsed stdio config:",a)}catch(e){P.ZP.error("Invalid JSON in stdio configuration");return}let i={...e,...a,stdio_config:void 0,mcp_info:{server_name:e.alias||e.url,description:e.description,mcp_server_cost_info:Object.keys(u).length>0?u:null},mcp_access_groups:s};if(console.log("Payload: ".concat(JSON.stringify(i))),null!=t){let e=await (0,g.createMCPServer)(t,i);P.ZP.success("MCP Server created successfully"),n.resetFields(),x({}),f([]),r(!1),l(e)}}catch(e){P.ZP.error("Error creating MCP Server: "+e,20)}finally{m(!1)}},k=()=>{n.resetFields(),x({}),f([]),r(!1)};return(0,eL.tY)(s)?(0,c.jsx)(E.Z,{title:(0,c.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,c.jsx)("img",{src:iK,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,c.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:a,width:1e3,onCancel:k,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsxs)(I.Z,{form:n,onFinish:w,onValuesChange:(e,s)=>p(s),layout:"vertical",className:"space-y-6",children:[(0,c.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,c.jsx)(z.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,c.jsx)(y.Z,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description"}],children:(0,c.jsx)(y.Z,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,c.jsxs)(C.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{b(e),"stdio"===e?n.setFieldsValue({url:void 0,auth_type:void 0}):n.setFieldsValue({command:void 0,args:void 0,env:void 0})},value:v,children:[(0,c.jsx)(C.default.Option,{value:"http",children:"HTTP"}),(0,c.jsx)(C.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,c.jsx)(C.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==v&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{type:"url",message:"Please enter a valid URL"}],children:(0,c.jsx)(y.Z,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==v&&(0,c.jsx)(I.Z.Item,{label:(0,c.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,c.jsxs)(C.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,c.jsx)(C.default.Option,{value:"none",children:"None"}),(0,c.jsx)(C.default.Option,{value:"api_key",children:"API Key"}),(0,c.jsx)(C.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,c.jsx)(C.default.Option,{value:"basic",children:"Basic Auth"})]})}),(0,c.jsx)(iV,{isVisible:"stdio"===v}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Version",(0,c.jsx)(z.Z,{title:"Select the MCP specification version your server supports",children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"spec_version",rules:[{required:!0,message:"Please select a spec version"}],children:(0,c.jsxs)(C.default,{placeholder:"Select MCP version",className:"rounded-lg",size:"large",children:[(0,c.jsx)(C.default.Option,{value:"2025-03-26",children:"2025-03-26 (Latest)"}),(0,c.jsx)(C.default.Option,{value:"2024-11-05",children:"2024-11-05"})]})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,c.jsx)(z.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,c.jsx)(U.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,c.jsx)(C.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.value)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>Z(e),tokenSeparators:[","],options:(()=>{let e=i.map(e=>({value:e,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})}));return N&&!i.some(e=>e.toLowerCase().includes(N.toLowerCase()))&&e.push({value:N,label:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:N}),(0,c.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e})(),maxTagCount:"responsive",allowClear:!0})})]}),(0,c.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,c.jsx)(iz,{accessToken:t,formValues:h,onToolsLoaded:f})}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(iM,{value:u,onChange:x,tools:j,disabled:!1})}),(0,c.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,c.jsx)(_.Z,{variant:"secondary",onClick:k,children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",loading:o,children:o?"Creating...":"Add MCP Server"})]})]})})}):null},iG=t(64935),iH=t(11239),iJ=t(54001),iY=t(96137),iW=t(96362),i$=t(80221),iQ=t(29202);let{Title:iX,Text:i0}=eh.default,{Panel:i1}=th.default,i2=e=>{let{icon:s,title:t,description:l,children:a,serverName:r,accessGroups:i=["dev"]}=e,[n,o]=(0,d.useState)(!1),m=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(n&&r){let s=[r.replace(/\s+/g,"_"),...i].join(",");e["x-mcp-servers"]=[s]}return e};return(0,c.jsxs)(tp.Z,{className:"border border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,c.jsxs)("div",{children:[(0,c.jsx)(iX,{level:5,className:"mb-0",children:t}),(0,c.jsx)(i0,{className:"text-gray-600",children:l})]})]}),r&&("Implementation Example"===t||"Configuration"===t)&&(0,c.jsxs)(I.Z.Item,{className:"mb-4",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(to.Z,{size:"small",checked:n,onChange:o}),(0,c.jsxs)(i0,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,c.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),n&&(0,c.jsx)(tJ.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,c.jsxs)("div",{children:[(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,c.jsxs)("code",{children:['["',r.replace(/\s+/g,"_"),'"]']})]}),(0,c.jsxs)("p",{children:[(0,c.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,c.jsx)("code",{children:'["dev-group"]'})]}),(0,c.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,c.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),d.Children.map(a,e=>{if(d.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return d.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(m(),null,8)))})}return e})]})};var i4=e=>{let{currentServerAccessGroups:s=[]}=e,t=(0,g.getProxyBaseUrl)(),[l,a]=(0,d.useState)({}),[r,i]=(0,d.useState)({openai:[],litellm:[],cursor:[],http:[]}),[n]=(0,d.useState)("Zapier_MCP"),o=async(e,s)=>{await eq(e)&&(a(e=>({...e,[s]:!0})),setTimeout(()=>{a(e=>({...e,[s]:!1}))},2e3))},m=e=>{let{code:s,copyKey:t,title:a,className:r=""}=e;return(0,c.jsxs)("div",{className:"relative group",children:[a&&(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(iG.Z,{size:16,className:"text-blue-600"}),(0,c.jsx)(i0,{strong:!0,className:"text-gray-700",children:a})]}),(0,c.jsxs)(tp.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(r),children:[(0,c.jsx)(T.ZP,{type:"text",size:"small",icon:l[t]?(0,c.jsx)(si.Z,{size:12}):(0,c.jsx)(sn.Z,{size:12}),onClick:()=>o(s,t),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(l[t]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,c.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},u=e=>{let{step:s,title:t,children:l}=e;return(0,c.jsxs)("div",{className:"flex gap-4",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsx)(i0,{strong:!0,className:"text-gray-800 block mb-2",children:t}),l]})]})};return(0,c.jsx)("div",{children:(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(k.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,c.jsx)(w.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,c.jsxs)(e$.Z,{className:"w-full",children:[(0,c.jsx)(eQ.Z,{className:"flex justify-start mt-8 mb-6",children:(0,c.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,c.jsx)(eW.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iG.Z,{size:18}),"OpenAI API"]})}),(0,c.jsx)(eW.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iH.Z,{size:18}),"LiteLLM Proxy"]})}),(0,c.jsx)(eW.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(i$.Z,{size:18}),"Cursor"]})}),(0,c.jsx)(eW.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,c.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,c.jsx)(iQ.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iG.Z,{className:"text-blue-600",size:24}),(0,c.jsx)(iX,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,c.jsx)(i0,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(i2,{icon:(0,c.jsx)(iJ.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,c.jsxs)(tW.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsxs)(i0,{children:["Get your API key from the"," ",(0,c.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,c.jsx)(iW.Z,{size:12})]})]})}),(0,c.jsx)(m,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iY.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"openai-server-url"})}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iG.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,c.jsx)(m,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(t,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,c.jsx)(eX.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iH.Z,{className:"text-emerald-600",size:24}),(0,c.jsx)(iX,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,c.jsx)(i0,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(i2,{icon:(0,c.jsx)(iJ.Z,{className:"text-emerald-600",size:16}),title:"API Key Setup",description:"Configure your LiteLLM Proxy API key for authentication",children:(0,c.jsxs)(tW.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsx)(i0,{children:"Get your API key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,c.jsx)(m,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iY.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"litellm-server-url"})}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iG.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:n,accessGroups:["dev"],children:(0,c.jsx)(m,{code:"curl --location '".concat(t,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_API_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(t,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,c.jsx)(eX.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(i$.Z,{className:"text-purple-600",size:24}),(0,c.jsx)(iX,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,c.jsx)(i0,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,c.jsxs)(tp.Z,{className:"border border-gray-200",children:[(0,c.jsx)(iX,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsx)(u,{step:1,title:"Open Cursor Settings",children:(0,c.jsxs)(i0,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,c.jsx)(u,{step:2,title:"Navigate to MCP Tools",children:(0,c.jsx)(i0,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,c.jsxs)(u,{step:3,title:"Add Configuration",children:[(0,c.jsxs)(i0,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or ",(0,c.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iG.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,c.jsx)(m,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "server_url": "'.concat(t,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,c.jsx)(eX.Z,{className:"mt-6",children:(0,c.jsx)(()=>(0,c.jsxs)(tW.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,c.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,c.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,c.jsx)(iQ.Z,{className:"text-green-600",size:24}),(0,c.jsx)(iX,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,c.jsx)(i0,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,c.jsx)(i2,{icon:(0,c.jsx)(iQ.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,c.jsxs)(tW.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,c.jsx)("div",{children:(0,c.jsx)(i0,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,c.jsx)(m,{title:"Server URL",code:"".concat(t,"/mcp"),copyKey:"http-server-url"}),(0,c.jsx)(m,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,c.jsx)("div",{className:"mt-4",children:(0,c.jsx)(T.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,c.jsx)(iW.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},i5=t(67187);let{Option:i6}=C.default,i3=e=>{let{isModalOpen:s,title:t,confirmDelete:l,cancelDelete:a}=e;return s?(0,c.jsx)(E.Z,{open:s,onOk:l,okType:"danger",onCancel:a,children:(0,c.jsxs)(v.Z,{numItems:1,className:"gap-2 w-full",children:[(0,c.jsx)(k.Z,{children:t}),(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)("p",{children:"Are you sure you want to delete this MCP Server?"})})]})}):null};var i8=e=>{let{accessToken:s,userRole:t,userID:l}=e,{data:a,isLoading:r,refetch:i}=(0,sm.a)({queryKey:["mcpServers"],queryFn:()=>{if(!s)throw Error("Access Token required");return(0,g.fetchMCPServers)(s)},enabled:!!s}),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(!1),[x,h]=(0,d.useState)(null),[p,j]=(0,d.useState)(!1),[f,v]=(0,d.useState)("all"),[y,b]=(0,d.useState)("all"),[N,Z]=(0,d.useState)([]),[S,I]=(0,d.useState)(!1),E="Internal User"===t,A=d.useMemo(()=>{if(!a)return[];let e=new Set,s=[];return a.forEach(t=>{t.teams&&t.teams.forEach(t=>{let l=t.team_id;e.has(l)||(e.add(l),s.push(t))})}),s},[a]),T=d.useMemo(()=>a?Array.from(new Set(a.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[a]),L=e=>{v(e),M(e,y)},O=e=>{b(e),M(f,e)},M=(e,s)=>{if(!a)return Z([]);let t=a;if("personal"===e){Z([]);return}"all"!==e&&(t=t.filter(s=>{var t;return null===(t=s.teams)||void 0===t?void 0:t.some(s=>s.team_id===e)})),"all"!==s&&(t=t.filter(e=>{var t;return null===(t=e.mcp_access_groups)||void 0===t?void 0:t.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),Z(t)};(0,d.useEffect)(()=>{M(f,y)},[a]);let D=d.useMemo(()=>iS(null!=t?t:"",e=>{h(e),j(!1)},e=>{h(e),j(!0)},F),[t]);function F(e){o(e),u(!0)}let R=async()=>{if(null!=n&&null!=s){try{await (0,g.deleteMCPServer)(s,n),P.ZP.success("Deleted MCP Server successfully"),i()}catch(e){console.error("Error deleting the mcp server:",e)}u(!1),o(null)}};return s&&t&&l?(0,c.jsxs)("div",{className:"w-full h-full p-6",children:[(0,c.jsx)(i3,{isModalOpen:m,title:"Delete MCP Server",confirmDelete:R,cancelDelete:()=>{u(!1),o(null)}}),(0,c.jsx)(iB,{userRole:t,accessToken:s,onCreateSuccess:e=>{Z(s=>[...s,e]),I(!1)},isModalVisible:S,setModalVisible:I,availableAccessGroups:T}),(0,c.jsx)(k.Z,{children:"MCP Servers"}),(0,c.jsx)(w.Z,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,eL.tY)(t)&&(0,c.jsx)(_.Z,{className:"mt-4 mb-4",onClick:()=>I(!0),children:"+ Add New MCP Server"}),(0,c.jsxs)(e$.Z,{className:"w-full h-full",children:[(0,c.jsx)(eQ.Z,{className:"flex justify-between mt-2 w-full items-center",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)(eW.Z,{children:"All Servers"}),(0,c.jsx)(eW.Z,{children:"Connect"})]})}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:(0,c.jsx)(()=>x?(0,c.jsx)(iR,{mcpServer:N.find(e=>e.server_id===x)||{server_id:"",alias:"",url:"",transport:"",spec_version:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{j(!1),h(null),i()},isProxyAdmin:(0,eL.tY)(t),isEditing:p,accessToken:s,userID:l,userRole:t,availableAccessGroups:T}):(0,c.jsxs)("div",{className:"w-full h-full",children:[(0,c.jsx)("div",{className:"w-full px-6",children:(0,c.jsx)("div",{className:"flex flex-col space-y-4",children:(0,c.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)(w.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,c.jsxs)(C.default,{value:f,onChange:L,style:{width:300},children:[(0,c.jsx)(i6,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:E?"All Available Servers":"All Servers"})]})}),(0,c.jsx)(i6,{value:"personal",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"Personal"})]})}),A.map(e=>(0,c.jsx)(i6,{value:e.team_id,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,c.jsxs)(w.Z,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,c.jsx)(z.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,c.jsx)(i5.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,c.jsxs)(C.default,{value:y,onChange:O,style:{width:300},children:[(0,c.jsx)(i6,{value:"all",children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),T.map(e=>(0,c.jsx)(i6,{value:e,children:(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[(0,c.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,c.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,c.jsx)("div",{className:"w-full px-6 mt-6",children:(0,c.jsx)(t8,{data:N,columns:D,renderSubComponent:()=>(0,c.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:r,noDataMessage:"No MCP servers configured"})})]}),{})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(i4,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:t,userID:l}),(0,c.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},i7=t(21770);function i9(e){let{tool:s,needsAuth:t,authValue:l,onSubmit:a,isLoading:r,result:i,error:n,onClose:o}=e,[m]=I.Z.useForm(),[u,x]=d.useState("formatted"),[h,p]=d.useState(null),[g,j]=d.useState(null),f=d.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),v=d.useMemo(()=>f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{type:"object",properties:f.properties.params.properties,required:f.properties.params.required||[]}:f,[f]);d.useEffect(()=>{h&&(i||n)&&j(Date.now()-h)},[i,n,h]);let b=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let t=document.execCommand("copy");if(document.body.removeChild(s),!t)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},N=async()=>{await b(JSON.stringify(i,null,2))?P.ZP.success("Result copied to clipboard"):P.ZP.error("Failed to copy result")},Z=async()=>{await b(s.name)?P.ZP.success("Tool name copied to clipboard"):P.ZP.error("Failed to copy tool name")};return(0,c.jsxs)("div",{className:"space-y-4 h-full",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,c.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,c.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,c.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:Z,title:"Click to copy tool name",children:[(0,c.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,c.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,c.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,c.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,c.jsx)(_.Z,{onClick:o,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,c.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,c.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,c.jsx)(z.Z,{title:"Configure the input parameters for this tool call",children:(0,c.jsx)(U.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,c.jsx)("div",{className:"p-4",children:(0,c.jsxs)(I.Z,{form:m,onFinish:e=>{p(Date.now()),j(null);let s={};Object.entries(e).forEach(e=>{var t;let[l,a]=e,r=null===(t=v.properties)||void 0===t?void 0:t[l];if(r&&null!=a&&""!==a)switch(r.type){case"boolean":s[l]="true"===a||!0===a;break;case"number":s[l]=Number(a);break;case"string":s[l]=String(a);break;default:s[l]=a}else null!=a&&""!==a&&(s[l]=a)}),a(f.properties&&f.properties.params&&"object"===f.properties.params.type&&f.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,c.jsx)("div",{className:"space-y-3",children:(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,c.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,c.jsx)(y.Z,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===v.properties?(0,c.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,c.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,c.jsx)("div",{className:"space-y-3",children:Object.entries(v.properties).map(e=>{var s,t,l,a,r;let[i,n]=e;return(0,c.jsxs)(I.Z.Item,{label:(0,c.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(s=v.required)||void 0===s?void 0:s.includes(i))&&(0,c.jsx)("span",{className:"text-red-500",children:"*"}),n.description&&(0,c.jsx)(z.Z,{title:n.description,children:(0,c.jsx)(U.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,rules:[{required:null===(t=v.required)||void 0===t?void 0:t.includes(i),message:"Please enter ".concat(i)}],className:"mb-3",children:["string"===n.type&&n.enum&&(0,c.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:n.default,children:[!(null===(l=v.required)||void 0===l?void 0:l.includes(i))&&(0,c.jsxs)("option",{value:"",children:["Select ",i]}),n.enum.map(e=>(0,c.jsx)("option",{value:e,children:e},e))]}),"string"===n.type&&!n.enum&&(0,c.jsx)(y.Z,{placeholder:n.description||"Enter ".concat(i),className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),"number"===n.type&&(0,c.jsx)("input",{type:"number",placeholder:n.description||"Enter ".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===n.type&&(0,c.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null===(a=n.default)||void 0===a?void 0:a.toString())||"",children:[!(null===(r=v.required)||void 0===r?void 0:r.includes(i))&&(0,c.jsxs)("option",{value:"",children:["Select ",i]}),(0,c.jsx)("option",{value:"true",children:"True"}),(0,c.jsx)("option",{value:"false",children:"False"})]})]},i)})}),(0,c.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,c.jsx)(_.Z,{onClick:()=>m.submit(),disabled:r,variant:"primary",className:"w-full",loading:r,children:r?"Calling Tool...":i||n?"Call Again":"Call Tool"})})]})})]}),(0,c.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,c.jsx)("div",{className:"p-4",children:i||n||r?(0,c.jsxs)("div",{className:"space-y-3",children:[i&&!r&&!n&&(0,c.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,c.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==g&&(0,c.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,c.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,c.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,c.jsx)("button",{onClick:()=>x("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,c.jsx)("button",{onClick:()=>x("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===u?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,c.jsx)("button",{onClick:N,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,c.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,c.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,c.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[r&&(0,c.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,c.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,c.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,c.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),n&&(0,c.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,c.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,c.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==g&&(0,c.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(g/1e3).toFixed(2),"s"]})]}),(0,c.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,c.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:n.message})})]})]})}),i&&!r&&!n&&(0,c.jsx)("div",{className:"space-y-3",children:"formatted"===u?i.map((e,s)=>(0,c.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,c.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let t=e.replace(/^#+\s/,"");return(0,c.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,c.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:t})},s)}let t=/(https?:\/\/[^\s\)]+)/g;if(t.test(e)){let l=e.split(t);return(0,c.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,c.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:l.map((e,s)=>t.test(e)?(0,c.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,c.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,c.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,c.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,c.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,c.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,c.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,c.jsx)("div",{className:"p-3",children:(0,c.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,c.jsxs)("div",{className:"flex-1",children:[(0,c.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,c.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,c.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,c.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,c.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,c.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,c.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,c.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(i,null,2)})})})})]})]}):(0,c.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,c.jsxs)("div",{className:"text-center max-w-sm",children:[(0,c.jsx)("div",{className:"mb-3",children:(0,c.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,c.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,c.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var ne=t(36724);let ns=e=>{let s,{visible:t,onOk:l,onCancel:a,authType:r}=e,[i]=I.Z.useForm();if(r===iP.API_KEY||r===iP.BEARER_TOKEN){let e=r===iP.API_KEY?"API Key":"Bearer Token";s=(0,c.jsx)(I.Z.Item,{name:"authValue",label:e,rules:[{required:!0,message:"Please input your ".concat(e)}],children:(0,c.jsx)(L.default.Password,{})})}else r===iP.BASIC&&(s=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I.Z.Item,{name:"username",label:"Username",rules:[{required:!0,message:"Please input your username"}],children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{name:"password",label:"Password",rules:[{required:!0,message:"Please input your password"}],children:(0,c.jsx)(L.default.Password,{})})]}));return(0,c.jsx)(E.Z,{open:t,title:"Authentication",onOk:()=>{i.validateFields().then(e=>{r===iP.BASIC?l("".concat(e.username.trim(),":").concat(e.password.trim())):l(e.authValue.trim())})},onCancel:a,destroyOnClose:!0,children:(0,c.jsx)(I.Z,{form:i,layout:"vertical",children:s})})},nt=e=>{let{authType:s,onAuthSubmit:t,hasAuth:l}=e,[a,r]=(0,d.useState)(!1);return(0,c.jsxs)("div",{className:"space-y-3",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)(ne.xv,{className:"text-sm font-medium text-gray-700",children:["Authentication ",l?"✓":""]}),(0,c.jsx)(ne.zx,{onClick:()=>r(!0),size:"sm",variant:"secondary",className:"text-xs",children:l?"Update":"Add Auth"})]}),(0,c.jsx)(ne.xv,{className:"text-xs text-gray-500",children:l?"Authentication configured":"Some tools may require authentication"}),(0,c.jsx)(ns,{visible:a,onOk:e=>{t(e),r(!1)},onCancel:()=>r(!1),authType:s})]})};var nl=e=>{let{serverId:s,accessToken:t,auth_type:l,userRole:a,userID:r}=e,[i,n]=(0,d.useState)(""),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)(null),{data:j,isLoading:f,error:v}=(0,sm.a)({queryKey:["mcpTools"],queryFn:()=>{if(!t)throw Error("Access Token required");return(0,g.listMCPTools)(t,s)},enabled:!!t}),{mutate:_,isPending:y}=(0,i7.D)({mutationFn:e=>{if(!t)throw Error("Access Token required");return(0,g.callMCPTool)(t,e.tool.name,e.arguments,e.authValue)},onSuccess:e=>{x(e),p(null)},onError:e=>{p(e),x(null)}}),b=(null==j?void 0:j.tools)||[],N=""!==i;return(0,c.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,c.jsx)(ne.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,c.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,c.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,c.jsx)(ne.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,c.jsxs)("div",{className:"flex flex-col flex-1 space-y-6",children:[(0,c.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,c.jsxs)(ne.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,c.jsx)(a4.Z,{className:"mr-2"})," Available Tools",b.length>0&&(0,c.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:b.length})]}),f&&(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,c.jsxs)("div",{className:"relative mb-3",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,c.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,c.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==j?void 0:j.error)&&(0,c.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,c.jsxs)("p",{className:"font-medium",children:["Error: ",j.message]})}),!f&&!(null==j?void 0:j.error)&&(!b||0===b.length)&&(0,c.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,c.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,c.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,c.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!f&&!(null==j?void 0:j.error)&&b.length>0&&(0,c.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:b.map(e=>(0,c.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==o?void 0:o.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{m(e),x(null),p(null)},children:[(0,c.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,c.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,c.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,c.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,c.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,c.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==o?void 0:o.name)===e.name&&(0,c.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,c.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,c.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]}),iL(l)&&(0,c.jsxs)("div",{className:"pt-4 border-t border-gray-200 flex-shrink-0",children:[(0,c.jsxs)(ne.xv,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,c.jsx)(a9.Z,{className:"mr-2"})," Authentication"]}),(0,c.jsx)(nt,{authType:l,onAuthSubmit:e=>n(e),hasAuth:N})]})]})]}),(0,c.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,c.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,c.jsx)(ne.Dx,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,c.jsx)("div",{className:"flex-1 overflow-auto p-4",children:o?(0,c.jsx)("div",{className:"h-full",children:(0,c.jsx)(i9,{tool:o,needsAuth:iL(l),authValue:i,onSubmit:e=>{_({tool:o,arguments:e,authValue:i})},result:u,error:h,isLoading:y,onClose:()=>m(null)})}):(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a3.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(ne.xv,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,c.jsx)(ne.xv,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})},na=t(57018),nr=e=>{let{tagId:s,onClose:t,accessToken:l,is_admin:a,editTag:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(r),[x,h]=(0,d.useState)([]),p=async()=>{if(l)try{let e=(await (0,g.tagInfoCall)(l,[s]))[s];e&&(o(e),r&&i.setFieldsValue({name:e.name,description:e.description,models:e.models}))}catch(e){console.error("Error fetching tag details:",e),P.ZP.error("Error fetching tag details: "+e)}};(0,d.useEffect)(()=>{p()},[s,l]),(0,d.useEffect)(()=>{l&&eK("dummy-user","Admin",l,h)},[l]);let j=async e=>{if(l)try{await (0,g.tagUpdateCall)(l,{name:e.name,description:e.description,models:e.models}),P.ZP.success("Tag updated successfully"),u(!1),p()}catch(e){console.error("Error updating tag:",e),P.ZP.error("Error updating tag: "+e)}};return n?(0,c.jsxs)("div",{className:"p-4",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(na.zx,{onClick:t,className:"mb-4",children:"← Back to Tags"}),(0,c.jsxs)(na.Dx,{children:["Tag Name: ",n.name]}),(0,c.jsx)(na.xv,{className:"text-gray-500",children:n.description||"No description"})]}),a&&!m&&(0,c.jsx)(na.zx,{onClick:()=>u(!0),children:"Edit Tag"})]}),m?(0,c.jsx)(na.Zb,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:j,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{label:"Tag Name",name:"name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed LLMs"," ",(0,c.jsx)(z.Z,{title:"Select which LLMs are allowed to process this type of data",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select LLMs",children:x.map(e=>(0,c.jsx)(C.default.Option,{value:e,children:F(e)},e))})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(na.zx,{onClick:()=>u(!1),children:"Cancel"}),(0,c.jsx)(na.zx,{type:"submit",children:"Save Changes"})]})]})}):(0,c.jsx)("div",{className:"space-y-6",children:(0,c.jsxs)(na.Zb,{children:[(0,c.jsx)(na.Dx,{children:"Tag Details"}),(0,c.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Name"}),(0,c.jsx)(na.xv,{children:n.name})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Description"}),(0,c.jsx)(na.xv,{children:n.description||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Allowed LLMs"}),(0,c.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:0===n.models.length?(0,c.jsx)(na.Ct,{color:"red",children:"All Models"}):n.models.map(e=>{var s;return(0,c.jsx)(na.Ct,{color:"blue",children:(0,c.jsx)(z.Z,{title:"ID: ".concat(e),children:(null===(s=n.model_info)||void 0===s?void 0:s[e])||e})},e)})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Created"}),(0,c.jsx)(na.xv,{children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(na.xv,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(na.xv,{children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]})]})]})})]}):(0,c.jsx)("div",{children:"Loading..."})},ni=e=>{let{data:s,onEdit:t,onDelete:l,onSelectTag:a}=e,[r,i]=d.useState([{id:"created_at",desc:!0}]),n=[{header:"Tag Name",accessorKey:"name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("div",{className:"overflow-hidden",children:(0,c.jsx)(z.Z,{title:t.name,children:(0,c.jsx)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5",onClick:()=>a(t.name),children:t.name})})})}},{header:"Description",accessorKey:"description",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.description,children:(0,c.jsx)("span",{className:"text-xs",children:t.description||"-"})})}},{header:"Allowed LLMs",accessorKey:"models",cell:e=>{var s,t;let{row:l}=e,a=l.original;return(0,c.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:(null==a?void 0:null===(s=a.models)||void 0===s?void 0:s.length)===0?(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"red",children:"All Models"}):null==a?void 0:null===(t=a.models)||void 0===t?void 0:t.map(e=>{var s;return(0,c.jsx)(eY.Z,{size:"xs",className:"mb-1",color:"blue",children:(0,c.jsx)(z.Z,{title:"ID: ".concat(e),children:(0,c.jsx)(w.Z,{children:(null===(s=a.model_info)||void 0===s?void 0:s[e])||e})})},e)})})}},{header:"Created",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,a=s.original;return(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>t(a),className:"cursor-pointer"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>l(a.name),className:"cursor-pointer"})]})}}],o=(0,sg.b7)({data:s,columns:n,state:{sorting:r},onSortingChange:i,getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0});return(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sv.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sb.Z,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(sZ.Z,{children:e.headers.map(e=>(0,c.jsx)(sN.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(s_.Z,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsx)(sZ.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(sy.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:n.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No tags found"})})})})})]})})})},nn=e=>{let{accessToken:s,userID:t,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(null),[u,x]=(0,d.useState)(!1),[h,p]=(0,d.useState)(!1),[j,b]=(0,d.useState)(null),[N,Z]=(0,d.useState)(""),[k]=I.Z.useForm(),[S,A]=(0,d.useState)([]),T=async()=>{if(s)try{let e=await (0,g.tagListCall)(s);console.log("List tags response:",e),r(Object.values(e))}catch(e){console.error("Error fetching tags:",e),P.ZP.error("Error fetching tags: "+e)}},O=async e=>{if(s)try{await (0,g.tagCreateCall)(s,{name:e.tag_name,description:e.description,models:e.allowed_llms}),P.ZP.success("Tag created successfully"),n(!1),k.resetFields(),T()}catch(e){console.error("Error creating tag:",e),P.ZP.error("Error creating tag: "+e)}},M=async e=>{b(e),p(!0)},D=async()=>{if(s&&j){try{await (0,g.tagDeleteCall)(s,j),P.ZP.success("Tag deleted successfully"),T()}catch(e){console.error("Error deleting tag:",e),P.ZP.error("Error deleting tag: "+e)}p(!1),b(null)}};return(0,d.useEffect)(()=>{t&&l&&s&&(async()=>{try{let e=await (0,g.modelInfoCall)(s,t,l);e&&e.data&&A(e.data)}catch(e){console.error("Error fetching models:",e),P.ZP.error("Error fetching models: "+e)}})()},[s,t,l]),(0,d.useEffect)(()=>{T()},[s]),(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:o?(0,c.jsx)(nr,{tagId:o,onClose:()=>{m(null),x(!1)},accessToken:s,is_admin:"Admin"===l,editTag:u}):(0,c.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,c.jsx)("h1",{children:"Tag Management"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[N&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",N]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{T(),Z(new Date().toLocaleString())}})]})]}),(0,c.jsxs)(w.Z,{className:"mb-4",children:["Click on a tag name to view and edit its details.",(0,c.jsxs)("p",{children:["You can use tags to restrict the usage of certain LLMs based on tags passed in the request. Read more about tag routing ",(0,c.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/tag_routing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})]}),(0,c.jsx)(_.Z,{className:"mb-4",onClick:()=>n(!0),children:"+ Create New Tag"}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(ni,{data:a,onEdit:e=>{m(e.name),x(!0)},onDelete:M,onSelectTag:m})})}),(0,c.jsx)(E.Z,{title:"Create New Tag",visible:i,width:800,footer:null,onCancel:()=>{n(!1),k.resetFields()},children:(0,c.jsxs)(I.Z,{form:k,onFinish:O,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:"Tag Name",name:"tag_name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Allowed Models"," ",(0,c.jsx)(z.Z,{title:"Select which LLMs are allowed to process requests from this tag",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_llms",children:(0,c.jsx)(C.default,{mode:"multiple",placeholder:"Select LLMs",children:S.map(e=>(0,c.jsx)(C.default.Option,{value:e.model_info.id,children:(0,c.jsxs)("div",{children:[(0,c.jsx)("span",{children:e.model_name}),(0,c.jsxs)("span",{className:"text-gray-400 ml-2",children:["(",e.model_info.id,")"]})]})},e.model_info.id))})}),(0,c.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,c.jsx)(_.Z,{type:"submit",children:"Create Tag"})})]})}),h&&(0,c.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,c.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,c.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,c.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,c.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,c.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,c.jsx)("div",{className:"sm:flex sm:items-start",children:(0,c.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,c.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Tag"}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this tag?"})})]})})}),(0,c.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:D,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:()=>{p(!1),b(null)},children:"Cancel"})]})]})]})})]})})},no=e=>{let{data:s,onView:t,onEdit:l,onDelete:a}=e,[r,i]=d.useState([{id:"created_at",desc:!0}]),n=[{header:"Vector Store ID",accessorKey:"vector_store_id",cell:e=>{let{row:s}=e,l=s.original;return(0,c.jsx)("button",{onClick:()=>t(l.vector_store_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:l.vector_store_id.length>15?"".concat(l.vector_store_id.slice(0,15),"..."):l.vector_store_id})}},{header:"Name",accessorKey:"vector_store_name",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.vector_store_name,children:(0,c.jsx)("span",{className:"text-xs",children:t.vector_store_name||"-"})})}},{header:"Description",accessorKey:"vector_store_description",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)(z.Z,{title:t.vector_store_description,children:(0,c.jsx)("span",{className:"text-xs",children:t.vector_store_description||"-"})})}},{header:"Provider",accessorKey:"custom_llm_provider",cell:e=>{let{row:s}=e,t=s.original,{displayName:l,logo:a}=(0,sO.dr)(t.custom_llm_provider);return(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,c.jsx)("img",{src:a,alt:l,className:"h-4 w-4"}),(0,c.jsx)("span",{className:"text-xs",children:l})]})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsx)("span",{className:"text-xs",children:new Date(t.updated_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:s}=e,t=s.original;return(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)(sf.Z,{icon:sF.Z,size:"sm",onClick:()=>l(t.vector_store_id),className:"cursor-pointer"}),(0,c.jsx)(sf.Z,{icon:el.Z,size:"sm",onClick:()=>a(t.vector_store_id),className:"cursor-pointer"})]})}}],o=(0,sg.b7)({data:s,columns:n,state:{sorting:r},onSortingChange:i,getCoreRowModel:(0,sj.sC)(),getSortedRowModel:(0,sj.tj)(),enableSorting:!0});return(0,c.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,c.jsx)("div",{className:"overflow-x-auto",children:(0,c.jsxs)(sv.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,c.jsx)(sb.Z,{children:o.getHeaderGroups().map(e=>(0,c.jsx)(sZ.Z,{children:e.headers.map(e=>(0,c.jsx)(sN.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,sg.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,c.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,c.jsx)(sS.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,c.jsx)(sw.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,c.jsx)(sC.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,c.jsx)(s_.Z,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,c.jsx)(sZ.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,c.jsx)(sy.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,sg.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,c.jsx)(sZ.Z,{children:(0,c.jsx)(sy.Z,{colSpan:n.length,className:"h-8 text-center",children:(0,c.jsx)("div",{className:"text-center text-gray-500",children:(0,c.jsx)("p",{children:"No vector stores found"})})})})})]})})})};(r=o||(o={})).Bedrock="Amazon Bedrock",r.PgVector="PostgreSQL pgvector (LiteLLM Connector)",r.VertexRagEngine="Vertex AI RAG Engine",r.OpenAI="OpenAI",r.Azure="Azure OpenAI";let nc={Bedrock:"bedrock",PgVector:"pg_vector",VertexRagEngine:"vertex_ai",OpenAI:"openai",Azure:"azure"},nd="/ui/assets/logos/",nm={"Amazon Bedrock":"".concat(nd,"bedrock.svg"),"PostgreSQL pgvector (LiteLLM Connector)":"".concat(nd,"postgresql.svg"),"Vertex AI RAG Engine":"".concat(nd,"google.svg"),OpenAI:"".concat(nd,"openai_small.svg"),"Azure OpenAI":"".concat(nd,"microsoft_azure.svg")},nu={bedrock:[],pg_vector:[{name:"api_base",label:"API Base",tooltip:"Enter the base URL of your deployed litellm-pgvector server (e.g., http://your-server:8000)",placeholder:"http://your-deployed-server:8000",required:!0,type:"text"},{name:"api_key",label:"API Key",tooltip:"Enter the API key from your deployed litellm-pgvector server",placeholder:"your-deployed-api-key",required:!0,type:"password"}],vertex_rag_engine:[],openai:[{name:"api_key",label:"API Key",tooltip:"Enter your OpenAI API key",placeholder:"sk-...",required:!0,type:"password"}],azure:[{name:"api_key",label:"API Key",tooltip:"Enter your Azure OpenAI API key",placeholder:"your-azure-api-key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Azure OpenAI endpoint (e.g., https://your-resource.openai.azure.com/)",placeholder:"https://your-resource.openai.azure.com/",required:!0,type:"text"}]},nx=e=>nu[e]||[];var nh=e=>{let{isVisible:s,onCancel:t,onSuccess:l,accessToken:a,credentials:r}=e,[i]=I.Z.useForm(),[n,m]=(0,d.useState)("{}"),[u,x]=(0,d.useState)("bedrock"),h=async e=>{if(a)try{let s={};try{s=n.trim()?JSON.parse(n):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:s,litellm_credential_name:e.litellm_credential_name},r=nx(e.custom_llm_provider).reduce((s,t)=>(s[t.name]=e[t.name],s),{});t.litellm_params=r,await (0,g.vectorStoreCreateCall)(a,t),P.ZP.success("Vector store created successfully"),i.resetFields(),m("{}"),l()}catch(e){console.error("Error creating vector store:",e),P.ZP.error("Error creating vector store: "+e)}},p=()=>{i.resetFields(),m("{}"),x("bedrock"),t()};return(0,c.jsx)(E.Z,{title:"Add New Vector Store",visible:s,width:1e3,footer:null,onCancel:p,children:(0,c.jsxs)(I.Z,{form:i,onFinish:h,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Provider"," ",(0,c.jsx)(z.Z,{title:"Select the provider for this vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],initialValue:"bedrock",children:(0,c.jsx)(C.default,{onChange:e=>x(e),children:Object.entries(o).map(e=>{let[s,t]=e;return(0,c.jsx)(C.default.Option,{value:nc[s],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:nm[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s)})})}),"pg_vector"===u&&(0,c.jsx)(tJ.Z,{message:"PG Vector Setup Required",description:(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"LiteLLM provides a server to connect to PG Vector. To use this provider:"}),(0,c.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,c.jsxs)("li",{children:["Deploy the litellm-pgvector server from: ",(0,c.jsx)("a",{href:"https://github.com/BerriAI/litellm-pgvector",target:"_blank",rel:"noopener noreferrer",children:"https://github.com/BerriAI/litellm-pgvector"})]}),(0,c.jsx)("li",{children:"Configure your PostgreSQL database with pgvector extension"}),(0,c.jsx)("li",{children:"Start the server and note the API base URL and API key"}),(0,c.jsx)("li",{children:"Enter those details in the fields below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_rag_engine"===u&&(0,c.jsx)(tJ.Z,{message:"Vertex AI RAG Engine Setup",description:(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{children:"To use Vertex AI RAG Engine:"}),(0,c.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,c.jsxs)("li",{children:["Set up your Vertex AI RAG Engine corpus following the guide: ",(0,c.jsx)("a",{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-overview",target:"_blank",rel:"noopener noreferrer",children:"Vertex AI RAG Engine Overview"})]}),(0,c.jsx)("li",{children:"Create a corpus in your Google Cloud project"}),(0,c.jsx)("li",{children:"Note the corpus ID from the Vertex AI console"}),(0,c.jsx)("li",{children:"Enter the corpus ID in the Vector Store ID field below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Vector Store ID"," ",(0,c.jsx)(z.Z,{title:"Enter the vector store ID from your api provider",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_id",rules:[{required:!0,message:"Please input the vector store ID from your api provider"}],children:(0,c.jsx)(y.Z,{placeholder:"vertex_rag_engine"===u?"6917529027641081856 (Get corpus ID from Vertex AI console)":"Enter vector store ID from your provider"})}),nx(u).map(e=>(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:[e.label," ",(0,c.jsx)(z.Z,{title:e.tooltip,children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:e.name,rules:e.required?[{required:!0,message:"Please input the ".concat(e.label.toLowerCase())}]:[],children:(0,c.jsx)(y.Z,{type:e.type||"text",placeholder:e.placeholder})},e.name)),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Vector Store Name"," ",(0,c.jsx)(z.Z,{title:"Custom name you want to give to the vector store, this name will be rendered on the LiteLLM UI",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_name",children:(0,c.jsx)(y.Z,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"vector_store_description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Existing Credentials"," ",(0,c.jsx)(z.Z,{title:"Optionally select API provider credentials for this vector store eg. Bedrock API KEY",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...r.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON metadata for the vector store (optional)",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),children:(0,c.jsx)(L.default.TextArea,{rows:4,value:n,onChange:e=>m(e.target.value),placeholder:'{"key": "value"}'})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,c.jsx)(_.Z,{onClick:p,variant:"secondary",children:"Cancel"}),(0,c.jsx)(_.Z,{variant:"primary",type:"submit",children:"Create"})]})]})})},np=e=>{let{isVisible:s,onCancel:t,onConfirm:l}=e;return(0,c.jsxs)(E.Z,{title:"Delete Vector Store",visible:s,footer:null,onCancel:t,children:[(0,c.jsx)("p",{children:"Are you sure you want to delete this vector store? This action cannot be undone."}),(0,c.jsxs)("div",{className:"px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,c.jsx)(_.Z,{onClick:l,color:"red",className:"ml-2",children:"Delete"}),(0,c.jsx)(_.Z,{onClick:t,variant:"primary",children:"Cancel"})]})]})};let{TextArea:ng}=L.default,{Text:nj,Title:nf}=eh.default;var nv=e=>{let{vectorStoreId:s,accessToken:t,className:l=""}=e,[a,r]=(0,d.useState)(""),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)([]),[u,x]=(0,d.useState)({}),h=async()=>{if(!a.trim()){P.ZP.warning("Please enter a search query");return}n(!0);try{let e=await (0,g.vectorStoreSearchCall)(t,s,a),l={query:a,response:e,timestamp:Date.now()};m(e=>[l,...e]),r("")}catch(e){console.error("Error searching vector store:",e),P.ZP.error("Failed to search vector store")}finally{n(!1)}},p=e=>new Date(e).toLocaleString(),j=(e,s)=>{let t="".concat(e,"-").concat(s);x(e=>({...e,[t]:!e[t]}))};return(0,c.jsx)(tp.Z,{className:"w-full rounded-xl shadow-md",children:(0,c.jsxs)("div",{className:"flex flex-col h-[600px]",children:[(0,c.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,c.jsxs)("div",{className:"flex items-center",children:[(0,c.jsx)(a7.Z,{className:"mr-2 text-blue-500"}),(0,c.jsx)(nf,{level:4,className:"mb-0",children:"Test Vector Store"})]}),o.length>0&&(0,c.jsx)(T.ZP,{onClick:()=>{m([]),x({}),P.ZP.success("Search history cleared")},size:"small",children:"Clear History"})]}),(0,c.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===o.length?(0,c.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,c.jsx)(a7.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,c.jsx)(nj,{children:"Test your vector store by entering a search query below"})]}):(0,c.jsx)("div",{className:"space-y-4",children:o.map((e,s)=>{var t;return(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("div",{className:"text-right",children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-blue-50 border border-blue-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,c.jsx)("strong",{className:"text-sm",children:"Query"}),(0,c.jsx)("span",{className:"text-xs text-gray-500",children:p(e.timestamp)})]}),(0,c.jsx)("div",{className:"text-left",children:e.query})]})}),(0,c.jsx)("div",{className:"text-left",children:(0,c.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-white border border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,c.jsx)(a7.Z,{className:"text-green-500"}),(0,c.jsx)("strong",{className:"text-sm",children:"Vector Store Results"}),e.response&&(0,c.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600",children:[(null===(t=e.response.data)||void 0===t?void 0:t.length)||0," results"]})]}),e.response&&e.response.data&&e.response.data.length>0?(0,c.jsx)("div",{className:"space-y-3",children:e.response.data.map((e,t)=>{let l=u["".concat(s,"-").concat(t)]||!1;return(0,c.jsxs)("div",{className:"border rounded-lg overflow-hidden bg-gray-50",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>j(s,t),children:[(0,c.jsxs)("div",{className:"flex items-center",children:[l?(0,c.jsx)(tg.Z,{className:"text-gray-500 mr-2"}):(0,c.jsx)(tQ.Z,{className:"text-gray-500 mr-2"}),(0,c.jsxs)("span",{className:"font-medium text-sm",children:["Result ",t+1]}),!l&&e.content&&e.content[0]&&(0,c.jsxs)("span",{className:"ml-2 text-xs text-gray-500 truncate max-w-md",children:["- ",e.content[0].text.substring(0,100),"..."]})]}),(0,c.jsxs)("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:["Score: ",e.score.toFixed(4)]})]}),l&&(0,c.jsxs)("div",{className:"border-t bg-white p-3",children:[e.content&&e.content.map((e,s)=>(0,c.jsxs)("div",{className:"mb-3",children:[(0,c.jsxs)("div",{className:"text-xs text-gray-500 mb-1",children:["Content (",e.type,")"]}),(0,c.jsx)("div",{className:"text-sm bg-gray-50 p-3 rounded border text-gray-800 max-h-40 overflow-y-auto",children:e.text})]},s)),(e.file_id||e.filename||e.attributes)&&(0,c.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[(0,c.jsx)("div",{className:"text-xs text-gray-500 mb-2 font-medium",children:"Metadata"}),(0,c.jsxs)("div",{className:"space-y-2 text-xs",children:[e.file_id&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium",children:"File ID:"})," ",e.file_id]}),e.filename&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium",children:"Filename:"})," ",e.filename]}),e.attributes&&Object.keys(e.attributes).length>0&&(0,c.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,c.jsx)("span",{className:"font-medium block mb-1",children:"Attributes:"}),(0,c.jsx)("pre",{className:"text-xs bg-white p-2 rounded border overflow-x-auto",children:JSON.stringify(e.attributes,null,2)})]})]})]})]})]},t)})}):(0,c.jsx)("div",{className:"text-gray-500 text-sm",children:"No results found"})]})}),s<o.length-1&&(0,c.jsx)(Q.Z,{})]},s)})}),i&&(0,c.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,c.jsx)(lu.Z,{indicator:(0,c.jsx)(a6.Z,{style:{fontSize:24},spin:!0})})})]}),(0,c.jsx)("div",{className:"p-4 border-t border-gray-200 bg-white",children:(0,c.jsxs)("div",{className:"flex items-end space-x-2",children:[(0,c.jsx)("div",{className:"flex-1",children:(0,c.jsx)(ng,{value:a,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),h())},placeholder:"Enter your search query... (Shift+Enter for new line)",disabled:i,autoSize:{minRows:1,maxRows:4},style:{resize:"none"}})}),(0,c.jsx)(T.ZP,{type:"primary",onClick:h,disabled:i||!a.trim(),icon:(0,c.jsx)(ra.Z,{}),loading:i,children:"Search"})]})})]})})},n_=e=>{let{vectorStoreId:s,onClose:t,accessToken:l,is_admin:a,editVectorStore:r}=e,[i]=I.Z.useForm(),[n,o]=(0,d.useState)(null),[m,u]=(0,d.useState)(r),[x,h]=(0,d.useState)("{}"),[p,j]=(0,d.useState)([]),[f,v]=(0,d.useState)("details"),y=async()=>{if(l)try{let e=await (0,g.vectorStoreInfoCall)(l,s);if(e&&e.vector_store){if(o(e.vector_store),e.vector_store.vector_store_metadata){let s="string"==typeof e.vector_store.vector_store_metadata?JSON.parse(e.vector_store.vector_store_metadata):e.vector_store.vector_store_metadata;h(JSON.stringify(s,null,2))}r&&i.setFieldsValue({vector_store_id:e.vector_store.vector_store_id,custom_llm_provider:e.vector_store.custom_llm_provider,vector_store_name:e.vector_store.vector_store_name,vector_store_description:e.vector_store.vector_store_description})}}catch(e){console.error("Error fetching vector store details:",e),P.ZP.error("Error fetching vector store details: "+e)}},b=async()=>{if(l)try{let e=await (0,g.credentialListCall)(l);console.log("List credentials response:",e),j(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e)}};(0,d.useEffect)(()=>{y(),b()},[s,l]);let N=async e=>{if(l)try{let s={};try{s=x?JSON.parse(x):{}}catch(e){P.ZP.error("Invalid JSON in metadata field");return}let t={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:s};await (0,g.vectorStoreUpdateCall)(l,t),P.ZP.success("Vector store updated successfully"),u(!1),y()}catch(e){console.error("Error updating vector store:",e),P.ZP.error("Error updating vector store: "+e)}};return n?(0,c.jsxs)("div",{className:"p-4 max-w-full",children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(_.Z,{icon:e1.Z,variant:"light",className:"mb-4",onClick:t,children:"Back to Vector Stores"}),(0,c.jsxs)(k.Z,{children:["Vector Store ID: ",n.vector_store_id]}),(0,c.jsx)(w.Z,{className:"text-gray-500",children:n.vector_store_description||"No description"})]}),a&&!m&&(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Vector Store"})]}),(0,c.jsxs)(e$.Z,{children:[(0,c.jsxs)(eQ.Z,{className:"mb-6",children:[(0,c.jsx)(eW.Z,{children:"Details"}),(0,c.jsx)(eW.Z,{children:"Test Vector Store"})]}),(0,c.jsxs)(e0.Z,{children:[(0,c.jsx)(eX.Z,{children:m?(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,c.jsx)(k.Z,{children:"Edit Vector Store"})}),(0,c.jsx)(X.Z,{children:(0,c.jsxs)(I.Z,{form:i,onFinish:N,layout:"vertical",initialValues:n,children:[(0,c.jsx)(I.Z.Item,{label:"Vector Store ID",name:"vector_store_id",rules:[{required:!0,message:"Please input a vector store ID"}],children:(0,c.jsx)(L.default,{disabled:!0})}),(0,c.jsx)(I.Z.Item,{label:"Vector Store Name",name:"vector_store_name",children:(0,c.jsx)(L.default,{})}),(0,c.jsx)(I.Z.Item,{label:"Description",name:"vector_store_description",children:(0,c.jsx)(L.default.TextArea,{rows:4})}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Provider"," ",(0,c.jsx)(z.Z,{title:"Select the provider for this vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,c.jsx)(C.default,{children:Object.entries(sO.Cl).map(e=>{let[s,t]=e;return"Bedrock"===s?(0,c.jsx)(C.default.Option,{value:sO.fK[s],children:(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("img",{src:sO.cd[t],alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let s=e.target,l=s.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),l.replaceChild(e,s)}}}),(0,c.jsx)("span",{children:t})]})},s):null})})}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsx)(w.Z,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter provider credentials below"})}),(0,c.jsx)(I.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,c.jsx)(C.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,s)=>{var t;return(null!==(t=null==s?void 0:s.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...p.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,c.jsxs)("div",{className:"flex items-center my-4",children:[(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,c.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,c.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,c.jsx)(I.Z.Item,{label:(0,c.jsxs)("span",{children:["Metadata"," ",(0,c.jsx)(z.Z,{title:"JSON metadata for the vector store",children:(0,c.jsx)(U.Z,{style:{marginLeft:"4px"}})})]}),children:(0,c.jsx)(L.default.TextArea,{rows:4,value:x,onChange:e=>h(e.target.value),placeholder:'{"key": "value"}'})}),(0,c.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,c.jsx)(T.ZP,{onClick:()=>u(!1),children:"Cancel"}),(0,c.jsx)(T.ZP,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]})})]}):(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,c.jsx)(k.Z,{children:"Vector Store Details"}),a&&(0,c.jsx)(_.Z,{onClick:()=>u(!0),children:"Edit Vector Store"})]}),(0,c.jsx)(X.Z,{children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"ID"}),(0,c.jsx)(w.Z,{children:n.vector_store_id})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Name"}),(0,c.jsx)(w.Z,{children:n.vector_store_name||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Description"}),(0,c.jsx)(w.Z,{children:n.vector_store_description||"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Provider"}),(0,c.jsx)("div",{className:"flex items-center space-x-2 mt-1",children:(()=>{let e=n.custom_llm_provider||"bedrock",{displayName:s,logo:t}=(()=>{let s=Object.keys(sO.fK).find(s=>sO.fK[s].toLowerCase()===e.toLowerCase());if(!s)return{displayName:e,logo:""};let t=sO.Cl[s],l=sO.cd[t];return{displayName:t,logo:l}})();return(0,c.jsxs)(c.Fragment,{children:[t&&(0,c.jsx)("img",{src:t,alt:"".concat(s," logo"),className:"w-5 h-5",onError:e=>{let t=e.target,l=t.parentElement;if(l){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=s.charAt(0),l.replaceChild(e,t)}}}),(0,c.jsx)(eY.Z,{color:"blue",children:s})]})})()})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Metadata"}),(0,c.jsx)("div",{className:"bg-gray-50 p-3 rounded mt-2 font-mono text-xs overflow-auto max-h-48",children:(0,c.jsx)("pre",{children:x})})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Created"}),(0,c.jsx)(w.Z,{children:n.created_at?new Date(n.created_at).toLocaleString():"-"})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)(w.Z,{className:"font-medium",children:"Last Updated"}),(0,c.jsx)(w.Z,{children:n.updated_at?new Date(n.updated_at).toLocaleString():"-"})]})]})})]})}),(0,c.jsx)(eX.Z,{children:(0,c.jsx)(nv,{vectorStoreId:n.vector_store_id,accessToken:l||""})})]})]})]}):(0,c.jsx)("div",{children:"Loading..."})},ny=e=>{let{accessToken:s,userID:t,userRole:l}=e,[a,r]=(0,d.useState)([]),[i,n]=(0,d.useState)(!1),[o,m]=(0,d.useState)(!1),[u,x]=(0,d.useState)(null),[h,p]=(0,d.useState)(""),[j,y]=(0,d.useState)([]),[b,N]=(0,d.useState)(null),[Z,k]=(0,d.useState)(!1),S=async()=>{if(s)try{let e=await (0,g.vectorStoreListCall)(s);console.log("List vector stores response:",e),r(e.data||[])}catch(e){console.error("Error fetching vector stores:",e),P.ZP.error("Error fetching vector stores: "+e)}},C=async()=>{if(s)try{let e=await (0,g.credentialListCall)(s);console.log("List credentials response:",e),y(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e),P.ZP.error("Error fetching credentials: "+e)}},I=async e=>{x(e),m(!0)},E=async()=>{if(s&&u){try{await (0,g.vectorStoreDeleteCall)(s,u),P.ZP.success("Vector store deleted successfully"),S()}catch(e){console.error("Error deleting vector store:",e),P.ZP.error("Error deleting vector store: "+e)}m(!1),x(null)}};return(0,d.useEffect)(()=>{S(),C()},[s]),b?(0,c.jsx)("div",{className:"w-full h-full",children:(0,c.jsx)(n_,{vectorStoreId:b,onClose:()=>{N(null),k(!1),S()},accessToken:s,is_admin:(0,eL.tY)(l||""),editVectorStore:Z})}):(0,c.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,c.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,c.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,c.jsx)("h1",{children:"Vector Store Management"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[h&&(0,c.jsxs)(w.Z,{children:["Last Refreshed: ",h]}),(0,c.jsx)(sf.Z,{icon:e2.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{S(),C(),p(new Date().toLocaleString())}})]})]}),(0,c.jsx)(w.Z,{className:"mb-4",children:(0,c.jsx)("p",{children:"You can use vector stores to store and retrieve LLM embeddings.."})}),(0,c.jsx)(_.Z,{className:"mb-4",onClick:()=>n(!0),children:"+ Add Vector Store"}),(0,c.jsx)(v.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,c.jsx)(f.Z,{numColSpan:1,children:(0,c.jsx)(no,{data:a,onView:e=>{N(e),k(!1)},onEdit:e=>{N(e),k(!0)},onDelete:I})})}),(0,c.jsx)(nh,{isVisible:i,onCancel:()=>n(!1),onSuccess:()=>{n(!1),S()},accessToken:s,credentials:j}),(0,c.jsx)(np,{isVisible:o,onCancel:()=>m(!1),onConfirm:E})]})})},nb=t(49096),nN=t(53335);let{cva:nZ,cx:nw,compose:nk}=(0,nb.ZD)({hooks:{onComplete:e=>(0,nN.m6)(e)}});function nS(e){var s,t;let{className:l="",...a}=e,r=(0,d.useId)();return s=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),s=e.find(e=>{var s;return(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))===r}),t=e.find(e=>{var s;return e.effect instanceof KeyframeEffect&&(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))!==r});s&&t&&(s.currentTime=t.currentTime)},t=[r],(0,d.useLayoutEffect)(s,t),(0,c.jsxs)("svg",{"data-spinner-id":r,className:nw("pointer-events-none size-12 animate-spin text-current",l),fill:"none",viewBox:"0 0 24 24",...a,children:[(0,c.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,c.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}let nC=new x.S;function nI(){return(0,c.jsxs)("div",{className:nw("h-screen","flex items-center justify-center gap-4"),children:[(0,c.jsx)("div",{className:"text-lg font-medium py-2 pr-4 border-r border-r-gray-200",children:"\uD83D\uDE85 LiteLLM"}),(0,c.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,c.jsx)(nS,{className:"size-4"}),(0,c.jsx)("span",{className:"text-gray-600 text-sm",children:"Loading..."})]})]})}function nP(){let[e,s]=(0,d.useState)(""),[t,l]=(0,d.useState)(!1),[a,r]=(0,d.useState)(!1),[i,n]=(0,d.useState)(null),[o,x]=(0,d.useState)(null),[f,v]=(0,d.useState)([]),[_,y]=(0,d.useState)([]),[b,N]=(0,d.useState)([]),[Z,w]=(0,d.useState)({PROXY_BASE_URL:"",PROXY_LOGOUT_URL:""}),[k,S]=(0,d.useState)(!0),C=(0,m.useSearchParams)(),[I,P]=(0,d.useState)({data:[]}),[E,A]=(0,d.useState)(null),[T,L]=(0,d.useState)(!1),[O,M]=(0,d.useState)(!0),[D,F]=(0,d.useState)(null),R=C.get("invitation_id"),[q,U]=(0,d.useState)(()=>C.get("page")||"api-keys"),[z,V]=(0,d.useState)(null),K=e=>{v(s=>s?[...s,e]:[e]),L(()=>!T)},B=!1===O&&null===E&&null===R;return((0,d.useEffect)(()=>{let e=function(e){let s=document.cookie.split("; ").find(s=>s.startsWith(e+"="));return s?s.split("=")[1]:null}("token");(0,g.getUiConfig)().then(s=>{A(e),M(!1)})},[]),(0,d.useEffect)(()=>{B&&(window.location.href=(g.proxyBaseUrl||"")+"/sso/key/generate")},[B]),(0,d.useEffect)(()=>{if(!E)return;let e=(0,u.o)(E);if(e){if(V(e.key),r(e.disabled_non_admin_personal_key_creation),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(e.user_role);s(t),"Admin Viewer"==t&&U("usage")}e.user_email&&n(e.user_email),e.login_method&&S("username_password"==e.login_method),e.premium_user&&l(e.premium_user),e.auth_header_name&&(0,g.setGlobalLitellmHeaderName)(e.auth_header_name),e.user_id&&F(e.user_id)}},[E]),(0,d.useEffect)(()=>{z&&D&&e&&eK(D,e,z,N),z&&D&&e&&j(z,D,e,null,x),z&&lb(z,y)},[z,D,e]),O||B)?(0,c.jsx)(nI,{}):(0,c.jsx)(d.Suspense,{fallback:(0,c.jsx)(nI,{}),children:(0,c.jsx)(h.aH,{client:nC,children:R?(0,c.jsx)(sT,{userID:D,userRole:e,premiumUser:t,teams:o,keys:f,setUserRole:s,userEmail:i,setUserEmail:n,setTeams:x,setKeys:v,organizations:_,addKey:K,createClicked:T}):(0,c.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,c.jsx)(p.Z,{userID:D,userRole:e,premiumUser:t,userEmail:i,setProxySettings:w,proxySettings:Z,accessToken:z,isPublicPage:!1}),(0,c.jsxs)("div",{className:"flex flex-1 overflow-auto",children:[(0,c.jsx)("div",{className:"mt-8",children:(0,c.jsx)(rC,{accessToken:z,setPage:e=>{let s=new URLSearchParams(C);s.set("page",e),window.history.pushState(null,"","?".concat(s.toString())),U(e)},userRole:e,defaultSelectedKey:q})}),"api-keys"==q?(0,c.jsx)(sT,{userID:D,userRole:e,premiumUser:t,teams:o,keys:f,setUserRole:s,userEmail:i,setUserEmail:n,setTeams:x,setKeys:v,organizations:_,addKey:K,createClicked:T}):"models"==q?(0,c.jsx)(ls,{userID:D,userRole:e,token:E,keys:f,accessToken:z,modelData:I,setModelData:P,premiumUser:t,teams:o}):"llm-playground"==q?(0,c.jsx)(rn,{userID:D,userRole:e,token:E,accessToken:z,disabledPersonalKeyCreation:a}):"users"==q?(0,c.jsx)(lg,{userID:D,userRole:e,token:E,keys:f,teams:o,accessToken:z,setKeys:v}):"teams"==q?(0,c.jsx)(l_,{teams:o,setTeams:x,searchParams:C,accessToken:z,userID:D,userRole:e,organizations:_,premiumUser:t}):"organizations"==q?(0,c.jsx)(lN,{organizations:_,setOrganizations:y,userModels:b,accessToken:z,userRole:e,premiumUser:t}):"admin-panel"==q?(0,c.jsx)(lM,{setTeams:x,searchParams:C,accessToken:z,userID:D,showSSOBanner:k,premiumUser:t,proxySettings:Z}):"api_ref"==q?(0,c.jsx)(aO,{proxySettings:Z}):"settings"==q?(0,c.jsx)(lG,{userID:D,userRole:e,accessToken:z,premiumUser:t}):"budgets"==q?(0,c.jsx)(l6,{accessToken:z}):"guardrails"==q?(0,c.jsx)(ib,{accessToken:z,userRole:e}):"transform-request"==q?(0,c.jsx)(iN,{accessToken:z}):"general-settings"==q?(0,c.jsx)(l1,{userID:D,userRole:e,accessToken:z,modelData:I}):"model-hub-table"==q?(0,c.jsx)(af.Z,{accessToken:z,publicPage:!1,premiumUser:t,userRole:e}):"caching"==q?(0,c.jsx)(rq,{userID:D,userRole:e,token:E,accessToken:z,premiumUser:t}):"pass-through-settings"==q?(0,c.jsx)(t9,{userID:D,userRole:e,accessToken:z,modelData:I}):"logs"==q?(0,c.jsx)(ag,{userID:D,userRole:e,token:E,accessToken:z,allTeams:null!=o?o:[],premiumUser:t}):"mcp-servers"==q?(0,c.jsx)(i8,{accessToken:z,userRole:e,userID:D}):"tag-management"==q?(0,c.jsx)(nn,{accessToken:z,userRole:e,userID:D}):"vector-stores"==q?(0,c.jsx)(ny,{accessToken:z,userRole:e,userID:D}):"new_usage"==q?(0,c.jsx)(aL,{userID:D,userRole:e,accessToken:z,teams:null!=o?o:[],premiumUser:t}):(0,c.jsx)(rE,{userID:D,userRole:e,token:E,accessToken:z,keys:f,premiumUser:t})]})]})})})}}},function(e){e.O(0,[665,990,445,152,634,475,199,338,162,172,971,117,744],function(){return e(e.s=1900)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/_next/static/chunks/main-app-475d6efe4080647d.js b/ui/litellm-dashboard/out/_next/static/chunks/main-app-4f7318ae681a6d94.jssimilarity index 54%rename from ui/litellm-dashboard/out/_next/static/chunks/main-app-475d6efe4080647d.jsrename to ui/litellm-dashboard/out/_next/static/chunks/main-app-4f7318ae681a6d94.jsindex 47508fc7a01..04cf9b11058 100644--- a/ui/litellm-dashboard/out/_next/static/chunks/main-app-475d6efe4080647d.js+++ b/ui/litellm-dashboard/out/_next/static/chunks/main-app-4f7318ae681a6d94.js@@ -1 +1 @@-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{20169:function(e,n,t){Promise.resolve().then(t.t.bind(t,12846,23)),Promise.resolve().then(t.t.bind(t,19107,23)),Promise.resolve().then(t.t.bind(t,61060,23)),Promise.resolve().then(t.t.bind(t,4707,23)),Promise.resolve().then(t.t.bind(t,80,23)),Promise.resolve().then(t.t.bind(t,36423,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,117],function(){return n(54278),n(20169)}),_N_E=e.O()}]);\ No newline at end of file+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{10264:function(e,n,t){Promise.resolve().then(t.t.bind(t,12846,23)),Promise.resolve().then(t.t.bind(t,19107,23)),Promise.resolve().then(t.t.bind(t,61060,23)),Promise.resolve().then(t.t.bind(t,4707,23)),Promise.resolve().then(t.t.bind(t,80,23)),Promise.resolve().then(t.t.bind(t,36423,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,117],function(){return n(54278),n(10264)}),_N_E=e.O()}]);\ No newline at end of filediff --git a/ui/litellm-dashboard/out/index.html b/ui/litellm-dashboard/out/index.htmlindex be86f2e9933..2cf3668e29b 100644--- a/ui/litellm-dashboard/out/index.html+++ b/ui/litellm-dashboard/out/index.html@@ -1 +1 @@-<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-475d6efe4080647d.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[45976,[\"665\",\"static/chunks/3014691f-b7b79b78e27792f3.js\",\"990\",\"static/chunks/13b76428-ebdf3012af0e4489.js\",\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"475\",\"static/chunks/475-4e66b9c01db4c006.js\",\"199\",\"static/chunks/199-9064d94cb58e5474.js\",\"338\",\"static/chunks/338-58247f2bc5fc3b51.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"172\",\"static/chunks/172-b2d8ff2740510f56.js\",\"931\",\"static/chunks/app/page-f64fe7b1998a3ca8.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-NrHJ0b9HqrHBQ9wRZS8v\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of file+<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-4f7318ae681a6d94.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[58193,[\"665\",\"static/chunks/3014691f-b7b79b78e27792f3.js\",\"990\",\"static/chunks/13b76428-ebdf3012af0e4489.js\",\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"475\",\"static/chunks/475-4e66b9c01db4c006.js\",\"199\",\"static/chunks/199-7d06fdac37bed3ff.js\",\"338\",\"static/chunks/338-5db4fbaf3c5da53d.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"172\",\"static/chunks/172-b2d8ff2740510f56.js\",\"931\",\"static/chunks/app/page-ae1e298d739b09ba.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-EIomgntDHk-HrU9rbKNY\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of filediff --git a/ui/litellm-dashboard/out/index.txt b/ui/litellm-dashboard/out/index.txtindex 004e44084ba..3f5f9cb0682 100644--- a/ui/litellm-dashboard/out/index.txt+++ b/ui/litellm-dashboard/out/index.txt@@ -1,7 +1,7 @@2:I[19107,[],"ClientPageRoot"]-3:I[45976,["665","static/chunks/3014691f-b7b79b78e27792f3.js","990","static/chunks/13b76428-ebdf3012af0e4489.js","445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","634","static/chunks/634-74ee1cee62277068.js","475","static/chunks/475-4e66b9c01db4c006.js","199","static/chunks/199-9064d94cb58e5474.js","338","static/chunks/338-58247f2bc5fc3b51.js","162","static/chunks/162-e1f42f86a1eb3286.js","172","static/chunks/172-b2d8ff2740510f56.js","931","static/chunks/app/page-f64fe7b1998a3ca8.js"],"default",1]+3:I[58193,["665","static/chunks/3014691f-b7b79b78e27792f3.js","990","static/chunks/13b76428-ebdf3012af0e4489.js","445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","634","static/chunks/634-74ee1cee62277068.js","475","static/chunks/475-4e66b9c01db4c006.js","199","static/chunks/199-7d06fdac37bed3ff.js","338","static/chunks/338-5db4fbaf3c5da53d.js","162","static/chunks/162-e1f42f86a1eb3286.js","172","static/chunks/172-b2d8ff2740510f56.js","931","static/chunks/app/page-ae1e298d739b09ba.js"],"default",1]4:I[4707,[],""]5:I[36423,[],""]-0:["-NrHJ0b9HqrHBQ9wRZS8v",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]+0:["-EIomgntDHk-HrU9rbKNY",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]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":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]]1:nulldiff --git a/ui/litellm-dashboard/out/model_hub.html b/ui/litellm-dashboard/out/model_hub.htmlindex 91d6c7c8531..c3d79190d5d 100644--- a/ui/litellm-dashboard/out/model_hub.html+++ b/ui/litellm-dashboard/out/model_hub.html@@ -1 +1 @@-<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-475d6efe4080647d.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[52829,[\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"338\",\"static/chunks/338-58247f2bc5fc3b51.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"418\",\"static/chunks/app/model_hub/page-43595a95e1b23546.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-NrHJ0b9HqrHBQ9wRZS8v\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"model_hub\"],\"initialTree\":[\"\",{\"children\":[\"model_hub\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"model_hub\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"model_hub\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of file+<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-4f7318ae681a6d94.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[52829,[\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"338\",\"static/chunks/338-5db4fbaf3c5da53d.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"418\",\"static/chunks/app/model_hub/page-1808d9da6d48b76d.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-EIomgntDHk-HrU9rbKNY\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"model_hub\"],\"initialTree\":[\"\",{\"children\":[\"model_hub\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"model_hub\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"model_hub\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of filediff --git a/ui/litellm-dashboard/out/model_hub.txt b/ui/litellm-dashboard/out/model_hub.txtindex 835cab5bb8d..7c87a5ebc0c 100644--- a/ui/litellm-dashboard/out/model_hub.txt+++ b/ui/litellm-dashboard/out/model_hub.txt@@ -1,7 +1,7 @@2:I[19107,[],"ClientPageRoot"]-3:I[52829,["445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","338","static/chunks/338-58247f2bc5fc3b51.js","162","static/chunks/162-e1f42f86a1eb3286.js","418","static/chunks/app/model_hub/page-43595a95e1b23546.js"],"default",1]+3:I[52829,["445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","338","static/chunks/338-5db4fbaf3c5da53d.js","162","static/chunks/162-e1f42f86a1eb3286.js","418","static/chunks/app/model_hub/page-1808d9da6d48b76d.js"],"default",1]4:I[4707,[],""]5:I[36423,[],""]-0:["-NrHJ0b9HqrHBQ9wRZS8v",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]+0:["-EIomgntDHk-HrU9rbKNY",[[["",{"children":["model_hub",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]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":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]]1:nulldiff --git a/ui/litellm-dashboard/out/model_hub_table.html b/ui/litellm-dashboard/out/model_hub_table.htmlindex 155cf9b802a..8952f372168 100644--- a/ui/litellm-dashboard/out/model_hub_table.html+++ b/ui/litellm-dashboard/out/model_hub_table.html@@ -1 +1 @@-<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-475d6efe4080647d.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[22775,[\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"475\",\"static/chunks/475-4e66b9c01db4c006.js\",\"338\",\"static/chunks/338-58247f2bc5fc3b51.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"172\",\"static/chunks/172-b2d8ff2740510f56.js\",\"25\",\"static/chunks/app/model_hub_table/page-f3fc1d21cad686db.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-NrHJ0b9HqrHBQ9wRZS8v\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"model_hub_table\"],\"initialTree\":[\"\",{\"children\":[\"model_hub_table\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"model_hub_table\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"model_hub_table\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of file+<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-4f7318ae681a6d94.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[22775,[\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"152\",\"static/chunks/152-c78d9bb44a92a615.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"475\",\"static/chunks/475-4e66b9c01db4c006.js\",\"338\",\"static/chunks/338-5db4fbaf3c5da53d.js\",\"162\",\"static/chunks/162-e1f42f86a1eb3286.js\",\"172\",\"static/chunks/172-b2d8ff2740510f56.js\",\"25\",\"static/chunks/app/model_hub_table/page-6750ac8910a46248.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-EIomgntDHk-HrU9rbKNY\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"model_hub_table\"],\"initialTree\":[\"\",{\"children\":[\"model_hub_table\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"model_hub_table\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"model_hub_table\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of filediff --git a/ui/litellm-dashboard/out/model_hub_table.txt b/ui/litellm-dashboard/out/model_hub_table.txtindex b14881aa5cf..6172d3f0ed3 100644--- a/ui/litellm-dashboard/out/model_hub_table.txt+++ b/ui/litellm-dashboard/out/model_hub_table.txt@@ -1,7 +1,7 @@2:I[19107,[],"ClientPageRoot"]-3:I[22775,["445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","634","static/chunks/634-74ee1cee62277068.js","475","static/chunks/475-4e66b9c01db4c006.js","338","static/chunks/338-58247f2bc5fc3b51.js","162","static/chunks/162-e1f42f86a1eb3286.js","172","static/chunks/172-b2d8ff2740510f56.js","25","static/chunks/app/model_hub_table/page-f3fc1d21cad686db.js"],"default",1]+3:I[22775,["445","static/chunks/445-e14a4d059f7305d5.js","152","static/chunks/152-c78d9bb44a92a615.js","634","static/chunks/634-74ee1cee62277068.js","475","static/chunks/475-4e66b9c01db4c006.js","338","static/chunks/338-5db4fbaf3c5da53d.js","162","static/chunks/162-e1f42f86a1eb3286.js","172","static/chunks/172-b2d8ff2740510f56.js","25","static/chunks/app/model_hub_table/page-6750ac8910a46248.js"],"default",1]4:I[4707,[],""]5:I[36423,[],""]-0:["-NrHJ0b9HqrHBQ9wRZS8v",[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub_table",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub_table","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]+0:["-EIomgntDHk-HrU9rbKNY",[[["",{"children":["model_hub_table",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["model_hub_table",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","model_hub_table","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]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":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]]1:nulldiff --git a/ui/litellm-dashboard/out/onboarding.html b/ui/litellm-dashboard/out/onboarding.htmlindex 8a3400b40a7..07c1b7153ef 100644--- a/ui/litellm-dashboard/out/onboarding.html+++ b/ui/litellm-dashboard/out/onboarding.html@@ -1 +1 @@-<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-475d6efe4080647d.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[12011,[\"665\",\"static/chunks/3014691f-b7b79b78e27792f3.js\",\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"338\",\"static/chunks/338-58247f2bc5fc3b51.js\",\"461\",\"static/chunks/app/onboarding/page-73a77fc5d4952c09.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-NrHJ0b9HqrHBQ9wRZS8v\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"onboarding\"],\"initialTree\":[\"\",{\"children\":[\"onboarding\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"onboarding\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"onboarding\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of file+<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-4f7318ae681a6d94.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[12011,[\"665\",\"static/chunks/3014691f-b7b79b78e27792f3.js\",\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"338\",\"static/chunks/338-5db4fbaf3c5da53d.js\",\"461\",\"static/chunks/app/onboarding/page-acdf578c06ba6714.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"-EIomgntDHk-HrU9rbKNY\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"onboarding\"],\"initialTree\":[\"\",{\"children\":[\"onboarding\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"onboarding\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"onboarding\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",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\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"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\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of filediff --git a/ui/litellm-dashboard/out/onboarding.txt b/ui/litellm-dashboard/out/onboarding.txtindex 033c7f018fd..4130dd53426 100644--- a/ui/litellm-dashboard/out/onboarding.txt+++ b/ui/litellm-dashboard/out/onboarding.txt@@ -1,7 +1,7 @@2:I[19107,[],"ClientPageRoot"]-3:I[12011,["665","static/chunks/3014691f-b7b79b78e27792f3.js","445","static/chunks/445-e14a4d059f7305d5.js","634","static/chunks/634-74ee1cee62277068.js","338","static/chunks/338-58247f2bc5fc3b51.js","461","static/chunks/app/onboarding/page-73a77fc5d4952c09.js"],"default",1]+3:I[12011,["665","static/chunks/3014691f-b7b79b78e27792f3.js","445","static/chunks/445-e14a4d059f7305d5.js","634","static/chunks/634-74ee1cee62277068.js","338","static/chunks/338-5db4fbaf3c5da53d.js","461","static/chunks/app/onboarding/page-acdf578c06ba6714.js"],"default",1]4:I[4707,[],""]5:I[36423,[],""]-0:["-NrHJ0b9HqrHBQ9wRZS8v",[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["onboarding",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","onboarding","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]+0:["-EIomgntDHk-HrU9rbKNY",[[["",{"children":["onboarding",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["onboarding",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","onboarding","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css","precedence":"next","crossOrigin":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/litellm-asset-prefix/_next/static/css/dd3d607f47531000.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_b0dd8a","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]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":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","link","5",{"rel":"icon","href":"./favicon.ico"}],["$","meta","6",{"name":"next-size-adjust"}]]1:nulldiff --git a/ui/litellm-dashboard/src/components/create_user_button.tsx b/ui/litellm-dashboard/src/components/create_user_button.tsxindex 3edfe93a076..fe706abab79 100644--- a/ui/litellm-dashboard/src/components/create_user_button.tsx+++ b/ui/litellm-dashboard/src/components/create_user_button.tsx@@ -27,6 +27,19 @@ import { InfoCircleOutlined } from "@ant-design/icons"import { getModelDisplayName } from "./key_team_helpers/fetch_available_models_team_key"import { useQueryClient } from "@tanstack/react-query"+// Helper function to generate UUID compatible across all environments+const generateUUID = (): string => {+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {+ return crypto.randomUUID()+ }+ // Fallback UUID generation for environments without crypto.randomUUID+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {+ const r = Math.random() * 16 | 0+ const v = c == 'x' ? r : (r & 0x3 | 0x8)+ return v.toString(16)+ })+}+interface CreateuserProps {userID: stringaccessToken: string@@ -141,7 +154,7 @@ const Createuser: React.FC<CreateuserProps> = ({// create an InvitationLink Object for this user for the SSO flow// for SSO the invite link is the proxy base url since the User just needs to loginconst invitationLink: InvitationLink = {- id: crypto.randomUUID(), // Generate a unique ID+ id: generateUUID(), // Generate a unique IDuser_id: user_id,is_accepted: false,accepted_at: null,